Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Utility function to generate the html label for a userPref based on if it is required or not
function generatePrefLabelMarkup(userPref) { var markup = []; var prefLabel = (userPref.required) ? "* " + userPref.displayName : userPref.displayName; markup.push("<td class='"); markup.push(WIDGET_PREFS_LABEL_CLASS); if (userPref.required) { markup.push(" "); markup.push(WIDGET_PREFS_LABEL_REQUIRED_CLASS); } markup.push("'>"); markup.push(prefLabel); markup.push("</td>"); return markup.join(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePrefInputClassMarkup(userPref) {\n var markup = [];\n markup.push(WIDGET_PREFS_INPUT_CLASS);\n if (userPref.required) {\n markup.push(\" \");\n markup.push(WIDGET_PREFS_INPUT_REQUIRED_CLASS);\n }\n return markup.join(\"\");\n }", "function checkLabel(name, value) {\n let input = doc.querySelector(`.shortcut-input[name=\"${name}\"]`);\n let label = input.previousElementSibling;\n if (label.dataset.l10nId) {\n is(label.dataset.l10nId, value, \"The l10n-id is set\");\n } else {\n is(label.textContent, value, \"The textContent is set\");\n }\n }", "function SP_RequiredLabelToggle(labelId,setRequired)\n{\n\tif(arguments.length > 2)\n\t{\n\t\tvar label = $('label[for='+labelId+']');\n\t\tif(setRequired == true)\n\t\t{\n\t\t\tif(label.text().indexOf(\"*\") == -1)\n\t\t\t{\n\t\t\t\tlabel.text(\"* \"+ label.text());\n\t\t\t\tlabel.addClass(\"dynamicRequiredLabel\");\n\t\t\t}\n\t\t}\n\t\telse if(setRequired == false)\n\t\t{\n\t\t\tif(label.text().indexOf(\"*\") == 0)\n\t\t\t{\n\t\t\t\tlabel.text(label.text().split(\"*\")[1]);\n\t\t\t\tlabel.removeClass(\"dynamicRequiredLabel\");\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tif(setRequired == true && SP_HasClass(document.getElementById(labelId),'dynamicLabel'))\n\t\t{\n\t\t\tdocument.getElementById(labelId).innerHTML = \"* \"+document.getElementById(labelId).innerHTML;\n\t\t\tSP_RemoveClass(document.getElementById(labelId),\"dynamicLabel\");\n\t\t\tSP_AddClass(document.getElementById(labelId),\"dynamicRequiredLabel\");\n\t\t}\n\t\telse if(setRequired == false && SP_HasClass(document.getElementById(labelId),'dynamicRequiredLabel'))\n\t\t{\n\t\t\tdocument.getElementById(labelId).innerHTML = document.getElementById(labelId).innerHTML.slice(1);\n\t\t\tSP_AddClass(document.getElementById(labelId),\"dynamicLabel\");\n\t\t\tSP_RemoveClass(document.getElementById(labelId),\"dynamicRequiredLabel\");\n\t\t}\n\t}\n}", "function tabLabelUpdateHTML() {\n var profileStore = retrieveProfileInfo();\n var userStyle = profileStore.style;\n var userVenue = profileStore.venue;\n if (userVenue === \"Indoor\") {\n $(\"#routes-tab\").text(\"GYMS\");\n } else if (userStyle === \"Boulder\") {\n $(\"#routes-tab\").text(\"PROBLEMS\");\n }\n}", "function FieldLabel({ model }) {\n const { label, isMandatory } = model;\n\n if (!label || label.length === 0) {\n return null;\n }\n return (\n <div className=\"ff-field-label\" >\n {label}\n {(isMandatory) && (\n <span className=\"ff-field-mandatory\">*</span>\n )}\n </div>\n );\n}", "getFormLabelContent() {\n\t\tif (this.props.textDictionary.labelText && this.props.textDictionary.labelText.length !== 0) {\n\t\t\treturn (\n\t\t\t\t<label className={ClassNameUtil.getClassNames(['fbra_passwordFormInput_label', 'fbra_test_passwordFormInput_label'])}>{this.props.textDictionary.labelText}</label>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}", "static get LABEL_NONE () {return 'none';}", "label (valueName, postValue, postLabel) {\n let value = ''\n\n try {\n value = this.tags[valueName]\n } catch (error) {\n\n }\n\n if (!value) { return '' }\n // look for any overrides or improvements and apply them if found\n let dataImprovement = dataImprover[valueName]\n let prettyLabel, prettyValue\n // let improverType = typeof (dataImprovement)\n switch (typeof (dataImprovement)) {\n case 'string':\n prettyLabel = dataImprovement\n prettyValue = value\n break\n case 'object':\n prettyLabel = dataImprovement.label\n prettyValue = dataImprovement.value(value)\n break\n default:\n prettyLabel = titleCase(valueName.replace(/[:|-|_]/gi, ' '))\n prettyValue = value\n }\n\n // console.log(prettyLabel,prettyValue);\n let ret =\n ((prettyLabel) ? `<strong>${prettyLabel}:</strong>&nbsp;` + (postLabel || '') : '') +\n prettyValue +\n ((postValue) || '')\n\n return ret\n }", "static splash_screen_tutorial_options_html(){\n let result = \"\"\n let labels = persistent_get(\"splash_screen_tutorial_labels\") //might have checkmarks in them.\n for(let name_and_tooltip of this.splash_screen_tutorial_names_and_tooltips){\n let name = name_and_tooltip[0]\n let label = null\n for(let a_label of labels) {\n if(a_label.endsWith(name)){\n label = a_label //might have a checkmark\n break;\n }\n }\n if(!label) { label = \"&nbsp;&nbsp;&nbsp;\" + name } //default is no checkmark\n result += \"<option class='splash_screen_item' \" +\n \"title='\" + name_and_tooltip[1] +\n \"' style='cursor:pointer;'>\" +\n label + \"</option>\\n\"\n }\n return result\n }", "function getResourceLabel(type, input) {\n switch (type) {\n case \"hasAuthor\": return (input + \" is an author of the document\");\n case \"hasPublicationYear\": return (\"The document was published in \" + input);\n case \"hasTitle\": return (\"The document's title is \" + input);\n case \"hasDOI\": return (\"The document's DOI is \" + input);\n case \"hasURL\": return (\"The document's URL is \" + input);\n case \"hasComment\": return (\"This is the fragment comment: \" + input);\n case \"denotesRhetoric\": return (\"This fragment has got a rhetorical function\"); // da sistemare\n case \"cites\": return (\"This document cites \" + input + \".\")\n default: {\n console.log(\"Something goes wrong with getResourceLabel()\");\n return error;\n }\n }\n}", "function createLabel(labelValue) {\n let generalLabel = document.createElement('label')\n if (labelValue) {\n generalLabel.innerHTML = 'So early to Heaven? huh!'\n } else {\n generalLabel.setAttribute('value', ' ')\n }\n return generalLabel\n}", "function badgeTooltipText() {\r\n var tooltip = \"Disable QuietAds on Twitch\";\r\n if (currSite == \"twitch\" && enabled == 1) tooltip = \"Disable QuietAds on Twitch\";\r\n if (currSite == \"twitch\" && enabled == 0) tooltip = \"Enable QuietAds on Twitch\";\r\n if (currSite == \"youtube\" && enabled == 1) tooltip = \"Disable QuietAds on Youtube\";\r\n if (currSite == \"youtube\" && enabled == 0) tooltip = \"Enable QuietAds on Youtube\";\r\n return tooltip;\r\n}", "_getAriaLabel(title) {\n return !title ? \"Modal Dialog\" : null;\n }", "function getLabel( key, required ) {\n return getLabelByName( getLabelName(key, required) );\n}", "get label() {\n if (this.isObject(this.options)) {\n return this.options.label;\n }\n else {\n return '';\n }\n }", "function fieldLabel(field) { return [field, \"Label\"].join(\"\"); }", "function getLabelValue(option) {\n\n //Non object? Use its value\n if (!angular.isObject(option)) {\n return option;\n }\n\n //Must have label property\n if (!labelBy) {\n $log.warn('Missing label-by property for check boxes');\n return '';\n }\n\n //Validate property\n if (typeof option[labelBy] === 'undefined') {\n $log.warn('Unknown property `' + labelBy + '` for check box label');\n return '';\n }\n\n //Return the property\n return option[labelBy];\n }", "yes() {\n if (this.user.state.locale !== 'en') return ' (Yes)';\n return '';\n }", "function toggleLabel() {\n var input = $(this);\n setTimeout(function() {\n var def = input.attr('title');\n if (!input.val() || (input.val() == def)) {\n input.prev('span').css('visibility', '');\n if (def) {\n var dummy = $('<label></label>').text(def).css('visibility','hidden').appendTo('body');\n input.prev('span').css('margin-left', dummy.width() + 3 + 'px');\n dummy.remove();\n }\n } else {\n input.prev('span').css('visibility', 'hidden');\n }\n }, 0);\n }", "get promptLabel() {\n\t\treturn this.nativeElement ? this.nativeElement.promptLabel : undefined;\n\t}", "function removelabelAddlabelToUsers(executionContext) {\n var formContext = executionContext.getFormContext();\n var XrmuserSettings = Xrm.Utility.getGlobalContext().userSettings;\n var userName = XrmuserSettings.userName;\n var userid = XrmuserSettings.userId;\n var usersecurityrolename = XrmuserSettings.securityRole;\n alert(\"logged in user id is:\" + userid + \"logged username:\" + userName);\n alert(\"usersecurityrolename::\" + usersecurityrolename);\n if (userName == \"Mimmy Sree\") {\n formContext.getControl(\"new_studentqualification\").removeOption(1);\n }\n if (userName == \"Srini karra\") {\n formContext.getControl(\"new_studentqualification\").addOption({ value: 1, text: 'MCA' });\n\n }\n\n}", "static labelOf(t) {\n const label= !t.desc ? Filters.titlecase(t.name.replace(/[-_]/g, ' ')) /* friendlyish name */ :\n (typeof t.desc === 'string') ? t.desc :\n t.desc.label;\n return label;\n }", "function createFormInput(pref, prefName, text){\r\n var elm = document.createElement('input');\r\n elm.className = \"lc_preferencesInput\";\r\n elm.name = prefName;\r\n switch(typeof pref){\r\n case \"string\":\r\n case \"number\":\r\n elm.value = pref;\r\n if(arguments[3]) elm.size = arguments[3];\r\n break;\r\n case \"boolean\":\r\n elm.type = \"checkbox\";\r\n elm.checked = pref;\r\n break;\r\n case \"object\":\r\n elm.type = \"radio\"; // pref = [\"pref value\", true]\r\n elm.value = pref[0]; // preference value\r\n elm.checked = pref[1]; // true or false\r\n }\r\n preferencesForm.appendChild(document.createElement('label')).appendChild(elm);\r\n elm.parentNode.insertBefore(document.createTextNode(text), elm);\r\n }", "function appendLabel(view,label,descriptor){\n const text = document.createElement('div');\n text.setAttribute('class','signInLabel');\n text.textContent = label;\n view.appendChild(text);\n const input = document.createElement('input');\n input.setAttribute('class','signIn');\n view.appendChild(input);\n input.setAttribute('id',label+' '+descriptor+' input');\n\n switch (label){\n case 'email address':\n input.type = 'email';\n break;\n case 'password':\n input.type = 'password';\n break;\n case 'confirm password':\n input.type = 'password';\n break;\n }\n\n return input;\n}", "getAccountTypesLabel(accountTypes) {\n const { isFarmer, isDistributor, isRetailer, isConsumer } = accountTypes;\n return isFarmer\n ? \"Farmer\"\n : isDistributor\n ? \"Distributor\"\n : isRetailer\n ? \"Retailer\"\n : isConsumer\n ? \"Consumer\"\n : \"\";\n }", "function textSet() {\n getMatchName();\n\n if (!partnerReady()) {\n document.getElementById('partnerLbl').innerText = \"You must complete your profile to continue (and be sure to click \\\"Update\\\").\";\n document.getElementById('profileLbl').innerText = \"There are uncategorized names in this group.\";\n document.getElementById('profileLbl').className = \"error\";\n document.getElementById('profileLbl').style.display = \"block\";\n }\n else {\n document.getElementById('partnerLbl').innerText = \"\";\n document.getElementById('profileLbl').innerText = \"\";\n document.getElementById('profileLbl').style.display = \"none\";\n }\n\n document.getElementById('PartnerPick').disabled = document.getElementById(\"partnerName\").value == \"\" ? false : true;\n}", "function createOptionLabel(Text,URL){\n if ( URL && !isAllWhite(URL) )\n return ( Text + \" (\" + URL + \")\" );\n else\n return Text ;\n}", "renderUserLabel() {\n if(this.props.isLoggedIn) {\n return \"Welcome, \" + this.state.cUsername;\n }\n return \"Hello, Guest\";\n }", "getVatFieldLabel() {\n const vatLabel = get(\n COUNTRIES_VAT_LABEL,\n this.signUpFormCtrl.model.country.toUpperCase(),\n );\n\n if (vatLabel) {\n return this.$filter('translateDefault')(\n `sign_up_activity_field_vat_${this.signUpFormCtrl.model.legalform}_more`,\n 'sign_up_activity_field_vat_more',\n { vatLabel },\n undefined,\n false,\n 'escapeParameters',\n );\n }\n return this.$filter('translateDefault')(\n `sign_up_activity_field_vat_${this.signUpFormCtrl.model.legalform}`,\n `sign_up_activity_field_vat`,\n { vatLabel },\n undefined,\n false,\n 'escapeParameters',\n );\n }", "function MUA_headertext(mode) {\n let header_text = (mode === \"update\") ? loc.User + \": \" + mod_MUA_dict.username : loc.Add_user;\n if(mod_MUA_dict.user_schoolbase_pk){ header_text = loc.Add_user_to + mod_MUA_dict.user_schoolname;}\n document.getElementById(\"id_MUA_header\").innerText = header_text;\n } // MUA_headertext", "nameLabel() {\n if (this.state.senatorOneName !== '') {\n return <h3 className=\"senator-name\">Your Senators: {this.state.senatorOneName} and {this.state.senatorTwoName} </h3>;\n }\n }", "function formatLabels( nLabelColumnWidth )\n{\n makeFieldLabels( $( '.form-control,.list-unstyled', '#editUserForm' ) );\n\n // Set up display of password/confirm fields\n if ( g_sUsername == JSON.parse( localStorage.getItem( 'panelSpy.session' ) )['user']['username'] )\n {\n $( '#oldPassword' ).closest( '.form-group' ).show();\n g_sFocusId = 'oldPassword';\n }\n else\n {\n $( '#oldPassword' ).closest( '.form-group' ).hide();\n\n if ( g_sAction == 'update' )\n {\n g_sFocusId = 'password';\n }\n else\n {\n g_sFocusId = 'username';\n }\n }\n\n var sNew = ( g_sAction == 'update' ) ? 'New ' : '';\n var sPassword = sNew + 'Password';\n var sConfirm = 'Confirm ' + sPassword;\n\n $( 'label[for=password]' ).text( sPassword );\n $( '#password' ).attr( 'placeholder', sPassword );\n $( 'label[for=confirm]' ).text( sConfirm );\n $( '#confirm' ).attr( 'placeholder', sConfirm );\n\n // Turn off autocomplete\n $( 'input', '#editUserForm' ).attr( 'autocomplete', 'off' );\n\n // Customize responsive layout\n $( '.form-group>label' ).removeClass().addClass( 'control-label' ).addClass( 'col-sm-' + nLabelColumnWidth );\n $( '.form-control,.fakeFormControl', '#editUserForm' ).parent().removeClass().addClass( 'col-sm-' + ( 12 - nLabelColumnWidth ) );\n}", "function setSetupLabel() {\r\n\r\n\tif ((gameSettingsFilter[0] && gameSettingsFilter[1]) | (!gameSettingsFilter[0] && !gameSettingsFilter[1])) {\r\n\t\t(gameSettingsFilter[0] && gameSettingsFilter[1]) ? (setupLabel.innerHTML = SetupHTML + AllHTML, setupFilterIs = 'All') : null;\r\n\t\t(!gameSettingsFilter[0] && !gameSettingsFilter[1]) ? (setupLabel.innerHTML = SetupHTML + PleaseChooseHTML, setupFilterIs = 'None') : null;\r\n\t}\r\n\t\r\n\telse {\r\n\t\t(gameSettingsFilter[0]) ? (setupLabel.innerHTML = SetupHTML + setupDefaultImageHTML, setupFilterIs = 'D') : (setupLabel.innerHTML = SetupHTML + setupCustomImageHTML, setupFilterIs = 'C');\r\n\t}\r\n}", "function create_form_text_holder(name,place_holder)\n{\n let shown_name ;\n\n if(name != 'Des questions ou commentaires?')\n {\n shown_name = name + \"<mand style='color: red; display: inline-block;'> * </mand>\";\n }\n else\n {\n shown_name = name;\n }\n\n if (typeof place_holder === 'undefined') \n {\n place_holder = name; \n }\n\n \n return `<div class=\"input_container\">\n <label for=\"${name.toLowerCase()}\"><b> ${shown_name} : </b></label>\n <br>\n <input id=\"input_${name.toLowerCase()}\" class=\"data\" type=\"text\" name=\"${name.toLowerCase()}\" placeholder=\"${place_holder}\">\n <span class=\"focus-input\" data-placeholder=\"${name.toUpperCase()}\"></span>\n </div>`;\n}", "function populate_description_of_materials_required_fn(){\n\tif( $(\"input#populate_description_of_materials_required_no\").is(\":checked\") || $(\"input#populate_description_of_materials_required_some\").is(\":checked\") ){\n\t\t$(\"div#populate_description_of_materials_required\").html(\"\" +\n\t\t\" <fieldset class='form-group'> \" +\n\t\t\t\" <label for='description_of_materials_required'> \" +\n\t\t\t\t\" Add a description to the equipment required to do the job: \" +\n\t\t\t\" </label> \" +\n\t\t\t\" <textarea name='description_of_materials_required' id='description_of_materials_required' class='form-control' rows='3' placeholder='Ex: If a truck is required, lawn mower, whipper snipper, cleaning supplies, ladder, etc.' id=''></textarea> \" +\n\t\t\" </fieldset><br> \" );\n\t}\n\telse if( $(\"input#populate_description_of_materials_required_yes\").is(\":checked\") ){\n\t\t$(\"div#populate_description_of_materials_required\").html(\" \");\n\t}\n}", "function _lprAdminQuestionHTML($dom, type) {\r\n\tswitch (type) {\r\n\t\tcase 'true_or_false':\r\n\t\t\t$dom.lprTrueOrFalseQuestion();\r\n\t\t\tbreak;\r\n\t\tcase 'multi_choice':\r\n\t\t\t$dom.lprMultiChoiceQuestion();\r\n\t\t\tbreak;\r\n\t\tcase 'single_choice':\r\n\t\t\t$dom.lprSingleChoiceQuestion();\r\n\t\t\tbreak;\r\n\t}\r\n}", "get completeLabel() {\n\t\treturn this.nativeElement ? this.nativeElement.completeLabel : undefined;\n\t}", "function fillLabel(opt) {\n Object(util_model[\"f\" /* defaultEmphasis */])(opt, 'label', ['show']);\n} // { [componentType]: MarkerModel }", "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1>\" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.adm1_code + \"_label\")\n .html(labelAttribute)\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html((props.NAME_1 + \" Region\").bold());\n }", "static handle_checking_of_tutorial(the_tut_label, the_tut_name, the_option_elt){\n let is_already_checked = the_tut_label.startsWith(SplashScreen.the_checkmark_char)\n if(!is_already_checked){\n the_option_elt.innerHTML = \"&check;\" + the_tut_name //check it\n let all_options = []\n for(let an_option_elt of splash_screen_which_tutorial_id.children){\n let text = an_option_elt.innerHTML\n all_options.push(text)\n }\n persistent_set(\"splash_screen_tutorial_labels\", all_options)\n }\n }", "function getTitle(value) {\n\tvar formalized = \"\";\n\tswitch (value) {\n\t\tcase 'major_advisor': formalized = \"Major Advisor\"; break;\n\t\tcase 'co_advisor': formalized = \"Co-Major Advisor\"; break;\n\t\tcase 'minor_advisor': formalized = \"Minor Advisor\"; break;\n\t\tcase 'gcr': formalized = \"GCR\"; break;\n\t\tcase 'committee': \n\t\tdefault: formalized = \"Committee\";\n\t}\n\t\n\treturn formalized;\n}", "function AutoGenerateTitle() {\r\n\tif (vLoading) return;\r\n\tvar Title = \"\";\r\n\r\n\tif ($(\"#ctl00_workarea_cbo_p1_role option:selected\").val()) {\r\n\t\tTitle = $(\"#ctl00_workarea_cbo_p1_role option:selected\").text();\r\n\r\n\t\tvar Variants = \"\";\r\n\t\t$(\".VariantsCBO\").each(function () {\r\n\t\t\tif ($(\"option:selected\", this).val()) {\r\n\t\t\t\tif (Variants === \"\")\r\n\t\t\t\t\tVariants = \" - \";\r\n\t\t\t\telse\r\n\t\t\t\t\tVariants = Variants + \", \";\r\n\t\t\t\tVariants = Variants + $(\"option:selected\", this).text();\r\n\t\t\t}\r\n\t\t});\r\n\t\tTitle = Title + Variants;\r\n\t}\r\n\r\n\tif (Title.length > parseInt($(\"#ctl00_workarea_txt_p1_alt_title\").attr(\"MaxLength\"),10)) {\r\n\t\t$.system_confirm(\"The auto generated role name exceeds the max length of this field. <br/>Only Show Role Description?\", function () {\r\n\t\t\tTitle = $(\"#ctl00_workarea_cbo_p1_role option:selected\").text();\r\n\t\t\t$(\"#ctl00_workarea_txt_p1_alt_title\").val(Title);\r\n\t\t}, function () {\r\n\t\t\tTitle = Title.substr(0, parseInt($(\"#ctl00_workarea_txt_p1_alt_title\").attr(\"MaxLength\"),10));\r\n\t\t\t$(\"#ctl00_workarea_txt_p1_alt_title\").val(Title);\r\n\t\t});\r\n\r\n\t\treturn;\r\n\t}\r\n\t$(\"#ctl00_workarea_txt_p1_alt_title\").val(Title);\r\n}", "function setLabel(props){\n\t\t//Label content\n\t\tlet labelAttribute = \"<h1>\" + props[expressed] +\n\t\t\t\"</h1><b>\" + expressed + \"</b>\";\n\n\t\t//Create info label div\n\t\tlet infoLabel = d3.select(\"body\")\n\t\t\t.append(\"div\")\n\t\t\t.attr(\"class\", \"infoLabel\")\n\t\t\t.attr(\"id\", props.name + \"_label\")\n\t\t\t.html(labelAttribute);\n\n\t\tlet countryName = infoLabel.append(\"div\")\n\t\t\t.attr(\"class\", \"labelname\")\n\t\t\t.html(props.name);\n\t}", "function pubmedTxt(field, extra) {\n var txt;\n if (!extra) {\n extra = '';\n }\n switch(field) {\n case 'modalTitle':\n txt = 'Add new PubMed Article';\n break;\n case 'inputLabel':\n txt = 'Enter a PMID';\n break;\n case 'editLabel':\n txt = 'Edit PMID';\n break;\n case 'inputButton':\n txt = 'Retrieve PubMed Article';\n break;\n case 'resourceResponse':\n txt = \"Select \\\"\" + extra + \"\\\" (below) if the following citation is correct; otherwise, edit the PMID (above) to retrieve a different article.\";\n break;\n }\n return txt;\n}", "function setRequiredFieldsLabelText(fieldConfig, d2) {\n fieldConfig.translatedName = d2.i18n.getTranslation(fieldConfig.props.labelText);\n fieldConfig.props.labelText = getLabelText(\n fieldConfig.translatedName,\n fieldConfig,\n );\n}", "function C101_KinbakuClub_RopeGroup_WouldYourSister() {\n\tif (ActorGetValue(ActorName) == \"Lucy\") OverridenIntroText = GetText(\"WouldYourSisterNod\");\n\tif (ActorGetValue(ActorName) == \"Heather\") OverridenIntroText = GetText(\"WouldYourSisterShake\");\n}", "function checkIfIssueDescIsOptional(snapInObject, preChatlableObject) {\n if (((\"issueVal\" in snapInObject && snapInObject.issueVal != \"\" && snapInObject.issueVal != null && snapInObject.issueVal != undefined && snapInObject.issueVal != 'None') || isWarrantyPartsReturnChat(snapInObject)) && document.getElementById(\"Issue_Description_Cust_Label\")) { //FY21-1201 Story #9315449: Warranty Parts Return : Pre-Chat Form\n removeDomElementbyId(\"issueDescIsOptional\");\n var optionalLabel = document.createElement('span');\n optionalLabel.id = 'issueDescIsOptional';\n\t\t//FY21-1003 Story #9078562: HES Admin Chat Prechat form changes [START]\n if(isHesAdminChat(snapInObject))\n optionalLabel.style = 'color: #767676;';\n\t\t//FY21-1003 Story #9078562: HES Admin Chat Prechat form changes [END]\n optionalLabel.innerText = preChatlableObject.optional;\n var Issue_Description_Cust_Label = document.getElementById(\"Issue_Description_Cust_Label\");\n Issue_Description_Cust_Label.appendChild(optionalLabel);\n removeDomElementbyId(\"ErrMsg_cusPreChat-IssueDescription\");\n } else {\n removeDomElementbyId(\"issueDescIsOptional\");\n }\n}", "function translationLabels() {\n\t\t\t\t\t/** This help array shows the hints for this experiment */\n\t\t\t\t\thelp_array = [_(\"help1\"), _(\"help2\"), _(\"help3\"), _(\"help4\"),_(\"Next\"), _(\"Close\")];\n\t\t\t\t\tscope.heading = _(\"heading\");\n\t\t\t\t\tscope.Variables = _(\"Variables\");\n\t\t\t\t\tscope.BaseValue=_(\"basevalue\");\n\t\t\t\t\tscope.Doublebond=_(\"Doublebond\");\n\t\t\t\t\tscope.Exocyclicdouble=_(\"Exocyclicdouble\");\n\t\t\t\t\tscope.Polargroups=_(\"Polargroups\");\n\t\t\t\t\tscope.AlkylSubstituent=_(\"AlkylSubstituent\");\n\t\t\t\t\tscope.ringResidue=_(\"ringResidue\");\n\t\t\t\t\tscope.Controls=_(\"Controls\");\n\t\t\t\t\tscope.lamdaMax=_(\"lamdaMax\");\n\t\t\t\t\tscope.Correct=_(\"Correct\");\n\t\t\t\t\tscope.Submit=_(\"Submit\"); \t\t\t\t\n\t\t\t\t\tscope.Aromatic=_(\"Aromatic\"); \t\t\t\t\n\t\t\t\t\tscope.Ketone=_(\"Ketone\"); \t\t\t\t\n\t\t\t\t\tscope.Conjugate=_(\"Conjugate\"); \t\t\t\t\n\t\t\t\t\tscope.AlkylSubstituentKeto=_(\"AlkylSubstituentKeto\"); \t\t\t\t\n\t\t\t\t\tscope.Polargroupsposition=_(\"Polargroupsposition\"); \t\t\t\t\n\t\t\t\t\tscope.Homodienecompound=_(\"Homodienecompound\"); \t\t\t\t\n\t\t\t\t\tscope.Ortho=_(\"Ortho\"); \t\t\t\t\n\t\t\t\t\tscope.Para=_(\"Para\"); \t\t\t\t\n\t\t\t\t\tscope.Meta=_(\"Meta\"); \t\t\t\t\n\t\t\t\t\tscope.lambdamax=_(\"lambdamax\"); \t\t\t\t\n\t\t\t\t\tscope.lambdamax=_(\"lambdamax\"); \t\t\t\t\n\t\t\t\t\tscope.result = _(\"Result\");\n\t\t\t\t\tscope.copyright = _(\"copyright\");\n\t\t\t\t\twoodward_fieser_stage.update();\n\t\t\t\t}", "renderOption(option) {\n\n if (option.value === null) {\n return <div>&nbsp;</div>; // placeholder for no-user\n }\n let user = this.getAppUser(option.value);\n const datatypeAttributes = this.props.fieldDef && this.props.fieldDef.datatypeAttributes ? this.props.fieldDef.datatypeAttributes : {};\n const userLabel = userFormatter.format({value: user}, datatypeAttributes);\n\n if (user) {\n return (\n <div className=\"userOption\">\n {this.state.selectedUserId === user.userId && !this.props.isAddUser && <QbIcon icon=\"check-reversed\"/>}\n <div className=\"userLabel\">{userLabel} {user.screenName &&\n <span>({user.screenName})</span>} {user.deactivated &&\n <span className=\"deactivatedLabel\">(deactivated)</span>}</div>\n {(option.showEmail || this.props.isAddUser) && user.email && <div className=\"email\">{user.email}</div>}\n </div>);\n } else {\n return <div className=\"hidden\">&nbsp;</div>;\n }\n }", "function addLabel(){\n label = document.createElement(\"input\");\n label.type = \"text\";\n label.className = classNames[\"TODO_TEXT\"];\n label.placeholder = \"New Task!\";\n return label; \n}", "set _label(value) {\n Helper.UpdateInputAttribute(this, \"label\", value);\n }", "set _label(value) {\n Helper.UpdateInputAttribute(this, \"label\", value);\n }", "function getModeHtml(val) {\n\t\t\t//不是undefined、null和空字符串中的一种\n\t\t\tif (!!val) {\n\t\t\t\tif (val == 1) {\n\t\t\t\t\treturn '(自动模式)';\n\t\t\t\t} else if (val == 2) {\n\t\t\t\t\treturn '(手动模式)';\n\t\t\t\t} else if (val == 3) {\n\t\t\t\t\treturn '(被授时自动模式)';\n\t\t\t\t} else {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t}", "function benefitOptionText() { \n return gapPlanData.benefitOption();\n}", "function createLabel(htmlFor, text){\n\tconst label = document.createElement(\"label\");\n\tlabel.htmlFor = htmlFor;\n\tconst b = document.createElement(\"b\");\n\tb.textContent = text;\n\tlabel.appendChild(b);\n\treturn label;\n}", "settings() {\n return {\n labelOn: 'Yes',\n labelOff: 'No'\n }\n }", "function defineLabels() {\r\n\tsteerAssistLabel = radioLabels[0];\r\n\tbrakeAssistLabel = radioLabels[1];\r\n\tABS_label = radioLabels[2];\r\n\tTC_label = radioLabels[3];\r\n\tSC_label = radioLabels[4];\r\n\tdamageLabel = radioLabels[5];\r\n\tgearLabel = radioLabels[6];\r\n\tclutchLabel = radioLabels[7];\r\n\tlineLabel = radioLabels[8];\r\n\t\r\n\tsetupLabel = checkboxesLabels[0];\r\n\tcontrollerLabel = checkboxesLabels[1];\r\n\tcameraLabel = checkboxesLabels[2];\r\n}", "function updateMCEPlaceHolderCtl() {\n if (mainWidget.softwareCompetition.projectHeader.isLccchecked()) {\n enableMCEPlaceholderText = true;\n $(['contestDescription', 'round1Info', 'round2Info']).each(function() {\n var obj = CKEDITOR.instances[this];\n if (obj.getData() == \"\") {\n obj.setData(\"Only members that register for this challenge will see this description.\");\n }\n });\n } else {\n $(['contestDescription', 'round1Info', 'round2Info']).each(function() {\n var obj = CKEDITOR.instances[this];\n if (obj.getData() == \"\") {\n obj.setData(\"\");\n }\n });\n enableMCEPlaceholderText = false;\n }\n}", "function updateLevelText(str) {\n let title = \"\"\n if (str === undefined) {\n title = \"Level: \" + level\n $('#feedback').text(title)\n }\n else { $('#level-title').text(str) }\n}", "formatDefaultLabel(text) {\n const { disabled, onFocus, onBlur, onClick } = this.props\n const { value, open } = this.state\n return (\n disabled ?\n <DropDownLabel disabled>\n {text}\n </DropDownLabel>\n : <DropDownLabel \n onFocus={onFocus} \n onBlur={onBlur} \n isPlaceHolder={value === ''} \n onClick={\n () => {\n this.toggleOpen(!open)\n if (onClick) onClick()\n }\n }>\n {text}\n </DropDownLabel>\n )\n }", "get text(){ return this.__label.text; }", "changeShowResultLabel() {\n var msg = '';\n if (this.state.showResult) {\n msg = 'Hide Solution';\n } else {\n msg = 'Show Solution';\n }\n return msg;\n }", "function displayName(user) {\n const html = `<br><br>\n <h1>${user.first_name} ${user.last_name}</h1>\n `;\n const display = document.getElementById('display-name')\n display.innerHTML = html\n return html\n}", "function LoadUserInfo()\r\n{\r\n\tuser_name=globalStorage['ytfm.ashishdubey.info'].getItem(\"user\");\t\r\n\tsession_key=globalStorage['ytfm.ashishdubey.info'].getItem(\"key\");\r\n\tif(user_name=='') disp_text=\"[None]\";\r\n\telse disp_text=user_name;\r\n\tdocument.getElementById(\"ytfm-userlabel\").setAttribute(\"value\",disp_text);\r\n}", "function Label(_ref) {\n var htmlFor = _ref.htmlFor,\n label = _ref.label,\n required = _ref.required;\n return _react.default.createElement(\"label\", {\n style: {\n display: \"block\"\n },\n htmlFor: htmlFor\n }, label, \" \", required && _react.default.createElement(\"span\", {\n style: {\n color: \"red\"\n }\n }, \" *\"));\n}", "get confirmLabel() {\n\t\treturn this.nativeElement ? this.nativeElement.confirmLabel : undefined;\n\t}", "function lblForName(text){\n\t\trandom = random+1;\n\t\tvar lblBasicConf1 = { id:\"lblForNm\"+random,text :text,isVisible:true,skin: \"lblBlackBold\"};\n\t\tvar lbllayoutConf1 = {containerWeight:40,hExpand:true,margin:[0,0,0,0],widgetAlignment:constants.WIDGET_ALIGN_MIDDLE_LEFT,contentAlignment :constants.CONTENT_ALIGN_MIDDLE_LEFT,padding:[2,0,0,0],vExpand: false,hExpand: true};//,percent:true\n\t\treturn new kony.ui.Label(lblBasicConf1, lbllayoutConf1, {});\t\n\t}", "function formatRepoUser (repo) {\n\n if (repo.loading) {\n return repo.name;\n }\n if (repo.newOption) {\n return '<a href=\"#\" class=\"\"><em>Select user below</em></a>';\n } else {\n var markup = \"<div>\" +\n \"<b>\"+repo.name+\"</b><br/>\"+repo.email\n \"</div>\";\n return markup;\n\n }\n}", "function inputCompleteHtml(code, value) {\n\t\tvar divHtml = '<div id=\"vtitleDiv_'+ code + '\">';\n\t\tvar fullname = $('#langchk_'+code)[0].getAttribute('data-fullname');\n\t\tdivHtml+='<label class=\"control-label\">' + fullname + '</label>';\n\t\tdivHtml+='<input type=\"text\" class=\"input-small\" data-required=\"true\" id=\"contentVtitle_' + code + '\" name=\"contentVtitle_' + code \n\t\t+ '\" value=\"' + value + '\"/></div>'\n\t\treturn divHtml;\n\t}", "function showLoginName(){\r\n\r\n\tif(typeof login_name != 'undefined')\r\n\t\t$(\"#loginName\").text(_user+': '+login_name);\r\n\telse\r\n\t\t$(\"#loginName\").text(_user+': '+'admin');\r\n\r\n}", "function showText(txt) {\n labelText = txt;\n}", "function VLabel(value, name, isMandatory, isADControl) {\n value = value != null ? value.replace(\"[&]\", \"\") : \"\";\n var strFor = ' for=\"' + name + '\"';\n if (isADControl)\n strFor = '';\n\n var $ctrl = $('<label ' + strFor + '></label>');\n\n IControl.call(this, $ctrl, VIS.DisplayType.Label, true, isADControl ? name : \"lbl\" + name);\n if (isMandatory) {\n $ctrl.text(value).append(\"<sup>*</sup>\");\n }\n else {\n $ctrl.text(value);\n }\n\n this.disposeComponent = function () {\n $ctrl = null;\n self = null;\n }\n }", "getOptionLabel(value) {\n let label = null;\n\n if (this._getProperty('options')) {\n this._getProperty('options').forEach((option) => {\n if (option.value === value) {\n label = option.label;\n }\n });\n }\n\n return label;\n }", "function waitingForUserText() {\n\t\treturn 'Waiting for User';\n\t}", "function GenerateProfileHTML(user) {\r\n \r\n if(typeof user['link'] != 'undefined')\r\n return '<a href=\"' + user['link'] + '\" class=\"user-link\">by ' + user['display_name'] + '</a>';\r\n else\r\n return '<span class=\"user-link\">' + user['display_name'] + '</span>'\r\n \r\n }", "addLabel() {\n this.scope_['value']['value']['label_names'].push(\n {type: 'unicode', value: this.defaultLabel_});\n }", "function getLabelDescriptions () {\n return {\n 'Walk' : {\n 'id' : 'Walk',\n 'text' : 'Walk'\n },\n 'StopSign' : {\n 'id' : 'StopSign',\n 'text' : 'Bus Stop Sign'\n },\n 'StopSign_OneLeg' : {\n 'id' : 'StopSign_OneLeg',\n 'text' : 'One-leg Stop Sign'\n },\n 'StopSign_TwoLegs' : {\n 'id' : 'StopSign_TwoLegs',\n 'text' : 'Two-leg Stop Sign'\n },\n 'StopSign_Column' : {\n 'id' : 'StopSign_Column',\n 'text' : 'Column Stop Sign'\n },\n 'StopSign_None' : {\n 'id' : 'StopSign_None',\n 'text' : 'Not provided'\n },\n 'Landmark_Shelter' : {\n 'id' : 'Landmark_Shelter',\n 'text' : 'Bus Stop Shelter'\n },\n 'Landmark_Bench' : {\n 'id' : 'Landmark_Bench',\n 'text' : 'Bench'\n },\n 'Landmark_TrashCan' : {\n 'id' : 'Landmark_TrashCan',\n 'text' : 'Trash Can / Recycle Can'\n },\n 'Landmark_MailboxAndNewsPaperBox' : {\n 'id' : 'Landmark_MailboxAndNewsPaperBox',\n 'text' : 'Mailbox / News Paper Box'\n },\n 'Landmark_OtherPole' : {\n 'id' : 'Landmark_OtherPole',\n 'text' : 'Traffic Sign / Pole'\n }\n }\n}", "get escapeLabelHTML() {\n return false;\n }", "function setBoolText(inBool) {\n var tempStr = \"NO\";\n if (inBool) {\n tempStr = \"YES\";\n }\n return tempStr;\n }", "async function generateLabel(field, fieldStats) {\n var label = `${field.alias || field.name}`;\n if (!fieldStats) {\n return label;\n } else {\n var min = fieldStats.values.min;\n var max = fieldStats.values.max;\n label += ' <span class=\"attributeRange\">';\n }\n if (fieldStats.values\n && (min && max) != null\n && typeof (min && max) != 'undefined') {\n if (field.simpleType === 'numeric') {\n // vary precision based on value range – round to integers if range is > 100, otherwise\n // find the decimal exponent of the most sigfig of the value range, and truncate two decimal places past that -\n // eg: if the range is .000999999, most sigfig exponent is -4 (.0001), values will be truncated to -6 (.000001)\n // TODO: test if this is actually working (seems to in practice)\n let digits = getDigits(max - min);\n let precision = digits[1] == 1 ? 0 : digits[0] > 3 ? 0 : digits[1];\n min = min.toFixed(precision);\n max = max.toFixed(precision);\n label += `(${min} to ${max})`;\n } else if (field.simpleType === 'date') {\n label += `(${formatDate(min)} to ${formatDate(max)})`;\n }\n } else if (fieldStats.uniqueCount && field.simpleType === 'string') {\n // remove bad values\n var uniqueValues = (await getDatasetFieldUniqueValues(field.name)).values;\n label += `(${uniqueValues.length} value${uniqueValues.length > 1 ? 's)' : ')'}`;\n } else {\n label += `<i>(No values)</i>`;\n }\n return ''+label+'</span>';\n }", "function create_cont_Likert(sentence,name_label)\n\t\t{ //console.log(\"it's getting here\")\n\t\t\tvar likert = '<tr><td style=\"text-align: left; height: 40px\"> <b>' + sentence + '</b></td>'+\n\t\t\t'<td><input type=\"radio\" name=\"' + name_label+ \n\t\t\t'\" value=\"1\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"2\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"3\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"4\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"5\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"6\" /></td><td><input type=\"radio\" name=\"' + name_label + \n\t\t\t'\" value=\"7\" /></td></tr>';\n\n\t\t\treturn likert;\n\t\t}", "function displayIngrInput2() {\n document.getElementById(\"userIngr\").placeholder = \"Rechercher un ingrédient\";\n}", "function createDisplayNameParagraph(key, displayName) {\n var p = document.createElement('p');\n if(displayName)\n p.innerText = displayName;\n else if(key)\n {\n p.setAttribute(\"data-i18n\",key);\n p.innerText = APP.translation.translateString(key);\n }\n\n return p;\n}", "render() {\n\t\treturn (\n\t\t\t<div>[User Panel Placeholder]</div>\n\t\t)\n\t}", "function label(type) {\n return labels[map(type)] || 'Unknown';\n }", "function getS_tabLabel(tabName)\n{\n switch (tabName)\n {\n case 'none': // On initial load, tabName will be 'none'. Treat same as 'playerStats'.\n case 'playerStats': return 'Player<br />Statistics';\n case 'playerRankings': return 'Player<br />Rankings';\n case 'teamStats': return 'Team<br />Statistics';\n case 'teamRecords': return 'Team<br />Records';\n case 'battPships': return 'Batting<br />Partnerships';\n default: error( 'Unexpected tabName \"' + tabName\n + '\" in function \\'icdb_data_retrieval_form.js\\'::getS_tabLabel().');\n }\n}", "function setReactionsLabel(length, reactionLabel) {\n\n const lang = document.querySelector(\"html\").getAttribute(\"lang\");\n\n let plural_rules;\n try {\n plural_rules = new Intl.PluralRules(lang);\n } catch {\n return;\n }\n\n // Singular\n if (plural_rules.select(length) === \"one\") {\n reactionLabel.textContent = reactionLabel.dataset.singular;\n return;\n }\n\n // Few - alternative plural (Used by \"ru\" and \"uk\")\n if (reactionLabel.dataset.plural_alt !== \"\" && plural_rules.select(length) === \"few\") {\n reactionLabel.textContent = reactionLabel.dataset.plural_alt;\n return;\n }\n\n // If a plural exists use that.\n if (reactionLabel.dataset.plural) {\n reactionLabel.textContent = reactionLabel.dataset.plural;\n return;\n }\n\n // Everything else sticks with the default\n return;\n\n}", "function enablePlaceholder() {\n placeholder.style.display = '';\n placeholder.innerHTML = 'Enter your age';\n }", "function getLabelDescriptions () {\n return {\n 'Walk' : {\n 'id' : 'Walk',\n 'text' : 'Walk'\n },\n CurbRamp: {\n id: 'CurbRamp',\n text: 'Curb Ramp'\n },\n NoCurbRamp: {\n id: 'NoCurbRamp',\n text: 'Missing Curb Ramp'\n },\n Obstacle: {\n id: 'Obstacle',\n text: 'Obstacle in a Path'\n },\n Other: {\n id: 'Other',\n text: 'Other'\n },\n SurfaceProblem: {\n id: 'SurfaceProblem',\n text: 'Surface Problem'\n },\n Void: {\n id: 'Void',\n text: 'Void'\n },\n Unclear: {\n id: 'Unclear',\n text: 'Unclear'\n },\n 'StopSign' : {\n 'id' : 'StopSign',\n 'text' : 'Bus Stop Sign'\n },\n 'StopSign_OneLeg' : {\n 'id' : 'StopSign_OneLeg',\n 'text' : 'One-leg Stop Sign'\n },\n 'StopSign_TwoLegs' : {\n 'id' : 'StopSign_TwoLegs',\n 'text' : 'Two-leg Stop Sign'\n },\n 'StopSign_Column' : {\n 'id' : 'StopSign_Column',\n 'text' : 'Column Stop Sign'\n },\n 'StopSign_None' : {\n 'id' : 'StopSign_None',\n 'text' : 'Not provided'\n },\n 'Landmark_Shelter' : {\n 'id' : 'Landmark_Shelter',\n 'text' : 'Bus Stop Shelter'\n },\n 'Landmark_Bench' : {\n 'id' : 'Landmark_Bench',\n 'text' : 'Bench'\n },\n 'Landmark_TrashCan' : {\n 'id' : 'Landmark_TrashCan',\n 'text' : 'Trash Can / Recycle Can'\n },\n 'Landmark_MailboxAndNewsPaperBox' : {\n 'id' : 'Landmark_MailboxAndNewsPaperBox',\n 'text' : 'Mailbox / News Paper Box'\n },\n 'Landmark_OtherPole' : {\n 'id' : 'Landmark_OtherPole',\n 'text' : 'Traffic Sign / Pole'\n }\n }\n}", "function translationLabels(){\n /** This help array shows the hints for this experiment */\n helpArray=[_(\"Next\"),_(\"Close\"),_(\"help1\"),_(\"help2\"),_(\"help3\"),_(\"help4\"),_(\"help5\")];\n scope.heading=_(\"Moment of Inertia of Flywheel\");\n scope.variables=_(\"Variables\"); \n scope.result=_(\"Result\"); \n scope.copyright=_(\"copyright\"); \n scope.choose_enviornment = _(\"Choose Environment:\");\n cm = _(\" cm\");\n scope.kg = _(\"kg\");\n scope.cm = cm;\n scope.gm = _(\"gm\");\n scope.earth = _(\"Earth, g=9.8m/s\");\n scope.mass_of_fly_wheel_lbl = _(\"Mass of fly wheel:\");\n scope.dia_of_fly_wheel_lbl = _(\"Diameter of fly wheel:\");\n scope.mass_of_rings_lbl = _(\"Mass of rings:\");\n scope.axle_diameter_lbl = _(\"Diameter of axle:\");\n scope.no_of_wound_lbl = _(\"No. of wound of chord:\");\n scope.mInertia_lbl = _(\"First start experiment..!\");\n scope.mInertia_val = \"\";\n btn_lbls = [_(\"Release fly wheel\"),_(\"Hold fly wheel\")];\n scope.release_hold_txt = btn_lbls[0];\n scope.reset = _(\"Reset\");\n scope.enviornment_array = [{\n enviornment: _('Earth, g=9.8m/s'),\n type: 9.8\n }, {\n enviornment: _('Moon, g=1.63m/s'),\n type: 1.63\n }, {\n enviornment: _('Uranus, g=10.5m/s'),\n type: 10.5\n }, {\n enviornment: _('Saturn, g=11.08m/s'),\n type: 11.08\n }, {\n enviornment: _('Jupiter, g=25.95m/s'),\n type: 25.95\n }];\n scope.$apply(); \n }", "function addlbl() {\n}", "getLabelFromBMI() {\n let label = ''\n\n if (this.bmi >= 25) {\n label = 'overweight'\n } else if (this.bmi >= 18.5 && this.bmi < 25) {\n label = 'normal'\n } else {\n label = 'underweight'\n }\n\n return label\n }", "function textOption() {\n if (Meteor.user().profile.name == \"Gabe Grand\")\n {\n return \"Position: \" + position.coords.latitude + \", \" + position.coords.longitude;\n }\n else\n {\n return sass;\n }\n }", "_hideLabelIfEmpty() {\n const label = this._elements.label;\n\n // If it's empty and has no non-textnode children, hide the label\n const hiddenValue = !(label.children.length === 0 && label.textContent.replace(/\\s*/g, '') === '');\n\n // Toggle the screen reader text\n this._elements.labelWrapper.style.margin = !hiddenValue ? '0' : '';\n this._elements.screenReaderOnly.hidden = hiddenValue || this.labelled;\n }", "function getSettingTogglePart(name, additionalHTML=\"\") {\n let d = `${name}Desc`\n return `\n <div class=\"gt2-setting\">\n <div>\n <span>${getLocStr(name)}</span>\n <div class=\"gt2-setting-toggle ${GM_getValue(\"opt_gt2\")[name] ? \"gt2-active\" : \"\"}\" data-setting-name=\"${name}\">\n <div></div>\n <div>\n ${getSvg(\"tick\")}\n </div>\n </div>\n </div>\n ${additionalHTML}\n ${getLocStr(d) ? `<span>${getLocStr(d)}</span>` : \"\"}\n </div>`\n }", "function checkIfIssueDescIsOptionalInCare(orderSnapinObject, orderPreChatlableObject){\n if(\"issueType\" in orderSnapinObject && orderSnapinObject.issueType != \"\" && orderSnapinObject.issueType != null && orderSnapinObject.issueType != undefined && orderSnapinObject.issueType !='None' && document.getElementById(\"CareIssue_Description_Cust_Label\")){\n removeDomElementbyId(\"issueDescIsOptionalInCare\");\n var optionalLabel = document.createElement('span');\n optionalLabel.id = 'issueDescIsOptionalInCare';\n optionalLabel.innerText = orderPreChatlableObject.optional;\n var Issue_Description_Cust_Label = document.getElementById(\"CareIssue_Description_Cust_Label\");\n Issue_Description_Cust_Label.appendChild(optionalLabel);\n removeDomElementbyId(\"ErrMsg_cusCAREPreChat-IssueDescription\");\n }else{\n removeDomElementbyId(\"issueDescIsOptionalInCare\");\n }\n}", "nameTooltip_html(set) {\n let typeStr = \"\";\n if(this.type == \"USD_MSRP\") \n typeStr = \"Dollars\"\n else \n typeStr = this.type\n let text = \"<div class='nameTooltip'>\"\n text += \"<h2>\" + set.Name + \"</h2>\";\n text += \"<h2>\" + set[this.type] + \" \" + typeStr + \"</h2>\";\n \n text += \"</div>\"\n return text;\n }", "function showLabelPropMenu() {\n propBoxLabel.show();\n labCaptLabel.show();\n opNameLabel.hide();\n ipNameLabel.hide();\n colNameLabel.hide();\n outputCaptionBox.hide();\n outputColorBox.hide();\n inputIsTopBox.hide();\n inputCaptionBox.hide();\n clockspeedLabel.hide();\n clockspeedSlider.hide();\n labelTextBox.show();\n labelTextBox.value(labels[propLabel].txt);\n propOutput = -1;\n propInput = -1;\n for (const elem of outputs) {\n elem.mark(false);\n }\n for (const elem of inputs) {\n elem.mark(false);\n }\n}", "addLabel(label) {\n if ('labels' in this.fieldNode) {\n this._givenLabels = this.fieldNode.labels.__childNodes.map(labelNode => labelNode._value);\n if (this._givenLabels.indexOf(label) === -1) {\n this.fieldNode.labels.createField({ fieldName: label, type: 'bool', _value: true });\n }\n } else {\n // attention, this is for ui only, this label will never sent back to the server\n this._addVirtualLabel(label);\n }\n }", "function exerciseLabel (el) {\n return thiz.$exerciseContainer(el).attr('data-label')\n }" ]
[ "0.6330865", "0.61747205", "0.61295223", "0.580869", "0.5763793", "0.5747451", "0.57332486", "0.5725752", "0.5665497", "0.5649104", "0.558894", "0.5561425", "0.5547449", "0.5540915", "0.5517936", "0.54994637", "0.54948455", "0.5455702", "0.5447712", "0.54466766", "0.5428423", "0.53984404", "0.5386771", "0.5386758", "0.5375602", "0.5350308", "0.53329796", "0.5319705", "0.5307135", "0.53069675", "0.53064764", "0.53062105", "0.53041804", "0.5296131", "0.5273588", "0.52732515", "0.52685946", "0.5260696", "0.5239552", "0.52339274", "0.52335477", "0.5232055", "0.52100676", "0.5202483", "0.5198685", "0.51973903", "0.5196635", "0.51873314", "0.51817536", "0.5179332", "0.5177506", "0.5177506", "0.5173011", "0.51714015", "0.517119", "0.5167774", "0.5167629", "0.5164588", "0.51605415", "0.5148162", "0.513787", "0.513569", "0.5135056", "0.51324475", "0.51290685", "0.51289666", "0.51161516", "0.5114316", "0.511159", "0.5107727", "0.51030636", "0.5101613", "0.50983894", "0.5096815", "0.5096559", "0.5096475", "0.5095891", "0.5089266", "0.5087373", "0.5081625", "0.50669634", "0.5066216", "0.50624496", "0.5062382", "0.5060675", "0.50553423", "0.5053487", "0.5036416", "0.503511", "0.5034541", "0.5033516", "0.5033433", "0.5026417", "0.5025542", "0.5022869", "0.5021786", "0.50174737", "0.50165915", "0.50125873", "0.50123996" ]
0.8082545
0
Utility function to generate the css class(es) of a userPref input field based on if it is required or not
function generatePrefInputClassMarkup(userPref) { var markup = []; markup.push(WIDGET_PREFS_INPUT_CLASS); if (userPref.required) { markup.push(" "); markup.push(WIDGET_PREFS_INPUT_REQUIRED_CLASS); } return markup.join(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "inputClass () {\n let klass = ''\n\n if (this.state.focus) {\n klass += ' usa-input-focus'\n }\n\n if (this.state.valid) {\n klass += ' usa-input-success'\n }\n\n if (this.state.checked) {\n klass += ' selected'\n }\n\n return klass.trim()\n }", "labelClass () {\n let klass = ''\n\n if (this.state.error) {\n klass += ' usa-input-error-label'\n }\n\n if (this.state.checked) {\n klass += ' checked'\n }\n\n if (this.state.focus) {\n klass += ' usa-input-focus'\n }\n\n return klass.trim()\n }", "getCSSClassesNames() {\n var classNames = 'article__textarea article__textarea--style';\n switch (this.state.cssCheck) {\n case 'OK':\n classNames += ' article__textarea--correct';\n break;\n case 'KO':\n classNames += ' article__textarea--wrong';\n break;\n default:\n classNames += ' article__textarea--idle';\n break;\n }\n return classNames;\n }", "function formStyleHelperClasses() {\r\n $('.form-style').attr('placeholder', '');\r\n\r\n $('.form-style').focus(function() {\r\n\r\n $(this).closest('.form-group').addClass('is-focused');\r\n \r\n }).blur(function() {\r\n \r\n $(this).closest('.form-group').removeClass('is-focused');\r\n \r\n if ( $(this).val() ) {\r\n\r\n $(this).closest('.form-group').addClass('is-not-empty');\r\n\r\n } else {\r\n\r\n $(this).closest('.form-group').removeClass('is-not-empty');\r\n\r\n }\r\n \r\n });\r\n }", "handleFieldsCheck(){\n let required = document.querySelectorAll('.required')\n let filled = true\n required.forEach( item => {\n if(!item.value) {\n item.classList.add('required-input')\n filled = false\n }\n })\n return filled\n }", "function generalFromValidationForPresence() {\n var emptyArray = []\n $(this).closest('form').find('.required_field').each(function(){\n if ($(this).val() == \"\") {\n $(this).css({\n \"background-color\":\"#F1D7D7\"\n });\n emptyArray.push($(this));\n } else {\n $(this).css({\n \"background-color\":\"none\"\n }); \n };\n });\n if (typeof(error_declaration_variable) == 'undefined') {\n if (emptyArray.length > 0) {\n $(this).closest('form').find('.missing_field_error').html('<p>Ensure all the required fields above are filled in.</p>');\n $(this).closest('form').find('.missing_field_error').removeClass('hidden');\n return 'missing'\n } else {\n $(this).closest('form').find('.missing_field_error').html('');\n $(this).closest('form').find('.missing_field_error').addClass('hidden');\n return 'okay'\n }\n } else {\n return 'missing'\n }\n}", "getEnyoClassesNames() {\n var classNames = 'article__textarea article__textarea--html';\n switch (this.state.enyoCheck) {\n case 'OK':\n classNames += ' article__textarea--correct';\n break;\n case 'KO':\n classNames += ' article__textarea--wrong';\n break;\n default:\n classNames += ' article__textarea--idle';\n break;\n }\n return classNames;\n }", "function requiredFields() {\n\tvar application_type = jQuery(\"input[name='application_type']:checked\").val();\n\tvar requiredAll = ['#degree-start', '#title','#surname','#firstname','#contact-number','#preferred-email','#nationality','#college','#degree','#subject','#term','#term-year','#acc-prefer-1','#acc-prefer-2','#tenancy-accept'];\n\tvar requiredJoint = ['#partner-title','#partner-lastname','#partner-firstname','#partner-relationship','#partner-nationality','#partner-preferred-email','#partner-contact-no','#partner-college','#partner-degree','#partner-subject','#partner-degree-start'];\n\tvar requiredFamily = ['#spouse-title','#spouse-firstname','#spouse-lastname','#spouse-relationship','#spouse-nationality'];\n\t\n\tjQuery('div.required').removeClass('required');\n\t\n\tjQuery(requiredAll).each(function(i,v) {\n\t\tjQuery(v).closest('div').addClass('required');\n\t});\n\t\n\tif (typeof application_type !== 'undefined' && application_type === 'Joint') {\n\t\tjQuery(requiredJoint).each(function(i,v){\n\t\t\tjQuery(v).closest('div').addClass('required');\n\t\t});\n\t}\n\telse if (typeof application_type !== 'undefined' && application_type === 'Couple/Family') {\n\t\tjQuery(requiredFamily).each(function(i,v){\n\t\t\tjQuery(v).closest('div').addClass('required');\n\t\t});\n\t}\n\t\n}", "function mandatoryInputCheck(){\n\n\tlet filled = true;\n\tfor (i = 0; i < NECESSARY_VAL.length; i++) {\n\n\t\tlet id = \"#\"+NECESSARY_VAL[i];\n\n\t\t\tif ($(id).val()==\"\" || $(id).hasClass(\"w3-red\")==true) {\n\n\t\t\t\t$(id).addClass(\"w3-red\");\n\t\t\t\tfilled = false;\n\t\t\t} else {\n\n\t\t\t\t$(id).removeClass(\"w3-red\");\n\t\t\t};\n\t};\n\treturn filled\n}", "function addClass(value){\n\t\n if(value.localeCompare(\"N / A\") === 0 ){\n\t\t\n\t\tvalue = \"<div class='no_membership'>\" + value + \"</div>\"; // css style in 'display_members.css' file\n\t}\n else if(value.localeCompare(\"present\") === 0){\n \t\n \tvalue = \"<div class='expired_membership'>N / A</div>\";\n }\n\telse if(value == 0.00){\n\t\t\n\t\tvalue = \"<div class='no_paid'>\" + value + \"</div>\"; // css style in 'display_members.css' file\n\t}\n\t\n\treturn value;\t\n}", "function class_nameVerify(){\n\t\tif(class_name.value != null || class_name.value != \"\"){\t\t\t\n\t\t\tclass_name.style.border = \"1px solid #5e6e66\";\n\t\t\tdocument.getElementById('class_name_div').style.color = \"#5e6e66\";\n\t\t\tclass_name_error.innerHTML = \"\";\n\t\t\treturn true;\n\t\t}\n\t}", "function valid(value){\n value.addClass(\"is-valid\");\n value.removeClass(\"is-invalid\");\n}", "function updateClasses() {\n\n var formField = formCtrl[scope.fieldName];\n element.toggleClass('isValid', formField.$valid);\n element.toggleClass('error', formField.$invalid && (formField.$dirty || formField.$touched || formCtrl.$submitted));\n element.toggleClass('valueEntered', formField.$dirty || (formField.$viewValue !== undefined && \n formField.$viewValue !== null && formField.$viewValue.length > 0));\n }", "getClasses() {\n let classes = ['indicator-pip'];\n\n if (this.props.final) {\n classes.push('final');\n }\n\n if (this.props.taken) {\n classes.push('taken');\n }\n\n return classes.join(' ');\n }", "function inputFieldClass() {\n if (event.key >= 'a' && event.key <= 'z') {\n var inputSlice = input.value + event.key;\n var currentWordSlice = randomWords[currentWord].slice(0, inputSlice.length);\n input.className = inputSlice === currentWordSlice ? '' : 'wrong';\n }else if (event.key === 'Backspace') {\n var inputSlice = event.ctrlKey ? '' : input.value.slice(0, input.value.length - 1);\n var currentWordSlice = randomWords[currentWord].slice(0, inputSlice.length);\n input.className = inputSlice === currentWordSlice ? '' : 'wrong';\n } else if (event.key === ' ') {\n input.className = '';\n }\n }", "get formElementClass() {\n let baseClass = ['slds-form-element'];\n\n if (this.variant && VARIANTS[this.variant]) {\n baseClass = [...baseClass, ...VARIANTS[this.variant]];\n }\n\n if (!this.valid) {\n baseClass = [...baseClass, 'slds-has-error'];\n }\n\n return baseClass.join(' ');\n }", "function getCountry(c)\n{\n if(c.value !== \"Choix...\")\n c.classList.add(\"is-valid\");\n else\n if(c.classList.contains('is-valid') === true)\n c.classList.remove(\"is-valid\");\n}", "function buildRequiredCheckboxValidation($formField,validation){var formFieldId=$formField.attr('id');var primarySelector='#'+formFieldId+' input:first-of-type';var secondarySelector='#'+formFieldId+' input';return{selector:primarySelector,triggeredBy:secondarySelector,validate:function validate(cb){var result=false;__WEBPACK_IMPORTED_MODULE_0_jquery___default()(secondarySelector).each(function(index,checkbox){if(checkbox.checked){result=true;return false}});cb(result)},errorMessage:'The \\''+validation.label+'\\' field cannot be blank.'}}", "render() {\n return (\n <fieldset className={ \"ValidateField\" + (this.status.invalid && \" invalid \") }>\n {this.props.children}\n {this.status.invalid && <span className=\"ValidateStatus\">{this.status.invalid}</span>}\n </fieldset>\n )\n\n }", "function makeFieldsMandatory(arrayOfFields)\n\t{\n\t for (var i=0; i<arrayOfFields.length; i++) \n\t {\n\t obj = getObj(arrayOfFields[i]);\n\t obj.className=\"mandatoryLabel\"\n\t }\n\t}", "renderField(field) {\n\n const { meta: { touched, error } } = field;\n const className = touched && error ? \"form-control form-control-lg is-invalid\" : \"form-control form-control-lg\";\n const inputType = field.type;\n const inputPlaceholder = field.placeholder;\n const errorMessageStyling = touched && error ? \"text-danger\" : \"\";\n\n return (\n\n <div>\n <input className={className} type={inputType} placeholder={inputPlaceholder} {...field.input} />\n <div className={errorMessageStyling}>\n <div>{touched ? error : \"\"}</div>\n \n </div>\n </div>\n );\n}", "function customizeInput(inputClass, styleNotSel, styleSel){\r\n\t\tvar element = $(\".\"+inputClass);\r\n\t\telement.css(\"display\", \"none\");//hide the default style\r\n\t\telement.addClass(styleNotSel); //add not selected style to it\r\n\t\tvar inputType = element.attr(\"type\");\r\n\t\t\r\n\t\tswitch(inputType){\r\n\t\t\r\n\t\tcase \"checkbox\":\r\n\t\t\telement.change(function(){ //toggle styled effects\r\n\t\t if($(this).is(\":checked\")){\r\n\t\t $(this).next(\"label\").addClass(styleSel);\r\n\t\t }else{\r\n\t\t $(this).next(\"label\").removeClass(styleSel);\r\n\t\t }\r\n\t\t });\r\n\t\t\tbreak;\r\n\t\tcase \"radio\":\r\n\t\t\telement.change(function(){\r\n\t\t if($(this).is(\":checked\")){\r\n\t\t $(element + \":not(:checked)\").removeClass(styleSel);\r\n\t\t $(this).next(\"label\").addClass(styleSel);\r\n\t\t }\r\n\t\t }); \r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t}", "function toggleRequiredClass() {\n var loadType = $('.IA-C-2.IA-C-3:checked').val();\n if (isPartial(loadType)) {\n $('.field-loadcar-model, .field-loadcar-quantity').addClass('required');\n } else {\n $('.field-loadcar-model, .field-loadcar-quantity').removeClass('required');\n }\n}", "function addClassInput() {\n if (classCnt >= 9) {\n alert('Reached maximum supported inference classes');\n return;\n }\n\n classCnt = classCnt + 1;\n\n let classInput = [];\n classInput.push(` <div class=\"row\" id=\"inference-class-${classCnt}-row\">\\n`);\n classInput.push(` <div class=\"col input-group input-group-sm mb-1\">\\n`);\n classInput.push(` <div class=\"input-group-prepend\">\\n`);\n classInput.push(` <span class=\"input-group-text\" id=\"inference-class-${classCnt}-label\">Class ${classCnt}:</span>\\n`);\n classInput.push(` </div>\\n`);\n classInput.push(` <input type=\"text\" class=\"form-control\" id=\"inference-class-${classCnt}\" placeholder=\"Enter Inference Class ${classCnt}\" aria-label=\"Inference Class ${classCnt}\" aria-describedby=\"inference-class-${classCnt}-label\">\\n`);\n classInput.push(` </div>\\n`);\n classInput.push(` </div>\\n`);\n\n let html = classInput.join(\"\");\n $(html).insertBefore($(\"#inference-class-add-remove\"));\n}", "renderField(field) {\n //console.log(\"Field Details : \" + JSON.stringify(field));\n const {\n meta: { touched, error },\n type,\n placeholder,\n value\n } = field;\n const className = `form-group form-control-lg ${\n touched && error ? \"has-danger\" : \"\"\n }`;\n console.log(\"className : \" + className);\n return (\n <div class=\"form-group form-control-lg has-danger\">\n <label>{field.label}</label>\n <input\n class=\"form-control form-control-lg border border border-dark\"\n type={type}\n placeholder={placeholder}\n value={value}\n {...field.input}\n />\n <div class={{ className }}>{touched ? error : \"\"}</div>\n </div>\n );\n }", "getClassText(value) {\n if (parseFloat(value) > 0.0) {\n return \"text-success\"\n } else {\n return \"text-danger\"\n }\n }", "function AssetClass() {\r\n var assets = $(\"#assets_class\").val()\r\n console.log(\"assets is ---->\", assets)\r\n if (assets.length == \"\") {\r\n\r\n $(\"#assets_class\").addClass(\"has-error\");\r\n $(\"#assets_class_label\").text(\"This Field is required\");\r\n return false;\r\n } \r\n else {\r\n $(\"#assets_class\").removeClass(\"has-error\");\r\n $(\"#assets_class_label\").text(\"\");\r\n return true;\r\n }\r\n\r\n}", "function checkRequired (color) {\n if(color === \"red\" || color === \"orange\" || color === \"gray\") {\n return \"required\";\n } else {\n return \"\";\n }\n}", "function generatePrefLabelMarkup(userPref) {\n var markup = [];\n var prefLabel = (userPref.required) ? \"* \" + userPref.displayName : userPref.displayName;\n markup.push(\"<td class='\");\n markup.push(WIDGET_PREFS_LABEL_CLASS);\n if (userPref.required) {\n markup.push(\" \");\n markup.push(WIDGET_PREFS_LABEL_REQUIRED_CLASS);\n }\n markup.push(\"'>\");\n markup.push(prefLabel);\n markup.push(\"</td>\");\n return markup.join(\"\");\n }", "function validNameRed () { \n if (name.value === '') {\n nameField.classList.add('input-invalid')\n } \n else{\n nameField.classList.add('input-valid')\n }\n}", "function validatePrefInput(element) {\n var isValid = true;\n var jqEl = $(element);\n // if the input is required verify it's trimmed input length is > 0\n if (jqEl.hasClass(WIDGET_PREFS_INPUT_REQUIRED_CLASS)) {\n isValid = $.trim(jqEl.val()).length > 0;\n }\n\n return isValid;\n }", "renderField(field) {\n //console.log(\"Field Details : \" + JSON.stringify(field));\n const {\n meta: { touched, error },\n type,\n placeholder,\n value\n } = field;\n const className = `form-group form-control-lg ${\n touched && error ? \"has-danger\" : \"\"\n }`;\n //console.log(\"className : \" + className);\n return (\n <div class=\"form-group form-control-lg has-danger\">\n <label>{field.label}</label>\n <input\n class=\"form-control form-control-lg border border border-dark\"\n type={type}\n placeholder={placeholder}\n value={value}\n {...field.input}\n />\n <div class={{ className }}>{touched ? error : \"\"}</div>\n </div>\n );\n }", "function checkValidUser() {\n var nombreup = $(\"#nombreup\").val();\n var nombreinput = $(\"#nombreup\");\n\n if (nombreup == \"\") {\n nombreinput.addClass(\"is-invalid\");\n $(\"#statusName\").html(\n '<span class=\"label label-success\" style=\"color: red\">Campo obligatorio</span>'\n );\n } else {\n $(\"#statusName\").html(\"\");\n nombreinput.removeClass(\"is-invalid\");\n nombreinput.addClass(\"is-valid\");\n return false;\n }\n}", "fieldClass(field, defaultClass = '', errorClass = '') {\n let defaultClassString = typeof defaultClass == 'function' ? defaultClass(field) : defaultClass;\n let errorClassString = typeof errorClass == 'function' ? errorClass(field) : errorClass;\n\n return this.errors.has(field) ? `${defaultClassString} ${errorClassString}` : defaultClassString;\n }", "function require(the_form){\n the_form.find(\".required\").each(function(){\n if($(this).attr(\"type\")!=\"checkbox\"){\n if($(this).val()==\"\" || $(this).val()==$(this).attr(\"default\")){\n $(this).parent().addClass(\"error\");\n }\n else{\n $(this).parent().removeClass(\"error\");\n }\n }\n else{\n if($(this).attr(\"checked\")==\"\"){\n $(this).parent().addClass(\"error\");\n }\n }\n });\n}", "function validate(field) {\n if (patterns[field.name].test(field.value)) {\n field.className = \"valid-field\";\n } else {\n field.className = \"invalid-field\";\n }\n}", "function setSuccessFor(input){\r\n const form_required = input.parentElement;\r\n form_required.className = 'required success';\r\n}", "function checkErrorFullName(value) {\n if(value.trim()=='') {\n var errorFullName = document.getElementById('errorFullName');\n var fullName = document.getElementById('fullName');\n errorFullName.classList.add('showElement');\n fullName.classList.add('invalidField');\n } \n}", "renderField(field) {\n //console.log(\"Field Details : \" + JSON.stringify(field));\n const {\n meta: { touched, error },\n type,\n placeholder,\n value\n } = field;\n const className = `form-group ${touched && error ? \"has-danger\" : \"\"}`;\n console.log(\"className : \" + className);\n return (\n <div class={className}>\n <label>{field.label}</label>\n <input class=\"form-control\" type={type} {...field.input} />\n <div class={{ className }}>{touched ? error : \"\"}</div>\n </div>\n );\n }", "divClass () {\n let klass = ''\n if (!this.props.native) {\n klass = 'eapp-blocks-radio'\n }\n\n if (this.state.error) {\n klass += ' usa-input-error'\n }\n\n if (this.props.className) {\n klass += ` ${this.props.className}`\n }\n\n return klass.trim()\n }", "function SP_MakeRequiredFieldsReadable()\n{\n\tvar objField = \"\";\n\tvar radioObj = \"\";\n\tvar RequiredFieldList = document.getElementById(\"requiredVariablesList\").value;\n\tRequiredFieldList = RequiredFieldList.split(\",\");\n\t\n\t$(':input[aria-required = \"true\"]').each(function(){\n\t\t$(this).removeAttr(\"aria-required\");\n\t});\n\t\n\tif(RequiredFieldList.length > 0)\n\t{\n\t\t$.each(RequiredFieldList,function()\n\t\t{\n\t\t\tif(SP_Trim(this) != \"\")\n\t\t\t{\n\t\t\t\tobjField = document.getElementById(this);\n\t\t\t\tswitch(objField.type)\n\t\t\t\t{\n\t\t\t\t\tcase \"radio\":\n\t\t\t\t\t\tradioObj = document.getElementsByName(this);\n\t\t\t\t\t\tfor(var i = 0; i < radioObj.length; i++) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tradioObj[i].setAttribute(\"aria-required\", \"true\");\n\t\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tobjField.setAttribute(\"aria-required\", \"true\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function checkErrorCompanyName(value) {\n if(value.trim()=='') {\n var errorCompanyName = document.getElementById('errorCompanyName');\n var companyName = document.getElementById('companyName');\n errorCompanyName.classList.add('showElement');\n companyName.classList.add('invalidField');\n } \n}", "function changeSty(thisfield,classpassed){\r\n\tdocument.getElementById(thisfield).className=classpassed;\r\n}", "function setErrorFor(input){\r\n const form_required = input.parentElement;\r\n form_required.className = 'required error';\r\n \r\n}", "function dinamicEmailV() \r{\r\te = document.getElementById(\"email\").value;\r\r\tif (checkMail(e)) \r\t{\r\t\tif (e == \"\") \r\t\t{\r\t\t\tdocument.getElementById(\"email\").className = \"\";\r\t\t}\r\t\telse \r\t\t{\r\t\t\tdocument.getElementById(\"email\").className = \"dinamicError\";\r\t\t}\r\t}\r\telse \r\t{\r\t\tdocument.getElementById(\"email\").className = \"dinamicVal\";\r\t\tdocument.getElementById(\"p1label\").className = \"none\";\r\t}\r}", "function checkValidUserUp() {\n var nombreup2 = $(\"#nombreup2\").val();\n var nombreinput2 = $(\"#nombreup2\");\n\n if (nombreup2 == \"\") {\n nombreinput2.addClass(\"is-invalid\");\n $(\"#statusName2\").html(\n '<span class=\"label label-success\" style=\"color: red\">Campo obligatorio</span>'\n );\n } else {\n $(\"#statusName2\").html(\"\");\n nombreinput2.removeClass(\"is-invalid\");\n nombreinput2.addClass(\"is-valid\");\n return false;\n }\n}", "renderField(field) {\n\n const { meta: { touched, error } } = field;\n const className = touched && error ? \"form-control form-control-lg is-invalid\" : \"form-control form-control-lg\";\n const inputType = field.type;\n const inputPlaceholder = field.placeholder;\n const errorMessageStyling = touched && error ? \"text-danger\" : \"\";\n\n return (\n\n <div className=\"form-group\">\n \n <input className={className} type={inputType} placeholder={inputPlaceholder} {...field.input} />\n <div className={errorMessageStyling}>\n <div>{touched ? error : \"\"}</div>\n \n </div>\n </div>\n );\n }", "function turnFieldToRedColorBorder(elementName) {\n elementName.classList.add(\"is-invalid\");\n}", "function checkPresence(field) {\n var hint = $F(field).length == 0 ? \" This field cannot be empty!\" : \"\";\n\n if ($(field + '_hint')) {\n $(field + '_hint').update(hint);\n }\n else {\n content = '<span class=\"validation\" style=\"color:red\" id=\"' + field + '_hint\">' +\n hint + '</span>';\n new Insertion.After(field, content);\n }\n}", "function handleValidInputStyle(inputField, i) {\n if (i.classList.contains(errorIcon)) {\n i.classList.remove(errorIcon, \"red\");\n inputField.classList.remove(\"red-border\");\n }\n\n i.classList.add(checkIcon, \"green\");\n inputField.classList.add(\"green-border\");\n }", "function createClassName(text)\n{\n\n // Ensure there is a non-null class name\n if (!text) { \n var text = 'empty';\n }\n\n // Replace invalid characters, lowercase and trim whitespace\n var conv = text.replace(/[!\\\"#$%&'\\(\\)\\*\\+,\\.\\/:;<=>\\?\\@\\[\\\\\\]\\^`\\{\\|\\}~]/g, '');\n var className = conv.replace (/ /g, \"-\")\n .toLowerCase()\n .trim();\n\n // Ensure first character is non-numeric \n if (!isNaN(parseInt(className.charAt(0), 10))) {\n className = (\"_\" + className);\n } \n\n return className;\n}", "function AttendanceRequiredFieldHandler(frm_data, action, required_class) {\n var response = true;\n if (frm_data.timetable.length == 0) {\n toastr.error('Timetable Required!');\n response = false;\n }\n if (frm_data.comment.length == 0) {\n toastr.error('Comment Required!');\n response = false;\n }\n if (action === 1) { //Actions only in Save\n\n }\n $(required_class).each(function () {\n if ($(this).val().length === 0) {\n// $(this).addClass(\"has-error\");\n } else {\n// $(this).removeClass(\"has-error\");\n }\n });\n return response;\n}", "function displayValidField(id) {\n\n let e = document.getElementById(id);\n e.className = \"has-success\";\n }", "function checkRequired() {\r\n\t var checkRequired = true;\r\n\t var inputs = $(\".required\");\r\n\t \r\n\t $.each(inputs, function(i, item) {\r\n\t\t if (item.value.trim() == \"\") {\r\n\t\t item.style.borderColor = \"red\";\r\n\t\t checkRequired = false;\r\n\t\t } else {\r\n\t\t\t item.style.borderColor = \"\";\r\n\t\t }\r\n\t } \r\n\t );\r\n\t return checkRequired;\r\n}", "function validateSurname() {\n var surname = document.getElementById ('surname')\n var surnameErrorMessage = document.getElementById('surname-error')\n if(surname.value == \"\" || surname.value == undefined)\n {\n surnameErrorMessage.classList.remove('is-invisible')\n }\n else{\n surnameErrorMessage.classList.add('is-invisible')\n }\n }", "function addOrRemoveInvalidInputClass(targetedElement, validOrNot){\n if (validOrNot) {\n $(targetedElement).removeClass('invalidInput');\n } else {\n $(targetedElement).addClass('invalidInput');\n }\n}", "function inputBoxClassStatus(elementInput, statusClass) {\n if(statusClass) { // If is true add success\n // remove box-message-fail\n elementInput.removeClass('input-fail')\n // add box-message-success\n elementInput.addClass('input-success')\n\n } else { // if is false add fail\n // remove input-success\n elementInput.removeClass('input-success')\n // add input-fail\n elementInput.addClass('input-fail')\n }\n}", "function RequiredField() {\n\n }", "function valid(input){\t\r\n\t// license box\r\n\tif(input.type==\"checkbox\")\r\n\t\tinput.parentNode.style.backgroundColor=\"#FFFFFF\";\r\n\t// title or description field \r\n\telse\r\n\t\tinput.style.backgroundColor=\"#FFFFFF\";\t\r\n}", "function set_required(required) {\n for (i=0; i<required.length; i++) {\n $(required[i]).prepend(\"<span class=\\\"required\\\">&#9733;</span>\");\n }\n}", "function marcar_elemento_valido(id_input){\n if($(id_input).hasClass(\"is-invalid\"))\n $(id_input).removeClass(\"is-invalid\")\n\n $(id_input).addClass(\"is-valid\")\n}", "function inputStyle(item, msg, isOk) {\n\tif (!isOk) {\n\t\titem.value = \"\";\n\t\titem.style = \"border: 1px solid red\";\n\t\titem.placeholder = msg;\n\t} else \n\t\titem.style = \"border: 1px solid green\";\n}", "function removeInputRequired() {\n document.getElementById('prompt-input-required').classList.remove('is-visible');\n}", "function marcar_elemento_no_valido(id_input){\n if($(id_input).hasClass(\"is-valid\"))\n $(id_input).removeClass(\"is-valid\")\n\n $(id_input).addClass(\"is-invalid\")\n}", "function addRemoveClass(that) {\n if (!that.value) {\n $(that).addClass('is-invalid').removeClass('is-valid')\n } else {\n $(that).removeClass('is-invalid').addClass('is-valid')\n }\n }", "function invalidInput(field, message) {\n field.addClass(\"invalid\");\n}", "function helperFormRequired () {\n if (\n dateNotEmpty() |\n stringNotEmpty('input', 'helper[profile][firstname]') |\n stringNotEmpty('input', 'helper[profile][familyname]') |\n stringNotEmpty('input', 'helper[profile][pob]') |\n stringNotEmpty('select', 'helper[profile][nationality]') |\n stringNotEmpty('input', 'helper[local][contact][countrycode]') |\n stringNotEmpty('input', 'helper[profile][residentialaddress]') |\n stringNotEmpty('select', 'helper[profile][portrepatriated]') |\n stringNotEmpty('select', 'helper[profile][religion]') |\n stringNotEmpty('select', 'helper[profile][dietaryrestriction]') |\n stringNotEmpty('select', 'helper[profile][foodhandlingrestriction]') |\n stringNotEmpty('select', 'helper[profile][maritalstatus]') |\n stringNotEmpty('select', 'helper[profile][phagency]') |\n stringNotEmpty('select', 'helper[education][educationlevel]') |\n stringNotEmpty('input', 'helper[education][fieldofstudy]') |\n numberNotZero('input', 'helper[local][contact][number]') |\n numberNotZero('input', 'helper[profile][heightcm]') |\n numberNotZero('input', 'helper[profile][weightkg]')\n ) {\n return true\n } else {\n return false\n }\n }", "function updateRequiredFieldsDisplay() {\r\n\tvar tt = document.getElementById(\"task-text\").value;\r\n\tvar tdd = document.getElementById(\"task-due-date\").value;\r\n\tif ( (tt != \"\") && (tdd != \"\") ) { // the two required fields are not empty, so hide required display\r\n\t\tdocument.getElementById(\"s2\").style.display = 'none';\r\n\t\tdocument.getElementById(\"s1\").style.display = 'none';\r\n\t\tdocument.getElementById(\"s3\").style.display = 'none';\r\n\t\tdocument.getElementById(\"tsk-due-time-lbl\").classList.add('tune-right');\r\n\t} else {\r\n\t\t// at least one of the two input elements, either the task's text or the task's due date, or both, are empty\r\n\t\tdocument.getElementById(\"s2\").style.display = 'inline';\r\n\t\tif ( (tt == \"\") && (tdd != \"\") ) {\r\n\t\t\tdocument.getElementById(\"s1\").style.display = 'inline';\r\n\t\t\tdocument.getElementById(\"s3\").style.display = 'none';\r\n\t\t\tdocument.getElementById(\"tsk-due-time-lbl\").classList.add('tune-right');\r\n\t\t} else if ( (tdd == \"\") && (tt != \"\") ) {\r\n\t\t\tdocument.getElementById(\"s1\").style.display = 'none';\r\n\t\t\tdocument.getElementById(\"s3\").style.display = 'inline';\r\n\t\t\tdocument.getElementById(\"tsk-due-time-lbl\").classList.remove('tune-right');\r\n\t\t} else if ( (tdd == \"\") && (tt == \"\") ) {\r\n\t\t\tdocument.getElementById(\"s1\").style.display = 'inline';\r\n\t\t\tdocument.getElementById(\"s3\").style.display = 'inline';\r\n\t\t\tdocument.getElementById(\"tsk-due-time-lbl\").classList.remove('tune-right');\r\n\t\t}\r\n\t}\r\n}", "errorStyles(style) {\r\n if(style === \"add\") {\r\n this.inputPeopleLabel.classList.add(\"error\");\r\n this.inputPeople.classList.add(\"error__border\");\r\n }\r\n if(style === \"remove\") {\r\n this.inputPeopleLabel.classList.remove(\"error\");\r\n this.inputPeople.classList.remove(\"error__border\");\r\n }\r\n }", "function checkRequired() {\n const req = Array.from(document.querySelectorAll('.req'));\n let returnValue = 0;\n req.forEach(c => {\n const reqField = Array.from(c.querySelectorAll('.reqfield'));\n let insert = 0;\n reqField.forEach(element => {\n if (element.value == '') {\n element.classList.add(\"errfield\");\n //c.style.background ='rgb(255, 237, 237)';\n \n insert = 1;\n returnValue =1;\n }\n });\n if(insert)\n {\n c.classList.add(\"errForm-section\");\n if(!c.querySelector('.block1')){\n let iDiv = document.createElement('div');\n iDiv.id = 'block';\n iDiv.className = 'block1';\n iDiv.innerHTML = \"! this feild is required\";\n c.appendChild(iDiv); \n }\n }\n });\n if(!checkEmail())\n returnValue = 1; \n \n if(returnValue)\n {\n return false;\n }\n return true;\n }", "function checkusername(username){\r\n if(username.length>7){\r\n document.getElementById(\"username\").classList.add(\"success\")\r\n document.getElementById(\"username\").classList.replace(\"error\",\"success\") //use replace instead of add //adding css proprty directly to javascript \r\n document.getElementById(\"username_error\").innerText=\" \"\r\n }else{\r\n document.getElementById(\"username\").classList.add(\"error\")\r\n document.getElementById(\"username_error\").innerText=\"username must be 8 letters long\"\r\n }\r\n}", "getClass() {\n const { isEditorApplyClass, isEditorClosed, isEditorApplyMaxClass, isEditorMaxed } = this.props;\n let cls = 'editor';\n if ( isEditorApplyClass ) cls += ' scale0';\n if ( isEditorClosed ) cls += ' closed';\n if ( isEditorApplyMaxClass ) cls += ' maxClass';\n if ( isEditorMaxed ) cls += ' maxed';\n\n return cls;\n }", "function frm_validate(class_name = ''){\n\n var input_c = $(class_name+' input[type=\"text\"]:required').length;\n if(input_c>0){\n var input = false;\n $(class_name+' input[type=\"text\"]:required').each(function(i, e){\n\n var value = $(e).val();\n if(value!=''){\n input = true;\n $(e).addClass('border-success').removeClass('border-danger');\n }\n else{\n $(e).addClass('border-danger').removeClass('border-success');\n }\n\n })\n }\n else{\n input = true;\n }\n\n var textarea_c = $(class_name+' textarea:required').length;\n if(textarea_c>0){\n var textarea = false;\n $(class_name+' textarea:required').each(function(i, e){\n\n var value = $(e).val();\n if(value!=''){\n textarea = true;\n $(e).addClass('border-success').removeClass('border-danger');\n }\n else{\n $(e).addClass('border-danger').removeClass('border-success');\n }\n\n })\n }\n else{\n textarea = true\n }\n\n var select_c = $(class_name+' select:required').length;\n if(select_c>0){\n var select = false;\n $(class_name+' select:required').each(function(i, e){\n\n var value = $(e).val();\n if(value!=''){\n select = true;\n $(e).addClass('border-success').removeClass('border-danger');\n }\n else{\n $(e).addClass('border-danger').removeClass('border-success');\n }\n\n })\n }\n else{\n select = true;\n }\n\n var input_file_c = $(class_name+' input[type=\"file\"]:required').length;\n if(input_file_c>0){\n var input_file = false;\n $(class_name+' input[type=\"file\"]:required').each(function(i, e){\n var value = $(e).val();\n if(value!=''){\n input_file = true;\n $(e).addClass('border-success').removeClass('border-danger');\n }\n else{\n $(e).addClass('border-danger').removeClass('border-success');\n }\n })\n }\n else{\n input_file = true;\n }\n\n if(input && textarea && input_file && select){\n return true;\n }\n else{\n return false;\n }\n }", "function empty_field_validation(first_class, second_class) {\n\n var container = document.getElementsByClassName(first_class)[0];\n var input = container.getElementsByClassName(\"required\");\n var url = container.getElementsByClassName(\"url\");\n var tmp = [];\n $(input).each(function (i) {\n if ($(this).val().trim() == \"\") {\n if (this.nextSibling.nodeName == \"SPAN\") {\n this.nextSibling.remove();\n }\n\n $(this).addClass(\"border-danger\");\n $(\"<span class='text-danger required-notice float-left mx-1'><i class='fa fa-warning'></i> This field can`t be empty</span>\").insertAfter(this);\n }\n else {\n tmp[i] = $(this).val().trim();\n if (this.type == \"email\") {\n validate_email(this);\n }\n }\n });\n\n // validate url field\n $(url).each(function () {\n if ($(this).val().trim() != \"\") {\n validate_url(this);\n }\n });\n\n // slide if all required field is not empty\n if (tmp.length == input.length && $(\".required-notice\").length == 0) {\n company_valudition(first_class, second_class);\n }\n\n // remove required message on input\n $(input).each(function () {\n $(this).on(\"input\", function () {\n if (this.nextSibling.nodeName == \"SPAN\") {\n $(this).removeClass(\"border-danger\");\n this.nextSibling.remove();\n }\n });\n });\n\n // remove url message on input\n $(url).each(function () {\n $(this).on(\"input\", function () {\n if (this.nextSibling.nodeName == \"SPAN\") {\n $(this).removeClass(\"border-danger\");\n this.nextSibling.remove();\n }\n });\n });\n\n }", "isLoading() {\n const { searchField } = this.state;\n let classes = \"control is-medium\";\n if (searchField !== []) {\n classes + \" is-loading\";\n }\n return classes;\n }", "function validInput(obj) {\n if(obj.hasClass('i-user')) {\n if(obj.val() == '' || /^[ ]+$/.test(obj.val())) {\n obj.removeClass('ok').addClass('error');\n\n } else if(!/[a-zA-Zа-яА-Я- ]+/.test(obj.val())) {\n obj.removeClass('ok').addClass('error');\n\n } else {\n obj.removeClass('error').addClass('ok');\n }\n\n } else if(obj.hasClass('i-phone')) {\n if(obj.val() == '' ) {\n //if(obj.val() == '' || /[ ]+/.test(obj.val())) {\n obj.removeClass('ok').addClass('error');\n\n } else if(/[_]+/.test(obj.val())) {\n obj.removeClass('ok').addClass('error');\n\n } else {\n obj.removeClass('error').addClass('ok');\n }\n }\n}", "function resetFieldText(obj, inputClassName) {\n /// <summary>重設輸入框預設值</summary>\n /// <param name=\"obj\">對應物件</param>\n /// <param name=\"inputClassName\">CSS Class 樣式</param>\n\n if (obj.value == '') {\n obj.value = obj.defaultValue;\n obj.className = inputClassName;\n }\n}", "function textClasses() {\n $('input[type=submit]').addClass('button');\n $('input[type=button]').addClass('button');\n \n\t$('input[type=text]').addClass('text');\n\t$('input[type=password]').addClass('text');\n \n $('.small input[type=text]').addClass('small');\n $('.small select').addClass('small');\n $('.small input[type=submit]').addClass('small');\n $('.small input[type=button]').addClass('small');\n}", "renderTextField(field) {\n const {meta} = field;\n const className = `form-control col-sm-6 ${meta.touched && meta.error ? 'is-invalid' : ''}`;\n return (\n <div className=\"form-group row \">\n <label className=\"col-sm-3 col-form-label\">{field.label}</label>\n <input\n className={className}\n type=\"text\"\n {...field.input}\n />\n <div className=\"invalid-feedback col-sm-4\">\n {meta.touched ? meta.error : ''}\n </div>\n </div>\n );\n }", "function detectMandatory( event ) {\n\t\t\tvar inputValue = event.target.value;\n\t\t\tvar mandatoryElement = $( event.target ).next( \".form-control-feedback\" ).find( \".icon\" );\n\n\t\t\tif ( inputValue.length > 0 ) {\n\t\t\t\tmandatoryElement.removeClass( \"icon-mandatory\" );\n\t\t\t} else {\n\t\t\t\tmandatoryElement.addClass( \"icon-mandatory\" );\n\t\t\t}\n\t\t}", "function lessOneNotNull(className) {\n var bool = false;\n $('.' + className).each(function (index, value) {\n if ($(this).val() !== '') {\n bool = true;\n return;\n }\n });\n return bool;\n}", "function checkValidUserUpTodos() {\n var nombreup2Todos = $(\"#nombreup2Todos\").val();\n var nombreinput2Todos = $(\"#nombreup2Todos\");\n\n if (nombreup2Todos == \"\") {\n nombreinput2Todos.addClass(\"is-invalid\");\n $(\"#statusName2Todos\").html(\n '<span class=\"label label-success\" style=\"color: red\">Campo obligatorio</span>'\n );\n } else {\n $(\"#statusName2Todos\").html(\"\");\n nombreinput2Todos.removeClass(\"is-invalid\");\n nombreinput2Todos.addClass(\"is-valid\");\n return false;\n }\n}", "function SP_DynamicRequireToggle(labelName, fieldName, flag)\n{\n\tSP_RequiredLabelToggle(labelName, flag);\n\tSP_ToggleFieldShadow(fieldName, \"PinkShadow\", flag); //This call is to ensure v11 style formatting for required fields\n\tmcRequireToggle(fieldName, flag);\n\tif(!flag)\n\t{\n\t\tvar oBorderStyle = document.getElementById(fieldName).style.border;\n\t\tif(oBorderStyle == \"thick solid red\" || oBorderStyle == \"red thick solid\")\n\t\t{\n\t\t\tdocument.getElementById(fieldName).style.border = \"1px solid #A5C0dF\";\n\t\t}\n\t}\n\t\n\tif(arguments[3] && arguments[4])\n\t{\n\t\tSP_DynamicTabLabel(arguments[3],arguments[4]);\n\t}\n}", "function addReqClass(pEl, pClass, pValidClass, pReqClass) {\n\n\t$('#' + pEl).closest('div').removeClass(pClass);\n\tif(pValidClass) {\n\t\t$('#' + pEl).closest('div').removeClass(pValidClass);\n\t}\n\n\t$('#' + pEl).closest('div').addClass(pReqClass);\n\n}", "function checkErrorMessage(value) {\n if(value.trim()=='') {\n var errorMessage = document.getElementById('errorMessage');\n var message = document.getElementById('message');\n errorMessage.classList.add('showElement');\n message.classList.add('invalidField');\n } \n}", "function validateRequiredField(field) {\n\n // Remove the unnecessary blanks at the front and back\n field.value = field.value.trim();\n\n // check to see if it's valid\n var valid = field.value.length > 0;\n\n // Valid like salad!\n if (valid) {\n field.className = 'form-control';\n } else {\n field.className = 'form-control invalid-field';\n }\n\n return valid;\n}", "function validate_userType() {\n var length = $(\"[name='userType']:checked\").length;\n if (length == 0) {\n $(\"#userTypeError\").show();\n $(\"#userTypeError\").html(\"***Please SELECT <b>User TYPE</b>\");\n $(\"#userTypeError\").css(\"color\", \"red\");\n userTypeError = false\n } else {\n\n $(\"#userTypeError\").hide();\n userTypeError = true;\n var elements = document.getElementsByName(\"userType\");\n for (var i = 0; i < elements.length; i++) {\n if (elements[i].checked && elements[i].defaultValue == \"Vendor\") {\n $(\"#userFor\").val(\"Purchase\")\n }\n if (elements[i].checked && elements[i].defaultValue == \"Customer\") {\n $(\"#userFor\").val(\"Sale\")\n }\n }\n $(\"#userForError\").hide();\n }\n\n return userTypeError;\n }", "function isValid($fieldWrap){\n $fieldWrap.removeClass(\"invalid\").addClass(\"valid\");\n }", "function inputReq(event) {\n\tif (event.currentTarget.value == '') {\n\t\tevent.currentTarget.parentNode.classList.add('border-red');\n\t\tevent.currentTarget.parentNode.classList.remove('acct-border');\n\t\tevent.currentTarget.parentNode.nextElementSibling.style.visibility = \"visible\";\n\n\t} else {\t\n\t\tevent.currentTarget.parentNode.classList.remove('border-red');\n\t\tevent.currentTarget.parentNode.classList.add('acct-border');\n\t\tevent.currentTarget.parentNode.nextElementSibling.style.visibility = \"hidden\";\n\n\t}\n}", "function checkAllRequiredFieldsHaveInput(){\n $('#user-table ._REQUIRED').each(function(index, thisEntry){ \n if($(thisEntry).val() == \"\") { \n $(thisEntry).addClass('MISSING');\n } else {\n $(thisEntry).removeClass('MISSING');\n }\n });\n \n \n \n //We only need to enable the the save button if there are NO missing\n //The bool returns are only for some needs\n console.log($('#user-table .MISSING').length + \" : \" + $('#user-table ._DELUSER').length + \" : \" + $('#user-table ._EDITED').length);\n if ( ($('#user-table ._NEWUSER').length > 0 || $('#user-table ._DELUSER').length > 0 || $('#user-table ._EDITED').length > 0 ) && $('#user-table .MISSING').length == 0 ) {\n $('#submit-user-changes').prop('disabled', false);\n\n } else { \n $('#submit-user-changes').prop('disabled', true);\n\n }\n \n \n \n}", "function DrawClassInput(sCourseCount, sGradePicklist, sGradeInput, sCreditsLit, sForm)\n{\n//alert (\"DrawClassInput - enter\");\n if (sGradeInput == \"L\") // if the Grade Inputs are supposed to be \"L\" for Letter Grades\n {\n iNumClasses = aClassListArray.length;\n\t if (sGradePicklist.length < 1)\n\t {\n\t\t rite('<span class=\"GPATermResultCellBig\">');\n\t\t rite('ERROR <br>');\n\t\t rite('The Grade Information in UCX-STU385 has not been set up. Please alert the Computer Center. ');\n\n\t\t rite('We apologize for the inconvenience. </span>');\n\t }\n\t else{\n\t for (ClassNum = 1; ClassNum <= sCourseCount ; ClassNum++ )\n\t {\n\t\trite('<!-- Class ' + ClassNum + ' Begin -->');\n\t\trite(' <tr height=\"2\" width=\"90%\">');\n\t\trite(' <td nowrap align=left class=\"GPAFormTitle\" width=\"25%\" headers=\"blank1\"></td>');\n \n // COURSE KEY\n\t\trite(' <td nowrap align=left class=\"GPAFormTitle\" width=\"20%\" headers=\"ClassName\">');\n\t\trite(' <input class=\"GPAClassInputText\" size=\"14\" maxlength=\"20\" name=\"FAUXCLASS' + ClassNum + '\"');\n\t\tif (ClassNum <= iNumClasses && aClassListArray[ClassNum - 1] != undefined)\n\t\t\trite(' value=\"' + aClassListArray[ClassNum - 1].sCourseKey + '\"');\n\t\telse if (sForm.NEXTFORM.value == \"1STTIME\")\n\t\t\trite(' value=\"Class ' + ClassNum + '\"');\n else // no class in this slot - leave it blank \n\t\t\trite(' value=\"\"');\n\t\trite(' onfocus=\"ClearField(sForm.CLASS' + ClassNum + ');\"');\n\t\trite('onKeyPress=\"checkEnter(event, \\'TERM\\', sForm, sCreditsLit, sCourseCount, sGradePicklist, iRounding);\">');\n\t\trite('\t </td>');\n \n // CREDITS\n\t\trite(' <td align=left width=\"15%\" headers=\"Credits\">');\n\t\trite('<input class=\"GPAClassInputText\" size=\"3\" maxlength=\"5\"');\n\t\trite(' name=\"NUMCRED' + ClassNum + '\" id=\"NUMCRED' + ClassNum + '\" ');\n\t\tif (ClassNum <= iNumClasses && aClassListArray[ClassNum - 1] != undefined)\n\t\t\trite(' value=\"' + aClassListArray[ClassNum - 1].iCredits + '\"');\n\t\telse // leave credits blank\n\t\t\trite(' value=\"\"');\n\t\trite('onKeyPress=\"checkEnter(event, \\'TERM\\', sForm, sCreditsLit, sCourseCount, sGradePicklist, iRounding);\"');\n\t\trite(' </td>');\n\t\t\n // GRADES - letter grades from STU385\n\t\tif (sGradeInput == \"L\") // If the input type is Picklist (\"L\" for Letter Grades)\n\t\t{\n\t\trite(' <td align=left width=\"15%\" headers=\"Grade\">');\n\t\trite(' <select name=\"GRADE' + ClassNum + '\" id=\"GRADE' + ClassNum + '\" size=\"1\" ');\n\t\trite(' nowrap accesskey=\"s\" style=\"font-family:Courier;\"');\n\t\trite('onKeyPress=\"checkEnter(event, \\'TERM\\', sForm, sCreditsLit, sCourseCount, sGradePicklist, iRounding);\">');\n\n // Note: it says \"credits\" below but it really means \"grade-number\"\n\t\tfor (x = 0; x < sGradePicklist.length ; x++ )\n\t\t\t{\n\t\t\tsGradeOption = '<option value=\"' + sGradePicklist[x].grade + '['+ sGradePicklist[x].credits + ']\" ';\n // If this is the grade on the course (exists when the 1st page is redisplayed) then select this option\n if (ClassNum <= iNumClasses && aClassListArray[ClassNum - 1].sGrade == sGradePicklist[x].grade)\n sGradeOption = sGradeOption + ' selected ';\n\t\t\tif (sGradePicklist[x].grade.length > 1) // has plus or minus; don't need the extra space\n sDisplayGrade = sGradePicklist[x].grade;\n else // Grade is only 1 char - add a space\n sDisplayGrade = sGradePicklist[x].grade + \" \";\n sGradeOption = sGradeOption + '\"> ' + sDisplayGrade + '[' + sGradePicklist[x].credits + ']</option>';\n rite (sGradeOption);\n\t\t\t}\n\t\t}\n // GRADES - numeric grades - STU385 is not used\n // NOTE: at the top of this function we check for GradeInput=L so this code will never be TRUE - it is dead code\n\t\telse if (sGradeInput == \"N\") // If the input type is Input Box (\"N\" for Numeric Grades)\n\t\t{\n\t\trite(' <td align=right width=\"15%\" headers=\"Grade\">');\n\t\trite('<input class=\"GPAClassInputText\" type=\"text\" size=\"3\" maxlength=\"4\"');\n\t\trite(' name=\"GRADE' + ClassNum + '\" id=\"GRADE' + ClassNum + '\" value=\"\"');\n\t\trite('onKeyPress=\"checkEnter(event, \\'TERM\\', sForm, sCreditsLit, sCourseCount, sGradePicklist, iRounding);\"');\n\n\t\trite('>');\n\t\t}\n\t\t// END display Grades as input boxes \n\t\trite(' </td>');\n\t\trite(' <td align=left width=\"25%\" headers=\"blank2\">');\n\t\trite(' </td>');\n\t\trite(' </tr>');\n\t\trite('<!-- Course ' + ClassNum + ' End -->');\n\t\n\t}\n }\n }\n}", "function togpassvisi() {\n var pasinput = document.getElementById(\"password\");\n var eyebtn = document.getElementById('togvisi');\n var classes = eyebtn.getAttribute('class');\n eyebtn.removeAttribute('class');\n // console.log(classes);\n if (pasinput.type === \"password\") {\n pasinput.type = \"text\";\n eyebtn.setAttribute('class', 'fas fa-eye-slash hs');\n } else {\n pasinput.type = \"password\";\n eyebtn.setAttribute('class', 'fas fa-eye hs');\n }\n}", "function validatorFields(frm) {\n let ky = 0;\n frm.find('.required').each(function () {\n if ($(this).val() == '' || $(this).val() == 0) {\n $(this).addClass('textbox-alert');\n $(this)\n .parent()\n .children('.textAlert')\n .css({ visibility: 'visible' });\n\n ky = 1;\n }\n });\n return ky;\n}", "function createFormInput(pref, prefName, text){\r\n var elm = document.createElement('input');\r\n elm.className = \"lc_preferencesInput\";\r\n elm.name = prefName;\r\n switch(typeof pref){\r\n case \"string\":\r\n case \"number\":\r\n elm.value = pref;\r\n if(arguments[3]) elm.size = arguments[3];\r\n break;\r\n case \"boolean\":\r\n elm.type = \"checkbox\";\r\n elm.checked = pref;\r\n break;\r\n case \"object\":\r\n elm.type = \"radio\"; // pref = [\"pref value\", true]\r\n elm.value = pref[0]; // preference value\r\n elm.checked = pref[1]; // true or false\r\n }\r\n preferencesForm.appendChild(document.createElement('label')).appendChild(elm);\r\n elm.parentNode.insertBefore(document.createTextNode(text), elm);\r\n }", "function validateForm() {\n if($('.recipient input').val() === \"\") {\n return \"recipient\";\n }else if($('.first-name input').val() === \"\") {\n return \"first name\";\n }else if(emailAvailable === \"taken\") {\n return \"email\";\n }else if($('.password input').val().length < 4){\n return \"password\";\n }else{\n return \"success\";\n }\n }", "function validate(){ \n var allInputs = $(\":input\");\n var list = \"<ul>\"\n var errors = false;\n $.each(allInputs, function(key, objValue){\n if($(this).prop('required')){ \n if(!$(this).val()){ \n errors = true;\n $(this).css(\"background-color\", \"#f8d7da\");\n list += \"<li>\" + objValue.placeholder + \"</li>\"\n event.preventDefault();\n } else {\n $(this).css(\"background-color\", \"#d4edda\");\n }\n }; \n });\n list += \"<ul>\";\n if(true == errors){\n $(\"#requiredFields\").removeAttr('hidden');\n document.getElementById(\"requiredFields\").innerHTML = list;\n };\n}", "function createRegisterInput(container,type, classHere,idHere, placeholder, pattern, title, required){\n try {\n const input = document.createElement('input');\n input.type = type;\n input.classList = classHere;\n input.id = idHere;\n input.placeholder = placeholder;\n input.pattern = pattern;\n input.title = title;\n input.required = required;\n container.appendChild(input);\n return input;\n } catch (e) {\n return \"createRegisterInput didnt work\";\n }\n}", "function validateFormUserParameter(event, state) {\n // clear all error messages\n const inputs = document.getElementsByClassName('is-danger');\n for (let i = 0; i < inputs.length; i++) {\n if (!inputs[i].classList.contains('error')) {\n inputs[i].classList.remove('is-danger');\n }\n }\n // check for blank field in setOwnGoal section\n if (state.hasOwnProperty('kcalGoal') && state.kcalGoal === '' && state.setOwnGoal === true) {\n document.getElementById('kcalGoal').classList.add('is-danger');\n return { blankfield: true };\n }\n if (state.hasOwnProperty('proteinGoal') && state.proteinGoal === '' && state.setOwnGoal === true) {\n document.getElementById('proteinGoal').classList.add('is-danger');\n return { blankfield: true };\n }\n if (state.hasOwnProperty('fatGoal') && state.fatGoal === '' && state.setOwnGoal === true) {\n document.getElementById('fatGoal').classList.add('is-danger');\n return { blankfield: true };\n }\n if (state.hasOwnProperty('carbGoal') && state.carbGoal === '' && state.setOwnGoal === true) {\n document.getElementById('carbGoal').classList.add('is-danger');\n return { blankfield: true };\n }\n // check for blank fields in custom section\n if (state.hasOwnProperty('gender') && state.gender === '' && state.setOwnGoal === false) {\n document.getElementById('gender').classList.add('is-danger');\n return { blankfield: true };\n }\n if (state.hasOwnProperty('activity') && state.activity === '' && state.setOwnGoal === false) {\n document.getElementById('activity').classList.add('is-danger');\n return { blankfield: true };\n }\n if (state.hasOwnProperty('goal') && state.goal === '' && state.setOwnGoal === false) {\n document.getElementById('goal').classList.add('is-danger');\n return { blankfield: true };\n }\n if (state.hasOwnProperty('weight') && state.weight === '' && state.setOwnGoal === false) {\n document.getElementById('weight').classList.add('is-danger');\n return { blankfield: true };\n }\n if (state.hasOwnProperty('height') && state.height === '' && state.setOwnGoal === false) {\n document.getElementById('height').classList.add('is-danger');\n return { blankfield: true };\n }\n if (state.hasOwnProperty('age') && state.age === '' && state.setOwnGoal === false) {\n document.getElementById('age').classList.add('is-danger');\n return { blankfield: true };\n }\n \n \n // regex expression\n\n const numberRegexKcal = /^[0-9]{4}([,.][0-9]{1,2})?$/;\n const numberRegex = /^[0-9]{2,3}([,.][0-9]{1,2})?$/;\n // regex check for setOwnGoal\n if (state.hasOwnProperty('kcalGoal') && !numberRegexKcal.test(state.kcalGoal) && state.setOwnGoal === true ) {\n document.getElementById('kcalGoal').classList.add('is-danger');\n return { blankfield: false ,invalidFormat: true };\n }\n if (state.hasOwnProperty('proteinGoal') && !numberRegex.test(state.proteinGoal) && state.setOwnGoal === true ) {\n document.getElementById('proteinGoal').classList.add('is-danger');\n return { blankfield: false ,invalidFormat: true };\n }\n if (state.hasOwnProperty('fatGoal') && !numberRegex.test(state.fatGoal) && state.setOwnGoal === true ) {\n document.getElementById('fatGoal').classList.add('is-danger');\n return { blankfield: false ,invalidFormat: true };\n }\n if (state.hasOwnProperty('carbGoal') && !numberRegex.test(state.carbGoal) && state.setOwnGoal === true ) {\n document.getElementById('carbGoal').classList.add('is-danger');\n return { blankfield: false ,invalidFormat: true };\n }\n // regex check for custom section\n if (state.hasOwnProperty('weight') && !numberRegex.test(state.weight) && state.setOwnGoal === false ) {\n document.getElementById('weight').classList.add('is-danger');\n return { blankfield: false ,invalidFormat: true };\n }\n if (state.hasOwnProperty('height') && !numberRegex.test(state.height) && state.setOwnGoal === false ) {\n document.getElementById('height').classList.add('is-danger');\n return { blankfield: false ,invalidFormat: true };\n }\n if (state.hasOwnProperty('age') && !numberRegex.test(state.age) && state.setOwnGoal === false ) {\n document.getElementById('age').classList.add('is-danger');\n return { blankfield: false ,invalidFormat: true };\n }\n // own callory set makro not match exception\n const calculationSum = state.proteinGoal * 4 + state.fatGoal * 9 + state.carbGoal * 4;\n\n if ( calculationSum !== Number(state.kcalGoal) && state.setOwnGoal === true ) {\n document.getElementById('kcalGoal').classList.add('is-danger');\n return { invalidSum: true };\n }\n\n }", "function usernamePassed() {\n var username = document.getElementById(\"usernamefeedback\");\n username.setAttribute(\"class\", \"form-group has-success has-feedback\");\n}", "function checkErrorEmail(value) {\n if(value.trim()=='') {\n var errorEmail = document.getElementById('errorEmail');\n var email = document.getElementById('email');\n errorEmail.classList.add('showElement');\n email.classList.add('invalidField');\n } \n}" ]
[ "0.684388", "0.6082944", "0.6043315", "0.6038432", "0.58463854", "0.5785473", "0.5770614", "0.57303566", "0.57255924", "0.57164735", "0.5619832", "0.557445", "0.5556102", "0.55518055", "0.5519978", "0.5514215", "0.5513528", "0.5507767", "0.5443522", "0.5426768", "0.5426207", "0.5423119", "0.541276", "0.5409376", "0.5398663", "0.5398403", "0.5393621", "0.53847146", "0.53770936", "0.53755474", "0.5357336", "0.53534615", "0.53433436", "0.53431547", "0.5339919", "0.533163", "0.5318945", "0.5307872", "0.53073", "0.5298728", "0.5283529", "0.52791154", "0.52777034", "0.5277026", "0.5271843", "0.52503145", "0.52350444", "0.5229008", "0.5228506", "0.5204802", "0.52018344", "0.51992816", "0.5192138", "0.51757234", "0.5167357", "0.51672447", "0.5165507", "0.5147958", "0.5145583", "0.51437926", "0.5142495", "0.51411545", "0.5124529", "0.5099489", "0.5090137", "0.5088979", "0.50774014", "0.50755525", "0.5059699", "0.5057939", "0.5056188", "0.5046115", "0.5043854", "0.5043645", "0.50385207", "0.50216454", "0.50195134", "0.5012645", "0.5010275", "0.5002926", "0.5001587", "0.49992737", "0.4996547", "0.49941528", "0.4987777", "0.4968031", "0.49623495", "0.49605384", "0.4959484", "0.49590564", "0.49511936", "0.49496806", "0.4949255", "0.49364862", "0.49254277", "0.49251765", "0.49147263", "0.49028596", "0.49015433", "0.48980883" ]
0.7445592
0
Utility function to validate a userPref input element
function validatePrefInput(element) { var isValid = true; var jqEl = $(element); // if the input is required verify it's trimmed input length is > 0 if (jqEl.hasClass(WIDGET_PREFS_INPUT_REQUIRED_CLASS)) { isValid = $.trim(jqEl.val()).length > 0; } return isValid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkElement(element)\r\n{\r\n var isRequired = element.getAttribute(\"isRequired\");\r\n var inputValue = element.value;\r\n if (inputValue == \"无权限查看\")\r\n return true;\r\n\r\n var validChar = GetValidChar(element.getAttribute(\"validEnum\"));\r\n\r\n //过滤特殊字符\r\n if (inputValue.length > 1 && (element.type == \"text\" || element == \"textarea\"))\r\n {\r\n var temp = \"\\\\(|\\\\)|'|;|and|exec|insert|select|delete|update|count|%|chr|mid|master|truncate|char|declare|&|#|\\\\$\";\r\n var regex1 = new RegExp(temp, \"g\");\r\n\r\n element.value = inputValue.replace(regex1, \"\").trim();\r\n }\r\n\r\n //判断长度\r\n var minLength = element.getAttribute(\"MinLength\");\r\n if (minLength != null && inputValue.length < minLength) {\r\n return false;\r\n }\r\n\r\n if (isRequired == \"true\")\r\n {\r\n if (inputValue.length < 1)\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n\r\n if (validChar != null)\r\n {\r\n\r\n var regex = new RegExp(validChar);\r\n return regex.test(inputValue);\r\n }\r\n }\r\n }\r\n else\r\n {\r\n if (inputValue.length < 1)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n if (validChar != null)\r\n {\r\n var regex = new RegExp(validChar);\r\n return regex.test(inputValue);\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n}", "function validateUserInput( $input ) {\r\r\n\r\r\n\t\tvar input = $input;\r\r\n\r\r\n\t\t// Check string for #NONE# indicating no vendor type selected\r\r\n\t\tif( input === '#NONE#' ) {\r\r\n\t\t\treturn false;\r\r\n\t\t}\r\r\n\r\r\n\t\t// Check for empty or null values\r\r\n\t\tif( !input.trim() ) {\r\r\n\t\t\treturn false;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\treturn true;\r\r\n\t}", "function upnpConfValidate(){\n\n\tvar txtFieldIdArr = new Array();\n txtFieldIdArr[0] = \"tf1_advertPeriod, \"+LANG_LOCALE['12203'];\n txtFieldIdArr[1] = \"tf1_adverttime, \"+LANG_LOCALE['12204'];\n \n if (txtFieldArrayCheck(txtFieldIdArr) == false) \n return false;\n\n if (isProblemCharArrayCheck(txtFieldIdArr, \"'\\\" \", NOT_SUPPORTED) == false) \n return false;\n\n var advObj = document.getElementById('tf1_advertPeriod');\n if (advObj && !advObj.disabled) {\n if (numericValueRangeCheck(advObj, 1, '', 1, 86400, true, LANG_LOCALE['11207']+': ', LANG_LOCALE['11167']) == false) \n return false;\n }\n var advObj = document.getElementById('tf1_adverttime');\n if (advObj && !advObj.disabled) {\n if (numericValueRangeCheck(advObj, 1, '', 1, 255, true, LANG_LOCALE['11208']+': ', LANG_LOCALE['13499']) == false) \n return false;\n }\n return true;\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 verifyField(element)\n{\n if (!element.value)\n {\n flashField(element);\n }\n}", "function userV() {\n var user = document.getElementById('user').value;\n if (user.length == 0) {\n showWarning(\"User field empty\");\n return false;\n } else if (user.indexOf(' ') !== -1) {\n showWarning(\"No spaces allowed\");\n return false;\n } else if (!user.match(/^[A-Za-z0-9]+$/)) {\n showWarning(\"Only numbers and letters for username\");\n return false;\n }\n\n return true;\n\n}", "function pWordValidation(pWordInput, pWordConfInput) {\n // Prefix with # to create an id selector\n pWordInput = \"#\" + pWordInput;\n\n // Create label element selector\n let pWordConfLabel = `label[for=\"${pWordConfInput}\"]`;\n\n // Prefix with # to create an id selector\n pWordConfInput = \"#\" + pWordConfInput;\n\n // Define default label text\n let labelText = \"Passwords do not match.\";\n\n // If passwords do not match, or the password is invalid, or is 0 length...\n if (($(pWordInput).val() !== $(pWordConfInput).val()) ||\n $(pWordInput).hasClass(\"invalid\") ||\n $(pWordInput).val().length === 0) {\n // Make the confirmation input invalid\n $(pWordConfInput).removeClass(\"valid\").\n addClass(\"invalid\");\n\n // If the password is invalid, or is 0 length...\n if ($(pWordInput).hasClass(\"invalid\") ||\n $(pWordInput).val().length === 0) {\n // Set the label text\n labelText = \"Invalid Password.\";\n }\n\n /* Update the confirmation input data-error attribute with the label */\n /* text, and return false (validation failed) */\n $(pWordConfLabel).attr(\"data-error\", labelText);\n return false;\n }\n // Otherwise, the password is valid so make the confirmation input valid\n $(pWordConfInput).removeClass(\"invalid\").\n addClass(\"valid\");\n return true; // return true (validation passed)\n}", "function validateInput(){\n\n}", "function PasswordTypeCheck() {\n if (!IncludeUpperCase && !IncludeLowerCase && !IncludeNumbers && !IncludeSpecialChar) {\n alert(\"The input type should include at least one character type, please try again!\");\n IsValid = false;\n UserChoice();\n } else {\n IsValid = true;\n console.log(\"The password type choice is valid\")\n }\n}", "function validateInput(elementName) {\n\n var element = document.getElementById(elementName);\n if ( ! element ) {\n return(true);\n }\n\n var elementType = element.getAttribute(\"axisType\");\n\n switch (elementType) {\n case \"ratingStars\" :\n break;\n\n case \"text\" : return(isValidInputText(elementName));\n break;\n\n case \"textarea\" : return(isValidInputTextArea(elementName));\n break;\n\n case \"email\": return(isValidInputEmail(elementName));\n break;\n\n case \"phone\": return(isValidInputPhone(elementName));\n break;\n\n case \"time_hour\": return(isValidInputHour(elementName));\n break;\n\n case \"time_minutes\": return(isValidInputMinutes(elementName));\n break;\n\n case \"date\": return(isValidInputDate(elementName));\n break;\n\n case \"color\": return(isValidInputColor(elementName));\n break;\n\n case \"icon\": return(isValidInputIcon(elementName));\n break;\n\n case \"password\" : return(isValidInputPassword(elementName));\n break;\n\n case \"pin\" : return(isValidInputPin(elementName));\n break;\n\n case \"number\" : return(isValidInputNumber(elementName));\n break;\n\n case \"zip\" : return(isValidInputZip(elementName));\n break;\n\n case \"city\" : return(isValidInputCity(elementName));\n break;\n\n case \"state\" : return(isValidInputState(elementName));\n break;\n\n case \"signature\" : return(isValidSignature(elementName));\n break;\n }\n return(true);\n}", "function validateInput(elem, isFieldExits){\n\n var currElement = $(elem);\n var originalClass = currElement.attr('class');\n var errorClassPosition = originalClass.lastIndexOf('error-field');\n \n if(errorClassPosition != -1){\n \n originalClass = originalClass.substring(0,errorClassPosition-1);\n currElement.attr({'class': originalClass});\n }\n \n if (!currElement.val() || isFieldExits === \"true\" ) {\n \n currElement.attr({'class': originalClass + ' error-field'});\n \n \n if(!currElement.val()){\n currElement.attr(\n \"data-content\", \"Это поле не может быть пустым!\"\n );\n currElement.popover(\"enable\");\n currElement.popover(\"show\");\n currElement.change(function(event) {\n currElement.popover(\"disable\");\n });\n }\n \n return false;\n }\n \n return true;\n \n}", "function checkInput() {\n // Check to see if the (numeric) points input field contains a value\n if ($(\"#quest-points-input\").prop(\"value\") == null || $(\"#quest-points-input\").prop(\"value\").length == 0) {\n $(\"#feedback\").html(\"Enter a point value\");\n $(\"#feedback\").css({\n color: \"red\"\n });\n $(\"#feedback\").show(0);\n $(\"#feedback\").fadeOut(2000);\n } else {\n validInput = true;\n }\n}", "function isValid(element){\n return element !== \"\"? true : false ;\n }", "function fn_CheckRequired ( theElement , theElementName )\n\t{\n\t\t/*\n\t\tif ( theElement == undefined )\n\t\t{\n\t\t\talert ( \"要求检查的项目(\" + theElementName\t+ \")并不是一个有效的JavaScript对象\" ) ;\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\ttheElement.value = trimString ( theElement.value ) ;\n\t\tif( theElement.value == \"\" )\n\t\t{\n\t\t\talert( \"\\\"\" + theElementName + \"\\\"\" + \"必须填写!\" ) ;\n\t\t\ttheElement.focus();\n\t\t\treturn false ;\n\t\t}\n\t\treturn true;\n\t}", "function isVaild(ele) {\n var id = ele.id || '';\n var val = ele.value || '';\n var sts = {\n 'isValid': true,\n 'errorMsg': ''\n }\n // Name and title validator\n if (id === 'name' || id === 'title') {\n if (!val.length) {\n sts['isValid'] = false;\n sts['errorMsg'] = `This field is required : ${id}`\n }\n }\n else if (id === 'extension') { // Extension validator\n var ext = Number(val);\n if (isNaN(ext) || ext < 0) {\n sts['isValid'] = false;\n sts['errorMsg'] = `Invalid ext!!`\n }\n }\n return sts;\n }", "function customValidation(input) { \n}", "function checkPrincipal()\n{\n var prc = document.getElementById(\"principal\").value;\n \n //If the user did not type in a positive number, they will not be allowed to compute their interest.\n if (prc <= 0)\n {\n alert(\"Please enter a positive number.\")\n document.getElementById(\"principal\").focus();\n return false;\n }\n\n return true;\n}", "function adjPresAffPlainCheckError() {\n let optionsGroup = document.getElementById(\"adjective-type-group\");\n let errorElement = optionsGroup.getElementsByClassName(\"must-choose-one-text\")[0];\n\n let selected = checkInputsForError(inputsToSelectAdjPresAffPlain, true);\n let unselected = checkInputsForError(inputsToDeselectAdjPresAffPlain, false);\n\n let iAdjInput = document.querySelectorAll('input[name=\"adjectivei\"]')[0];\n let irrAdjInput = document.querySelectorAll('input[name=\"adjectiveirregular\"]')[0];\n let naAdjInput = document.querySelectorAll('input[name=\"adjectivena\"]')[0];\n if (selected && unselected && !naAdjInput.checked && (iAdjInput.checked || irrAdjInput.checked)) {\n toggleError(errorElement, \"*Invalid combination: い/irregular, present, affirmative, plain\", true);\n // element could be hidden because verb is unchecked, so check to enable back button\n checkToEnableBackButton();\n } else if (document.querySelectorAll('input[name=\"adjective\"]')[0].checked){\n optionsGroupCheckError(optionsGroup);\n }\n}", "function validate (input) {\n \t//ver dps..\n \treturn true;\n }", "'validateValue'(value) {}", "function inputAvailable(div) {\n if (div.value) {\n return false;\n } else if (!div.value || div.value === undefined) {\n return true;\n }\n}", "validateInput(elem){\n\n // checking if the input field is empty and if there are any message not shown\n if (elem.value === '' && elem.nextElementSibling.nextElementSibling.tagName !== 'SPAN'){\n let name;\n if (elem.name === 'name'){\n name = 'Name';\n }else if (elem.name === 'address'){\n name = 'Address';\n }else if (elem.name === 'phone'){\n name = 'Phone';\n }else if (elem.name === 'engineNo'){\n name = 'Engine No';\n }else if (elem.name === 'licenseNo'){\n name = 'License No';\n }\n this.ui.showError(elem, `${name} can not be empty`);\n }else if (elem.value !== '' && elem.nextElementSibling.nextElementSibling.tagName === 'SPAN'){\n this.ui.clearError(elem.nextElementSibling.nextElementSibling);\n }\n }", "function CheckUserPrefs(){\r\n if(UserPrefs.storePrefs && GM_getValue){\r\n for(opt in UserPrefs){\r\n if(opt == \"storePrefs\"){ continue; }\r\n if(opt == \"message\"){ continue; }\r\n if(typeof UserPrefs[opt] !== \"boolean\"){\r\n GM_log(\"CheckUserPrefs: UserPrefs \" + opt +\r\n \" not boolean - must be true or false\");\r\n UserPrefs[opt] = true;\r\n }\r\n UserPrefs[opt] = SetUserPref(opt, UserPrefs[opt]);\r\n }\r\n }\r\n function SetUserPref(pref,val){\r\n try{\r\n var curPref = GM_getValue(pref);\r\n }catch(e){\r\n GM_log(\"SetUserPref(\\\"\" + pref + \"\\\") thew an exception... \" + e.message);\r\n if(e.name === \"NS_ERROR_UNEXPECTED\") alert(\"You need to restart or set pref: \" + pref);\r\n return false;\r\n }\r\n if(curPref !== undefined) return curPref;\r\n var userval = confirm(\"MU_Bundle UserScript option:\\n \" + UserPrefs.message[pref] + \"?\");\r\n if(typeof userval === \"boolean\"){ val = userval }\r\n else{ GM_log(\"SetUserPref: confirm did not return boolean\") }\r\n GM_setValue(pref, val);\r\n return val;\r\n }\r\n}", "function checkDesiredCustomProfileURL (input) {\n var check = input.toString().trim()\n\n // Check to make sure characters are legal\n var illegalChar = check.match(/[^A-Za-z0-9_-]+/)\n if (illegalChar && illegalChar.length > 0) {\n return 'Please only use letters, numbers, hyphens, and underscores.'\n }\n // Check string length is OK\n if (check.length < 4) {\n return 'Please enter more than four characters.'\n } else if (check.length > 32) {\n return 'Please enter no more than 32 characters.'\n }\n\n return true\n}", "function validInput(obj) {\n if(obj.hasClass('i-user')) {\n if(obj.val() == '' || /^[ ]+$/.test(obj.val())) {\n obj.removeClass('ok').addClass('error');\n\n } else if(!/[a-zA-Zа-яА-Я- ]+/.test(obj.val())) {\n obj.removeClass('ok').addClass('error');\n\n } else {\n obj.removeClass('error').addClass('ok');\n }\n\n } else if(obj.hasClass('i-phone')) {\n if(obj.val() == '' ) {\n //if(obj.val() == '' || /[ ]+/.test(obj.val())) {\n obj.removeClass('ok').addClass('error');\n\n } else if(/[_]+/.test(obj.val())) {\n obj.removeClass('ok').addClass('error');\n\n } else {\n obj.removeClass('error').addClass('ok');\n }\n }\n}", "function isValidInputField(inputElement) {\n if (!inputElement.value){\n inputElement.setAttribute('class', 'validate invalid');\n return false\n }\n return true;\n }", "function validarProvincia() {\n // comprobaremos que el valor del elemento provincia es igual que alguno de los valores reales, si lo es, devolvera true, si no dara error.\n if ((document.getElementById(\"provincia\").value)!=\"C\" && (document.getElementById(\"provincia\").value)!=\"LU\" && (document.getElementById(\"provincia\").value)!=\"OU\" && (document.getElementById(\"provincia\").value)!=\"PV\"){\n document.getElementById(\"provincia\").value = \"error!\";\n document.getElementById(\"provincia\").focus();\n document.getElementById(\"provincia\").className=\"error\";\n document.getElementById(\"errores\").innerHTML = \"Error, debes seleccionar una provincia.\";\n return false;\n }\n else {\n document.getElementById(\"provincia\").className=\"\";\n document.getElementById(\"errores\").innerHTML = \"\";\n return true;\n }\n}", "function inputFileCheck()\n{\n\n var element = eval(this.element);\n if ( typeof element != 'undefined' )\n {\n\n this.custom_alert = (typeof this.custom_alert != 'undefined') ? this.custom_alert : '';\n\n this.ref_label = (typeof this.ref_label != 'undefined') ? this.ref_label\n : JS_RESOURCES.getFormattedString('field_name.substitute', [element.name]);\n var val = element.value;\n\n\n if ( this.invalid_chars )\n {\n var arr = val.invalidChars(this.invalid_chars);\n\n if ( arr && arr.length )\n {\n alert(JS_RESOURCES.getFormattedString('validation.invalid_chars',\n [this.ref_label, arr.join(', ')]));\n shiftFocus( element, false);\n return false;\n }\n }\n\n if ( val.length < this.minlength )\n {\n if ( this.minlength == 1 )\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.required', [this.ref_label]));\n }\n else\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.minimum_length',\n [this.minlength, this.ref_label]));\n }\n\n return false;\n }\n\n if ( this.img_check )\n {\n return image_check(element);\n }\n\n }\n return true;\n}", "function validateUName() {\n\tvar message = \"\";\n\tvar uName = document.getElementById(\"tUName\").value;\n\tdocument.getElementById(\"tUName\").style.border = \"1px solid #0000ff\";\n\tmessage = message == \"\" ? isEmpty( uName ) : message;\n\tmessage = message == \"\" ? isGTMinlength( uName, 6 ) : message;\n\tmessage = message == \"\" ? isLTMaxlength( uName, 15 ) : message;\n\tif( message == \"\" ) {\n\t\tif( uName.search(/^[\\w]+$/) < 0 ) {\n\t\t\tmessage = \"Please enter only letters from English alphabet or decimal digits or underscore.\"\n\t\t}\n\t}\n\tdocument.getElementById(\"pUName\").innerHTML = message;\n\treturn styleInput(\"tUName\", message);\n}", "function signUpFieldLocalValidation(input, signUpDiv) {\n let regex=/^.*$/,errorMsg=\"Unknown error\";\n switch(input.attr(\"id\")) {\n case \"email\": {\n regex = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/;\n errorMsg = \"Please input valid email address: [email protected]\";\n break;\n }\n case \"pwd_s\": {\n regex = /^(?=.*[A-Za-z]).{8,}$/;\n errorMsg = \"Password is too weak, it's insecure.\";\n break;\n }\n case \"username_s\": {\n regex = /^[A-Za-z_][A-Za-z_\\-0-9]{4,}$/;\n errorMsg = \"Not a valid username, please see instruction.\";\n break;\n }\n case \"first_name\": {\n regex = /^[A-Za-z]{1,30}$/;\n errorMsg = \"Please input your first name.\";\n break;\n }\n case \"last_name\": {\n regex = /^[A-Za-z]{1,30}$/;\n errorMsg = \"Please input your last name.\";\n break;\n }\n case \"mobile\": {\n regex = /^\\d{10}$/;\n errorMsg = \"Please input valid 10 digits phone number.\";\n break;\n }\n default: break;\n }\n\n if(regex.exec(input.val())) {\n inputDivStatusChange(signUpDiv,\"\",\"succeed\");\n signUpValidation[input.attr('id')]=true;\n signUpButtonValidation();\n return true;\n }\n else {\n inputDivStatusChange(signUpDiv,errorMsg,\"error\");\n signUpValidation[input.attr('id')]=false;\n signUpButtonValidation();\n return false;\n }\n}", "function userCheck(){\r\n var user= signup.user.value.trim(); \r\n var errors= document.querySelector(\".errmessage\");\r\n var chars= \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"; \r\n var passChar=false; \r\n\r\n if(chars.indexOf(user.substr(0,1))>=0){\r\n passChar=true;\r\n }\r\n if(!passChar){\r\n clear();\r\n errors.innerHTML+= \"<p>* Username must begin with a character. <p>\";\r\n signup.user.focus();\r\n return false; \r\n }\r\n if(user.length<6){\r\n clear();\r\n errors.innerHTML+= \"<p>* Username must be at least 6 characters long. <p>\";\r\n signup.user.focus();\r\n return false; \r\n }\r\n \r\n return true; \r\n \r\n}", "function checkField(currentElem){\n value = currentElem.val();\n currentElem.removeClass(oParams.errorInputCssClass);\n if(!value){\n //check if it's empty\n handleEmtpyValue(oSetting.name +\" is empty.\\n\");\n }else{\n if(oSetting.type ===\"number\"){\n numberCheck(value, oSetting.name);\n }else if(oSetting.type ===\"hour\"){\n hourCheck(value, oSetting.name);\n }else if(oSetting.type ===\"minute\"){\n minuteCheck(value, oSetting.name);\n }else if(oSetting.type ===\"customFn\"){\n customCheck(value, oSetting.name);\n }\n }\n\n }", "function validateCheckForAffil(){\n if (!checkAffilName.value) {\n atmWindow.document.getElementById(\"checkAffilNameError_atm\").style.display = \"block\";\n } else {\n atmWindow.document.getElementById(\"checkAffilNameError_atm\").style.display = \"none\";\n checkForAffiliate(checkAffilName.value);\n }\n }", "function checkUserInput()\r\n{\r\n\tvar isCorrect=true;\r\n\t//if the input is blank, default value, or contains any space, regard it as a invalid input\r\n\tif($(\"#username\").val()==\"\" || $(\"#username\").val()==usernameValue || $(\"#username\").val().search(\" \")!=-1)\r\n\t{\r\n\t\tbuildPopupMsg({\r\n\t\t\t\"content\":usernameValue,\r\n\t\t\t\"title\":\"Username can not be empty\",\r\n\t\t\t\"onShow\": function () {\r\n\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t$('#error_button_ok').focus();\r\n\t\t\t\t}, 100);\r\n\t\t\t}\r\n\t\t});\r\n\t\tisCorrect=false;\r\n\t}\r\n\telse if($(\"#password\").val()==\"\" || $(\"#password\").val()==passwordValue)\r\n\t{\r\n\t\tbuildPopupMsg({\r\n\t\t\t\"content\":passwordValue,\r\n\t\t\t\"title\":\"Password can not be empty\",\r\n\t\t\t\"onShow\": function () {\r\n\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t$('#error_button_ok').focus();\r\n\t\t\t\t}, 100);\r\n\t\t\t}\r\n\t\t});\r\n\t\tisCorrect=false;\r\n\t}\r\n\telse if ($(\"#password\").val().search(/\\s/g)!=-1) {\r\n\t\tbuildPopupMsg({\r\n\t\t\t\"content\":'Please check that there are no spaces in your password',\r\n\t\t\t\"title\":\"No spaces in password\",\r\n\t\t\t\"onShow\": function () {\r\n\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t$('#error_button_ok').focus();\r\n\t\t\t\t}, 100);\r\n\t\t\t}\r\n\t\t});\r\n\t\tisCorrect=false;\r\n\t}\r\n\treturn isCorrect;\r\n}", "function validateInput(element, format) {\n \"use strict\";\n if (element.value == \"\") {\n alert(\"Error: \" + element.type + \" is empty!\");\n element.focus();\n return false;\n }\n\n if (element.value.match(format)) {\n element.focus();\n element.setAttribute(\"style\", \"border: 2px solid green;\");\n return true;\n }\n element.focus();\n element.setAttribute(\"style\", \"border: 1px solid red;\");\n return false;\n}", "hasInput_(value) {\n return value.length > 0;\n }", "function validator(elem) {\n const valPath = elem.value;\n if (valPath === \"\") {\n $(elem).addClass(\"valid\");\n elem.placeholder = \"This cannot be empty :(\";\n valCheck = true;\n } else {\n $(elem).removeClass(\"valid\");\n }\n }", "function validateInput() {\n\t\tif (!name) {\n\t\t\talert('Please input a name');\n\t\t\treturn false;\n\t\t}\n\t\tif (!description) {\n\t\t\talert('Please give a small description');\n\t\t\treturn false;\n\t\t}\n\t\tif (!value) {\n\t\t\talert('Please describe the sentimental value');\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function validateUser(userVal) {\r\n\tif(userVal == \"\") {\r\n\t\talertify.alert(\"Please select new facilitator.\");\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function verifyInput(){\r\n}", "function validateEle(obj){\n\tvar isValidEle = true;\n\tvar val = '';\n\tvar pattern;\n\tif(obj.is('input') || obj.is('textarea')){\n\t\tvalidityType = obj.attr('data-validityType');\n\t\tvar compulsory = obj.attr('data-noncompulsory') == undefined;//check if it is a non compulsory element\n\t\tval = $.trim(obj.val());\n\t\tif(val == '' && compulsory) isValidEle = false;\n\t\telse if(val == '' && !compulsory) isValidEle = true;\n\t\telse if(validityType == 'email'){\n\t\t\tpattern = /^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}$/;//validation pattern for email\n\t\t\tisValidEle = checkPattern(pattern, val);\n\t\t}\n\t\telse if(validityType == 'alphabet'){\n\t\t\tpattern = /^[A-Za-z .'-]+$/;//validation pattern for alphabet\n\t\t\tisValidEle = checkPattern(pattern, val);\n\t\t}\n\t\telse if(validityType == 'mobile'){\n\t\t\tpattern = /^[0]?[789]\\d{9}$/;//validation pattern for phone number\n\t\t\tif(val.substr(0,3) == '+91') val = val.substr(3);//if it has +91 just validate the remaining field\n\t\t\tisValidEle = checkPattern(pattern, val);\n\t\t}\n\t}\n\tif(isValidEle){\n\t\tobj.closest('.form-group').removeClass('has-error');\n\t}\n\telse\n\t\tobj.closest('.form-group').addClass('has-error');\n\treturn isValidEle;\n}", "function validateField(input, result) {\n\t\t// Raine: Great idea here to generate the selector dynamically from the given alert!\n\t\t// I would use an id here. David: done \n\t\t// Even more flexible, I would pass in the entire selector or\n\t\t// selected element itself. That makes this function more flexible. \n\t\t var \twarning = \"#\" + input,\n\t \t\tinputField = \".\" + input;\n\n\t\t// Raine: A===true can be shortened to A, and A===false can be shortened to !A. David: done\n\t\tif (result) {\n\t\t\t$(inputField).removeClass('false');\n\t\t\t$(inputField).addClass('true');\n\t\t\t$(warning).text('true');\n\t\t}\n\t\telse {\n\t\t\t$(inputField).removeClass('false');\n\t\t\t$(inputField).addClass('true');\n\t\t\t$(warning).text('false');\n\t\t\t$('body').append('<p id = \"invalidAlert\">This form is invalid!</p>');\n\t\t}\n\t}", "function validateName(element) {\n\n\t\tvar value = element.value;\n\t\tconsole.log(value);\n\n\t if ( checkFullName(value) ) {\n\t \telement.setCustomValidity(\"\");\n\t } else {\n\t \telement.setCustomValidity(\"Please enter a your full name including your last.\");\n\t }\n }", "function InputFormSetError(elem, elem_box)\n{\n\tvar element = document.getElementById(elem);\n\tvar element_box = document.getElementById(elem_box);\n\t\n\tif(element.value.trim() == \"\")\n\t{\n\t\tif(element_box.className.indexOf(\"has-error\") == -1)\n\t\t{\n\t\t\telement_box.className = element_box.className + \" has-error\";\n\t\t}\n\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\telement_box.className = element_box.className.replace(\"has-error\", \n\t\t\t\"\").replace(\"has-warning\", \"\").replace(\"has-success\", \"\");\n\t\t\n\t\treturn true;\n\t}\t\n}", "validateAssignedTo() {\n let input = this.assignedTo.value\n let error = document. querySelector(\"#assigned_error\")\n const successIcon = document.querySelector(\"#assignedSuccessIcon\")\n const errorIcon = document.querySelector(\"#assignedErrorIcon\")\n \n if (input == \"\" || input <= 3 || input <= 25) {\n error.innerText = \"Please enter between 3 and 25 characters\"\n this.assignedTo.classList.add(\"error\")\n this.assignedTo.classList.remove(\"success\")\n errorIcon.style.display = \"block\"\n successIcon.style.display = \"none\"\n return false\n }\n else {\n error.innerHTML = \"\"\n this.assignedTo.classList.add(\"success\")\n this.assignedTo.classList.remove(\"error\")\n successIcon.style.display = \"block\"\n errorIcon.style.display = \"none\"\n return true\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}", "function inputTextCheck()\n{\n if ( this.shouldFocus === undefined )\n {\n this.shouldFocus = true;\n }\n\n var element = eval(this.element);\n var cmp_element = eval(this.cmp_element);\n\n if ( element )\n {\n // don't validate disabled elements\n if (element.disabled)\n {\n return true;\n }\n\n var focusElement = element;\n if ( this.axobj )\n {\n focusElement = this.axobj;\n }\n\n this.custom_alert = (typeof this.custom_alert != 'undefined') ? this.custom_alert : '';\n this.custom_alert_cmp = (typeof this.custom_alert_cmp != 'undefined') ? this.custom_alert_cmp : '';\n\n this.ref_label = (typeof this.ref_label != 'undefined') ? this.ref_label\n : JS_RESOURCES.getFormattedString('field_name.substitute', [element.name]);\n var val = element.value;\n if ( isAnEmptyVtbe(val) )\n {\n val='';\n }\n var trimmedVal, numVal, isValidNum, re;\n\n if ( this.activeX && isEmptyWysiwyg(element) )\n {\n element.value = '';\n val = '';\n }\n\n if ( typeof eval(this.formatElement) != \"undefined\" && eval(this.formatElement) !== null )\n {\n //Check if it is a mathml where;\n if ( /<APPLET ID=\"(\\d+)\" NAME=\"(\\w+)\"/.test(element.value) )\n {\n if ( getRadioValue(eval(this.formatElement)) == 'P' )\n {\n if ( !confirm(JS_RESOURCES.getString('validation.plain_text.confirm')) )\n {\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n }\n }\n }\n\n if ( this.trim )\n {\n val = val.trim();\n element.value = val;\n } //Remove leading & trailing spaces if needed\n\n if ( typeof cmp_element != 'undefined' )\n {\n if ( this.xor )\n {\n if ( val.trim()=='' ^ cmp_element.value.trim()=='' )\n {\n if ( val.trim()=='' )\n {\n alert( this.custom_alert ? this.custom_alert :\n JS_RESOURCES.getFormattedString('validation.cmp_field.required',\n [this.ref_label, this.cmp_ref_label]));\n if ( this.shouldFocus )\n {\n shiftFocus(focusElement, this.activeX);\n }\n }\n else\n {\n alert(this.custom_alert_cmp ? this.custom_alert_cmp :\n JS_RESOURCES.getFormattedString('validation.cmp_field.required',\n [this.cmp_ref_label, this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( cmp_element );\n }\n }\n return false;\n }\n }\n }\n\n if ( this.disable_script )\n {\n if ( typeof eval(this.formatElement) == \"undefined\" || getRadioValue(eval(this.formatElement)) != 'P' )\n {\n re = /<\\s*script/ig;\n var re1 = /<\\s*\\/\\s*script\\s*>/ig;\n val = val.replace(re,'<disabled-script');\n val = val.replace(re1,'</disabled-script>');\n var re2 = /href\\s*=\\s*(['\"]*)\\s*javascript\\s*:/ig;\n val = val.replace(re2,\"href=$1disabled-javascript:\");\n element.value = val;\n }\n }\n\n if ( this.valid_number )\n {\n trimmedVal = val.trim();\n //added this check bcoz for numeric fields which are not required, this function was not working\n if ( trimmedVal!=\"\" )\n {\n var numLocalizer = new NumberLocalizer();\n if ( numLocalizer === undefined )\n {\n numVal = parseInt(trimmedVal, 10);\n }\n else\n {\n numVal = numLocalizer.parseNumber( trimmedVal );\n }\n isValidNum = !isNaN(numVal);\n if ( !isValidNum )\n {\n alert(JS_RESOURCES.getFormattedString('validation.number', [this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n if (this.integer_number)\n {\n re = /^[+-]?[0-9]+$/;\n if ( !re.test( trimmedVal ))\n {\n alert(JS_RESOURCES.getFormattedString('validation.integer_number', [this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n }\n if (this.nonnegative && numVal<0)\n {\n alert(JS_RESOURCES.getFormattedString('validation.negative', [this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n if ( ( (this.min_value || this.min_value === 0) && numVal < this.min_value ) ||\n ( this.max_value && ( numVal > this.max_value ) ) )\n {\n alert(JS_RESOURCES.getFormattedString('validation.invalid_value', [this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n }\n }\n\n if ( this.valid_float )\n {\n trimmedVal = val.trim();\n\n var numFormat;\n if ( this.allow_negative_float )\n {\n numFormat = LOCALE_SETTINGS.getString('float.allow.negative.format');\n }\n else\n {\n numFormat = LOCALE_SETTINGS.getString('float.format');\n }\n\n if ( numFormat )\n {\n //hand parse for l10n\n re = new RegExp( numFormat );\n isValidNum = trimmedVal.search( re ) === 0;\n }\n else\n {\n //try to use platform native (non-localized)\n numVal = parseFloat(trimmedVal);\n isValidNum = !isNaN(numVal);\n if ( isValidNum && numVal.toString().length != trimmedVal.length )\n {\n /* Allow strings with trailing zeros to pass */\n re = /^[\\.0]+$/;\n isValidNum = re.test(trimmedVal.substring(numVal.toString().length));\n }\n }\n if ( !isValidNum )\n {\n alert(JS_RESOURCES.getFormattedString('validation.number', [this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n }\n\n if ( this.valid_percent )\n {\n if ( this.allow_negative_percent )\n {\n if ( !isValidNegativePercent(val) )\n {\n alert(JS_RESOURCES.getFormattedString('validation.allow_negtive.percent', [this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n }\n else\n {\n if ( !isPercent(val) )\n {\n alert(JS_RESOURCES.getFormattedString('validation.percent', [this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n }\n }\n\n if ( this.valid_efloat )\n {\n if ( !isNumeric(val) )\n {\n alert(JS_RESOURCES.getFormattedString('validation.number', [this.ref_label]));\n if ( this.shouldFocus )\n {\n focusElement = (this.focusElement ? this.focusElement : this.element);\n if ( focusElement.focus )\n {\n safeFocus( focusElement );\n }\n }\n return false;\n }\n }\n\n if ( this.valid_points_decimal_places )\n {\n if ( !validPointsDecimalPlaces(val) )\n {\n alert(JS_RESOURCES.getFormattedString('validation.points.decimal.places.error.location', [this.ref_label]));\n if ( this.shouldFocus )\n {\n focusElement = (this.focusElement ? this.focusElement : this.element);\n if ( focusElement.focus )\n {\n safeFocus( focusElement );\n }\n }\n return false;\n }\n }\n\n if ( this.valid_email )\n {\n if ( val.trim() == '' )\n {\n if ( confirm(JS_RESOURCES.getString('warning.email')) )\n {\n return true;\n }\n else\n {\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n }\n else\n {\n re = /^(['`a-zA-Z0-9_+\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9])+$/;\n if ( !re.test(val) )\n {\n alert(JS_RESOURCES.getFormattedString('validation.email', [this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n }\n }\n\n // confirms via javascript pop-up if input field is empty;\n // user can click Ok to proceed or cancel to go back with the element focused\n // the message that pops up is the message passed in with ref_label\n if ( this.empty_value_warn )\n {\n if ( val.trim() == '' )\n {\n if ( confirm(this.ref_label) )\n {\n return true;\n }\n else\n {\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n }\n }\n\nif ( val.length < this.minlength )\n {\n if ( this.minlength == 1 )\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.required', [this.ref_label]));\n }\n else\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.minimum_length',\n [this.minlength, this.ref_label]));\n }\n if ( this.shouldFocus )\n {\n shiftFocus(focusElement, this.activeX);\n }\n return false;\n }\n\n var extra = 0;\n if (navigator.appName==\"Netscape\" &&\n parseInt(navigator.appVersion, 10 )>=5) {\n var index = val.indexOf('\\n');\n while(index != -1) {\n extra += 1;\n index = val.indexOf('\\n',index+1);\n }\n }\n if ( this.maxlength < val.length + extra )\n {\n var newlength = val.length + extra;\n if ( (newlength - this.maxlength) > 1 )\n {\n alert(JS_RESOURCES.getFormattedString('validation.maximum_length.plural',\n [this.ref_label,this.maxlength,(newlength-this.maxlength)]));\n }\n else\n {\n alert(JS_RESOURCES.getFormattedString('validation.maximum_length.singular',\n [this.ref_label,this.maxlength]));\n }\n if ( this.shouldFocus )\n {\n shiftFocus(focusElement, this.activeX);\n }\n return false;\n }\n\n // required_url, unlike valid_url, flags empty strings as invalid URLs.\n if ( this.required_url )\n {\n if ( val.trim() == '' )\n {\n alert(JS_RESOURCES.getFormattedString('validation.required', [this.ref_label]));\n return false;\n }\n \n this.valid_url = true; // since the url is required, it also must be valid\n }\n \n if ( this.valid_url )\n {\n if ( val.trim()=='' )\n {\n return true; // should not reach here if required_url is true \n }\n\n if ( !isValidUrl(val) )\n {\n // Special case for b2-authored links which are legitimate to not be fully qualified URLs. See launch_external.jsp and B2 documentation\n if( val.startsWith( \"/webapps/blackboard/launch_external.jsp\" ) )\n {\n return true;\n }\n \n alert(JS_RESOURCES.getFormattedString('validation.url', [this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n }\n\n if ( typeof(this.regex) == 'string' )\n {\n this.regex=eval(this.regex);\n }\n\n if ( (typeof(this.regex) == 'object' || typeof(this.regex) == 'function') && val.trim() != '' )\n {\n re =this.regex;\n if ( this.regex_match && val.search(re) == -1 )\n {\n alert(this.regex_msg + (this.ref_and_regex?(this.ref_label + '.'):''));\n if ( this.shouldFocus )\n {\n shiftFocus(focusElement, this.activeX);\n }\n return false;\n }\n if ( !this.regex_match && re.test(val) )\n {\n alert(this.regex_msg + (this.ref_and_regex?(this.ref_label + '.'):''));\n if ( this.shouldFocus )\n {\n shiftFocus(focusElement, this.activeX);\n }\n return false;\n }\n }\n\n if ( this.invalid_chars )\n {\n // if string was passed, convert to regular expression object\n if( Object.isString( this.invalid_chars ) )\n {\n var stringToParse = this.invalid_chars;\n var firstSlashPos = stringToParse.indexOf(\"/\");\n var lastSlashPos = stringToParse.lastIndexOf(\"/\");\n\n var pattern = stringToParse.substring( ++firstSlashPos, lastSlashPos );\n var modifier = stringToParse.substring( ++lastSlashPos, stringToParse.length );\n this.invalid_chars = new RegExp( pattern, modifier );\n }\n\n var arr = val.invalidChars(this.invalid_chars);\n\n if ( arr && arr.length )\n {\n alert(JS_RESOURCES.getFormattedString('validation.invalid_chars',\n [this.ref_label, arr.join(', ')]));\n if ( this.shouldFocus )\n {\n shiftFocus(focusElement, this.activeX);\n }\n return false;\n }\n }\n\n if ( this.verify )\n {\n var chk_field = bbDomUtil.getInputElementByName(element.name.replace(/_inp$/,'_chk'));\n var field = bbDomUtil.getInputElementByName(element.name.replace(/_inp$/,''));\n\n if ( chk_field.value != val )\n {\n alert(JS_RESOURCES.getFormattedString('validation.mismatch', [this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( chk_field );\n }\n return false;\n }\n // Encode password\n if ( element.type == 'password' )\n {\n element.value = element.value.trim();\n if ( element.value != '' )\n {\n if ( !this.skipMD5 )\n {\n element.value = field.value = chk_field.value = calcMD5(element.value);\n }\n }\n else\n {\n alert(JS_RESOURCES.getString('validation.password'));\n element.value = field.value ='';\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n }\n }\n\n if ( this.cmp_required && element.value.trim()!='' )\n {\n if ( !cmp_element.value.trim().length )\n {\n alert(JS_RESOURCES.getFormattedString('validation.cmp_field.rejected',\n [this.ref_label, this.cmp_ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( cmp_element );\n }\n return false;\n }\n }\n\n if ( this.img_check )\n {\n return image_check(element);\n }\n\n\n //AS-102122, if a image tag without ALT properties <img src=\"1.jpg\">, add a null ALT for it. <img src=\"1.jpg\" alt=\"\">\n imgTag_check(element,0);\n\n\n // System role ids cannot begin with \"BB\" as of 7.2; such ids are reserved for solely for Blackboard use\n // Checks field to see if string begins with \"BB\" case-insensitive and if so, alert the user\n if ( this.valid_system_role_id )\n {\n if ( element.value.indexOf('BB') === 0 || element.value.indexOf('bb') === 0 )\n {\n alert(this.custom_alert ? this.custom_alert : JS_RESOURCES.getFormattedString('validation.system_role.reserve', [this.ref_label]));\n if ( this.shouldFocus )\n {\n safeFocus( element );\n }\n return false;\n }\n else\n {\n return true;\n }\n }\n\n }\n return true;\n}", "function validi(){\r\n var usrnam = document.getElementById(\"un1\");\r\n var passwd = document.getElementById(\"pw1\");\r\n\r\n if (usrnam.value ==\"\" ){\r\n alert (\"you can not leave username blank \" );\r\n document.getElementById(\"uss1\").style.border=\"thin solid red\";\r\n \r\n return false;\r\n }\r\n \r\n else if ( passwd.value == \"\") {\r\n alert (\"you can not leave password blank\");\r\n document.getElementById(\"pss1\").style.border=\"thin solid red\";\r\n\r\n // removing border if they made a mistake earlier\r\n document.getElementById(\"uss1\").style.border=\"\";\r\n return false ;\r\n }\r\n// length of password should be over a certain length lets say 5\r\n else if (passwd.length <= 5){\r\n alert(\"password too short\");\r\n document.getElementById(\"pss1\").style.border=\"thin solid red\";\r\n \r\n \r\n return false;\r\n\r\n }\r\n\r\n else {\r\n return true ;\r\n }\r\n}", "function inputValidation() {\r\n\tvar portalPacketTitle = document.getElementById(\"portalPacketTitle\");\r\n\tvar portalPacketContent = document.getElementById(\"portalPacketContent\");\r\n\tvar portalPacketFooter = document.getElementById(\"portalPacketFooter\");\r\n\tvar error = \"\";\r\n\tif (portalPacketTitle.value.length == 0) {\r\n\t\terror += \"标题不能为空\\n\";\r\n\t}\r\n\tif (portalPacketContent.value.length == 0) {\r\n\t\terror += \"描述文字不能为空\\n\";\r\n\t}\r\n\tif (portalPacketFooter.value.length == 0) {\r\n\t\terror += \"页脚不能为空\\n\";\r\n\t}\r\n\tif (error.length != 0) {\r\n\t\twindow.alert(error);\r\n\t\treturn false;\r\n\t} else\r\n\t\treturn true;\r\n}", "function checkInput() {\n\n let userInput = document.getElementById(\"username\").value;\n\n if (userInput != '') {\n displayResult;\n }\n\n else {\n const inputValidation = document.getElementById(\"usernameHelp\");\n inputValidation.addEventListener(\"blur\", e => {\n inputValidation.textContent = \"Enter a GitHub username\";\n })\n }\n}", "function isHInput(type,name){\r\n\tif ((type == null) || (name == null)) return false;\r\n\tif ((type == \"text\") || (type == \"password\") || (type == \"textarea\") ||\r\n\t\t\t(type == \"hidden\") || (type == \"checkbox\") ||\r\n\t\t\t(type == \"select-one\") || (type == \"radio\")){\r\n\t\tvar pool = name.split(\"_\");\r\n\t\tif (pool.length>=3){\r\n\t\t\tif ((pool[0].indexOf(\"in\")!=-1) && (!isNaN(pool[1])) && (!isNaN(pool[2]))){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function validateInput() {\n // Get the users vales from the DOM\n const nameInput = document.getElementById(\"name-input\").value;\n const emailInput = document.getElementById(\"email-input\").value;\n const messageInput = document.getElementById(\"message-box\").value;\n\n // If any of them are blank show an error message\n if (!nameInput) userMessage(\"Please fill out the name field\", true);\n else if (!emailInput) userMessage(\"Please fill out the email field\", true);\n else if (!emailInput.includes('@')) userMessage(\"Please enter a valid email address\", true);\n else if (!emailInput.includes('.')) userMessage(\"Please enter a valid email address\", true);\n else if (!messageInput) userMessage(\"Please fill out the message field\", true);\n else userMessage(\"<p>Thank you for your message!</p> <p>You have instantly become a member of our cooking community!</p>\", false);\n}", "function firstid_validation(uid, mx, my) {\n var uid_len = uid.value.length;\n if (uid_len == 0 || uid_len >= my || uid_len < mx) {\n alert(\"Firstname has issues\" + \" \" + mx + \" to \" + my);\n uid.style.border = '3px solid red';\n uid.focus();\n return false;\n }\n return true;\n}", "function validarInput() {\r\n /* Definicao das variaveis a serem usadas */\r\n let jsPref_1 = document.getElementById('pref_1').value;\r\n let jsPref_2 = document.getElementById('pref_2').value;\r\n let jsPref_3 = document.getElementById('pref_3').value;\r\n let jsPesoPref_1 = document.getElementById('pesoPref_1').value;\r\n let jsPesoPref_2 = document.getElementById('pesoPref_2').value;\r\n let jsPesoPref_3 = document.getElementById('pesoPref_3').value;\r\n let tManha = document.getElementById('turnoManha').checked;\r\n let tTarde = document.getElementById('turnoTarde').checked;\r\n let tNoite = document.getElementById('turnoNoite').checked;\r\n\r\n var missingField = 0;\r\n\r\n /* Envia para console o input que o usuario fez */\r\n /* \r\n console.log('pref 1 =' + jsPref_1 + \" - \" + pesoPref_1.value);\r\n console.log('pref 2 =' + jsPref_2 + \" - \" + pesoPref_2.value);\r\n console.log('pref 3 =' + jsPref_3 + \" - \" + pesoPref_3.value);\r\n console.log('turno Manha =' + turnoManha.checked);\r\n console.log('turno Tarde =' + turnoTarde.checked);\r\n console.log('turno Noite =' + turnoNoite.checked);\r\n */\r\n\r\n /* Validacao do input do usuario nas preferencias */\r\n if (jsPref_1 == 'blank') {\r\n document.getElementById('pref_1').style.border = 'solid 2px red';\r\n missingField++;\r\n } else {\r\n document.getElementById('pref_1').style.border = '';\r\n }\r\n if (jsPref_2 == 'blank') {\r\n document.getElementById('pref_2').style.border = 'solid 2px red';\r\n missingField++;\r\n } else {\r\n document.getElementById('pref_2').style.border = '';\r\n }\r\n if (jsPref_3 == 'blank') {\r\n document.getElementById('pref_3').style.border = 'solid 2px red';\r\n missingField++;\r\n } else {\r\n document.getElementById('pref_3').style.border = '';\r\n }\r\n\r\n /* Validacao do input do usuario no peso das preferencias */\r\n if (jsPesoPref_1 == -1) {\r\n document.getElementById('pesoPref_1').style.border = 'solid 2px red';\r\n missingField++;\r\n } else {\r\n document.getElementById('pesoPref_1').style.border = '';\r\n }\r\n if (jsPesoPref_2 == -1) {\r\n document.getElementById('pesoPref_2').style.border = 'solid 2px red';\r\n missingField++;\r\n } else {\r\n document.getElementById('pesoPref_2').style.border = '';\r\n }\r\n if (jsPesoPref_3 == -1) {\r\n document.getElementById('pesoPref_3').style.border = 'solid 2px red';\r\n missingField++;\r\n } else {\r\n document.getElementById('pesoPref_3').style.border = '';\r\n }\r\n\r\n /* Validacao se FORM turno esta vazio */\r\n if (tManha == false && tTarde == false && tNoite == false) {\r\n document.getElementById('missingFieldTurno').innerText = '*'\r\n console.log('ERROR: Turno');\r\n missingField++;\r\n } else {\r\n document.getElementById('missingFieldTurno').innerText = ''\r\n }\r\n\r\n\r\n if (missingField != 0) {\r\n return (false)\r\n } else {\r\n return (true)\r\n }\r\n}", "function validateInput() {\n if (!keyCodeValid || !accountCodeValid || ($(\"#keyCodeCP\").val() == \"\" && isAcctAllEmpty()) ||\n $(\"#desc\").val() == \"\" || $(\"#instruct\").val() == \"\" || $(\"#instruct\").val().length > 65535) {\n $(\"#submitCP\").button(\"option\", \"disabled\", true);\n } else {\n $(\"#submitCP\").button(\"option\", \"disabled\", false);\n }\n }", "function inputValueCheck(el) {\n\t \tif (el.value === '') {\n\t \t\treturn false; // If element has no value, return false\n\t \t} else {\n\t \t\treturn true;\n\t \t}\n\t }", "function checkPass(elem) {\n // collect needed elements\n var pass1 = document.getElementById('pass');\n var pass2 = document.getElementById('pass_confirmed');\n var errmsg = document.getElementById('errP');\n\n // return flag\n var okPass = true;\n\n // check the user defined Passwords\n if (pass1.value != pass2.value && pass2.value.length != 0) {\n if (elem && elem === pass2)\n errmsg.innerHTML = \"Passwords Do Not Match\";\n okPass = false;\n } else if (pass1.value.length < 8 && pass1.value.length != 0) {\n if (elem && elem === pass1)\n errmsg.innerHTML = \"Passwords must be at least 8 characters\";\n okPass = false;\n } else {\n errmsg.innerHTML = \"\";\n }\n\n return okPass;\n}", "function txtVal() {\n var elm = document.getElementById(\"info\");\n\n if (elm.validity.valueMissing) {\n elm.setCustomValidity(\"Please enter in your comments!\");\n } else {\n elm.setCustomValidity(\"\");\n }\n}", "function checkForText(element) {\n \tif (element.value == \"\")\n \t{\n\t\t// If field is left blank alert user.\n\t\tinputStatus(element, \"error\", \"Error: cannot leave empty\");\n\t\telement.focus();\n\t}\n\telse if (/\\d/.test(element.value))\n\t{\n\t\t// If field contains digit alert user.\n\t\tinputStatus(element, \"error\", \"Error: contains digit\");\n\t}\n\telse {\n\t\tinputStatus(element, \"success\", \"Success\");\n\t}\n}", "function checkForSpecialCharAndText(e, ele) {\n var format = /[0-9 !@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]/;\n if (format.test(pastedText(e)) == true) {\n e.preventDefault();\n //FY22-0702 STORY 10571328: Copy Paste Validation on Pre Chat Form[START]\n if (ele === \"cusCAREPreChat-FirstName\")\n alert(orderSnapinLabelObj.firstNameInValid);\n else if (ele === \"cusCAREPreChat-LastName\")\n alert(orderSnapinLabelObj.lastNameInValid);\n //FY22-0702 STORY 10571328: Copy Paste Validation on Pre Chat Form[END]\n } else if (ele === \"cusCAREPreChat-FirstName\" && document.getElementById(\"ErrMsg_cusCAREPreChat-FirstName\"))\n removeDomElementbyId(\"ErrMsg_cusCAREPreChat-FirstName\");\n else if (ele === \"cusCAREPreChat-LastName\" && document.getElementById(\"ErrMsg_cusCAREPreChat-LastName\"))\n removeDomElementbyId(\"ErrMsg_cusCAREPreChat-LastName\");\n }", "function isValid( ) {\n\n\t\t\tif ( _widget[ \"content\" ][ \"impl\" ].value.match(_validPtn) ) {\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "function ForumInputCheck() {\n if (document.forms.addform.user_name.value == '') {\n alert('名前が入力されていません。');\n document.forms.addform.user_name.focus();\n return false;\n } else if (document.forms.addform.title.value == '') {\n alert('タイトルが入力されていません。');\n document.forms.addform.title.focus();\n return false;\n } else if (document.forms.addform.comment.value == '') {\n alert('コメントが入力されていません。');\n document.forms.addform.comment.focus();\n return false;\n } else if (document.forms.addform.user_pass.value == '') {\n alert('パスワードが入力されていません。');\n document.forms.addform.user_pass.focus();\n return false;\n }\n return true;\n}", "function responsibilityVerify(){\n if(responsibility.value != null || responsibility.value != \"\"){\t\t\t\n responsibility.style.border = \"1px solid #5e6e66\";\n document.getElementById('responsibility_div').style.color = \"#5e6e66\";\n responsibility_error.innerHTML = \"\";\n return true;\n }\n}", "function validate(inputElement,rule){\n var errorMessage =rule.test(inputElement.value);\n var errorElement = inputElement.parentElement.querySelector(options.errorSelector);\n if(errorMessage){\n errorElement.innerText=errorMessage;\n inputElement.parentElement.classList.add('invalid');\n }\n else{\n errorElement.innerText='';\n inputElement.parentElement.classList.remove('invalid');\n }\n }", "function isAlwaysValid(input) {\n return true;\n}", "function privilege_not_empty() {\n\tvar privilegeInvalid = document.getElementById(\"privilege_invalid\");\n\tvar system = document.getElementById(\"SystemManager\");\n\tvar testM = document.getElementById(\"TestManager\");\n\tvar tbM = document.getElementById(\"TBManager\");\n\tvar tbO = document.getElementById(\"TBOperator\");\n\tvar viewer = document.getElementById(\"Viewer\");\n\tvar testee = document.getElementById(\"Testee\");\n\n\tif (system.checked === false && testM.checked === false && tbM.checked === false && tbO.checked === false && viewer.checked === false && testee.checked === false) {\n\t\tprivilegeInvalid.innerHTML = \"<span style='color: red; font-size: 14px'>Choose one privilege at least.</span>\";\n\t\tpassPrivilege = false;\n\t} else {\n\t\tprivilegeInvalid.innerHTML = \"\";\n\t\tpassPrivilege = true;\n\t}\n\n\tdata_valid();\n}", "function hasInput(fieldElement){\n\tif(fieldElement.value == null || trim(fieldElement.value) == \"\"){\n\t\treturn false;\n\t}\n\treturn true;\n}", "function isinputvalid() {\r\n let inputstr = field.value;\r\n let patt = /^[0-9]{1,3}$/g; //1-999\r\n let cond = patt.test(inputstr);\r\n\r\n if (!cond) {\r\n field.value = \"\";\r\n updateImg(data.default.bev);\r\n }\r\n return cond;\r\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 validateIn() {\r\n\t// username\r\n\tif (username.value == \"\") {\r\n\t\talertUsername.textContent = \"Username is required.\";\r\n\t\tusername.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// check username length\r\n\tif (username.value.length < 6 || username.value.length > 18) {\r\n\t\talertUsername.textContent = \"Between 6 and 18 characters.\";\r\n\t\tusername.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// username must contain only\r\n\t\t// letters\r\n\t\t// numbers\r\n\t\t// no whitespaces\r\n\tif (!(/^(?:[a-zA-Z])[a-zA-Z0-9]+$/.test(username.value))) {\r\n\t\talertUsername.textContent = \"Begin with a letter, followed by numbers only. No whitespaces.\";\r\n\t\tusername.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// password\r\n\tif (password.value == \"\") {\r\n\t\talertPassword.textContent = \"Password is required.\";\r\n\t\tpassword.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// check length of password\r\n\tif (password.value.length < 8) {\r\n\t\talertPassword.textContent = \"8 or more characters.\";\r\n\t\tpassword.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// check if password contains\r\n\t\t// one lowercase\r\n\t\t// one uppercase\r\n\t\t// one number\r\n\t\t// one special character from !@#$%^&*\r\n\tif (!(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!_.@#\\$%\\^&\\*])/.test(password.value))) {\r\n\t\talertPassword.textContent = \"Must contain one lowercase, one uppercase, one number and one special character.\";\r\n\t\tpassword.focus();\r\n\t\treturn false;\r\n\t}\r\n}", "function checkUserFullName(){\n var userFullName = document.getElementById(\"userFullName\").value;\n var flag = false;\n if(userFullName === \"\"){\n flag = true;\n }\n if(flag){\n document.getElementById(\"userFullNameError\").style.display = \"block\";\n }else{\n document.getElementById(\"userFullNameError\").style.display = \"none\";\n }\n}", "function name_check(){\n var user_form_name, user_form_name_valid; \n user_form_name = document.getElementById('username');\n user_form_name_valid = user_form_name.checkValidity();\n name_value = user_form_name.value;\n console.log(\"Name Validation Works!!!!\");\n console.log(name_value);\n}", "function validateUserNameLength()\r\n{\r\n var username = document.getElementsByClassName(\"usernameForm\")[0];\r\n\r\n if(username.value.length < 7)\r\n username.setCustomValidity(\"Username must be of at least 7 characters!\");\r\n else if (username.value.length > 30)\r\n username.setCustomValidity(\"Username must be of at most 30 characters!\");\r\n else\r\n username.setCustomValidity(\"\");\r\n}", "function checkData() {\n\t\t\t\tif (document.form1.threeChar.value.length == 3) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\talert(\"Enter exactly 3 characters. \" +\n\t\t\t\t\t\tdocument.form1.threeChar.value + \" is not valid.\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}", "function validateInput(valueOfInput) {\r\n\r\n if (valueOfInput.val().trim() == \"\") {\r\n valueOfInput.css(\"border\", \"solid 3px red\");\r\n alert(\"Please enter a country name\");\r\n return false\r\n }\r\n return true\r\n }", "function verifyCustomInput(input) {\n if (/^[0-9]*$/.test(\"\"+input.value) && (input.value!==\"\")){\n input.className = \"valid\";\n return true;\n }\n else {\n input.className = \"error\";\n input.value = \"\";\n return false;\n }\n}", "function verbPresAffPlainCheckError() {\n let optionsGroup = document.getElementById(\"verb-tense-group\");\n let errorElement = optionsGroup.getElementsByClassName(\"must-choose-one-text\")[0];\n\n let selected = checkInputsForError(inputsToSelectVerbPresAffPlain, true);\n let unselected = checkInputsForError(inputsToDeselectVerbPresAffPlain, false);\n\n if (selected && unselected) {\n toggleError(errorElement, \"*Invalid combination: present, affirmative, plain\", true);\n // element could be hidden because verb is unchecked, so check to enable back button\n checkToEnableBackButton();\n } else {\n optionsGroupCheckError(optionsGroup);\n }\n}", "function validateInput(value){\r\n\tvar re=/^\\s*$/;\r\n\tif (re.test(value)){\r\n\t\talertify.alert(\"Please enter user name.\");\r\n\t\treturn false;\r\n\t}\t\r\n\treturn true;\r\n}", "function validate_total_percentage(element){\n var total_percentage = 0.0;\n $(\"[id$='percentage']\").each(function(){\n //the element not visible is the template used to create the allocations form\n if($(this).is(\":visible\"))\n total_percentage += parseFloat($(this).val());\n });\n\n if(total_percentage > 100){\n alert(\"The sum of the percentages should not be more than 100.\");\n if(element){\n $(element).val(\"\");\n $(element).focus();\n }\n return false;\n }\n return true;\n }", "function checkInp() {\n var x = document.getElementById(\"id\").value;\n if (x.match(/^[a-zA-Z0-9\\-_]+$/)) {\t\t//--> problem with click method\n // if (x.match(/^[0-9]+$/)) {\n return true;\n }\n}", "validateInput()\n {\n return this.refs.date.isValid()\n && this.refs.amount.isValid()\n && this.refs.account.isValid()\n }", "function validateInput(inputType, regex, toolTipsName) {\n const nameInputValue = $(inputType).val();\n const validator = regex;\n if (validator.test(nameInputValue)) {\n if ($(inputType).next().prop('tagName') === 'P') {\n $(inputType).next().remove();\n }\n $(`<p class=\"validation-message\">OK!</p>`).insertAfter(inputType);\n $(toolTipsName).addClass('hidden')\n $(inputType).css('border', '2px solid #6CC070');\n $(inputType).next().css('color', '#6CC070');\n $(inputType).prev().css('color', '#6CC070');\n if ((inputType) === 'input#other-title') {\n $(inputType).prev().css('color', 'black');\n $(inputType).prev().prev().css('color', '#6CC070');\n }\n return true;\n } else {\n if ($(inputType).next().text() === 'OK!') {\n $(inputType).next().text('Oops! Please follow the recommended tooltips.')\n }\n showToolTips(toolTipsName);\n $(inputType).css('border', '2px solid #A63232');\n if ($(inputType).next().prop('tagName') === 'P') {\n $(inputType).next().css('color', '#A63232');\n }\n $(inputType).prev().css('color', '#A63232');\n if ((inputType) === 'input#other-title') {\n $(inputType).prev().css('color', 'black');\n $(inputType).prev().prev().css('color', '#A63232');\n }\n return false;\n }\n}", "function valida_senha(String) {\r\n\tvar mensagem = \"As senhas nao conferem!\"\r\n\tvar msg = \"\";\r\n\tif ((String) != document.getElementById('senha2').value) msg = mensagem;\r\n\treturn msg;\r\n}", "function validateUserNameLength()\r\n{\r\n var username = document.getElementsByClassName(\"usernameForm\")[0];\r\n\r\n if(username.value.length < 7)\r\n username.setCustomValidity(\"Username must be of at least 7 characters!\");\r\n else\r\n username.setCustomValidity(\"\");\r\n}", "function valSearchUdhaarByFixedAmountInputs(obj) {\r\n if (validateEmptyField(document.srch_udhaar_fixedAmt.udhaarFixedAmt.value, \"Please enter udhaar principal amount!\") == false ||\r\n validateNum(document.srch_udhaar_fixedAmt.udhaarFixedAmt.value, \"Accept only Numbers without space character!\") == false) {\r\n document.srch_udhaar_fixedAmt.udhaarFixedAmt.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function isTextInputValid(input, regex, message) {\r\n let inputElement = document.getElementById(input);\r\n let messageElement = inputElement.nextElementSibling;\r\n \r\n /* Test si l'utilisateur a rempli l'input */\r\n if (inputElement.value == '') {\r\n messageElement.innerText = message + \" manquant\";\r\n messageElement.style.color = \"red\";\r\n\r\n return false;\r\n \r\n /* Test si ce qu'a rempli l'utilisateur respect les REGEX */\r\n } else if (regex.test(inputElement.value) == false) {\r\n messageElement.innerText = \"Format incorrect\";\r\n messageElement.style.color = \"red\";\r\n\r\n return false;\r\n } else {\r\n messageElement.innerText = \"\";\r\n return true\r\n }\r\n}", "function validateUser(theUser) {\n var userAlert = $(alert);\n userAlert.text(\"\");\n\n if (theUser === \"\") {\n userAlert.text(\"Please enter a username.\");\n } else if (/[%<>@{}\\s]+/.test(theUser)) {\n userAlert.text(\n \"You've entered an illegal character. The following characters are illegal: \" +\n \"%, <, >, {, }, @, and spaces.\"\n );\n }\n\n if (userAlert.text() !== \"\") {\n $(\"#user-alert\").append(userAlert);\n return false;\n } else {\n return true;\n }\n}", "function checkPresence(field) {\n var hint = $F(field).length == 0 ? \" This field cannot be empty!\" : \"\";\n\n if ($(field + '_hint')) {\n $(field + '_hint').update(hint);\n }\n else {\n content = '<span class=\"validation\" style=\"color:red\" id=\"' + field + '_hint\">' +\n hint + '</span>';\n new Insertion.After(field, content);\n }\n}", "function confirmUserInputs() {\n // Confirm Uppercase\n upperCaseConfirm = confirm(\"Would you like your password to include Uppercase characters?\");\n // Confirm Lowercase\n lowerCaseConfirm = confirm(\"Would you like your password to include Lowercase characters?\");\n // Confirm Numerics\n numericConfirm = confirm(\"Would you like your password to include numbers?\");\n // Confirm Special Chars\n specialCaseConfirm = confirm(\"Would you like your password to include Special characters?\");\n if (upperCaseConfirm === false && lowerCaseConfirm === false && numericConfirm === false && specialCaseConfirm === false) {\n alert(\"Please include at least one of the following case types: Uppercase, Lowercase, Numeric, & Special Case.\");\n confirmUserInputs();\n return;\n };\n}", "function validateRideInput(data){\n\treturn true; // currently everything is supported\n}", "function checkUserFullName(){\n var userSurname = document.getElementById(\"userFullName\").value;\n var flag = false;\n if(userSurname === \"\"){\n flag = true;\n }\n if(flag){\n document.getElementById(\"userFullNameError\").style.display = \"block\";\n }else{\n document.getElementById(\"userFullNameError\").style.display = \"none\";\n }\n}", "function checkUserSurname(){\n var userSurname = document.getElementById(\"userSurname\").value;\n var flag = false;\n if(userSurname === \"\"){\n flag = true;\n }\n if(flag){\n document.getElementById(\"userSurnameError\").style.display = \"block\";\n }else{\n document.getElementById(\"userSurnameError\").style.display = \"none\";\n }\n}", "function checkUserSurname(){\n var userSurname = document.getElementById(\"userSurname\").value;\n var flag = false;\n if(userSurname === \"\"){\n flag = true;\n }\n if(flag){\n document.getElementById(\"userSurnameError\").style.display = \"block\";\n }else{\n document.getElementById(\"userSurnameError\").style.display = \"none\";\n }\n}", "function valuser() {\r\n\t\tvar user = document.getElementById('username').value.trim();\r\n\t\tif (user == \"\") {\r\n\t\t\terror = \"Please create a username.\";\r\n\t\t\tdocument.getElementById(\"check7\").style.visibility = \"hidden\";\r\n\t\t\tdocument.getElementById(\"check8\").style.visibility = \"visible\";\r\n\t\t\tdocument.getElementById(\"usererror\").style.visibility = \"visible\";\r\n\t document.getElementById(\"usererror\").innerHTML = error;\r\n\t\t\tdocument.getElementById('username').focus();\r\n\t\t}\r\n\t\telse if ((user.length < 5) || (user.length > 15)) {\r\n\t\t\terror = \"Username should be of length 6 to 14.\";\r\n\t\t\tdocument.getElementById(\"check7\").style.visibility = \"hidden\";\r\n\t\t\tdocument.getElementById(\"check8\").style.visibility = \"visible\";\r\n\t\t\tdocument.getElementById(\"usererror\").style.visibility = \"visible\";\r\n\t document.getElementById(\"usererror\").innerHTML = error;\r\n\t\t\tdocument.getElementById('username').focus();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdocument.getElementById(\"check7\").style.visibility = \"visible\";\r\n\t\t\tdocument.getElementById(\"check8\").style.visibility = \"hidden\";\r\n\t\t\tdocument.getElementById(\"usererror\").style.visibility = \"hidden\";\r\n\t\t}\r\n\t\t\r\n\t}", "function customValidation(input){\n return input;\n \n}", "function validationPass(element) {\n\tlet elementLabel = element.parentNode;\n\telementLabel.classList.add('valid');\n\telementLabel.classList.remove('not-valid');\n\t//hides the hint is validation pass.\n\telementLabel.lastElementChild.style.display = 'none';\n\treturn 'is valid';\n}", "function valida_user( ) /* OK */\r\n\t{\r\n \r\n\t}", "function checkInputField(element) {\n var background = window.getComputedStyle(element, null).getPropertyValue(\"background-color\");\n if(background == 'rgb(255, 0, 0)') {\n\treturn true;\n } else {\n\treturn false;\n }\n}", "function validate(element) {\n var value = element.value;\n var data = getDataItemsFor(element);\n\n if (performLocalValidation(value, data) !== null){\n return false;\n }\n\n // find the corresponding hidden field\n var fluencyField = $(element).closest('.html-element-wrapper').find('.fluency_assessment')[0];\n if (fluencyField.value){ // language ID validation already performed\n var fluencyData = JSON.parse(fluencyField.value);\n\n if (fluencyData.result == 'yes'){\n return true; // once the validation passes, always return true\n }\n if (fluencyData.text == value){\n return false; // never run twice for the same text\n }\n }\n\n // run the external validation, return its result\n var fluencyData = requestExternalValidation(value, data);\n fluencyField.value = JSON.stringify(fluencyData);\n return fluencyData.result == 'yes';\n }", "function formFieldHasInput(fieldElement){\n\t// Check if the text field has a value\n\tif ( fieldElement.value == null || trim(fieldElement.value) == \"\" )\n\t{\n\t\t// Invalid entry\n\t\treturn false;\n\t}\n\t\n\t// Valid entry\n\treturn true;\n}" ]
[ "0.625641", "0.62227505", "0.6090967", "0.5930259", "0.58690655", "0.5840207", "0.5833624", "0.5761783", "0.5758281", "0.5725038", "0.5719227", "0.570561", "0.5668139", "0.56507987", "0.5622217", "0.56155854", "0.5614728", "0.56125677", "0.5596227", "0.5595975", "0.55951035", "0.5590117", "0.5584115", "0.55784875", "0.5569334", "0.5557896", "0.5540444", "0.55401796", "0.55310273", "0.55305254", "0.55093896", "0.5507282", "0.55060047", "0.5498797", "0.5496476", "0.5483432", "0.5482814", "0.54783654", "0.54747474", "0.54697806", "0.5466418", "0.5465077", "0.54614", "0.54593563", "0.5448832", "0.54323304", "0.542111", "0.5421011", "0.541572", "0.5412067", "0.54045707", "0.54031706", "0.5400134", "0.53982425", "0.5389512", "0.538302", "0.5375175", "0.537468", "0.53624123", "0.53571886", "0.5351696", "0.5350422", "0.5348047", "0.53453094", "0.5341779", "0.53372395", "0.533709", "0.5335207", "0.5330342", "0.5320839", "0.5316498", "0.5314636", "0.531328", "0.53131795", "0.53103536", "0.5307658", "0.53062093", "0.53051615", "0.5304319", "0.5302463", "0.52990544", "0.5297974", "0.52864945", "0.52855563", "0.52852154", "0.52801424", "0.5279277", "0.52757734", "0.52725273", "0.5270896", "0.5270756", "0.5270345", "0.5270345", "0.52687436", "0.5265437", "0.5262457", "0.5261617", "0.5255866", "0.525451", "0.5254033" ]
0.7807044
0
Applies styling to the several buttons in the widget toolbar
function styleWidgetButtons(widgetId) { var widget = rave.getRegionWidgetById(widgetId); // init the widget minimize button which is hidden by default // and only renders when widget is in maximized view $("#widget-" + widgetId + "-min").click({id: widgetId}, rave.minimizeWidget); // init the collapse/restore toggle // conditionally style the icon and setup the event handlers var $toggleCollapseIcon = $("#widget-" + widgetId + "-collapse"); $toggleCollapseIcon.html((widget.collapsed) ? WIDGET_TOGGLE_DISPLAY_COLLAPSED_HTML : WIDGET_TOGGLE_DISPLAY_NORMAL_HTML); $toggleCollapseIcon .click({id:widgetId}, toggleCollapseAction) .mousedown(function (event) { // don't allow drag and drop when this item is clicked event.stopPropagation(); }); $('#widget-' + widgetId + '-toolbar').mousedown(function(event) { // don't allow drag and drop when this item is clicked event.stopPropagation(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InsertButtonsToToolBar()\n{\n//Strike-Out Button\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/c/c9/Button_strike.png\",\n \"speedTip\": \"Strike\",\n \"tagOpen\": \"<s>\",\n \"tagClose\": \"</s>\",\n \"sampleText\": \"Strike-through text\"}\n//Line break button\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/1/13/Button_enter.png\",\n \"speedTip\": \"Line break\",\n \"tagOpen\": \"<br />\",\n \"tagClose\": \"\",\n \"sampleText\": \"\"}\n//Superscript\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/8/80/Button_upper_letter.png\",\n \"speedTip\": \"Superscript\",\n \"tagOpen\": \"<sup>\",\n \"tagClose\": \"</sup>\",\n \"sampleText\": \"Superscript text\"}\n//Subscript\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/7/70/Button_lower_letter.png\",\n \"speedTip\": \"Subscript\",\n \"tagOpen\": \"<sub>\",\n \"tagClose\": \"</sub>\",\n \"sampleText\": \"Subscript text\"}\n//Small Text\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/5/58/Button_small.png\",\n \"speedTip\": \"Small\",\n \"tagOpen\": \"<small>\",\n \"tagClose\": \"</small>\",\n \"sampleText\": \"Small Text\"}\n//Comment\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/3/34/Button_hide_comment.png\",\n \"speedTip\": \"Insert hidden Comment\",\n \"tagOpen\": \"<!-- \",\n \"tagClose\": \" -->\",\n \"sampleText\": \"Comment\"}\n//Gallery\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/1/12/Button_gallery.png\",\n \"speedTip\": \"Insert a picture gallery\",\n \"tagOpen\": \"\\n<gallery>\\n\",\n \"tagClose\": \"\\n</gallery>\",\n \"sampleText\": \"Image:Example.jpg|Caption1\\nImage:Example.jpg|Caption2\"}\n//Block Quote\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png\",\n \"speedTip\": \"Insert block of quoted text\",\n \"tagOpen\": \"<blockquote>\\n\",\n \"tagClose\": \"\\n</blockquote>\",\n \"sampleText\": \"Block quote\"}\n// Table\nmwCustomEditButtons[mwCustomEditButtons.length] = {\n \"imageFile\": \"http://upload.wikimedia.org/wikipedia/commons/0/04/Button_array.png\",\n \"speedTip\": \"Insert a table\",\n \"tagOpen\": '{| class=\"wikitable\"\\n|-\\n',\n \"tagClose\": \"\\n|}\",\n \"sampleText\": \"! header 1\\n! header 2\\n! header 3\\n|-\\n| row 1, cell 1\\n| row 1, cell 2\\n| row 1, cell 3\\n|-\\n| row 2, cell 1\\n| row 2, cell 2\\n| row 2, cell 3\"}\n}", "get toolbarBtns() {\n let defaultBtns =\n 'heading,bold,italic,quote,link,image,table,hr,list-ol,list-ul,undo,help';\n let btns = [];\n if (this.args.btns) {\n btns = this.args.btns.split(',');\n } else {\n btns = defaultBtns.split(',');\n }\n var that = this;\n var toolbarBtns = [];\n var btnGroups = [];\n var formattingOpts = that._formattingOpts;\n\n btns.forEach(function (type) {\n if (!btnGroups[formattingOpts[type].group]) {\n btnGroups[formattingOpts[type].group] = [];\n }\n btnGroups[formattingOpts[type].group].push(formattingOpts[type]);\n });\n\n btnGroups.forEach(function (btn) {\n toolbarBtns.push(A(btn));\n });\n\n return A(toolbarBtns);\n }", "function addExtraButtons () {\n\tmw.toolbar.addButtons(\n\t{\n\t\t'imageId': 'button-redirect',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_redirect.png', \n\t\t'speedTip': 'Redirect',\n\t\t'tagOpen': '#REDIRECT[[',\n\t\t'tagClose': ']]',\n\t\t'sampleText': 'Target page name'\n\t},\n\t{\n\t\t'imageId': 'button-strike',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_strike.png', \n\t\t'speedTip': 'Strike',\n\t\t'tagOpen': '<s>',\n\t\t'tagClose': '</s>',\n\t\t'sampleText': 'Strike-through text'\n\t},\n\t{\n\t\t'imageId': 'button-enter',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_enter.png', \n\t\t'speedTip': 'Line break',\n\t\t'tagOpen': '<br/>',\n\t\t'tagClose': '',\n\t\t'sampleText': ''\n\t}, \n\t\t'imageId': 'button-hide-comment',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_hide_comment.png', \n\t\t'speedTip': 'Insert hidden Comment',\n\t\t'tagOpen': '<!-- ',\n\t\t'tagClose': ' -->',\n\t\t'sampleText': 'Comment'\n\t}, \n\t{\n\t\t'imageId': 'button-blockquote',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_blockquote.png',\n\t\t'speedTip': 'Insert block of quoted text',\n\t\t'tagOpen': '<blockquote>\\n',\n\t\t'tagClose': '\\n</blockquote>',\n\t\t'sampleText': 'Block quote'\n\t},\n\t{\n\t\t'imageId': 'button-insert-table',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_insert_table.png',\n\t\t'speedTip': 'Insert a table',\n\t\t'tagOpen': '{| class=\"wikitable\"\\n|',\n\t\t'tagClose': '\\n|}',\n\t\t'sampleText': '-\\n! header 1\\n! header 2\\n! header 3\\n|-\\n| row 1, cell 1\\n| row 1, cell 2\\n| row 1, cell 3\\n|-\\n| row 2, cell 1\\n| row 2, cell 2\\n| row 2, cell 3'\n\t},\n\t{\n\t\t'imageId': 'button-insert-reflink',\n\t\t'imageFile': '//static3.wikia.nocookie.net/psiepsilon/images/c/c9/Button_reflink.png',\n\t\t'speedTip': 'Insert a reference',\n\t\t'tagOpen': '<ref>',\n\t\t'tagClose': '</ref>',\n\t\t'sampleText': 'Insert footnote text here'\n\t}\n\t);\n}", "function styleButtons() {\n $(\"button, input:submit\").button();\n\t $(\"button, input:button\").button();\n}", "function setButtonStyles () {\n // OPACITY VALUES FOR BUTTON STYLES\n var a1 = 0.08;\n var a2 = 0.16;\n var a3 = 0.25;\n\n // SET CUSTOM CSS PROPERTIES OF BUTTON STYLES\n document.documentElement.style.setProperty('--button-color-default', 'rgba(' + cc + ', ' + a1 + ')');\n document.documentElement.style.setProperty('--button-color-hover', 'rgba(' + cc + ', ' + a2 + ')');\n document.documentElement.style.setProperty('--button-color-active', 'rgba(' + cc + ', ' + a3 + ')');\n}", "function setButtonStyles () {\n // OPACITY VALUES FOR BUTTON STYLES\n var a1 = 0.08;\n var a2 = 0.16;\n var a3 = 0.25;\n\n // SET CUSTOM CSS PROPERTIES OF BUTTON STYLES\n document.documentElement.style.setProperty('--button-color-default', 'rgba(' + cc + ', ' + a1 + ')');\n document.documentElement.style.setProperty('--button-color-hover', 'rgba(' + cc + ', ' + a2 + ')');\n document.documentElement.style.setProperty('--button-color-active', 'rgba(' + cc + ', ' + a3 + ')');\n}", "static get styleUrls() {\n return [\n 'jqx.button.css'\n ]\n }", "getActiveStyle() {\n\n let style = \"\";\n this.bar.buttons.forEach(button => {\n if (button.active) {\n if (button.type == \"style\" || button.type == \"align\") {\n style += button.style;\n }\n }\n });\n return style;\n }", "function toolbarControls()\n{\n\tvar toolBarBtnArray = new Array();\n\n\t//if we're a coldfusion connection, add a button to get to admin via the server\n\tif (isDisplayingColdfusionConnections())\n\t{\n\t\tvar datasrcButton = new ToolbarControlRec();\n\t\tdatasrcButton.image\t\t\t= DATASRCBUTTONUP;\n\t\tdatasrcButton.pressedImage\t= DATASRCBUTTONDOWN;\n\t\tdatasrcButton.toolStyle\t\t= \"right\";\n\t\tdatasrcButton.toolTipText\t= MM.BTN_ModifyDataSources;\n\t\tdatasrcButton.command = \"MMDB.showColdFusionAdmin();\";\n\t\tdatasrcButton.enabled = true;\n\t\ttoolBarBtnArray.push(datasrcButton);\n\t}\n\n\tvar refreshButton = new ToolbarControlRec();\n\trefreshButton.image\t\t\t= REFRESHBUTTONUP;\n\trefreshButton.pressedImage\t= REFRESHBUTTONDOWN;\n\trefreshButton.toolStyle\t\t= \"right\";\n\trefreshButton.toolTipText\t= MM.BTN_Refresh;\n\trefreshButton.command = \"clickedRefresh()\";\n\t// No reason to ever disable refresh button\n\t//refreshButton.enabled = \"(dw.databasePalette.getSelectedNode() && (dw.databasePalette.getSelectedNode().objectType=='Connection'))\";\n\ttoolBarBtnArray.push(refreshButton);\n\n return toolBarBtnArray;\n}", "function updateActiveButtons() {\n var selectedRange = wpdtEditor.getSelectedRange()[0],\n highlightRow = selectedRange.highlight.row,\n highlightCol = selectedRange.highlight.col,\n cellMeta = wpdtEditor.getCellMeta(highlightRow, highlightCol),\n cellData = wpdtEditor.getDataAtCell(highlightRow, highlightCol),\n cellClasses = typeof cellMeta.className != 'undefined' ? cellMeta.className : '',\n bgColorButton = $('#wpdt-background-color'),\n mainAlignButtonIcon = $('#wpdt-align-button i:first-child'),\n mainValignButtonIcon = $('#wpdt-valign-button i:first-child'),\n mainWrapButtonIcon = $('#wpdt-wrap-button i:first-child'),\n textColorButton = $('#wpdt-text-color'),\n linkButton = $('#wpdt-link'),\n mediaButton = $('#wpdt-media'),\n htmlButton = $('#wpdt-html'),\n shortcodeButton = $('#wpdt-do-shortcode'),\n starButton = $('#wpdt-star-rating');\n // Update Bold button\n if (cellClasses.indexOf('wpdt-bold') !== -1) {\n $('#wpdt-bold').addClass('selected');\n } else {\n $('#wpdt-bold').removeClass('selected');\n }\n // Update Italic button\n if (cellClasses.indexOf('wpdt-italic') !== -1) {\n $('#wpdt-italic').addClass('selected');\n } else {\n $('#wpdt-italic').removeClass('selected');\n }\n // Update Underline button\n if (cellClasses.indexOf('wpdt-underline') !== -1) {\n $('#wpdt-underline').addClass('selected');\n } else {\n $('#wpdt-underline').removeClass('selected');\n }\n // Update Text color button\n if (cellClasses.indexOf('wpdt-tc-') !== -1) {\n let textColor = cellClasses.substring(cellClasses.indexOf('wpdt-tc-') + 8, cellClasses.indexOf('wpdt-tc-') + 14);\n textColorButton.removeAttr('style');\n textColorButton.css(\"border-bottom-color\", \"#\" + textColor);\n } else {\n textColorButton.removeAttr('style');\n textColorButton.css(\"border-bottom-color\", \"#000000\");\n }\n // Update Background color button\n if (cellClasses.indexOf('wpdt-bc-') !== -1) {\n let bgColor = cellClasses.substring(cellClasses.indexOf('wpdt-bc-') + 8, cellClasses.indexOf('wpdt-bc-') + 14);\n bgColorButton.removeAttr('style');\n bgColorButton.css(\"border-bottom-color\", \"#\" + bgColor);\n } else {\n bgColorButton.removeAttr('style');\n bgColorButton.css(\"border-bottom-color\", \"#FFFFFF\");\n }\n // Update Horizontal right align button\n if (cellClasses.indexOf('wpdt-align-right') !== -1) {\n $('#wpdt-align-right').addClass('selected');\n mainAlignButtonIcon.removeClass();\n mainAlignButtonIcon.addClass('wpdt-icon-align-right');\n } else {\n $('#wpdt-align-right').removeClass('selected');\n }\n // Update Horizontal left align button\n if (cellClasses.indexOf('wpdt-align-left') !== -1) {\n $('#wpdt-align-left').addClass('selected');\n mainAlignButtonIcon.removeClass();\n mainAlignButtonIcon.addClass('wpdt-icon-align-left');\n } else {\n $('#wpdt-align-left').removeClass('selected');\n }\n // Update Horizontal center align button\n if (cellClasses.indexOf('wpdt-align-center') !== -1) {\n $('#wpdt-align-center').addClass('selected');\n mainAlignButtonIcon.removeClass();\n mainAlignButtonIcon.addClass('wpdt-icon-align-center');\n } else {\n $('#wpdt-align-center').removeClass('selected');\n }\n // Update Horizontal justify align button\n if (cellClasses.indexOf('wpdt-align-justify') !== -1) {\n $('#wpdt-align-justify').addClass('selected');\n mainAlignButtonIcon.removeClass();\n mainAlignButtonIcon.addClass('wpdt-icon-align-justify');\n } else {\n $('#wpdt-align-justify').removeClass('selected');\n }\n // Update main Horizontal align button\n if (cellClasses.indexOf('wpdt-align-justify') === -1 &&\n cellClasses.indexOf('wpdt-align-center') === -1 &&\n cellClasses.indexOf('wpdt-align-left') === -1 &&\n cellClasses.indexOf('wpdt-align-right') === -1\n ) {\n mainAlignButtonIcon.removeClass();\n mainAlignButtonIcon.addClass('wpdt-icon-align-left');\n }\n // Update Vertical top align button\n if (cellClasses.indexOf('wpdt-valign-top') !== -1) {\n $('#wpdt-valign-top').addClass('selected');\n mainValignButtonIcon.removeClass();\n mainValignButtonIcon.addClass('wpdt-icon-vertical-align-top');\n } else {\n $('#wpdt-valign-top').removeClass('selected');\n }\n // Update Vertical middle align button\n if (cellClasses.indexOf('wpdt-valign-middle') !== -1) {\n $('#wpdt-valign-middle').addClass('selected');\n mainValignButtonIcon.removeClass();\n mainValignButtonIcon.addClass('wpdt-icon-vertical-align-center');\n } else {\n $('#wpdt-valign-middle').removeClass('selected');\n }\n // Update Vertical bottom align button\n if (cellClasses.indexOf('wpdt-valign-bottom') !== -1) {\n $('#wpdt-valign-bottom').addClass('selected');\n mainValignButtonIcon.removeClass();\n mainValignButtonIcon.addClass('wpdt-icon-vertical-align-bottom');\n } else {\n $('#wpdt-valign-bottom').removeClass('selected');\n }\n // Update main Vertical align button\n if (cellClasses.indexOf('wpdt-valign-top') === -1 &&\n cellClasses.indexOf('wpdt-valign-middle') === -1 &&\n cellClasses.indexOf('wpdt-valign-bottom') === -1\n ) {\n mainValignButtonIcon.removeClass();\n mainValignButtonIcon.addClass('wpdt-icon-vertical-align-center');\n }\n // Update Wrap text button\n if (cellClasses.indexOf('wpdt-wrap-text') !== -1) {\n $('#wpdt-wrap-text').addClass('selected');\n mainWrapButtonIcon.removeClass();\n mainWrapButtonIcon.addClass('wpdt-icon-wrap-text');\n } else {\n $('#wpdt-wrap-text').removeClass('selected');\n }\n // Update Overflow text button\n if (cellClasses.indexOf('wpdt-overflow-text') !== -1) {\n $('#wpdt-overflow-text').addClass('selected');\n mainWrapButtonIcon.removeClass();\n mainWrapButtonIcon.addClass('wpdt-icon-overflow-text');\n } else {\n $('#wpdt-overflow-text').removeClass('selected');\n }\n // Update Clip text button\n if (cellClasses.indexOf('wpdt-clip-text') !== -1) {\n $('#wpdt-clip-text').addClass('selected');\n mainWrapButtonIcon.removeClass();\n mainWrapButtonIcon.addClass('wpdt-icon-clip-text');\n } else {\n $('#wpdt-clip-text').removeClass('selected');\n }\n // Update main Wrap text button\n if (cellClasses.indexOf('wpdt-wrap-text') === -1 &&\n cellClasses.indexOf('wpdt-overflow-text') === -1 &&\n cellClasses.indexOf('wpdt-clip-text') === -1\n ) {\n mainWrapButtonIcon.removeClass();\n mainWrapButtonIcon.addClass('wpdt-icon-wrap-text');\n }\n\n // Update Link button\n if (cellData != null && cellData.indexOf('wpdt-link-content') !== -1) {\n linkButton.addClass('selected');\n } else {\n linkButton.removeClass('selected');\n }\n // Update Media button\n if (cellData != null && cellData.indexOf('wpdt-media-content') !== -1) {\n mediaButton.addClass('selected');\n } else {\n mediaButton.removeClass('selected');\n }\n // Update HTML button\n if (cellData != null && cellData.indexOf('wpdt-html-content') !== -1) {\n htmlButton.addClass('selected');\n } else {\n htmlButton.removeClass('selected');\n }\n\n // Update Shortcode button\n if (cellData != null && cellData.indexOf('wpdt-do-shortcode') !== -1) {\n shortcodeButton.addClass('selected');\n } else {\n shortcodeButton.removeClass('selected');\n }\n\n // Update HTML button\n if (cellData != null && cellData.indexOf('wpdt-star-rating') !== -1) {\n starButton.addClass('selected');\n } else {\n starButton.removeClass('selected');\n }\n }", "function renderButtons() {\n\n $(\"#cartoon-buttons\").empty();\n\n for (i = 0; i < topicsarray.length; i++) {\n var btn = \"<button class='btn-primary' data-cartoon='\" + topicsarray[i] + \"'>\" + topicsarray[i] + \" </button>\"\n // btn.style.paddingLeft = \"50px\";\n // $(\"#cartoon-buttons\").append(\"<button class='btn-primary' data-cartoon='\" + topicsarray[i] + \"'>\" + topicsarray[i] + \" </button>\");\n // btn.css( { marginLeft : \"5px\", marginRight : \"5px\" } )\n $(\"#cartoon-buttons\").append(btn);\n // btn.css( { \"padding-right\" : \"10px\" } );\n }\n\n }", "function addButtons() {\n\t\tcreateButton(\"Outdent\");\n\t\tcreateButton(\"Indent\");\n\t}", "static get baseStyles() {\n return [\n ...super.styles,\n css`\n :host([hidden]) {\n display: none;\n }\n #toolbar {\n display: flex;\n opacity: 1;\n z-index: 1;\n margin: 0;\n align-items: stretch;\n flex-wrap: wrap;\n justify-content: flex-start;\n background-color: var(--rich-text-editor-bg);\n border: var(--rich-text-editor-border);\n font-size: 12px;\n transition: all 0.5s;\n }\n #toolbar[aria-hidden=\"true\"] {\n visibility: hidden;\n opacity: 0;\n height: 0;\n }\n #toolbar .group {\n display: flex;\n flex-wrap: nowrap;\n justify-content: space-evenly;\n align-items: stretch;\n padding: 0 3px;\n }\n #toolbar .group:not(:last-of-type) {\n margin-right: 3px;\n border-right: var(--rich-text-editor-border);\n }\n #toolbar .button {\n display: flex;\n flex: 0 0 auto;\n align-items: stretch;\n }\n #toolbar #morebutton {\n flex: 1 0 auto;\n justify-content: flex-end;\n }\n /* hide more button if all buttons are displayed */\n #toolbar[responsive-size=\"xs\"] #morebutton[collapse-max=\"xs\"],\n #toolbar[responsive-size=\"sm\"] #morebutton[collapse-max*=\"s\"],\n #toolbar[responsive-size=\"md\"] #morebutton:not([collapse-max*=\"l\"]),\n #toolbar[responsive-size=\"lg\"] #morebutton:not([collapse-max=\"xl\"]),\n #toolbar[responsive-size=\"xl\"] #morebutton,\n /* hide buttons if they should be collaped until */\n #toolbar[responsive-size=\"xs\"][collapsed] *[collapsed-until*=\"m\"],\n #toolbar[responsive-size=\"xs\"][collapsed] *[collapsed-until*=\"l\"],\n #toolbar[responsive-size=\"sm\"][collapsed] *[collapsed-until=\"md\"],\n #toolbar[responsive-size=\"sm\"][collapsed] *[collapsed-until*=\"l\"],\n #toolbar[responsive-size=\"md\"][collapsed] *[collapsed-until*=\"l\"],\n #toolbar[responsive-size=\"lg\"][collapsed] *[collapsed-until=\"xl\"] {\n display: none;\n }\n `,\n ];\n }", "function buttonEmphasize(e) {\n for (var n = 0; n < buttons.length; n++) {\n if (vars[buttons[n].name] && buttons[n].emphasis && buttons[n].tag != '')\n detectElement(buttons[n].tag) ? toolbar.find('.' + vars.css + '_tool_' + buttons[n].cls).addClass(emphasize) : $('.' + vars.css + '_tool_' + buttons[n].cls).removeClass(emphasize);\n }\n // showing text format\n if (vars.format && angular.isArray(vars.formats)) {\n var isFoundFormat = false;\n\n for (var f = 0; f < vars.formats.length; f++) {\n var thisFormat = [];\n thisFormat[0] = vars.formats[f][0];\n\n if (vars.formats[f][0].length > 0 && detectElement(thisFormat)) {\n formatLabelView(vars.formats[f][1]);\n\n isFoundFormat = true;\n break;\n }\n }\n\n if (!isFoundFormat)\n formatLabelView(vars.formats[0][1]);\n }\n\n // hide all style-fields\n styleFieldSwitch(\"\", false);\n formatFieldSwitch(false);\n }", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n\n // Find the button just clicked\n let button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n let buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n _bubbleChart.toggleDisplay(buttonId);\n });\n}", "function initDataSourceToolbarButtons() {\r\n\r\n // Init variables for the toolbar controls\r\n toolBar = container.find(\".\" + config.CSS.DATA_SOURCE_TOOLBAR);\r\n\r\n // Init toolbar Button\r\n /*\r\n * Event deligation to the containing div for the button toolbar.\r\n * This pattern reduces the number of event handerlers.\r\n */\r\n toolBar.on('click', 'button', function(event) {\r\n\r\n // Prevent event propogation or \"bubbling up\"\r\n event.preventDefault();\r\n\r\n // XXX This is clumsy needs refactoring\r\n var classList = $(event.currentTarget).attr('class'),\r\n classArray = classList.split(\" \"),\r\n uniqueClass;\r\n\r\n // XXX Need selected row content ID and or data source id\r\n if (classArray.length >= 2) {\r\n // Second class in list is the unique class for the button\r\n uniqueClass = classArray[1].trim();\r\n\r\n // Make sure the class is what we are looking for\r\n if (uniqueClass.indexOf('data-source-') >= 0) {\r\n $(publicInterface).trigger(config.CFG.TOOL_BAR_CLICK_EVENT, {\r\n button: uniqueClass\r\n });\r\n }\r\n }\r\n });\r\n\r\n }", "_applyTheme(theme) {\n const that = this;\n\n if (theme !== '') {\n const headerButtons = that.$.buttonsContainer.children;\n\n for (let i = 0; i < headerButtons.length; i++) {\n headerButtons[i].classList.add(theme);\n }\n }\n }", "function renderButtons() {\n\t\tcelebButtons.empty();\n\n\n\t\tfor (var i = 0; i < topics.length; i++) {\n\t\t\taddButton = $(\"<button>\");\n\t\t\taddButton.addClass(\"celebrity-button\")\n\t\t\taddButton.attr('data-name', topics[i]);\n\t\t\taddButton.removeClass('btn-success').addClass('btn-primary');\n\t\t\t$(this).addClass('btn-fancy').removeClass('btn-primary');\n\t\t\taddButton.text(topics[i]);\n\t\t\tcelebButtons.append(addButton);\n\n\t\t}\n\t}", "init() {\n this.editor.style.width = this.width;\n this.editor.style.height = this.height;\n this.bar.setupToolbar();\n\n this.createTag(\"\", this.getActiveTags(), this.getActiveStyle());\n\n let tools = document.querySelectorAll(\".editor-button\");\n tools.forEach(t => {\n t.addEventListener('click', (e) => {\n this.updateStyle(e);\n });\n });\n }", "renderButtonSet() {\n if (!this.jQueryEl.hasClass('contextual-toolbar')) return;\n\n function isItemOverflowed(item) {\n const isRTL = Locale.isRTL();\n const itemRect = item.getBoundingClientRect();\n const buttonsetRect = item.parentElement.getBoundingClientRect();\n const itemOutsideXEdge = isRTL ? (itemRect.left <= buttonsetRect.left) :\n (itemRect.right >= buttonsetRect.right || itemRect.right);\n const itemBelowYEdge = itemRect.bottom >= buttonsetRect.bottom;\n\n return itemBelowYEdge === true || itemOutsideXEdge === true;\n }\n\n const isMoreThanFive = this.toolBarItems?.not('.btn-actions').length > 5;\n const targetItems = isMoreThanFive ? this.toolBarItems?.not('.btn-actions').slice(0, 5) : this.toolBarItems?.not('.btn-actions');\n targetItems.removeClass('is-overflowed');\n const overflowedItems = isMoreThanFive ? this.toolBarItems?.not('.btn-actions').slice(5) : $();\n const visibleItems = $();\n\n for (let i = 0; i < targetItems.length; i++) {\n if (isItemOverflowed(targetItems[i])) {\n overflowedItems.push(targetItems[i]);\n } else {\n visibleItems.push(targetItems[i]);\n }\n }\n\n overflowedItems.addClass('is-overflowed');\n\n for (let i = 0; i < visibleItems.length; i++) {\n const actionButtonLinkData = $(visibleItems[i]).data('action-button-link');\n if (actionButtonLinkData) {\n actionButtonLinkData.parent()[0].classList.add('hidden');\n }\n }\n\n for (let i = 0; i < overflowedItems.length; i++) {\n const actionButtonLinkData = $(overflowedItems[i]).data('action-button-link');\n if (actionButtonLinkData) {\n actionButtonLinkData.parent()[0].classList.remove('hidden');\n }\n }\n\n if (overflowedItems.length > 0) {\n this.more.parent().css('display', 'inline-block');\n this.more.parent().siblings('.buttonset').css('width', 'calc(55% - 41px');\n } else {\n this.more.parent().css('display', 'none');\n this.more.parent().siblings('.buttonset').css('width', 'calc(55% - 1px');\n }\n }", "function setButtonToolbarClass(props){\n\n // Variable for class selectors, defaults to belows value\n let buttontoolbarprops = \"btn-toolbar\";\n\n /**\n * This attribute justify and center the children of this component.\n * \n * <ButtonToolbar justify=\"true\">\n * <ButtonGroup vertical=\"true\">\n * <Button class=\"warning\">1</Button>\n * <Button class=\"danger\">2</Button>\n * <Button class=\"primary\">3</Button>\n * <Button class=\"secondary\">4</Button>\n * </ButtonGroup>\n * <ButtonGroup>\n * <Button class=\"warning\">1</Button>\n * <Button class=\"danger\">2</Button>\n * <Button class=\"primary\">3</Button>\n * <Button class=\"secondary\">4</Button>\n * </ButtonGroup>\n * </ButtonToolbar>\n * \n */\n if(props.justify === \"true\"){\n buttontoolbarprops += \" justify-content-between\";\n }\n\n return buttontoolbarprops;\n}", "static get styleUrls() {\n return [\n 'jqx.button.css',\n 'jqx.splitter.css'\n ]\n }", "function formatToolbar(selectedButtons) {\n const $toolbar = document.createElement('div');\n $toolbar.classList.add('toolbar');\n\n let markup = '';\n selectedButtons.forEach((name) => {\n // abort if separator\n if (name === '|') {\n markup += '<span class=\"tool-separator\">|</span>';\n return;\n }\n\n const button = buttonsData(name) ? buttonsData(name) : null;\n\n // abort if no data\n if (button === null) {\n return;\n }\n\n const shortcut = button.shortcut ? `data-shortcut=\"${button.shortcut}\"` : '';\n\n // add title attribute and info about its shortcut\n const title = (button.title && button.shortcut)\n ? `title=\"${button.title} (CTRL + ${button.shortcut.toUpperCase()})\"`\n : `title=\"${button.title}\"`;\n\n // if no icon, show first character\n const icon = button.icon ? button.icon : `<i>${button.title[0]}</i>`;\n\n // show label if exists\n const label = button.label ? `<span>${button.label}</span>` : '';\n\n // create the button\n markup += `<a class=\"tool-${name}\" data-tool=\"${name}\" ${shortcut} ${title}>\n ${icon} ${label}\n </a>`;\n });\n\n $toolbar.innerHTML = markup;\n return $toolbar;\n}", "static get styleUrls() {\n return [\n 'jqx.button.css',\n 'jqx.menu.css'\n ]\n }", "function renderButtons(savedButtons) {\n $(\"#api-list\").empty();\n // Looping through the array of topics\n for (var i = 0; i < savedButtons.length; i++){\n $(\"#api-list\").append(\n addObj({\n type: \"button\"\n ,class: \"classApi\"\n ,text: savedButtons[i].name\n ,attr: [\n { a: \"api-name\", v: savedButtons[i].name}\n , { a: \"api-description\", v: savedButtons[i].description}\n , { a: \"api-owner\", v: savedButtons[i].owner}\n , { a: \"api-authors\", v: savedButtons[i].authors}\n , { a: \"api-docurl\", v: savedButtons[i].docurl}\n , { a: \"api-url\", v: savedButtons[i].url}\n , { a: \"api-param\", v: savedButtons[i].param}\n , { a: \"api-sample\", v: savedButtons[i].sample}\n , { a: \"api-index\", v: i}\n ]\n }\n )\n\n )}\n }", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function() {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n //myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function values$static_(){ToolbarSkin.values=( com.coremedia.ui.util.Enum.collectValues(ToolbarSkin));}", "function Toolbar(props) {\n return (\n <ThemedButton onClick={props.changeTheme}>\n Change Theme\n </ThemedButton>\n );\n}", "static get styles() {\n return [\n css`\n :host {\n display: inline;\n --lrn-vocab-border: 1px dashed #ccc;\n }\n button {\n text-transform: none;\n min-width: unset;\n margin: 0;\n position: relative;\n top: 0px;\n border-radius: 0;\n border-bottom: var(--lrn-vocab-border);\n background: #f5f5f5;\n font-size: 1.1em;\n padding: 2px;\n }\n button:hover {\n background: #bbdefb;\n border-bottom: 1px dashed #2196f3;\n }\n `,\n ];\n }", "function updateToolbarButton() {\n \tif (toolbar.button === null)\n \t\treturn;\n\n \tvar icon = \"share/image/paused.png\",\n \t\ttitle = \"No playing videos.\";\n\n \tif(toolbar.videoid && pref.getPref(\"addtoolbarbutton\")) {\n \t\tif (video[toolbar.videoid].playing) {\n \t\t\ticon = \"share/image/playing.png\";\n \t\t\ttitle = video[toolbar.videoid].title + \" [Playing]\";\n \t\t}\n \t\telse {\n \t\t\ticon = \"share/image/paused.png\",\n \t\t\ttitle = video[toolbar.videoid].title + \" [Paused]\";\n \t\t}\n \t}\n \telse if (availableUpdate && (!videocount || !pref.getPref(\"addtoolbarbutton\"))) {\n \t\ticon = \"share/image/toolbar-button-attention.png\";\n \t\ttitle = \"An update for ExtendTube is available. Click for more info.\";\n \t}\n\n \tif (availableUpdate)\n \t\ticon = icon.replace(/(-attention)?\\.png$/, \"-attention.png\");\n\n \tif (toolbar.button.title != title) {\n \t\ttoolbar.button.icon = icon;\n \t\ttoolbar.button.title = title;\n \t}\n\n \t// Update badge text and colours.\n \tif (videocount && pref.getPref(\"addtoolbarbutton\")) {\n \t\ttoolbar.button.badge.textContent = videocount.toString();\n \t\ttoolbar.button.badge.backgroundColor = \"hsla(60, 100%, 50%, .4)\";\n \t\ttoolbar.button.badge.color = \"#a52a2a\";\n \t}\n \telse {\n \t\ttoolbar.button.badge.textContent = '!';\n \t\ttoolbar.button.badge.backgroundColor = \"hsla(200, 100%, 50%, .2)\";\n \t\ttoolbar.button.badge.color = \"#010203\";\n \t}\n }", "function ApplyToolbarHandlers(){\n var buttons = document.getElementsByClassName(\"toolbar-button\");\n //Megaplay\n buttons[0].addEventListener(\"click\", function(){\n gameInstance.SendMessage(\"RTClipEditor\", \"PlayActiveClipFromHTML\");\n });\n //Play/pause\n buttons[1].addEventListener(\"click\", function(){\n gameInstance.SendMessage(\"RTClipEditor\", \"TogglePause\");\n });\n //Reset active curve\n buttons[2].addEventListener(\"click\", function(){\n gameInstance.SendMessage(\"RTClipEditor\", \"ResetActiveCurve\");\n });\n //Reset active clip\n buttons[3].addEventListener(\"click\", function(){\n gameInstance.SendMessage(\"RTClipEditor\", \"ResetActiveClip\");\n });\n}", "function Toolbar(props) {\n return (\n <ThemedButton onClick={props.changeTheme}>\n Change Theme\n </ThemedButton>\n );\n}", "static get styles() {\n return [\n css`\n :host {\n display: block;\n overflow: auto;\n }\n .buttons {\n position: absolute;\n bottom: 0;\n z-index: 1000000;\n background-color: var(--simple-modal-titlebar-background, #000000);\n color: var(--simple-modal-titlebar-color, #ffffff);\n left: 0;\n right: 0;\n }\n .buttons button {\n color: black;\n background-color: white;\n }\n simple-icon {\n margin-right: 4px;\n }\n `,\n ];\n }", "updateButtons() {\n var svg = d3.select('.brush-' + this.getId());\n var box = /** @type {SVGElement} */ (svg.node()).getBBox();\n var xPos = (box.width / 2) - 4 + box.x;\n svg.selectAll('.buttons > .button').\n style('display', 'block').\n style('pointer-events', 'auto').\n attr('x', xPos);\n }", "get miniConfig() {\n return [\n {\n type: \"button-group\",\n buttons: [\n this.boldButton,\n this.italicButton,\n this.removeFormatButton,\n ],\n },\n this.linkButtonGroup,\n this.scriptButtonGroup,\n {\n type: \"button-group\",\n buttons: [this.orderedListButton, this.unorderedListButton],\n },\n ];\n }", "function setupButtons() {\r\n d3.select('#toolbar')\r\n .selectAll('.button')\r\n .on('click', function () {\r\n // Remove active class from all buttons\r\n d3.selectAll('.button').classed('active', false);\r\n // Find the button just clicked\r\n var button = d3.select(this);\r\n\r\n // Set it as the active button\r\n button.classed('active', true);\r\n\r\n // Get the id of the button\r\n var buttonId = button.attr('id');\r\n var dataArr = [];\r\n\r\n // Toggle the bubble chart based on\r\n // the currently clicked button.\r\n myBubbleChart.toggleDisplay(buttonId);\r\n });\r\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\t\tconsole.log(\"buttonId \"+buttonId);\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "renderToolbarButton() {\n const toolbars = this.instance.getChildByClass(this.instance.root, 'gm-toolbar');\n if (!toolbars) {\n return; // if we don't have toolbar, we can't spawn the widget\n }\n\n const toolbar = toolbars.children[0];\n this.toolbarBtn = document.createElement('li');\n this.toolbarBtnImage = document.createElement('div');\n this.toolbarBtnImage.className = 'gm-icon-button gm-iothrottling-button';\n this.toolbarBtnImage.title = this.i18n.IOTHROTTLING_TITLE || 'Disk I/O';\n this.toolbarBtn.appendChild(this.toolbarBtnImage);\n this.toolbarBtn.onclick = this.toggleWidget.bind(this);\n toolbar.appendChild(this.toolbarBtn);\n }", "function updateButtonColors(button, parent) {\n parent.selectAll(\"rect\")\n .attr(\"fill\",defaultColor)\n\n button.select(\"rect\")\n .attr(\"fill\",pressedColor)\n}", "static get styleUrls() {\n return [\n 'jqx.button.css',\n 'jqx.numerictextbox.css'\n ]\n }", "function Toolbar(props) {\n return (\n <ThemedButtonComponent1 onClick={props.changeTheme}>\n Click to Change Theme \n </ThemedButtonComponent1>\n );\n}", "static get styleUrls() {\n return [\n 'jqx.powerbutton.css'\n ]\n }", "renderPopularThemes() {\n return (\n popularThemes.map((theme) => {\n const name = theme.name;\n const props = this.props;\n\n return <Button key={name}\n callback={() => props.uiStyleChange(\n theme.background,\n theme.buttonBackground,\n theme.buttonColor,\n theme.color\n )}\n content={name} />\n })\n )\n }", "function setAllBtnColor() {\n\tsetBtnColor(idName('pen'), (mouse.status == mouseStatus.paint));\n\tsetBtnColor(idName('eraser'),\n\t\t(mouse.status == mouseStatus.erase));\n\tif (mouse.status == mouseStatus.other)\n\t\tclickShape();\n\telse\n\t\tclickPaint();\n}", "function renderButtons () {\n\t\t$(\".buttons-view\").empty();\n\t\tfor (var i = 0; i < topics.length; i++) {\n\t\t\tvar newButton = $(\"<button>\");\n\t\t\tnewButton.addClass(\"topic btn btn-default\");\n\t\t\tnewButton.attr(\"data-name\", topics[i]);\n\t\t\tnewButton.text(topics[i]);\n\t\t\t$(\".buttons-view\").append(newButton);\n\t\t}\n\t}", "_updateButtons() {\n const hideButton = action =>\n this.$header.querySelector(`.osjs-window-button[data-action=${action}]`)\n .style.display = 'none';\n\n const buttonmap = {\n maximizable: 'maximize',\n minimizable: 'minimize',\n closeable: 'close'\n };\n\n if (this.attributes.controls) {\n Object.keys(buttonmap)\n .forEach(key => {\n if (!this.attributes[key]) {\n hideButton(buttonmap[key]);\n }\n });\n } else {\n Array.from(this.$header.querySelectorAll('.osjs-window-button'))\n .forEach(el => el.style.display = 'none');\n }\n }", "get scriptButtonGroup() {\n return {\n type: \"simple-toolbar-button-group\",\n subtype: \"script-button-group\",\n \"aria-label\": \"Subscript and Superscript\",\n buttons: [this.subscriptButton, this.superscriptButton],\n };\n }", "static get tag(){return\"rich-text-editor-toolbar-mini\"}", "function finaliseButtonDisplay(specificWidgetArray) {\r\n// Old \r\n//function finaliseButtonDisplay() {\r\n// END CHANGE BY Marc TABARY - 2017-03-06 - ALLOW DISABLED SPECIFIC WIDGET\r\n\r\n// ADD BY Marc TABARY - 2017-03-06 - - ALLOW DISABLED SPECIFIC WIDGET\r\n if (specificWidgetArray!==undefined) {\r\n // This parameter must be an array\r\n if (specificWidgetArray instanceof Array) {\r\n for (i = 0; i < specificWidgetArray.length; i++) {\r\n enableWidget(specificWidgetArray[i]);\r\n }\r\n }\r\n }\r\n// END ADD BY Marc TABARY - 2017-03-06 - - ALLOW DISABLED SPECIFIC WIDGET\r\n\r\n id = dojo.byId(\"id\");\r\n if (id) {\r\n if (id.value == \"\") {\r\n // id exists but is not set => new item, all buttons locked until first\r\n // change\r\n formLock();\r\n enableWidget('newButton');\r\n enableWidget('newButtonList');\r\n enableWidget('saveButton');\r\n disableWidget('undoButton');\r\n disableWidget('mailButton');\r\n disableWidget('changeStatusButton');\r\n disableWidget('subscribeButton');\r\n if (dijit.byId(\"objectGrid\")) {\r\n enableWidget('multiUpdateButton');\r\n } else {\r\n disableWidget('multiUpdateButton');\r\n disableWidget('indentDecreaseButton');\r\n disableWidget('indentIncreaseButton');\r\n }\r\n }\r\n } else {\r\n // id does not exist => not selected, only new button possible\r\n formLock();\r\n enableWidget('newButton');\r\n enableWidget('newButtonList');\r\n disableWidget('changeStatusButton');\r\n disableWidget('subscribeButton');\r\n if (dijit.byId(\"objectGrid\")) {\r\n enableWidget('multiUpdateButton');\r\n } else {\r\n disableWidget('multiUpdateButton');\r\n }\r\n // but show print buttons if not in objectDetail (buttonDiv exists)\r\n if (!dojo.byId(\"buttonDiv\")) {\r\n enableWidget('printButton');\r\n enableWidget('printButtonPdf');\r\n }\r\n }\r\n buttonRightLock();\r\n}", "function changePreviewStyle(style) {\n\t\t$(\"#StylePreview #UIToolbarContainer\").attr('class',\n\t\t\t\t\"UIContainer UIToolbarContainer UIToolbarContainer\" + style);\n\t}", "function coloredButtons() {\r\n\r\n\t\t\t\t$('.nectar-button.see-through[data-color-override], .nectar-button.see-through-2[data-color-override], .nectar-button.see-through-3[data-color-override]').each(function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $usingMaterialSkin = ($('body.material[data-button-style^=\"rounded\"]').length > 0) ? true : false;\r\n\t\t\t\t\t$(this).css('visibility', 'visible');\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($(this).hasClass('see-through-3') && $(this).attr('data-color-override') == 'false') {\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $color;\r\n\t\t\t\t\tvar $that;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($(this).attr('data-color-override') != 'false') {\r\n\t\t\t\t\t\t$color = $(this).attr('data-color-override');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($(this).parents('.dark').length > 0) {\r\n\t\t\t\t\t\t\t$color = '#000000';\r\n\t\t\t\t\t\t}\telse {\r\n\t\t\t\t\t\t\t$color = '#ffffff';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!$(this).hasClass('see-through-3')) {\r\n\t\t\t\t\t\t$(this).css('color', $color);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).find('i').css('color', $color);\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar colorInt = parseInt($color.substring(1), 16);\r\n\t\t\t\t\tvar $hoverColor = ($(this).has('[data-hover-color-override]')) ? $(this).attr('data-hover-color-override') : 'no-override';\r\n\t\t\t\t\tvar $hoverTextColor = ($(this).has('[data-hover-text-color-override]')) ? $(this).attr('data-hover-text-color-override') : '#fff';\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar R = (colorInt & 0xFF0000) >> 16;\r\n\t\t\t\t\tvar G = (colorInt & 0x00FF00) >> 8;\r\n\t\t\t\t\tvar B = (colorInt & 0x0000FF) >> 0;\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $opacityStr = ($(this).hasClass('see-through-3')) ? '1' : '0.75';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).css('border-color', 'rgba(' + R + ',' + G + ',' + B + ',' + $opacityStr + ')');\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Material theme skin buttons w/ icons starting\r\n\t\t\t\t\tif ($usingMaterialSkin) {\r\n\t\t\t\t\t\t$(this).find('i').css({\r\n\t\t\t\t\t\t\t'background-color': 'rgba(' + R + ',' + G + ',' + B + ',1)',\r\n\t\t\t\t\t\t\t'box-shadow': '0px 8px 15px rgba(' + R + ',' + G + ',' + B + ',0.24)'\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($(this).hasClass('see-through')) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$that = $(this);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).on('mouseenter touchstart', function () {\r\n\t\t\t\t\t\t\t$that.css('border-color', 'rgba(' + R + ',' + G + ',' + B + ',1)');\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).on('mouseleave touchtouchend', function () {\r\n\t\t\t\t\t\t\t$that.css('border-color', 'rgba(' + R + ',' + G + ',' + B + ',1)');\r\n\t\t\t\t\t\t\t$opacityStr = ($(this).hasClass('see-through-3')) ? '1' : '0.75';\r\n\t\t\t\t\t\t\t$that.css('border-color', 'rgba(' + R + ',' + G + ',' + B + ',' + $opacityStr + ')');\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).find('i').css('color', $hoverTextColor);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($hoverColor != 'no-override') {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$that = $(this);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$(this).on('mouseenter touchstart', function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$that.css({\r\n\t\t\t\t\t\t\t\t\t'border-color': $hoverColor,\r\n\t\t\t\t\t\t\t\t\t'background-color': $hoverColor,\r\n\t\t\t\t\t\t\t\t\t'color': $hoverTextColor\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// Material buttons w/ icons over\r\n\t\t\t\t\t\t\t\tif ($usingMaterialSkin) {\r\n\t\t\t\t\t\t\t\t\t$that.find('i').css({\r\n\t\t\t\t\t\t\t\t\t\t'background-color': '',\r\n\t\t\t\t\t\t\t\t\t\t'box-shadow': ''\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$(this).on('mouseleave touchtouchend', function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$opacityStr = ($(this).hasClass('see-through-3')) ? '1' : '0.75';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($usingMaterialSkin) {\r\n\t\t\t\t\t\t\t\t\t$that.find('i').css({\r\n\t\t\t\t\t\t\t\t\t\t'background-color': 'rgba(' + R + ',' + G + ',' + B + ',1)',\r\n\t\t\t\t\t\t\t\t\t\t'box-shadow': '0px 8px 15px rgba(' + R + ',' + G + ',' + B + ',0.24)'\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\tif (!$that.hasClass('see-through-3')) {\r\n\t\t\t\t\t\t\t\t\t$that.css({\r\n\t\t\t\t\t\t\t\t\t\t'border-color': 'rgba(' + R + ',' + G + ',' + B + ',' + $opacityStr + ')',\r\n\t\t\t\t\t\t\t\t\t\t'background-color': 'transparent',\r\n\t\t\t\t\t\t\t\t\t\t'color': $color\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t$that.css({\r\n\t\t\t\t\t\t\t\t\t\t'border-color': 'rgba(' + R + ',' + G + ',' + B + ',' + $opacityStr + ')',\r\n\t\t\t\t\t\t\t\t\t\t'background-color': 'transparent'\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});\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$that = $(this);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$(this).on('mouseenter touchstart', function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$that.css({\r\n\t\t\t\t\t\t\t\t\t'border-color': $hoverColor,\r\n\t\t\t\t\t\t\t\t\t'color': $hoverTextColor\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$(this).on('mouseleave touchtouchend', function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$opacityStr = ($that.hasClass('see-through-3')) ? '1' : '0.75';\r\n\t\t\t\t\t\t\t\t$that.css({\r\n\t\t\t\t\t\t\t\t\t'border-color': 'rgba(' + R + ',' + G + ',' + B + ',' + $opacityStr + ')',\r\n\t\t\t\t\t\t\t\t\t'color': $hoverTextColor\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t$('.nectar-button:not(.see-through):not(.see-through-2):not(.see-through-3)[data-color-override]').each(function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).css('visibility', 'visible');\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($(this).attr('data-color-override') != 'false') {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $color = $(this).attr('data-color-override');\r\n\r\n\t\t\t\t\t\t$(this)\r\n\t\t\t\t\t\t\t.removeClass('accent-color')\r\n\t\t\t\t\t\t\t.removeClass('extra-color-1')\r\n\t\t\t\t\t\t\t.removeClass('extra-color-2')\r\n\t\t\t\t\t\t\t.removeClass('extra-color-3')\r\n\t\t\t\t\t\t\t.css('background-color', $color);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// Solid color tilt \r\n\t\t\t\tif ($('.swiper-slide .solid_color_2').length > 0 || $('.tilt-button-inner').length > 0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $tiltButtonCssString = '';\r\n\t\t\t\t\tvar $color;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.swiper-slide .solid_color_2 a').each(function (i) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).addClass('instance-' + i);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($(this).attr('data-color-override') != 'false') {\r\n\t\t\t\t\t\t\t$color = $(this).attr('data-color-override');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif ($(this).parents('.dark').length > 0) {\r\n\t\t\t\t\t\t\t\t$color = '#000000';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t$color = '#ffffff';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).css('color', $color);\r\n\t\t\t\t\t\t$(this).find('i').css('color', $color);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $currentColor = $(this).css('background-color'),\r\n\t\t\t\t\t\t$topColor = shadeColor($currentColor, 0.13),\r\n\t\t\t\t\t\t$bottomColor = shadeColor($currentColor, -0.15);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$tiltButtonCssString += '.swiper-slide .solid_color_2 a.instance-' + i + ':after { background-color: ' + $topColor + '; }' + ' .swiper-slide .solid_color_2 a.instance-' + i + ':before { background-color: ' + $bottomColor + '; } ';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.tilt-button-wrap a').each(function (i) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).addClass('instance-' + i);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $currentColor = $(this).css('background-color');\r\n\t\t\t\t\t\tvar $color;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($(this).attr('data-color-override') != 'false') {\r\n\t\t\t\t\t\t\t$color = $(this).attr('data-color-override');\r\n\t\t\t\t\t\t\t$(this).css('background-color', $color);\r\n\t\t\t\t\t\t\t$currentColor = $color;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $topColor = shadeColor($currentColor, 0.13),\r\n\t\t\t\t\t\t$bottomColor = shadeColor($currentColor, -0.15);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$tiltButtonCssString += '.tilt-button-wrap a.instance-' + i + ':after { background-color: ' + $topColor + '; }' + ' .tilt-button-wrap a.instance-' + i + ':before { background-color: ' + $bottomColor + '; } ';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Style\r\n\t\t\t\t\tnectarCreateStyle($tiltButtonCssString, 'tilt-button');\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// Transparent 3D\r\n\t\t\t\tif ($('.nectar-3d-transparent-button').length > 0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $3dTransButtonCssString = '';\r\n\t\t\t\t\t$('.nectar-3d-transparent-button').each(function (i) {\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\t$size \t\t= $that.attr('data-size'),\r\n\t\t\t\t\t\t$padding \t= 0,\r\n\t\t\t\t\t\tv1 \t\t\t\t= 1.5,\r\n\t\t\t\t\t\tv2 \t\t\t\t= 1.65,\r\n\t\t\t\t\t\t$font_size;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Size\r\n\t\t\t\t\t\tif ($size == 'large') {\r\n\t\t\t\t\t\t\t$padding \t\t= 46;\r\n\t\t\t\t\t\t\t$font_size \t= 16;\r\n\t\t\t\t\t\t\tv1 \t\t\t\t\t= 1.5;\r\n\t\t\t\t\t\t\tv2 \t\t\t\t\t= 1.7;\r\n\t\t\t\t\t\t} else if ($size == 'medium') {\r\n\t\t\t\t\t\t\t$padding \t\t= 30;\r\n\t\t\t\t\t\t\t$font_size \t= 16;\r\n\t\t\t\t\t\t} else if ($size == 'small') {\r\n\t\t\t\t\t\t\t$padding \t\t= 20;\r\n\t\t\t\t\t\t\t$font_size \t= 12;\r\n\t\t\t\t\t\t} else if ($size == 'jumbo') {\r\n\t\t\t\t\t\t\t$padding \t\t= 54;\r\n\t\t\t\t\t\t\t$font_size \t= 24;\r\n\t\t\t\t\t\t\tv1 \t\t\t\t\t= 1.5;\r\n\t\t\t\t\t\t\tv2 \t\t\t\t\t= 1.68;\r\n\t\t\t\t\t\t} else if ($size == 'extra_jumbo') {\r\n\t\t\t\t\t\t\t$padding \t\t= 100;\r\n\t\t\t\t\t\t\t$font_size \t= 64;\r\n\t\t\t\t\t\t\tv1 \t\t\t\t\t= 1.6;\r\n\t\t\t\t\t\t\tv2 \t\t\t\t\t= 1.6;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$that.find('svg text').attr('font-size', $font_size);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $boundingRect = $(this).find('.back-3d .button-text')[0].getBoundingClientRect(),\r\n\t\t\t\t\t\t$text_width = $boundingRect.width,\r\n\t\t\t\t\t\t$text_height = $font_size * 1.5;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$that.css({\r\n\t\t\t\t\t\t\t'width': ($text_width + $padding * 1.5) + 'px',\r\n\t\t\t\t\t\t\t'height': ($text_height + $padding) + 'px'\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$that.find('> a').css({\r\n\t\t\t\t\t\t\t'height': ($text_height + $padding) + 'px'\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$that.find('.back-3d svg, .front-3d svg').css({\r\n\t\t\t\t\t\t\t'width': ($text_width + $padding * 1.5) + 'px',\r\n\t\t\t\t\t\t\t'height': ($text_height + $padding) + 'px'\r\n\t\t\t\t\t\t}).attr('viewBox', '0 0 ' + ($text_width + $padding) + ' ' + ($text_height + $padding));\r\n\r\n\t\t\t\t\t\t$that.find('svg text').attr('transform', 'matrix(1 0 0 1 ' + ($text_width + $padding * v1) / 2 + ' ' + (($text_height + $padding) / v2) + ')');\r\n\t\t\t\t\t\t$that.find('.front-3d, .back-3d').css('transform-origin', '50% 50% -' + ($text_height + $padding) / 2 + 'px');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Mask\r\n\t\t\t\t\t\t$(this).find('.front-3d svg > rect').attr('id', 'masked-rect-id-' + i);\r\n\t\t\t\t\t\t$(this).find('.front-3d defs mask').attr('id', 'button-text-mask-' + i);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$that.css('visibility', 'visible');\r\n\t\t\t\t\t\t$3dTransButtonCssString += '#masked-rect-id-' + i + ' { mask: url(#button-text-mask-' + i + '); -webkit-mask: url(#button-text-mask-' + i + ')} ';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Extra jumbo resize\r\n\t\t\t\t\tcreateExtraJumboSize();\r\n\t\t\t\t\t$window.on('smartresize', createExtraJumboSize);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Style\r\n\t\t\t\t\tnectarCreateStyle($3dTransButtonCssString, 'nectar-td-button');\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Gradient btn init\r\n\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t$('.nectar-button[class*=\"color-gradient\"] .start').removeClass('loading');\r\n\t\t\t\t}, 150);\r\n\t\t\t\t// No grad for ff\r\n\t\t\t\tif (navigator.userAgent.toLowerCase().indexOf('firefox') > -1 || \r\n\t\t\t\tnavigator.userAgent.indexOf(\"MSIE \") > -1 || \r\n\t\t\t\tnavigator.userAgent.match(/Trident\\/7\\./)) {\r\n\t\t\t\t\t$('.nectar-button[class*=\"color-gradient\"] .start').addClass('no-text-grad');\r\n\t\t\t\t}\r\n\t\t\t}", "function DEFAULT$static_(){ToolbarSkin.DEFAULT=( new ToolbarSkin(\"default\"));}", "function updateButtons() {\n $(\"#buttonDisplay\").empty();\n for (var i = 0; i < topics.length; i++) {\n // create new caption\n var newCaption = $(\"<div>\").text(topics[i]).addClass(\"button-caption\");\n // create new black space\n var newBlackSpace = $(\"<div>\").addClass(\"black-space\");\n // create new button\n var newButton = $(\"<button>\").data(\"name\", topics[i]).addClass(\"topic-button\");\n // append caption to button\n newButton.append(newBlackSpace, newCaption);\n // append it to the display\n $(\"#buttonDisplay\").append(newButton);\n };\n }", "createToolbar() {\n const toolbar = document.createElement(\"div\");\n toolbar.className = this.options.className;\n toolbar.style.visibility = \"hidden\";\n\n const buttonsContainer = document.createElement(\"div\");\n buttonsContainer.className = `${this.options.className}__buttons`;\n\n this.options.buttons.map((button) => {\n const buttonElement = document.createElement(\"button\");\n buttonElement.innerHTML = button.innerHTML;\n buttonElement.dataset.action = button.name;\n buttonsContainer.appendChild(buttonElement);\n });\n\n toolbar.appendChild(buttonsContainer);\n document.body.appendChild(toolbar);\n return toolbar;\n }", "get styleBtn() { return Object.assign({}, this.style.button); }", "updateButtons(){\n // Checks if the wish list is empty and then hides and shows the appropriate sections.\n // Adds wish list buttons if applicable\n if (Object.keys(this.wish_list).length === 0){\n $('#empty_wish_list').show();\n $('#wish_list').hide();\n } else {\n $(\"#wish_list\").html(\"\"); // clears all of the buttons from before\n for (let key in this.wish_list){\n if (this.wish_list.hasOwnProperty(key)) {\n let color = \"#BBBBBB\";\n let font_color = \"#333333\";\n if (this.scheduler.schedules_info[key][\"color\"]){\n color = this.scheduler.schedules_info[key][\"color\"];\n font_color = \"#ffffff\";\n }\n this.wish_list[key].createButton(color, font_color);\n }\n }\n\n $('#empty_wish_list').hide();\n $('#wish_list').show();\n\n tippy('.wish_list_item', {theme: 'light'}); // adds tooltips to all of the wish list items\n }\n }", "function initLayout_buttons() {\n\t$$(\"button#site-search-button\", \"button.generic\").each(function(elt) {\n\t\tif (!elt.form.id) {\n\t\t\telt.form.id = Helper.getUniqueId();\n\t\t}\n\n\t\tlinkAsButton = document.createElement('a');\n\t\tlinkAsButton.className = (elt.id == \"site-search-button\") ? \"search-button\" : \"generic-button\";\n\t\tif ($(elt).hasClassName('inactive')) {\n\t\t\t$(linkAsButton).addClassName('inactive-generic-button');\n\t\t\tlinkAsButton.observe('click', function(e){\n\t\t\t\tif($(this).hasClassName('inactive-generic-button')){\n\t\t\t\t\te.stop();\n\t\t\t\t}\n\t\t\t });\n\t\t}\n\t\tlinkAsButton.href = \"javascript:submitForm('\" + elt.form.id + \"');\";\n\n\t\tif (elt.id == \"site-search-button\") {\n\t\t\tlinkAsButton.innerHTML = $(elt).innerHTML;\n\t\t} else {\n\t\t\tlinkAsButton.innerHTML = '<span><span>' + $(elt).innerHTML + '</span></span>';\n\t\t}\n\n\t\t$(elt).parentNode.replaceChild($(linkAsButton), $(elt));\n\n\t});\n}", "get styleSelectBtn() { return Object.assign({}, this.style.comboBox.button); }", "function renderButtons() {\n\t\t$(\"#buttons\").empty();\n\n\t\tfor (var i = 0; i < topics.length; i++) {\n\t\t\tvar newButton = $(\"<button class='btn btn-default fButton'>\");\n\t\t\tnewButton.attr(\"data-name\", topics[i]);\n\t\t\tnewButton.text(topics[i])\n\t\t\t$(\"#buttons\").append(newButton);\n\t\t};\n\t}", "renderSceneEditButtons() {\n const buttonClass = 'mb-2 ml-4 mr-4';\n\n let buttons;\n if (this.activePlaylistItem) {\n buttons = (\n <ButtonToolbar className=\"d-flex flex-row justify-content-around\">\n <div><Button variant=\"primary\" size=\"lg\" className={ buttonClass } onClick={ this.handleEditSceneClick }><EditIcon /></Button></div>\n <div><Button variant=\"primary\" size=\"lg\" className={ buttonClass } onClick={ this.handleResetSceneSettingsClick }>Reset Scene</Button></div>\n <div><Button variant=\"primary\" size=\"lg\" className={ buttonClass } onClick={ this.handleSaveSceneSettingsClick }>Save Scene Settings</Button></div>\n <div><Button variant=\"primary\" size=\"lg\" className={ buttonClass } onClick={ this.handleSaveAsSceneSettingsClick }>Save as new Scene</Button></div>\n </ButtonToolbar>\n );\n } else {\n buttons = null;\n }\n return buttons;\n }", "function renderButtons() {\n $(\"#button-list\").empty();\n for (var i = 0; i < topics.length; i++) {\n var button = $(\"<button>\");\n button.addClass(\"place-button btn btn-outline-secondary btn-block custom-button\");\n button.attr(\"data-name\", topics[i].toUpperCase());\n button.attr(\"type\", \"button\");\n button.text(topics[i].toUpperCase());\n $(\"#button-list\").append(button);\n }\n}", "function editor_updateToolbar(objname,action) {\r\n var config = document.all[objname].config;\r\n var editor_obj = document.all[\"_\" +objname+ \"_editor\"];\r\n\r\n // disable or enable toolbar\r\n\r\n if (action == \"enable\" || action == \"disable\") {\r\n var tbItems = new Array('FontName','FontSize','FontStyle'); // add pulldowns\r\n for (var btnName in config.btnList) { tbItems.push(config.btnList[btnName][0]); } // add buttons\r\n\r\n for (var idxN in tbItems) {\r\n var cmdID = tbItems[idxN].toLowerCase();\r\n var tbObj = document.all[\"_\" +objname+ \"_\" +tbItems[idxN]];\r\n if (cmdID == \"htmlmode\" || cmdID == \"about\" || cmdID == \"showhelp\" || cmdID == \"popupeditor\") { continue; } // don't change these buttons\r\n if (tbObj == null) { continue; }\r\n var isBtn = (tbObj.tagName.toLowerCase() == \"button\") ? true : false;\r\n\r\n if (action == \"enable\") { tbObj.disabled = false; if (isBtn) { tbObj.className = 'btn' }}\r\n if (action == \"disable\") { tbObj.disabled = true; if (isBtn) { tbObj.className = 'btnNA' }}\r\n }\r\n return;\r\n }\r\n\r\n // update toolbar state\r\n\r\n if (editor_obj.tagName.toLowerCase() == 'textarea') { return; } // don't update state in textedit mode\r\n var editdoc = editor_obj.contentWindow.document;\r\n\r\n // Set FontName pulldown\r\n var fontname_obj = document.all[\"_\" +objname+ \"_FontName\"];\r\n if (fontname_obj) {\r\n var fontname = editdoc.queryCommandValue('FontName');\r\n if (fontname == null) { fontname_obj.value = null; }\r\n else {\r\n var found = 0;\r\n for (i=0; i<fontname_obj.length; i++) {\r\n if (fontname.toLowerCase() == fontname_obj[i].text.toLowerCase()) {\r\n fontname_obj.selectedIndex = i;\r\n found = 1;\r\n }\r\n }\r\n if (found != 1) { fontname_obj.value = null; } // for fonts not in list\r\n }\r\n }\r\n\r\n // Set FontSize pulldown\r\n var fontsize_obj = document.all[\"_\" +objname+ \"_FontSize\"];\r\n if (fontsize_obj) {\r\n var fontsize = editdoc.queryCommandValue('FontSize');\r\n if (fontsize == null) { fontsize_obj.value = null; }\r\n else {\r\n var found = 0;\r\n for (i=0; i<fontsize_obj.length; i++) {\r\n if (fontsize == fontsize_obj[i].value) { fontsize_obj.selectedIndex = i; found=1; }\r\n }\r\n if (found != 1) { fontsize_obj.value = null; } // for sizes not in list\r\n }\r\n }\r\n\r\n // Set FontStyle pulldown\r\n var classname_obj = document.all[\"_\" +objname+ \"_FontStyle\"];\r\n if (classname_obj) {\r\n var curRange = editdoc.selection.createRange();\r\n\r\n // check element and element parents for class names\r\n var pElement;\r\n if (curRange.length) { pElement = curRange[0]; } // control tange\r\n else { pElement = curRange.parentElement(); } // text range\r\n while (pElement && !pElement.className) { pElement = pElement.parentElement; } // keep going up\r\n\r\n var thisClass = pElement ? pElement.className.toLowerCase() : \"\";\r\n if (!thisClass && classname_obj.value) { classname_obj.value = null; }\r\n else {\r\n var found = 0;\r\n for (i=0; i<classname_obj.length; i++) {\r\n if (thisClass == classname_obj[i].value.toLowerCase()) {\r\n classname_obj.selectedIndex = i;\r\n found=1;\r\n }\r\n }\r\n if (found != 1) { classname_obj.value = null; } // for classes not in list\r\n }\r\n }\r\n\r\n // update button states\r\n var IDList = Array('Bold','Italic','Underline','StrikeThrough','SubScript','SuperScript','JustifyLeft','JustifyCenter','JustifyRight','InsertOrderedList','InsertUnorderedList');\r\n for (i=0; i<IDList.length; i++) {\r\n var btnObj = document.all[\"_\" +objname+ \"_\" +IDList[i]];\r\n if (btnObj == null) { continue; }\r\n var cmdActive = editdoc.queryCommandState( IDList[i] );\r\n\r\n if (!cmdActive) { // option is OK\r\n if (btnObj.className != 'btn') { btnObj.className = 'btn'; }\r\n if (btnObj.disabled != false) { btnObj.disabled = false; }\r\n } else if (cmdActive) { // option already applied or mixed content\r\n if (btnObj.className != 'btnDown') { btnObj.className = 'btnDown'; }\r\n if (btnObj.disabled != false) { btnObj.disabled = false; }\r\n }\r\n }\r\n}", "function Toolbar(props) {\n return (\n <ThemeButton onClick={props.changeTheme}>\n Change Theme\n </ThemeButton>\n )\n}", "get justifyButtonGroup() {\n return {\n type: \"simple-toolbar-button-group\",\n subtype: \"advanced-insert-button-group\",\n \"aria-label\": \"Text Alignment\",\n required: true,\n buttons: [\n this.justifyLeftButton,\n this.justifyCenterButton,\n this.justifyRightButton,\n this.justifyFullButton,\n ],\n };\n }", "addButtonToToolbar() {\n const lists = ['OrderedList', 'UnorderedList'];\n\n for (const listType of lists) {\n const div = document.createElement('div');\n const indentMenu = document.createElement('button');\n indentMenu.id = `ribs-wysiwyg-toolbar-lists-${listType}`;\n indentMenu.innerHTML = listType;\n indentMenu.addEventListener('click', () => this.createLists(listType));\n div.append(indentMenu);\n this.toolbarDiv.append(div);\n }\n }", "static get baseStyles() {\n return [\n ...super.baseStyles,\n ...RichTextStyles,\n css`\n :host {\n border: var(--rich-text-editor-border-width, 1px) solid\n var(--rich-text-editor-border-color, #ddd);\n background-color: var(--rich-text-editor-bg, #ffffff);\n }\n #morebutton::part(button) {\n border-radius: var(\n --rich-text-editor-button-disabled-border-radius,\n 0px\n );\n }\n `,\n ];\n }", "function Toolbar(props) {\n return (\n <ThemeButton2 onClick={props.changeTheme}>\n Change Theme\n </ThemeButton2>\n )\n}", "componentWillUpdate() {\n hotButtonStyle = notSelectedClass;\n newButtonStyle = notSelectedClass;\n risingButtonStyle = notSelectedClass;\n topButtonStyle = notSelectedClass;\n }", "function jqueryToolBarOnClickEvents() {\r\n\t$('#pencil').on(\"click\", function () {\r\n\t\t$(\"#\" + state).attr('class', '');\r\n\t\tstate = 'pencil';\r\n\t\t$('#pencil').attr('class', 'active');\r\n\t\t$('#pencil').css('background', 'url(../styles/media/drawHover.png) no-repeat center');\r\n\t\t$('#rect').css('background', 'url(../styles/media/rect.png) no-repeat center');\r\n\t\t$('#tria').css('background', 'url(../styles/media/tria.png) no-repeat center');\r\n\t\t$('#circle').css('background', 'url(../styles/media/circle.png) no-repeat center');\r\n\t\t$('#line').css('background', 'url(../styles/media/line.png) no-repeat center');\r\n\t\t$('#text').css('background', 'url(../styles/media/text.png) no-repeat center');\r\n\t\t$('#fill').css('background', 'url(../styles/media/fill.png) no-repeat center');\r\n\t\t$('#fill').attr('class', '');\r\n\t\tfilled = false;\r\n\t\tdocument.body.style.cursor = 'auto';\r\n\t});\r\n\t$('#rect').on(\"click\", function () {\r\n\t\t$(\"#\" + state).attr('class', '');\r\n\t\tstate = 'rect';\r\n\t\t$('#rect').attr('class', 'active');\r\n\t\t$('#rect').css('background', 'url(../styles/media/rectHover.png) no-repeat center');\r\n\t\t$('#pencil').css('background', 'url(../styles/media/draw.png) no-repeat center');\r\n\t\t$('#tria').css('background', 'url(../styles/media/tria.png) no-repeat center');\r\n\t\t$('#circle').css('background', 'url(../styles/media/circle.png) no-repeat center');\r\n\t\t$('#line').css('background', 'url(../styles/media/line.png) no-repeat center');\r\n\t\t$('#text').css('background', 'url(../styles/media/text.png) no-repeat center');\r\n\t\t$('#fill').css('background', 'url(../styles/media/fill.png) no-repeat center');\r\n\t\t$('#fill').attr('class', '');\r\n\t\tfilled = false;\r\n\t\tdocument.body.style.cursor = 'se-resize';\r\n\t});\r\n\t$('#tria').on(\"click\", function () {\r\n\t\t$('#tria').attr('class', 'active');\r\n\t\t$(\"#\" + state).attr('class', '');\r\n\t\tstate = 'tria';\r\n\t\t$('#tria').attr('class', 'active');\r\n\t\t$('#tria').css('background', 'url(../styles/media/triaHover.png) no-repeat center');\r\n\t\t$('#pencil').css('background', 'url(../styles/media/draw.png) no-repeat center');\r\n\t\t$('#circle').css('background', 'url(../styles/media/circle.png) no-repeat center');\r\n\t\t$('#line').css('background', 'url(../styles/media/line.png) no-repeat center');\r\n\t\t$('#rect').css('background', 'url(../styles/media/rect.png) no-repeat center');\r\n\t\t$('#text').css('background', 'url(../styles/media/text.png) no-repeat center');\r\n\t\t$('#fill').css('background', 'url(../styles/media/fill.png) no-repeat center');\r\n\t\t$('#fill').attr('class', '');\r\n\t\tfilled = false;\r\n\t\tdocument.body.style.cursor = 'se-resize';\r\n\t});\r\n\t$('#circle').on(\"click\", function () {\r\n\t\t$('#circle').attr('class', 'active');\r\n\t\t$(\"#\" + state).attr('class', '');\r\n\t\tstate = 'circle';\r\n\t\t$('#circle').attr('class', 'active');\r\n\t\t$('#circle').css('background', 'url(../styles/media/circleHover.png) no-repeat center');\r\n\t\t$('#pencil').css('background', 'url(../styles/media/draw.png) no-repeat center');\r\n\t\t$('#tria').css('background', 'url(../styles/media/tria.png) no-repeat center');\r\n\t\t$('#line').css('background', 'url(../styles/media/line.png) no-repeat center');\r\n\t\t$('#rect').css('background', 'url(../styles/media/rect.png) no-repeat center');\r\n\t\t$('#text').css('background', 'url(../styles/media/text.png) no-repeat center');\r\n\t\t$('#fill').css('background', 'url(../styles/media/fill.png) no-repeat center');\r\n\t\t$('#fill').attr('class', '');\r\n\t\tfilled = false;\r\n\t\tdocument.body.style.cursor = 'se-resize';\r\n\t});\r\n\t$('#text').on(\"click\", function () {\r\n\t\t$('#text').attr('class', 'active');\r\n\t\t$(\"#\" + state).attr('class', '');\r\n\t\tstate = 'text';\r\n\t\t$('#text').attr('class', 'active');\r\n\t\tmyText = prompt(\"Text eingeben: \", \"\");\r\n\t\t$('#text').css('background', 'url(../styles/media/textHover.png) no-repeat center');\r\n\t\t$('#pencil').css('background', 'url(../styles/media/draw.png) no-repeat center');\r\n\t\t$('#circle').css('background', 'url(../styles/media/circle.png) no-repeat center');\r\n\t\t$('#tria').css('background', 'url(../styles/media/tria.png) no-repeat center');\r\n\t\t$('#rect').css('background', 'url(../styles/media/rect.png) no-repeat center');\r\n\t\t$('#line').css('background', 'url(../styles/media/line.png) no-repeat center');\r\n\t\t$('#fill').css('background', 'url(../styles/media/fill.png) no-repeat center');\r\n\t\t$('#fill').attr('class', '');\r\n\t\tfilled = false;\r\n\t\tdocument.body.style.cursor = 'text';\r\n\t});\r\n\t$('#fontSize').on(\"click\", function () {\r\n\t\t$('#text').attr('class', 'active');\r\n\t\t$(\"#\" + state).attr('class', '');\r\n\t\tstate = 'text';\r\n\t\t$('#text').attr('class', 'active');\r\n\t});\r\n\t$('#fontFamily').on(\"click\", function () {\r\n\t\t$('#text').attr('class', 'active');\r\n\t\t$(\"#\" + state).attr('class', '');\r\n\t\tstate = 'text';\r\n\t\t$('#text').attr('class', 'active');\r\n\t});\r\n\t$('#line').on(\"click\", function () {\r\n\t\t$('#line').attr('class', 'active');\r\n\t\t$(\"#\" + state).attr('class', '');\r\n\t\tstate = 'line';\r\n\t\t$('#line').attr('class', 'active');\r\n\t\t$('#line').css('background', 'url(../styles/media/lineHover.png) no-repeat center');\r\n\t\t$('#pencil').css('background', 'url(../styles/media/draw.png) no-repeat center');\r\n\t\t$('#circle').css('background', 'url(../styles/media/circle.png) no-repeat center');\r\n\t\t$('#tria').css('background', 'url(../styles/media/tria.png) no-repeat center');\r\n\t\t$('#rect').css('background', 'url(../styles/media/rect.png) no-repeat center');\r\n\t\t$('#text').css('background', 'url(../styles/media/text.png) no-repeat center');\r\n\t\t$('#fill').css('background', 'url(../styles/media/fill.png) no-repeat center');\r\n\t\t$('#fill').attr('class', '');\r\n\t\tfilled = false;\r\n\t\tdocument.body.style.cursor = 'w-resize';\r\n\t});\r\n\t$('#fill').on(\"click\", function () {\r\n\t\tif (filled == true) {\r\n\t\t\t$('#fill').css('background', 'url(../styles/media/fill.png) no-repeat center');\r\n\t\t\t$('#fill').attr('class', '');\r\n\t\t\tfilled = false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$('#fill').css('background', 'url(../styles/media/fillHover.png) no-repeat center');\r\n\t\t\t$('#fill').attr('class', 'active');\r\n\t\t\tfilled = true;\r\n\t\t}\r\n\t\tdocument.body.style.cursor = 'se-resize';\r\n\t});\r\n\t$('#colorrange').on(\"click\", function () {\r\n\t\t$('#colorrange').attr('class', 'active');\r\n\t\t$(\"#\" + state).attr('class', '');\r\n\t\tstate = 'colorrange';\r\n\t\t$('#colorrange').attr('class', 'active');\r\n\t});\r\n}", "function commandButtons()\n{\n\t// find the index of the current recordset in MM.rsTypes\n\t//rsIndex = recordsetDialog.searchByType(RECORDSET_TYPE);\n\t\n\tbtnArray = new Array(\n\t\tMM.BTN_OK, \"clickedOK()\", \n MM.BTN_Cancel, \"clickedCancel()\", \n MM.BTN_Test, \"PopUpTestDialog()\");\n\t// add a button for each different rs type\n\tfor (i = 0;i < MM.rsTypes.length;i++) {\n\t\tif(MM.rsTypes[i].single == \"true\") {\n\t\t\tcontinue;\n\t\t}\n \tif (dw.getDocumentDOM().serverModel.getServerName() == MM.rsTypes[i].serverModel) {\n \t\tif (RECORDSET_TYPE.toLowerCase() != MM.rsTypes[i].type.toLowerCase()) {\n\t\t\t\tvar btnLabel = dw.loadString(\"recordsetType/\" + MM.rsTypes[i].type);\n\t\t\t\tif (!btnLabel)\n\t\t\t\t\tbtnLabel = MM.rsTypes[i].type;\n\t\t\t\tbtnArray.push(btnLabel+\"...\");\n\t\t\t\tbtnArray.push(\"clickedChange(\" + i + \")\");\n\t\t\t}\n\t\t}\n\t}\n\tbtnArray.push(MM.BTN_Help);\n\tbtnArray.push(\"displayHelp()\"); \n\treturn btnArray;\n}", "function setButtonStates() {\n var $scanButton = $(instancePage.onDemandScanBtn);\n var $butrButton = $(instancePage.onDemandButrBtn);\n var $saveButton = $('.save-btn');\n var tooltip = \"Save changes to enable\";\n\n $scanButton.removeClass('inactive').prop('disabled', false).removeAttr('title');\n $butrButton.removeClass('inactive').prop('disabled', false).removeAttr('title');\n $saveButton.addClass('inactive').prop('disabled', true);\n\n if (isOAuthPolling ||\n $(instancePage.hiddenIsRenameLocked).val() === \"true\" ||\n $(instancePage.oauthContainer).hasClass('prompting')) {\n $scanButton.addClass('inactive').prop('disabled', true);\n }\n\n if (isOAuthPolling ||\n $(instancePage.oauthContainer).hasClass('prompting')) {\n $butrButton.addClass('inactive').prop('disabled', true);\n }\n\n if (AlmCommon.getHasUnsavedChanges()) {\n $saveButton.removeClass('inactive').prop('disabled', false);\n\n if (getHasActiveJob(scanConfigProperties.container) != scanConfigProperties.previousToolState ||\n scanConfigProperties.hasUnsavedChanges) {\n $scanButton.addClass('inactive').prop('disabled', true).attr('title', tooltip);\n }\n\n if (getHasActiveJob(butrConfigProperties.container) != butrConfigProperties.previousToolState ||\n butrConfigProperties.hasUnsavedChanges) {\n $butrButton.addClass('inactive').prop('disabled', true).attr('title', tooltip);\n }\n }\n }", "function Toolbar() {\n return (\n <div>\n <ThemedButton />\n </div>\n );\n }", "function Toolbar({ changeTheme }) {\n return <ThemedButton onClick={changeTheme}>Change Theme</ThemedButton>;\n}", "function btncss (type) {\n\tswitch (type) {\n\t\tcase qojl_data:\n\t\t\treturn 'qojl';\n\t\t\tbreak;\n\t\tcase qutip_data:\n\t\t\treturn 'qutip';\n\t\t\tbreak;\n\t\tcase qutipcython_data:\n\t\t\treturn 'qutipc';\n\t\t\tbreak;\n\t\tcase toolbox_data:\n\t\t\treturn 'qotb';\n\t\t\tbreak;\n\t}\n}", "createButtons() {\n this.settingsButton = this._createConnectionButton(TEXTURE_NAME_SETTINGS);\n this.deleteButton = this._createConnectionButton(TEXTURE_NAME_DELETE);\n }", "function renderButtons() {\n\n $(\"#buttons-view\").empty();\n\n for (i = 0; i < topics.length; i++) {\n\n var a = $(\"<button>\");\n\n a.addClass(\"topicgif\");\n\n a.attr(\"data-name\", topics[i]);\n\n a.text(topics[i]);\n\n $(\"#buttons-view\").append(a);\n }\n }", "function toolbar(obj) {\r\n document.write(\"<div class=\\\"toolbar\\\">\");\r\n /* strong */\r\n document.write(\"<button class=\\\"btn_bold\\\" type=\\\"button\\\" name=\\\"btnBold\\\" title=\\\"Bold\\\" onClick=\\\"tagify('[b]','[/b]','\" + obj + \"')\\\">Bold</button>\");\r\n /* emphasized */\r\n document.write(\"<button class=\\\"btn_italic\\\" type=\\\"button\\\" name=\\\"btnItalic\\\" title=\\\"Italic\\\" onClick=\\\"tagify('[i]','[/i]','\" + obj + \"')\\\">Italic</button>\");\r\n /* quotation */\r\n document.write(\"<button class=\\\"btn_quote\\\" type=\\\"button\\\" name=\\\"btnQuote\\\" title=\\\"Quote\\\" onClick=\\\"tagify('[quote]','[/quote]','\" + obj + \"')\\\">Quote</button>\");\r\n /* URL */\r\n document.write(\"<button class=\\\"btn_link\\\" type=\\\"button\\\" name=\\\"btnLink\\\" title=\\\"Insert URL Link\\\" onClick=\\\"urlify('\" + obj + \"')\\\">URL</button>\");\r\n /* image */\r\n document.write(\"<button class=\\\"btn_img\\\" type=\\\"button\\\" name=\\\"btnPicture\\\" title=\\\"Insert Image\\\" onClick=\\\"imagify('\" + obj + \"')\\\">Image</button>\");\r\n /* ordered list */\r\n document.write(\"<button class=\\\"btn_ol\\\" type=\\\"button\\\" name=\\\"btnList\\\" title=\\\"Ordered List\\\" onClick=\\\"listify('[ol]','[/ol]','\" + obj + \"')\\\">OL</button>\");\r\n /* unordered list */\r\n document.write(\"<button class=\\\"btn_ul\\\" type=\\\"button\\\" name=\\\"btnList\\\" title=\\\"Unordered List\\\" onClick=\\\"listify('[ul]','[/ul]','\" + obj + \"')\\\">UL</button>\");\r\n /* table */\r\n document.write(\"<button class=\\\"btn_table\\\" type=\\\"button\\\" name=\\\"btnTable\\\" title=\\\"Inserts a table\\\" onClick=\\\"tagify('[table][br][tr][td]','[/td][/tr][/table]','\" + obj + \"')\\\">Table</button>\");\r\n /* code */\r\n document.write(\"<button class=\\\"btn_code\\\" type=\\\"button\\\" name=\\\"btnCode\\\" title=\\\"Code\\\" onClick=\\\"tagify('[code]','[/code]','\" + obj + \"')\\\"><tt>Code</tt></button>\");\r\n document.write(\"</div>\");\r\n}", "function renderButtons() {\n // Deletes the movies prior to adding new movies\n $('.buttons-view').empty();\n // Loops through the array of topics to create buttons for all topics\n for (var i = 0; i < topics.length; i++) {\n var createButtons = $('<button>');\n createButtons.addClass('topic btn btn-success');\n createButtons.attr('data-name', topics[i]);\n createButtons.text(topics[i]);\n $('.buttons-view').append(createButtons);\n }\n }", "static get tag(){return\"rich-text-editor-toolbar-full\"}", "function renderButtons() {\n // start by emptying the button-area div every time so that there are no duplicates\n $(\"#button-area\").empty();\n for (var i=0; i < topics.length; i++) {\n // create button element for each array item\n var button = $(\"<button>\");\n // Add classes\n button.addClass(\"btn btn-info tv-show\");\n // Add data attribute\n button.attr(\"data-name\", topics[i]);\n // Add text\n button.text(topics[i]);\n // Append to #button-area\n $(\"#button-area\").append(button);\n } \n }", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n console.log(buttonId);\n\n\t //$(this).closest(\"form\").submit();\n \n });\n}", "function setupButtons() {\n\t\n\td3.select(\"#bubbles-toolbar\")\n\t.selectAll(\"a\")\n\t.on(\"click\", function() {\n\n\t\td3.selectAll(\".dropdown-item\")\n\t\t.classed(\"active\", false);\n\n\t\tvar button = d3.select(this);\n\n\t\tbutton.classed(\"active\", true);\n\n\t\tvar buttonId = button.attr(\"id\");\n\n\t\tmyBubbleChart.toggleDisplay(buttonId);\n\n\t});\n}", "function changeButtonTheme(theme) {\n\t$('body').css(\"background-color\", theme.bg);\n $('#buttons div').css(\"color\", theme.fontColor);\n $('#buttons div').css(\"background-color\", theme.bgColor);\n\t$('.modal').css(\"background-color\", theme.bgColor);\n\t$('.modal').css(\"color\", theme.fontColor);\n}", "function renderTopicButtons() {\n // Deleting the xmas buttons prior to adding new xmas buttons\n $(\"#buttons\").empty();\n // Looping through the array of xmas buttons\n for (var i = 0; i < topics.length; i++) {\n var topic = topics[i];\n createButton(topic);\n }\n}", "static get tag(){return\"rich-text-editor-button\"}", "function renderPostControls(){\n // Gets all the posts of the current page:\n var posts = document.getElementsByClassName(DOM_POST_PREVIEW_CONTAINER_CLASS);\n var toolbars = []; // All posts toolbars handler\n\n for(var i = 0; i < posts.length; i++){ // For every post in the current page\n // If the post has no toolbar, add it\n if( !posts[i].classList.contains(DOM_POST_TOOLBAR_CONTAINER) ){\n // Gets post's shortcode:\n shortcode = posts[i].childNodes[0].href.match(REGEX_POST_URL)[1];\n\n // Creates the toolbar and adds it to toolbars handler:\n toolbars.push( document.createElement('div') );\n // Saves corresponding shortcode into toolbar's dataset:\n toolbars[ toolbars.length - 1 ].setAttribute('data-shortcode', shortcode);\n toolbars[ toolbars.length - 1 ].className = DOM_POST_TOOLBAR_ClASS;\n\n // Creates toolbar's buttons:\n toolbars[ toolbars.length - 1 ].appendChild( document.createElement('div') );\n\t\t\ttoolbars[ toolbars.length - 1 ].appendChild( document.createElement('div') );\n\n // Adds fullscreen button functionality:\n toolbars[ toolbars.length - 1 ].childNodes[0].onclick = function(){\n fullscreenAction(this);\n };\n\n // Adds download button functionality:\n toolbars[ toolbars.length - 1 ].childNodes[1].onclick = function(){\n downloadAction(this);\n };\n\n // Fullscreen button icon:\n toolbars[ toolbars.length - 1 ].childNodes[0].appendChild(\n\t\t\t\tdocument.createElement('img')\n\t\t\t);\n // Download button icon:\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[1].appendChild(\n\t\t\t\tdocument.createElement('img')\n\t\t\t);\n\n // Toolbar's buttons setup:\n toolbars[ toolbars.length - 1 ].childNodes[0].childNodes[0].className = DOM_POST_FULLSCREEN_BUTTON_CLASS;\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[1].childNodes[0].className = DOM_POST_DOWNLOAD_BUTTON_CLASS;\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[0].childNodes[0].title = chrome.i18n.getMessage(\"postToolbarFullscreen\");\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[1].childNodes[0].title = chrome.i18n.getMessage('postToolbarDownload');\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[0].childNodes[0].src = IG_URL + IG_SPRITESA_PATH;\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[1].childNodes[0].src = IG_URL + IG_SPRITESA_PATH;\n\n // Injects toolbar to the post:\n\t\t\tposts[i].insertBefore(toolbars[ toolbars.length - 1 ], posts[i].childNodes[0]);\n\t\t\tposts[i].classList.add(DOM_POST_TOOLBAR_CONTAINER);\n }\n }\n}", "function renderButtons() {\n\n // Deleting the buttons prior to adding new topics\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#topics-container\").empty();\n\n // Looping through the array of topics\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamically generating buttons for each topic in the array\n // This code $(\"<button>\") is all jQuery needs to create the beginning and end tag. (<button></button>)\n var a = $(\"<button>\");\n // Adding a class of topic to our button\n a.addClass(\"topic\");\n a.addClass(\"btn btn-success\");\n // Adding a data-attribute\n a.attr(\"data-search-item\", topics[i]);\n // Providing the initial button text\n a.text(topics[i]);\n // Adding the button to the buttons-view div\n $(\"#topics-container\").append(a);\n }\n }", "function createToolbar(wysiwyg) {\n var toolbar = document.createElement(\"div\");\n var bar = 0;\n toolbar.className = \"toolbar toolbar\" + bar;\n for (var foo = 0; foo < wysiwyg_toolbarButtons.length; foo++) {\n if (wysiwyg_toolbarButtons[foo][0] == \"toggleview\") {\n var button = createButton(wysiwyg, foo);\n button.onclick = toggleView;\n button.htmlTitle = wysiwyg_toolbarButtons[foo][1];\n button.composeTitle = wysiwyg_toolbarButtons[foo][2];\n toolbar.appendChild(button);\n } else if (wysiwyg_toolbarButtons[foo].length >= 3) {\n var button = createButton(wysiwyg, foo);\n button.onclick = execCommand;\n toolbar.appendChild(button);\n } else if (wysiwyg_toolbarButtons[foo][0] == \"div\") {\n var divider = document.createElement(\"div\");\n divider.className = \"divider\";\n toolbar.appendChild(divider);\n } else {\n bar++;\n wysiwyg.insertBefore(toolbar, wysiwyg.control);\n var toolbar = document.createElement(\"div\");\n toolbar.className = \"toolbar toolbar\" + bar;\n }\n }\n wysiwyg.insertBefore(toolbar, wysiwyg.control);\n }", "function renderButtons() {\n\n // Deletes the topics prior to adding a new topic\n // (this is necessary otherwise you will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n _.each(topics, function (element) {\n // Then dynamicaly generates buttons for each topic in the array\n // console.log(topics);\n var btn = $(\"<button>\");\n btn.addClass(\"btn btn-primary btn-md topic-btn\");\n btn.attr(\"data-name\", element);\n btn.text(element);\n $(\"#buttons-view\").append(btn);\n });\n }", "createAllStyle(id) {\n\t\t// Set style of the tab\n\t\tStyle.createStyle(\n\t\t'.bgroup' + id + ` {\n\t\t\toverflow: hidden;\n\t\t\twidth: 150px;\n\t\t\theight: 100px;\n\t\t\tbackground: #f1f1f1;\n\t\t\tborder: 1px solid #ccc;\n\t\t\tpadding: 4px 4px;\n\t\t\tfloat: left;\n\t\t}\n\t\t`);\n\n\t\t// Set style of the buttons inside the tab\n\t\tStyle.createStyle(\n\t\t'.button' + id + ` {\n\t\t\tbackground: #ddd;\n\t\t\tfloat: left;\n\t\t\twidth: 60px;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t`);\n\t}", "function _swdoc_lcf_setup_toolbar_buttons(oJsonFormOptions)\r\n{\r\n\tvar bAllowLog =(oJsonFormOptions.allowLog!=\"true\")?false:true;\r\n\tvar bAllowLogAssign =(oJsonFormOptions.allowLogAssign!=\"true\")?false:true;\r\n\tvar bAllowLogAccept =(oJsonFormOptions.allowLogAccept!=\"true\")?false:true;\r\n\tvar bAllowLogClose =(oJsonFormOptions.allowLogClose!=\"true\")?false:true;\r\n\tvar bAllowLogAcceptTake =(oJsonFormOptions.allowLogAcceptTake!=\"true\")?false:true;\r\n\tvar bAllowAttachments =(oJsonFormOptions.showFileAttachments!=\"true\")?false:true;\r\n\r\n\tapp.toolbar_item_dore(\"lcf\", \"calllog\" , bAllowLog, document);\r\n\tapp.toolbar_item_dore(\"lcf\", \"callassign\" , bAllowLogAssign, document);\r\n\tapp.toolbar_item_dore(\"lcf\", \"callaccept\" ,bAllowLogAcceptTake , document);\r\n\tapp.toolbar_item_dore(\"lcf\", \"calltake\" , bAllowLogAccept, document);\r\n\tapp.toolbar_item_dore(\"lcf\", \"callresolve\" , bAllowLogClose, document);\r\n\r\n\t//-- file attach\r\n\tapp.toolbar_item_sorh(\"lcf\", \"attach\" , bAllowAttachments, document);\r\n\tapp.toolbar_item_sorh(\"lcf\", \"unattach\" , bAllowAttachments, document);\r\n\t\r\n}", "function setBtns () {\n //wipe the div clean\n $(\"#buttonRow\").html(\"\");\n //then repopulate buttons\n for (i=0; i<topicArray.length; i++) {\n //console.log(topicArray[i]);\n var topicBtn = $('<button/>').attr(\"id\", topicArray[i]).attr(\"class\", \"select btnStyle\").text(topicArray[i]);\n $(\"#buttonRow\").append(topicBtn);\n };\n }", "function initWidgetUI() {\n $(\".widget-wrapper\").each(function () {\n var widgetId = extractObjectIdFromElementId($(this).attr(\"id\"));\n styleWidgetButtons(widgetId);\n });\n }", "function refreshButtons(editor) {\n\n // Webkit requires focus before queryCommandEnabled will return anything but false\n if (!iOS && webkit && !editor.focused) {\n editor.$frame[0].contentWindow.focus();\n window.focus();\n editor.focused = true;\n }\n\n // Get the object used for checking queryCommandEnabled\n var queryObj = editor.doc;\n\n // Loop through each button\n var inSourceMode = sourceMode(editor);\n $.each(editor.$toolbar.find(\".\" + BUTTON_CLASS), function (idx, elem) {\n\n var $elem = $(elem),\n button = $.cleditor.buttons[$.data(elem, BUTTON_NAME)],\n command = button.command,\n enabled = true;\n\t\t\t\n // Determine the state\n if (editor.disabled)\n enabled = false;\n else if (button.getEnabled) {\n var data = {\n editor: editor,\n button: elem,\n buttonName: button.name,\n popup: popups[button.popupName],\n popupName: button.popupName,\n command: button.command,\n useCSS: editor.options.useCSS\n };\n enabled = button.getEnabled(data);\n if (enabled === undefined)\n enabled = true;\n }\n else if ((inSourceMode || iOS) && button.name !== \"source\") \n enabled = false;\n\t\t\telse if ( (focusedObj==\"\" || focusedObj==undefined) \n\t\t\t\t&& ( command == \"insertrowcol\" || command == \"resizecell\" \n\t\t\t\t\t|| command == \"borderstyle\" || command == \"background\"\n\t\t\t\t\t|| command == \"perspect\" || command == \"rotation\" )) enabled = false;\n else if (command && command !== \"print\" \n\t\t\t\t\t\t&& command !==\"textbox\" && command !==\"table\" \n\t\t\t\t\t\t&& command !==\"insertrowcol\" && command !== \"resizecell\" \n\t\t\t\t\t\t&& command !==\"borderstyle\" && command !== \"background\" \n\t\t\t\t\t\t&& command !==\"bodystyle\" && command !== \"perspect\"\n\t\t\t\t\t\t&& command !==\"rotation\" ) { //change\n\t\t\t\tif ((!iege11) || command !== \"inserthtml\") {\n try { enabled = queryObj.queryCommandEnabled(command); }\n catch (err) { enabled = false; }\n }\n }\n\t\t\t\n // Enable or disable the button\n if (enabled) {\n $elem.removeClass(DISABLED_CLASS);\n $elem.removeAttr(DISABLED);\n }\n else {\n $elem.addClass(DISABLED_CLASS);\n $elem.attr(DISABLED, DISABLED);\n }\n\n });\n }", "function FIELD$static_(){ToolbarSkin.FIELD=( new ToolbarSkin(\"field\", \"Transparent Background with centered scrollers.\"));}", "function LIGHT$static_(){ToolbarSkin.LIGHT=( new ToolbarSkin(\"light\"));}" ]
[ "0.6848476", "0.67644095", "0.65586317", "0.6547209", "0.6473002", "0.6473002", "0.6393089", "0.6262251", "0.6152703", "0.60909927", "0.6077904", "0.607606", "0.6042236", "0.6038369", "0.60128576", "0.5982865", "0.5976774", "0.5976658", "0.5974836", "0.5974748", "0.5965876", "0.5963055", "0.5950862", "0.59347934", "0.59127456", "0.59041476", "0.59041476", "0.59041476", "0.5901377", "0.5893085", "0.58681726", "0.5861067", "0.5849815", "0.58496994", "0.5837294", "0.5830777", "0.5823989", "0.5821783", "0.5820372", "0.5818579", "0.58120936", "0.57975364", "0.57747304", "0.5769432", "0.57665503", "0.5758809", "0.57564044", "0.57377106", "0.5713032", "0.5707389", "0.5706183", "0.5700378", "0.56989366", "0.56933117", "0.5689036", "0.56880903", "0.56830096", "0.56826955", "0.5680254", "0.5680109", "0.5670749", "0.56639004", "0.5661894", "0.5658992", "0.56586945", "0.56453186", "0.56381387", "0.56156886", "0.5613954", "0.56046957", "0.55992514", "0.5595423", "0.5595306", "0.55941916", "0.55907553", "0.55867845", "0.5586643", "0.5582332", "0.5581778", "0.5580961", "0.55805415", "0.5579825", "0.5576747", "0.55721927", "0.5556685", "0.55525374", "0.5551325", "0.5550882", "0.55469394", "0.554531", "0.55440396", "0.55401546", "0.55376184", "0.5529401", "0.552668", "0.5526008", "0.55202264", "0.55122197", "0.55108213", "0.5507676" ]
0.6461761
6
Toggles the display of the widget collapse/restore icon.
function toggleCollapseWidgetIcon(widgetId, collapsed) { var $toggleIcon = $("#widget-" + widgetId + "-collapse"); if (collapsed) { $toggleIcon.html(WIDGET_TOGGLE_DISPLAY_COLLAPSED_HTML); } else { $toggleIcon.html(WIDGET_TOGGLE_DISPLAY_NORMAL_HTML); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideShowExpandToggle() {\n if (minWidth) {\n setExpandedWidth(\"60%\");\n } else {\n setExpandedWidth(\"80%\");\n }\n\n if (isExpanded) {\n setExpanded(false);\n } else {\n setExpanded(true);\n }\n }", "toggle() {\n this.collapsed = !this.collapsed\n }", "toggle() {\n this.collapsed = !this.collapsed\n }", "toggle() {\n this.expanded = !this.expanded;\n }", "toggle() {\n\t\tif (this.isVisible) {\n\t\t\tthis.display();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}", "collapse () {\n this.root.toggle(true, false);\n }", "toggle() {\n this.setState({ collapse: !this.state.collapse });\n }", "_toggle() {\n if (this._isVisible) {\n this._hide();\n } else {\n this._show();\n }\n }", "toggle() {\n\t\tthis.setState(state => ({ collapse: !state.collapse }));\n\t}", "function toggle() {\n setOpened(!opened);\n expandedCallback(!opened);\n }", "_toggleIconAriaHidden() {\n this._renderedLabel = this._renderedLabel || this.label || this.content;\n\n // toggle aria-hidden if tab is labelled\n if (this._elements.icon) {\n const isLabelled = (this._renderedLabel && this._renderedLabel.textContent.trim().length) ||\n this.getAttribute('aria-label') !== null ||\n this.getAttribute('aria-labelledby') !== null;\n\n this._elements.icon[isLabelled ? 'setAttribute' : 'removeAttribute']('aria-hidden', 'true');\n }\n }", "toggle() {\n if (this.isActive) {\n this.hide();\n } else {\n this.show();\n }\n }", "toggle(){\n if(zoteroRoam.interface.icon.getAttribute('status') == \"off\"){\n zoteroRoam.extension.load();\n } else {\n zoteroRoam.extension.unload();\n }\n }", "function collapsePanel() {\n phone.mode = DisplayMode.Minimized;\n $(\".expanded\").hide();\n}", "toggleVisibility() {\n if (this.isOpen()) {\n this.hide();\n } else {\n this.show();\n }\n }", "_toggleCollapsedState() {\n const that = this;\n\n if (!that.collapsible) {\n return;\n }\n\n if (!that.collapsed) {\n that.collapse();\n }\n else {\n that.expand();\n }\n }", "toggle() {\n if (!this.disabled) {\n this.expanded = !this.expanded;\n }\n }", "toggleIcon_() {\n this.toggleIconEls_.forEach((el) => {\n if (el.classList.contains(cssClass.HIDE)) {\n el.classList.remove(cssClass.HIDE);\n } else {\n el.classList.add(cssClass.HIDE);\n }\n });\n }", "function setToggleButton() {\n var collapse = $toggleButton.attr(\"data-collapse\");\n var expand = $toggleButton.attr(\"data-expand\");\n if ($panels.next().hasClass('in')) {\n $panels.next().collapse('hide');\n $toggleButton.text(expand);\n $toggleButton.removeClass('closed');\n } else {\n $panels.next().collapse('show');\n $toggleButton.text(collapse);\n $toggleButton.addClass('closed');\n }\n}", "toggleVisibility() {\n this.setVisible(!this.visible);\n }", "toggleRegionsDrawingMode() {\n if ($('.regions-drawing-mode').is(':visible')) {\n $('.regions-drawing-mode').hide();\n $('.regions-drawing-mode-toggler').removeClass('collapse-up');\n $('.regions-drawing-mode-toggler').addClass('expand-down');\n } else {\n $('.regions-drawing-mode').show();\n $('.regions-drawing-mode-toggler').removeClass('expand-down');\n $('.regions-drawing-mode-toggler').addClass('collapse-up');\n }\n }", "function dropIconToggle() {\n if(dropBool) {\n\tdropBool = false;\n\tdocument.getElementById(\"dropDiv\").innerHTML=\n\t 'Advanced Search <i class=\"icon-chevron-down\" data-toggle=\"collapse\"'\n\t\t+ ' data-target=\"#advSearch\"></i>';\n } else {\n\tdropBool = true;\n\tdocument.getElementById(\"dropDiv\").innerHTML=\n\t 'Advanced Search <i class=\"icon-chevron-up\" data-toggle=\"collapse\"'\n\t\t+ ' data-target=\"#advSearch\"></i>';\n }\n}", "toggleHidden() {\n if (this.isHidden) this.show();\n else this.hide();\n }", "toggle() {\n const self = this;\n if (!hasClass(self.element, showClass)) self.show();\n else self.hide();\n }", "function toggleIcon() {\n $(this).toggleClass('open-accordion');\n $(this).find(\".toggle-accordion\").html($(this).text() == 'Ver más' ? 'Ver menos' : 'Ver m&aacute;s');\n }", "set suiCollapse(value) {\n if (value) {\n this.hide();\n }\n else {\n this.show();\n }\n }", "function toggleMode() {\n\tif (overviewMode === \"graph\") {\n\t\tmatrixContainer.style.display = \"flex\";\n\t\tgraphContainer.style.display = \"none\";\n\t\toverviewMode = \"matrix\";\n\t\ticonMode.src = \"img/hash.svg\";\n\t} else if (overviewMode === \"matrix\") {\n\t\tmatrixContainer.style.display = \"none\";\n\t\tgraphContainer.style.display = \"flex\";\n\t\toverviewMode = \"graph\";\n\t\ticonMode.src = \"img/git-branch.svg\";\n\t}\n}", "toggle() {\n this._setState({\n expanded: !this.state.expanded,\n });\n }", "function collapsePanel() {\n phone.mode = DisplayMode.Minimized;\n document.documentElement.style.setProperty(\"--widgetAreaWidth\", \"0px\");\n $(\".expanded\").hide();\n \n}", "function toggleScreen() {\n var x = document.getElementById(\"changeIcon\");\n if (x.className === \"fas fa-expand-arrows-alt\") {\n x.className = \"fas fa-compress-arrows-alt\";\n openFullscreen();\n } else {\n x.className = \"fas fa-expand-arrows-alt\";\n closeFullscreen();\n }\n }", "toggle() {\n return this[this.isExpanded ? 'collapse' : 'expand']();\n }", "function setup_div_toggle() {\n $('.collapse_icon').mouseover(function() {\n this.src = '/images/minimize_black.png';\n });\n $('.collapse_icon').mouseout(function() {\n this.src = '/images/minimize_grey.png';\n });\n $('.collapse_icon').click(function() {\n $(this).parent().next().slideToggle();\n });\n}", "toggler() {\n const visibility = this.state.visibility;\n const expanded = this.state.expanded;\n if (visibility === \"hidden\" && !expanded) {\n this.setState({\n visibility: \"visible\",\n expanded: true\n })\n } else {\n this.setState({\n visibility: \"hidden\",\n expanded: false\n })\n }\n\n }", "toggleCardCollapsed() {\n this.card_collapsed = !this.card_collapsed;\n }", "_handleCollapsePanel() {\n const examplePanel = this.shadowRoot.querySelector('.renderer')\n const icon = this.shadowRoot.querySelector('.expand-icon')\n icon.classList.toggle('expand-icon-collapse')\n examplePanel.classList.toggle('collapse')\n\n this._collapseExamplePanel = !this._collapseExamplePanel\n }", "toggleVisibility() {\n return this.stateIsOpen ? this.close() : this.open();\n }", "function toggleIconToMinus() { \ndocument.getElementById(\"plus\").style.display=\"none\"; document.getElementById(\"minus\").style.display=\"block\"; \n}", "function toggleVisibility() {\n setVisibility(isVisible => !isVisible);\n }", "function toggleVisibility() {\n setVisibility(isVisible => !isVisible);\n }", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "function toggleHidden() {\n setIsHidden(!isHidden);\n }", "toggle() {\r\n\t\tif(this._isOpen) {\r\n\t\t\tthis.hide();\r\n\t\t} else {\r\n\t\t\tthis.show();\r\n\t\t}\r\n\t}", "toggle() {\n if (this.isActive) {\n this.close();\n } else {\n this.open();\n }\n }", "close() {\n this.expanded = false;\n }", "updateExpandIcon() {}", "function _toggleIcon(jQElement) {\n // Change the icon.\n if (jQElement.children('ul').is(':visible')) {\n // The user wants to collapse the child list.\n jQElement.children('span').children('i')\n .removeClass('icon-chevron-down')\n .addClass('icon-chevron-up');\n } else {\n // The user wants to expand the child list.\n jQElement.children('span').children('i')\n .removeClass('icon-chevron-up')\n .addClass('icon-chevron-down');\n }\n }", "collapse() {\n const that = this;\n\n if (!that.collapsible || that.collapsed) {\n return;\n }\n\n that.collapsed = true;\n }", "toggle()\n {\n if (this.showing)\n {\n this.close();\n }\n else\n {\n this.open();\n }\n }", "justToggleExpand() {\n this.setState({\n expand: !this.state.expand\n });\n }", "justToggleExpand() {\n this.setState({\n expand: !this.state.expand\n });\n }", "toggle() {\n this.panelOpen ? this.close() : this.open();\n }", "function toggleTmiMode() {\n tmiModeExpanded = !tmiModeExpanded;\n\n $('collapse').style.display =\n tmiModeExpanded ? 'inline' : 'none';\n $('expand').style.display =\n tmiModeExpanded ? 'none' : 'inline';\n\n document.body.className =\n tmiModeExpanded ? 'show-tmi-mode' : 'hide-tmi-mode';\n\n browserProxy.saveShowDetailsToPrefs(tmiModeExpanded);\n}", "toggleContents() {\n\t\tif (this.breakpoint === this.sizeS && this.sideContentVisibility !== SideContentVisibility.AlwaysShow) {\n\t\t\tthis._toggled = !this._toggled;\n\t\t}\n\t}", "function toggleOn() {\n if(toggle==0)\n {\n toggle=1;\n $(\".content\").css(\"display\",\"none\");\n $(\".containeffect\").css(\"display\",\"inline-block\");\n if(equal==1)\n {\n $(\".contain\").css(\"display\",\"none\");\n $(\".fa-bar-chart\").toggleClass('bar-icon')\n $(\"svg\").css(\"display\",\"none\");\n equal=0;\n }\n }\n else {\n toggle=0;\n $(\".containeffect\").css(\"display\",\"none\");\n $(\".content\").css(\"display\",\"inline-block\");\n }\n}", "function toggle(target, zipper) {\n\tvar targetWidget = $('#' + target).toggle('slow');\n\tvar zipperWidget = $('#' + zipper);\n\tif (zipperWidget.attr('src') == 'images/collapse_arrow.png') {\n\t\tzipperWidget.attr('src', 'images/expand_arrow.png');\n\t} else {\n\t\tzipperWidget.attr('src', 'images/collapse_arrow.png');\n\t}\n}", "toggleWidget() {\n // Notify other callers\n if (this.widget.classList.contains('gm-hidden')) {\n this.instance.emit('close-overlays');\n this.instance.emit('keyboard-disable');\n } else {\n this.instance.emit('keyboard-enable');\n }\n\n // Toggle display\n this.widget.classList.toggle('gm-hidden');\n this.toolbarBtnImage.classList.toggle('gm-active');\n }", "function expandSidebarIcons() {\n $('#sidebarContent .iconToggle').parent().siblings('ul').css({'display': 'block'});\n $('#sidebarContent .iconToggle').removeClass('fa-angle-right');\n $('#sidebarContent .iconToggle').addClass('fa-angle-down');\n}", "close() {\n if (!this.disabled) {\n this.expanded = false;\n }\n }", "function toggleVisible() {\n setVisible(false)\n\n }", "function toggleDisclosure(id,iconid,closeUrl,openUrl){\n $(id).toggle();\n if($(id).visible()){\n $(iconid).setAttribute(\"src\",openUrl);\n }else{\n\n $(iconid).setAttribute(\"src\",closeUrl);\n }\n}", "function setToggle(dropBool) {\n if(dropBool == \"true\") {\n\tdocument.getElementById(\"advSearch\").className=\"collapse in\";\n }\n dropIconToggle();\n}", "toggle() {\r\n this.props.dispatch({\r\n type: 'mainLayout/setCollapsed',\r\n payload: !this.props.model.collapsed,\r\n });\r\n }", "toggle(){\n // Measure heights and animate transition\n const {_details: details} = this;\n const initialHeight = getComputedStyle(details).height;\n const wasOpen = details.open;\n details.open= !details.open;\n const finalHeght = getComputedStyle(details).height;\n details.open= true; // Close after animation ends\n const keyframes = [\n {height: initialHeight},\n {height: finalHeght}\n ];\n const options = { duration: 150 };\n const animation = details.animate(keyframes, options);\n // This makes the animation consistent between states\n if(wasOpen){\n details.classList.remove(\"open\");\n animation.onfinish = () => {\n details.open = false;\n };\n }else\n details.classList.add(\"open\");\n }", "toggle() {\r\n if (this.props.isMobile) {\r\n this.props.updateCurrentTopPointSalePointId(this);\r\n this.setState({ collapse: !this.state.collapse });\r\n }\r\n }", "function toggle_collapse(objid)\n{\n\tif (!is_regexp)\n\t{\n\t\treturn false;\n\t}\n\n\tobj = fetch_object('collapseobj_' + objid);\n\timg = fetch_object('collapseimg_' + objid);\n\tcel = fetch_object('collapsecel_' + objid);\n\n\tif (!obj)\n\t{\n\t\t// nothing to collapse!\n\t\tif (img)\n\t\t{\n\t\t\t// hide the clicky image if there is one\n\t\t\timg.style.display = 'none';\n\t\t}\n\t\treturn false;\n\t}\n\n\tif (obj.style.display == 'none')\n\t{\n\t\tobj.style.display = '';\n\t\tsave_collapsed(objid, false);\n\t\tif (img)\n\t\t{\n\t\t\timg_re = new RegExp(\"_collapsed\\\\.gif$\");\n\t\t\timg.src = img.src.replace(img_re, '.gif');\n\t\t}\n\t\tif (cel)\n\t\t{\n\t\t\tcel_re = new RegExp(\"^(thead|tcat)(_collapsed)$\");\n\t\t\tcel.className = cel.className.replace(cel_re, '$1');\n\t\t}\n\t}\n\telse\n\t{\n\t\tobj.style.display = 'none';\n\t\tsave_collapsed(objid, true);\n\t\tif (img)\n\t\t{\n\t\t\timg_re = new RegExp(\"\\\\.gif$\");\n\t\t\timg.src = img.src.replace(img_re, '_collapsed.gif');\n\t\t}\n\t\tif (cel)\n\t\t{\n\t\t\tcel_re = new RegExp(\"^(thead|tcat)$\");\n\t\t\tcel.className = cel.className.replace(cel_re, '$1_collapsed');\n\t\t}\n\t}\n\treturn false;\n}", "toggleContents() {\n if (this.breakpoint === this.sizeS && this.sideContentVisibility !== _SideContentVisibility.default.AlwaysShow) {\n this._toggled = !this._toggled;\n }\n }", "collapseFilters () {\n this._toggleCollapsibleFilters(true);\n }", "toggleExpand() {\n if (currentExpanded !== undefined) {\n currentExpanded.justToggleExpand();\n currentExpanded = undefined;\n }\n if (!this.state.expand && currentExpanded === undefined)\n currentExpanded = this;\n\n this.justToggleExpand();\n }", "toggleExpand() {\n if (currentExpanded !== undefined) {\n currentExpanded.justToggleExpand();\n currentExpanded = undefined;\n }\n if (!this.state.expand && currentExpanded === undefined)\n currentExpanded = this;\n\n this.justToggleExpand();\n }", "function toggle(button, target) {\n\t\t\t\n\t\t\tif(target.css(\"height\") == \"0px\" ) {\n\t\t\t\tbutton.attr(\"src\", \"/static/app/pts/collapse.png\");\n\t\t\t\ttarget.css({\n\t\t\t\t\t\"height\": \"auto\",\n\t\t\t\t\t\"overflow\": \"visible\"\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbutton.attr(\"src\", \"/static/app/pts/expand.png\");\n\t\t\t\ttarget.css({\n\t\t\t\t\t\"height\": \"0px\",\n\t\t\t\t\t\"overflow\": \"hidden\"\n\t\t\t\t});\n\t\t\t}\n\t\t}", "onToggleExpanded() {\n this.toggleProperty('isExpanded');\n }", "function toggleFlyout() {\n const analyticsAction = isExpanded ? 'CloseDrawer' : 'OpenDrawer'\n analyticsService.logEvent('KnowledgeManagement', analyticsAction)\n setIsExpanded(!isExpanded)\n }", "expand () {\n this.root.toggle(true, true);\n }", "toggle() {\n if (this.isOpen()) {\n this.close();\n }\n else {\n this.open();\n }\n }", "toggle() {\n if (this.isOpen()) {\n this.close();\n }\n else {\n this.open();\n }\n }", "function toggleVisibility() {\r\n\t\tif (designImage.style.display == '') {\r\n\t\t\tdesignImage.style.display = 'block';\r\n\t\t\tmeasurement.box.style.display = 'block';\r\n\t\t\tpositionDesignImage()\r\n\t\t\tEstate.Develop.CheckImage.Run( requestURL )\r\n\t\t} else {\r\n\t\t\tdesignImage.style.display = '';\r\n\t\t\tmeasurement.box.style.display = '';\r\n\t\t}\r\n\t}", "function hideSidenav()\n{ \n $('#sidenav').css('transition','0.5s ease')\n $('#sidenav').css('width','0');\n $('.sidenavItems').css('display','none');\n console.log(\"sidenav hide icon clicked\");\n}", "function toggleToolbar() {\n if (state.toolbarState === \"hidden\") {\n showToolbar()\n } else {\n hideToolbar();\n }\n}", "toggle(e) {\n\t\tif (this.isShowing) {\n\t\t\tthis.hideContainer(e);\n\t\t} else {\n\t\t\tthis.showContainer(e);\n\t\t}\n\t}", "onClickToggleCollapse (event) {\n return\n }", "function toggle() {\n setIsActive(!isActive);\n }", "toggle () {\n this.opened = !this.opened;\n }", "toggle () {\n this.opened = !this.opened;\n }", "open() {\n this.expanded = true;\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}", "_collapseBand(band) {\n band.expanded = false;\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}", "function toggleAnnotations(){\n if(annotFlag){\n $('#anoToggle i').removeClass('icon-edit');\n $('#anoToggle i').addClass('icon-pencil');\n addConsoleMessage(\"Showing all annotations.\");\n hideAllAnnotations();\n }\n else{\n $('#anoToggle i').removeClass('icon-pencil');\n $('#anoToggle i').addClass('icon-edit');\n addConsoleMessage(\"Hide all annotations\");\n showAllAnnotations();\n }\n}", "function collapseForm(e) {\n var searchForm = e.target.closest('section');\n // get the icon element\n var collapseIcon = e.currentTarget.children[0].children[0];\n\n if (searchForm.dataset.visible === 'visible') {\n collapseIcon.classList.add('fa-angle-down')\n collapseIcon.classList.remove('fa-angle-up')\n searchForm.dataset.visible = 'hidden';\n searchForm.children[1].setAttribute('style', 'display:none');\n searchForm.children[2].setAttribute('style', 'display:none');\n } else {\n collapseIcon.classList.add('fa-angle-up')\n collapseIcon.classList.remove('fa-angle-down')\n searchForm.dataset.visible = 'visible';\n searchForm.children[1].setAttribute('style', '');\n searchForm.children[2].setAttribute('style', '');\n }\n}", "function toggle(){\n\t\t\tcartVisible = !cartVisible;\n\t\t}", "function displayToggle(event) {\n console.log(event);\n if (event.target.name === 'hide') {\n currentInventory.beers[event.target.id].toggleDisplay();\n currentInventory.saveToLocalStorage();\n // console.log(currentInventory);\n }\n}", "onHide() {\n\t\tthis.setState({\n\t\t\topen: false\n\t\t});\n\t}", "toggleEdgeHide() {\n if (this.html.attr(\"visibility\") === \"hidden\") {\n this.html.attr(\"visibility\", \"visible\")\n }\n else {\n this.html.attr(\"visibility\", \"hidden\")\n }\n }", "function toggle(o) { o.is(':visible') ? o.hide() : o.show(); }", "toggle_() {\n if (this.isOpen_()) {\n this.close_();\n } else {\n this.open_();\n }\n }", "expand() {\n if (this.titleElement.classList.contains('expanded')) {\n return this.materialize();\n }\n this.titleElement.classList.add('expanded');\n ARIAUtils.setExpanded(this.titleElement, true);\n this.titleExpandIcon.setIconType('smallicon-triangle-down');\n return this.materialize().then(() => {\n if (this.widget) {\n this.widget.show(this.element);\n }\n });\n }", "function toggleIcon(e) {\n $(e.target)\n .prev('.panel-heading')\n .find(\".more-less\")\n .toggleClass('glyphicon-plus fa-minus');\n }", "function toggle(elementId,siteRoot) {\n if (document.getElementById(elementId).style.display == 'none') {\n document.getElementById(elementId).style.display = '';\n document.getElementById('expand_' + elementId).src = siteRoot + '/images/buttons/collapse.png';\n } else {\n document.getElementById(elementId).style.display = 'none';\n document.getElementById('expand_' + elementId).src = siteRoot + '/images/buttons/expand.png';\n }\n}" ]
[ "0.70135665", "0.69897556", "0.69897556", "0.686293", "0.68112946", "0.6808528", "0.67870665", "0.6741469", "0.6725679", "0.6628447", "0.66143376", "0.65889484", "0.65522915", "0.65255564", "0.65252", "0.6519703", "0.6473483", "0.64279777", "0.6405912", "0.63805467", "0.63708156", "0.63679034", "0.636446", "0.6363127", "0.63511187", "0.63497835", "0.63458073", "0.63327116", "0.632157", "0.6314402", "0.6312258", "0.6312098", "0.6297933", "0.62794954", "0.62613577", "0.62531674", "0.62476593", "0.6247369", "0.6247369", "0.62463194", "0.62463194", "0.62463194", "0.623197", "0.6226601", "0.6221142", "0.6182068", "0.616836", "0.6162127", "0.6147332", "0.61354965", "0.6124347", "0.6124347", "0.61173534", "0.6114968", "0.6110727", "0.6096901", "0.607875", "0.6073299", "0.6060546", "0.6055407", "0.60501534", "0.60458606", "0.60436785", "0.60365367", "0.60195357", "0.60180014", "0.60130423", "0.5997887", "0.5992786", "0.5980364", "0.5980364", "0.5980221", "0.5969564", "0.5965029", "0.596045", "0.5953705", "0.5953705", "0.59475386", "0.5934588", "0.59285206", "0.59267765", "0.5903876", "0.59023404", "0.5887957", "0.5887957", "0.5887577", "0.58872795", "0.5886946", "0.5881841", "0.5879349", "0.5870381", "0.5868259", "0.5857013", "0.58563673", "0.58557695", "0.584931", "0.5840874", "0.58337796", "0.58253914", "0.5820721" ]
0.731999
0
Displays the "empty page" message on the page
function displayEmptyPageMessage() { $("#emptyPageMessageWrapper").removeClass("hidden"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayEmpty() {\n var emptyCase = `\n <div class = \"alert alert-warning\" role = \"alert\">\n <h5>No new articles available.</h5>\n </div>`;\n articleContainer.append(emptyCase);\n }", "function EmptyPage() {\n return <div>Empty page</div>;\n}", "function empty() {\n res.send(\n {\n \"response_type\": \"ephemeral\",\n \"text\": \"Sorry, Desk give me any results :(\",\n }\n )\n }", "function renderEmpty() {\n reviewContainer.empty();\n\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"There must be a Review created before you can view one.\");\n reviewContainer.append(alertDiv);\n\n var query = window.location.search;\n var partial = \"\";\n if (movieSelect.val()) {\n partial = \" for Movie Title\" + movieSelect.val();\n }\n\n var message = $(\"<h2>\");\n message.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n message.html(\"No reviews yet\" + partial + \", navigate <a href='/cms\" + query +\n \"'>here</a> in order to get started.\");\n reviewContainer.append(message);\n }", "function isPageEmpty() {\n return $.isEmptyObject(widgetByIdMap);\n }", "function displayEmpty() {\n responseContainer.empty();\n var messageh2 = $(\"<h2>\");\n messageh2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageh2.html(\"No responses yet for this category, navigate <a href='/questionnaire'>here</a> in order to create a new response.\");\n responseContainer.append(messageh2);\n }", "function emptyPage(response, exit) {\n response.writeHead(200, html);\n response.end('');\n if (exit) {\n process.nextTick(process.exit.bind(process, 0));\n }\n}", "function displayEmpty(id) {\n var query = window.location.search;\n var partial = \"\";\n if (id) {\n partial = \" for restaurant #\" + id;\n }\n menuContainer.empty();\n var messageH2 = $(\"<h2>\");\n messageH2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageH2.html(\"No menus yet\");\n menuContainer.append(messageH2);\n }", "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-info\");\n alertDiv.text(\"No Records Found\");\n inventoryContainer.append(alertDiv);\n }", "function displayEmpty(id) {\n var query = window.location.search;\n var partial = \"\";\n if (id) {\n partial = \" for Workout #\" + id;\n }\n blogContainer.empty();\n var messageh2 = $(\"<h2>\");\n messageh2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageh2.html(\"No exercises yet\" + partial + \", navigate <a href='/exercise\" + query +\n \"'>here</a> in order to get started.\");\n blogContainer.append(messageh2);\n }", "function displayEmpty(id) {\n var query = window.location.search;\n var partial = \"\";\n if (id) {\n partial = \" for Patient #\" + id;\n }\n pillboxContainer.empty();\n var messageh2 = $(\"<h2>\");\n messageh2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageh2.html(\"No schedules yet\" + partial + \", navigate <a href='/cms\" + query +\n \"'>here</a> in order to get started.\");\n pillboxContainer.append(messageh2);\n }", "function displayEmpty(id) {\n var query = window.location.search;\n var partial = \"\";\n if (id) {\n partial = \" for Merchant #\" + id;\n }\n blogContainer.empty();\n var messageH2 = $(\"<h2>\");\n messageH2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageH2.html(\"No products yet\" + partial + \", navigate <a href='/cms\" + query +\n \"'>here</a> in order to get started.\");\n blogContainer.append(messageH2);\n }", "function displayEmpty() {\n blogContainer.empty();\n var messageH2 = $(\"<h2>\");\n messageH2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\",\"color\":\"gray\" });\n messageH2.html('No posts yet for this category. Click \"Add Post\" at top of page');\n blogContainer.append(messageH2);\n }", "function displayEmpty(id) {\n var query = window.location.search;\n var partial = \"\";\n if (id) {\n partial = \" for Player #\" + id;\n }\n //listContainer.empty();\n inProgress.empty();\n completed.empty();\n wishList.empty();\n var messageh2 = $(\"<h2>\");\n messageh2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageh2.html(\"No games yet\" + partial + \", navigate <a href='/cms\" + query +\n \"'>here</a> in order to get started.\");\n listContainer.append(messageh2);\n }", "function displayEmpty() {\n reviewContainer.empty();\n var messageH2 = $(\"<h2>\");\n messageH2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageH2.html(\"No posts yet for this rating.\");\n reviewContainer.append(messageH2);\n }", "function renderEmpty() {\n const alertText = \"Uh Oh. Looks like we don't have any saved articles.\";\n const alertBox = $('<div/>')\n .addClass('shadow alert alert-warning text-center')\n .append($('<h4/>').text(alertText));\n\n const cardHeaderText = 'Would You Like to Browse Available Articles?';\n const cardHeader = $('<div/>')\n .addClass('card-header d-block')\n .append($('<h3/>').addClass('text-center').text(cardHeaderText));\n\n const browseLink = $('<a/>')\n .addClass('browse-articles')\n .attr({ href: '/' })\n .text('Browse Articles');\n const cardBody = $('<div/>')\n .addClass('card-body text-center')\n .append($('<h4/>').append(browseLink));\n const card = $('<div/>').addClass('card').append(cardHeader, cardBody);\n\n articleContainer.append(alertBox, card);\n }", "function EmptyPage() {\n return <div id=\"emptyPage\" style={{ width: \"100%\", height: \"100vh\", background: \"rgba(0,0,0,0.4)\", zIndex: \"2\", position: \"fixed\", top: \"0\", left: \"-100%\", transition: \"350ms ease-in-out\" }}></div>\n }", "function displayEmpty() {\n blogContainer.empty();\n var messageh2 = $(\"<h2>\");\n messageh2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageh2.html(\"No dancers yet\");\n blogContainer.append(messageh2);\n }", "function displayEmpty(id) {\n var query = window.location.search;\n var partial = \"\";\n if (id) {\n partial = \" for Author #\" + id;\n }\n blogContainer.empty();\n var messageh2 = $(\"<h2>\");\n messageh2.css({ \"text-align\": \"center\", \"margin-top\": \"50%\" });\n messageh2.html(\"This NerdGirl has not posted anything yet.\" );\n blogContainer.append(messageh2);\n }", "function renderEmpty(){\n // This function renders some HTML to the page explaining we don't have any articles to view\n // using a joined array of HTML string data because it's easier to read/change than a concatenated string\n var emptyAlert =\n $([\"<div calss='alert-warning text-center'>\",\n \"<h4>Uh oh. Looks like we don't have any new articles.</h4>\",\n \"</div>\",\n \"<div class='panel panel-default'>\",\n \"<div class='panel-heading text-center'>\",\n \"<h3>What Would You Like To Do?</h3>\",\n \"</div>\",\n \"<div class='panel-body text-center'>\",\n \"<h4><a class='class'scrape-new'>Try Scraping New Articles</a></h4>\",\n \"</div>\"\n ].join(\"\"));\n // appending this data to the page\n articleContainer.append(emptyAlert);\n}", "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"You must create an property before you can create a Post.\");\n propertyContainer.append(alertDiv);\n }", "function displayEmpty() {\n blogContainer.empty();\n var messageh2 = $(\"<h2>\");\n messageh2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageh2.html(\"No parents yet\");\n blogContainer.append(messageh2);\n }", "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"You must create an Author before you can create a Definition.\");\n authorContainer.append(alertDiv);\n }", "function displayEmpty() {\n requestsContainer.empty();\n var messageh2 = $(\"<h2>\");\n messageh2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageh2.html(\"No time off requests have been made.\");\n requestsContainer.append(messageh2);\n }", "function displayEmpty(id) {\n const query = window.location.search;\n let partial = \"\";\n if (id) {\n partial = \" for Organization #\" + id;\n }\n eventFeed.empty();\n const messageH2 = $(\"<h2>\");\n messageH2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageH2.html(\n \"No events yet\" +\n partial +\n \", navigate <a href='/orgLogin\" +\n query +\n \"'>here</a> in order to get started.\"\n );\n eventFeed.append(messageH2);\n }", "function render_empty()\n {\n var emptyAlert = $(\n [\n \"<div class='alert alert-warning text-center'>\",\n \"<h4>We don't have any saved headlines.</h4>\",\n \"</div>\",\n \"<div class='card'>\",\n \"<div class='card-body'>\",\n \"<div class='card-title text-center'>\",\n \"<h3>Would You Like to Browse Available Articles?</h3>\",\n \"</div>\",\n \"<div class='card-text text-center'>\",\n \"<h4><a href='/'>Browse Articles</a></h4>\",\n \"</div>\",\n \"</div>\",\n \"</div>\"\n ].join(\"\")\n );\n headline_container.append(emptyAlert);\n }", "function displayIfNoLinks() {\n\n // Used in showing if there are no results\n const page = document.querySelector(\".page\");\n\n // If there is already an h1 tag, it is removed\n if (page.lastElementChild.tagName === \"H1\") {\n page.removeChild(page.lastElementChild);\n }\n\n // If there are 0 links that match the search, then a message is outputted\n if (linksToDisplay.length === 0) {\n const noTextMessage = makeH1(\"No matches found!\");\n\n // Makes h1 tag for output\n page.appendChild(noTextMessage);\n }\n}", "static renderEmptyInfo() {\n return <span className=\"no-formulae\">The tenet is empty</span>\n }", "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"Sorry - Nothing to reServe today!\");\n groceryContainer.append(alertDiv);\n }", "function renderEmpty() {\n const alertDiv = $('<div>');\n alertDiv.addClass('alert alert-danger');\n alertDiv.text('You must create a Segment before you can create a SubSegment.');\n segmentContainer.append(alertDiv);\n }", "function renderEmpty() {\n\t\tvar alertDiv = $('<div>');\n\t\talertDiv.addClass('alert alert-danger');\n\t\talertDiv.text('You must create a customer.');\n\t\tContactsContainer.append(alertDiv);\n\t}", "function empty() {\n }", "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"There are no entries for the selected employee\");\n tableContainer.append(alertDiv);\n }", "function renderEmpty() {\n const alertText = \"Uh Oh. Looks like we don't have any articles.\";\n const alertBox = $('<div/>')\n .addClass('shadow alert alert-warning text-center')\n .append($('<h4/>').text(alertText));\n\n const cardHeaderText = 'What Would You Like To Do?';\n const cardHeader = $('<div/>')\n .addClass('card-header d-block')\n .append($('<h3/>').addClass('text-center').text(cardHeaderText));\n\n const scrapeLink = $('<a/>')\n .addClass('scrape-new')\n .attr({ href: '#' })\n .text('Try Scraping New Articles');\n const savedLink = $('<a/>')\n .addClass('go-to-saved')\n .attr({ href: '/saved' })\n .text('Go to Saved Articles');\n\n const cardBody = $('<div/>')\n .addClass('card-body text-center')\n .append(\n $('<h4/>').append(scrapeLink),\n $('<h4/>').append(savedLink)\n );\n\n const card = $('<div/>').addClass('card').append(cardHeader, cardBody);\n\n articleContainer.append(alertBox, card);\n }", "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"You must create a Reviewer before you can create a Post.\");\n reviewerContainer.append(alertDiv);\n }", "function clearPage() {\n\t\t//Clear the page\n\t\tlet mainArea = document.querySelector('#mainArea');\n\n\t\twhile (mainArea && mainArea.firstChild) {\n\t\t\tmainArea.removeChild(mainArea.firstChild);\n\t\t}\n\t}", "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.html(\"You must create a Mood before you can create a Comment.\");\n moodContainer.append(alertDiv);\n }", "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"No Comments So Far\");\n commentContainer.append(alertDiv);\n }", "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"You must create an Tenant before you can create a Ticket.\");\n tenantContainer.append(alertDiv);\n }", "function renderEmpty(){\n\t\t$(\"#potLuckInfoH1\").hide();\n\t\t$(\"#theadInfo\").hide();\n\t\tvar alertDiv = $(\"<div>\");\n\t alertDiv.addClass(\"alert alert-danger\");\n\t alertDiv.text(\"You must create an Potluck\");\n\t potLuckContainer.append(alertDiv);\n\n\t $(\".alert-danger\").show().delay(3000).fadeOut();\n\n\t}", "renderEmpty(){\n if (this.state.alerts.length === 0){\n return (\n <div class=\"col-12\">\n <Alert className=\"no-alerts-alert\" color=\"primary\">\n There are no alerts to display.\n </Alert>\n </div>\n );\n }\n }", "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"You must create a Player before you can create a Game.\");\n playerContainer.append(alertDiv);\n }", "function noContent() {\n let noContent = '';\n noContent += '<p class=\"text-center mt-20\">No data available.</p>';\n // noContent += '<img src=\"'+config.cloud.server.protocol+'://'+\n // cloudServerAddress+'/'+config.projects.name.dashboard+'/assets/dist/img/no_content.png\" />';\n // noContent += '</div>';\n // noContent += '<p class=\"text-center m-10 text-muted\">Details Unavailable.</p>';\n // noContent += '<p class=\"text-center m-10 text-muted\">There is no detail available.</p>';\n\n return noContent;\n}", "function renderEmpty() {\n var alertDiv = $(\"<div>\");\n alertDiv.addClass(\"alert alert-danger\");\n alertDiv.text(\"Please contact your administrator to have your employeeID entered. If the user has an employeeID then the user hasn't logged any hours yet!\");\n tableContainer.append(alertDiv);\n }", "function errorHandleNoRoutes() {\n\tinfoWindow.setContent(\"<h1>No Route Found</h1>\");\n}", "function displayHelpPage() {\n // Set display to \"no category selected\".\n pageCollection.setCategory('noCat');\n // Display the default page.\n pageCollection.setPage('helpPage');\n}", "function renderEmpty() {\n alert(\"Please enter a new job\");\n }", "function pageLoaded() {\t\t\t\n\t\twriteToConsole(\"Page Loaded\");\n\t}", "empty() {\n this.context.invoke('code', dom.emptyPara);\n }", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function Empty(){}", "function clearPage() {\n quizQuestion.empty();\n timeRem.empty();\n quizAnswers.empty();\n }", "prePage(){\n if(this.pageContent === null){\n return (\n <div className='center'>\n loading...\n </div>\n )\n }else if(this.pageContent === true){\n return (\n <p>Not found</p>\n )\n }\n }", "function renderEmpty(){\n\n if( $(\"#newsArea\").children(\"#no-articles-warning\").length === 0 ){\n var div = $(\"<div class='alert alert-warning' role='alert'>\");\n div.text(\"No new artciles have been added!\");\n div.attr(\"id\", \"no-articles-warning\");\n $(\"#newsArea\").prepend(div);\n }\n\n}", "function initPage() {\n $.get('/api/headlines?saved=false').done((data) => {\n articleContainer.empty();\n if (data && data.length > 0) {\n renderArticles(data);\n\n // Activate tooltips for the action buttons.\n $('[data-toggle=\"tooltip\"]').tooltip();\n } else {\n renderEmpty();\n }\n });\n }", "renderPage() {}", "function initPage() {\n $.get('/api/headlines?saved=true').done((data) => {\n articleContainer.empty();\n\n if (data && data.length > 0) {\n renderArticles(data);\n\n // Activate tooltips for the action buttons.\n $('[data-toggle=\"tooltip\"]').tooltip();\n } else {\n renderEmpty();\n }\n });\n }", "function showDefaultPage(defaultArticleObj){\n cleanArticleFields();\n if(defaultArticleObj) { \n $('.title').append('<span>' + defaultArticleObj.title + '</span>' );\n $('.author').append( defaultArticleObj.author );\n $('.date').append( defaultArticleObj.date );\n $('.text').append( defaultArticleObj.text );\n } else {\n $('.title').text(noArticleObject.title);\n $('.text').text( noArticleObject.text ); \n }\n }", "function noEventsFound() {\n\t$('#events_scroller').empty()\n\t\t.append($(\"<div id='no_events_container'>Sorry, no events found.</div>\"));\t\n}", "function displaySavedEmpty(id) {\n if (id) {\n partial = \" for Organization #\" + id;\n }\n savedEventFeed.empty();\n const messageH2 = $(\"<h2>\");\n messageH2.css({ \"text-align\": \"center\", \"margin-top\": \"50px\" });\n messageH2.html(\"No events saved yet\");\n savedEventFeed.append(messageH2);\n }", "function addEmptyMessage(container) {\n const message = document.createElement('p');\n message.innerText = 'There are no saved diagrams.';\n container.appendChild(message);\n}", "function Empty() {\n}", "function pageHome(request, response) {\r\n response.send('<h1>Welcome to Phonebook</h1>')\r\n}", "function clear_page(id)\n{\n if(id == undefined)\n $(\"#page-wrapper\").html(\"\");\n else\n $(id).html(\"\");\n}", "function DisplayEmptyCloud(cloud) {\n }", "function errorPage(e) {\r\n if (!empty(e)) {\r\n Logger.error(\"[Error page redirect:\" + e.error + \"] - ***Emarsys error message: \" + e.errorMessage);\r\n }\r\n app.getView().render('subscription/emarsys_error');\r\n}", "function clearPage (){\n if (outputResult.hasChildNodes()) {\n outputResult.removeChild(outputResult.childNodes[0]);\n }\n if (warningAlert.classList.contains(\"reveal\")) {\n warningAlert.classList.remove(\"reveal\");\n }\n if (database.hasChildNodes()) {\n database.removeChild(database.childNodes[0]);\n return true;\n }\n}", "function getEmptyMsg(){\n\t\t\treturn \"There are no items in your cart\";\n\t\t}", "function PageNotFound(props) {\r\n\treturn(\r\n\t\t<div id=\"page-not-found-container\" className=\"text-center\">\r\n\t\t\t<h1 id=\"page-not-found-message\">\r\n\t\t\t\t<FormattedMessage \r\n\t\t\t\t\tid=\"pagenotfound.message\" \r\n\t\t\t\t\tdefaultMessage=\"\"\r\n\t\t\t\t/>\t\t\t\r\n\t\t\t</h1> \r\n\t\t</div>\r\n\t\t);\r\n}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}", "function Empty() {}" ]
[ "0.6837556", "0.6818285", "0.681492", "0.6773253", "0.67297196", "0.6642752", "0.6617391", "0.6607315", "0.6561375", "0.65374064", "0.6446165", "0.6436086", "0.6409814", "0.63900256", "0.634226", "0.6312254", "0.62965447", "0.6273451", "0.6268011", "0.623355", "0.62277764", "0.62193185", "0.6214428", "0.6211417", "0.61808276", "0.6178295", "0.61602247", "0.6157118", "0.61005235", "0.60883206", "0.60823655", "0.6077897", "0.60684717", "0.60639775", "0.6052519", "0.6045736", "0.6042613", "0.6000909", "0.59523976", "0.5945513", "0.59431106", "0.59342146", "0.593386", "0.5931822", "0.5931365", "0.5929434", "0.5919542", "0.5908801", "0.58813214", "0.58437526", "0.58437526", "0.58437526", "0.58437526", "0.58437526", "0.58080894", "0.5796322", "0.57461333", "0.5708745", "0.56934553", "0.5664535", "0.5656153", "0.5643522", "0.56405807", "0.563707", "0.5636401", "0.56309456", "0.56290144", "0.5625205", "0.5623771", "0.56146026", "0.5602475", "0.5596788", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491", "0.5592491" ]
0.7388173
0
Utility function to determine if a javascript object is a function
function isFunction(obj) { return (typeof obj == "function"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFunction(object) { return typeof object === 'function'; }", "function isFunction( obj ){\n return Object.prototype.toString.call( obj ) == \"[object Function]\";\n }", "function isFunction(obj) {\n return typeof obj === \"function\";\n}", "function isFunction(obj) {\n return typeof obj === \"function\";\n}", "function isFunction(obj) {\n return typeof obj === 'function';\n}", "function isFunction(obj) {\n return typeof obj === 'function';\n}", "function isFunction(obj) {\n return typeof obj === 'function';\n}", "function isFunction(obj) {\n return (typeof obj === \"function\");\n}", "function isFunction(obj) {\n return typeof obj === 'function';\n }", "function isFunction(obj) {\n return typeof obj === 'function';\n }", "function isFunction(obj) {\n return typeof obj === 'function';\n }", "function isFunction(obj) {\n return typeof obj === 'function';\n }", "function isFunction(obj) {\n\treturn typeOf(obj, \"function\");\n\t// return toString.call(obj) == '[object Function]';\n}", "function is_func(func) { return Object.prototype.toString.call(func) == \"[object Function]\"; }", "function isFn (x) { return typeof x === 'function' }", "function _isFunction(obj) {\n return typeof obj === 'function';\n}", "function isFunction(obj) {\n return (obj && typeof obj === \"function\");\n }", "function is_func(func) {\n return Object.prototype.toString.call(func) == \"[object Function]\";\n }", "function isFunction (obj) {\n return !!(obj && obj.constructor && obj.call && obj.apply)\n}", "function isFunction(obj) {\n return $.isFunction(obj);\n }", "static isFunction(obj) {\n return !!(obj && obj.constructor && obj.call && obj.apply);\n }", "function isFunction(a) {\n return getTypeString(a) === '[object Function]';\n }", "function isFunc(cf) {\r\n return typeof cf === \"function\";\r\n}", "function isFunc(f) {\n return typeof f === \"function\";\n}", "__is_function(variable) {\n\n return typeof variable == \"function\"\n }", "function isFunction(a) {\r\n return typeof a == 'function';\r\n}", "function isFunction(input){return\"undefined\"!=typeof Function&&input instanceof Function||\"[object Function]\"===Object.prototype.toString.call(input)}", "is_function(value) {\n return typeof(value) === 'function';\n }", "function isFunction(x) {\n return \"function\" == typeof x;\n }", "function isFunc(it) {\n return it instanceof Function || typeof it === \"function\";\n }", "function isFunction(x) {\n return typeof x === \"function\";\n}", "function isFunction(x) {\n return \"function\" === typeof x;\n }", "function isFunction(fun) {\n return fun && {}.toString.call(fun) === '[object Function]';\n}", "function isFunction(obj){\n \treturn typeof obj === \"function\" && typeof obj.nodeType !== \"number\";\n }", "function isFunction(value) { return typeof value === \"function\" || value instanceof Function; }", "function checkIfFunction(func) {\n return typeof func === \"function\";\n}", "isFunction(functionToCheck) {\n return functionToCheck && {}.toString.call(functionToCheck) === '[object Function]';\n }", "function isFunction(x) {\n return typeof x === 'function';\n}", "function isFunction (f) {\n return 'function' === typeof f\n}", "function isFunction (f) {\n return 'function' === typeof f\n}", "function isFunction(func) {\n return (typeof func) === 'function';\n}", "function isFunction(func) {\n return (typeof func) === 'function';\n}", "function isFunction(func) {\n return typeof func === \"function\";\n}", "function isFunction(variable) {\n return Object.prototype.toString.call(variable) === \"[object Function]\";\n }", "function t(a){return typeof Function!=\"undefined\"&&a instanceof Function||Object.prototype.toString.call(a)===\"[object Function]\"}", "function isFunction(input) {\n return (\n typeof Function !== 'undefined' && input instanceof Function ||\n Object.prototype.toString.call(input) === '[object Function]');\n\n }", "function a(t){return typeof Function!==\"undefined\"&&t instanceof Function||Object.prototype.toString.call(t)===\"[object Function]\"}", "function isFunction(input) {\n\t return (\n\t (typeof Function !== 'undefined' && input instanceof Function) ||\n\t Object.prototype.toString.call(input) === '[object Function]'\n\t );\n\t }", "function isFunction(data) {\n return typeof data === \"function\";\n}", "function isFunction(input) {\n return typeof Function !== 'undefined' && input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';\n }", "function isFunction(fn) {\n return typeof fn === \"function\";\n}", "function isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n}", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(input) {\n return (\n (typeof Function !== 'undefined' && input instanceof Function) ||\n Object.prototype.toString.call(input) === '[object Function]'\n );\n }", "function isFunction(value) {\n return typeof value === \"function\";\n}", "function isFunction(value) {\n return typeof value === \"function\";\n}", "function isFunction(value) {\n return typeof value === \"function\";\n}", "function isFunction (data) {\n return typeof data === 'function';\n }", "function isFunction(value) {\n return typeof value === 'function';\n}", "function r(t){return typeof Function!=\"undefined\"&&t instanceof Function||Object.prototype.toString.call(t)===\"[object Function]\"}", "function isFunction (it) {\n return Object.prototype.toString.call(it) === '[object Function]'\n }", "function isFunction(functionToCheck) {\n var getType = {};\n return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n }", "function isFunction(value) {\n return !!(value && {}.toString.call(value) == \"[object Function]\");\n}", "function isFunction (data) {\n return typeof data === 'function';\n }", "function isFunction(func) {\n return (typeof func) === 'function';\n }", "function z(t){\n var e=typeof t;\n return\"function\"==e||!!t&&\"object\"==e\n}", "function a(e){return typeof Function!==\"undefined\"&&e instanceof Function||Object.prototype.toString.call(e)===\"[object Function]\"}", "function a(e){return typeof Function!==\"undefined\"&&e instanceof Function||Object.prototype.toString.call(e)===\"[object Function]\"}", "function isFunction(value) {\n return typeof value === 'function';\n}", "function isFunction(functionToCheck) {\n\t\tvar getType = {};\n\t\treturn functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';\n\t}", "function isFunction(val) {\n return typeof val == \"function\";\n}", "function isFunction (value) {\n return typeof value == 'function';\n }" ]
[ "0.87275076", "0.85716516", "0.84731215", "0.84731215", "0.84659374", "0.84659374", "0.8413471", "0.8400714", "0.8271588", "0.8271588", "0.82297206", "0.82297206", "0.81895155", "0.818057", "0.8168735", "0.8164996", "0.81547797", "0.79345363", "0.7929563", "0.7900477", "0.78796124", "0.78292733", "0.7745578", "0.77230066", "0.77163774", "0.76751935", "0.76574975", "0.76272506", "0.7614114", "0.75943446", "0.7583592", "0.7581013", "0.7579822", "0.75550675", "0.75521725", "0.7551901", "0.7545151", "0.75353646", "0.75321347", "0.75321347", "0.7523613", "0.7523613", "0.75211585", "0.7482233", "0.74716675", "0.7464981", "0.74408203", "0.7426013", "0.74145305", "0.7392422", "0.7382301", "0.7370694", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.73621213", "0.7334318", "0.7334318", "0.7334318", "0.7309853", "0.7289813", "0.7280745", "0.7279443", "0.72791123", "0.72708476", "0.7262187", "0.7254578", "0.7237413", "0.72362554", "0.72362554", "0.72182256", "0.72051877", "0.7198922", "0.7188686" ]
0.826689
10
Determines if a page is empty (has zero widgets)
function isPageEmpty() { return $.isEmptyObject(widgetByIdMap); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPaginationEmpty(block) {\n\t return block === void 0 || block === null || block.length <= block.perPage;\n\t}", "get empty() {\n if(this.children.length === 0) {\n return true\n } else {\n return false\n }\n }", "isEmpty() {\n\t\treturn this.size === 0;\n\t}", "empty () { return this.length === 0 }", "get isEmpty() {\n return isNodeEmpty(this.state.doc);\n }", "isEmpty() {\r\n\t\treturn size() == 0;\r\n\t}", "isEmpty() {\n return this._size === 0;\n }", "isEmpty() {\n\t\treturn this.items.length === 0;\n\t}", "isEmpty() {\n return (this._size === 0);\n }", "isEmpty() {\r\n\t\treturn this.heap.length === 0;\r\n\t}", "isEmpty() {\r\n\t\treturn this.heap.length === 0;\r\n\t}", "isEmpty() {\n return this.size === 0;\n }", "isEmpty() {\n return this.size === 0;\n }", "isEmpty() {\n return this.size === 0;\n }", "isEmpty() {\n return this.size === 0;\n }", "isEmpty() {\n return this.size === 0;\n }", "isEmpty(area) {\n switch (area) {\n case 'bottom':\n return this._bottomPanel.widgets.length === 0;\n case 'down':\n return this._downPanel.stackedPanel.widgets.length === 0;\n case 'header':\n return this._headerPanel.widgets.length === 0;\n case 'left':\n return this._leftHandler.stackedPanel.widgets.length === 0;\n case 'main':\n return this._dockPanel.isEmpty;\n case 'menu':\n return this._menuHandler.panel.widgets.length === 0;\n case 'right':\n return this._rightHandler.stackedPanel.widgets.length === 0;\n case 'top':\n return this._topHandler.panel.widgets.length === 0;\n default:\n return true;\n }\n }", "isEmpty() {\n\t\treturn this.items == 0;\n\t}", "isEmpty()\r\n {\r\n if(this.getSize() === 0){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "isEmpty() {\r\n\t\treturn this.size == 0;\r\n\t}", "function isEditorEmpty() {\n var childNodes = scribe.el.childNodes;\n var blockCount = childNodes.length;\n\n if (blockCount === 0) {\n return true;\n } else if (blockCount === 1) {\n var node = childNodes[0];\n var nodeName = node.nodeName.toLowerCase();\n\n if (nodeName === 'p' && node.textContent === '') {\n return true;\n }\n }\n\n return false;\n }", "isEmpty() {\n if (this.Size > 0) {\n return true;\n }\n return false;\n }", "empty() {\n\t\tif (this.size() === 0) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "isEmpty() {\n return _size == 0;\n }", "isEmpty() {\n\t\treturn this._length === 0;\n\t}", "isEmpty() {\n return (this.elements > 0) ? false : true;\n }", "isEmpty() {\n return (this.elements > 0) ? false : true;\n }", "empty(){\r\n return this.size == 0;\r\n }", "isEmpty() {\n\t\treturn this.#hiddenLevels.length === this.#hiddenSize;\n\t}", "isEmpty() {\n return this.size == 0;\n }", "isEmpty() {\n\t\treturn Object.keys(this.items).length == 0\n\t}", "isEmpty() {\n\t\treturn this.items.isEmpty();\n\t}", "isEmpty() {\n return this.items.length === 0;\n }", "isEmpty(editor, element) {\n var {\n children\n } = element;\n var [first] = children;\n return children.length === 0 || children.length === 1 && Text.isText(first) && first.text === '' && !editor.isVoid(element);\n }", "isEmpty(editor, element) {\n var {\n children\n } = element;\n var [first] = children;\n return children.length === 0 || children.length === 1 && Text.isText(first) && first.text === '' && !editor.isVoid(element);\n }", "isEmptyView() {\n return !this.form\n .getRawValue()\n .appRows.some(appRowRawValue => this.shouldShowAppRow(appRowRawValue));\n }", "isEmpty() {\n return this._selection.size === 0;\n }", "isEmpty() {\n return this._selection.size === 0;\n }", "isEmpty () {\n\t\treturn (this.length === 0);\n\t}", "isEmpty(){\n return this.items.length == 0;\n }", "isEmpty() {\n if (this.#size == 0) {\n return true;\n } else {\n return false;\n }\n }", "isEmpty() {\n return (this.collection.length === 0);\n }", "isEmpty() {\n return (this.collection.length === 0);\n }", "isEmpty() {\n return this.size() === 0; \n }", "isEmpty() {\n return this.items.length == 0\n }", "empty() {\n\n // no todos?\n return this.data.length === 0;\n }", "isEmpty() {\n return this._selection.size === 0;\n }", "isEmpty() {\n console.log(this.size === 0);\n }", "isEmpty() {\n return this._elementRef.nativeElement.value.length === 0;\n }", "isEmpty() {\n return this._elementRef.nativeElement.value.length === 0;\n }", "isEmpty(){\n return (this.size === 0); \n }", "isEmpty() { \n return this.size == 0; \n }", "isEmpty() {\n return !this.items.length;\n }", "isEmpty() {\n return this.storage.length === 0;\n }", "isEmpty() {\n const isHeaderEmpty = this.__headerTextEditor.getEditorState().read($canShowPlaceholderCurry(false));\n const isSubheaderEmpty = this.__subheaderTextEditor.getEditorState().read($canShowPlaceholderCurry(false));\n const isDisclaimerEmpty = this.__disclaimerTextEditor.getEditorState().read($canShowPlaceholderCurry(false));\n\n return !this.__backgroundColor &&\n !this.__backgroundImageSrc &&\n !this.__buttonColor &&\n !this.__buttonText &&\n isDisclaimerEmpty &&\n isHeaderEmpty &&\n !this.__labels.length &&\n isSubheaderEmpty;\n }", "function displayEmptyPageMessage() {\n $(\"#emptyPageMessageWrapper\").removeClass(\"hidden\");\n }", "isEmpty() {\n return this.items.isEmpty();\n }", "isEmpty() {\n return this.count === 0;\n }", "isEmpty() {\n return this.count === 0;\n }", "function empty(){\n\tif(this.dataStore.length == 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "isEmpty() {\n return this.collection.length === 0;\n }", "function quiet() {\n\t\treturn $(\"#status-centered\").is(\":empty\");\n\t}", "isEmpty() {\n return !this.heapContainer.length;\n }", "isEmpty() {\n return this.length === 0;\n }", "isEmpty() {\n return this.length === 0;\n }", "isEmpty() {\n return this.length() === 0;\n }", "isEmpty() {\n return (this.length === 0);\n }", "isEmpty() {\n return (this.length === 0);\n }", "get empty() {\n return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() &&\n !this.autofilled;\n }", "isEmpty() {\n return this.length === 0;\n }", "isEmpty() {\n return this.length === 0;\n }", "function isEmpty() {\n return this.top === 0;\n}", "isEmpty(){\n return this.items.length == 0; \n }", "isEmpty() {\n if (this.size == 0) {\n return true;\n }\n return false;\n }", "function heapisEmpty() {\n return this.size == 0 ? true : false;\n}", "get empty() {\n return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() && !this.autofilled;\n }", "isEmpty() {\n if (this.collection.length === 0) return true\n else return false\n }", "get _isEmpty() {\n return this._notifContainerElem.children(\".notif:first\").length === 0;\n }", "function EmptyPage() {\n return <div>Empty page</div>;\n}", "isEmpty() {\n return this.store.length === 0;\n }", "isEmpty() {\n if (this._storage.head === null) {\n return true;\n }\n return false;\n }", "function isTabEmpty(aTab)\n{\n return isBrowserEmpty(aTab.linkedBrowser);\n}", "isEmpty() \n { \n return this.size == 0; \n }", "get hasContent() {\n return Boolean(typeof this.html === 'string' && this.html.length || this.items.length);\n }", "get empty() {\n return !this._elementRef.nativeElement.value || this._elementRef.nativeElement.value.length === 0;\n }", "function empty() {\n }", "get isEmpty() {\n return this._programInternal.length === 0;\n }", "function isEmpty() {\n return N === 0;\n }", "function removeEmptyPages(document){\n for(var k=0;k < document.pages.length;k++){\n var page = document.pages[k];\n if(page.pageItems.length <= 0){\n page.remove();\n }\n }\n}", "isEmpty(){\n if(this.items.length == 0){\n return true;\n }\n else{\n return false;\n }\n }", "isEmpty() {\n return this.vertexCount === 0;\n }", "isEmpty(){\n return this.items.length == 0;\n }", "isEmpty() {\n return this.size() < 1;\n }", "isEmpty() {\n return this.data.length === 0;\n }", "isEmpty() {\n if (this.type === undefined) return true;\n return false;\n }", "isEmpty() {\n return _(this).collection.length === 0;\n }", "isEmpty() {\n return _(this).collection.length === 0;\n }", "isEmpty(){\n if(this.items.length === 0){\n return true;\n }\n return false;\n }", "isEmpty() {\n return this.root === null\n }", "empty() { return this.m == 0; }" ]
[ "0.67035246", "0.6671512", "0.64998066", "0.64573294", "0.6448146", "0.64434016", "0.6433765", "0.6409741", "0.64053875", "0.6402961", "0.6402961", "0.6370084", "0.6370084", "0.6370084", "0.6370084", "0.6370084", "0.63637847", "0.6327837", "0.63211155", "0.6304488", "0.6291391", "0.6283182", "0.62742394", "0.6268705", "0.62417006", "0.62385356", "0.62385356", "0.6229602", "0.6221994", "0.6212053", "0.6211721", "0.62049764", "0.61746675", "0.6171386", "0.6171386", "0.61698806", "0.61696076", "0.61696076", "0.61690784", "0.61571014", "0.61562264", "0.61551225", "0.61551225", "0.6152405", "0.6150513", "0.61483234", "0.61438787", "0.61234933", "0.61157113", "0.61157113", "0.6112664", "0.60968816", "0.6095037", "0.6089917", "0.60890925", "0.6086608", "0.6084934", "0.6078103", "0.6078103", "0.6062605", "0.6052804", "0.6036918", "0.6034766", "0.60335505", "0.60335505", "0.6032458", "0.60317844", "0.60317844", "0.60262555", "0.60185605", "0.60185605", "0.60147136", "0.60062736", "0.60009384", "0.59954447", "0.5995145", "0.5992712", "0.5990961", "0.5986163", "0.59816504", "0.5964204", "0.59623015", "0.5960907", "0.5951232", "0.59501165", "0.59497494", "0.5946575", "0.5939065", "0.59368783", "0.5932252", "0.59313315", "0.593012", "0.59286535", "0.5923291", "0.59175336", "0.5911257", "0.5911257", "0.5910154", "0.5908377", "0.590801" ]
0.87860894
0
Removes a regionWidgetId from the internal widget map
function removeWidgetFromMap(regionWidgetId) { delete widgetByIdMap[regionWidgetId]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove_widget(widget_id) {\n delete this.data[widget_id];\n }", "function removeWidget(widget) {\r\n storage.get(\"tiles\", function(storage_data) {\r\n var widgets = storage_data.tiles;\r\n\r\n delete widgets[widget];\r\n\r\n storage.set({\"tiles\": widgets})\r\n });\r\n}", "function deleteWidget(widgetId) {\n var widget = findWidgetById(widgetId);\n var index = widgets.indexOf(widget);\n widgets.splice(index, 1);\n }", "removeWidget(id, origin){\n let addOrPanelRemove;\n if (origin === 'Canvas'){\n addOrPanelRemove = this.state.canvasWidgets;\n }\n else {\n addOrPanelRemove = this.state.rightPanelWidgets;\n }\n const newState = addOrPanelRemove.filter( el => el.widgetId !== id );\n return newState;\n }", "removeWidget(id) {\n this.focus(() => {\n var {\n editorState,\n contentState\n } = this._getDraftData();\n\n var selection = DraftUtils.findPattern(contentState, widgetRegexForId(id)); //eslint-disable-line max-len\n\n var newDraftData = DraftUtils.deleteSelection({\n editorState,\n selection\n });\n\n this._handleChange({\n editorState: newDraftData.editorState\n });\n });\n }", "moveWidget (widgetId, location) {\n for (var r = 0; r < this.data.length; r++) {\n for (var w = 0; w < this.data[r].length; w++) {\n if (String(this.data[r][w].id) === String(widgetId)) {\n let widget = Object.assign({}, this.data[r][w])\n // Remove from data\n this.data[r].splice(w, 1)\n\n // Add to data\n this.addWidget(widget, location)\n\n this.clean()\n return\n }\n }\n }\n }", "function unregister(name) {\n var widgetId = nameIdMap[name];\n\n delete registry[widgetId];\n /* delete the entry from the registry */\n delete nameIdMap[name];\n /* delete the entry from the nameIdMap */\n delete returnObj[name];\n }", "function remover_circunferencia()\n{\n\tif(distanceWidget)\n\t{\n\t\tdistanceWidget.marker.setMap(null);\n\t\tdistanceWidget = null; \n\t}\n}", "_onWidgetRemoved(sender, widget) {\n if (widget === this._lastCurrent) {\n this._lastCurrent = null;\n }\n ArrayExt.removeAt(this._items, this._findWidgetIndex(widget));\n this._sideBar.removeTab(widget.title);\n this._refreshVisibility();\n }", "function deleteWidget(widgetId) {\n return Widget.remove({_id: widgetId});\n }", "_removeWidget( widgetKey ) {\n const { firebaseUrl , boardKey } = this.authStoreState.appConfig;\n let widgetBase = new Firebase( `${firebaseUrl}/widgets/${boardKey}/${widgetKey}` );\n widgetBase.remove();\n widgetBase.off();\n NotificationActions.pushNotif({\n type : 'success',\n message : 'widgetRemoved'\n });\n }", "removeSlot() {\n this.closet.removeSlot();\n this.updateClosetGV();\n }", "function onShapeRemove(areaId/*:String*/)/*:void*/ {\n var struct/*:Bean*/ = this.getModifiableStruct();\n var imageMapList/*:Array*/ = struct.get(com.coremedia.cms.studio.im.ImageMapEditorConstants.IMAGEMAP_STRUCT_NAME);\n\n var removed/*:Boolean*/ = imageMapList.every(function (area/*:Bean*/, index/*:Number*/)/*:Boolean*/ {\n if (area.get(com.coremedia.cms.studio.im.ImageMapEditorConstants.AREA_ID) === areaId) {\n struct.removeAt(com.coremedia.cms.studio.im.ImageMapEditorConstants.IMAGEMAP_STRUCT_NAME, index);\n return false;\n }\n return true;\n });\n if (!removed && joo.debug) {\n AS3.trace(\"[WARN] area \", areaId, \"was not found in\", struct.toObject());\n }\n\n this.getSelectedAreaExpression().setValue(null);\n }", "function removeMapImage() {\n $(\".story-container-item--active .image-map\").remove();\n $(\"#map-caption\").remove();\n}", "remove() {\n this.setMap(null);\n }", "removeLayer() {\n if (this.__shown) {\n const map = this.map;\n map.removeLayer(this.uniqueId);\n map.removeLayer(this.uniqueId + 'label');\n map.removeLayer(this.uniqueId + 'citylabel');\n map.removeLayer(this.uniqueId + 'citylabelun');\n this.__shown = false;\n }\n }", "cleanWidget (widget) {\n if (!widget.id) { widget.id = Math.floor(Math.random() * 1000000) }\n }", "function removeWidget(){\n\tfrmAnimation.hboxContainer.setVisibility(false, animationConfigDisable);\n}", "removeAriaLiveRegion() {\n if (this._ariaLiveRegion) {\n var context = this.getCtx();\n context.getContainer().removeChild(this._ariaLiveRegion);\n this._ariaLiveRegion = null;\n }\n }", "_removeMap(map) {\n const index = this._selectedMaps.indexOf(map);\n\n if (index > -1) {\n this._selectedMaps.splice(index, 1);\n }\n\n this._eventBus.trigger(EVENT.TOGGLE_VIDEO_MAP, this._selectedMaps);\n }", "removeBlock(editorState, key) {\n const currentContent = editorState.getCurrentContent();\n const blockMap = currentContent.getBlockMap().remove(key);\n\n return EditorState.set(editorState, {\n currentContent: currentContent.merge({\n blockMap: blockMap,\n }),\n });\n }", "function removePanel(container, region, state) {\n if (!state) state = $.data(container, 'layout');\n var panels = state.panels;\n if (panels[region].length) {\n panels[region].panel('destroy');\n panels[region] = $();\n var expandP = 'expand' + region.substring(0, 1).toUpperCase() + region.substring(1);\n if (panels[expandP]) {\n panels[expandP].panel('destroy');\n panels[expandP] = undefined;\n }\n }\n }", "function removeLayerParamElement(divNum) {\n var d = document.getElementById('mapParameters');\n var olddiv = document.getElementById(divNum);\n d.removeChild(olddiv);\n}", "function clearRegionTabBar() {\n $(jqId('region_tab_bar')).empty();\n}", "unregister(id) {\n const item = this._items.get(id);\n if (item != null) {\n item.template = null;\n item.inflate = null;\n item.defaulte = null;\n this._items.delete(id);\n }\n }", "function removeMapDiv() {\n\tmap = null;\n\t$('#map-canvas').remove();\n}", "function clear_rectangles(map_id, layer_id){\n for (i = 0; i < window[map_id + 'googleRectangles' + layer_id].length; i++){\n window[map_id + 'googleRectangles' + layer_id][i].setMap(null);\n }\n window[map_id + 'googleRectangles' + layer_id] = null;\n}", "function removeArea(areaId) {\n if ( areas[areaId] ) {\n areas[areaId].helper.remove();\n delete areas[areaId];\n }\n }", "onRegionDelete(deleted_region) {\n this.regions.splice(this.regions.indexOf(deleted_region), 1);\n }", "mapRemove() {\n\n\t\tthis.map.remove();\n\n\t}", "removeGeometryLayer() {\n this.map.removeLayer(this.geometryLayer);\n this.geometryLayer = null;\n }", "removeLayer() {\n if (this.__shown) {\n const map = this.map;\n map.removeLayer(this.uniqueId + 'fillpoly');\n this.__shown = false;\n }\n }", "update() {\n\t /**\n\t * It is somewhat complex to properly update, especially when the widget is currently\n\t * showing a list of geotrace/geoshape points. Hence we use the inefficient but robust\n\t * method to re-initialize instead.\n\t */\n\t const widget = this.element.parentElement.querySelector('.widget');\n\t if (widget) {\n\t widget.remove();\n\t this.loadMap = undefined;\n\t this.map = undefined;\n\t this.polyline = undefined;\n\t this.polygon = undefined;\n\t this._init();\n\t }\n\t }", "function removeMapIcons() {\n deleteMarkers();\n if ($('[name=direction]').val() == 'available') {\n directions1Display.setMap(null);\n directions1Display.setPanel(null);\n }\n}", "function removeLayerLimitParamElement(divNum) {\n var d = document.getElementById('mapLimitParameters');\n var olddiv = document.getElementById(divNum);\n d.removeChild(olddiv);\n}", "function DeleteMap() {\n document.body.removeChild(map);\n}", "function removeRegionFilter(region) {\n var match = matchVoiceToDataCase(data, columnIndex, region);\n activeSheet.applyFilterAsync(\n \"Region\",\n match,\n tableau.FilterUpdateType.REMOVE);\n }", "function removeGeolocButton() {\n var\n geo_button_container = document.querySelector('#address>li:first-child');\n\n if (geo_button_container !== null) {\n address_ul_elem.removeChild(geo_button_container);\n }\n }", "function removeClient(id) {\n if (clientWidgets[id])\n clientWidgets[id].destroy();\n delete clientWidgets[id];\n}", "function removeLoginW(){\n\t\t \tvar loginW = document.querySelector(\"#loginw\");\n\t\t \tif(loginW){\n\t\t \t\tdocument.querySelector(\"#map\").removeChild(loginW);\n\t\t \t}\n\t\t }", "function removePlace(lData) {\n// console.log(\"remove Place: \" + JSON.stringify(lData.title));\n lData.mapMarkerDetail.setMap(null);\n}", "function delWorkLocation() {\n if (polygonArray) map.remove(polygonArray);\n if (workMarker) map.remove(workMarker);\n polygonArray = [];\n}", "clearCell(cellElement) {\n if (cellElement.widgets) {\n cellElement.widgets.forEach((widget) => {\n // destroy widget and remove reference to it\n delete this.widgetMap[widget.id];\n widget.destroy();\n });\n cellElement.widgets = null;\n }\n }", "function unregister(anchor) {\r\n\r\n if (typeof self.activeElements[anchor] != 'undefined') {\r\n\r\n //remove the element from the dom,\r\n self.activeElements[anchor].instance.$element.remove();\r\n\r\n //remove any extra markup that may have been inserted with this widget\r\n self.activeElements[anchor].instance.removeMarkup();\r\n\r\n //unbind the events created by this widget (i.e. resize events are bound to the window)\r\n self.activeElements[anchor].instance.destroy();\r\n\r\n //then delete it from the active elements array\r\n delete self.activeElements[anchor];\r\n }\r\n\r\n }", "function deleteRect (rectId) {\n $(\"#rect_\" + rectId).popover(\"destroy\");\n $(\"#rect_\" + rectId).remove();\n $(\"#lt_rect_\" + rectId).remove();\n $(\"#rt_rect_\" + rectId).remove();\n $(\"#title_text_\" + rectId).remove();\n $(\"#time_text_\" + rectId).remove();\n $(\"#collab_btn_\" + rectId).remove();\n $(\"#handoff_btn_\" + rectId).remove();\n\n var indexOfJSON = getEventJSONIndex(rectId);\n for (i = 1; i <= flashTeamsJSON[\"events\"][indexOfJSON].members.length; i++) {\n $(\"#event_\" + rectId + \"_eventMemLine_\" + i).remove();\n }\n //Remove from JSON\n flashTeamsJSON[\"events\"].splice(indexOfJSON, 1);\n}", "function updateWidget(widgetId, widget) {\n var oldWidget = findWidgetById(widgetId);\n var index = widgets.indexOf(oldWidget);\n widget._id = oldWidget._id;\n widget.pageId = oldWidget.pageId;\n widgets[index] = widget;\n }", "function clean(id) {\n if(typeof map.getLayer(id) !== 'undefined') {\n map.removeLayer(String(id));\n map.removeSource(String(id));\n }\n}", "removeItem(x,y) { this.getCell(x,y)._mapItem = null; }", "function remove()\n{\n clearTimeout(window.updateTimer);\n widget.setPreferenceForKey(null, dashcode.createInstancePreferenceKey(\"gamertag\"));\n}", "function eraseWidget () {\n document.getElementById('city').innerHTML = \"\"\n document.getElementById('temp').innerHTML = \"\"\n document.getElementById('forecast').innerHTML = \"\"\n document.getElementById('icon').src = \"\"\n document.getElementById('time').innerHTML = \"\"\n document.getElementById('date').innerHTML = \"\"\n}", "function mapWidgetResetMap() {\n\n mapWidgetClearMap();\n\n // Reset map center and zoom\n map.setCenter(new google.maps.LatLng(39.5, -100.35));\n map.setZoom(4);\n\n // Selection button\n $(\"#selection-button\").trigger(\"click\");\n $(\"#state-button\").trigger(\"click\");\n rectangleManager.setMap(map);\n rectangleManager.setDrawingMode(google.maps.drawing.OverlayType.RECTANGLE);\n}", "function pullWidget(pageId, widgetId) {\n return Page.update(\n { _id: pageId },\n { $pullAll:\n {\n widgets: [widgetId]\n }\n }\n );\n }", "function remMapLayer(layer) {\r\n if (map.getLayer(layer)) {\r\n map.removeLayer(layer);\r\n }\r\n if (map.getSource(layer)) {\r\n map.removeSource(layer);\r\n }\r\n}", "function deleteBookInfo() {\n var div = document.getElementById('arqsiWidget');\n var oldDiv = document.getElementById(\"arqsiWidgetBookInfo_div\");\n if (oldDiv) div.removeChild(oldDiv);\n}", "function stopEdits(){\r\n map.removeControl(drawControl);\r\n controlOnMap = false;\r\n}", "function removeStaticMap() {\n\t$('#map').prepend('<div id=\"jsMap\"></div>');\n\t$('#staticMap').remove();\n}", "removeBand( id ){\n this.bands = this.bands.filter( band => band.id !== id )\n }", "function removeMarker(id) {\r\n console.log(gmarkers);\r\n try {\r\n gmarkers[id].setMap(null);\r\n $.post(\"/lock_mngr\", {cmd: 'remove', cell_id: id, csrfmiddlewaretoken: token});\r\n delete gmarkers[id];\r\n var dom_elem = document.getElementById(id);\r\n document.getElementById('parent').removeChild(dom_elem);\r\n }\r\n catch (err) {\r\n alert(\"Nešto se iskundačilo !\" + \"\\n\" + \"pogledaj konzolu\");\r\n console.log(err);\r\n }\r\n console.log(gmarkers)\r\n}", "function editorDestroyTile(map, px, py) {\n var list = edTiles[px + py*map.x]; // list of list\n list.forEach(s => s.destroy());\n list.splice(0, list.length);\n}", "function deleteCarOverlay() {\n if (carMarker) {\n carMarker.setMap(null);\n }\n }", "unbindDomElement(_elemId) {\n const _indexOfElementId = this._domElementBindings.indexOf(_elemId);\n if (_indexOfElementId !== -1) {\n ELEM.del(_elemId);\n this._domElementBindings.splice(_indexOfElementId, 1);\n }\n }", "function removeWidgetFromColumn($scope, column, evt){\n // remove old item and apply to scope\n $scope.$apply(function(){\n column.widgets.splice(evt.oldIndex, 1);\n $rootScope.$broadcast('adfWidgetRemovedFromColumn');\n });\n }", "function rm(obj) {\n // Google maps element\n if (isFunction(obj.setMap)) {\n obj.setMap(null);\n }\n // jQuery\n if (isFunction(obj.remove)) {\n obj.remove();\n }\n // internal (cluster)\n if (isFunction(obj.free)) {\n obj.free();\n }\n obj = null;\n }", "function rm(obj) {\n // Google maps element\n if (isFunction(obj.setMap)) {\n obj.setMap(null);\n }\n // jQuery\n if (isFunction(obj.remove)) {\n obj.remove();\n }\n // internal (cluster)\n if (isFunction(obj.free)) {\n obj.free();\n }\n obj = null;\n }", "function rm(obj) {\n // Google maps element\n if (isFunction(obj.setMap)) {\n obj.setMap(null);\n }\n // jQuery\n if (isFunction(obj.remove)) {\n obj.remove();\n }\n // internal (cluster)\n if (isFunction(obj.free)) {\n obj.free();\n }\n obj = null;\n }", "function hideWidget() {\n widgets.forEach((widget) => {\n $(widget).css(\"z-index\", \"0\");\n $(widget).hide();\n $(widget).removeClass(\"active\");\n });\n}", "function purge() {\n //Replace current map container (\"map\") with an empty one. Else Leaflet error \"container already initialized\", when 2nd map is loaded.\n var newdiv = document.createElement(\"div\");\n newdiv.setAttribute(\"id\", \"map\");\n var oldDiv = document.getElementById(\"map\");\n var parent = document.getElementById(\"content\");\n parent.replaceChild(newdiv,oldDiv);\n //Purge the content of map div element.\n document.getElementById(\"map\").innerHTML=\"\";\n //Reset Wikidata ID's array\n createWikidataIds();\n //Empty output textareabox\n document.getElementById(\"textareabox\").innerHTML=\"\";\n}", "function removeTileFromShape_old(tileId, shapeId) {\n shapeIndex[shapeId] = shapeIndex[shapeId].filter(function(tileId2) {\n return tileId2 != tileId;\n });\n if (shapeIndex[shapeId].length > 0 === false) {\n // TODO: make sure to test the case where a shape becomes empty\n // error(\"empty shape\")\n }\n }", "function onRemovePlotFrame() {\n if (polygonGraphic != null) {\n removeDatashopPolygon(polygonGraphic);\n if (map.graphics.graphics.length > 0) {\n var polygonCount = 0;\n for (var i = 0; i < map.graphics.graphics.length; i++) {\n if (map.graphics.graphics[i].geometry instanceof DatashopPolygon) {\n polygonGraphic = map.graphics.graphics[i];\n polygonCenter = polygonGraphic.geometry.getCenterPoint();\n setActiveSymbology(polygonGraphic);\n polygonCount++;\n break;\n }\n }\n if (polygonCount == 1) {\n getPlotTemplateComboBox().disabled = false;\n getScaleComboBox().disabled = false;\n polygonAngle = polygonGraphic.geometry.rotationInDegrees;\n }\n recalcFrameNumbers();\n } else {\n clearPlots();\n onPan();\n }\n }\n isMaxPolygon = false;\n updatePlotFrameButtons();\n}", "function removeCurrentBasemap() {\n Object.keys(CONFIG.basemaps).forEach(function(basemap) {\n CONFIG.map.removeLayer(CONFIG.basemaps[basemap]);\n CONFIG.map.removeLayer(CONFIG.basemaps.labels);\n });\n}", "remove(map, {srcId, layerId}) {\n map.removeSource(srcId);\n map.removeLayer(layerId);\n }", "destroy() {\n this.region.remove();\n this.stopListening();\n }", "destroy() {\n this.region.remove();\n this.stopListening();\n }", "function deleteWidget(widgetId){\n var result = $http.delete(\"/api/widget/\"+widgetId);\n return result;\n }", "function remove()\n{\n // Stop any timers to prevent CPU usage\n // Remove any preferences as needed\n // widget.setPreferenceForKey(null, createInstancePreferenceKey(\"your-key\"));\n}", "function destroy() {\n\t\t\t\tdocument.removeEventListener(eventType.WIDGET_DEFINED, defineWidget, true);\n\t\t\t\tdocument.removeEventListener(eventType.DESTROY, destroy, false);\n\t\t\t}", "function removeLineKey(line_id) {\n $('#key-'+line_id).remove();\n }", "function releaseMiniMap() {\n\t\tif (document.getElementById(MINIMAP) != null) {\n\t\t\tdocument.body.removeChild(document.getElementById(MINIMAP));\n\t\t}\n\t}", "function delRentLocation(argument) {\n\tif (rentMarkerArray) map.remove(rentMarkerArray);\n rentMarkerArray = [];\n}", "function byId(widgetId) {\n return registry[widgetId];\n }", "function removeMapLine(line) {\n mymap.removeLayer(line);\n}", "function deletetZone (scenarioName) {\n viewer.entities.removeById(scenarioName);\n}", "function removeSpan(id) {\n for( var i=0; i<spans.length; i++){ \n if ( spans[i].id === id) { spans.splice(i,1); }\n }\n}", "function removeMapping(state) {\n modalMap[state] = null;\n promiseMap[state] = null;\n }", "destroy() {\n this.hot.columnIndexMapper.unregisterMap(this.mapName);\n this.sortingStates = null;\n }", "removeSpinner() {\n u.removeSpinner(SPINNER_ID);\n }", "clearActiveRegion() {\n if (this.activeRegion) {\n this.activeRegion.classList.remove(A11yClassNames.ACTIVE);\n this.activeRegion.dispatchEvent(new Event(A11yCustomEventTypes.DEACTIVATE));\n this.activeRegion.removeEventListener(A11yCustomEventTypes.UPDATE, this.handleActiveRegionUpdate);\n this.activeRegion = null;\n }\n this.clearActiveSection();\n }", "_removeTile(key) {\n const tile = this._tiles[key]\n if (!tile) {\n return\n }\n\n const clusters = this._tileClusters[key]\n\n if (clusters) {\n clusters.forEach(layer => this._clusters.removeLayer(layer))\n }\n\n delete this._tiles[key]\n\n this.fire('tileunload', {\n tileId: key,\n coords: this._keyToTileCoords(key),\n })\n }", "function deactivate() {\n populationApp.toolbar.deactivate();\n clearMap();\n }", "function removeSpinner (ev, id) {\n if (!id) return;\n var newid = id.charAt(0) == '#' ? id : ('#'+id);\n angular\n .element(newid)\n .removeClass(whirlClass);\n }", "function removeSpinner (ev, id) {\n if (!id) return;\n var newid = id.charAt(0) == '#' ? id : ('#'+id);\n angular\n .element(newid)\n .removeClass(whirlClass);\n }", "function replaceRegion(regionId) {\r\n let regionBtn = document.getElementById(\"regionBtn\");\r\n let region = document.getElementById(regionId).textContent;\r\n regionBtn.textContent = region;\r\n regionBtn.setAttribute(\"value\", regionId);\r\n /*After clicking on a Region hide the dropdown*/\r\n document.getElementById(\"dropdownCont\").style.visibility = \"hidden\";\r\n}", "removeRegionsInArea(area) {\n area.normalize();\n // this is temporary solution. There will be previews\n for (var i = this.imageInfo.regions.length - 1; i >= 0; i--) {\n var region = this.imageInfo.regions[i];\n if (region.source === RegionInfoSourceEnum.MANUAL) {\n var intersected = region.checkIntersectionRegion(this.selectionRegionInfo);\n if (intersected) {\n this.imageInfo.regions.splice(i, 1);\n }\n }\n }\n }", "function onWidgetDelete(widget) {\n let description = widget.displayName;\n if (description === undefined || description == '')\n description = Array.isArray(widget.series)\n ? widget.series.join(', ')\n : widget.series;\n showModalDialog(createYesNoModualDialog({ \n dangerzone: true,\n title: 'Remove Widget?',\n question: `Do you really want to remove the widget with metric series <em>${description}</em> from the page?`,\n yes: 'Remove', \n no: 'Cancel', \n onYes: () => {\n onPageChange(MonitoringConsole.Model.Page.Widgets.remove(widget.id));\n showFeedback({ type: 'success', message: `Widget ${description} removed.`});\n }\n }));\n }", "function hideOppSearchedArea() {\n if (window.mapImg) {\n searchGrid.restoreImageData(0, mapImg, 0, 0);\n window.mapImg = null;\n }\n}", "function hideWidget(widgetName) {\r\n if (dojo.byId(widgetName)) {\r\n dojo.style(dijit.byId(widgetName).domNode, {\r\n display : 'none'\r\n });\r\n }\r\n}", "function removeLayer() {\n map.removeLayer(tcLayer);\n}", "function RemoveSpend(id){\n\n if (spendArray.length > 0){\n\n for (var el in spendArray){\n if (spendArray[el].id == id){\n \n spendArray.splice(el, 1);\n break;\n }\n }\n \n const elementToRemove = document.getElementById(id);\n gsap.to(elementToRemove, {duration: 0.5, opacity: 0, x: 40, clearProps: 'all'})\n setTimeout(() => {\n elementToRemove.parentNode.removeChild(elementToRemove); //removes the element\n UpdateCharts(); //update chart\n }, 500);\n \n }\n}", "function eraseMapLabel(label){\n\t\t\t\t\t\n\t\t\t\tif((label === undefined) || (labelMap[label] === undefined)){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tvar labelObj = labelMap[label];\t\t\t\t\n\t\t\t\tpushCanvasStack();\n\t\t\t\t\n\t\t\t\tindContext.clearRect(0, 0, indCanvas.width, indCanvas.height);\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t/*\tif (labelObj.coords === undefined){\n\t\t\t\t\treturn;\n\t\t\t\t}*/\n\t\t\t\tlabelObj.coords = undefined;\n\t\t\t\t//repaint all but removed label\n\t\t\t\trepaintAllLabels();\n\t\t\t\t\n\t\t\t\t//restoreLabelState(label);\t\n\t\t\t}", "function DeleteField() {\n myInfoWindow.close();\n myField.setMap(null);\n ShowDrawingTools(true);\n}" ]
[ "0.7151344", "0.6785963", "0.6577708", "0.6394485", "0.6382265", "0.6328557", "0.62226796", "0.6040211", "0.5929866", "0.5923567", "0.5807613", "0.5766515", "0.5722185", "0.57135826", "0.5709486", "0.56413305", "0.5630386", "0.5606092", "0.5505306", "0.5474496", "0.5463774", "0.5407469", "0.54023176", "0.53869", "0.53850687", "0.5381213", "0.53792983", "0.535291", "0.53501976", "0.5343895", "0.53437924", "0.5341464", "0.53275114", "0.5296435", "0.52851295", "0.52795756", "0.5261137", "0.52362496", "0.5230179", "0.52091104", "0.5207902", "0.5202136", "0.5200059", "0.51944387", "0.5181711", "0.5178155", "0.5170759", "0.51687914", "0.5158946", "0.5154972", "0.5122018", "0.51136786", "0.50905406", "0.50898254", "0.50859207", "0.5084813", "0.5084496", "0.50761646", "0.5070568", "0.506854", "0.5060802", "0.50542814", "0.5041117", "0.5041117", "0.5041117", "0.5035492", "0.50299877", "0.5028047", "0.5020704", "0.5017703", "0.50123745", "0.50036466", "0.50036466", "0.50004166", "0.4998023", "0.49966058", "0.49950692", "0.49916267", "0.49882486", "0.4988149", "0.49858466", "0.4983525", "0.49820682", "0.49813604", "0.4976242", "0.49707547", "0.49616235", "0.49580994", "0.49578646", "0.49537927", "0.49537927", "0.49526647", "0.4952621", "0.49519226", "0.49448764", "0.49438834", "0.4934894", "0.4934167", "0.4933005", "0.49259531" ]
0.8964363
0
Logs to a console object if it exists
function log(message) { if (typeof console != "undefined" && console.log) { console.log(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ovverideConsole() {\n console.log = (message, args = []) => {\n const pattern = /^\\[bot\\.(info|error|plugin)\\](.*)/;\n const matches = message.match(pattern);\n\n if (!matches) {\n logger.log(message, ...args);\n return;\n }\n\n if (matches.length > 1) {\n const method = matches[1];\n const textMessage = matches[2]\n if (typeof logger[method] === 'function') {\n logger[method](textMessage, ...args);\n }\n }\n }\n}", "function consoleLog() {\n if (typeof(console) == 'object' && typeof(console[\"log\"]) != \"undefined\") {\n console.log.apply(console, arguments);\n }\n}", "function consoleLog(msg) {\n if (typeof console.log != \"undefined\") {\n console.log(newclass + \": \" + msg);\n }\n}", "function log () {\n if (shouldLog) {\n console.log.apply(this, arguments)\n }\n}", "function log() {\n var _console;\n\n if (undefined) (_console = console).log.apply(_console, arguments);\n}", "_log (str) {\n if (this.context.runnerOptions.stream) console.log(str)\n else this._logs.push(str)\n }", "function log() {\n if (window.console) console.log.apply(console,arguments);\n}", "function console_log(msg) {\n if (window.console) {\n console.log(msg);\n }\n }", "function log(message) {\n if (typeof console !== 'undefined' && typeof console.log === 'function') {\n console.log(message)\n }\n}", "function log(msg, useInBrowserLog){\n if(console) console.log(msg);\n}", "function log(){ // this hackery is required for IE8/9, where\n// the `console.log` function doesn't have 'apply'\nreturn 'object' === typeof console && console.log && Function.prototype.apply.call(console.log,console,arguments);}", "function log(msg) {\n if (window.console) {\n //console.log(msg);\n }\n}", "function logToConsole(obj){\n\tif (app.get('env') == \"development\"){\n\t\tconsole.log(colors.red(obj));\n\t}\t\n}", "consoleDevLog(...args) {\n if (this.logging) {\n console.log(...args);\n }\n }", "function logger(message) {\n\tif (window.console != null && typeof window.console != \"undefined\") {\n\t\tconsole.log(message);\n\t}\n}", "function safelog(str){return typeof(console)!=='undefined' && console.log && console.log(str);}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === (typeof console === 'undefined' ? 'undefined' : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);\n }", "set consoleLog(value) {\n this._consoleLog = Boolean(value);\n }", "function console_log(stringa){\n if (global_verbosity_argo > 0){\n console.log(stringa);\n }\n}", "function logger(textToPrint) {\n if (printLogs) {\n console.log(textToPrint);\n }\n}", "function log() {\n\t\t // this hackery is required for IE8/9, where\n\t\t // the `console.log` function doesn't have 'apply'\n\t\t return 'object' === typeof console\n\t\t && console.log\n\t\t && Function.prototype.apply.call(console.log, console, arguments);\n\t\t}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console &&\n console.log &&\n Function.prototype.apply.call(console.log, console, arguments);\n }", "function log() { console.log.apply(console, arguments); }", "function log() { console.log.apply(console, arguments); }", "function log(){// this hackery is required for IE8/9, where\n// the `console.log` function doesn't have 'apply'\nreturn'object'===(typeof console==='undefined'?'undefined':(0,_typeof3.default)(console))&&console.log&&Function.prototype.apply.call(console.log,console,arguments);}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console &&\n console.log &&\n Function.prototype.apply.call(console.log, console, arguments);\n}", "static log(...args) {\n if (this.toLog('LOG')) {\n console.log.apply(console, arguments);\n }\n }", "function log(message) {\n if(typeof window.console !== 'undefined') {\n console.log(message);\n }\n }", "function writeToConsole (text) {\n\t\tif (typeof console !== 'undefined') {\n\t\t\tconsole.log(text); \n\t\t} else {\n\t\t\talert(text); \n\t\t}\n\t}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === (typeof console === 'undefined' ? 'undefined' : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === (typeof console === 'undefined' ? 'undefined' : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === (typeof console === 'undefined' ? 'undefined' : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === (typeof console === 'undefined' ? 'undefined' : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === (typeof console === 'undefined' ? 'undefined' : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n var _console; // This hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n\n\n return (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);\n }", "function log() {\n var _console; // This hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n\n\n return (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);\n }", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === (typeof console === \"undefined\" ? \"undefined\" : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}", "function log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}" ]
[ "0.7528249", "0.73931277", "0.719233", "0.7014647", "0.6815774", "0.676632", "0.6712763", "0.6712387", "0.6710047", "0.668018", "0.6677263", "0.6676313", "0.66670454", "0.66303664", "0.6629112", "0.6618885", "0.66159666", "0.66011435", "0.6598733", "0.65965366", "0.65939385", "0.658567", "0.6574271", "0.6574271", "0.65588486", "0.6551132", "0.65394115", "0.65315515", "0.65245247", "0.65203476", "0.65203476", "0.65203476", "0.65203476", "0.65203476", "0.65183216", "0.65183216", "0.65181446", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.6516985", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455", "0.65135455" ]
0.6602824
17
Hiermee doe ik de menu knop open en dicht
function myFunction() { document.getElementById("myDropdown").classList.toggle("show"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openMenu() {\n g_IsMenuOpen = true;\n}", "function openMenu() {\n vm.showMenu=!vm.showMenu;\n }", "function onOpen() {\n createMenu();\n}", "function openMenuBar() {\n setOpen(!open)\n }", "function handleOpenMenu() {\n setOpenMenu(!openMenu);\n }", "function manageMenu() {\n if (menuOpen) {\n menuOpen = false;\n closeMenu();\n } else {\n menuOpen = true;\n openMenu();\n }\n}", "function onOpen() { CUSTOM_MENU.add(); }", "function onOpen() {\n setDefaults();\n loadMenu(userProp.getProperty(g_debug_key));\n}", "function doOpen(e) {\n $.win.invalidateOptionsMenu();\n}", "function loadMenu(){\n\t\tpgame.state.start('menu');\n\t}", "function __m_realokacija_menuOpenera(){\n\t\tvar centriranje = ($(window).height()/2)-($('#__m_openner').height())\n\t\t$('#__m_openner').css({'left':'40px', 'top':centriranje+'px'});\n\t\t$('#__m_opener_c').text(__m_opener_open);\n\t}", "function menuOptions() {}", "function setMenu() {\n //添加快捷键\n\tlet applicationOptions = [\n\t\t{ label: \"About Kungfu\", click: showKungfuInfo},\n\t\t{ label: \"Settings\", accelerator: \"CmdOrCtrl+,\", click: openSettingDialog },\n\t\t{ label: \"Close\", accelerator: \"CmdOrCtrl+W\", click: function() { console.log(BrowserWindow.getFocusedWindow().close()); }}\n\t]\n\n\tif(platform === 'mac') {\n\t\tapplicationOptions.push(\n\t\t\t{ label: \"Quit\", accelerator: \"Command+Q\", click: function() { app.quit(); }},\n\t\t)\n\t}\n\n\tconst template = [\n\t{\n\t\tlabel: \"Kungfu\",\n\t\tsubmenu: applicationOptions\n\t}, \n\t{\n\t\tlabel: \"Edit\",\n\t\tsubmenu: [\n\t\t\t{ label: \"Copy\", accelerator: \"CmdOrCtrl+C\", selector: \"copy:\" },\n\t\t\t{ label: \"Paste\", accelerator: \"CmdOrCtrl+V\", selector: \"paste:\" },\n\t\t]\n\t}];\n\t\n\tMenu.setApplicationMenu(Menu.buildFromTemplate(template))\n}", "function openMenu () {\n $(this).toggleClass('open');\n $('ul, .social-links').toggleClass('active open');\n }", "function openExcursionsMenu($event) {\n ActivityTracker(EventLogFactory.action.excursionsList.contextMenu());\n list.excursionMenu.show($event);\n }", "function openMenu() {\n if (menu_visible)\n return;\n menuGroup.add(mesh_menu);\n mesh_menu.position.set(mouse_positions[1].x, mouse_positions[1].y, mouse_positions[1].z);\n mesh_menu.lookAt(camera.position);\n menu_visible = true;\n }", "expandMenu() {\r\n\t}", "function simulat_menu_infos() {\n display_menu_infos();\n}", "function menuhrres() {\r\n\r\n}", "function menuShow() {\n ui.appbarElement.addClass('open');\n ui.mainMenuContainer.addClass('open');\n ui.darkbgElement.addClass('open');\n}", "function selectMenu() {\n\tif (menuActive()) { //Si on est dans le menu, on lance la fonction appropriée\n\t\tvar fn = window[$(\".menu_item_selected\").attr(\"action\")];\n\t\tif(typeof fn === 'function') {\n\t\t\tfn();\n\t\t}\n\t} else if (delAllActive()) { //Si on est dans la validation du delete\n\t\tdelAll();\n\t}\n}", "function loadMenu() {\n // Works only with nav-links that have 'render' instead of 'component' below in return\n if (istrue) {\n // Do not show these buttons to unauthorise user\n document.getElementById(\"edit\").children[6].style.display = \"none\";\n document.getElementById(\"edit\").children[5].style.display = \"none\";\n document.getElementById(\"edit\").children[4].style.display = \"none\";\n document.getElementById(\"edit\").children[3].style.display = \"none\";\n }\n }", "function menuOpen(ev) {\n switch(ev.target.id) {\n case \"class-btn\":\n closeMenus(); \n document.getElementById(\"class-menu\").style.display = \"block\";\n break;\n case \"prof-btn\":\n closeMenus(); \n document.getElementById(\"prof-menu\").style.display = \"block\";\n break;\n case \"choose-schedule-btn\":\n closeMenus(); \n document.getElementById(\"choose-schedule-menu\").style.display = \"block\";\n break;\n case \"add-class-btn\":\n if(!_schedule) {\n window.alert(\"Choose a schedule to add classes.\");\n return;\n }\n \n\t _popUpCount++;\n \n\t if(_addedTimes) resetTimeArea(\"class\");\n document.getElementById(\"add-class\").style.display = \"block\";\n break;\n case \"add-prof-alt\":\n document.getElementById(\"add-class\").className += \" blur-on\";\n case \"add-prof-btn\":\n if(!_schedule) {\n window.alert(\"Choose a schedule to add professors.\");\n return;\n }\n\t \n\t _popUpCount++;\n \n\t if(_addedTimes) resetTimeArea(\"prof\");\n document.getElementById(\"add-prof\").style.display = \"block\";\n break;\n case \"add-schedule-btn\":\n _popUpCount++;\n document.getElementById(\"add-schedule\").style.display = \"block\";\n break;\n }\n }", "function OnClicked(param: String)\r\t{\r\t\tif (!ShowMenu(param, true))\r\t\t{\r\t\t\tgameObject.SendMessage(param, SendMessageOptions.DontRequireReceiver);\r\t\t\tShowMenu(\"\", false);\r\t\t\tActivateMenu(false);\r\t\t}\r\t}", "function openMenu() {\n\n\t\t$(\"#menu-items\").css(\"display\",\"block\");\n \n $(\"#app-canvas\").velocity({\n\t\t\tleft:\"85%\",\n }, {\n duration: 300,\n complete: function() {\n\t\t\t\tsetTimeout(function(){\n isMenuOpen=true;\n },150);\n\t\t\t}\n }); \n }", "function basicMenu() {\nif (advancedMenuIsOpen)\n{closeAdvancedMenu()}\nelse {\n if (basicMenuIsOpen) {\n closeBasicMenu();\n } else {\n openBasicMenu();\n }\n}\n}", "function menuLateralDireito()\n {\n $('#optionPlus').toggle();//exibe o menu lateral direito se estiver oculto\n\n }", "function togglemenu(){\n this.isopen = !this.isopen;\n }", "function menu_open(){\r\n document.getElementById(\"menupage\").style.display = \"inline-block\";\r\n document.getElementById(\"close_menu\").style.display = \"inline-block\";\r\n document.getElementById(\"menu\").style.display = \"none\";\r\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(\"<h1 id='title' style='position:relative;top:20px;left:-40px;width:500px;'>Sheep's Snake</h1><p style='position:absolute;top:250px;left:-50px;font-size:1.1em;' id='playA'>Press A to play!</p><p style='position:absolute;top:280px;left:-50px;font-size:1.1em;' id='playB'>Press B for some help !</p>\");\r\n\t\t\t\t\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "function myFunction(){\r\n if(location.href === \"http://localhost/thefabexperience/index.html#!/menu\"){\r\n document.getElementById(\"defaultOpen\").click();\r\n if(w >= 775 && w <= 1104 ){\r\n console.log(\"we\");\r\n menuElements(document.querySelector('body'), document.querySelector('header'), document.querySelector('main'));\r\n }\r\n }\r\n}", "function tl_start() {\n $('#futureman_face, #menu-open').css('display', 'inherit');\n $('.menu-open').css('visibility', 'inherit');\n }", "function menuOpen(){\n $html.classList.remove(\"menu-close\");\n $html.classList.add(\"menu-open\");\n // $body.classList.remove(\"scroll\");\n\n // $('body').on('scroll mousewheel touchmove', function(e) {\n // e.preventDefault();\n // e.stopPropagation();\n // return false;\n // });\n\n }", "function onOpen() {\n ui.createMenu('Daily Delivery Automation')\n .addItem('Run', 'confirmStart').addToUi();\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 testMenuPostion( menu ){\n \n }", "function openMenuItemsOnLoad()\r\n{\r\n\tfindCookieRoot();\r\n\tvar openMenuItemIds = get_cookie('openMenuItemIds');\r\n\tif (openMenuItemIds) \r\n\t{\r\n\t\tvar itemForOpenArr = openMenuItemIds.split(\";\");\r\n\t\tfor (var i = 0; i < itemForOpenArr.length; i++) \r\n\t\t{\r\n\t\t\tvar itemId = itemForOpenArr[i];\r\n\t\t\t// show sometimes conficts with slideDown in Vmenu2()\r\n\t\t\t$(\"#\"+itemId).slideDown(1);\r\n\t\t\tvar par = $(\"#\"+itemId).parent();\r\n\t\t\tvar parc = $('a.current').parent();\r\n\t\t\tif($('a.current',par).length && $(par).attr('id')!=$(parc).attr('id'))\r\n\t\t\t\t$(par).find('a:first').css('color',window.colorlink);\r\n\t\t\t$(par).find('img:first').attr(\"src\", \"include/img/minus.gif\");\t\t\r\n\t\t}\r\n\t}\r\n\ttoggleExpandCollapse();\r\n}", "function handleMenuClick(event) {\n setMenuOpen(event.currentTarget);\n }", "function onProductionButton( event ) {\r\n\topenWindowMenu(2);\r\n}", "function openMobileMenu() {\n\t\tsetClick(!click);\n\t}", "openMenu() {\n this._itemContainer.visible = true;\n this.accessible.expanded = true;\n this._label.accessible.expanded = true;\n }", "function openMenu(menu_item){\n\t\t\t\n\t\t\t// Get menu box\n\t\t\tvar menu_box = menu_item.find('> ul, > div').stop(true, true);\n\t\t\t\n\t\t\t// This will make the selected menu always on top of the\n\t\t\t// non selected menu\n\t\t\t$(menu_item).parent()\n\t\t\t\t\t\t.find(\"ul, div\")\n\t\t\t\t\t\t.css(\"z-index\", settings.zindex);\n\t\t\tmenu_box.css(\"z-index\", (settings.zindex+1));\n\n\t\t\t// If animation is function\n\t\t\tif(typeof settings.openAnimation == 'function'){\n\t\t\t\t$(menu_item).addClass(settings.openMenuClass)\n\t\t\t\tsettings.openAnimation.call(menu_box);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif(!$(menu_item).is('.' + settings.openMenuClass)){\n\t\t\t\t switch(settings.openAnimation){\n\t\t\t\t\t case 'fade':\n\t\t\t\t\t\t fadeAnimation(menu_box, true);\n\t\t\t\t\t\t break;\n\t\t\t\t\t case 'size':\n\t\t\t\t\t\t sizeAnimation(menu_box, true);\n\t\t\t\t\t\t break;\t\n\t\t\t\t\t default:\n\t\t\t\t\t\t slideAnimation(menu_box, true);\n\t\t\t\t\t\t break;\n\t\t\t\t }\n\t\t\t}\n\t\t\t\t\n\t\t}", "function addMenu(){\n var appMenu = new gui.Menu({ type: 'menubar' });\n if(os.platform() != 'darwin') {\n // Main Menu Item 1.\n item = new gui.MenuItem({ label: \"Options\" });\n var submenu = new gui.Menu();\n // Submenu Items.\n submenu.append(new gui.MenuItem({ label: 'Preferences', click :\n function(){\n // Add preferences options.\n // Edit Userdata and Miscellaneous (Blocking to be included).\n\n var mainWin = gui.Window.get();\n\n\n var preferWin = gui.Window.open('./preferences.html',{\n position: 'center',\n width:901,\n height:400,\n focus:true\n });\n mainWin.blur();\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'User Log Data', click :\n function(){\n var mainWin = gui.Window.get();\n\n var logWin = gui.Window.open('./userlogdata.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus:true\n });\n }\n }));\n\n submenu.append(new gui.MenuItem({ label: 'Exit', click :\n function(){\n gui.App.quit();\n }\n }));\n\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 2.\n item = new gui.MenuItem({ label: \"Transfers\"});\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'File Transfer', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./filetransfer.html',{\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n\n // Main Menu Item 3.\n item = new gui.MenuItem({ label: \"Help\" });\n var submenu = new gui.Menu();\n // Submenu 1.\n submenu.append(new gui.MenuItem({ label: 'About', click :\n function(){\n var mainWin = gui.Window.get();\n var aboutWin = gui.Window.open('./about.html', {\n position: 'center',\n width:901,\n height:400,\n toolbar: false,\n focus: true\n });\n mainWin.blur();\n }\n }));\n item.submenu = submenu;\n appMenu.append(item);\n gui.Window.get().menu = appMenu;\n }\n else {\n // menu for mac.\n }\n\n}", "function OpenSideMenu() {\n if ($(\"body\").hasClass(\"mode-translation\")) {\n ToggleSideMenu(true);\n }\n}", "function MenuOpen(){\r\n \t$(menu).offset({left:rawMouseX, top:rawMouseY});\r\n \tvar items = $('.circleNavi a');\r\n \tfor(var i = 0, l = items.length; i < l; i++) {\r\n \t\t$(items[i]).animate({\r\n \t\t\tleft:(-100*Math.cos(Math.PI + (1/(l-1))*i*(Math.PI))).toFixed(4) + \"px\",\r\n \t\t\ttop:(100*Math.sin(Math.PI + (1/(l-1))*i*(Math.PI))).toFixed(4) + \"px\"\r\n \t\t});\r\n \t}\r\n \t$(menu).addClass('open');\r\n }", "function DfoMenu(/**string*/ menu)\r\n{\r\n\tSeS(\"G_Menu\").DoMenu(menu);\r\n\tDfoWait();\r\n}", "function advancedMenu() {\n if (advancedMenuIsOpen) {\n closeAdvancedMenu();\n } else {\n openAdvancedMenu();\n }\n}", "function navigasjonsmeny() {\n $('.trestripeknapp').click(function() {\n menyFram();\n })\n}", "function salirMenu() {\n if(confirm(\"¿Esta seguro de que quiere salir al menu?\")) {\n for (var mini in Game.global.control){\n mini.haGanado=false\n }\n this.music.stop();\n if(this.cascada.isPlaying)\n this.cascada.stop();\n Game.state.start('Menu');\n }\n }", "function onOpen() {\n // Add a menu with some items, some separators, and a sub-menu.\n DocumentApp.getUi().createMenu('Utilities')\n .addItem('Insert Date', 'insertDateAtCursor')\n .addItem('Insert Time', 'insertTimeAtCursor')\n .addToUi();\n}", "menuButtonClicked() {}", "function printMenu() {\n console.log(\"\\n<====== PENDAFATARAN SISWA BARU ======>\");\n console.log(\"<====== SMKN 1 RPL ======>\");\n console.log(\"\\n<====== Menu ======>\");\n console.log(\"1. Registrasi\");\n console.log(\"2. Input Nilai\");\n console.log(\"3. Lihat Profil\");\n console.log(\"4. Informasi Kelulusan\");\n console.log(\"5. keluar\");\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}", "get menuOpen() {\n return this._menuOpen;\n }", "function openTopMenu() {\n $(\"#\"+current_menu+\">ul\").show();\n //alert (menuId);\n}", "function installMenu() {\n wkof.Menu.insert_script_link({\n name: script_name,\n submenu: \"Settings\",\n title: script_name,\n on_click: openSettings,\n });\n }", "openInstructions(args) {\n this.menu.openInstructions();\n this.instructionsOpenedEvent.publish();\n }", "function openMenu() {\n\n //Set the menu to be visible\n setVisibility(document.getElementById(\"menuPopup\"), true);\n\n $(\"#graphContextMenu\").hide();\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 closeMenu() {\n g_IsMenuOpen = false;\n}", "function openSideMenu($mdMenu, event) {\n $mdMenu.open(event);\n }", "function onOpen() {\n var ui = SpreadsheetApp.getUi();\n // Or DocumentApp or FormApp.\n ui.createMenu('🙂 Click me')\n .addItem('List of items with 🔎 search', 'showPage_')\n .addToUi();\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}", "function onFleetButton( event ) {\r\n\topenWindowMenu(3);\r\n}", "function Vmenu2()\r\n{\r\n\twindow.colorlink = $(\"a.tablelinkssearch\").css(\"color\");\r\n\t$('.Vmenu2 ul li a').hover(\r\n\tfunction()\r\n\t{\r\n\t\tif($(this).parent().attr('class')!='hr')\r\n\t\t\t$(this).addClass('menu_active');\r\n\t},\r\n\tfunction()\r\n\t{\r\n\t\tif($(this).parent().attr('class')!='hr')\r\n\t\t\t$(this).removeClass('menu_active'); \r\n\t}); \r\n\t$('.Vmenu2 ul li ul').hide();\r\n\t$('li[@view=topitem]:has(ul:has(a.current))').find('a:first').css('color',$(\"a.current\").css(\"color\"));\r\n\t$('.Vmenu2 ul li:has(ul) span').bind('click',function()\r\n\t{\r\n\t\tvar par = $(this).parent();\r\n\t\tvar parc = $('a.current').parent();\r\n\t\t$(par).find('ul:first').slideToggle(); \r\n\t\tif ($(this).find('img.pmimg').attr('src') == 'include/img/plus.gif') \r\n\t\t{\r\n\t\t\t// add to cookie opened menu\r\n\t\t\taddOpenMenuItemIdToCookie($(par).find('ul:first').attr(\"id\"));\r\n\t\t\t$(this).find('img.pmimg').attr('src', 'include/img/minus.gif');\r\n\t\t\tif($('a.current',par).length && $(par).attr('id')!=$(parc).attr('id'))\r\n\t\t\t\t$(par).find('a:first').css('color',window.colorlink);\r\n\t\t\t$(par).find('ul:has(a.current)').each(function(parc)\r\n\t\t\t{\r\n\t\t\t\t$(this).parent().find('img.pmimg:first').attr('src','include/img/minus.gif');\r\n\t\t\t\tif($('a.current',this).length && $(this).parent().attr('id')!=$(parc).attr('id'))\r\n\t\t\t\t\t$(this).parent().find('a:first').css('color',window.colorlink);\r\n\t\t\t\taddOpenMenuItemIdToCookie($(this).attr(\"id\"));\r\n\t\t\t\t$(this).slideDown();\r\n\t\t\t});\r\n\t\t}\r\n\t\telse{\r\n\t\t\t\t// remove from cookie opened menu\r\n\t\t\t\tremoveOpenMenuFromCookie($(par).find('ul:first').attr(\"id\"));\r\n\t\t\t\t// remove all children from cookie\r\n\t\t\t\t$(par).find('ul').each(function()\r\n\t\t\t\t{\r\n\t\t\t\t\tremoveOpenMenuFromCookie($(this).attr(\"id\"));\r\n\t\t\t\t});\r\n\t\t\t\t$(this).find('img.pmimg').attr('src', 'include/img/plus.gif');\r\n\t\t\t\tif($('a.current',par).length && $(par).attr('id')!=$(parc).attr('id'))\r\n\t\t\t\t\t$(par).find('a:first').css('color',$(\"a.current\").css(\"color\"));\r\n\t\t\t}\r\n\t\treturn false;\r\n\t});\r\n\tif($('.Vmenu2 li[@view=topitem]:has(ul)').length && $('.Vmenu2 ul:first').length)\r\n\t{\r\n\t\t$('.Vmenu2_links').css('display','block');\r\n\t\t$('a.plus_minus').click(function()\r\n\t\t{\r\n\t\t if(flag)\r\n\t\t {\r\n\t\t\t\t$(this).parent().parent().find('ul li ul').slideUp('slow');\r\n\t\t\t\t$('a.plus_minus').empty();\r\n\t\t\t\t$('img.pmimg').attr('src','include/img/plus.gif');\r\n\t\t\t\t$('a.plus_minus').append('<img src=\\\"include/img/plus.gif\\\" border=0> &nbsp;&nbsp;'+TEXT_EXPAND_ALL);\r\n\t\t\t\tflag = 0;\r\n\t\t\t\t// on collapse all, remove all ids from cookie\r\n\t\t\t\tdelete_cookie('openMenuItemIds', cookieRoot, '');\r\n\t\t\t\t$(this).parent().parent().find('li:has(ul:has(a.current))').each(function()\r\n\t\t\t\t{\r\n\t\t\t\t\t$(this).find('a:first').css('color',$(\"a.current\").css(\"color\"));\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t else{\r\n\t\t\t\t\t$(this).parent().parent().find('ul li ul').slideDown('slow');\r\n\t\t\t\t\t$('a.plus_minus').empty();\r\n\t\t\t\t\t$('img.pmimg').attr('src','include/img/minus.gif');\r\n\t\t\t\t\t$('a.plus_minus').append('<img src=\\\"include/img/minus.gif\\\" border=0> &nbsp;&nbsp;'+TEXT_COLLAPSE_ALL);\r\n\t\t\t\t\tflag = 1;\r\n\t\t\t\t\t// on expand all add all ids to cookie\r\n\t\t\t\t\t$(this).parent().parent().find('ul li ul').each(function()\r\n\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\taddOpenMenuItemIdToCookie($(this).attr(\"id\"));\t\r\n\t\t\t\t\t});\r\n\t\t\t\t\t$(this).parent().parent().find('li:has(ul:has(a.current))').each(function()\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$(this).find('a:first').css('color',window.colorlink);\r\n\t\t\t\t\t});\t\r\n\t\t\t\t}\r\n\t\t\treturn false; \r\n\t\t});\r\n\t}\t\r\n\tif($.browser.msie)\r\n\t\t$('.Vmenu2 ul li').css('padding','5px 0');\t\r\n}", "function startMenu() {\n createManager();\n}", "function install_menu() {\n var config = {\n name: 'lesson_lock',\n submenu: 'Settings',\n title: 'Lesson Lock',\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "function install_menu() {\n let config = {\n name: script_id,\n submenu: 'Settings',\n title: script_title,\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }", "static onClick_() {\n if (MenuManager.isMenuOpen()) {\n ActionManager.exitCurrentMenu();\n } else {\n Navigator.byItem.exitGroupUnconditionally();\n }\n }", "async function openMenu(menu){\n\tkony.automation.flexcontainer.click([\"frmUnifiedDashboard\",\"customFooter\",\"flxMore\"]);\n\tawait kony.automation.playback.wait(1000);\n\tawait kony.automation.playback.waitFor([\"frmUnifiedDashboard\",\"Hamburger\",\"flxMenu\",\"segHamburger\"]);\n\tawait kony.automation.playback.wait(1000);\n\tvar menuOptions = kony.automation.widget.getWidgetProperty([\"frmUnifiedDashboard\",\"Hamburger\",\"flxMenu\",\"segHamburger\"], \"data\");\n\tkony.print(\"menuOptions: \"+menuOptions);\n\tvar menuIndex = -1;\n\tfor(i=0; i<menuOptions.length; i++){\n\t\tif(menuOptions[i].text === menu){\n\t\t\tmenuIndex = i;\n\t\t\tbreak;\n\t\t}\n }\n\tif(menuIndex > -1){\n\t\tkony.automation.segmentedui.click([\"frmUnifiedDashboard\",\"Hamburger\",\"segHamburger[0,\" + menuIndex+ \"]\" ]);\n }else{\n expect(menuIndex).toBeGreaterThan(-1);\n }\n}", "function setupMenu() {\n // console.log('setupMenu');\n\n document.getElementById('menuGrip')\n .addEventListener('click', menuGripClick);\n\n document.getElementById('menuPrint')\n .addEventListener('click', printClick);\n\n document.getElementById('menuHighlight')\n .addEventListener('click', menuHighlightClick);\n\n const menuControls = document.getElementById('menuControls');\n if (Common.isIE) {\n menuControls.style.display = 'none';\n } else {\n menuControls.addEventListener('click', menuControlsClick);\n }\n\n document.getElementById('menuSave')\n .addEventListener('click', menuSaveClick);\n\n document.getElementById('menuExportSvg')\n .addEventListener('click', exportSvgClick);\n\n document.getElementById('menuExportPng')\n .addEventListener('click', exportPngClick);\n\n PageData.MenuOpen = (Common.Settings.Menu === 'Open');\n}", "function menu(_func){\n\tif(myNodeInit){\t\t\n\t\tif(_func == \"properties\"){\n\t\t\topenproperties();\n\t\t} else if(_func == \"collapse\"){\n \tmyExpandedMode = 0;\n\t\t\texpand();\n \toutlet(4, \"vpl_menu\", \"setitem\", 3, \"expand\");\n \toutlet(4, \"vpl_menu\", \"setitem\", 4, \"fold\");\n\t\t} else if(_func == \"expand\" || _func == \"unfold\"){\n \tmyExpandedMode = 2;\n\t\t\texpand();\n \toutlet(4, \"vpl_menu\", \"setitem\", 3, \"collapse\");\n \toutlet(4, \"vpl_menu\", \"setitem\", 4, \"fold\");\n } else if(_func == \"fold\"){\n \tmyExpandedMode = 1;\n\t\t\texpand();\n \toutlet(4, \"vpl_menu\", \"setitem\", 3, \"collapse\");\n \toutlet(4, \"vpl_menu\", \"setitem\", 4, \"unfold\");\n\t\t} else if(_func == \"duplicate\"){\n\t\t\t;\n\t\t} else if(_func == \"delete\"){\n\t\t\t;\n\t\t} else if(_func == \"help\"){\n\t\t\toutlet(2, \"load\", \"bs.help.node.\" + myNodeHelp + \".maxpat\");\n\t\t}\n\t}\n}", "openMenu() {\n\t\t// prevent rerender when called multiple times\n\t\tif (!this.state.isMenuOpen) {\n\t\t\tthis.setState({ isMenuOpen: true });\n\t\t}\n\t}", "openMenu() {\n\t\t// prevent rerender when called multiple times\n\t\tif (!this.state.isMenuOpen) {\n\t\t\tthis.setState({ isMenuOpen: true });\n\t\t}\n\t}", "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}", "function install_menu() {\n var config = {\n name: 'dashboard_level',\n submenu: 'Settings',\n title: 'Dashboard Level',\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\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 callOpenFile() {\n let win = BrowserWindow.getFocusedWindow();\n win.webContents.send('open-menu-click');\n}", "function clickInBrowser(){\n if (! lastClickOnMenu) {\n closeMenu(\"divMenuHelp\");\n closeMenu(\"divMenuOpt\");\n closeMenu(\"divMenuGame\"); }\n lastClickOnMenu = false;}", "openMenu() {\n $('body').addClass('menu-open');\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 goTo(menuKey) {\n\t\t\t var hasPerm = true;\n\t\t\t if (hasPerm) {\n\t\t\t var template = Constant.getTemplateUrl(menuKey);\n\t\t\t postal.publish({\n\t\t\t channel : \"Tab\",\n\t\t\t topic : \"open\",\n\t\t\t data : template\n\t\t\t });\n\t\t\t }\n\t\t}", "function enableMenu()\r\n{\r\n\tif (typeof top.menu == \"undefined\" || typeof top.menu.divContain == \"undefined\")\r\n\t\treturn -1;\r\n\ttop.menu.divContain.style.visibility = \"hidden\";\r\n\treturn 0;\r\n}", "function main() {\n\t$('.icon-menu').click(function() {\n\t\t$('.menu').animate({\n\t\t\t'left': '0px'\n\t\t}, 600);\n\n// *********close-menu**********\n\t$('.icon-close').click(function() {\n\t\t$('.menu').animate({\n\t\t\t'left': -285\n\t\t}, 600);\n\t});\n\n\t});\n}", "function openMenu() {\n console.log(\"open menu A\");\n menu.classList.add('showMenu');\n}", "function onOpen() {\n app.createMenu('Move Sheet')\n .addItem('Move Active Sheet to End', 'moveactiveSheet')\n .addItem('Move Sheet', 'movespecificSheet')\n .addToUi(); \n}", "showStandardMenu() {\n const menu = this._Menu.buildFromTemplate([\n {role: 'cut'},\n {role: 'copy'},\n {role: 'paste'},\n {type: 'separator'},\n {role: 'selectAll'},\n ]);\n menu.popup();\n }", "static toggleMenu() {\n var win = $(\"#window\")[0];\n\n if (win.classList.contains(MENU_ACTIVE)) {\n this.menuOff();\n }\n else {\n this.menuOn();\n }\n }", "function globalNavOpen() {\n openNav(navBtn);\n openNav(navMenu);\n}", "function onOpen() {\n var menu = [{name: 'Run', functionName: 'runSXSW'},\n {name: 'Standby', functionName: 'sleep'},\n {name: 'Update', functionName: 'update'},\n {name: 'Consolidate QR Codes', functionName: 'allMoviesDoc'}];\n SpreadsheetApp.getActive().addMenu('SXSW', menu);\n}", "function toMenu() {\n\tclearScreen();\n\tviewPlayScreen();\n}", "function isOpen(){\n\t\t\tif(open)\n\t\t\t\t return \"menu is open\";\n\t\t\telse\n\t\t\t\t return \"menu is closed\";\n\t}", "function menuGripClick() {\n // console.log('menuGripClick');\n\n PageData.MenuOpen = !PageData.MenuOpen;\n setMenuPosition();\n\n if (!PageData.MenuOpen && PageData.ControlsOpen) {\n PageData.ControlsOpen = false;\n setControlsPosition();\n }\n}", "function onOpen() {\n FormApp.getUi()\n .createMenu('TSTranslateKhmer')\n .addItem('Create Form', 'createForm')\n .addItem('Enable Submit Trigger', 'enableSubmitTrigger')\n .addSubMenu(FormApp.getUi().createMenu('Utilities')\n .addItem('Translate Form Text to Khmer', 'translateToKhmer')\n .addItem('Translate Form Text to English', 'translateToEnglish'))\n .addSeparator()\n .addItem('About', 'about')\n .addToUi();\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 goToMenu() {\n stopTTS();\n cStatus = undefined;\n cStatus = new CurrentStatus();\n $('#quiz').hide('slow');\n $('#game').hide('slow');\n $('#menu').show('slow');\n}", "function MenuOpen () {\n\tmenuDiv.style.marginLeft='0px';\n\tbodyDiv.style.marginLeft=menuWidth+'px';\n\tif (siteWdth<560) bodyDiv.style.width='100%';\n\telse bodyDiv.style.width='calc(100% - '+(menuWidth+1)+'px)';\n\tmenu_holderDiv.style.display=\"block\";\n\tmenuOpened=1;\n\t// body height\n\tdocument.getElementById('body').style.minHeight=document.getElementById('menu_holder').clientHeight + 20;\n\t// myhome\n\t//if (document.location.href.split('/')[3]=='myhome') ResizeButs();\n}", "function menu() {\n console.log (\"\\n 1 : Lister les contacts\");\n console.log (\" 2 : Ajouter un contact\");\n console.log (\" 0 : Quitter le Gestionnaire\");\n\n}", "function onOpen() {\n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();\n var entries = [\n {\n name: \"Calcular Costos\",\n functionName: \"calcularCostos\"\n },\n {\n name: \"Enviar Listado\",\n functionName: \"enviarListado\"\n }\n ];\n spreadsheet.addMenu(\"Menu - Desafio Q10\", entries);\n}", "function onOpen(e) {\n DocumentApp.getUi().createAddonMenu()\n .addItem('Start', 'showSidebar')\n .addToUi();\n}", "function determineMenuAction() {\n var that = $(this),\n correspondingUl = that.parent().next();\n if (correspondingUl.is(':hidden')) {\n openMenu(that, correspondingUl);\n } else {\n closeMenu(that, correspondingUl);\n }\n }" ]
[ "0.7982476", "0.7686112", "0.75871783", "0.74780846", "0.7346505", "0.7304437", "0.7216212", "0.7133257", "0.71231824", "0.7083501", "0.69914055", "0.6989825", "0.6935601", "0.6925134", "0.6914193", "0.691408", "0.6895226", "0.68763447", "0.6825789", "0.6811059", "0.6806017", "0.6785569", "0.67285305", "0.6718767", "0.6717774", "0.6709055", "0.6703321", "0.6688611", "0.6671668", "0.66574824", "0.6626853", "0.6624037", "0.66089237", "0.6603533", "0.6598811", "0.6596682", "0.6595483", "0.65886027", "0.65856826", "0.6584348", "0.6584184", "0.6581512", "0.6579723", "0.6578182", "0.6549828", "0.6538634", "0.6535122", "0.65330714", "0.6521852", "0.651649", "0.6514241", "0.65094584", "0.650671", "0.65063494", "0.6495934", "0.64920914", "0.64847827", "0.64813477", "0.64715093", "0.6467687", "0.64620984", "0.64544874", "0.64504504", "0.6437875", "0.6434725", "0.6421595", "0.6417521", "0.6409042", "0.6401988", "0.63995796", "0.63993484", "0.63939494", "0.639059", "0.639059", "0.63849187", "0.6379949", "0.6377244", "0.63771355", "0.6374003", "0.63706976", "0.63703924", "0.63694835", "0.6365486", "0.6364819", "0.63547534", "0.6338133", "0.63231134", "0.63215077", "0.63203293", "0.6319387", "0.63176376", "0.63168025", "0.6313015", "0.6301238", "0.63011783", "0.6300308", "0.6299376", "0.6297345", "0.62957674", "0.6291991", "0.62883705" ]
0.0
-1
EURO TO DOLLAR CONVERT FUNCTION
function euroTodollar() { var euro2dollar = 1.10; var bedrag = document.querySelector("#bedrag").value; document.getElementById("convert").value = (bedrag * euro2dollar).toFixed(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dollarToeuro() {\n var dollar2euro = 0.91;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * dollar2euro).toFixed(2);\n\n }", "function pond2euro() {\n var pond2euro = 1.17;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * pond2euro).toFixed(2);\n\n }", "function toCurrency(){\n\n}", "function conversion(kelvin) {\n return Math.floor(kelvin * (9/5) - 459.67) + \"°F\";\n}", "function currencyConversion(euros, exchangeRate) {\n const amount = euros * (exchangeRate / 100);\n const twoDecimal = amount.toFixed(2);\n return euros + ' ' + \"euros at an exchange rate of\" + ' ' + exchangeRate + ' ' + \"is\" + ' ' + twoDecimal + ' ' + \"U.S. dollars\";\n}", "function convertPrice(price){\n return new Intl.NumberFormat('ru-RU').format(Math.round(price));\n}", "function convertToCelcius(x){\n let kelvin = 273.15;\n let temp = x - kelvin; \n temp = Math.round(temp);\n return temp;\n}", "function convert (celsius){\n var fahrenheit = ((celsius * 9/5) +32);\n console.log(celsius +\" degrees celsius equates to: \"+fahrenheit + \" \"+ \"fahrenheit\");\n }", "function euroTopond() {\n var euro2pond = 0.85;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * euro2pond).toFixed(2);\n\n }", "function convertToCelsius(num){\n return (num - 32) * 5 / 9;\n}", "function kelvinToCelcius(K){\n return parseInt(K) - parseInt(273);\n}", "function eurfunc()\r\n{\r\n inr.value = parseFloat(eur.value) * 1.43448;\r\n usd.value = parseFloat(eur.value) * 0.70641;\r\n cad.value = parseFloat(eur.value) * 0.72037;\r\n aud.value = parseFloat(eur.value) * 0.62382;\r\n}", "function convertToCurrency(num) {\n return \"AUD \" + num.toFixed(2);\n}", "function convert() {\n let k = document.getElementById(\"kelvin\").value\n let o = k- 273.15\n document.getElementById(\"out\").innerHTML = o.toFixed(2) + \" degrees C\"\n}", "function ConverterEuro() {\n var valorElemento = document.getElementById(\"valor\");\n var valor = valorElemento.value;\n var valorEmDolarNumerico = parseFloat(valor);\n var valorEmEuro = valorEmDolarNumerico * 0.85;\n var elementoValorConvertio = document.getElementById(\"valorConvertido\");\n var valorConvertido = \"O resultado em euro é € \" + valorEmEuro + \".\";\n elementoValorConvertio.innerHTML = valorConvertido;\n}", "function Currency(str) {\n str = str - -0.5;\n var arr = new String(str);\n var arr1 = '';\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] != '.') {\n arr1 = arr1 + arr[i];\n }\n else {\n if (arr[i + 1] >= '5') {\n arr1[i] = arr[i] - -1;\n }\n break;\n }\n }\n var Gia = \"\";\n var dem = 0;\n for (var i = arr1.length - 1; i >= 0; i--) {\n dem++;\n Gia = Gia + arr1[i];\n if (dem == 3 && i != 0) {\n Gia = Gia + \",\";\n dem = 0;\n }\n }\n var arr2 = new String(Gia);\n var GiaMoi = '';\n for (var i = arr2.length - 1; i >= 0; i--) {\n GiaMoi = GiaMoi + arr2[i];\n }\n return GiaMoi;\n }", "function formatAsEuros (amount) {\n var res = '€'\n , currentPart\n ;\n\n if (amount === 0) { return '0 ' + res; }\n\n while (amount > 0) {\n currentPart = amount - 1000 * Math.floor(amount / 1000);\n if (amount === currentPart) { // No padding if it's the last part\n res = currentPart + ' ' + res;\n } else {\n res = pad(currentPart) + ' ' + res;\n }\n amount = (amount - currentPart) / 1000;\n }\n\n return res;\n}", "function convertRate(price) {\n if (gCurrLang === 'he') {\n return price * gExcangeRates.quotes.USDILS\n } else if (gCurrLang === 'en') {\n return price\n }\n}", "function NumberEU(num) {\r\n\tnum = num.replace(\",\", \".\");\r\n\treturn Number(num);\r\n}", "function Converter(currency, input) {\n\n if (isNaN(input)) {\n number.value = null;\n alert('Nazadal jsi cislo');\n }\n\n switch (currency) {\n\n case 'USD':\n\n usd = 23.61777;\n return (input / usd).toFixed(2) + ' $';\n case 'EUR':\n\n eur = 25.840273;\n return (input / eur).toFixed(2) + ' €';\n\n case 'PLN':\n\n pln = 5.89558584;\n return (input / pln).toFixed(2) + ' zł';\n }\n}", "function convertToF(celsius) { \n \n return( 9*celsius/5 + 32);\n}", "function convert (c) {\n \n var f=(9*c/5) + 32;\n return c + '°C is ' + f + '°F';\n \n \n}", "kelvinToCelsius(kelvin) {\n return Math.floor(kelvin - 273) + \" °C\"\n }", "function convert(){\r\nvar fsub = f.value-32;\r\nvar fdiv = fsub/1.8;\r\n c.innerHTML=fdiv+\"°C\";\r\n}", "function currencyConverter(from, to, amount) {\n // It's javascript convention to DECLARE variables at the top of functions\n // before they are actually DEFINED and used. This way it's easier to keep\n // track of the different scopes.\n var result, converter;\n\n // - CURRENCY_CONVERSION_MAP is being accessed like a nested Ruby hash.\n // - CURRENCY_CONVERSION_MAP[from] is an object representing all the ways to\n // convert `from` currency.\n // - CURRENCY_CONVERSION_MAP[from][to] is the anonymous function that converts\n // `from` currency into `to` currency.\n converter = CURRENCY_CONVERSION_MAP[from][to];\n result = converter(amount);\n\n // If we didn't use a constant variable here, this line would be completely\n // unclear to anyone unfamiliar with the toFixed() method!\n return result.toFixed(CURRENCY_PRECISION);\n}", "function calculateConvertedCurrency() {\n\tlet fromCurr = currFrom.value;\n\tlet toCurr = currTo.value;\n\t\n\tfetch(`https://api.exchangerate-api.com/v4/latest/${fromCurr}`)\n\t\t.then(res => res.json())\n\t\t.then(res => {\n\t\tconst rate = res.rates[toCurr];\n perRate.innerText = `1 ${fromCurr} = ${rate} ${toCurr}`;\n let ans=(amountfrom.value * rate);\n\t\tamountTo.value = ans.toFixed(2);\n\t})\n}", "function CurrencyConvert(v,idx,full) {\n if(idx==undefined) idx = 0;\n var c = CurrencyData[idx];\n v = parseInt(10000*v/c[2])/10000;\n if(v>1 && v<1000) v=parseInt(10*v)/10;\n if(v>=1000 && v<10000) v=parseInt(v/1000)+\"千\";\n else if(v>=10000 && v<100000000) v=parseInt(v/10000)+\"萬\";\n else if(v>=100000000 && v<1000000000000) v=parseInt(v/100000000)+\"億\";\n else if(v>=1000000000000) v=parseInt(v/1000000000000)+\"兆\";\n return v+(full?c[0]+c[1]:\"\");\n }", "function celsius2Kelvin(celsius)\n{\n //+ will become string\n return celsius + 273;\n}", "function convertKelvinToCelsius(kelvin) {\n if (kelvin < (0)) {\n return 'below absolute zero (0 K)';\n } else {\n let celciusVal = kelvin - 273.15\n return Math.round(celciusVal * 100) / 100;\n }\n}", "function usdfunc()\r\n{\r\n inr.value = parseFloat(usd.value) * 2.03032;\r\n eur.value = parseFloat(usd.value) * 1.41544;\r\n cad.value = parseFloat(usd.value) * 1.01941;\r\n aud.value = parseFloat(usd.value) * 0.88297;\r\n}", "function convertToCelsius(fahrenheit){\n let temp = (Number(fahrenheit)-32) * 5/9;\n return temp.toFixed(2);\n }", "function convertToCelcius(fahrenheit) {\n return Math.round((fahrenheit - 32) * 5 / 9);\n}", "function convert(){\n var c = document.querySelector(\"#c\").value;\n var f = c * 9/5 +32;\n document.querySelector(\"h3\").innerHTML = \"Result: \" + f+ \"°\"+ \"F\";\n}", "function convertToCelsius(fahrenheit){\n if(typeof(fahrenheit)=='string'||typeof(fahrenheit)=='undefined'||typeof(fahrenheit)=='object'){\n return 'Technical Error!';\n } \n return (5/9) * (fahrenheit-32);\n \n}", "function getPeso (adcvalue, devider) {\n\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t return ((((parseInt(adcvalue)/devider) * 230)/1000)/3600) *12\n\n\t\t\t\t\t\t\t\t\t\t }", "function kelvin_to_celsius(num) {\n return Math.round(num - 273.15);\n} // kelvin to celsius", "getYieldInEuros() {\n return this.price * this.getYieldInKg()\n }", "function convertToCelcius(tempKelvin){\n let tempCel = Math.round(tempKelvin - 273.15);\n return tempCel\n}", "function convertirACelsius(tempValue) {\n return (tempValue - 32) * 5 / 9;\n}", "function priceConversion(productPrice) {\n return Intl.NumberFormat(\"fr-FR\", {\n style: \"currency\",\n currency: \"EUR\",\n minimumFractionDigits: 2,\n }).format(`${productPrice}` / 100);\n}", "function kelvin2Farenheit(kelvin)\n{\n return (9/5 * (kelvin - 273)) + 32;\n}", "function centsToDollars(num){\n return num / 100; \n}", "function convert(value, dest) {\n var out = value - 273.15;\n if(dest == 'F') {\n out = (value - 273.15) * 1.8 + 32;\n }\n return Math.round(out * 10) / 10.0; \n }", "function convertCurrencyCalculator (value) {\n\n\n\n\t}", "function convertToF(celsius) {\n\treturn celsius * 9 / 5 + 32;\n}", "function convertCurrency(currencyValue) {\n if (currentCurrency == \"INR\") {\n return currencyValue;\n } else if (currentCurrency == \"USD\") {\n return currencyValue / currency.USDINR;\n } else {\n return currencyValue * currency.USDJPY / currency.USDINR;\n }\n}", "convert() {\n return `${(this.payments.type.price[this.currencyType] / 100)}`;\n }", "convert($geez_number) {\n const $parsed = this.parse($geez_number);\n\n return this.calculate($parsed);\n }", "function cvtC(p){\n\tvar s = \"$\";\n\t s+= Number(p.toFixed(2) ).toLocaleString();\n\treturn s;\n}", "async convertCurrency() {\n if (this.fromVal.value <= 0) {\n this.props.CounterStore.currencyError(\"Value must be positive\");\n return;\n }\n\n try {\n var conversionFactor = await currencyRequest.currencyRequest(\n this.fromCurr.value,\n this.toCurr.value,\n );\n this.props.CounterStore.currencyError(\"\");\n this.toVal.value = (\n conversionFactor.data[\n `${this.fromCurr.value}_${this.toCurr.value}`\n ] * this.fromVal.value\n ).toFixed(2);\n } catch (error) {\n console.log(error);\n }\n }", "function fahrenheitToCelsius(cDegrees) {\n var fahrenheit=( 9 / 5 * cDegrees) + 32;\n fahrenheit = Math.round(fahrenheit);\n return fahrenheit;\n}", "function convertKelvinToFahrenheit(kelvin) {\n return ((kelvin - 273.15) * 9 / 5 + 32).toFixed(2);\n}", "function convertToCelsius(temperature) {\n return parseInt(temperature - 273.15);\n}", "function celsiusToFahrenheit(cDegrees) \n{\n return Math.round(((9/5) * cDegrees) + 32);\n}", "function convertCtoF(celsius) {\n return (celsius * 9/5) + 32;\n}", "function c2k(celsius) {\n return celsius + 273.15;\n}", "function FahrenheitToCelsius(fDegree){\n var celsius = (fDegree - 32)*5 / 9;\n console.log(celsius);\n }", "function temp_converter(celsius_value){\n let F = celsius_value + 32/1.8\n console.log(celsius_value+\"C\"+ \" = \"+ F+\"F\")\n}", "function convertsToCurrency(num1){\n\tvar currency = num1.toFixed(2);\n\treturn currency\n}", "getDegFahrenheit(degKelvin) {\n let result = parseInt(degKelvin);\n result = Math.round(result * 9/5 - 459.67);\n result = result + \"&#8457;\"\n return result;\n }", "function convert(rate) {\n rate = rate / 100;\n return rate;\n}", "function c2f(celsius) {\n return celsius * 1.8 + 32;\n}", "function convertToF(celsius) { //1\n let fahrenheit = celsius * 9/5 + 32; //2\n\n return fahrenheit; //3\n}", "static fromKelvinToCelsius(temperature) {\n return Math.trunc(Number(temperature) - 273.15) + '°';\n }", "function convertFahr (celsiusTemp) {\n return (((9/5) * celsiusTemp) + 32).toFixed(2);\n} // end convertFahr()", "function convertToRupiah(value, currencyType) {\n switch (currencyType) {\n case \"yen\":\n return `$${value} yen = Rp.${value * 129.88}`;\n case \"usd\":\n return `${value} USD = Rp.${value * 14272.67}`;\n case \"euro\":\n return `${value} EUR = Rp.${value * 16932.8}`;\n default:\n return \"no match type currency\";\n }\n}", "function numtocurrency(num) {\n num = num.toString().replace(/\\$|\\./g, '');\n\n if (isNaN(num)) num = \"0\";\n\n sign = (num == (num = Math.abs(num)));\n num = Math.floor(num * 100 + 0.50000000001);\n cents = num % 100;\n num = Math.floor(num / 100).toString();\n\n if (cents == 0) cents = '';\n else if (cents < 10) cents = \",0\" + cents;\n else cents = ',' + cents;\n\n for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)\n num = num.substring(0, num.length -(4 * i + 3)) + '.' + num.substring(num.length - (4 * i + 3));\n\n return(((sign) ? '' : '-') + num + cents);\n}", "function formatEuroNumber(number) {\r\n\tvar str = String(number);\r\n\tvar res;\r\n\tif(str) {\r\n\t\tres = \"&euro; \" + str;\r\n\t}\r\n\treturn res;\r\n}", "function convertToDegrees(val) {\n return val / range * 270 - (serie.min / range * 270 + 45);\n }", "function calcFahrToCelsius(n) {\n //1F = 1.8C + 32 (e.g 0deg C = 32deg F)\n var Fahr = ((n - 32) / 1.8);\n var fahrDec = parseFloat(Fahr.toFixed(4));\n console.log(`'${fahrDec}'`);\n return `${fahrDec}`\n}", "function toRad($Value) \n{\n return $Value * Math.PI / 180;\n}", "function convertToF(celsius) {\n\tlet fahrenheit = celsius * (9 / 5) + 32;\n\treturn fahrenheit;\n}", "get conversion() {\n return (5/9) * (this._Fahrenheit - 32);\n }", "function celciusToFarenheit(C){\n return 1.8*C + 32;\n \n}", "function convertToDegrees(val) { return val / currentRange * 270 - (currentSerie.minRange / currentRange * 270 + 45); }", "function convertToF(celsius) {\n let fahrenheit;\n fahrenheit = (celsius * 9 /5) +32;\n return fahrenheit; \n }", "function convertToEpic(input) {\n\tswitch (input) {\n\t\tcase 0:\n\t\toutput = 0;\n\t\tbreak;\n\t\tcase 1:\n\t\toutput = 1;\n\t\tbreak;\n\t\tcase 2:\n\t\toutput = 2;\n\t\tbreak;\n\t\tcase 3:\n\t\toutput = 4;\n\t\tbreak;\n\t\tcase 4:\n\t\toutput = 7;\n\t\tbreak;\n\t\tcase 5:\n\t\toutput = 11;\n\t\tbreak;\n\t\tcase 6:\n\t\toutput = 16;\n\t\tbreak;\n\t\tcase 7:\n\t\toutput = 22;\n\t\tbreak;\n\t\tcase 8:\n\t\toutput = 29;\n\t\tbreak;\n\t\tcase 9:\n\t\toutput = 37;\n\t\tbreak;\n\t\tcase 10:\n\t\toutput = 46;\n\t\tbreak;\n\t}\n\treturn output;\n}", "function kelvinToF(kelvin){\n return Math.round((( (kelvin-273.15) * 9)/5) + 32);\n}", "function celciusToKelvin(C){\n return parseInt(273) + parseInt(C);\n}", "function numToDollars(num) {\n return '$' + num.toFixed(2);\n}", "function convertRad(input) {\n\treturn (Math.PI * input) / 180;\n}", "function convertTemp (celsius, decimalPlaces = 1) { // Here we are giving default value as 1 , if decimalPlaces is not defined\n const fahrenhite = celsius * 1.8 + 32;\n return Number(fahrenhite.toFixed(decimalPlaces));\n}", "function toPrice(value) {\n value /= 100;\n return parseFloat(Math.round(value + \"e\" + 2) + \"e-\" + 2).toFixed(2);\n}", "function UdregnRente(startBeløb, rente, år) {\n\n return (startBeløb * Math.pow(1 + rente, år)).toFixed(2);\n}", "function convert(amount) {\n return Number(amount) * 1e12;\n}", "function e(e,l){return Number(e.toFixed(l))}", "function convertPrice(formatPrice){\n\tstr = formatPrice.substring(0,formatPrice.length - 4);\n \tstr1 = str.replace('.','');\n \tstr2 = str1.replace('.','');\n \tstr3 = str2.replace('.','');\n \t\n \treturn str3;\n}", "function kelvinToFahrenheit(kelvin) {\n return (kelvin - 273.15) * 1.8 + 32\n}", "function convertToRadians () {\n var celsius = 12;\n var radians = ((Math.PI/180) *celsius);\n console.log(celsius +\" degrees celsius equates to: \"+ radians + \" radians\");\n}", "function kelvin(){\n var tempkelvin=celsius+273.15\n console.log('La temperatura en grados kelvin es: ')\n console.log(tempkelvin +' °K')\n}", "function convertToNumber(numText) {\n var number;\n number = numText.replace('€', '');\n number = number.replace(',', '.');\n number = number.replace('.', ' ');\n number = parseFloat(number);\n\n if (number != 'NaN') {\n return number;\n } else {\n return 0;\n }\n }", "function converter(){\n var valorEmDolar= window.document.getElementById(\"txtn1\")\n var res = window.document.getElementById(\"res\")\n \n var valorEmDolarNumber = parseFloat(valorEmDolar.value)\n var taxa = 5.50\n var valorEmReal= valorEmDolarNumber * taxa\n res.innerHTML =' O valor em real é R$ ' + valorEmReal.toFixed(2)\n}", "callback(value) {\n return formatCurrency(value, 4);\n }", "function toCelsius(kelvin) {\n const celsius = kelvin - 273;\n return Math.round(celsius);\n\n}", "function toCelsius(kelvin) {\r\n var tempInCelsius = Math.round(kelvin - 273.15);\r\n return tempInCelsius + '°C';\r\n }", "function convertToF(celsius) {\n let fahrenheit = celsius * 9/5 + 32;\n return fahrenheit;\n}", "function convertFahrenheitToCelsius(temp) {\n return ((temp - 32) * 5) / 9;\n}", "function convertToF(celsius) {\n let fahrenheit;\n fahrenheit = (celsius * 9 / 5) + 32\n return `${celsius}°C is ${fahrenheit}°F.`;\n}", "function Iu(e,t,n,i){switch(n){case\"s\":return i||t?\"néhány másodperc\":\"néhány másodperce\";case\"ss\":return e+(i||t?\" másodperc\":\" másodperce\");case\"m\":return\"egy\"+(i||t?\" perc\":\" perce\");case\"mm\":return e+(i||t?\" perc\":\" perce\");case\"h\":return\"egy\"+(i||t?\" óra\":\" órája\");case\"hh\":return e+(i||t?\" óra\":\" órája\");case\"d\":return\"egy\"+(i||t?\" nap\":\" napja\");case\"dd\":return e+(i||t?\" nap\":\" napja\");case\"M\":return\"egy\"+(i||t?\" hónap\":\" hónapja\");case\"MM\":return e+(i||t?\" hónap\":\" hónapja\");case\"y\":return\"egy\"+(i||t?\" év\":\" éve\");case\"yy\":return e+(i||t?\" év\":\" éve\")}return\"\"}", "testWhatIsTheConversionRateFromEURToUSD() {\n let tenEuros = new Money(10, 'EUR')\n this.bank.addExchangeRate('EUR', 'USD', 1.2)\n assert.deepStrictEqual(\n this.bank.convert(tenEuros, 'USD'),\n new Money(12, 'USD')\n )\n }" ]
[ "0.7358444", "0.67566913", "0.672828", "0.6651549", "0.6607016", "0.63641584", "0.63308567", "0.62846744", "0.6241035", "0.6185155", "0.6164351", "0.61156285", "0.6078811", "0.6071066", "0.6067765", "0.6011564", "0.6007596", "0.59942394", "0.59901863", "0.59857875", "0.5982113", "0.59763217", "0.5958582", "0.5952692", "0.5950734", "0.5940736", "0.59246033", "0.59006923", "0.58945286", "0.5884362", "0.58804774", "0.58795387", "0.5878057", "0.5875069", "0.58594", "0.5840908", "0.5836689", "0.5793251", "0.5791516", "0.57706773", "0.57691133", "0.5754004", "0.57504994", "0.57468873", "0.572858", "0.5713073", "0.5689937", "0.56854564", "0.56841385", "0.5658576", "0.5656809", "0.56406474", "0.56346804", "0.56346756", "0.5607392", "0.5603824", "0.5580185", "0.55726707", "0.55693126", "0.555623", "0.5550354", "0.55190533", "0.55105454", "0.5502013", "0.54964", "0.5495453", "0.54939836", "0.54796535", "0.5470269", "0.54621464", "0.5458279", "0.5455843", "0.54461634", "0.5436618", "0.5431609", "0.542995", "0.54257196", "0.54239047", "0.5421527", "0.54189897", "0.5418357", "0.54001987", "0.539289", "0.5392003", "0.53903776", "0.538315", "0.5378929", "0.5378196", "0.53780085", "0.5377194", "0.5374155", "0.53733945", "0.53712595", "0.5365957", "0.53601927", "0.5356609", "0.53561497", "0.5351326", "0.53478634", "0.53475046" ]
0.68504477
1
Dollar To Euro CONVERT FUNCTION
function dollarToeuro() { var dollar2euro = 0.91; var bedrag = document.querySelector("#bedrag").value; document.getElementById("convert").value = (bedrag * dollar2euro).toFixed(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function euroTodollar() {\n var euro2dollar = 1.10;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * euro2dollar).toFixed(2);\n\n }", "function toCurrency(){\n\n}", "function convertToCurrency(num) {\n return \"AUD \" + num.toFixed(2);\n}", "function currencyConversion(euros, exchangeRate) {\n const amount = euros * (exchangeRate / 100);\n const twoDecimal = amount.toFixed(2);\n return euros + ' ' + \"euros at an exchange rate of\" + ' ' + exchangeRate + ' ' + \"is\" + ' ' + twoDecimal + ' ' + \"U.S. dollars\";\n}", "function convertPrice(price){\n return new Intl.NumberFormat('ru-RU').format(Math.round(price));\n}", "function ConverterEuro() {\n var valorElemento = document.getElementById(\"valor\");\n var valor = valorElemento.value;\n var valorEmDolarNumerico = parseFloat(valor);\n var valorEmEuro = valorEmDolarNumerico * 0.85;\n var elementoValorConvertio = document.getElementById(\"valorConvertido\");\n var valorConvertido = \"O resultado em euro é € \" + valorEmEuro + \".\";\n elementoValorConvertio.innerHTML = valorConvertido;\n}", "function pond2euro() {\n var pond2euro = 1.17;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * pond2euro).toFixed(2);\n\n }", "function formatCurrency(number){\n return \"$\"+number+\".00\"\n}", "changePrice() {\n var parts = this.precio.toFixed(2).toString().split(\".\");\n var result = parts[0].replace(/\\B(?=(\\d{3})+(?=$))/g, \".\") + (parts[1] ? \",\" + parts[1] : \"\");\n return `$${result}`;\n }", "function convertMoney(money) {\n return `$ ${money.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")}`\n}", "function numtocurrency(num) {\n num = num.toString().replace(/\\$|\\./g, '');\n\n if (isNaN(num)) num = \"0\";\n\n sign = (num == (num = Math.abs(num)));\n num = Math.floor(num * 100 + 0.50000000001);\n cents = num % 100;\n num = Math.floor(num / 100).toString();\n\n if (cents == 0) cents = '';\n else if (cents < 10) cents = \",0\" + cents;\n else cents = ',' + cents;\n\n for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)\n num = num.substring(0, num.length -(4 * i + 3)) + '.' + num.substring(num.length - (4 * i + 3));\n\n return(((sign) ? '' : '-') + num + cents);\n}", "function formatPrice(num)\n{\n\t num = num.toString().replace(/\\$|\\,/g,'');\n\t if(isNaN(num))\n\t num = \"0\";\n\t sign = (num == (num = Math.abs(num)));\n\t num = Math.floor(num*100+0.50000000001);\n\t cents = num%100;\n\t num = Math.floor(num/100).toString();\n\t if(cents<10)\n\t cents = \"0\" + cents;\n\t for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)\n\t num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));\t \n\t //return (((sign)?'':'-') + '<?php //echo $this->model_superadmin->generate_isocode_bo()?> ' + num + ',' + cents);\n\t return (((sign)?'':'-') + 'Rp. '+ num +',00');\n}", "function usCurrency$Format(num) {\n return '$' + num.toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, '$1,');\n }", "function formatEuroNumber(number) {\r\n\tvar str = String(number);\r\n\tvar res;\r\n\tif(str) {\r\n\t\tres = \"&euro; \" + str;\r\n\t}\r\n\treturn res;\r\n}", "function currency (value){\n return '$ ' + value\n .toFixed(2)\n .replace(/(\\d)(?=(\\d{3})+\\.)/g, '$1,').replace('.00', '')\n }", "function formatCurrency(num) {\nnum = num.toString().replace(/\\$|\\,/g,'');\nif(isNaN(num))\nnum = \"0\";\nsign = (num == (num = Math.abs(num)));\nnum = Math.floor(num*100+0.50000000001);\ncents = num%100;\nnum = Math.floor(num/100).toString();\nif(cents<10)\ncents = \"0\" + cents;\nfor (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)\nnum = num.substring(0,num.length-(4*i+3))+','+\nnum.substring(num.length-(4*i+3));\nreturn (((sign)?'':'-') + num + '.' + cents);\n}", "function totalPrice(price) {\n return `$${price.toFixed(2)}`;\n}", "function formatCurrency(num) {\n return 'PKR ' + (num).toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n}", "function centsToDollars(num){\n return num / 100; \n}", "function toPrice(value) {\n value /= 100;\n return parseFloat(Math.round(value + \"e\" + 2) + \"e-\" + 2).toFixed(2);\n}", "function convertMoney(num){\n\n inputdollar = document.forms[0].inputdollar.value;\n var euro = inputdollar * .883785;\n var inputString = \"You entered $\" + inputdollar + \" USD\" + \"</br>\";\n var convertString = \"You exchanged $\" + inputdollar + \" U.S. Dollars for $\" + euro.toFixed(2) + \" Euros\" + \"</br>\";\n var outPutString = inputString + convertString;\n document.getElementById('moneyForm').innerHTML = outPutString;\n}", "function convertTotal(money){\n input = money.toString();\n var test = input.split(\"\");\n if (input.match(/\\./) !== null) {\n var part2;\n for (var i = 0; i < test.length; i++) {\n if (test[i] == \".\") {\n part2 = test.slice(i, i+3);\n test = test.slice(0, i);\n break;\n }\n };\n }\n if (test.length > 3) {\n for (var i = test.length - 3; i > 0; i = i - 3) {\n test.splice(i, 0, \",\");\n };\n }\n if (part2) {\n test = test.concat(part2);\n }\n input = test.join(\"\");\n return '$' + input;\n }", "function CurrencyConvert(v,idx,full) {\n if(idx==undefined) idx = 0;\n var c = CurrencyData[idx];\n v = parseInt(10000*v/c[2])/10000;\n if(v>1 && v<1000) v=parseInt(10*v)/10;\n if(v>=1000 && v<10000) v=parseInt(v/1000)+\"千\";\n else if(v>=10000 && v<100000000) v=parseInt(v/10000)+\"萬\";\n else if(v>=100000000 && v<1000000000000) v=parseInt(v/100000000)+\"億\";\n else if(v>=1000000000000) v=parseInt(v/1000000000000)+\"兆\";\n return v+(full?c[0]+c[1]:\"\");\n }", "function convertToUSDWithCommas(num) {\n numString = num.toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, '$1,');\n numString = \"$\" + numString;\n return numString;\n}", "function formatAsEuros (amount) {\n var res = '€'\n , currentPart\n ;\n\n if (amount === 0) { return '0 ' + res; }\n\n while (amount > 0) {\n currentPart = amount - 1000 * Math.floor(amount / 1000);\n if (amount === currentPart) { // No padding if it's the last part\n res = currentPart + ' ' + res;\n } else {\n res = pad(currentPart) + ' ' + res;\n }\n amount = (amount - currentPart) / 1000;\n }\n\n return res;\n}", "function Converter(currency, input) {\n\n if (isNaN(input)) {\n number.value = null;\n alert('Nazadal jsi cislo');\n }\n\n switch (currency) {\n\n case 'USD':\n\n usd = 23.61777;\n return (input / usd).toFixed(2) + ' $';\n case 'EUR':\n\n eur = 25.840273;\n return (input / eur).toFixed(2) + ' €';\n\n case 'PLN':\n\n pln = 5.89558584;\n return (input / pln).toFixed(2) + ' zł';\n }\n}", "function convertRate(price) {\n if (gCurrLang === 'he') {\n return price * gExcangeRates.quotes.USDILS\n } else if (gCurrLang === 'en') {\n return price\n }\n}", "function convertToNumber(numText) {\n var number;\n number = numText.replace('€', '');\n number = number.replace(',', '.');\n number = number.replace('.', ' ');\n number = parseFloat(number);\n\n if (number != 'NaN') {\n return number;\n } else {\n return 0;\n }\n }", "function priceConversion(productPrice) {\n return Intl.NumberFormat(\"fr-FR\", {\n style: \"currency\",\n currency: \"EUR\",\n minimumFractionDigits: 2,\n }).format(`${productPrice}` / 100);\n}", "function dollars(n) {\n document.paycheck.feedback3.value = \"$ \" + n.toFixed(2);\n}", "function currency ( value ) {\n\treturn \"£\" + _number(value);\n}", "function convertCurrencyCalculator (value) {\n\n\n\n\t}", "function convertsToCurrency(num1){\n\tvar currency = num1.toFixed(2);\n\treturn currency\n}", "function formatPrice(price) {\n return `$${(price * 0.01).toFixed(2)}`\n}", "function formatPrice(price) {\n return `$${(price * 0.01).toFixed(2)}`\n}", "function formatCurrency(value) {\n var stringValue = String(value);\n value = Math.round(value * 100) / 100;\n\n var output = \"\" + value;\n if (stringValue.indexOf('$') === -1) {\n output = '$' + output;\n }\n var dotIndex = output.indexOf('.');\n if (dotIndex === -1) {\n output = output + \".00\";\n } else if (output.substring(dotIndex + 1).length === 1) {\n output = output + \"0\";\n }\n return output;\n}", "function convertToCents (amount) {\n amount = amount.replace('.', '')\n return parseInt(amount)\n }", "convert() {\n return `${(this.payments.type.price[this.currencyType] / 100)}`;\n }", "function parseEuroNumber(number) {\r\n\t// number muss ein String sein!\r\n\tvar str = String(number);\r\n\tvar res;\r\n\tif(str) {\r\n\t\tstr = str.replace(\"EUR\", \"\");\r\n\t\tstr = str.replace(\"&euro;\", \"\");\r\n\t\tres = str;\r\n\t}\r\n\treturn res;\r\n}", "function euroTopond() {\n var euro2pond = 0.85;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * euro2pond).toFixed(2);\n\n }", "formatCurrency(value) {\n // get signal\n const signal = Number(value) < 0 ? '-' : ''\n //clean string\n // \\D -> Encontre tudo que náo é number\n value = String(value).replace(/\\D/g, '')\n // convert \n value = Number(value) / 100\n value = value.toLocaleString(\"pt-BR\", {\n style: \"currency\",\n currency: \"BRL\"\n })\n\n return signal + value\n }", "function numberToCurrency(number) {\n\tvar thousandsSeparator = ',';\n\tvar decimalSymbol = '.';\n\tvar sign;\n\n\tnumber = stripDollarSign(number);\n\tnumber = isNaN(number) || number == '' || number == null ? 0.00 : number;\n\tvar numberStr = parseFloat(number).toFixed(2).toString();\n\tif (numberStr.indexOf('-') != -1) {\n\t\tsign = '-';\n\t\tnumberStr = numberStr.substr(1);\n\t}\n\tvar numberFormatted = new Array(numberStr.slice(-3));\n\t// this returns the decimal and cents\n\tnumberStr = numberStr.substring(0, numberStr.length - 3);\n\t// this removes the decimal and cents\n\t/*\n\t * Why is there an `unshift()` function, but no `shift()`?\n\t * Also, a `pop()` function would be handy here.\n\t */\n\twhile (numberStr.length > 3) {\n\t\tnumberFormatted.unshift(numberStr.slice(-3));\n\t\t// this prepends the last three digits to `numberFormatted`\n\t\tnumberFormatted.unshift(thousandsSeparator);\n\t\t// this prepends the thousandsSeparator to `numberFormatted`\n\t\tnumberStr = numberStr.substring(0, numberStr.length - 3);\n\t\t// this removes the last three digits\n\t}\n\tnumberFormatted.unshift(numberStr);\n\t// there are less than three digits in numberStr, so prepend them\n\t\n\t\t//numberFormatted.unshift(currencySymbol);\n\t\t// prepend the currencySymbol\n\tif (sign == \"-\")\n\t\tnumberFormatted.unshift(\"-\");\n\t\t\n\treturn changeDecimalSymbol(numberFormatted.join(''), decimalSymbol);\n\t// put it all together\n}", "formatPrice(amount, currency) {\n let price = (amount / 100).toFixed(2);\n let numberFormat = new Intl.NumberFormat(['en-US'], {\n style: 'currency',\n currency: 'usd',\n currencyDisplay: 'symbol',\n });\n return numberFormat.format(price);\n }", "function formatAmount(amount){\n return \"$\" + amount.toFixed(2);\n}", "function numToDollars(num) {\n return '$' + num.toFixed(2);\n}", "function formatCurrency(num,dec) {\n\tvar parteEntera = '';\n\tvar parteDecimal = '';\n\t\n\tif(dec==undefined){dec=0;}\n\t\n\tvar auxNum = num + '';\n\tvar bDec = false;\n\tfor(m=0;m<auxNum.length;m++){\n\t\tif(auxNum.charAt(m) == \".\"){\n\t\t\tbDec = true;\n\t\t}else{\n\t\t\tif(bDec == true){\n\t\t\t\tparteDecimal += auxNum.charAt(m);\n\t\t\t}else{\n\t\t\t\tparteEntera += auxNum.charAt(m);\n\t\t\t}\t\n\t\t}\n\t}\n\t\n parteEntera = parteEntera.toString().replace(/\\$|\\,/g,'');\n if(isNaN(parteEntera))\n parteEntera = \"0\";\n sign = (parteEntera == (parteEntera = Math.abs(parteEntera)));\n parteEntera = Math.floor(parteEntera*100+0.50000000001);\n parteEntera = Math.floor(parteEntera/100).toString();\n for (var i = 0; i < Math.floor((parteEntera.length-(1+i))/3); i++)\n parteEntera = parteEntera.substring(0,parteEntera.length-(4*i+3))+'.'+\n parteEntera.substring(parteEntera.length-(4*i+3));\n parteEntera = (((sign)?'':'-') + parteEntera);\n\t\n\tvar resultado = parteEntera;\n\tif(dec>0){\n\t\tresultado+= ',' + parteDecimal;\n\t\tfor(m=parteDecimal.length;m<dec;m++){\n\t\t\tresultado+= '0';\n\t\t}\n\t}\n\t\n\treturn resultado;\n}", "function cvtC(p){\n\tvar s = \"$\";\n\t s+= Number(p.toFixed(2) ).toLocaleString();\n\treturn s;\n}", "function getAmountInCurrency(price, currency, convertFromEuro) {\n return currency in price ?\n price[currency] :\n convertFromEuro(price[\"eur\"], currency);\n }", "function formatCurrency(num)\n\t{\n\t // Courtesy of http://www7.brinkster.com/cyanide7/\n\t\tnum = num.toString().replace(/\\$|\\,/g,'');\n\t\tif(isNaN(num))\n\t\t num = \"0\";\n\t\tsign = (num == (num = Math.abs(num)));\n\t\tnum = Math.floor(num*100+0.50000000001);\n\t\tcents = num%100;\n\t\tnum = Math.floor(num/100).toString();\n\t\tif(cents<10)\n\t\t cents = \"0\" + cents;\n\t\tfor (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)\n\t\t num = num.substring(0,num.length-(4*i+3))+''+\n\t\t num.substring(num.length-(4*i+3));\n \t return (((sign)?'':'-') + num + '.' + cents);\n\t}", "function formatMoney(amount){\r\n return \"$\" + amount.toFixed(2)\r\n}", "function calculateUSD() {\n\t\tmodelPriceUSD = modelPrice / uahUsdRate;\n\t\tmodelPriceUSD = modelPriceUSD.toFixed(2);\n\n\t\tmodelPriceUsdHolder.text(\"$ \" + addSpace(modelPriceUSD));\n\t}", "function getDollarSignValue(price) {\n let dollarAmount = ''\n for (var i = 0; i < price; i++) {\n dollarAmount += '$'\n }\n return dollarAmount\n }", "function currencyConverter(from, to, amount) {\n // It's javascript convention to DECLARE variables at the top of functions\n // before they are actually DEFINED and used. This way it's easier to keep\n // track of the different scopes.\n var result, converter;\n\n // - CURRENCY_CONVERSION_MAP is being accessed like a nested Ruby hash.\n // - CURRENCY_CONVERSION_MAP[from] is an object representing all the ways to\n // convert `from` currency.\n // - CURRENCY_CONVERSION_MAP[from][to] is the anonymous function that converts\n // `from` currency into `to` currency.\n converter = CURRENCY_CONVERSION_MAP[from][to];\n result = converter(amount);\n\n // If we didn't use a constant variable here, this line would be completely\n // unclear to anyone unfamiliar with the toFixed() method!\n return result.toFixed(CURRENCY_PRECISION);\n}", "static formatCurrency(x) {\n return \"₱\" + x.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "function formatUSCurrency(val) {\r\n return val.toLocaleString('en-US',\r\n {style: \"currency\", currency: \"USD\"});\r\n}", "function formatCurrency( num )\n{\n\t// add '$' sign\n\tnum = num.toString().replace(/\\$|\\,/g,'');\n\t\n\t// if not a number, convert to 0\n\tif( isNaN( num ) ){\n\t\tnum = \"0\";\n\t}\n\t\n\t// add positive/negative sign\n\tsign = ( num == ( num = Math.abs( num ) ) );\n\t\n\t// begin calculations\n\tnum = Math.floor( num * 100 + 0.50000000001 );\n\tcents = num % 100;\n\tnum = Math.floor( num / 100 ).toString();\n\t\n\t// add cents, if needed\n\tif( cents < 10 ){\n\t\tcents = \"0\" + cents;\n\t}\n\t\n\t// add commas as needed\n\tfor( var i = 0; i < Math.floor( ( num.length - ( 1 + i ) ) / 3 ); i++ ){\n\t\tnum = num.substring( 0, num.length - ( 4 * i + 3 ) ) + ',' + num.substring( num.length - ( 4 * i + 3 ) );\n\t}\n\t\n\t// return formated number\n\treturn ( ( ( sign ) ? '' : '-' ) + '$' + num + '.' + cents );\n}", "function realCurrency(number){\r\n let value = number\r\n \r\n let result = value.toLocaleString('pt-br', {style: 'currency', currency: 'BRL'});\r\n\r\n return result\r\n}", "USD(b) {\n if (!b) { return '0.00' }\n else {\n // BOLT has 8 decimals right now\n b /= Math.pow(10, 8);\n b = b.toFixed(2)\n return String(b)\n }\n }", "function getAmountInCurrency(price, currency, convertFromEuro) {\n return currency in price ?\n price[currency] :\n convertFromEuro(price[\"eur\"], currency);\n }", "function formatoCurrency(valor) {\n var currency = 0;\n currency = valor.toFixed(2).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\");\n return currency;\n}", "function formatCurrency(row, cell, value) {\n return '$' + formatNumber(value);\n }", "function formatPrice(price) {\n\tif (price == null){\n\t\treturn '-';\n\t}else{\n\t\treturn '$' + price.toLocaleString('en');\n\t}\n}", "function formatPrice(price)\n{\n\tvar integer = Math.floor(price);\n\tvar decimals = Math.floor((price-integer)*100);\n\tif (decimals < 10)\n\t{decimals = \"0\"+decimals;}\n\treturn \"$\"+integer+\"<sup>\"+decimals+\"</sup>\";\n}", "function formatMoney(number){\n return '$'+number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g,'$&,');\n}", "function cur(num) {\n num = num.toString().replace(/\\$|\\,/g, '');\n if(isNaN(num))\n num = \"0\";\n sign = (num == (num = Math.abs(num)));\n num = Math.floor(num * 100 + 0.5000000001);\n cents = num % 100;\n num = Math.floor(num / 100).toString();\n if(cents < 10)\n cents = \"0\" + cents;\n for (var i = 0; i < Math.floor((num.length - (1 + i)) /3); i++)\n num = num.substring(0, num.length - (4*i+3)) + ',' +\n num.substring(num.length - (4*i+3));\n return (((sign) ? '' : '-') + '$' + num + '.' + cents);\n}", "function formatAsMoney(amount) {\r\n\t return '$' + parseFloat(amount, 10).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1,\").toString();\r\n\t }", "function GetPrice(price) {\n return (price * 0.75).toFixed(2);\n}", "function currency(num) {\r\n return new Intl.NumberFormat('en-us', {\r\n style: 'currency',\r\n currency: 'USD'\r\n }).format(num);\r\n }", "function Currency(str) {\n str = str - -0.5;\n var arr = new String(str);\n var arr1 = '';\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] != '.') {\n arr1 = arr1 + arr[i];\n }\n else {\n if (arr[i + 1] >= '5') {\n arr1[i] = arr[i] - -1;\n }\n break;\n }\n }\n var Gia = \"\";\n var dem = 0;\n for (var i = arr1.length - 1; i >= 0; i--) {\n dem++;\n Gia = Gia + arr1[i];\n if (dem == 3 && i != 0) {\n Gia = Gia + \",\";\n dem = 0;\n }\n }\n var arr2 = new String(Gia);\n var GiaMoi = '';\n for (var i = arr2.length - 1; i >= 0; i--) {\n GiaMoi = GiaMoi + arr2[i];\n }\n return GiaMoi;\n }", "function formatMoney(num){ \n return num.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n}", "function displayDollar(amount){\n\treturn \"$\" + (Math.round(amount*100)/100).toFixed(2).toString()\n}", "function formatMoney(number) {\r\n return '$ ' + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\r\n}", "function money(amt) {\n let dollars = \"$\" + Number.parseFloat(amt).toFixed(2);\n return dollars;\n}", "function convert(amount) {\n return Number(amount) * 1e12;\n}", "callback(value) {\n return formatCurrency(value, 0);\n }", "callback(value) {\n return formatCurrency(value, 4);\n }", "function convertAmount( amount ) {\n\n\t//If the amount is negative\n\tif ( amount.charAt(0) == \"-\" )\n\t{\n\t\t//Remove -$\n\t\tamount = amount.substr(2);\n\t\t//Remove any commas\n\t\tamount = amount.replace(/,/g,\"\");\n\t\t//convert to an integer in \"milli format\"\n\t\tamount = ( Number( amount ) * 1000);\n\t}\n\telse\n\t//If amount is positive\n\t{\n\t\t//Remove $\n\t\tamount = amount.substr(1);\n\t\t//Remove any commas\n\t\tamount = amount.replace(/,/g,\"\");\n\t\t//convert to an integer in \"milli format\" (negative for outflow)\n\t\tamount = ( Number( amount ) * -1000);\n\t}\n\t\n\treturn amount;\n}", "function convert_to_dollars(coinArray) {\n let dollarAmount = 0\n dollarAmount = dollarAmount + coinArray[0] * 0.25;\n dollarAmount = dollarAmount + coinArray[1] * 0.05;\n dollarAmount = dollarAmount + coinArray[2] * 0.10;\n dollarAmount = dollarAmount + coinArray[3] * 0.01;\n console.log(dollarAmount)\n return dollarAmount;\n\n}", "function NumberEU(num) {\r\n\tnum = num.replace(\",\", \".\");\r\n\treturn Number(num);\r\n}", "function convertPrice(formatPrice){\n\tstr = formatPrice.substring(0,formatPrice.length - 4);\n \tstr1 = str.replace('.','');\n \tstr2 = str1.replace('.','');\n \tstr3 = str2.replace('.','');\n \t\n \treturn str3;\n}", "function calculateConvertedCurrency() {\n\tlet fromCurr = currFrom.value;\n\tlet toCurr = currTo.value;\n\t\n\tfetch(`https://api.exchangerate-api.com/v4/latest/${fromCurr}`)\n\t\t.then(res => res.json())\n\t\t.then(res => {\n\t\tconst rate = res.rates[toCurr];\n perRate.innerText = `1 ${fromCurr} = ${rate} ${toCurr}`;\n let ans=(amountfrom.value * rate);\n\t\tamountTo.value = ans.toFixed(2);\n\t})\n}", "function currencyFormatted(n) {\n var minus = '';\n if (n < 0) { minus = '-'; }\n n = Math.abs(n);\n var s = addCommas(n.toFixed(2));\n return minus + \"$\" + s;\n}", "function taxCalculator(itemPrice){\n\n return parseInt((itemPrice * 0.085).toFixed(2));\n \n}", "function cleanNumericValueForDisplaying(num) {\n var neg;\n if (num < 0) neg = true;\n else neg = false;\n num = Math.abs(num);\n var str = num.toString();\n\n var price, cleanPrice;\n var dollars, cleanDollars;\n var dollarArray = new Array();\n var correctOrder = '';\n var cents, cleanCents;\n\n if (str.indexOf('.') != -1) {\n price = str.split('.');\n dollars = price[0];\n cents = price[1];\n if (cents.length == 1) cleanCents = cents + '0';\n else cleanCents = cents;\n var commaCount = 0;\n for (var i = dollars.length - 1; i > -1; i--) {\n commaCount++;\n dollarArray.push(dollars[i]);\n if (commaCount % 3 == 0 && i != 0) dollarArray.push('-');\n }\n\n cleanDollars = dollarArray.toString();\n while (cleanDollars.indexOf(',') != -1) {\n cleanDollars = cleanDollars.replace(',', '');\n }\n\n while (cleanDollars.indexOf('-') != -1) {\n cleanDollars = cleanDollars.replace('-', ',');\n }\n\n for (var i = cleanDollars.length - 1; i > -1; i--) {\n correctOrder += cleanDollars[i];\n }\n\n cleanPrice = '$' + correctOrder + '.' + cleanCents;\n if (neg) {\n cleanPrice = '(-' + cleanPrice + ')';\n }\n return cleanPrice;\n } else {\n var commaCount = 0;\n for (var i = str.length - 1; i > -1; i--) {\n commaCount++;\n dollarArray.push(str[i]);\n if (commaCount % 3 == 0 && i != 0) dollarArray.push('-');\n }\n cleanDollars = dollarArray.toString();\n\n while (cleanDollars.indexOf(',') != -1) {\n cleanDollars = cleanDollars.replace(',', '');\n }\n\n while (cleanDollars.indexOf('-') != -1) {\n cleanDollars = cleanDollars.replace('-', ',');\n }\n\n for (var i = cleanDollars.length - 1; i > -1; i--) {\n correctOrder += cleanDollars[i];\n }\n\n cleanPrice = '$' + correctOrder;\n\n if (neg) {\n cleanPrice = '(-' + cleanPrice + ')';\n }\n return cleanPrice;\n }\n}", "function toDollarAmount(value)\n\t{\n\t\treturn '$' + parseFloat(value, 10).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1,\").toString();\n\t}", "function formatMoney(number){\r\n\treturn '$' + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\r\n}", "function convert (amount) {\n let number = Number(amount) * 1e8;\n // remove any decimals\n number = number.toFixed(0);\n return Number(number);\n}", "function currencyConversion() {\n const euros = prompt(\"How many euros are you exchanging?\");\n const exchangeRate = prompt(\"What is the exchange rate?\");\n const amount = euros * (exchangeRate/100);\n const twoDecimal = amount.toFixed(2);\n alert(euros + ' ' + \"euros at an exchange rate of\" + ' ' + exchangeRate + ' ' + \"is\" + ' ' + twoDecimal + ' ' + \"U.S. dollars\");\n}", "function conversion(kelvin) {\n return Math.floor(kelvin * (9/5) - 459.67) + \"°F\";\n}", "function convertCurrency(currencyValue) {\n if (currentCurrency == \"INR\") {\n return currencyValue;\n } else if (currentCurrency == \"USD\") {\n return currencyValue / currency.USDINR;\n } else {\n return currencyValue * currency.USDJPY / currency.USDINR;\n }\n}", "function priceInCents(price) {\n return Math.round(price * 100);\n}", "function unformatMoney(money) {\n return parseFloat(money.replace(/[$,]/g, \"\"));\n }", "function fomartMoney(number) {\n\treturn '$' + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,')\n}", "function usd(amount) {\n // return +(parseFloat(amount).toFixed(4));\n return +(parseFloat(amount).toFixed(2)); // Reducing Price Precision\n}", "function formatPrice(price, currency) {\n price = Number(price); //Convert to number in case its a string\n if(isNaN(price) || typeof currency !== \"string\") {\n throw new Error(\"Please supply current arguments\");\n }\n return `${currency}${price.toFixed(2)}`;\n}", "function convertToCelcius(x){\n let kelvin = 273.15;\n let temp = x - kelvin; \n temp = Math.round(temp);\n return temp;\n}", "function roundCurrency(amount) {\n return Math.round(amount * 100)/ 100;\n\n}", "function format_price(price) {\n\treturn (Math.round( price * 100 ) / 100).toFixed(2);\n}", "function formatMoney(num) {\n return '£ ' + num.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n}", "function converter(){\n var valorEmDolar= window.document.getElementById(\"txtn1\")\n var res = window.document.getElementById(\"res\")\n \n var valorEmDolarNumber = parseFloat(valorEmDolar.value)\n var taxa = 5.50\n var valorEmReal= valorEmDolarNumber * taxa\n res.innerHTML =' O valor em real é R$ ' + valorEmReal.toFixed(2)\n}" ]
[ "0.7718889", "0.75523186", "0.7517815", "0.75133", "0.7273224", "0.7204205", "0.70954895", "0.7047062", "0.69806165", "0.69283384", "0.69272465", "0.69200283", "0.6892008", "0.68343306", "0.68201447", "0.681075", "0.6803525", "0.67761314", "0.6742312", "0.6741504", "0.67400306", "0.6736792", "0.6725499", "0.6717963", "0.6707017", "0.66755056", "0.6667433", "0.6651093", "0.66451895", "0.6643601", "0.66378814", "0.66158134", "0.66043884", "0.6580497", "0.6580497", "0.65793", "0.6578829", "0.6574221", "0.65730196", "0.65590864", "0.6549115", "0.6530288", "0.6518939", "0.65177643", "0.6509817", "0.64987797", "0.64943975", "0.64870924", "0.645878", "0.6455782", "0.64472735", "0.64379656", "0.64342594", "0.6427474", "0.6424461", "0.6413408", "0.6404439", "0.6400691", "0.64004564", "0.63920075", "0.6366238", "0.6363068", "0.6361826", "0.6356904", "0.6356658", "0.6351288", "0.63447994", "0.63359064", "0.6332286", "0.6327195", "0.63245213", "0.6319043", "0.63184756", "0.63135993", "0.63108885", "0.6307329", "0.63035876", "0.6299691", "0.6295687", "0.62929595", "0.62903595", "0.628336", "0.6274508", "0.6264631", "0.625117", "0.62344897", "0.6233469", "0.6229266", "0.6227434", "0.62270164", "0.62258905", "0.6209811", "0.6204937", "0.6203365", "0.61993253", "0.6198989", "0.61900496", "0.61856204", "0.618437", "0.61842245" ]
0.8191923
0
Euro To Pond CONVERT FUNCTION
function euroTopond() { var euro2pond = 0.85; var bedrag = document.querySelector("#bedrag").value; document.getElementById("convert").value = (bedrag * euro2pond).toFixed(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pond2euro() {\n var pond2euro = 1.17;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * pond2euro).toFixed(2);\n\n }", "function dollarToeuro() {\n var dollar2euro = 0.91;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * dollar2euro).toFixed(2);\n\n }", "function euroTodollar() {\n var euro2dollar = 1.10;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * euro2dollar).toFixed(2);\n\n }", "function toCurrency(){\n\n}", "function CurrencyConvert(v,idx,full) {\n if(idx==undefined) idx = 0;\n var c = CurrencyData[idx];\n v = parseInt(10000*v/c[2])/10000;\n if(v>1 && v<1000) v=parseInt(10*v)/10;\n if(v>=1000 && v<10000) v=parseInt(v/1000)+\"千\";\n else if(v>=10000 && v<100000000) v=parseInt(v/10000)+\"萬\";\n else if(v>=100000000 && v<1000000000000) v=parseInt(v/100000000)+\"億\";\n else if(v>=1000000000000) v=parseInt(v/1000000000000)+\"兆\";\n return v+(full?c[0]+c[1]:\"\");\n }", "function ConverterEuro() {\n var valorElemento = document.getElementById(\"valor\");\n var valor = valorElemento.value;\n var valorEmDolarNumerico = parseFloat(valor);\n var valorEmEuro = valorEmDolarNumerico * 0.85;\n var elementoValorConvertio = document.getElementById(\"valorConvertido\");\n var valorConvertido = \"O resultado em euro é € \" + valorEmEuro + \".\";\n elementoValorConvertio.innerHTML = valorConvertido;\n}", "function conversion(kelvin) {\n return Math.floor(kelvin * (9/5) - 459.67) + \"°F\";\n}", "function currencyConversion(euros, exchangeRate) {\n const amount = euros * (exchangeRate / 100);\n const twoDecimal = amount.toFixed(2);\n return euros + ' ' + \"euros at an exchange rate of\" + ' ' + exchangeRate + ' ' + \"is\" + ' ' + twoDecimal + ' ' + \"U.S. dollars\";\n}", "function Currency(str) {\n str = str - -0.5;\n var arr = new String(str);\n var arr1 = '';\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] != '.') {\n arr1 = arr1 + arr[i];\n }\n else {\n if (arr[i + 1] >= '5') {\n arr1[i] = arr[i] - -1;\n }\n break;\n }\n }\n var Gia = \"\";\n var dem = 0;\n for (var i = arr1.length - 1; i >= 0; i--) {\n dem++;\n Gia = Gia + arr1[i];\n if (dem == 3 && i != 0) {\n Gia = Gia + \",\";\n dem = 0;\n }\n }\n var arr2 = new String(Gia);\n var GiaMoi = '';\n for (var i = arr2.length - 1; i >= 0; i--) {\n GiaMoi = GiaMoi + arr2[i];\n }\n return GiaMoi;\n }", "function convertPrice(price){\n return new Intl.NumberFormat('ru-RU').format(Math.round(price));\n}", "function convertToCurrency(num) {\n return \"AUD \" + num.toFixed(2);\n}", "convert() {\n return `${(this.payments.type.price[this.currencyType] / 100)}`;\n }", "convert($geez_number) {\n const $parsed = this.parse($geez_number);\n\n return this.calculate($parsed);\n }", "function convertToCelsius(num){\n return (num - 32) * 5 / 9;\n}", "function cvtC(p){\n\tvar s = \"$\";\n\t s+= Number(p.toFixed(2) ).toLocaleString();\n\treturn s;\n}", "function convertMoney(money) {\n return `$ ${money.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")}`\n}", "changePrice() {\n var parts = this.precio.toFixed(2).toString().split(\".\");\n var result = parts[0].replace(/\\B(?=(\\d{3})+(?=$))/g, \".\") + (parts[1] ? \",\" + parts[1] : \"\");\n return `$${result}`;\n }", "function convert (c) {\n \n var f=(9*c/5) + 32;\n return c + '°C is ' + f + '°F';\n \n \n}", "function convertX(p) {\r\n return 0.2504 * p - 381.399\r\n}", "function convert(){\r\nvar fsub = f.value-32;\r\nvar fdiv = fsub/1.8;\r\n c.innerHTML=fdiv+\"°C\";\r\n}", "function formatNumberToIndianRupee ( number, options ) {\n\n\tif ( ! number )\n\t\treturn 0;\n\n\toptions = options || { };\n\tvar formattedNumber;\n\n\tnumber = parseStringToNumber( number );\n\tvar roundedNumber = number.toFixed( 0 );\n\tvar integerAndFractionalParts = ( roundedNumber + \"\" ).split( \".\" );\n\tvar integerPart = integerAndFractionalParts[ 0 ];\n\tvar fractionalPart = integerAndFractionalParts[ 1 ];\n\n\tvar lastThreeDigitsOfIntegerPart = integerPart.slice( -3 );\n\tvar allButLastThreeDigitsOfIntegerPart = integerPart.slice( 0, -3 );\n\n\tformattedNumber = allButLastThreeDigitsOfIntegerPart.replace( /\\B(?=(\\d{2})+(?!\\d))/g, \",\" );\n\n\tif ( allButLastThreeDigitsOfIntegerPart ) {\n\t\tformattedNumber += \",\";\n\t}\n\tformattedNumber += lastThreeDigitsOfIntegerPart;\n\n\tif ( fractionalPart ) {\n\t\tformattedNumber += \".\" + fractionalPart;\n\t}\n\n\tvar symbol = options.symbol === false ? \"\" : \"₹\";\n\tif ( /^-/.test( formattedNumber ) ) {\n\t\tformattedNumber = formattedNumber.replace( /^-/, \"minus \" + symbol );\n\t}\n\telse {\n\t\tformattedNumber = symbol + formattedNumber;\n\t}\n\n\treturn formattedNumber;\n\n}", "function convertirDolarAEuro() {\n var listaPrecios = $('.precioProducto');\n var listaPreciosLength = listaPrecios.length;\n\n var _loop = function _loop(i) {\n $.getJSON(urlBasica.forex, {\n quantity: parseInt($(listaPrecios[i]).text(), 10),\n api_key: apiKey.Forex,\n format: 'json'\n }).done(function (response) {\n var posA = response.text.indexOf(' USD');\n var dolar = (response.text + \"\").substring(0, posA);\n var eur = response.value.toFixed(2);\n $(listaPrecios[i]).text(eur + '\\u20AC');\n });\n };\n\n for (var i = 0; i < listaPreciosLength; i += 1) {\n _loop(i);\n }\n}", "function convertirDolarAEuro() {\n const listaPrecios = $('.precioProducto');\n const listaPreciosLength = listaPrecios.length;\n for (let i = 0; i < listaPreciosLength; i += 1) {\n $.getJSON(urlBasica.forex, {\n quantity: parseInt($(listaPrecios[i]).text(), 10),\n api_key: apiKey.Forex,\n format: 'json',\n }).done(function (response) {\n const posA = (response.text).indexOf(' USD');\n const dolar = (response.text+\"\").substring(0, posA);\n const eur = response.value.toFixed(2);\n $(listaPrecios[i]).text(`${eur}€`);\n });\n }\n}", "function convertRate(price) {\n if (gCurrLang === 'he') {\n return price * gExcangeRates.quotes.USDILS\n } else if (gCurrLang === 'en') {\n return price\n }\n}", "function convertToPennies(AmountFieldValue) {\n // if there is '£' sign only then the value is in GBP style.\n // Also, if there is a combination of both '£' and 'p' it will be in GBP style.\n //\n if (isValidInput(AmountFieldValue)) {\n var newAmountVal = cleanAmountText(AmountFieldValue);\n\n if (AmountFieldValue.charAt(0) == '£' || (AmountFieldValue.charAt(0) == '£' && AmountFieldValue.charAt(AmountFieldValue.length - 1) == 'p')) {\n //number is in GBP style\n return (Math.floor(parseFloat(newAmountVal) * 100));\n } else if (AmountFieldValue.charAt(AmountFieldValue.length - 1) == 'p' && newAmountVal.indexOf(\".\") == -1) {\n // if the input doesn't have a floating point, then it is Pennies style.\n // No conversion required!\n return (Math.floor(parseFloat(newAmountVal)));\n } else if (AmountFieldValue.charAt(AmountFieldValue.length - 1) == 'p' && newAmountVal.indexOf(\".\") >= 0) {\n // if the input has a floating point, then it is GBP style and it needs to be converted.\n return (Math.floor(parseFloat(newAmountVal) * 100));\n } else if (newAmountVal.indexOf(\".\") >= 0) {\n // if the input has a floating point, then it is GBP style and it needs to be converted.\n return (Math.floor(parseFloat(newAmountVal) * 100));\n } else {\n // if the input doesn't have a floating point, '£' or 'p', then it is Pennies style.\n // No conversion required!\n return (Math.floor(parseFloat(newAmountVal)));\n }\n } else {\n // the input does not match the input pattern\n return -1;\n }\n\n}", "function formatEuroNumber(number) {\r\n\tvar str = String(number);\r\n\tvar res;\r\n\tif(str) {\r\n\t\tres = \"&euro; \" + str;\r\n\t}\r\n\treturn res;\r\n}", "function parseEuroNumber(number) {\r\n\t// number muss ein String sein!\r\n\tvar str = String(number);\r\n\tvar res;\r\n\tif(str) {\r\n\t\tstr = str.replace(\"EUR\", \"\");\r\n\t\tstr = str.replace(\"&euro;\", \"\");\r\n\t\tres = str;\r\n\t}\r\n\treturn res;\r\n}", "function ConverterLibra() {\n var valorElemento = document.getElementById(\"valor\");\n var valor = valorElemento.value;\n var valorEmDolarNumerico = parseFloat(valor);\n var valorEmLibra = valorEmDolarNumerico * 0.72;\n var elementoValorConvertio = document.getElementById(\"valorConvertido\");\n var valorConvertido = \"O resultado em libra é £ \" + valorEmLibra + \".\";\n elementoValorConvertio.innerHTML = valorConvertido;\n}", "function convert(){\n var c = document.querySelector(\"#c\").value;\n var f = c * 9/5 +32;\n document.querySelector(\"h3\").innerHTML = \"Result: \" + f+ \"°\"+ \"F\";\n}", "function PWM_Func_DecimalPrice(Price, Format) {\n try {\n\n ///int\n var nPrice = 0, nFrac1 = 0, nFrac2 = 0, nFrac3 = 0;\n //Decimal\n //var dPrice = 0M;\n var dPrice = 0;\n //string[]\n var PriceParts = Price.toString().split('#');\n\n if (PriceParts.length > 0) {\n for (var index = 0; index < PriceParts.length; index++) {\n if (index == 0)\n nPrice = parseInt(PriceParts[index]);\n else if (index == 1) {\n if (Format < 16)\n nFrac1 = parseInt(PriceParts[index].substring(0, PriceParts[index].indexOf(\"/\")));\n else\n nFrac1 = parseInt(PriceParts[index]);\n }\n else if (index == 2)\n nFrac2 = parseInt(PriceParts[index]);\n else if (index == 3)\n nFrac3 = parseInt(PriceParts[index]);\n }\n dPrice = parseFloat(nPrice);\n if (Format == 0) //1/2=eHalfs\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/2\" + \"^\" + (dPrice + parseFloat(nFrac1) / 2));\n }\n else if (Format == 1) //1/4=eQuarters\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/4\" + \"^\" + (dPrice + parseFloat(nFrac1) / 4));\n }\n else if (Format == 2) //1/8=eEighths\n {\n return (nPrice + \"'\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 8));\n }\n else if (Format == 3) //1/16=eSixteenths\n {\n if (nFrac1 == 0)\n return (nPrice + \"''00\" + \"^\" + dPrice);\n else if (nFrac1 > 0 && nFrac1 < 10)\n return (nPrice + \"''0\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n else\n return (nPrice + \"''\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n }\n else if (Format == 4) //1/32=eThirtySeconds\n {\n if (nFrac1 == 0)\n return (nPrice + \"-00\" + \"^\" + dPrice);\n else if (nFrac1 > 0 && nFrac1 < 10)\n return (nPrice + \"-0\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n else\n return (nPrice + \"-\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n }\n else if (Format == 5) //1/64=eSixtyFourths\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/64\" + \"^\" + (dPrice + parseFloat(nFrac1) / 64));\n }\n else if (Format == 6) //1/128=eOneTwentyEights\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/128\" + \"^\" + (dPrice + parseFloat(nFrac1) / 128));\n }\n else if (Format == 7) //1/256=eTwoFiftySixths\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/256\" + \"^\" + (dPrice + parseFloat(nFrac1) / 256));\n }\n else if (Format == 8) {\n if (nFrac2 == 4) // if 2nd fraction is 4 then display \"+\" after 1st fraction\n {\n return (nPrice + \"-\" + ((nFrac1 == 0) ? \"00\" : nFrac1.toString()) + \"+\" + \"^\" + (dPrice + parseFloat(nFrac1) / 32 + parseFloat(0.031250 / 8 * nFrac2)));\n }\n else if (nFrac2 == 0) //if 2nd fraction is 0 then no need to display 2nd fraction\n {\n return (nPrice + \"-\" + ((nFrac1 == 0) ? \"00\" : nFrac1.toString()) + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n }\n else //show 2nd fraction after 1st fraction and dot\n {\n return (nPrice + \"-\" + ((nFrac1 == 0) ? \"00\" : nFrac1.toString()) + \".\" + nFrac2 + \"^\" + (dPrice + parseFloat(nFrac1) / 32 + parseFloat(0.031250 / 8 * nFrac2)));\n }\n }\n else if (Format == 9) //1/4R=eQuartersReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 == 2)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 4) + \"^\" + (dPrice + parseFloat(nFrac1) / 4));\n else\n return (nPrice + \"-\" + nFrac1 + \"/4\" + \"^\" + (dPrice + parseFloat(nFrac1) / 4));\n }\n else if (Format == 10) //1/8R=eEighthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 8) + \"^\" + (dPrice + parseFloat(nFrac1) / 8));\n else\n return (nPrice + \"-\" + nFrac1 + \"/8\" + \"^\" + (dPrice + parseFloat(nFrac1) / 8));\n }\n else if (Format == 11) //1/16R=eSixteenthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 16) + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n else\n return (nPrice + \"-\" + nFrac1 + \"/16\" + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n }\n else if (Format == 12) //1/32R=eThirtySecondsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 32) + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n else\n return (nPrice + \"-\" + nFrac1 + \"/32\" + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n }\n else if (Format == 13) //1/64R=eSixtyFourthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 64) + \"^\" + (dPrice + parseFloat(nFrac1) / 64));\n else\n return (nPrice + \"-\" + nFrac1 + \"/64\" + \"^\" + (dPrice + parseFloat(nFrac1) / 64));\n }\n else if (Format == 14) //1/128R=eOneTwentyEightsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 128) + \"^\" + (dPrice + parseFloat(nFrac1) / 128));\n else\n return (nPrice + \"-\" + nFrac1 + \"/128\" + \"^\" + (dPrice + parseFloat(nFrac1) / 128));\n }\n else if (Format == 15) //1/256R=eTwoFiftySixthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 256) + \"^\" + (dPrice + parseFloat(nFrac1) / 256));\n else\n return (nPrice + \"-\" + nFrac1 + \"/256\" + \"^\" + (dPrice + parseFloat(nFrac1) / 256));\n }\n else if (Format == 16) //1=e0DecimalPlaces\n {\n return (nPrice + \"^\" + dPrice);\n }\n else if (Format == 17) //0.1=e1DecimalPlace\n {\n return (nPrice + \".\" + (nFrac1.toString()).substring(0, 1) + \"^\" + dPrice + \".\" + nFrac1);\n }\n else if (Format == 18) //0.01=e2DecimalPlaces\n {\n return (nPrice + \".\" + nFrac1 + (nFrac2.toString()).substring(0, 1) + \"^\" + dPrice + \".\" + nFrac1 + nFrac2);\n }\n else if (Format == 19) //0.001=e3DecimalPlaces\n {\n return (nPrice + \".\" + nFrac1 + nFrac2 + (nFrac3.toString()).substring(0, 1) + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + nFrac3);\n }\n else if (Format == 20) //0.001=eFurtureRateHalfs\n {\n if (nFrac3 == 0)\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"^\" + dPrice + \".\" + nFrac1 + nFrac2);\n else\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"+\" + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + \"5\");\n }\n else if (Format == 21) //0.001=eFurtureRateQuarters\n {\n if (nFrac3 == 0)\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"^\" + dPrice + \".\" + nFrac1 + nFrac2);\n else if (nFrac3 == 2)\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"+\" + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + \"5\");\n else\n return (nPrice + \".\" + nFrac1 + nFrac2 + \".\" + nFrac3 + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + ((nFrac3 == 1) ? \"25\" : \"75\"));\n }\n }\n }\n catch (err) {\n PWM_Func_HandleJsError(\"PWM_Func_DecimalPrice\", err);\n }\n}", "function Converter(currency, input) {\n\n if (isNaN(input)) {\n number.value = null;\n alert('Nazadal jsi cislo');\n }\n\n switch (currency) {\n\n case 'USD':\n\n usd = 23.61777;\n return (input / usd).toFixed(2) + ' $';\n case 'EUR':\n\n eur = 25.840273;\n return (input / eur).toFixed(2) + ' €';\n\n case 'PLN':\n\n pln = 5.89558584;\n return (input / pln).toFixed(2) + ' zł';\n }\n}", "function formatCurrency(num,dec) {\n\tvar parteEntera = '';\n\tvar parteDecimal = '';\n\t\n\tif(dec==undefined){dec=0;}\n\t\n\tvar auxNum = num + '';\n\tvar bDec = false;\n\tfor(m=0;m<auxNum.length;m++){\n\t\tif(auxNum.charAt(m) == \".\"){\n\t\t\tbDec = true;\n\t\t}else{\n\t\t\tif(bDec == true){\n\t\t\t\tparteDecimal += auxNum.charAt(m);\n\t\t\t}else{\n\t\t\t\tparteEntera += auxNum.charAt(m);\n\t\t\t}\t\n\t\t}\n\t}\n\t\n parteEntera = parteEntera.toString().replace(/\\$|\\,/g,'');\n if(isNaN(parteEntera))\n parteEntera = \"0\";\n sign = (parteEntera == (parteEntera = Math.abs(parteEntera)));\n parteEntera = Math.floor(parteEntera*100+0.50000000001);\n parteEntera = Math.floor(parteEntera/100).toString();\n for (var i = 0; i < Math.floor((parteEntera.length-(1+i))/3); i++)\n parteEntera = parteEntera.substring(0,parteEntera.length-(4*i+3))+'.'+\n parteEntera.substring(parteEntera.length-(4*i+3));\n parteEntera = (((sign)?'':'-') + parteEntera);\n\t\n\tvar resultado = parteEntera;\n\tif(dec>0){\n\t\tresultado+= ',' + parteDecimal;\n\t\tfor(m=parteDecimal.length;m<dec;m++){\n\t\t\tresultado+= '0';\n\t\t}\n\t}\n\t\n\treturn resultado;\n}", "function convert (celsius){\n var fahrenheit = ((celsius * 9/5) +32);\n console.log(celsius +\" degrees celsius equates to: \"+fahrenheit + \" \"+ \"fahrenheit\");\n }", "function convertToNumber(numText) {\n var number;\n number = numText.replace('€', '');\n number = number.replace(',', '.');\n number = number.replace('.', ' ');\n number = parseFloat(number);\n\n if (number != 'NaN') {\n return number;\n } else {\n return 0;\n }\n }", "function convertCurrencyCalculator (value) {\n\n\n\n\t}", "function formatPrice(num)\n{\n\t num = num.toString().replace(/\\$|\\,/g,'');\n\t if(isNaN(num))\n\t num = \"0\";\n\t sign = (num == (num = Math.abs(num)));\n\t num = Math.floor(num*100+0.50000000001);\n\t cents = num%100;\n\t num = Math.floor(num/100).toString();\n\t if(cents<10)\n\t cents = \"0\" + cents;\n\t for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)\n\t num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));\t \n\t //return (((sign)?'':'-') + '<?php //echo $this->model_superadmin->generate_isocode_bo()?> ' + num + ',' + cents);\n\t return (((sign)?'':'-') + 'Rp. '+ num +',00');\n}", "function convertToEpic(input) {\n\tswitch (input) {\n\t\tcase 0:\n\t\toutput = 0;\n\t\tbreak;\n\t\tcase 1:\n\t\toutput = 1;\n\t\tbreak;\n\t\tcase 2:\n\t\toutput = 2;\n\t\tbreak;\n\t\tcase 3:\n\t\toutput = 4;\n\t\tbreak;\n\t\tcase 4:\n\t\toutput = 7;\n\t\tbreak;\n\t\tcase 5:\n\t\toutput = 11;\n\t\tbreak;\n\t\tcase 6:\n\t\toutput = 16;\n\t\tbreak;\n\t\tcase 7:\n\t\toutput = 22;\n\t\tbreak;\n\t\tcase 8:\n\t\toutput = 29;\n\t\tbreak;\n\t\tcase 9:\n\t\toutput = 37;\n\t\tbreak;\n\t\tcase 10:\n\t\toutput = 46;\n\t\tbreak;\n\t}\n\treturn output;\n}", "function convertToCelcius(x){\n let kelvin = 273.15;\n let temp = x - kelvin; \n temp = Math.round(temp);\n return temp;\n}", "function getOuncesFromPounds(pounds) {\nreturn pounds * 16;\n\n}", "function formatCurrency(num) {\n return 'PKR ' + (num).toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n}", "function convert(amount) {\n return Number(amount) * 1e12;\n}", "function priceConversion(productPrice) {\n return Intl.NumberFormat(\"fr-FR\", {\n style: \"currency\",\n currency: \"EUR\",\n minimumFractionDigits: 2,\n }).format(`${productPrice}` / 100);\n}", "function converter(){\n var valorEmDolar= window.document.getElementById(\"txtn1\")\n var res = window.document.getElementById(\"res\")\n \n var valorEmDolarNumber = parseFloat(valorEmDolar.value)\n var taxa = 5.50\n var valorEmReal= valorEmDolarNumber * taxa\n res.innerHTML =' O valor em real é R$ ' + valorEmReal.toFixed(2)\n}", "kelvinToCelsius(kelvin) {\n return Math.floor(kelvin - 273) + \" °C\"\n }", "function NumberEU(num) {\r\n\tnum = num.replace(\",\", \".\");\r\n\treturn Number(num);\r\n}", "function convert(montantTtc, tauxDollar = 1.1032 ){\n return montantTtc * tauxDollar;\n}", "function convertPrice(formatPrice){\n\tstr = formatPrice.substring(0,formatPrice.length - 4);\n \tstr1 = str.replace('.','');\n \tstr2 = str1.replace('.','');\n \tstr3 = str2.replace('.','');\n \t\n \treturn str3;\n}", "function convert(num) {\n\n\n}", "function eurfunc()\r\n{\r\n inr.value = parseFloat(eur.value) * 1.43448;\r\n usd.value = parseFloat(eur.value) * 0.70641;\r\n cad.value = parseFloat(eur.value) * 0.72037;\r\n aud.value = parseFloat(eur.value) * 0.62382;\r\n}", "function ConvertToPersian(number){\r\n const persian = { 0: '۰', 1: '۱', 2: '۲', 3: '۳', 4: '۴', 5: '۵', 6: '۶', 7: '۷', 8: '۸', 9: '۹' };\r\n let PersianNumber='';\r\n \r\n const numberAsText=number.toString();\r\n\r\n for (let i=0;i<numberAsText.length;i++){\r\n PersianNumber+=persian[+numberAsText[i]];\r\n }\r\n\r\n return PersianNumber \r\n}", "function convertToCelsius(fahrenheit){\n let temp = (Number(fahrenheit)-32) * 5/9;\n return temp.toFixed(2);\n }", "static formatCurrency(x) {\n return \"₱\" + x.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "formatCurrency(value) {\n // get signal\n const signal = Number(value) < 0 ? '-' : ''\n //clean string\n // \\D -> Encontre tudo que náo é number\n value = String(value).replace(/\\D/g, '')\n // convert \n value = Number(value) / 100\n value = value.toLocaleString(\"pt-BR\", {\n style: \"currency\",\n currency: \"BRL\"\n })\n\n return signal + value\n }", "function numtocurrency(num) {\n num = num.toString().replace(/\\$|\\./g, '');\n\n if (isNaN(num)) num = \"0\";\n\n sign = (num == (num = Math.abs(num)));\n num = Math.floor(num * 100 + 0.50000000001);\n cents = num % 100;\n num = Math.floor(num / 100).toString();\n\n if (cents == 0) cents = '';\n else if (cents < 10) cents = \",0\" + cents;\n else cents = ',' + cents;\n\n for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)\n num = num.substring(0, num.length -(4 * i + 3)) + '.' + num.substring(num.length - (4 * i + 3));\n\n return(((sign) ? '' : '-') + num + cents);\n}", "function getPeso (adcvalue, devider) {\n\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t return ((((parseInt(adcvalue)/devider) * 230)/1000)/3600) *12\n\n\t\t\t\t\t\t\t\t\t\t }", "function engToJp(x) {\r\n var intermediateValue = x;\r\n var japaneseValue = \"\";\r\n for (i = 0; i < units.length; i++) {\r\n // console.log(units[i]);\r\n if ((intermediateValue / units[i][0]) >= 1) {\r\n japaneseValue += Math.floor(intermediateValue / units[i][0]) + units[i][1];\r\n // console.log(japaneseValue);\r\n intermediateValue = (intermediateValue % units[i][0]);\r\n // console.log(intermediateValue);\r\n };\r\n };\r\n return japaneseValue + intermediateValue;\r\n}", "function virgulaToPonto(valor) {\n var retorno = valor;\n while (retorno.indexOf(',') > - 1)\n retorno = retorno.replace(',', '.');\n\n return retorno;\n}", "function celsius2Kelvin(celsius)\n{\n //+ will become string\n return celsius + 273;\n}", "function money2DecimalString(m){\n if (typeof m === 'undefined') return NaN;\n var v;\n var p = m;\n if (typeof p == 'string')\n {\n p = money2DecimalArr(m);\n }\n if (typeof p == 'number' && isNaN(p))\n {\n return p;\n }\n if (p.invalid)\n {\n return NaN;\n }\n \n p.left = parseInt('0'+p.left,10);\n \n if (p.left && p.right)\n {\n v = p.left+'.'+p.right;\n }\n else if (p.right)\n {\n v = '0.'+p.right;\n }\n else if (p.left)\n {\n v = p.left;\n }\n else\n {\n v = '0';\n }\n if (p.negative && v!=='0')\n {\n v = '-'+v;\n }\n return v;\n}", "function kelvinToCelcius(K){\n return parseInt(K) - parseInt(273);\n}", "function convertToRupiah(value, currencyType) {\n switch (currencyType) {\n case \"yen\":\n return `$${value} yen = Rp.${value * 129.88}`;\n case \"usd\":\n return `${value} USD = Rp.${value * 14272.67}`;\n case \"euro\":\n return `${value} EUR = Rp.${value * 16932.8}`;\n default:\n return \"no match type currency\";\n }\n}", "convertirViento(viento) {\n return Math.round(viento * 3.6 * 10) / 10;\n }", "callback(value) {\n return formatCurrency(value, 4);\n }", "function inicializarPrototipos() {\n\n\tString.prototype.toPriceEntero = function () {\n\n\t\t// Este metodo convierte el string a un numero de la forma 123.321,50\n\t\tvar v;\n\t\tif (/^\\d+(,\\d+)$/.test(this))\n\t\t\tv = this.replace(/,/, '.');\n\t\telse if (/^\\d+((,\\d{3})*(\\.\\d+)?)?$/.test(this))\n\t\t\tv = this.replace(/,/g, \"\");\n\t\telse if (/^\\d+((.\\d{3})*(,\\d+)?)?$/.test(this))\n\t\t\tv = this.replace(/\\./g, \"\").replace(/,/, \".\");\n\t\tvar x = parseFloat(v).toFixed(2).toString().split(\".\"),\n\t\tx1 = x[0],\n\t\tx2 = ((x.length == 2) ? \",\" + x[1] : \".00\"),\n\t\texp = /^([0-9]+)(\\d{3})/;\n\t\twhile (exp.test(x1))\n\t\t\tx1 = x1.replace(exp, \"$1\" + \".\" + \"$2\");\n\t\treturn x1 + x2;\n\t}\n\n\tString.prototype.toPriceSinComa = function () {\n\n\t\t// Este metodo convierte el string a un numero de la forma 123.321\n\t\tvar v;\n\t\tif (/^\\d+(,\\d+)$/.test(this))\n\t\t\tv = this.replace(/,/, '.');\n\t\telse if (/^\\d+((,\\d{3})*(\\.\\d+)?)?$/.test(this))\n\t\t\tv = this.replace(/,/g, \"\");\n\t\telse if (/^\\d+((.\\d{3})*(,\\d+)?)?$/.test(this))\n\t\t\tv = this.replace(/\\./g, \"\").replace(/,/, \".\");\n\t\t//var x = parseFloat(v).toFixed(2).toString().split(\".\"),\n\t\tvar x = parseFloat(v).toFixed(0).toString(),\n\t\t\t//x1 = x[0],\n\t\t\tx1 = x,\n\t\t\texp = /^([0-9]+)(\\d{3})/;\n\t\twhile (exp.test(x1))\n\t\t\tx1 = x1.replace(exp, \"$1\" + \".\" + \"$2\");\n\t\treturn x1;\n\t}\n\t\n\tString.prototype.validarMail = function(){\n\t//Regresa TRUE si el mail esta bien formado, FALSE en caso contrario\t\n\t\tvar emailReg = /^([\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4})?$/;\n\t\tif( !emailReg.test(this) )\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}\n\n\tString.prototype.validarPassword = function(){\n\t//Regresa TRUE si la contrasenia es segura, FALSE en caso contrario\n\n\t\tvar passRegExp = /(?=^.{8,}$)((?=.*\\d)|(?=.*\\W+))(?![.\\n])(?=.*[A-Z])(?=.*[a-z]).*$/;\n\t\tif (passRegExp.test(this))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\n\tString.prototype.validarFecha = function( ){\n\t\t//Validar el formato de la fecha, y que sea una fecha valida\n\t\t\n\t\tfunction daysInFebruary (year){\n\t\t\treturn (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );\n\t\t}\n\t\t\n\t\tvar formato = this.split('/');\n\n\t\tvar dia = parseInt(formato[0]);\t\n\t\tvar mes = parseInt(formato[1]);\n\t\tvar anio = parseInt(formato[2]);\n\t\t\n\t\tvar diasEnMes = [31,daysInFebruary(anio),31,30,31,30,31,31,30,31,30,31];\n\t\t\n\t\tmes--;\n\t\t\n\t\tif (1900 < anio && anio < 2100){\n\t\t\tif (0 <= mes && mes <= 11){\n\t\t\t\tif (0 < dia && dia <= diasEnMes[mes]){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\tString.prototype.isNumeric = function( ){\n\n\t\tif (this == undefined)\n\t\t\treturn false\n\n\t\tvar validChars = '0123456789.';\n\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tif(validChars.indexOf(this.charAt(i)) == -1)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tString.prototype.isDuracion = function( ){\n\n\t\tif (this == undefined)\n\t\t\treturn false\n\n\t\tvar validChars = '0123456789:';\n\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tif(validChars.indexOf(this.charAt(i)) == -1)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\tString.prototype.esSimboloMatematico = function( ){\n\n\t\tif (this == undefined)\n\t\t\treturn false\n\n\t\tvar validChars = '()+-*/';\n\n\t\tfor(var i = 0; i < this.length; i++) {\n\t\t\tvar caracter = this.charAt(i);\n\t\t\tif(validChars.indexOf(caracter) != -1)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\t\n\tString.prototype.reemplazarComas = function( ) {\n\t\tvar resultado = this;\n\t\tif (resultado != \"\") {\n\t\t\twhile (resultado.search(',') != -1) {\n\t\t\t\tresultado = resultado.replace(\",\",\".\");\n\t\t\t}\n\t\t}\n\t\treturn resultado;\n\t}\n\t\n\tString.prototype.quitarTildesYOtros = function() { \n\t\n\t\tvar from = \"ÃÀÁÄÂÈÉËÊÌÍÏÎÒÓÖÔÙÚÜÛãàáäâèéëêìíïîòóöôùúüûÇç\",\n\t\t\tto = \"AAAAAEEEEIIIIOOOOUUUUaaaaaeeeeiiiioooouuuucc\",\n\t\t\tmapping = {};\n\t \n\t\tfor(var i = 0, j = from.length; i < j; i++ )\n\t\t\tmapping[ from.charAt( i ) ] = to.charAt( i );\n\t\t\n\t\tvar str = this;\n\t\tvar ret = [];\n\t\tfor( var i = 0, j = str.length; i < j; i++ ) {\n\t\t\tvar c = str.charAt( i );\n\t\t\tif( mapping.hasOwnProperty( str.charAt( i ) ) )\n\t\t\t\tret.push( mapping[ c ] );\n\t\t\telse\n\t\t\t\tret.push( c );\n\t\t}\n\t\treturn ret.join( '' );\n\t} \n\n\tArray.prototype.moverElemento = function(index, nuevoIndex){\n\n\t\t// Este metodo mueve el elemento que esta en la posicion index\n\t\t// a la posicion nuevoIndex, y conserva la posicion de los demas elementos\n\n\t\t// Por ejemplo:\n\t\t// myarray = {0,1,2,3,4,5}\n\t\t// myarray.moverElemento(5, 0); Mueve el elemento de la posicion 5 a la 0\n\t\t// conservando la posicion de los demas elementos\n\t\t// myarray = {5,0,1,2,3,4}\n\n\t\tvar copiaElem = this.splice(index,1);\n\t\tthis.splice(nuevoIndex,0,copiaElem[0]);\n\n\t\treturn true;\n\t};\n\t\n\tArray.prototype.obtenerPosicionPorID = function(id) {\n\t//Devuelve la posicion del elemento con id = id si existe\n\t//en caso contrario retorna -1\n\t\tfor (var i = 0; i < this.length; i++) {\n\t\t\tif (this[i].id == id)\n\t\t\t\treturn i;\n\t\t};\n\t\treturn -1;\n\t};\n\n\tArray.prototype.clear = function() {\n\t\n\t\twhile (this.length > 0) {\n\t\t\tthis.pop();\n\t\t}\n\t};\n\t\n\tArray.prototype.contains = function(otro) {\n\t\tfor(var i =0; i< this.length; i++){\n\t\t\tif(this[i] == otro){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t};\n}", "function convertAmountToTetri(amount) {\n return amount * 100;\n}", "function formatUang(number) {\n //code here\n var hasil = 'Rp.'\n var split = number.toString().split('')\n var temp = ''\n\n for (var i = split.length - 1; i >= 0; i--) {\n if (i === split.length - 1) {\n temp += '00,' +split[i]\n } else if (i === split.length - 4 || i === split.length - 7) {\n temp += '.' + split[i]\n } else {\n temp += split[i]\n }\n }\n\n var arrTemp = temp.split('')\n\n for (var j = arrTemp.length - 1; j >= 0; j--) {\n hasil+= arrTemp[j]\n }\n return hasil\n}", "convertHandler($) {\n var convert = $.message.text.split(' ').slice(1);\n var num, con1, con2;\n\n if (isNaN(convert[0])) {\n con1 = convert[0];\n con2 = convert[2];\n } else {\n num = convert[0];\n con1 = convert[1];\n con2 = convert[3];\n }\n\n if (con1 == null || con2 == null)\n $.sendMessage('`/convert [amount] <currency> to <currency>`', {\n parse_mode: 'Markdown'\n });\n else {\n var conv1 = con1.toUpperCase();\n var conv2 = con2.toUpperCase();\n\n if (\n (conv1 == 'MXN' ||\n conv1 == 'CAD' ||\n conv1 == 'EUR' ||\n conv1 == 'USD') &&\n (conv2 == 'MXN' || conv2 == 'CAD' || conv2 == 'EUR' || conv2 == 'USD')\n ) {\n request.get('https://api.fixer.io/latest?base=' + conv1, function(\n err,\n res,\n body\n ) {\n var obj = JSON.parse(body);\n var newobj = obj.rates[conv2];\n if (num == null)\n $.sendMessage(\n '*' + add_coma_to_number(newobj.toString()) + ' ' + conv2 + '*',\n { parse_mode: 'Markdown' }\n );\n else {\n var newNum = num * newobj;\n $.sendMessage(\n '*' + add_coma_to_number(newNum.toString()) + ' ' + conv2 + '*',\n { parse_mode: 'Markdown' }\n );\n }\n });\n } else if (\n conv2 == 'MXN' ||\n conv2 == 'CAD' ||\n conv2 == 'EUR' ||\n conv2 == 'USD'\n ) {\n var coinDictionary = {};\n var dicObj = {};\n\n request.get(\n 'https://api.coinmarketcap.com/v1/ticker/?start=0&limit=0',\n function(err, res, data) {\n dicObj = JSON.parse(data);\n\n for (var i = 0; i < dicObj.length; i++) {\n coinDictionary[dicObj[i].symbol.toUpperCase()] = dicObj[i].id;\n }\n\n if (conv1 in coinDictionary) conv1 = coinDictionary[conv1];\n\n request.get(\n 'https://api.coinmarketcap.com/v1/ticker/' +\n conv1 +\n '/?convert=' +\n conv2,\n function(err, res, body) {\n var obj = JSON.parse(body);\n if (obj.error)\n return $.sendMessage(\"`'\" + conv1 + \"' doesn't exist!`\", {\n parse_mode: 'Markdown'\n });\n else {\n var conv2low = 'price_' + conv2.toLowerCase();\n var newobj = obj[0][conv2low];\n if (num == null)\n $.sendMessage(\n '*' +\n add_coma_to_number(newobj.toString()) +\n ' ' +\n conv2 +\n '*',\n { parse_mode: 'Markdown' }\n );\n else {\n var newNum = num * newobj;\n $.sendMessage(\n '*' +\n add_coma_to_number(newNum.toString()) +\n ' ' +\n conv2 +\n '*',\n { parse_mode: 'Markdown' }\n );\n }\n }\n }\n );\n }\n );\n } else\n $.sendMessage('`/convert [amount] <currency> to <currency>`', {\n parse_mode: 'Markdown'\n });\n }\n }", "function formatAsEuros (amount) {\n var res = '€'\n , currentPart\n ;\n\n if (amount === 0) { return '0 ' + res; }\n\n while (amount > 0) {\n currentPart = amount - 1000 * Math.floor(amount / 1000);\n if (amount === currentPart) { // No padding if it's the last part\n res = currentPart + ' ' + res;\n } else {\n res = pad(currentPart) + ' ' + res;\n }\n amount = (amount - currentPart) / 1000;\n }\n\n return res;\n}", "function poundsConversion() {\n const pWeight = parseFloat(poundsInput.value); // turns the string into a number which is used for each conversion in this function\n const gWeight = pWeight / 0.0022046;\n const oWeight = pWeight * 16;\n const kWeight = pWeight * 0.45359;\n gramsInput.value = gWeight.toFixed(3); //sets values to DOM using a fixed decimal input\n ounceInput.value = oWeight.toFixed(3);\n kilogramInput.value = kWeight.toFixed(3);\n}", "function convertToUSDWithCommas(num) {\n numString = num.toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, '$1,');\n numString = \"$\" + numString;\n return numString;\n}", "function convertPounds(e) {\n let lbs = e.target.value;\n $output.style.visibility = \"visible\";\n if (lbs === \"\") {\n return ($output.style.visibility = \"hidden\"); // removing output if blank\n }\n $gramsOutput.innerHTML = (lbs / 0.0022046).toFixed(2);\n $kgOutput.innerHTML = (lbs / 2.205).toFixed(2);\n $ozOutput.innerHTML = (lbs * 16).toFixed(2);\n}", "function getPrice() {\n if (interest.Prijs.Koopprijs && !interest.Prijs.Huurprijs) {\n return '<strong>€ ' + numberWithPeriods(interest.Prijs.Koopprijs) + ' <abbr title=\"Kosten Koper\">k.k.</abbr></strong>';\n } else {\n return '<strong>€ ' + numberWithPeriods(interest.Prijs.Huurprijs) + ' <abbr title=\"Per maand\">/mnd</abbr></strong>';\n }\n }", "function convertirACelsius(tempValue) {\n return (tempValue - 32) * 5 / 9;\n}", "function priceSymbol(x) {\n var price = new Intl.NumberFormat('ja-JP', { style: 'currency', currency: 'JPY' }).format(x);\n return price;\n}", "USD(b) {\n if (!b) { return '0.00' }\n else {\n // BOLT has 8 decimals right now\n b /= Math.pow(10, 8);\n b = b.toFixed(2)\n return String(b)\n }\n }", "function convert_to_dollars(coinArray) {\n let dollarAmount = 0\n dollarAmount = dollarAmount + coinArray[0] * 0.25;\n dollarAmount = dollarAmount + coinArray[1] * 0.05;\n dollarAmount = dollarAmount + coinArray[2] * 0.10;\n dollarAmount = dollarAmount + coinArray[3] * 0.01;\n console.log(dollarAmount)\n return dollarAmount;\n\n}", "function indianFormat(amount) {\n\tvar delimiter = \",\"; // replace comma if desired\n\tamount = new String(amount);\n\tvar a = amount.split('.',2);\n\tvar dec = ''\n\tvar k = a[0]\n\tvar istr = k.split('').reverse().join('');\n\n\tif(a[1].length > 0){\n dec = '.'+a[1]\n\t}\n\tvar ln = a[0].length -1\n\ti =0;\n\n\t var rn_str = '';\n\t while ( i <= ln ){\n if ( i == 3 || ( i > 4 && i%2 == 1)){\n rn_str += ','\n }\n\n rn_str += istr[i];\n i++;\n\n\t }\n\t rs = rn_str.split('').reverse().join('');\n\t return rs+dec\n \n}", "function formatCurrency(num) {\nnum = num.toString().replace(/\\$|\\,/g,'');\nif(isNaN(num))\nnum = \"0\";\nsign = (num == (num = Math.abs(num)));\nnum = Math.floor(num*100+0.50000000001);\ncents = num%100;\nnum = Math.floor(num/100).toString();\nif(cents<10)\ncents = \"0\" + cents;\nfor (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)\nnum = num.substring(0,num.length-(4*i+3))+','+\nnum.substring(num.length-(4*i+3));\nreturn (((sign)?'':'-') + num + '.' + cents);\n}", "function getPrice() {\n if (result.Prijs.Koopprijs && !result.Prijs.Huurprijs) {\n return '<strong>€ ' + numberWithPeriods(result.Prijs.Koopprijs) + ' <abbr title=\"Kosten Koper\">k.k.</abbr></strong>';\n } else {\n return '<strong>€ ' + numberWithPeriods(result.Prijs.Huurprijs) + ' <abbr title=\"Per maand\">/mnd</abbr></strong>';\n }\n }", "userCallback(value) {\n // Convert the number to a string and splite the string every 3 charaters from the end\n value = value.toString();\n value = value.split(/(?=(?:...)*$)/);\n \n // Convert the array to a string and format the output\n value = value.join('.');\n return `₳ ${value}`;\n }", "function realCurrency(number){\r\n let value = number\r\n \r\n let result = value.toLocaleString('pt-br', {style: 'currency', currency: 'BRL'});\r\n\r\n return result\r\n}", "function centsToDollars(num){\n return num / 100; \n}", "function prikazCena(cena){\n let zaokruzenaCena = cena.toFixed(2);\n return zaokruzenaCena + \" RSD\";\n}", "function convertMoney(num){\n\n inputdollar = document.forms[0].inputdollar.value;\n var euro = inputdollar * .883785;\n var inputString = \"You entered $\" + inputdollar + \" USD\" + \"</br>\";\n var convertString = \"You exchanged $\" + inputdollar + \" U.S. Dollars for $\" + euro.toFixed(2) + \" Euros\" + \"</br>\";\n var outPutString = inputString + convertString;\n document.getElementById('moneyForm').innerHTML = outPutString;\n}", "function convert() {\n let k = document.getElementById(\"kelvin\").value\n let o = k- 273.15\n document.getElementById(\"out\").innerHTML = o.toFixed(2) + \" degrees C\"\n}", "function transform(data){\n var currencies = [\n {code: 'USD', symbol: '$'}, //United States Dollar\n {code: 'EUR', symbol: '€'}, //European Union Euro\n {code: 'GBP', symbol: '£'}, //United Kingdom Pound\n\n {code:'ALL', symbol: 'Lek'}, //Albania Lek\n {code: 'AFN', symbol: '؋'}, //Afghanistan Afghani\n {code: 'ARS', symbol: 'AR$'}, //Argentina Peso\n {code: 'AWG', symbol: 'ƒ'}, //Aruba Guilder\n {code: 'AUD', symbol: 'A$'}, //Australia Dollar\n {code: 'AZN', symbol: '₼'}, //Azerbaijan Manat\n {code: 'BSD', symbol: 'B$'}, //Bahamas Dollar\n {code: 'BBD', symbol: 'Bds$'}, //Barbados Dollar\n {code: 'BYN', symbol: 'Br'}, //Belarus Ruble\n {code: 'BZD', symbol: 'BZ$'}, //Belize Dollar\n {code: 'BMD', symbol: '$'}, //Bermuda Dollar\n {code: 'BOB', symbol: '$b'}, //Bolivia Bolíviano\n {code: 'BAM', symbol: 'KM'}, //Bosnia and Herzegovina Convertible Marka\n {code: 'BWP', symbol: 'P'}, //Botswana Pula\n {code: 'BGN', symbol: 'лв'}, //Bulgaria Lev\n {code: 'BRL', symbol: 'R$'}, //Brazil Real\n {code: 'BND', symbol: 'B$'}, //Brunei Darussalam Dollar\n {code: 'KHR', symbol: '៛'}, //Cambodia Riel\n {code: 'CAD', symbol: 'Can$'}, //Canada Dollar\n {code: 'KYD', symbol: 'CI$'}, //Cayman Islands Dollar\n {code: 'CLP', symbol: 'CLP$'}, //Chile Peso\n {code: 'CNY', symbol: 'CN¥'}, //China Yuan Renminbi\n {code: 'COP', symbol: 'COL$'}, //Colombia Peso\n {code: 'CRC', symbol: '₡'}, //Costa Rica Colon\n {code: 'HRK', symbol: 'kn'}, //Croatia Kuna\n {code: 'CUP', symbol: '₱'}, //Cuba Peso\n {code: 'CZK', symbol: 'Kč'}, //Czech Republic Koruna\n {code: 'DKK', symbol: 'kr'}, //Denmark Krone\n {code: 'DOP', symbol: 'RD$'}, //Dominican Republic Peso\n {code: 'XCD', symbol: 'EC$'}, //East Caribbean Dollar\n {code: 'EGP', symbol: 'E£'}, //Egypt Pound\n {code: 'EGP', symbol: 'ج.م'}, //Egypt Pound\n {code: 'SVC', symbol: '₡'}, //El Salvador Colon\n {code: 'FKP', symbol: 'FK£'}, //Falkland Islands (Malvinas) Pound\n {code: 'FJD', symbol: 'FJ$'}, //Fiji Dollar\n {code: 'GHS', symbol: '¢'}, //Ghana Cedi\n {code: 'GIP', symbol: 'GI£'}, //Gibraltar Pound\n {code: 'GTQ', symbol: 'Q'}, //Guatemala Quetzal\n {code: 'GGP', symbol: '£'}, //Guernsey Pound\n {code: 'GYD', symbol: 'G$'}, //Guyana Dollar (or GY$)\n {code: 'HNL', symbol: 'L'}, //Honduras Lempira\n {code: 'HKD', symbol: 'HK$'}, //Hong Kong Dollar\n {code: 'HUF', symbol: 'Ft'}, //Hungary Forint\n {code: 'ISK', symbol: 'kr'}, //Iceland Krona\n {code: 'INR', symbol: '₹'}, //Indian rupee\n {code: 'IDR', symbol: 'Rp'}, //Indonesia Rupiah\n {code: 'IRR', symbol: '﷼'}, //Iran Rial\n {code: 'IMP', symbol: '£'}, //Isle of Man Pound\n {code: 'ILS', symbol: '₪'}, //Israel Shekel\n {code: 'JMD', symbol: 'J$'}, //Jamaica Dollar\n {code: 'JPY', symbol: '¥'}, //Japan Yen\n {code: 'JEP', symbol: '£'}, //Jersey Pound\n {code: 'KZT', symbol: 'лв'}, //Kazakhstan Tenge\n {code: 'KRW', symbol: '₩'}, //Korea (South) Won\n {code: 'KPW', symbol: '₩'}, //Korea (North) Won\n {code: 'KGS', symbol: 'лв'}, //Kyrgyzstan Som\n {code: 'LAK', symbol: '₭'}, //Laos Kip\n {code: 'LBP', symbol: 'ل.ل.‎'}, //Lebanon Pound\n {code: 'LRD', symbol: 'L$'}, //Liberia Dollar - Also LD$\n {code: 'MKD', symbol: 'ден'}, //Macedonia Denar\n {code: 'MYR', symbol: 'RM'}, //Malaysia Ringgit\n {code: 'MUR', symbol: '₨'}, //Mauritius Rupee\n {code: 'MXN', symbol: 'Mex$'}, //Mexico Peso\n {code: 'MNT', symbol: '₮'}, //Mongolia Tughrik\n {code: 'MZN', symbol: 'MT'}, //Mozambique Metical\n {code: 'NAD', symbol: 'N$'}, //Namibia Dollar\n {code: 'NPR', symbol: '₨'}, //Nepal Rupee\n {code: 'ANG', symbol: 'ƒ'}, //Netherlands Antilles Guilder\n {code: 'NZD', symbol: 'NZ$'}, //New Zealand Dollar\n {code: 'NIO', symbol: 'C$'}, //Nicaragua Cordoba\n {code: 'NGN', symbol: '₦'}, //Nigeria Naira\n {code: 'NOK', symbol: 'kr'}, //Norway Krone\n {code: 'OMR', symbol: '﷼'}, //Oman Rial\n {code: 'PKR', symbol: '₨'}, //Pakistan Rupee\n {code: 'PAB', symbol: 'B/.'}, //Panama Balboa\n {code: 'PYG', symbol: 'Gs'}, //Paraguay Guarani\n {code: 'PEN', symbol: 'S/.'}, //Peru Sol\n {code: 'PHP', symbol: '₱'}, //Philippines Piso\n {code: 'PLN', symbol: 'zł'}, //Poland Zloty\n {code: 'QAR', symbol: '﷼'}, //Qatar Riyal\n {code: 'RON', symbol: 'lei'}, //Romania Leu\n {code: 'RUB', symbol: '₽'}, //Russia Ruble\n {code: 'SHP', symbol: '£'}, //Saint Helena Pound\n {code: 'SAR', symbol: '﷼'}, //Saudi Arabia Riyal\n {code: 'RSD', symbol: 'Дин.'}, //Serbia Dinar\n {code: 'SCR', symbol: '₨'}, //Seychelles Rupee\n {code: 'SGD', symbol: 'S$'}, //Singapore Dollar\n {code: 'SBD', symbol: 'SI$'}, //Solomon Islands Dollar\n {code: 'SOS', symbol: 'S'}, //Somalia Shilling\n {code: 'ZAR', symbol: 'R'}, //South Africa Rand\n {code: 'LKR', symbol: '₨'}, //Sri Lanka Rupee\n {code: 'SEK', symbol: 'kr'}, //Sweden Krona\n {code: 'CHF', symbol: 'CHF'}, //Switzerland Franc\n {code: 'SRD', symbol: 'Sr$'}, //Suriname Dollar\n {code: 'SYP', symbol: '£S'}, //Syria Pound\n {code: 'SYP', symbol: 'LS'}, //Syria Pound\n {code: 'TWD', symbol: 'NT$'}, //Taiwan New Dollar\n {code: 'THB', symbol: '฿'}, //Thailand Baht\n {code: 'TTD', symbol: 'TT$'}, //Trinidad and Tobago Dollar\n {code: 'TRY', symbol: '₺'}, //Turkish Lira\n {code: 'TVD', symbol: '$'}, //Tuvalu Dollar\n {code: 'UAH', symbol: '₴'}, //Ukraine Hryvnia\n {code: 'UYU', symbol: '$U'}, //Uruguay Peso\n {code: 'UGX', symbol: 'Ush'}, //Ugandan shilling - might also be 'USh' as per wikipedia\n {code: 'UZS', symbol: 'лв'}, //Uzbekistan Som\n {code: 'VEF', symbol: 'Bs'}, //Venezuela Bolívar\n {code: 'VND', symbol: '₫'}, //Viet Nam Dong\n {code: 'YER', symbol: '﷼'}, //Yemen Rial\n {code: 'ZWD', symbol: 'Z$'} //Zimbabwe Dollar\n];\n for (var i = 0; i < currencies.length; i++) {\n if (data.indexOf(currencies[i].symbol) !== -1) return currencies[i].code;\n }\n\n return \"\";\n}", "function ypFmtPrice(price) {\n var decimals = price.substring(price.indexOf(\",\") + 1);\n // Price n,n\n if (decimals.length == 1) {\n return price + \"0\";\n }\n // Price n\n if (decimals.length == 0) {\n return price + \",00\";\n }\n // Price n,nn\n return price;\n}", "function convertToCelcius(fahrenheit) {\n return Math.round((fahrenheit - 32) * 5 / 9);\n}", "function convert (amount) {\n let number = Number(amount) * 1e8;\n // remove any decimals\n number = number.toFixed(0);\n return Number(number);\n}", "function transformGasDecimal(num) {\n if (num.length <= 8) {\n return \"0.\" + num.padStart(8, \"0\");\n }\n const decimalPoint = num.length - 8;\n return (\n num.substring(0, decimalPoint) +\n \".\" +\n num.substring(decimalPoint, num.length)\n );\n}", "function kelvin2Farenheit(kelvin)\n{\n return (9/5 * (kelvin - 273)) + 32;\n}", "function cur(num) {\n num = num.toString().replace(/\\$|\\,/g, '');\n if(isNaN(num))\n num = \"0\";\n sign = (num == (num = Math.abs(num)));\n num = Math.floor(num * 100 + 0.5000000001);\n cents = num % 100;\n num = Math.floor(num / 100).toString();\n if(cents < 10)\n cents = \"0\" + cents;\n for (var i = 0; i < Math.floor((num.length - (1 + i)) /3); i++)\n num = num.substring(0, num.length - (4*i+3)) + ',' +\n num.substring(num.length - (4*i+3));\n return (((sign) ? '' : '-') + '$' + num + '.' + cents);\n}", "function formatoMoedaVolume(_num) {\n _num = _num.toString().replace(/\\$|\\,/g, '');\n if (isNaN(_num))\n _num = \"0\";\n var sign = (_num == (_num = Math.abs(_num)));\n _num = Math.floor(_num * 1000 + 0.50000000001);\n var cents = _num % 1000;\n _num = Math.floor(_num / 1000).toString();\n if (cents < 10)\n cents = \"0\" + cents;\n for (var i = 0; i < Math.floor((_num.length - (1 + i)) / 3); i++)\n _num = _num.substring(0, _num.length - (4 * i + 3)) + ',' + _num.substring(_num.length - (4 * i + 3));\n //retirando a virgula\n var retorno = (((sign) ? '' : '-') + _num + '.' + cents);\n while (retorno.indexOf(',') > - 1)\n retorno = retorno.replace(',', '');\n return retorno;\n}", "function poundsToStone(pounds){\r\n //this function return pounds in a string data type\r\n var stone =Math.round((pounds)/14);\r\n return stone.toString();\r\n }", "function poundsToDollars(pounds) {\n pounds = Number(pounds);\n let dollars = pounds * 1.31;\n console.log(dollars.toFixed(3));\n}", "function convertToF(celsius) { \n \n return( 9*celsius/5 + 32);\n}", "callback(value) {\n return formatCurrency(value, 0);\n }", "function formatUang(number) {\n //code here\n number = number.toString();\n let str = \"\";\n count = 1;\n for (let i = number.length - 1; i >= 0; i--) {\n str = number[i] + str;\n if (count % 3 === 0 && i !== 0) {\n str = \".\" + str;\n }\n count++;\n }\n // console.log(str)\n str = \"Rp\" + str + \",00\";\n return str;\n}", "function ounceConvert(ounceValue, id) {\n if (['XAU', 'XAG'].includes(id.toUpperCase())) {\n return ounceValue / OUNCETOGRAMS\n } else {\n return ounceValue\n }\n}", "function formatCurrency(number){\n return \"$\"+number+\".00\"\n}" ]
[ "0.7509184", "0.70787", "0.69346756", "0.66679895", "0.66138965", "0.6537474", "0.64933497", "0.63803834", "0.63189256", "0.6294522", "0.62887555", "0.6285561", "0.62005484", "0.6194006", "0.61798245", "0.6174534", "0.6166513", "0.6156343", "0.61549664", "0.6137713", "0.61114407", "0.6110679", "0.60973704", "0.6085253", "0.60544854", "0.6039962", "0.60295403", "0.6024236", "0.60055625", "0.5997333", "0.5980755", "0.5980515", "0.5933347", "0.5933107", "0.5929286", "0.59082496", "0.5896346", "0.58530426", "0.5848298", "0.58482474", "0.5847576", "0.58453006", "0.5842687", "0.58397436", "0.5837535", "0.5835293", "0.5815654", "0.581001", "0.58081067", "0.580132", "0.5792067", "0.57859355", "0.5765872", "0.5762471", "0.5722268", "0.57220966", "0.57176787", "0.5712137", "0.5686721", "0.5685284", "0.56788874", "0.56767404", "0.56619465", "0.56472176", "0.5631452", "0.5626668", "0.56257796", "0.5622311", "0.5621133", "0.5606375", "0.55998665", "0.5594794", "0.55927116", "0.55876094", "0.5583099", "0.55696696", "0.55685955", "0.5561436", "0.55596054", "0.55592436", "0.5558105", "0.55547726", "0.55491304", "0.5548253", "0.5547957", "0.554077", "0.5540034", "0.5537938", "0.552748", "0.55227137", "0.55184543", "0.55151016", "0.55148464", "0.55106956", "0.55019975", "0.5498447", "0.5497542", "0.54968053", "0.5485633", "0.54854566" ]
0.7094993
1
Pond To Euro CONVERT FUNCTION
function pond2euro() { var pond2euro = 1.17; var bedrag = document.querySelector("#bedrag").value; document.getElementById("convert").value = (bedrag * pond2euro).toFixed(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function euroTopond() {\n var euro2pond = 0.85;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * euro2pond).toFixed(2);\n\n }", "function dollarToeuro() {\n var dollar2euro = 0.91;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * dollar2euro).toFixed(2);\n\n }", "function euroTodollar() {\n var euro2dollar = 1.10;\n var bedrag = document.querySelector(\"#bedrag\").value;\n\n document.getElementById(\"convert\").value = (bedrag * euro2dollar).toFixed(2);\n\n }", "function conversion(kelvin) {\n return Math.floor(kelvin * (9/5) - 459.67) + \"°F\";\n}", "function toCurrency(){\n\n}", "function CurrencyConvert(v,idx,full) {\n if(idx==undefined) idx = 0;\n var c = CurrencyData[idx];\n v = parseInt(10000*v/c[2])/10000;\n if(v>1 && v<1000) v=parseInt(10*v)/10;\n if(v>=1000 && v<10000) v=parseInt(v/1000)+\"千\";\n else if(v>=10000 && v<100000000) v=parseInt(v/10000)+\"萬\";\n else if(v>=100000000 && v<1000000000000) v=parseInt(v/100000000)+\"億\";\n else if(v>=1000000000000) v=parseInt(v/1000000000000)+\"兆\";\n return v+(full?c[0]+c[1]:\"\");\n }", "function ConverterEuro() {\n var valorElemento = document.getElementById(\"valor\");\n var valor = valorElemento.value;\n var valorEmDolarNumerico = parseFloat(valor);\n var valorEmEuro = valorEmDolarNumerico * 0.85;\n var elementoValorConvertio = document.getElementById(\"valorConvertido\");\n var valorConvertido = \"O resultado em euro é € \" + valorEmEuro + \".\";\n elementoValorConvertio.innerHTML = valorConvertido;\n}", "function currencyConversion(euros, exchangeRate) {\n const amount = euros * (exchangeRate / 100);\n const twoDecimal = amount.toFixed(2);\n return euros + ' ' + \"euros at an exchange rate of\" + ' ' + exchangeRate + ' ' + \"is\" + ' ' + twoDecimal + ' ' + \"U.S. dollars\";\n}", "function formatEuroNumber(number) {\r\n\tvar str = String(number);\r\n\tvar res;\r\n\tif(str) {\r\n\t\tres = \"&euro; \" + str;\r\n\t}\r\n\treturn res;\r\n}", "function convertToCelsius(num){\n return (num - 32) * 5 / 9;\n}", "function convert(){\r\nvar fsub = f.value-32;\r\nvar fdiv = fsub/1.8;\r\n c.innerHTML=fdiv+\"°C\";\r\n}", "function convertToCurrency(num) {\n return \"AUD \" + num.toFixed(2);\n}", "function convertirDolarAEuro() {\n const listaPrecios = $('.precioProducto');\n const listaPreciosLength = listaPrecios.length;\n for (let i = 0; i < listaPreciosLength; i += 1) {\n $.getJSON(urlBasica.forex, {\n quantity: parseInt($(listaPrecios[i]).text(), 10),\n api_key: apiKey.Forex,\n format: 'json',\n }).done(function (response) {\n const posA = (response.text).indexOf(' USD');\n const dolar = (response.text+\"\").substring(0, posA);\n const eur = response.value.toFixed(2);\n $(listaPrecios[i]).text(`${eur}€`);\n });\n }\n}", "function convertirDolarAEuro() {\n var listaPrecios = $('.precioProducto');\n var listaPreciosLength = listaPrecios.length;\n\n var _loop = function _loop(i) {\n $.getJSON(urlBasica.forex, {\n quantity: parseInt($(listaPrecios[i]).text(), 10),\n api_key: apiKey.Forex,\n format: 'json'\n }).done(function (response) {\n var posA = response.text.indexOf(' USD');\n var dolar = (response.text + \"\").substring(0, posA);\n var eur = response.value.toFixed(2);\n $(listaPrecios[i]).text(eur + '\\u20AC');\n });\n };\n\n for (var i = 0; i < listaPreciosLength; i += 1) {\n _loop(i);\n }\n}", "function parseEuroNumber(number) {\r\n\t// number muss ein String sein!\r\n\tvar str = String(number);\r\n\tvar res;\r\n\tif(str) {\r\n\t\tstr = str.replace(\"EUR\", \"\");\r\n\t\tstr = str.replace(\"&euro;\", \"\");\r\n\t\tres = str;\r\n\t}\r\n\treturn res;\r\n}", "function convertPrice(price){\n return new Intl.NumberFormat('ru-RU').format(Math.round(price));\n}", "function formatNumberToIndianRupee ( number, options ) {\n\n\tif ( ! number )\n\t\treturn 0;\n\n\toptions = options || { };\n\tvar formattedNumber;\n\n\tnumber = parseStringToNumber( number );\n\tvar roundedNumber = number.toFixed( 0 );\n\tvar integerAndFractionalParts = ( roundedNumber + \"\" ).split( \".\" );\n\tvar integerPart = integerAndFractionalParts[ 0 ];\n\tvar fractionalPart = integerAndFractionalParts[ 1 ];\n\n\tvar lastThreeDigitsOfIntegerPart = integerPart.slice( -3 );\n\tvar allButLastThreeDigitsOfIntegerPart = integerPart.slice( 0, -3 );\n\n\tformattedNumber = allButLastThreeDigitsOfIntegerPart.replace( /\\B(?=(\\d{2})+(?!\\d))/g, \",\" );\n\n\tif ( allButLastThreeDigitsOfIntegerPart ) {\n\t\tformattedNumber += \",\";\n\t}\n\tformattedNumber += lastThreeDigitsOfIntegerPart;\n\n\tif ( fractionalPart ) {\n\t\tformattedNumber += \".\" + fractionalPart;\n\t}\n\n\tvar symbol = options.symbol === false ? \"\" : \"₹\";\n\tif ( /^-/.test( formattedNumber ) ) {\n\t\tformattedNumber = formattedNumber.replace( /^-/, \"minus \" + symbol );\n\t}\n\telse {\n\t\tformattedNumber = symbol + formattedNumber;\n\t}\n\n\treturn formattedNumber;\n\n}", "convert($geez_number) {\n const $parsed = this.parse($geez_number);\n\n return this.calculate($parsed);\n }", "function convert (c) {\n \n var f=(9*c/5) + 32;\n return c + '°C is ' + f + '°F';\n \n \n}", "function convertRate(price) {\n if (gCurrLang === 'he') {\n return price * gExcangeRates.quotes.USDILS\n } else if (gCurrLang === 'en') {\n return price\n }\n}", "function convertToEpic(input) {\n\tswitch (input) {\n\t\tcase 0:\n\t\toutput = 0;\n\t\tbreak;\n\t\tcase 1:\n\t\toutput = 1;\n\t\tbreak;\n\t\tcase 2:\n\t\toutput = 2;\n\t\tbreak;\n\t\tcase 3:\n\t\toutput = 4;\n\t\tbreak;\n\t\tcase 4:\n\t\toutput = 7;\n\t\tbreak;\n\t\tcase 5:\n\t\toutput = 11;\n\t\tbreak;\n\t\tcase 6:\n\t\toutput = 16;\n\t\tbreak;\n\t\tcase 7:\n\t\toutput = 22;\n\t\tbreak;\n\t\tcase 8:\n\t\toutput = 29;\n\t\tbreak;\n\t\tcase 9:\n\t\toutput = 37;\n\t\tbreak;\n\t\tcase 10:\n\t\toutput = 46;\n\t\tbreak;\n\t}\n\treturn output;\n}", "function Currency(str) {\n str = str - -0.5;\n var arr = new String(str);\n var arr1 = '';\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] != '.') {\n arr1 = arr1 + arr[i];\n }\n else {\n if (arr[i + 1] >= '5') {\n arr1[i] = arr[i] - -1;\n }\n break;\n }\n }\n var Gia = \"\";\n var dem = 0;\n for (var i = arr1.length - 1; i >= 0; i--) {\n dem++;\n Gia = Gia + arr1[i];\n if (dem == 3 && i != 0) {\n Gia = Gia + \",\";\n dem = 0;\n }\n }\n var arr2 = new String(Gia);\n var GiaMoi = '';\n for (var i = arr2.length - 1; i >= 0; i--) {\n GiaMoi = GiaMoi + arr2[i];\n }\n return GiaMoi;\n }", "function convert(){\n var c = document.querySelector(\"#c\").value;\n var f = c * 9/5 +32;\n document.querySelector(\"h3\").innerHTML = \"Result: \" + f+ \"°\"+ \"F\";\n}", "function eurfunc()\r\n{\r\n inr.value = parseFloat(eur.value) * 1.43448;\r\n usd.value = parseFloat(eur.value) * 0.70641;\r\n cad.value = parseFloat(eur.value) * 0.72037;\r\n aud.value = parseFloat(eur.value) * 0.62382;\r\n}", "function convert (celsius){\n var fahrenheit = ((celsius * 9/5) +32);\n console.log(celsius +\" degrees celsius equates to: \"+fahrenheit + \" \"+ \"fahrenheit\");\n }", "function convertX(p) {\r\n return 0.2504 * p - 381.399\r\n}", "convert() {\n return `${(this.payments.type.price[this.currencyType] / 100)}`;\n }", "function convertToCelsius(fahrenheit){\n let temp = (Number(fahrenheit)-32) * 5/9;\n return temp.toFixed(2);\n }", "kelvinToCelsius(kelvin) {\n return Math.floor(kelvin - 273) + \" °C\"\n }", "function convertToCelcius(x){\n let kelvin = 273.15;\n let temp = x - kelvin; \n temp = Math.round(temp);\n return temp;\n}", "function convertCurrencyCalculator (value) {\n\n\n\n\t}", "changePrice() {\n var parts = this.precio.toFixed(2).toString().split(\".\");\n var result = parts[0].replace(/\\B(?=(\\d{3})+(?=$))/g, \".\") + (parts[1] ? \",\" + parts[1] : \"\");\n return `$${result}`;\n }", "function ounceConvert(ounceValue, id) {\n if (['XAU', 'XAG'].includes(id.toUpperCase())) {\n return ounceValue / OUNCETOGRAMS\n } else {\n return ounceValue\n }\n}", "function getOuncesFromPounds(pounds) {\nreturn pounds * 16;\n\n}", "function ConverterLibra() {\n var valorElemento = document.getElementById(\"valor\");\n var valor = valorElemento.value;\n var valorEmDolarNumerico = parseFloat(valor);\n var valorEmLibra = valorEmDolarNumerico * 0.72;\n var elementoValorConvertio = document.getElementById(\"valorConvertido\");\n var valorConvertido = \"O resultado em libra é £ \" + valorEmLibra + \".\";\n elementoValorConvertio.innerHTML = valorConvertido;\n}", "function convertToRupiah(value, currencyType) {\n switch (currencyType) {\n case \"yen\":\n return `$${value} yen = Rp.${value * 129.88}`;\n case \"usd\":\n return `${value} USD = Rp.${value * 14272.67}`;\n case \"euro\":\n return `${value} EUR = Rp.${value * 16932.8}`;\n default:\n return \"no match type currency\";\n }\n}", "function celsius2Kelvin(celsius)\n{\n //+ will become string\n return celsius + 273;\n}", "function cvtC(p){\n\tvar s = \"$\";\n\t s+= Number(p.toFixed(2) ).toLocaleString();\n\treturn s;\n}", "function PWM_Func_DecimalPrice(Price, Format) {\n try {\n\n ///int\n var nPrice = 0, nFrac1 = 0, nFrac2 = 0, nFrac3 = 0;\n //Decimal\n //var dPrice = 0M;\n var dPrice = 0;\n //string[]\n var PriceParts = Price.toString().split('#');\n\n if (PriceParts.length > 0) {\n for (var index = 0; index < PriceParts.length; index++) {\n if (index == 0)\n nPrice = parseInt(PriceParts[index]);\n else if (index == 1) {\n if (Format < 16)\n nFrac1 = parseInt(PriceParts[index].substring(0, PriceParts[index].indexOf(\"/\")));\n else\n nFrac1 = parseInt(PriceParts[index]);\n }\n else if (index == 2)\n nFrac2 = parseInt(PriceParts[index]);\n else if (index == 3)\n nFrac3 = parseInt(PriceParts[index]);\n }\n dPrice = parseFloat(nPrice);\n if (Format == 0) //1/2=eHalfs\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/2\" + \"^\" + (dPrice + parseFloat(nFrac1) / 2));\n }\n else if (Format == 1) //1/4=eQuarters\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/4\" + \"^\" + (dPrice + parseFloat(nFrac1) / 4));\n }\n else if (Format == 2) //1/8=eEighths\n {\n return (nPrice + \"'\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 8));\n }\n else if (Format == 3) //1/16=eSixteenths\n {\n if (nFrac1 == 0)\n return (nPrice + \"''00\" + \"^\" + dPrice);\n else if (nFrac1 > 0 && nFrac1 < 10)\n return (nPrice + \"''0\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n else\n return (nPrice + \"''\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n }\n else if (Format == 4) //1/32=eThirtySeconds\n {\n if (nFrac1 == 0)\n return (nPrice + \"-00\" + \"^\" + dPrice);\n else if (nFrac1 > 0 && nFrac1 < 10)\n return (nPrice + \"-0\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n else\n return (nPrice + \"-\" + nFrac1 + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n }\n else if (Format == 5) //1/64=eSixtyFourths\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/64\" + \"^\" + (dPrice + parseFloat(nFrac1) / 64));\n }\n else if (Format == 6) //1/128=eOneTwentyEights\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/128\" + \"^\" + (dPrice + parseFloat(nFrac1) / 128));\n }\n else if (Format == 7) //1/256=eTwoFiftySixths\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else\n return (nPrice + \"-\" + nFrac1 + \"/256\" + \"^\" + (dPrice + parseFloat(nFrac1) / 256));\n }\n else if (Format == 8) {\n if (nFrac2 == 4) // if 2nd fraction is 4 then display \"+\" after 1st fraction\n {\n return (nPrice + \"-\" + ((nFrac1 == 0) ? \"00\" : nFrac1.toString()) + \"+\" + \"^\" + (dPrice + parseFloat(nFrac1) / 32 + parseFloat(0.031250 / 8 * nFrac2)));\n }\n else if (nFrac2 == 0) //if 2nd fraction is 0 then no need to display 2nd fraction\n {\n return (nPrice + \"-\" + ((nFrac1 == 0) ? \"00\" : nFrac1.toString()) + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n }\n else //show 2nd fraction after 1st fraction and dot\n {\n return (nPrice + \"-\" + ((nFrac1 == 0) ? \"00\" : nFrac1.toString()) + \".\" + nFrac2 + \"^\" + (dPrice + parseFloat(nFrac1) / 32 + parseFloat(0.031250 / 8 * nFrac2)));\n }\n }\n else if (Format == 9) //1/4R=eQuartersReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 == 2)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 4) + \"^\" + (dPrice + parseFloat(nFrac1) / 4));\n else\n return (nPrice + \"-\" + nFrac1 + \"/4\" + \"^\" + (dPrice + parseFloat(nFrac1) / 4));\n }\n else if (Format == 10) //1/8R=eEighthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 8) + \"^\" + (dPrice + parseFloat(nFrac1) / 8));\n else\n return (nPrice + \"-\" + nFrac1 + \"/8\" + \"^\" + (dPrice + parseFloat(nFrac1) / 8));\n }\n else if (Format == 11) //1/16R=eSixteenthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 16) + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n else\n return (nPrice + \"-\" + nFrac1 + \"/16\" + \"^\" + (dPrice + parseFloat(nFrac1) / 16));\n }\n else if (Format == 12) //1/32R=eThirtySecondsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 32) + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n else\n return (nPrice + \"-\" + nFrac1 + \"/32\" + \"^\" + (dPrice + parseFloat(nFrac1) / 32));\n }\n else if (Format == 13) //1/64R=eSixtyFourthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 64) + \"^\" + (dPrice + parseFloat(nFrac1) / 64));\n else\n return (nPrice + \"-\" + nFrac1 + \"/64\" + \"^\" + (dPrice + parseFloat(nFrac1) / 64));\n }\n else if (Format == 14) //1/128R=eOneTwentyEightsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 128) + \"^\" + (dPrice + parseFloat(nFrac1) / 128));\n else\n return (nPrice + \"-\" + nFrac1 + \"/128\" + \"^\" + (dPrice + parseFloat(nFrac1) / 128));\n }\n else if (Format == 15) //1/256R=eTwoFiftySixthsReduced\n {\n if (nFrac1 == 0)\n return (nPrice + \"^\" + dPrice);\n else if (nFrac1 % 2 == 0)\n return (nPrice + \"-\" + PWM_Func_GetReducedFraction(nFrac1, 256) + \"^\" + (dPrice + parseFloat(nFrac1) / 256));\n else\n return (nPrice + \"-\" + nFrac1 + \"/256\" + \"^\" + (dPrice + parseFloat(nFrac1) / 256));\n }\n else if (Format == 16) //1=e0DecimalPlaces\n {\n return (nPrice + \"^\" + dPrice);\n }\n else if (Format == 17) //0.1=e1DecimalPlace\n {\n return (nPrice + \".\" + (nFrac1.toString()).substring(0, 1) + \"^\" + dPrice + \".\" + nFrac1);\n }\n else if (Format == 18) //0.01=e2DecimalPlaces\n {\n return (nPrice + \".\" + nFrac1 + (nFrac2.toString()).substring(0, 1) + \"^\" + dPrice + \".\" + nFrac1 + nFrac2);\n }\n else if (Format == 19) //0.001=e3DecimalPlaces\n {\n return (nPrice + \".\" + nFrac1 + nFrac2 + (nFrac3.toString()).substring(0, 1) + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + nFrac3);\n }\n else if (Format == 20) //0.001=eFurtureRateHalfs\n {\n if (nFrac3 == 0)\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"^\" + dPrice + \".\" + nFrac1 + nFrac2);\n else\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"+\" + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + \"5\");\n }\n else if (Format == 21) //0.001=eFurtureRateQuarters\n {\n if (nFrac3 == 0)\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"^\" + dPrice + \".\" + nFrac1 + nFrac2);\n else if (nFrac3 == 2)\n return (nPrice + \".\" + nFrac1 + nFrac2 + \"+\" + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + \"5\");\n else\n return (nPrice + \".\" + nFrac1 + nFrac2 + \".\" + nFrac3 + \"^\" + dPrice + \".\" + nFrac1 + nFrac2 + ((nFrac3 == 1) ? \"25\" : \"75\"));\n }\n }\n }\n catch (err) {\n PWM_Func_HandleJsError(\"PWM_Func_DecimalPrice\", err);\n }\n}", "function Converter(currency, input) {\n\n if (isNaN(input)) {\n number.value = null;\n alert('Nazadal jsi cislo');\n }\n\n switch (currency) {\n\n case 'USD':\n\n usd = 23.61777;\n return (input / usd).toFixed(2) + ' $';\n case 'EUR':\n\n eur = 25.840273;\n return (input / eur).toFixed(2) + ' €';\n\n case 'PLN':\n\n pln = 5.89558584;\n return (input / pln).toFixed(2) + ' zł';\n }\n}", "function convertMoney(money) {\n return `$ ${money.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")}`\n}", "function convertToNumber(numText) {\n var number;\n number = numText.replace('€', '');\n number = number.replace(',', '.');\n number = number.replace('.', ' ');\n number = parseFloat(number);\n\n if (number != 'NaN') {\n return number;\n } else {\n return 0;\n }\n }", "function NumberEU(num) {\r\n\tnum = num.replace(\",\", \".\");\r\n\treturn Number(num);\r\n}", "function formatAsEuros (amount) {\n var res = '€'\n , currentPart\n ;\n\n if (amount === 0) { return '0 ' + res; }\n\n while (amount > 0) {\n currentPart = amount - 1000 * Math.floor(amount / 1000);\n if (amount === currentPart) { // No padding if it's the last part\n res = currentPart + ' ' + res;\n } else {\n res = pad(currentPart) + ' ' + res;\n }\n amount = (amount - currentPart) / 1000;\n }\n\n return res;\n}", "function convert(num) {\n\n\n}", "function kelvinToCelcius(K){\n return parseInt(K) - parseInt(273);\n}", "function converter(){\n var valorEmDolar= window.document.getElementById(\"txtn1\")\n var res = window.document.getElementById(\"res\")\n \n var valorEmDolarNumber = parseFloat(valorEmDolar.value)\n var taxa = 5.50\n var valorEmReal= valorEmDolarNumber * taxa\n res.innerHTML =' O valor em real é R$ ' + valorEmReal.toFixed(2)\n}", "function convertirACelsius(tempValue) {\n return (tempValue - 32) * 5 / 9;\n}", "function ConvertToPersian(number){\r\n const persian = { 0: '۰', 1: '۱', 2: '۲', 3: '۳', 4: '۴', 5: '۵', 6: '۶', 7: '۷', 8: '۸', 9: '۹' };\r\n let PersianNumber='';\r\n \r\n const numberAsText=number.toString();\r\n\r\n for (let i=0;i<numberAsText.length;i++){\r\n PersianNumber+=persian[+numberAsText[i]];\r\n }\r\n\r\n return PersianNumber \r\n}", "function convert(amount) {\n return Number(amount) * 1e12;\n}", "convertHandler($) {\n var convert = $.message.text.split(' ').slice(1);\n var num, con1, con2;\n\n if (isNaN(convert[0])) {\n con1 = convert[0];\n con2 = convert[2];\n } else {\n num = convert[0];\n con1 = convert[1];\n con2 = convert[3];\n }\n\n if (con1 == null || con2 == null)\n $.sendMessage('`/convert [amount] <currency> to <currency>`', {\n parse_mode: 'Markdown'\n });\n else {\n var conv1 = con1.toUpperCase();\n var conv2 = con2.toUpperCase();\n\n if (\n (conv1 == 'MXN' ||\n conv1 == 'CAD' ||\n conv1 == 'EUR' ||\n conv1 == 'USD') &&\n (conv2 == 'MXN' || conv2 == 'CAD' || conv2 == 'EUR' || conv2 == 'USD')\n ) {\n request.get('https://api.fixer.io/latest?base=' + conv1, function(\n err,\n res,\n body\n ) {\n var obj = JSON.parse(body);\n var newobj = obj.rates[conv2];\n if (num == null)\n $.sendMessage(\n '*' + add_coma_to_number(newobj.toString()) + ' ' + conv2 + '*',\n { parse_mode: 'Markdown' }\n );\n else {\n var newNum = num * newobj;\n $.sendMessage(\n '*' + add_coma_to_number(newNum.toString()) + ' ' + conv2 + '*',\n { parse_mode: 'Markdown' }\n );\n }\n });\n } else if (\n conv2 == 'MXN' ||\n conv2 == 'CAD' ||\n conv2 == 'EUR' ||\n conv2 == 'USD'\n ) {\n var coinDictionary = {};\n var dicObj = {};\n\n request.get(\n 'https://api.coinmarketcap.com/v1/ticker/?start=0&limit=0',\n function(err, res, data) {\n dicObj = JSON.parse(data);\n\n for (var i = 0; i < dicObj.length; i++) {\n coinDictionary[dicObj[i].symbol.toUpperCase()] = dicObj[i].id;\n }\n\n if (conv1 in coinDictionary) conv1 = coinDictionary[conv1];\n\n request.get(\n 'https://api.coinmarketcap.com/v1/ticker/' +\n conv1 +\n '/?convert=' +\n conv2,\n function(err, res, body) {\n var obj = JSON.parse(body);\n if (obj.error)\n return $.sendMessage(\"`'\" + conv1 + \"' doesn't exist!`\", {\n parse_mode: 'Markdown'\n });\n else {\n var conv2low = 'price_' + conv2.toLowerCase();\n var newobj = obj[0][conv2low];\n if (num == null)\n $.sendMessage(\n '*' +\n add_coma_to_number(newobj.toString()) +\n ' ' +\n conv2 +\n '*',\n { parse_mode: 'Markdown' }\n );\n else {\n var newNum = num * newobj;\n $.sendMessage(\n '*' +\n add_coma_to_number(newNum.toString()) +\n ' ' +\n conv2 +\n '*',\n { parse_mode: 'Markdown' }\n );\n }\n }\n }\n );\n }\n );\n } else\n $.sendMessage('`/convert [amount] <currency> to <currency>`', {\n parse_mode: 'Markdown'\n });\n }\n }", "function convertToCelcius(fahrenheit) {\n return Math.round((fahrenheit - 32) * 5 / 9);\n}", "function formatUang(number) {\n //code here\n var hasil = 'Rp.'\n var split = number.toString().split('')\n var temp = ''\n\n for (var i = split.length - 1; i >= 0; i--) {\n if (i === split.length - 1) {\n temp += '00,' +split[i]\n } else if (i === split.length - 4 || i === split.length - 7) {\n temp += '.' + split[i]\n } else {\n temp += split[i]\n }\n }\n\n var arrTemp = temp.split('')\n\n for (var j = arrTemp.length - 1; j >= 0; j--) {\n hasil+= arrTemp[j]\n }\n return hasil\n}", "function engToJp(x) {\r\n var intermediateValue = x;\r\n var japaneseValue = \"\";\r\n for (i = 0; i < units.length; i++) {\r\n // console.log(units[i]);\r\n if ((intermediateValue / units[i][0]) >= 1) {\r\n japaneseValue += Math.floor(intermediateValue / units[i][0]) + units[i][1];\r\n // console.log(japaneseValue);\r\n intermediateValue = (intermediateValue % units[i][0]);\r\n // console.log(intermediateValue);\r\n };\r\n };\r\n return japaneseValue + intermediateValue;\r\n}", "function convert(montantTtc, tauxDollar = 1.1032 ){\n return montantTtc * tauxDollar;\n}", "function convertToCelsius(fahrenheit){\n if(typeof(fahrenheit)=='string'||typeof(fahrenheit)=='undefined'||typeof(fahrenheit)=='object'){\n return 'Technical Error!';\n } \n return (5/9) * (fahrenheit-32);\n \n}", "function convertPrice(formatPrice){\n\tstr = formatPrice.substring(0,formatPrice.length - 4);\n \tstr1 = str.replace('.','');\n \tstr2 = str1.replace('.','');\n \tstr3 = str2.replace('.','');\n \t\n \treturn str3;\n}", "function formatCurrency(num) {\n return 'PKR ' + (num).toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\n}", "USD(b) {\n if (!b) { return '0.00' }\n else {\n // BOLT has 8 decimals right now\n b /= Math.pow(10, 8);\n b = b.toFixed(2)\n return String(b)\n }\n }", "function convertToF(celsius) { \n \n return( 9*celsius/5 + 32);\n}", "function kelvin2Farenheit(kelvin)\n{\n return (9/5 * (kelvin - 273)) + 32;\n}", "function convert() {\n let k = document.getElementById(\"kelvin\").value\n let o = k- 273.15\n document.getElementById(\"out\").innerHTML = o.toFixed(2) + \" degrees C\"\n}", "function formatPrice(num)\n{\n\t num = num.toString().replace(/\\$|\\,/g,'');\n\t if(isNaN(num))\n\t num = \"0\";\n\t sign = (num == (num = Math.abs(num)));\n\t num = Math.floor(num*100+0.50000000001);\n\t cents = num%100;\n\t num = Math.floor(num/100).toString();\n\t if(cents<10)\n\t cents = \"0\" + cents;\n\t for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)\n\t num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3));\t \n\t //return (((sign)?'':'-') + '<?php //echo $this->model_superadmin->generate_isocode_bo()?> ' + num + ',' + cents);\n\t return (((sign)?'':'-') + 'Rp. '+ num +',00');\n}", "function toEUR(){\n\n //declaration of variables to make an HTTP request\n var apikey = '033bd71ee6e561787d172fcccb6f9e64';\n var api_url = 'http://apilayer.net/api/live';\n var fromcurrancy='USD';\n \n //declaration of variable url to access the currancylayer data\n var request_url = api_url\n + '?'\n + 'access_key=' +encodeURIComponent(apikey)\n +'&currancies='+encodeURIComponent(fromcurrancy)\n +'&format=1';\n \n var request = new XMLHttpRequest();\n request.open('GET', request_url, true);\n \n request.onload = function() {\n \n if (request.status == 200){ \n // Success!\n var data = JSON.parse(request.responseText);\n //alert(data.results[0].formatted);\n var numberfrom=+document.getElementById('number').value;\n document.getElementById('result').innerHTML=(data.quotes.USDEUR)*numberfrom+' euros';\n \n \n } else if (request.status <= 500){ \n // We reached our target server, but it returned an error\n \n console.log(\"unable to geocode! Response code: \" + request.status);\n var data = JSON.parse(request.responseText);\n console.log(data.status.message);\n } else {\n console.log(\"server error\");\n }\n }\n \n request.onerror = function() {\n // There was a connection error of some sort\n console.log(\"unable to connect to server\"); \n };\n request.send();\n \n \n }", "function convertPounds(e) {\n let lbs = e.target.value;\n $output.style.visibility = \"visible\";\n if (lbs === \"\") {\n return ($output.style.visibility = \"hidden\"); // removing output if blank\n }\n $gramsOutput.innerHTML = (lbs / 0.0022046).toFixed(2);\n $kgOutput.innerHTML = (lbs / 2.205).toFixed(2);\n $ozOutput.innerHTML = (lbs * 16).toFixed(2);\n}", "function priceConversion(productPrice) {\n return Intl.NumberFormat(\"fr-FR\", {\n style: \"currency\",\n currency: \"EUR\",\n minimumFractionDigits: 2,\n }).format(`${productPrice}` / 100);\n}", "callback(value) {\n return formatCurrency(value, 4);\n }", "function convertAmountToTetri(amount) {\n return amount * 100;\n}", "userCallback(value) {\n // Convert the number to a string and splite the string every 3 charaters from the end\n value = value.toString();\n value = value.split(/(?=(?:...)*$)/);\n \n // Convert the array to a string and format the output\n value = value.join('.');\n return `₳ ${value}`;\n }", "function convertMoney(num){\n\n inputdollar = document.forms[0].inputdollar.value;\n var euro = inputdollar * .883785;\n var inputString = \"You entered $\" + inputdollar + \" USD\" + \"</br>\";\n var convertString = \"You exchanged $\" + inputdollar + \" U.S. Dollars for $\" + euro.toFixed(2) + \" Euros\" + \"</br>\";\n var outPutString = inputString + convertString;\n document.getElementById('moneyForm').innerHTML = outPutString;\n}", "function convertFahrenheitToCelsius(temp) {\n return ((temp - 32) * 5) / 9;\n}", "function convertToPennies(AmountFieldValue) {\n // if there is '£' sign only then the value is in GBP style.\n // Also, if there is a combination of both '£' and 'p' it will be in GBP style.\n //\n if (isValidInput(AmountFieldValue)) {\n var newAmountVal = cleanAmountText(AmountFieldValue);\n\n if (AmountFieldValue.charAt(0) == '£' || (AmountFieldValue.charAt(0) == '£' && AmountFieldValue.charAt(AmountFieldValue.length - 1) == 'p')) {\n //number is in GBP style\n return (Math.floor(parseFloat(newAmountVal) * 100));\n } else if (AmountFieldValue.charAt(AmountFieldValue.length - 1) == 'p' && newAmountVal.indexOf(\".\") == -1) {\n // if the input doesn't have a floating point, then it is Pennies style.\n // No conversion required!\n return (Math.floor(parseFloat(newAmountVal)));\n } else if (AmountFieldValue.charAt(AmountFieldValue.length - 1) == 'p' && newAmountVal.indexOf(\".\") >= 0) {\n // if the input has a floating point, then it is GBP style and it needs to be converted.\n return (Math.floor(parseFloat(newAmountVal) * 100));\n } else if (newAmountVal.indexOf(\".\") >= 0) {\n // if the input has a floating point, then it is GBP style and it needs to be converted.\n return (Math.floor(parseFloat(newAmountVal) * 100));\n } else {\n // if the input doesn't have a floating point, '£' or 'p', then it is Pennies style.\n // No conversion required!\n return (Math.floor(parseFloat(newAmountVal)));\n }\n } else {\n // the input does not match the input pattern\n return -1;\n }\n\n}", "formatCurrency(value) {\n // get signal\n const signal = Number(value) < 0 ? '-' : ''\n //clean string\n // \\D -> Encontre tudo que náo é number\n value = String(value).replace(/\\D/g, '')\n // convert \n value = Number(value) / 100\n value = value.toLocaleString(\"pt-BR\", {\n style: \"currency\",\n currency: \"BRL\"\n })\n\n return signal + value\n }", "function asintorsxg($a) { // ASIN to reversible sexagesimal; prefix ISBN-10 w ~\n $a = amazontoasin($a); // extract ASIN from Amazon URL if necessary\n if ($a[0]=='B') {\n $a=numtosxg(hxttonum(substr($a,1,9)));\n }\n else {\n $a = implode(\"\",explode(\"-\",$a)); // eliminate presentational hyphens\n if (strlen($a)>10 && substr($a,0,3)==\"978\") {\n $a = substr($a,3,9);\n }\n else {\n $a = substr($a,0,9);\n }\n $a = strcat(\"~\",numtosxg($a));\n }\n return $a;\n}", "function numtocurrency(num) {\n num = num.toString().replace(/\\$|\\./g, '');\n\n if (isNaN(num)) num = \"0\";\n\n sign = (num == (num = Math.abs(num)));\n num = Math.floor(num * 100 + 0.50000000001);\n cents = num % 100;\n num = Math.floor(num / 100).toString();\n\n if (cents == 0) cents = '';\n else if (cents < 10) cents = \",0\" + cents;\n else cents = ',' + cents;\n\n for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3); i++)\n num = num.substring(0, num.length -(4 * i + 3)) + '.' + num.substring(num.length - (4 * i + 3));\n\n return(((sign) ? '' : '-') + num + cents);\n}", "function fahrenheitConversion(event) {\n let temperatureElement = document.querySelector(\"#temperature\");\n let temperature = temperatureElement.innerHTML;\n temperatureElement.innerHTML = Math.round((temperature * 9) / 5 + 32);\n}", "function convert() {\n var num = $('.texty').val();\n var ara = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 6, 5, 4, 1]; //Arabic numbers\n var rom = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'VI', 'V', 'IV', 'I']; //Roman numerals\n var final = '';\n for (var i = 0; i < rom.length; i++) {\n while (num >= ara[i]) {\n final += rom[i];\n num -= ara[i];\n }\n }\n $('.texty').val(final);\n }", "function kelvin(){\n var tempkelvin=celsius+273.15\n console.log('La temperatura en grados kelvin es: ')\n console.log(tempkelvin +' °K')\n}", "static formatCurrency(x) {\n return \"₱\" + x.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "function get_uc_price(el){\n return parseInt(el.find('.uc-price').text().split(\" تومان\")[0].split(\",\").join(\"\"))\n }", "function formatCurrency(num,dec) {\n\tvar parteEntera = '';\n\tvar parteDecimal = '';\n\t\n\tif(dec==undefined){dec=0;}\n\t\n\tvar auxNum = num + '';\n\tvar bDec = false;\n\tfor(m=0;m<auxNum.length;m++){\n\t\tif(auxNum.charAt(m) == \".\"){\n\t\t\tbDec = true;\n\t\t}else{\n\t\t\tif(bDec == true){\n\t\t\t\tparteDecimal += auxNum.charAt(m);\n\t\t\t}else{\n\t\t\t\tparteEntera += auxNum.charAt(m);\n\t\t\t}\t\n\t\t}\n\t}\n\t\n parteEntera = parteEntera.toString().replace(/\\$|\\,/g,'');\n if(isNaN(parteEntera))\n parteEntera = \"0\";\n sign = (parteEntera == (parteEntera = Math.abs(parteEntera)));\n parteEntera = Math.floor(parteEntera*100+0.50000000001);\n parteEntera = Math.floor(parteEntera/100).toString();\n for (var i = 0; i < Math.floor((parteEntera.length-(1+i))/3); i++)\n parteEntera = parteEntera.substring(0,parteEntera.length-(4*i+3))+'.'+\n parteEntera.substring(parteEntera.length-(4*i+3));\n parteEntera = (((sign)?'':'-') + parteEntera);\n\t\n\tvar resultado = parteEntera;\n\tif(dec>0){\n\t\tresultado+= ',' + parteDecimal;\n\t\tfor(m=parteDecimal.length;m<dec;m++){\n\t\t\tresultado+= '0';\n\t\t}\n\t}\n\t\n\treturn resultado;\n}", "function convertFahToCel(t) {\n\n\treturn (5 / 9) * (t - 32);\n\n}", "function poundsConversion() {\n const pWeight = parseFloat(poundsInput.value); // turns the string into a number which is used for each conversion in this function\n const gWeight = pWeight / 0.0022046;\n const oWeight = pWeight * 16;\n const kWeight = pWeight * 0.45359;\n gramsInput.value = gWeight.toFixed(3); //sets values to DOM using a fixed decimal input\n ounceInput.value = oWeight.toFixed(3);\n kilogramInput.value = kWeight.toFixed(3);\n}", "function convertToCelsius(temperature) {\n return parseInt(temperature - 273.15);\n}", "function convertCeltoFah() {\r\n let userTemp = document.getElementById('userTemp').value;\r\n let fahOutput = document.getElementById('fahOutput');\r\n fahOutput.innerHTML = (userTemp * 9 / 5 + 32) + \"&#8457;\";\r\n}", "function transform(data){\n var currencies = [\n {code: 'USD', symbol: '$'}, //United States Dollar\n {code: 'EUR', symbol: '€'}, //European Union Euro\n {code: 'GBP', symbol: '£'}, //United Kingdom Pound\n\n {code:'ALL', symbol: 'Lek'}, //Albania Lek\n {code: 'AFN', symbol: '؋'}, //Afghanistan Afghani\n {code: 'ARS', symbol: 'AR$'}, //Argentina Peso\n {code: 'AWG', symbol: 'ƒ'}, //Aruba Guilder\n {code: 'AUD', symbol: 'A$'}, //Australia Dollar\n {code: 'AZN', symbol: '₼'}, //Azerbaijan Manat\n {code: 'BSD', symbol: 'B$'}, //Bahamas Dollar\n {code: 'BBD', symbol: 'Bds$'}, //Barbados Dollar\n {code: 'BYN', symbol: 'Br'}, //Belarus Ruble\n {code: 'BZD', symbol: 'BZ$'}, //Belize Dollar\n {code: 'BMD', symbol: '$'}, //Bermuda Dollar\n {code: 'BOB', symbol: '$b'}, //Bolivia Bolíviano\n {code: 'BAM', symbol: 'KM'}, //Bosnia and Herzegovina Convertible Marka\n {code: 'BWP', symbol: 'P'}, //Botswana Pula\n {code: 'BGN', symbol: 'лв'}, //Bulgaria Lev\n {code: 'BRL', symbol: 'R$'}, //Brazil Real\n {code: 'BND', symbol: 'B$'}, //Brunei Darussalam Dollar\n {code: 'KHR', symbol: '៛'}, //Cambodia Riel\n {code: 'CAD', symbol: 'Can$'}, //Canada Dollar\n {code: 'KYD', symbol: 'CI$'}, //Cayman Islands Dollar\n {code: 'CLP', symbol: 'CLP$'}, //Chile Peso\n {code: 'CNY', symbol: 'CN¥'}, //China Yuan Renminbi\n {code: 'COP', symbol: 'COL$'}, //Colombia Peso\n {code: 'CRC', symbol: '₡'}, //Costa Rica Colon\n {code: 'HRK', symbol: 'kn'}, //Croatia Kuna\n {code: 'CUP', symbol: '₱'}, //Cuba Peso\n {code: 'CZK', symbol: 'Kč'}, //Czech Republic Koruna\n {code: 'DKK', symbol: 'kr'}, //Denmark Krone\n {code: 'DOP', symbol: 'RD$'}, //Dominican Republic Peso\n {code: 'XCD', symbol: 'EC$'}, //East Caribbean Dollar\n {code: 'EGP', symbol: 'E£'}, //Egypt Pound\n {code: 'EGP', symbol: 'ج.م'}, //Egypt Pound\n {code: 'SVC', symbol: '₡'}, //El Salvador Colon\n {code: 'FKP', symbol: 'FK£'}, //Falkland Islands (Malvinas) Pound\n {code: 'FJD', symbol: 'FJ$'}, //Fiji Dollar\n {code: 'GHS', symbol: '¢'}, //Ghana Cedi\n {code: 'GIP', symbol: 'GI£'}, //Gibraltar Pound\n {code: 'GTQ', symbol: 'Q'}, //Guatemala Quetzal\n {code: 'GGP', symbol: '£'}, //Guernsey Pound\n {code: 'GYD', symbol: 'G$'}, //Guyana Dollar (or GY$)\n {code: 'HNL', symbol: 'L'}, //Honduras Lempira\n {code: 'HKD', symbol: 'HK$'}, //Hong Kong Dollar\n {code: 'HUF', symbol: 'Ft'}, //Hungary Forint\n {code: 'ISK', symbol: 'kr'}, //Iceland Krona\n {code: 'INR', symbol: '₹'}, //Indian rupee\n {code: 'IDR', symbol: 'Rp'}, //Indonesia Rupiah\n {code: 'IRR', symbol: '﷼'}, //Iran Rial\n {code: 'IMP', symbol: '£'}, //Isle of Man Pound\n {code: 'ILS', symbol: '₪'}, //Israel Shekel\n {code: 'JMD', symbol: 'J$'}, //Jamaica Dollar\n {code: 'JPY', symbol: '¥'}, //Japan Yen\n {code: 'JEP', symbol: '£'}, //Jersey Pound\n {code: 'KZT', symbol: 'лв'}, //Kazakhstan Tenge\n {code: 'KRW', symbol: '₩'}, //Korea (South) Won\n {code: 'KPW', symbol: '₩'}, //Korea (North) Won\n {code: 'KGS', symbol: 'лв'}, //Kyrgyzstan Som\n {code: 'LAK', symbol: '₭'}, //Laos Kip\n {code: 'LBP', symbol: 'ل.ل.‎'}, //Lebanon Pound\n {code: 'LRD', symbol: 'L$'}, //Liberia Dollar - Also LD$\n {code: 'MKD', symbol: 'ден'}, //Macedonia Denar\n {code: 'MYR', symbol: 'RM'}, //Malaysia Ringgit\n {code: 'MUR', symbol: '₨'}, //Mauritius Rupee\n {code: 'MXN', symbol: 'Mex$'}, //Mexico Peso\n {code: 'MNT', symbol: '₮'}, //Mongolia Tughrik\n {code: 'MZN', symbol: 'MT'}, //Mozambique Metical\n {code: 'NAD', symbol: 'N$'}, //Namibia Dollar\n {code: 'NPR', symbol: '₨'}, //Nepal Rupee\n {code: 'ANG', symbol: 'ƒ'}, //Netherlands Antilles Guilder\n {code: 'NZD', symbol: 'NZ$'}, //New Zealand Dollar\n {code: 'NIO', symbol: 'C$'}, //Nicaragua Cordoba\n {code: 'NGN', symbol: '₦'}, //Nigeria Naira\n {code: 'NOK', symbol: 'kr'}, //Norway Krone\n {code: 'OMR', symbol: '﷼'}, //Oman Rial\n {code: 'PKR', symbol: '₨'}, //Pakistan Rupee\n {code: 'PAB', symbol: 'B/.'}, //Panama Balboa\n {code: 'PYG', symbol: 'Gs'}, //Paraguay Guarani\n {code: 'PEN', symbol: 'S/.'}, //Peru Sol\n {code: 'PHP', symbol: '₱'}, //Philippines Piso\n {code: 'PLN', symbol: 'zł'}, //Poland Zloty\n {code: 'QAR', symbol: '﷼'}, //Qatar Riyal\n {code: 'RON', symbol: 'lei'}, //Romania Leu\n {code: 'RUB', symbol: '₽'}, //Russia Ruble\n {code: 'SHP', symbol: '£'}, //Saint Helena Pound\n {code: 'SAR', symbol: '﷼'}, //Saudi Arabia Riyal\n {code: 'RSD', symbol: 'Дин.'}, //Serbia Dinar\n {code: 'SCR', symbol: '₨'}, //Seychelles Rupee\n {code: 'SGD', symbol: 'S$'}, //Singapore Dollar\n {code: 'SBD', symbol: 'SI$'}, //Solomon Islands Dollar\n {code: 'SOS', symbol: 'S'}, //Somalia Shilling\n {code: 'ZAR', symbol: 'R'}, //South Africa Rand\n {code: 'LKR', symbol: '₨'}, //Sri Lanka Rupee\n {code: 'SEK', symbol: 'kr'}, //Sweden Krona\n {code: 'CHF', symbol: 'CHF'}, //Switzerland Franc\n {code: 'SRD', symbol: 'Sr$'}, //Suriname Dollar\n {code: 'SYP', symbol: '£S'}, //Syria Pound\n {code: 'SYP', symbol: 'LS'}, //Syria Pound\n {code: 'TWD', symbol: 'NT$'}, //Taiwan New Dollar\n {code: 'THB', symbol: '฿'}, //Thailand Baht\n {code: 'TTD', symbol: 'TT$'}, //Trinidad and Tobago Dollar\n {code: 'TRY', symbol: '₺'}, //Turkish Lira\n {code: 'TVD', symbol: '$'}, //Tuvalu Dollar\n {code: 'UAH', symbol: '₴'}, //Ukraine Hryvnia\n {code: 'UYU', symbol: '$U'}, //Uruguay Peso\n {code: 'UGX', symbol: 'Ush'}, //Ugandan shilling - might also be 'USh' as per wikipedia\n {code: 'UZS', symbol: 'лв'}, //Uzbekistan Som\n {code: 'VEF', symbol: 'Bs'}, //Venezuela Bolívar\n {code: 'VND', symbol: '₫'}, //Viet Nam Dong\n {code: 'YER', symbol: '﷼'}, //Yemen Rial\n {code: 'ZWD', symbol: 'Z$'} //Zimbabwe Dollar\n];\n for (var i = 0; i < currencies.length; i++) {\n if (data.indexOf(currencies[i].symbol) !== -1) return currencies[i].code;\n }\n\n return \"\";\n}", "function convertToCelcius(tempKelvin){\n let tempCel = Math.round(tempKelvin - 273.15);\n return tempCel\n}", "function getPeso (adcvalue, devider) {\n\n\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t return ((((parseInt(adcvalue)/devider) * 230)/1000)/3600) *12\n\n\t\t\t\t\t\t\t\t\t\t }", "function convert (amount) {\n let number = Number(amount) * 1e8;\n // remove any decimals\n number = number.toFixed(0);\n return Number(number);\n}", "function formatoMoedaVolume(_num) {\n _num = _num.toString().replace(/\\$|\\,/g, '');\n if (isNaN(_num))\n _num = \"0\";\n var sign = (_num == (_num = Math.abs(_num)));\n _num = Math.floor(_num * 1000 + 0.50000000001);\n var cents = _num % 1000;\n _num = Math.floor(_num / 1000).toString();\n if (cents < 10)\n cents = \"0\" + cents;\n for (var i = 0; i < Math.floor((_num.length - (1 + i)) / 3); i++)\n _num = _num.substring(0, _num.length - (4 * i + 3)) + ',' + _num.substring(_num.length - (4 * i + 3));\n //retirando a virgula\n var retorno = (((sign) ? '' : '-') + _num + '.' + cents);\n while (retorno.indexOf(',') > - 1)\n retorno = retorno.replace(',', '');\n return retorno;\n}", "function getPrice() {\n if (interest.Prijs.Koopprijs && !interest.Prijs.Huurprijs) {\n return '<strong>€ ' + numberWithPeriods(interest.Prijs.Koopprijs) + ' <abbr title=\"Kosten Koper\">k.k.</abbr></strong>';\n } else {\n return '<strong>€ ' + numberWithPeriods(interest.Prijs.Huurprijs) + ' <abbr title=\"Per maand\">/mnd</abbr></strong>';\n }\n }", "function convertToFahrenheit(tempC) {\n const tempF = tempC * 1.8 + 32;\n return `${Math.round(tempF)} °F`;\n}", "static fromKelvinToCelsius(temperature) {\n return Math.trunc(Number(temperature) - 273.15) + '°';\n }", "callback(value) {\n return formatCurrency(value, 0);\n }", "function convertToUSDWithCommas(num) {\n numString = num.toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, '$1,');\n numString = \"$\" + numString;\n return numString;\n}", "function inrToPoundConvert(){\n\tvar xhttp= new XMLHttpRequest();\n\txhttp.onreadystatechange = function(){\n\t\tif(this.readyState == 4 && this.status == 200){\n\t\t\tvar apiData =JSON.parse(this.responseText);\n\t\t\tvar indianData = 0.0;\n\t\t\tvar newValue=0.0;\n\t\t\tvar updateAmount = 0.0;\n\n\t\t\tindianData=document.getElementById('rupees').value;\n\t\t\tnewValue = apiData.rates.GBP;\n\t\t\tupdateAmount = indianData * newValue;\n\t\t\t\n\t\t\tdocument.getElementById('pounds').value = updateAmount;\t\n\t\t\t\n\t\t}\n\t};\n\txhttp.open(\"GET\",'https://api.fixer.io/latest?base=INR&symbols=GBP',true);\n\txhttp.send();\n}", "convertToC (farTemp) {\n return (farTemp - 32) * (5 / 9);\n }", "function temp_converter(celsius_value){\n let F = celsius_value + 32/1.8\n console.log(celsius_value+\"C\"+ \" = \"+ F+\"F\")\n}", "function fahrenheitToCelsius(num){\n return (num-32)*5/9\n}", "function inrToUsdConvert(){\n\tvar xhttp= new XMLHttpRequest();\n\txhttp.onreadystatechange = function(){\n\t\tif(this.readyState == 4 && this.status == 200){\n\t\t\tvar apiData =JSON.parse(this.responseText);\n\t\t\tvar rupeeData = 0.0;\n\t\t\tvar newValue=0.0;\n\t\t\tvar updateAmount=0.0;\n\n\t\t\trupeeData=document.getElementById('rupees').value;\n\t\t\tnewValue=apiData.rates.USD;\n\t\t\tupdateAmount =rupeeData * newValue;\n\t\t\t\n\t\t\tdocument.getElementById('dollar').value = updateAmount;\t\t \n\t\t}\n\t};\n\txhttp.open(\"GET\",'https://api.fixer.io/latest?base=INR&symbols=USD',true);\n\txhttp.send();\n}" ]
[ "0.7081263", "0.70436895", "0.6820045", "0.65416956", "0.65415627", "0.6422886", "0.6411635", "0.62857646", "0.628178", "0.6262123", "0.621799", "0.61933947", "0.6176558", "0.6171094", "0.61676157", "0.6163205", "0.6142973", "0.61243206", "0.6101886", "0.609606", "0.60783726", "0.6074158", "0.60454917", "0.5983474", "0.5968209", "0.596324", "0.5961785", "0.59148455", "0.5887957", "0.5885275", "0.58458954", "0.5845308", "0.58444464", "0.58409667", "0.5832932", "0.5829419", "0.5828211", "0.58163494", "0.578864", "0.57871485", "0.5776323", "0.57701117", "0.5751219", "0.5731756", "0.57300913", "0.57245135", "0.5716948", "0.571325", "0.57090956", "0.5705833", "0.56919277", "0.5671997", "0.56497306", "0.56490564", "0.56444985", "0.56434447", "0.5642077", "0.5640281", "0.56231415", "0.5616609", "0.56066674", "0.5596033", "0.55924773", "0.55845606", "0.55839", "0.5581699", "0.55777985", "0.5564516", "0.55559903", "0.5553508", "0.5543917", "0.5537613", "0.55355656", "0.5535239", "0.55345726", "0.55172086", "0.55110323", "0.5497407", "0.5487383", "0.54740417", "0.5472078", "0.5468163", "0.54606813", "0.54603904", "0.5453351", "0.54518706", "0.54447377", "0.5437046", "0.5433829", "0.5433393", "0.5428996", "0.54276353", "0.54208934", "0.5420573", "0.5415891", "0.5415387", "0.54131794", "0.54108626", "0.5409139", "0.54034454" ]
0.74830157
0
UI EVENTS onSubmit onChange
onSubmit(event) { event.preventDefault(); // Validate the form this.step.validate(); // Set a timeout due to the setState function of react setTimeout(() => { const valid = this.step.isValid(); if (valid) { if (this.state.step === this.state.stepLength && !this.state.submitting) { // Start the submitting this.setState({ submitting: true }); // Set the request // Send the request const xmlhttp = new XMLHttpRequest(); const xmlhttpOptions = { type: (this.state.dataset && this.state.layer) ? 'PATCH' : 'POST', authorization: this.state.form.authorization, contentType: 'application/json', omit: ['authorization'] }; xmlhttp.open(xmlhttpOptions.type, `${process.env.WRI_API_URL}/dataset/${this.state.dataset}/layer/${this.state.layer || ''}`); xmlhttp.setRequestHeader('Content-Type', xmlhttpOptions.contentType); xmlhttp.setRequestHeader('Authorization', xmlhttpOptions.authorization); xmlhttp.send(JSON.stringify({ // Remove unnecesary atributtes to prevent 'Unprocessable Entity error' layer: omit(this.state.form, xmlhttpOptions.omit) })); xmlhttp.onreadystatechange = () => { if (xmlhttp.readyState === 4) { // Stop the submitting this.setState({ submitting: false }); if (xmlhttp.status === 200 || xmlhttp.status === 201) { const response = JSON.parse(xmlhttp.responseText); const successMessage = `The layer "${response.data.id}" - "${response.data.attributes.name}" has been uploaded correctly`; console.info(response); console.info(successMessage); alert(successMessage); // Go back to first step and set the dataset // This will trigger the PATCH function this.setState({ step: 1, layer: response.data.id }); } else { console.info('Error'); } } }; } else { this.setState({ step: this.state.step + 1 }, () => console.info(this.state)); } } }, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSubmit() {\n console.log(\"submit form\");\n }", "async handleSubmit(evt) {}", "onSubmit (e) {\n e.preventDefault(); // Don't refresh page\n this.props.onSubmit(this.state.value);\n }", "function onSubmit(ev) {\n ev.preventDefault()\n console.log(`Iniciando submit`)\n\n if (!validacionFinal(aNodosValidables)) {\n return\n }\n aFormData.forEach(item => oDatos[item.name] = item.value)\n aCheckBox.forEach(item => oDatos[item.name] = item.checked)\n aSelects.forEach(item => oDatos[item.name] = item.value)\n oDatos.sitio = getRadio(aRadioSitio)\n renderModal()\n }", "formChanged() {}", "function changeSubmit(event) {\n\tlet submit = event.path[1].children[1];\n\tif (event.target.value) {\n\t\tsubmit.disable = false;\n\t\tsubmit.style.color = \"#0095F6\";\n\t\tsubmit.style.cursor = \"pointer\";\n\t} else {\n\t\tsubmit.disable = true;\n\t\tsubmit.style.color = \"#BADFFC\";\n\n\t}\n}", "onChange () {}", "onChange () {}", "onSubmitClicked() {\n this.onSubmit({\n query: this.ui\n });\n }", "function handleChange(e) {\n var key = e.target.name;\n var value = e.target.value;\n setValues(function (values) {\n return _objectSpread(_objectSpread({}, values), {}, _defineProperty({}, key, value));\n });\n } //menangani submit form", "handleSubmit(e) {\n e.preventDefault();\n this.props.onSubmit(this.state.value);\n }", "function submit_form(form) {\n form.children[2].children[0].onchange = function() {\n form.submit();\n }\n}", "onSubmitHandler(event) {\n event.preventDefault();\n const fields = event.detail.fields;\n fields.Car_Info__c = this.carobject.Id;\n fields.Start_Date__c = this.startdate;\n fields.End_Date__c = this.enddate;\n\n this.template\n .querySelector('lightning-record-edit-form').submit(fields);\n this.status = false;\n }", "handleSubmit(event) {\n this.showLoadingSpinner = true;\n // prevending default type sumbit of record edit form\n event.preventDefault();\n // querying the record edit form and submiting fields to form\n this.template\n .querySelector(\"lightning-record-edit-form\")\n .submit(event.detail.fields);\n this.showLoadingSpinner = false;\n \n }", "function formQueryOnSubmit(e) {\n console.log(\"Form submit\");\n\n // Get the current form fields values and use them for the filtering.\n parseResultsFromJSON($(\"#tournament\").val());\n\n // This prevents the form from being submitted to the server.\n e.preventDefault();\n}", "function handleSubmit(e) {\r\n // update to database\r\n }", "onSubmit() {\n const {onSubmit,onError} = this.props;\n const {validateFields} = this.props.form;\n validateFields((errors,values)=>{\n\n if(errors){\n showMessage(getFirstError(errors));\n if(onError){\n onError(errors);\n }\n return;\n }\n if (onSubmit) {\n onSubmit(values);\n }\n });\n }", "function handleSubmit(e) {\n updateCal();\n YAHOO.util.Event.preventDefault(e);\n }", "function submitAndChange(evt) {\n // evt.preventDefault(); //prevents the natural form behavior from resetting\n\n setBadgeList([\n ...badgeList,\n {\n firstName: state.firstName,\n lastName: state.lastName,\n email: state.email,\n placeOfBirth: state.placeOfBirth,\n phone: state.phone,\n favoriteFood: state.favoriteFood,\n about: state.about\n\n // isSubmitted: false,\n }\n ]);\n // console.log(\"Clearing form\");\n document.getElementById(\"my-form\").reset();\n setState({ firstName: \"\", about: \"\" });\n }", "handleSubmit (formValue) {\n this.props.onSubmit(formValue)\n }", "function onChange() {\n\n // hide and show input elements for which this is necessary\n setVisibility();\n\n // update preview considering the changed input value\n updatePreview();\n\n // perform change actions\n self.onchange && self.onchange( self );\n\n }", "function onChange() {\n\n // hide and show input elements for which this is necessary\n setVisibility();\n\n // update preview considering the changed input value\n updatePreview();\n\n // perform change actions\n self.onchange && self.onchange( self );\n\n }", "function handleFormSubmission(event) {\n //this preventDefault tells the DOM\n // when you click on a button on a form or div that click propogates up each element has a default action\n // prevent default prevents the default action of the element\n // event.stopPropagation - prevents the event from going up the chain\n event.preventDefault();\n // console.log(event.target.elements);\n const {elements} = event.target;\n const class_name = elements[\"name\"].value;\n const date_started = elements[\"date_started\"].value;\n const date_ended = elements[\"date_ended\"].value;\n onSubmit({class_name, date_started, date_ended});\n}", "onSubmit(values) {\n handleFormOnsubmit(values)\n }", "onSubmit(event, data={}, callback=null, header={}){\n event.preventDefault();\n if(has(event.target.dataset, 'action') && has(event.target.dataset, 'method')){\n return this.api(event.target.dataset.action, callback, data, event.target.dataset.method, header);\n }\n }", "handleSubmit(event) {\n\t\tevent.preventDefault();\n\t\tthis.props.onSearchTermChange(this.state.value);\n\t}", "_onSubmit(evt) {\n evt.preventDefault();\n this.props.onSubmit(this.props.data);\n }", "handleSubmit(e){\n const {onSubmit} = this.props;\n console.log(e);\n onSubmit(e, this.state.textin);\n }", "onSubmit(e) {\n e.preventDefault();\n var itemData = {\n name: this.refs.name.value,\n description: this.refs.description.value,\n price: parseFloat(this.refs.price.value).toFixed(2),\n availableDate: this.refs.availableDate.value,\n isTaxable: this.refs.isTaxable.checked\n };\n // TODO: validation\n\n // Callback passed in from parent component\n this.props.onAddItem(itemData);\n // Clear the form once added\n this.refs.itemForm.reset();\n }", "function onChangeHandler(e) {\n\n }", "function onChangeHandler(e) {\n\n }", "onSubmit(e) {\n\t\t// preventing default page reload when form submitted\n\t\te.preventDefault();\n\t\t// remove any whitespace from beginning and end of player name input\n\t\tlet currentValue = this.state.value.trim();\n\t\t// iterating over each player name already inputted by the user - return true if any name matches\n\t\tconst invalid = this.props.players.reduce((acc, item) => {\n\t\t\treturn item.name === currentValue ? acc = true : acc\n\t\t}, false)\n\t\t// next line results in a warning in console from eslint - attempted to resolve this warning - no impact on code when testing \n\t\t// \"Expected an assignment or function call and instead saw an expression no-unused-expressions\" warning\n\t\t// eslint-disable-next-line\n\t\tinvalid ?\n\t\t\tnull\n\t\t\t:\n\t\t\t// call action creator to add the new name to player list if name input is valid\n\t\t\tthis.props.submitPlayer({name: this.state.value})\n\t\t\tthis.setState({\n\t\t\t\tvalue: invalid ? currentValue : \"\",\n\t\t\t\terror: invalid\n\t\t\t})\n\t}", "async function handleSubmit(event) {\n\t// ...\n}", "onSubmit(e) {\n e.preventDefault();\n this.props.onSubmit({ \"blogHeaderText\": this.state.blogHeaderText, \"blogText\": this.state.blogText });\n }", "function onSubmitHandler(e) {\n e.preventDefault();\n\n if (editMode) {\n formData.id = article.id;\n updateArticle(formData);\n } else {\n createArticle(formData);\n }\n\n setEditMode(false);\n selectRef.current.value = 'Open this select menu';\n setArticle({});\n }", "onSubmit(event) {\n // Send message\n this.sendMessage();\n\n event.preventDefault();\n event.stopPropagation();\n }", "_handleSubmit (event) {\n event.preventDefault();\n const query = this.requestURL();\n this.props.onSubmit(query);\n }", "function submitHandler(event){\n event.preventDefault()\n \n props.fetchWeatherData(input)\n }", "onSubmit(e) {\n e.preventDefault();\n this.props[this.state.action](this.state.role);\n this.setState({formHasChanged: false});\n }", "onSubmit(e) {\n e.preventDefault();\n alert(\"Saved\");\n }", "handleSubmit(e) {\r\n // Prevent legacy form post\r\n e.preventDefault();\r\n\r\n // Validate\r\n if (FormValidator.validateForm(e)) {\r\n // TODO place ajax POST / PUT stuff here...\r\n let isSuccess = true;\r\n\r\n if (typeof this.props.onSubmit === 'function') {\r\n this.props.onSubmit(this.state.data, isSuccess);\r\n }\r\n }\r\n }", "_onSubmit(evt) {\n evt.preventDefault();\n const {updateProfileFormState} = this.props.data;\n this.props.onSubmit(updateProfileFormState.firstName, updateProfileFormState.lastName, updateProfileFormState.project, updateProfileFormState.releaseDate, updateProfileFormState.primarySkills, updateProfileFormState.secondarySkills, updateProfileFormState.yearsOfExperience, updateProfileFormState.trainings, updateProfileFormState.qualification, updateProfileFormState.mobileNo, updateProfileFormState.email);\n}", "handleSubmit(event) {\n this.props.callBack(this.state.value);\n event.preventDefault();\n }", "handleSubmit(event) {\n if (this.state.valueChampsSelected === 1) {\n this.creatUser(event);\n }\n if (this.state.valueChampsSelected === 2) {\n this.updateUser(event);\n }\n if (this.state.valueChampsSelected === 3) {\n this.deleteUser(event);\n }\n }", "registerSubmitEvent() {\n\t\tthis.container.on('click', '.js-modal__save', (e) => {\n\t\t\tAppConnector.request({\n\t\t\t\tmodule: app.getModuleName(),\n\t\t\t\taction: 'ChangeCompany',\n\t\t\t\trecord: this.container.find('#companyId').val()\n\t\t\t}).done(() => {\n\t\t\t\twindow.location.href = 'index.php';\n\t\t\t});\n\t\t\te.preventDefault();\n\t\t});\n\t}", "function formSubmitHandler(event) {\n event.preventDefault();\n buttonSubmitHandler(deck);\n }", "function handleSubmit(e) {\n e.preventDefault()\n setValue(input.value)\n console.log(data)\n }", "function onSubmit (fields, { setSubmitting } ) {\n console.log(\"From onSubmit these are the fields: \" + JSON.stringify(fields)); \n alertService.clear();\n subService.create(fields)\n .then(() => {\n // const { from } = location.state || { from: { pathname: \"/\" } };\n // history.push(from);\n alertService.success('Application submitted successfully', { keepAfterRouteChange: true });\n history.push('.');\n })\n .catch(error => {\n setSubmitting(false);\n alertService.error(error);\n });\n\n }", "function submitPressed() {\n \n}", "function formSubmitted(){\n getCurrentNumbers();\n setConfirmationMessage();\n}", "onSubmitHandler(ev) {\n //Prevent refreshing the page\n ev.preventDefault();\n createMeeting(\n this.props.location.pathname.split('/')[2]\n ,this.state.topic,\n this.state.time,\n this.state.date,\n this.onCreateSuccess);\n }", "function handleSubmit(e) {\n e.preventDefault();\n const currentValue = input.value;\n paintGreeting(currentValue);\n saveName(currentValue);\n}", "function onSubmit() {\n const post = { postHeader, postContent, creatorName, postId: shortid.generate() }\n submitPost(post)\n }", "function handleSubmit(event){\n props.onSubmit(noteState);\n setNoteState({\n title: \"\",\n body: \"\"\n })\n setExpand(false);\n event.preventDefault();\n }", "function onSubmit(){\n //Concurrency programming - multiple people could potentiall submit the form at the same time!\n var lock = LockService.getScriptLock()\n try {\n lock.waitLock(30000) // Wait for up to 30 seconds for another form to be processed\n }catch(e) {\n // Handle lock exception\n Logger.log('Could not obtain lock after 30 seconds.')\n }\n\n //Update form description. isProcessingComplete = false\n updateFormDescription(false)\n\n //1. Assign new question ID\n assignQuestionID()\n\n //2. Copy Data from Existing Survey, or Update Form Item options and automatically append new entries\n if(isExistingSurvey()){\n copyDataFromExistingSurvey()\n } else {\n updateFormItem(EXISTING_SURVEY_POLL_NAME, POLL_NAME)\n updateFormItem(POLLING_GROUP)\n }\n\n //3. Update the two other relational worksheets\n updateOptionsWorksheet()\n updateKeywordsWorksheet()\n\n //Update form description. isProcessingComplete = true\n updateFormDescription(true)\n\n lock.releaseLock()\n}", "onSubmit(value) {\n this.status = 'answered';\n\n // Rerender prompt\n this.render();\n\n this.screen.done();\n cliCursor.show();\n this.done(value);\n }", "onSubmit(value) {\n this.status = 'answered';\n\n // Rerender prompt\n this.render();\n\n this.screen.done();\n cliCursor.show();\n this.done(value);\n }", "function onSubmitHandler(e) {\n e.preventDefault();\n props.Search(props.cities);\n }", "onSubmit() {\n if(this.updatingType){\n this.updateType();\n } else {\n this.createType();\n }\n }", "handleSubmit(event){\n event.preventDefault(); // stop the form from submitting\n const fields = event.detail.fields;\n\n //Update RecordId, ObjectAPIName based on URL in case URL has changed in console\n //There is no way to track URL changes as there is no API and component doesn't re-render in Utility Bar\n //Update page data (object, record ID, URL) with latest info (if it was in console) and submit form\n this.updateRecordInfoFromUrl();\n\n //Use namespace in fields\n fields.issuebox__Reported_Object__c = this.objectApiName;\n fields.issuebox__Reported_Record__c = this.recordId;\n fields.issuebox__URL__c = this.pageUrlPath;\n \n this.template.querySelector('lightning-record-edit-form').submit(fields);\n }", "onSubmit_() {\n if (!this.canSubmit_) {\n // Disallow submitting when it's not allowed or while proceeding the\n // previous submission.\n return;\n }\n this.processingCompletion_ = true;\n this.fire('completed', this.$.pinKeyboard.value);\n }", "function handleSubmit(e) {\n e.preventDefault();\n\n // stateovi za errore\n // validacija\n }", "onChange() {\n triggerEvent(this.input, 'input');\n triggerEvent(this.input, 'change');\n }", "function onChange() {\n\t\t__debug_452( 'Received a change event.' );\n\t\tself.render();\n\t}", "function handleSubmit() {\n\n displayVoteCount();\n renderChart();\n pushNewData();\n}", "function onFormSubmit(e) {\n var timestamp = e.namedValues['Timestamp'][0];\n var userId = e.namedValues['UserID'][0];\n var temperature = parseFloat(e.namedValues['Temperature (F)'][0]);\n var feeling = e.namedValues['Feeling'][0];\n var symptoms = e.namedValues['Symptoms'][0];\n updateSummarySheet(timestamp, userId, temperature, feeling, symptoms);\n updateIndividualSheet(timestamp, userId, temperature, feeling, symptoms);\n // TODO: Uncomment this once this is better tested.\n // updateAggregateChart(timestamp, userId, temperature);\n sendEmail(timestamp, userId, temperature, feeling, symptoms);\n}", "function handleSubmit(event) {\n event.preventDefault(); // stop page from reloading\n const form = event.currentTarget;\n if (form.checkValidity() === false) {\n event.preventDefault();\n event.stopPropagation();\n }\n // get the form data so we can access it\n const formData = new FormData(event.target),\n formDataObj = Object.fromEntries(formData.entries());\n setValidated(true);\n // request an analysis from the API. \n // provide the setter and the appropriate file\n requestFromApi(setResp, formDataObj)\n\n }", "internalOnChange(event) {\n const me = this,\n value = me.value,\n oldValue = me._lastValue;\n\n // Don't trigger change if we enter invalid value or if value has not changed (for IE when pressing ENTER)\n if (me.isValid && value !== oldValue) {\n me._lastValue = value;\n\n // trigger change event, signaling that origin is from user\n me.trigger('change', { value, oldValue, event, userAction: true });\n\n // per default Field triggers action event on change, but might be reconfigured in subclasses (such as Combo)\n if (me.defaultAction === 'change') {\n me.trigger('action', { value, oldValue, event });\n }\n }\n\n // since Widget has Events mixed in configured with 'callOnFunctions' this will also call onClick and onAction\n }", "function handleOnSubmit(e) {\n e.preventDefault()\n\n showUsernameValue()\n showEmailValue()\n showPasswordValue()\n\n clearUsernameInput()\n clearEmailInput()\n clearPasswordInput()\n }", "handleSubmit(e){\n e.preventDefault();\n this.props.onSubmitRequest(this.state.submitQuery1, this.state.submitQuery2);\n }", "function submitClicked () {\n retrieveInput();\n changePage();\n}", "function onChange() {\n\t\t__debug_330( 'Received a change event.' );\n\t\tself.render();\n\t}", "function handleChange(e) {\n const value = e.target.value;\n const name = e.target.name;\n dispatch({ value: value, update: name });\n }", "onFormSubmit(event) {\n event.preventDefault();\n const { onSubmit } = this.props;\n const { clientName, amount, id, created } = this.state;\n\n if (onSubmit && clientName && amount) {\n onSubmit({\n id,\n created,\n clientName,\n amount: amount * 100 // convert to cents\n });\n }\n }", "async function handleSubmit(e)\n {\n e.preventDefault();\n //check if empty\n if(ifEmpty(\"titel\", titel) && ifEmpty(\"inter\", inter) && ifEmpty(\"tech\", tech) /**&& ifEmpty(\"tech2\", tech2)*/ ){\n //add job to db\n const result = await addJobdb4params(titel, inter, tech, email)\n if(result === true){\n //get all jobs from db\n var jobs = await getJobs(email)\n //set all jobs in db\n props.updateUser(jobs)\n //redirect to /profile\n history.push(\"/profile\");\n }\n } \n }", "function onChange(control, oldValue, newValue, isLoading) {\r\n if (isLoading || newValue == '') {\r\n return;\r\n }\r\n\tsd = g_form.getValue('issue');\r\n\tif (sd == 'meetings_issue'){\r\n\t\tvar c = this;\r\n\t\tc.confirmed = \"asking\";\r\n\t\tspModal.alert(\"Please make sure to attach a screenshot!\").then(function(confirmed) {\r\n\t\tc.confirmed = confirmed; // true or false\r\n\t\tif (c.confirmed == true) {\r\n\t\t\tg_form.setValue('triggerOnSubmit()', true);\r\n\t\t}else {\r\n\t\t\tg_form.setValue('triggerOnSubmit()', false);\r\n\t\t}\r\n\t});\r\n\t}\r\n}", "onChange(event) {\n const { onEntryChange } = this.props;\n onEntryChange(event.target.value);\n }", "onChange(event) {\n const {\n onEntryChange\n } = this.props;\n onEntryChange(event.target.value);\n }", "async submitForm(event) {\n // Set up\n var { formValues, history, submitWorkflow } = this.props;\n event.preventDefault();\n\n // Check if we even have to do an update (aka did the user even make any changes?)\n var madeNoChanges = this.compareForms(this.state.originalForm, this.props.formValues.values);\n if (madeNoChanges) {\n toast(\"You made no changes yet!\");\n return;\n }\n\n var successfullySubmission = await submitWorkflow(formValues.values, history);\n if (successfullySubmission) {\n toast(\"You have updated your profile!\");\n }\n }", "function submitAndRerender() {\n if (this.value === \"\") { return };\n submit(this)\n renderCurrent();\n }", "handleSubmit(event) {\r\n event.preventDefault();\r\n this.props.onSubmit();\r\n }", "function handleFormSubmit(event){\n event.preventDefault(); //não fazer o padrão\n }", "function formSubmitted(e) {\n\n var action = e.target.getAttribute('action');\n\n if (action[0] === '#') {\n e.preventDefault();\n trigger('POST', action, e, serialize(e.target));\n }\n }", "function formSubmitHandler(event) {\n event.preventDefault();\n\n var selectedCity = citySelect.options[citySelect.options.selectedIndex].value;\n var selectedDays = parseInt(daysSelect.options[daysSelect.options.selectedIndex].value, 10);\n var layoutsArray = Array.prototype.slice.call(widgetLayouts);\n var selectedLayout;\n\n layoutsArray.forEach(function(layout) {\n if (layout.checked) {\n selectedLayout = layout.value;\n }\n });\n var apiPath = '/widget?city=' + selectedCity + '&days=' + selectedDays + '&layout=' + selectedLayout;\n\n fetchTemplate(apiPath, function(template) {\n hideWidgetForm();\n //codeResult.querySelector('.well').innerText = template;\n });\n\n }", "function handlerSubmit(e) {\n e.preventDefault();\n if (!comment || !rating) {\n dispatch(\n showMessageWithTimeout(\"danger\", true, \"Please fill out all the fields\")\n );\n } else if (token === null) {\n dispatch(\n showMessageWithTimeout(\n \"danger\",\n true,\n \"You need to log in to leave a comment\"\n )\n );\n } else if (user.isCandidate) {\n dispatch(\n showMessageWithTimeout(\n \"danger\",\n true,\n \"You can leave a review only if you are register as owner\"\n )\n );\n } else {\n dispatch(addReview(rating, comment, profile.id));\n }\n setRating(0);\n setComment(\"\");\n }", "handleSubmit(e){\n\t\t// The target element = the form\n\t\tlet playerName = e.target.playerName.value;\n\t\t// prevents the full page refresh when the submit button is clicked \n\t\te.preventDefault();\n\t\t\n\t// if the input is not empty\n\t\tif(playerName){\n\t\t\t// Clear the input form to an empty string\n\t\t\te.target.playerName.value = '';\n\t\t\t// Insert into Players a new object (document) with key:value pairs\n\t\t\tPlayers.insert({\n\t\t\t\tname: playerName,\n\t\t\t\tscore: 0\n\t\t\t});\n\t}\n\t}", "formSubmit() {\n if(this.get('disableSubmit')) { return; }\n \n this.sendAction('submitUserContact', {\n contactType: this.get('selectedContactType'),\n name: this.get('nameValue'),\n fromEmail: this.get('emailValue'),\n content: this.get('commentValue')\n });\n\n if(this.attrs.onContactSubmit) {\n this.attrs.onContactSubmit();\n }\n }", "onSubmit(e) {\n\t\te.preventDefault();\n\t\tif (!this.state.champ) {\n\t\t\t//alert(\"You didn't enter anything!\");\n\t\t\treturn;\n\t\t}\n\t\t//Prevent default form actions.\n\t\t//Manually redirect user to next page.\n\t\tthis.setState({redirect: true});\n\t}", "handleSubmit(event){\r\n event.preventDefault(); // stop the form from submitting\r\n const fields = event.detail.fields;\r\n name = event.target.name;\r\n\r\n //select the account fields from the record page.\r\n if( name == \"saveAccount\"){\r\n this.template.querySelector('.accnt').submit(fields);\r\n }\r\n //select the contact fields from the record page.\r\n else if(name == \"saveContact\"){\r\n this.template.querySelector('.cont').submit(fields);\r\n }\r\n //select the opportunity fields from the record page.\r\n else if(name == \"saveOppty\"){\r\n this.template.querySelector('.oppty').submit(fields); \r\n }\r\n }", "function preSubmitHandler(){\n\tsubmitFinishHandler();\n}", "function handleSubmit(e){\n e.preventDefault()\n \n submitCategoryEdit({\n id: id,\n name: categoryName,\n budget: parseInt(budgetValue)\n })\n\n setIsEditClicked(!isEditClicked)\n\n }", "validateOnSubmit(e) {\n // validate the entire form\n return this.runValidation(false);\n }", "function onChange(event)\n\t{\n\t\tconst val = event.target.value\n\t\tsetValue(val)\n\t}", "async function handleSubmit(e) {\n e.preventDefault();\n console.log(\"handle submit clicked\")\n // setShowEventModal(false)\n await API.addEvent({\n title: titleState,\n startDate: startDate,\n endDate: endDate,\n startTime: startTime,\n endTime: endTime,\n notes: noteState,\n userId: userId\n })\n getEvents();\n console.log('Submit clicked')\n handleEventModalClose();\n handleDayModalClose();\n getEvents(); \n }", "function handleSubmit(e) {\n e.preventDefault();\n // console.log('submitted');\n // console.log(e.currentTarget);\n const name = e.currentTarget.item.value;\n // console.log(name);\n\n // if it's empty then dont submit\n if (!name) return;\n\n // when collecting a list of items, good to have an id for easy lookup. ID should be something unique, good to use current timestamp in milliseconds\n const item = {\n name,\n id: Date.now(),\n complete: false,\n };\n\n // push item into our state\n items.push(item);\n // console.log(`there are now ${items.length} in your state`);\n // console.log(items);\n\n // clear the form inputs\n e.target.reset();\n\n // display items - we'll refactor this later as we want to display items from local storage when page refreshes and when items are deleted the list should rerender - this will all be done through custom events\n // displayItems();\n\n // fire custom event that will tell anyone that cares, that the items have been updated - using dispatch event method\n list.dispatchEvent(new CustomEvent('itemsUpdated'));\n}", "handleSubmit(e){\n //preventDefault previene que la pagina se recargue\n e.preventDefault();\n /**un call back a onAdd props. el stado\n * actual es pasado como parametro\n */\n $(\"#exampleModal\").modal('hide');\n this.props.onUpdate(this.state.newProduct);\n }", "function onFormSubmit ( formSubmitEvent ) {\n\t\tconsole.log(\"Form submitted and man handled...\");\n\t\t//prevent the page from reloading on submission\n\t\tformSubmitEvent.preventDefault();\n\n\n\t\t//Get info from zipcode box\n\t\tvar zip = $( \"#zip\" ).val();\n\t\tconsole.log(\"zip:\", zip);\n\n\t\t$.get(\"http://maps.googleapis.com/maps/api/geocode/json\", \n\t\t\t{ address: zip }, \n\t\t\tonGeocodeResponse);\n\t}", "handleSubmit(event) {\n this.GetFromNW();\n this.GetTotalLogins();\n }", "function onChange() {\n\t\t__debug_412( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "handleSubmit(event) {\n\n //prevent the form submitting\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n\n let\n props = this.props,\n valid = true,\n fieldValues = getValues(fieldNames, props.form.fields, initialFieldValues)\n ;\n\n //let the user filter and validate each field\n fieldNames.forEach(fieldName => {\n\n if (filterOnSubmit) {\n fieldValues[fieldName] = props.form.actions.filter(filter, fieldName, fieldValues);\n }\n\n if (validateOnSubmit) {\n valid = props.form.actions.validate(validate, fieldName, fieldValues) && valid;\n }\n\n });\n\n //let the user submit the values\n if (valid && submit) {\n props.form.actions.submit(submit, fieldValues);\n }\n\n }", "function onChange(e) {\n setValue(e.target.value);\n }" ]
[ "0.71524733", "0.70684963", "0.70531464", "0.6934514", "0.6842213", "0.6828775", "0.67651504", "0.67651504", "0.6764502", "0.6713403", "0.67049795", "0.6698204", "0.6695863", "0.66804487", "0.6624674", "0.661544", "0.6574098", "0.656762", "0.6548952", "0.6540871", "0.6532958", "0.6532958", "0.6532955", "0.65318644", "0.6514187", "0.65097046", "0.650355", "0.6485618", "0.648437", "0.648093", "0.648093", "0.6477697", "0.6472745", "0.6471775", "0.64563197", "0.64196664", "0.6417591", "0.64175206", "0.6413971", "0.6403246", "0.6402806", "0.63958436", "0.6394929", "0.63948846", "0.6377731", "0.6375985", "0.6372555", "0.6369403", "0.63654006", "0.63641953", "0.63638544", "0.6339621", "0.63270915", "0.63149196", "0.63082063", "0.63026303", "0.63026303", "0.6302329", "0.6298041", "0.6292348", "0.6289712", "0.62879914", "0.6286839", "0.62863994", "0.62853926", "0.6284592", "0.62794816", "0.62774605", "0.6271024", "0.62708676", "0.6268347", "0.62674564", "0.62666345", "0.6262484", "0.62613857", "0.6245768", "0.6243815", "0.6239994", "0.62387675", "0.62345517", "0.62336916", "0.6230608", "0.62295866", "0.6228453", "0.62211436", "0.6213228", "0.620952", "0.6203778", "0.6199714", "0.619822", "0.61977994", "0.61953896", "0.6192247", "0.6192208", "0.61905503", "0.6190247", "0.6190072", "0.6186597", "0.6184124", "0.61810136", "0.6180437" ]
0.0
-1
randomly change the light
function changeLight() { if (OrangeCounter > 0) { LIGHT = "Orange"; OrangeCounter -= 1; } else if (random() < ChangeProb) { newLIGHT = ((LIGHT == "Red") ? "Green" : "Red"); OrangeCounter = OrangeTime; } else if (OrangeCounter <= 0) { OrangeCounter = 0; LIGHT = newLIGHT; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fakeLight(){\n pntLight = false;\n}", "function randomStopLight() {\n var randomNumber = Math.floor(Math.random() * 10);\n if (randomNumber < 3) {\n return \"Red\";\n } else if(randomNumber >= 3 && randomNumber <= 6) {\n return \"Yellow\";\n } else {\n return \"Green\";\n }\n}", "function realLight(){\n pntLight = true;\n}", "alterWind() {\n var change = Math.random() * 0.1;\n if(Math.random() > 0.5)\n change *= -1;\n\n if(Math.random() > 0.6)\n this.wind[0] += change;\n else\n this.wind[2] += change;\n vec3.normalize(this.wind, this.wind);\n\n vec3.scale(this.wind, this.wind, this.windStrength);\n }", "function changeColor()\n{\n if (this.style.backgroundColor === 'rgb(255, 255, 255)' || flag === 1)\n {\n this.style.backgroundColor = 'rgb(' + Math.floor(Math.random() * 256) + ','\n + Math.floor(Math.random() * 256) + ',' + Math.floor(Math.random() * 256) + ')';\n }\n else if (flag === 0)\n {\n let lightness = parseInt(this.style.filter.match(/\\d+/));\n lightness != 0 ? this.style.filter = `brightness(${lightness - 10}%)` : false;\n }\n}", "setRandomColor() {\n const r = Math.floor(Math.random() * 255);\n const g = Math.floor(Math.random() * 255);\n const b = Math.floor(Math.random() * 255);\n \n this.setColorState([r, g, b]);\n }", "function getRandomLightColor() {\n var letters = '0123456789ABCDEF';\n var color = '#';\n for (var i = 0; i < 6; i++) {\n color += letters[(Math.floor(Math.random() * 15)+1)];\n }\n return color;\n }", "function buttonRainbowMode() {\n randomBirdsColourChange();\n}", "function pickRandomColors(element, lightness) {\n element.style.setProperty(\"--lightness\", lightness);\n element.style.background = `hsl(${getRndInteger(0, 361)},${getRndInteger(0, 101)}%,${lightness}%)`;\n}", "function updateLights(gl){\n if(isDisco){ // If disco mode is on\n xDisco+=1;\n for(var i=0; i<12; i++){\n lightColours[i]=randomLights[i].getVal(xDisco); // Randomise the lights\n }\n }else{\n for(var i=0; i<12; i++){\n lightColours[i]=1; // Set the lights to 1\n }\n }\n if(sunOn){\n if(sunTime+0.005>2*Math.PI){\n sunTime=0;\n }else{\n sunTime+=0.001;\n }if(won){ // If you got all the entities on the roof\n xSun+=1;\n gl.uniform3f(program.u_AmbientLight, randomSun[0].getVal(xSun), randomSun[1].getVal(xSun), randomSun[2].getVal(xSun)); // Randomise the ambient light\n gl.clearColor(randomSun[0].getVal(xSun), randomSun[1].getVal(xSun), randomSun[2].getVal(xSun),1); // Randomise the clear colour\n }else{\n sunBrightness=0.6+0.4*Math.sin(sunTime);\n gl.uniform3f(program.u_AmbientLight, sunBrightness, sunBrightness, sunBrightness); // Do the day/night cycle\n gl.clearColor(0,0,sunBrightness,1-0.6*sunBrightness);\n }\n }else{\n gl.uniform3f(program.u_AmbientLight, 0.7, 0.7, 0.7);\n }\n gl.uniform1iv(program.lightsOn, lightsOn); // Set whether the point lights are on\n gl.uniform3fv(program.lightColours, lightColours); // Set the point light colours\n gl.uniform3fv(program.lightPositions, lightPositions); // Set the point light positions\n\n}", "function lightningGenerator() {\n\n let odds = random(0, 1);\n\n //FLASHING EFFECT//\n lightning.alpha = lightning.alpha - lightning.speed;\n lightingInside.alpha = lightingInside.alpha - lightingInside.speed;\n\n //PLAYS LIGHTNING AT ADJUSTABLE ODDS//\n if (odds > 0.998) {\n\n if (isOutside) {\n\n //EFFECTS ONLY OUTSIDE LIGHNING EFFECT//\n lightningSFX.setVolume(1);\n lightningSFX.play();\n lightning.alpha = 210;\n } else {\n\n //EFFECTS INSIDE AND OUTSIDE LIGHTNING EFFECT//\n lightningSFX.setVolume(0.3);\n lightningSFX.play();\n lightning.alpha = 210;\n lightingInside.alpha = 200;\n }\n\n }\n\n push();\n fill(lightning.color, lightning.alpha);\n rect(0, 0, width, height);\n pop();\n}", "function changeColor() {\n const random = Math.floor(Math.random() * colorsArray.length);\n event.target.style.color = colorsArray[random];\n}", "function lightMode() {\n change(\n \"rgb(255 255 255 / 50%)\",\n \"rgb(0 0 0 / 50%)\",\n \"Light Mode\",\n \"fa-moon\",\n \"fa-sun\",\n \"img/undraw_proud_coder_light.svg\",\n \"img/undraw_feeling_proud_light.svg\",\n \"img/undraw_conceptual_idea_light.svg\"\n );\n \n}", "function switchLight(lightNumber) {\n allOff();\n var light = LIGHTS[lightNumber];\n light.classList.add(\"on\");\n\n if (lightNumber == 0)\n red();\n\n if (lightNumber == 2)\n ready();\n}", "function assignRandomColor1(){\r\n color1.value = getRandomColor();\r\n setGradient();\r\n}", "function colorChange() {\n let x = Math.floor(Math.random() * 248);\n let y = Math.floor(Math.random() * 248);\n let z = Math.floor(Math.random() * 248);\n let linkColor = \"rgb(\" + x + \",\" + y + \",\" + z + \")\";\n return linkColor;\n}", "function RandomColor()\n{\nif( shapeColor.length > 0)\n {\nvar newColor = Random.Range(0,shapeColor.length);\nGetComponent.<Renderer>().material.color = shapeColor[newColor];\n }\n}", "function changeGray() {\n gray = random(0, 255, 0);\n}", "function lightChangingFunction() {\n nextActive = chooseNewNumber(active);\n\n lightButtons[nextActive].classList.toggle(\"chosenButton\");\n lightButtons[active].classList.remove(\"chosenButton\");\n\n timesBlinked++;\n blinked.push(timesBlinked);\n\n if (blinked.length > 3) {\n stopTheGame();\n return;\n }\n\n active = nextActive;\n\n function chooseNewNumber(active) {\n pressedOnce = false;\n let nextActive = getRandomNumber(0, 3);\n if (nextActive != active) {\n return nextActive;\n } else {\n return chooseNewNumber(active);\n }\n }\n\n timer = setTimeout(lightChangingFunction, gameSpeed);\n}", "function light(){\n\n console.log('SHOW TIME');\n gsap.set(\"#light\",{display:\"block\", scale:.75, alpha:.25, transformOrigin:\"center center\"});\n\n lightTL.to(\"#light\",{duration:1, scale:1, aplha:1, yoyo:true, repeat:-1, ease:\"back.out\"});\n\n lightTL.play()\n }", "function randnomColor(){\n randnomColorCalcVar = true;\n opacityTaggle(\"false\");\n hoverActivate();\n\n}", "function toggleLight() {\n setLit(!islit);\n }", "function resetLight() {\r\n\tgl.uniform4fv(gl.getUniformLocation(program, \"ambientProduct\"), flatten(ambientProduct));\r\n\tgl.uniform4fv(gl.getUniformLocation(program, \"specularProduct\"), flatten(specularProduct));\r\n}", "function randomOn() {\n if (blinks < blink) {\n i = Math.floor(Math.random() * antall);\n on[i] = true;\n blinks++;\n startTime = new Date().getTime();\n updateView();\n timeID = setTimeout(off, 1500);\n updateView();\n } else { clearInterval(blinkID); }\n \n}", "function changeGray() {\n g = random(0, 255);\n}", "function flashy_random_color() {\n //to get flashy color let red to 255 and change green and blue\n var g=Math.floor(255*Math.random())\n var b=Math.floor(255*Math.random())\n return \"rgb(255,\"+g+\",\"+b+\")\"\n}", "illuminateColor(color){\r\n this.color[color].classList.add('light')\r\n setTimeout(()=>this.turnOffColor(color),350)\r\n}", "function randomColor(e){\n let randomColor = '#' + Math.floor(Math.random()*16777215).toString(16);\n e.target.style.setProperty('--random-color', randomColor);\n e.target.classList.add('colorChange');\n e.target.classList.remove('greyScale');\n}", "function generateRed() {\n choice = randomIntFromInterval(0, 1);\n switch (choice) {\n case 0:\n hue = randomIntFromInterval(Hrainbow.red.low1, Hrainbow.red.high1);\n \n case 1:\n hue = randomIntFromInterval(Hrainbow.red.low2, Hrainbow.red.high2);\n }\n return hue;\n}", "function changeColor() {\n let colorArr = [\"red\", \"green\", \"blue\", \"yellow\", \"pink\", \"purple\", \"grey\"];\n let colorChangeIdx = Math.floor(Math.random() * colorArr.length);\n let body = document.getElementsByTagName(\"body\")[0];\n body.style.backgroundColor = colorArr[colorChangeIdx];\n}", "function randomCrystalYellow() {\n $(\"#yellow-crystal\").html(yellowValue);\n }", "function updateLight(current) {\n if (current === \"green\") {\n return \"yellow\";\n } else if (current === \"yellow\") {\n return \"red\";\n } else {\n return \"green\";\n }\n}", "function changeColor() {\n var color = randColor();\n // console.log(\"color is:\" + color);\n return \"rgb(\" + color + \")\";\n}", "function randomColor () {\nreturn Math.floor (Math.random() * 256) ;\n}", "function randColor() {\n\n // Set random word\n\n\n // Set random word color\n\n\n }", "function changeColor() {\n change.style.background = getRandomColor();\n}", "function changeBallColour(){\r\n\tlet rand = Math.floor(Math.random() * 6);\r\n\tlet colour = [\"blue\", \"green\", \"#fe1c80\", \"yellow\", \"red\", \"purple\", \"orange\", \"white\"];\r\n\tlet currentColour = document.getElementById(\"ball\").style.backgroundColor;\r\n\t\r\n\tif(currentColour == colour[rand]){\r\n\t\trand = 7;\r\n\t}//if\r\n\t\r\n\tdocument.getElementById(\"ball\").style.backgroundColor = colour[rand];\r\n\t\r\n}", "function randColor() {\n var col = app.foregroundColor;\n col.rgb.red = Math.floor( Math.random()*256 );\n col.rgb.green = Math.floor( Math.random()*256 );\n col.rgb.blue = Math.floor( Math.random()*256 );\n app.foregroundColor = col;\n }", "function randomizeGemColor(gem) {\n items++;\n $(\"#gems\").text(items);\n\n gem.frame = game.rnd.integerInRange(0, gem.animations.frameTotal - 1);\n\n}", "function doChangeRedLight() {\r\n if (document.getElementById(\"light4\").checked) {\r\n scene.add(redLight);\r\n } else {\r\n scene.remove(redLight);\r\n }\r\n if (!animating) {\r\n render();\r\n }\r\n}", "newNextColor() {\n if (this.gameOver) {\n return;\n }\n this.nextBlob1Color = Math.floor(Math.random() * this.puyoVariations) + 1;\n this.nextBlob2Color = Math.floor(Math.random() * this.puyoVariations) + 1;\n this.state.updateNextBlobs();\n }", "async function lightShow(){\n await changeBodyColor('teal',1000);\n await changeBodyColor('pink',1000);\n await changeBodyColor('indigo',1000);\n await changeBodyColor('violet',1000);\n}", "function lightSquare() {\n\tclickedAllowed = false;\n\tif(timer) {\n\t\tclearInterval(timer);\n\t} \n\tindex = 0;\n\tsquares.push(Math.floor(Math.random() * 4));\n\ttimer = setInterval(lightUp, 900); //number indicates how long it takes for square to light up after clicking start\n}", "function changueColor(){\n let randomNumber = Math.floor(Math.random() * (256 - 1 + 1)) + 1;\n return randomNumber;\n}", "function illuminateRed() {\n clearLights();\n document.getElementById('stopLight').style.backgroundColor = \"red\";\n document.getElementById('goLight-R').style.backgroundColor = \"green\";\n}", "function illuminateGreen() {\n clearLights();\n document.getElementById('goLight').style.backgroundColor = \"green\";\n}", "function illuminateYellow() {\n clearLights();\n document.getElementById('slowLight').style.backgroundColor = \"yellow\";\n}", "function SetColor(){\n\tvar newColor : Color;\n\tnewColor.r = (Random.Range(0, 17) / 16.0);\n\tnewColor.g = (Random.Range(0, 17) / 16.0);\n\tnewColor.b = (Random.Range(0, 17) / 16.0);\n\tnewColor.a = 1.0;\n\n\tfor(var i = 0; i < meshData.Length; i++){\n\t\tvar skinnedMeshData : SkinnedMeshRenderer = meshData[i].GetComponent(SkinnedMeshRenderer);\n\t\tif(skinnedMeshData){\n\t\t\tskinnedMeshData.material.color = newColor;\n\t\t}\n\t\telse{\n\t\t\tmeshData[i].GetComponent(MeshRenderer).material.color = newColor;\n\t\t}\n\t}\n}", "function changeColor(){\n var i = Math.floor(Math.random() * 8);\n col = c[i];\n}", "function randomizer() {\n target = Math.floor(Math.random() * 100) + 19;\n gem1rando = Math.floor(Math.random() * 13) + 2;\n gem2rando = Math.floor(Math.random() * 13) + 2;\n gem3rando = Math.floor(Math.random() * 13) + 2;\n gem4rando = Math.floor(Math.random() * 13) + 2;\n }", "function changeBackground() {\n\treturn Math.floor(Math.random() * 256);\n}", "execute() {\n this.light.changeBrightness(100);\n }", "getRandomColor() {\n const randomNumber = Math.floor(Math.random()*16777215);\n let color = '#'+( randomNumber ).toString(16);\n\n let mode = this.lightOrDark(color);\n\n if ( color.length < 7 ) {\n color = '#000000';\n mode = 'dark';\n }\n\n return {\n color,\n mode\n };\n }", "function updateLight(current) {\n \n return current === 'yellow' ? 'red' : current === 'green' ? 'yellow' : 'green';\n\n}", "function randomColor(){\r\n var hue = Math.floor(Math.random() * 360);\r\n var l = Math.random() * 15 + 70;\r\n var pastel = 'hsl(' + hue + ', 100%, ' + l + '%)';\r\n return pastel;\r\n}", "function changeColor() {\n var first = Math.floor(Math.random() * 256);\n var second = Math.floor(Math.random() * 256);\n var third = Math.floor(Math.random() * 256);\n var color = \"rgb(\" + first + \",\" + second + \",\" + third + \")\"\n document.body.style.backgroundColor = color;\n}", "function pickcolor() {\n\tvar random=Math.floor(Math.random()*color.length);\n\t return color[random];\n\t// body...\n}", "function Light() {}", "function random_colour ()\n{\n var colour_no = Math.floor (Math.random () * 6);\n return colours[colour_no];\n}", "function autoGlitch() {\n if (noise) noise.go();\n setTimeout(function() {\n if (noise) noise.pause();\n }, Math.random() * 300 + 400);\n setTimeout(autoGlitch, Math.random() * 3000 + 4000);\n}", "randomizeColors(){\n for (const [key, color] of Object.entries(this.colors)) {\n color.newColor()\n }\n this.updateGradientString()\n }", "function generateMuted(hue) {\n flag = 'false';\n // Muted colors do not appear on the saturation/lightness table in a\n // uniform column or row so the sections of the table were split in\n // four. To choose random integers successfully between the four groups\n // the first step is to pick a random integer 0 to 3 and then pick\n // another random integer within the saturation/lightness table section\n choice = randomIntFromInterval(0, 3); // 0 to 3\n switch (choice) {\n case 0:\n // saturation = random # 6 to 25 inclusive\n satMin = 6;\n satMax = 25;\n\n // lightness = random # 26 to 35 inclusive\n lightMin = 26;\n lightMax = 35;\n\n saturation = randomIntFromInterval(satMin, satMax);\n lightness = randomIntFromInterval(lightMin, lightMax);\n\n // Error checking?\n if (isLightnessWithinConstraints(lightness, lightMin, lightMax)\n && isSaturationWithinConstraints(saturation, satMin, satMax)) {\n break;\n }\n\n case 1:\n // saturation = random # 6 to 45 inclusive\n satMin = 6;\n satMax = 45;\n\n // lightness = random # 36 to 55 inclusive\n lightMin = 36;\n lightMax = 55;\n\n saturation = randomIntFromInterval(satMin, satMax);\n lightness = randomIntFromInterval(lightMin, lightMax);\n\n // Error checking?\n if (isLightnessWithinConstraints(lightness, lightMin, lightMax)\n && isSaturationWithinConstraints(saturation, satMin, satMax)) {\n break;\n }\n\n case 2:\n // saturation = random # 6 to 35 inclusive\n satMin = 6;\n satMax = 35;\n\n // lightness = random # 56 to 65 inclusive\n lightMin = 56;\n lightMax = 65;\n\n saturation = randomIntFromInterval(satMin, satMax);\n lightness = randomIntFromInterval(lightMin, lightMax);\n\n // Error checking?\n if (isLightnessWithinConstraints(lightness, lightMin, lightMax)\n && isSaturationWithinConstraints(saturation, satMin, satMax)) {\n break;\n }\n case 3:\n // saturation = random # 16 to 35 inclusive\n satMin = 16;\n satMax = 35;\n\n // lightness = random # 66 to 75 inclusive\n lightMin = 66;\n lightMax = 75;\n\n saturation = randomIntFromInterval(satMin, satMax);\n lightness = randomIntFromInterval(lightMin, lightMax);\n\n // Error checking?\n if (isLightnessWithinConstraints(lightness, lightMin, lightMax)\n && isSaturationWithinConstraints(saturation, satMin, satMax)) {\n break;\n }\n }\n\n hsl = \"hsl(\" + hue + \", \" + saturation + \"%, \" + lightness + \"%)\";\n debug(hsl); // test\n return hsl;\n}", "function changeColor() {\n\t\tvar randomColor = '#' + Math.floor(Math.random() * 16777215).toString(16);\n\t\tvar text = document.getElementById(\"color-div\");\n\t\ttext.style.color = randomColor;\n\t}", "function generateRandomColors() {\r\n color1.value = getRandom();\r\n color2.value = getRandom();\r\n setGradient();\r\n}", "function switchColor () {\n if (!gl) {\n gl = canvas.getContext(\"webgl\") || canvas.getContext(\"experimental-webgl\");\n if (!gl) {\n alert(\"Browser unsupported!\");\n return;\n }\n\n gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);\n\n}\n //get a random color\n var color = getRandomColor();\n\n gl.clearColor(color[0], color[1], color[2], 1.0);\n\n gl.clear(gl.COLOR_BUFFER_BIT);\n\n}", "function randomColour() {\n let red = randomNumber();\n let green = randomNumber();\n let blue = randomNumber();\n\n colour.style.backgroundColor = 'rgb(' + red + ',' + green + ',' + blue + ')';\n hex.value = '#' + rgbToHex(red) + rgbToHex(green) + rgbToHex(blue);\n\n fetchColorInfo(hex.value.substring(1, 7));\n updateHistory(hex.value);\n updateStorage();\n updateHistoryArea();\n}", "function darkenLight() {\r\n\tgl.uniform4fv(gl.getUniformLocation(program, \"ambientProduct\"), flatten(vec4(0, 0, 0, 0)));\r\n\tgl.uniform4fv(gl.getUniformLocation(program, \"diffuseProduct\"), flatten(vec4(0, 0, 0, 0)));\r\n\tgl.uniform4fv(gl.getUniformLocation(program, \"specularProduct\"), flatten(vec4(0, 0, 0, 0)));\r\n}", "function rndWaterColor() {\n return 'rgb(' + colorsWater[Math.floor(Math.random() * 5999) + 1] + ')';\n }", "function randomColor(color){\n return color[Math.floor((Math.random() * 3))];\n }", "drawLight(unit){}", "function moveLighting() {\n lightPosition[2] = -10;\n gl.uniform4fv(gl.getUniformLocation(program, \"lightPosition\"),\n flatten(lightPosition) );\n lightIndex = 20;\n}", "function generateLighting(num) {\r\n var pointLHelper1, pointLHelper2, dirLightHelper;\r\n if (num === 0) {\r\n pointLight1.intensity = 0.8;\r\n pointLight1.color.setHex(0xcccccc);\r\n pointLight1.position.set(3, 5, -5);\r\n\r\n pointLight2.intensity = 0.2;\r\n pointLight2.color.setHex(0x648038);\r\n pointLight2.position.set(-3, -5, -5);\r\n\r\n hemisphereLight.intensity = 0.2;\r\n hemisphereLight.color.setHex(0x3e1c09);\r\n hemisphereLight.groundColor.setHex(0xb92d12);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// hemisphereLight.name = \"hemisphereLight\";\r\n// scene.add(pointLight1, hemisphereLight);\r\n } else if (num == 1) {\r\n pointLight1.intensity = 0.8;\r\n pointLight1.color.setHex(getRandomColour(0xcc, 0xfa, 0xc5, 0xfa, 0xcc, 0xfa));\r\n pointLight1.position.set(0, 9, 0);\r\n\r\n hemisphereLight.intensity = 0.5;\r\n hemisphereLight.color.setHex(0x3e1c09);\r\n hemisphereLight.groundColor.setHex(0x9b5649);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// scene.add(pointLight1);\r\n } else if (num == 2) {\r\n pointLight1.intensity = 6;\r\n pointLight1.color.setHex(0xffc682);\r\n pointLight1.position.set(14, 18, -23);\r\n\r\n directionalLight.intensity = 0.5;\r\n directionalLight.color.setHex(0xddcccc);\r\n directionalLight.position.set(0, 10, 0);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// directionalLight.name = \"directionalLight\";\r\n// scene.add(pointLight1, directionalLight);\r\n } else if (num == 3) {\r\n hemisphereLight.intensity = 0.5;\r\n hemisphereLight.color.setHex(0x427a98);\r\n hemisphereLight.groundColor.setHex(0x24221f);\r\n\r\n pointLight1.intensity = 1;\r\n pointLight1.color.setHex(0xff9327);\r\n pointLight1.position.set(8, 10, -25);\r\n\r\n pointLight2.intensity = 1;\r\n pointLight2.color.setHex(0xff9327);\r\n pointLight2.position.set(-8, 10, -25);\r\n\r\n pointLight3.intensity = 1;\r\n pointLight3.color.setHex(0xff9327);\r\n pointLight3.position.set(16, 10, -25);\r\n\r\n pointLight4.intensity = 1;\r\n pointLight4.color.setHex(0xff9327);\r\n pointLight4.position.set(-16, 10, -25);\r\n\r\n// pointLHelper1 = new THREE.PointLightHelper(pointLight1, 10);\r\n// pointLHelper2 = new THREE.PointLightHelper(pointLight2, 10);\r\n\r\n// hemisphereLight.name = \"hemisphereLight\";\r\n// pointLight1.name = \"pointLight1\";\r\n// pointLight2.name = \"pointLight2\";\r\n// pointLight3.name = \"pointLight3\";\r\n// pointLight4.name = \"pointLight4\";\r\n// scene.add(pointLight1, pointLight2, pointLight3, pointLight4,\r\n// hemisphereLight);\r\n } else if (num == 4) {\r\n pointLight1.intensity = 1.2;\r\n pointLight1.color.setHex(0xff6026);\r\n pointLight1.position.set(0, -10, -6);\r\n\r\n pointLight2.intensity = 0.6;\r\n pointLight2.color.setHex(0x7c9aaa);\r\n pointLight2.position.set(11, -10, -8);\r\n\r\n pointLight3.intensity = 0.6;\r\n pointLight3.color.setHex(0xc3a2d0);\r\n pointLight3.position.set(-11, -10, -8);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// pointLight2.name = \"pointLight2\";\r\n// pointLight3.name = \"pointLight3\";\r\n// scene.add(pointLight1, pointLight2, pointLight3);\r\n } else if (num == 5) {\r\n hemisphereLight.intensity = 0.5;\r\n hemisphereLight.color.setHex(0x427a98);\r\n hemisphereLight.groundColor.setHex(0x24221f);\r\n\r\n pointLight1.intensity = 3;\r\n pointLight1.distance = 4.4;\r\n pointLight1.color.set(0xf2d24b);\r\n pointLight1.position.set(1.8, 2.5, -6);\r\n// pointLHelper1 = new THREE.PointLightHelper(pointLight1, 2);\r\n\r\n directionalLight.intensity = 0.5;\r\n directionalLight.color.setHex(0xf2d24b);\r\n directionalLight.position.set(4, 20, -5);\r\n// dirLightHelper = new THREE.DirectionalLightHelper(directionalLight, 20);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// directionalLight.name = \"directionalLight\";\r\n// hemisphereLight.name = \"hemisphereLight\";\r\n// scene.add(hemisphereLight, directionalLight, pointLight1);\r\n } else if (num == 6) {\r\n pointLight1.intensity = 0.6;\r\n pointLight1.color.setHex(0xff0000);\r\n pointLight1.position.set(5, 10, -4);\r\n\r\n pointLight2.intensity = 0.6;\r\n pointLight2.color.setHex(0x00ff00);\r\n pointLight2.position.set(-7, 10, -9);\r\n\r\n pointLight3.intensity = 0.6;\r\n pointLight3.color.setHex(0x0000ff);\r\n pointLight3.position.set(-0.3, -2, -4);\r\n\r\n// pointLight1.name = \"pointLight1\";\r\n// pointLight2.name = \"pointLight2\";\r\n// pointLight3.name = \"pointLight3\";\r\n// scene.add(pointLight1, pointLight2, pointLight3);\r\n }\r\n console.log(\"Objects in scene: \");\r\n console.log(scene.children);\r\n}", "function pickAColour() {\n if(clickHistory.length > 0) {\n var a = clickHistory[random(0, clickHistory.length-1)][1] * random(0, 10); //generates random color based on clickHistory array value * random(0,10)//\n return a;\n } else {\n return colourList[Math.floor(Math.random() * colourList.length)]; //otherwise, generates completely random color from the colourList array of 255//\n }\n}", "setColorsRand() {\n this.fg = 0;\n this.bg = 0;\n\n while (Math.abs(this.fg - this.bg) < 10) {\n this.fg = Math.floor(Math.random() * 255);\n this.bg = Math.floor(Math.random() * 255);\n }\n\n this.setColors();\n }", "function ambient_light (r, g, b) {\r\n a_red = r;\r\n a_green = g;\r\n a_blue = b;\r\n}", "static light() {\n window.localStorage.setItem('colorScheme', 'light')\n this.#isDark = false;\n this.#applyScheme();\n }", "function setRandomBackground(){\n color1.value = colorRandom();\n color2.value = colorRandom();\n setGradient();\n // console.log(colorRandom());\n}", "function illuminateRed(){\n clearLights();\n $(\"#stopLight\").css(\"background-color\", \"red\");\n }", "function discoParty() {\n for (i = 0; i < 30; i++) {\n setTimeout(function() {\n var randIdx = Math.floor(Math.random() * tjColors.length);\n var randColor = tjColors[randIdx];\n tj.shine(randColor);\n }, i * 250);\n }\n}", "function randomColor(){\n \t\tvar colors = [\"#6816A4\",\"#2A509F\",\"#E21F22\",\"#FC9A24\"]; \n \t\tvar rand = Math.floor(Math.random()*colors.length); \n \t\t$('section.tsumLibrary div').css(\"background\", colors[rand]);\n\t}", "function SeededRandom(){}", "function changeColor() {\n red = Math.floor(Math.random() * 255);\n green = Math.floor(Math.random() * 255);\n blue = Math.floor(Math.random() * 255);\n\n return red, green, blue;\n}", "function chooseRandomStickyColour(){\r\n\treturn tStickyColours[Math.floor(Math.random()*tStickyColours.length)];\r\n}", "function randColor()\n {\n return '#'+ Math.floor(Math.random()*16777215).toString(16);\n }", "generateMutedColor(){\n\t\tlet hue = Math.floor(random(360));\n\t\tlet saturation = 0.15 + (random() * 0.85);//between 15 to 100\n\t\tlet lumosity = 0.3 + (random() * 0.5); //between 0.3 to 0.8\n\n\t\tlet colorValue = this.hslToRgb(hue, saturation, lumosity);\n\n\t\tconsole.log(colorValue);\n\t\tthis.set(colorValue[0], colorValue[1], colorValue[2]);\n\t}", "function setLighting(state)\r\n{\r\n gl.uniform1i(shaderProgram.uLighting,state);\r\n}", "function rainbowColor() {\n updatePenMode(\"random\");\n}", "function setRandomColor() {\n var colors = ['#16a085', '#27ae60', '#2c3e50', '#f39c12', '#e74c3c', '#9b59b6', '#FB6964', '#342224', \"#472E32\", \"#BDBB99\", \"#77B1A9\", \"#73A857\"];\n document.body.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];\n}", "update(time) {\n /*light.intensity = (Math.sin(time)+1.5)/1.5;\n light.color.setHSL( Math.sin(time), 0.5, 0.5 );\n */\n }", "function doChangeViewLight() {\r\n if (document.getElementById(\"light2\").checked) {\r\n scene.add(viewpointLight);\r\n } else {\r\n scene.remove(viewpointLight);\r\n }\r\n if (!animating) {\r\n render();\r\n }\r\n}", "function lightAndSound(simon) {\n\t// First setTimeout is delay between player move ending and computer move starting.\n\tsetTimeout(function() {\n\t\tfor (var i = 0; i < simon.length; i++) {\n\t\t\t(function(order) {\n\t\t\t\t// Second setTimeout is for delay between computer moves.\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tsoundIdx = colorArr.indexOf(simon[order]);\n\t\t\t\t\tsoundsArr[soundIdx].play();\n\t\t\t\t\t$('.' + simon[order]).addClass(simon[order] + '-glow');\n\t\t\t\t\t// Third setTimeout is for delay between removing glow effect.\n\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t$('.' + simon[order]).removeClass(simon[order] + '-glow')\n\t\t\t\t\t}, speed());\n\t\t\t\t}, order * (speed() + 50));\n\t\t\t})(i);\n\t\t}\n\t}, 850);\n\tplayerTurn = true;\n}", "function doChangeAmbientLight() {\r\n if (document.getElementById(\"light3\").checked) {\r\n scene.add(ambientLight);\r\n } else {\r\n scene.remove(ambientLight);\r\n }\r\n if (!animating) {\r\n render();\r\n }\r\n}", "function changeBoxColor() {\n var red = Math.random()*256;\n red = Math.floor(red);\n var green = Math.random()*256;\n green = Math.floor(green);\n var blue = Math.random()*256;\n blue = Math.floor(blue);\n var color = \"rgb(\" +red+\",\"+green+\",\"+blue+\")\";\n box.style.backgroundColor = color;\n }", "function pickColor(){\n return Math.floor(Math.random()*numColors);\n}", "function delayRando(){\n let elem = document.getElementById('helloWorld')\n elem.onclick = () => {\n let r = Math.random()*255\n let g = Math.random()*255\n let b = Math.random()*255\n setTimeout(() => {\n elem.style.color = `rgb(${r}, ${g}, ${b})`\n },3000)\n }\n}", "function randomToggleState() {\n return Math.floor(Math.random() * 2);\n}", "function changeBackgroundColorWithTimer() {\n window.setInterval('getRandomColor()', 10000);\n}", "function randColor() {\n return Math.floor(Math.random() * 256);\n}", "function randomColor() {\n return Math.floor(Math.random() * 255);\n}", "function changeattr() {\n $(\"#Blue\").attr(\"value\", Math.floor(Math.random() * 12))\n $(\"#Red\").attr(\"value\", Math.floor(Math.random() * 12))\n $(\"#Green\").attr(\"value\", Math.floor(Math.random() * 12))\n $(\"#Yellow\").attr(\"value\", Math.floor(Math.random() * 12))\n\n}" ]
[ "0.73495024", "0.7308613", "0.7187673", "0.6919768", "0.6912044", "0.6880123", "0.6871698", "0.6805461", "0.6795812", "0.671041", "0.6692147", "0.6655923", "0.6650478", "0.66353744", "0.6598286", "0.6590681", "0.6583609", "0.6563177", "0.6562443", "0.65593904", "0.6536377", "0.6521601", "0.6518582", "0.6501367", "0.6499987", "0.6496285", "0.6481375", "0.6463587", "0.64288753", "0.6421147", "0.64203864", "0.64191854", "0.64152074", "0.6409373", "0.640926", "0.63994586", "0.63979274", "0.63936645", "0.63917506", "0.63710815", "0.63586116", "0.6352259", "0.63441163", "0.63337123", "0.63329685", "0.63321877", "0.6331246", "0.6330506", "0.63191664", "0.63174367", "0.6308797", "0.6307953", "0.6291656", "0.6288853", "0.62856925", "0.6275726", "0.6273229", "0.6271296", "0.62696105", "0.6267147", "0.6266159", "0.6261781", "0.62567526", "0.62558824", "0.6243761", "0.62423813", "0.62403333", "0.62362796", "0.62351894", "0.62271595", "0.62252605", "0.62249696", "0.62215775", "0.6220505", "0.6219405", "0.62169033", "0.62162584", "0.6216215", "0.6214887", "0.6211054", "0.6208039", "0.62055784", "0.62034017", "0.62029964", "0.62014884", "0.619451", "0.6182039", "0.6179399", "0.6176058", "0.61759955", "0.61711144", "0.6167698", "0.6162456", "0.61596626", "0.61579514", "0.61484134", "0.61454153", "0.6145392", "0.61357623", "0.6132132" ]
0.7821203
0
this image handler is for experience
function imageHandler_discuss() { const input = document.createElement('input'); input.setAttribute('type', 'file'); input.click(); input.onchange = () => { var file = input.files[0]; var image_file = new FormData(); image_file.append("image", file); $.ajax({ url : 'http://127.0.0.1:8000/post/save_user_discuss_post_image/', type : "POST", data: image_file, contentType: false, headers: { "X-CSRFToken": csrftoken }, processData: false, success : function(response_data) { insertToEditor_discuss(response_data["image_url"]); }, error : function(xhr,errmsg,err) { console.log(xhr.status + ": " + xhr.responseText); } }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function image_display() {\r\n\r\n}", "function C999_Common_Achievements_ShowImage(ImagePath) {\n C999_Common_Achievements_Image = ImagePath;\n}", "function getImageInfo() {\n\n}", "function imageHandler(e) {\n fileName = e.target.files[0];\n mpImg = new MegaPixImage(fileName);\n setTimeout(presentImage, 1000);\n}", "imageCreated(/* image */) {}", "handlePreviewImage(e){\n // pics array\n const urls = this.GoodsInfo.pics.map(v=>v.pics_mid);\n // use passed data as url\n const current = e.currentTarget.dataset.url;\n\n wx.previewImage({\n current: current,\n urls: urls,\n success: (result)=>{\n \n },\n fail: ()=>{},\n complete: ()=>{}\n });\n\n\n }", "function loadImage(){\n console.log(\"Image clicked one\")\n // self.img.path = self.image.src;\n // console.log(\"Image clicked two\");\n }", "function handlePlanImage(id) {\n alert(id);\n }", "function imageLoader(event) {\n displayImage(event)\n previewFile()\n}", "display() {\n this.move();\n imageMode(CENTER);\n image(this.axeImg, this.x + bgLeft, this.y, this.w, this.h);\n }", "imageSelected() {\n this.props.displayCallback(this.state.imageURL, this.state.parentAlbum, this.state.editHistory);\n }", "patched() {\n this._handleImageLoad();\n }", "function PhotoArticleCover() {\n\n\n\n\t}", "function displayImage(){\n\n}", "onImageClick() {\n console.log('Clicked Image')\n }", "function superbgimage_click(img) {\n\t\t\t\t\t\t$fullsize.nextSlide();\n\t\t\t\t\t\t$fullsizetimer.startTimer( 7000 );\n\t\t\t\t\t}", "function imageClicked(eventData) {\n let clickInformation = eventData;\n if ( clickInformation.target.className = 'image') {\n if (clickInformation.target.alt === \"rock\") {\n let playerSelection = \"rock\";\n rockImage.classList.add('image','playerWeapon');\n outcome = playRound(playerSelection, computerPlay());\n \n if (playerScore != 5 && compScore != 5) {\n whoWon(outcome);\n \n }\n\n } else if (clickInformation.target.alt === \"paper\") {\n let playerSelection = \"paper\";\n paperImage.classList.add('image','playerWeapon');\n outcome = playRound(playerSelection, computerPlay());\n\n if (playerScore != 5 && compScore != 5) {\n whoWon(outcome);\n \n }\n \n } else if (clickInformation.target.alt === \"scissors\") {\n let playerSelection = \"scissors\";\n scissorsImage.classList.add('image','playerWeapon');\n outcome = playRound(playerSelection, computerPlay());\n\n if (playerScore != 5 && compScore != 5) {\n whoWon(outcome);\n \n }\n }\n }\n \n }", "function handler() {\n applyFishEye(\n sig.mousecaptor.mouseX,\n sig.mousecaptor.mouseY\n );\n }", "function customEventOnImageRendered (e) {\n onImageRendered(e, e.detail);\n }", "function image_result_streamization() {\r\n \r\n}", "function New_Image_Display(n) {\n image_index += n;\n if (image_index > image_files_in_dir.length) {\n image_index = 1\n }\n if (image_index < 1) {\n image_index = image_files_in_dir.length\n };\n \n val_obj = {descriptionInput:'', taglist:'', imgMain:image_files_in_dir[image_index - 1]}\n //view_annotate_module.Annotation_DOM_Alter(val_obj)\n\n //UNOCMMENT LATER!!!!\n tagging_view_annotate.Annotation_DOM_Alter(val_obj)\n\n //Load_State_Of_Image()\n\n //UNOCMMENT LATER!!!!\n Load_State_Of_Image_IDB() \n\n}", "function onItemImageUpdated(event, index){\n\t\t\n\t\tvar objItem = t.getItem(index);\t\t\n\t\tcheckPreloadItemImage(objItem);\t\t\n\t}", "renderNewImage() {\n\n document.getElementById('img').src = `${this.url}`\n document.getElementById('p1').innerText = `${this.caption}`\n\n }", "function dc1(ob) {\r\n\tob.src = app_path_images+'balloon_left.png';\r\n}", "populate(asset) {\n const cls = this.constructor\n\n // Clear the current state component\n this._destroyStateComponent()\n\n // Update the asset and input value\n this._asset = asset\n\n // Set up the viewer\n const behaviourMap = this._gallery.constructor.behaviours\n const behaviour = this.parentBehaviours.viewer\n this._viewer = behaviourMap.viewer[behaviour](this)\n this._viewer.init()\n\n // Set up event handlers for the viewer\n $.listen(\n this._viewer.viewer,\n {\n 'download': () => {\n // Build a link to trigger a file download\n const a = $.create(\n 'a',\n {\n 'download': '',\n 'href': this.getAssetProp('downloadURL'),\n 'target': '_blank'\n }\n )\n a.click()\n },\n\n 'edit': () => {\n\n const imageEditorBehaviour = this.parentBehaviours\n .imageEditor\n const imageEditor = behaviourMap\n .imageEditor[imageEditorBehaviour](this)\n imageEditor.init()\n imageEditor.show()\n\n $.listen(\n imageEditor.overlay,\n {\n 'okay': () => {\n const {transforms} = imageEditor\n const {previewDataURI} = imageEditor\n\n previewDataURI.then(([dataURI, sizeInfo]) => {\n\n // Set the preview image\n this._viewer.imageURL = dataURI\n\n // Set base transforms against the image\n this.setAssetProp(\n 'transforms',\n imageEditor.transforms\n )\n\n // Set the preview URL\n this.setAssetProp('previewURL', dataURI)\n\n imageEditor.hide()\n })\n },\n 'cancel': () => {\n imageEditor.hide()\n },\n 'hidden': () => {\n imageEditor.destroy()\n }\n }\n )\n },\n\n 'metadata': () => {\n const metaBehaviour = this.parentBehaviours.metadata\n const metadata = behaviourMap\n .metadata[metaBehaviour](this)\n metadata.init()\n metadata.show()\n\n $.listen(\n metadata.overlay,\n {\n 'okay': () => {\n // Apply any metadata changes\n const {props} = metadata\n for (let key in props) {\n this.setAssetProp(key, props[key])\n }\n\n // Hide the medata overlay\n metadata.hide()\n },\n 'cancel': () => {\n metadata.hide()\n },\n 'hidden': () => {\n metadata.destroy()\n }\n }\n )\n },\n\n 'remove': () => {\n // Remove the item\n this.destroy()\n\n // Dispatch the removed event\n $.dispatch(this.item, 'removed', {'item': this})\n }\n }\n )\n\n // Set the new state\n this._state = 'viewing'\n\n // Flag element as populated in the DOM\n this.item.classList.add(cls.css['populated'])\n\n // Dispatch a populated event\n $.dispatch(this.item, 'populated', {'item': this})\n }", "display() {\n push();\n this.image = enemyImage[this.hitCount]\n imageMode(CENTER)\n image(this.image, this.x, this.y, this.size * 2, this.size * 2);\n pop();\n }", "function handler() {\n applyFishEye(\n sig.mousecaptor.mouseX,\n sig.mousecaptor.mouseY\n );\n }", "function getAndDisplayGuideImage(){\n\tconsole.log('getAndDisplayGuideImage ran');\n\tgetAnimations(displayGuideImage);\n}", "dibujarEnemigo(e) {\n this.app.image(e.tipo, e.x, e.y);\n }", "function imageLoaded() {\n self.framed = self.createFramedImage(self.image, width, height);\n //self.framed = self.image;\n self.object = self.createRendererObject();\n if(self.prepareCallback) {\n self.prepareCallback(true);\n }\n }", "function AdminPromotionsImageUiLoadTypeImages(obj) {\n AdminPromotionsImageUiLoadTypeImagesMain($(obj).attr(\"tabKey\"), $(obj).attr(\"contentId\"));\n}", "function dh1(ob) {\r\n\tob.src = app_path_images+'history_active.png';\r\n}", "function C999_Common_Achievements_Run() {\n BuildInteraction(C999_Common_Achievements_CurrentStage);\n if ((C999_Common_Achievements_Image !== undefined) && (C999_Common_Achievements_Image.trim() != \"\")) {\n DrawImage(C999_Common_Achievements_Image, 600, 0);\n }\n}", "function onImageLoaded(evt) {\n console.log('The image loaded')\n evt.target.classList.add('appear')\n}", "function onImgClick () {\n $ ('.img-wrap').one ('click', function (e) {\n console.log ('image clicked');\n console.log (characters);\n attackSound.play ();\n $ ('#selected-character-id').css ('border', 'solid 5px greenyellow');\n $ (this).off (e);\n });\n }", "alertImage() {\n\t\tAlert.alert(\n\t\t\t'MobiShop',\n\t\t\t'from where you want the image',\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\ttext: 'cancel',\n\n\t\t\t\t\tstyle: 'cancel'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttext: 'gallery',\n\t\t\t\t\tonPress: () => this.onChooseImageUploud2()\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttext: 'camera',\n\t\t\t\t\tonPress: () => this.onChooseImageUploud()\n\t\t\t\t}\n\t\t\t],\n\t\t\t{ cancelable: false }\n\t\t);\n\t}", "_handleImageLoad() {\n if (!this.attachmentViewer || !this.attachmentViewer.attachment) {\n return;\n }\n const refs = this._getRefs();\n const image = refs[`image_${this.attachmentViewer.attachment.id}`];\n if (\n this.attachmentViewer.attachment.fileType === 'image' &&\n (!image || !image.complete)\n ) {\n this.attachmentViewer.update({ isImageLoading: true });\n }\n }", "function imageInfoListItemClick(event) {\n gImageInfoViewer.setImageInfo(event.currentTarget.imageInfo);\n}", "function handleFileLoad(event) {\n console.log(\"A file has loaded of type: \" + event.item.type);\n // create bitmaps of images\n if (event.item.id == \"background\") {\n background = new createjs.Bitmap(event.result);\n } else if (event.item.id.includes(\"treaty_\")) {\n var tempTreaty = new createjs.Bitmap(event.result);\n tempTreaty.id = event.item.id;\n treatyImages.push(tempTreaty);\n } else if (event.item.id == \"panel\") {\n panel = new createjs.Bitmap(event.result);\n }\n}", "function clickHandler(event) {\n //take the path from the src attribute of the img node\n //that we clicked on. We get a reference to that node\n //from event.target\n var targetString = event.target.src;\n //take the relevant part of the path from the node\n var targetPath = targetString.split('assets')[1];\n var itemPath;\n\n //look through the ItemImage objects to find the one that\n //corresponds to the image we clicked on\n for (var i = 0; i < items.length; i++) {\n //get the relevant part from the path on the object\n itemPath = items[i].path.split('assets')[1];\n if (itemPath === targetPath) {\n //when we find the right object increment its clicked\n //property\n items[i].clicked += 1;\n }\n }\n\n changePicture();\n}", "onImageLoad() {\n this.cacheFrameReady = true;\n this.drawCurrentFrame();\n }", "function imageClickHandler(e) {\n var wordIndex;\n // get index that was stored in the img object\n wordIndex = e.currentTarget.getAttribute('data-word-index');\n console.log('image click ' + wordIndex);\n // collect the word clicked!\n game.wordsCollected[wordIndex] = true;\n // set a popup based on mouse position\n setPopupContent(wordIndex, e.clientX, e.clientY);\n // show mask\n jQuery('#mask').show();\n // show pop-up\n jQuery('#popup').show();\n // sound\n game.soundInstance = createjs.Sound.play(\"word_\" + wordIndex); // play using id. Could also use full sourcepath or event.src.\n //game.soundInstance.addEventListener(\"complete\", createjs.proxy(this.handleComplete, this));\n //game.soundInstance.volume = 0.5;\n // prevent other events\n e.stopPropagation();\n}", "function imageloadpost(){\r\n\tloadedimages++;\r\n\tif (loadedimages==data_obj.frame_number){\r\n\t postaction(); //call postaction \r\n\t}\r\n }", "function onShowDemo() {\n resetPageState();\n var demoCon = document.querySelector('.demo_con');\n demoCon.innerHTML = generateClickimageSource();\n\n var img = demoCon.querySelector('img');\n img.src = document.querySelector('.image_wrap .image_con img').src;\n\n // from clickimage.js\n try {\n clickimagePins(img); //eslint-disable-line\n } catch(e) {\n // ignore\n }\n\n document.querySelector('.page').classList.add('demo');\n }", "function ho(){var t=this;Be(this);var e=ki(this.$source,[\"imageloadend\",\"imageloaderror\",\"imageloadstart\"]);this.subscribeTo(e,function(e){return t.$emit(e.type,e)})}", "errorPoster(p){\n p.target.src = 'img/boolflixposter.png'\n }", "function displayCurrent(img){\n img.className = 'current ' + scope.photoImport.data[n].orientClass;\n return img;\n }", "function ImageHead(url) {\n\twhiteboard.modalClose('.modal_image_upload_progress');\n\twhiteboard.modalClose('.modal_image_select');\n\twhiteboard.modalOpen('.modal_image');\n\twhiteboard.toolbarActivate('#toolbar_confirm', '#toolbar_cancel', '#toolbar_image');\n\tthis.url = url;\n\t$('#modal_image').attr('src', url);\n}", "putImage(button){\n if(button.code == -1){//al ser clickeada la locación, se enrutará a la página de locaciones y su subbsección respectiva\n switch(this.easyFrame){\n case 0:\n window.location.href = \"location.html#cove\";\n return;\n case 1:\n window.location.href = \"location.html#darkest-dungeon\";\n return;\n case 2:\n window.location.href = \"location.html#ruins\";\n return;\n case 3:\n window.location.href = \"location.html#warrens\";\n return;\n case 4:\n window.location.href = \"location.html#weald\";\n return;\n case 5:\n window.location.href = \"location.html#courtyard\";\n return;\n case 6:\n window.location.href = \"location.html#farmstead\";\n return;\n default:\n return;\n }\n\n }\n //en caso que se clickee un botón, se ajusta el frame de la locación y se vuelve visible, además se le agrega su interactividad\n this.areaPicture.setFrame(button.code);\n this.easyFrame = button.code;\n this.areaPicture.setVisible(true);\n this.areaPicture.setInteractive();\n this.areaPicture.on('clicked', this.putImage, this);\n }", "function imgClick(event) {\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}", "function imgOnload(){\n addedImagesCount--;\n if(addedImagesCount === 0) highlightMessage(selectedMessageId);\n }", "display(){\r\n var angle = this.body.angle;\r\n //Pushing in the settings to be applied on the image\r\n push();\r\n //Translating or moving the image to the given position \r\n translate(this.body.position.x, this.body.position.y);\r\n //Rotating the image based on the angle provided\r\n rotate(angle);\r\n imageMode(CENTER);\r\n image(this.image, 0, 0, this.width, this.height);\r\n //Reverting to the original settings\r\n pop();\r\n }", "function handleComplete(){ /** Loading all preloaded images to canvas */ \n loadImages(queue.getResult(\"texture\"),\"texture\",318,130,\"\",0,container,1); \n loadImages(queue.getResult(\"texture\"),\"texture_1\",318,-231,\"\",0,container,1);\n loadImages(queue.getResult(\"light_gradient\"),\"light_gradient\",327,130,\"\",0,container,1); \n drawLine(); /** Function to draw lines over fly wheel*/\n loadImages(queue.getResult(\"background\"),\"background\",0,0,\"\",0,container,1);\n loadImages(queue.getResult(\"weight_with_hook\"),\"weight_with_hook\",369,553,\"\",0,weight_container,1);\n loadImages(queue.getResult(\"weight\"),\"weight_4\",370.5,592,\"\",0,weight_container,1);\n loadImages(queue.getResult(\"weight\"),\"weight_6\",370.5,584,\"\",0,weight_container,1);\n loadImages(queue.getResult(\"weight\"),\"weight_8\",370.5,576,\"\",0,weight_container,1);\n loadImages(queue.getResult(\"weight\"),\"weight_10\",370.5,568,\"\",0,weight_container,1);\n container.addChild(long_string); /** Adding shape object to container */\n loadImages(queue.getResult(\"thread_falling_anim\"),\"thread_falling_anim\",298,230,\"\",0,container,1);\n loadImages(queue.getResult(\"weight\"),\"weights_4\",0,24,\"\",0,weight_container_temp,1);\n loadImages(queue.getResult(\"weight\"),\"weights_6\",0,16,\"\",0,weight_container_temp,1);\n loadImages(queue.getResult(\"weight\"),\"weights_8\",0,8,\"\",0,weight_container_temp,1);\n loadImages(queue.getResult(\"weight\"),\"weights_10\",0,0,\"\",0,weight_container_temp,1);\n loadImages(queue.getResult(\"scale\"),\"scale\",430,483,\"\",0,container,1);\n loadImages(queue.getResult(\"popup_height\"),\"popup_height\",470,610,\"\",0,container,1); \n setText(\"hundred\",120,231,0,\"white\",2,container); /** Text for place value ten in counter */ \n setText(\"ten\",142,231,0,\"white\",2,container); /** Text for place value ten in counter */\n setText(\"one\",164,231,0,\"white\",2,container); /** Text for place value one in counter */\n setText(\"period\",186,231,\".\",\"white\",2,container); /** To show period in counter */\n setText(\"decimal_one\",201,231,0,\"white\",2,container); /** Text for place value one after decimal point in counter */\n setText(\"decimal_ten\",223,231,0,\"white\",2,container); /** Text for place value ten after decimal point in counter */\n setText(\"height_txt\",485,629,'02cm',\"black\",1.1,container);\n initialisationOfVariables(); /** Initializing the variables */\n initialisationOfControls(scope); /** Initialization of control side variables */\n thread_anim_rect.graphics.beginStroke(\"\").drawRect(320,200,180,490); /** Rectangle for mask thread animation */\n initialisationOfImages(); /** Function call for images used in the apparatus visibility */\n translationLabels(); /** Translation of strings using gettext */\n createStopwatch(stage, 20, 500, 1); /** To load and generate stop watch */\n stage.update(); /** Function to update stage */\n setTimeout(function(){clearInterval(tick)},200); /** Clearing stage update after 200 milli seconds */\n play_event = clockContainer.getChildByName(\"play\").on(\"click\",function(){ /** Click event added to play button on timer */\n releaseHold(scope); /** Function to start the experiment and rotation of fly wheel */\n scope.$apply();\n });\n clockContainer.getChildByName(\"pause\").off(\"click\",listner_pause) /** Click event removed from pause button */ \n clockContainer.getChildByName(\"reset\").on(\"click\",function(){ /** Click event added to reset button on timer */\n resetExperiment(scope); /** This function will rest simulstion */\n scope.$apply();\n });\n\n }", "static ImageProcessor(bot, context, request, name, sentMessage){\n if(context.interaction)\n return Image.InteractionImageProcessor(bot, context.interaction, request, sentMessage);\n return Image.MessageImageProcessor(bot, context.message, request, name, sentMessage)\n }", "function nextImage(e){\n defaultImage.src = this.src;\n }", "displayPicture(url){this.newPictureContainer.attr('src',url);page('/add');this.imageCaptionInput.focus();this.uploadButton.prop('disabled',true)}", "display() {\n push();\n noStroke();\n imageMode(CENTER);\n image(this.avalancheImg, this.x, this.y, this.width, this.height);\n pop();\n }", "ImageViewer(data){\n\t\t\n\t\tconsole.log(\"ImageViewer\");\n\t\tconsole.log(data);\n\t\tlet viewCard = new Card('Viewer_', this.path);\n\t\tviewCard.setStyle(\"position\", \"absolute\");\n\t\t//viewCard.setStyle(\"position\", \"absolute\");\n\t\tviewCard.setStyle(\"top\", \"0px\");\n\t\tviewCard.setStyle(\"left\", \"0px\");\n\t\tviewCard.setStyle(\"width\", \"100%\");\n\t\tviewCard.setStyle(\"height\", \"100%\");\n\t\tviewCard.setStyle(\"background\", \"red\");\n\t\tviewCard.setStyle(\"zIndex\", \"1000\");\n\n\t\tlet PictElt = viewCard.setElement(\"PictElt\");\n\t\tviewCard.push(\"Image\", PictElt, \"MyPict\", data);\n\n\t\tviewCard.getContainer().addEventListener(\"click\",()=>viewCard.destroyMe());\n\n\n\t}", "function handler( e ){\n data.element = this;\n data.found = e.type == 'load';\n data.image = this.src;\n data.index = this.index;\n var orig = data.original = sources[this.index];\n data[data.found?'loaded':'failed']++;\n data.done++;\n\n if( settings.onComplete ) {\n settings.onComplete( data );\n }\n if( data.done < data.total ) {\n fetch( 0, this );\n } else {\n if( imgs && imgs.unbind ) {\n imgs.unbind('load').unbind('error').unbind('abort');\n }\n imgs = null;\n finish();\n }\n }", "function modifiedImgBack(image){\n image.src = image.id + '.jpg';\n }", "function imgClicked(e)\n{\n\tlargeImg.src = e.target.src;\n}", "function loadImg(obj, imageId) {\n \n $('#ms-lightbox, #ms-overlay').remove();\n \n // show the lLightbox\n obj.showLightbox();\n \n // show navigation arraows\n createArrowLinks(imageId);\n }", "function showImg(e)\r\n{\r\nconsole.log(e.src)\r\nvar i = document.getElementById(\"modelImage\")\r\ni.src = e.src;\r\n}", "addPic(event) {\r\n // var name= this.props.product.name;\r\n let img = this.props.img;\r\n\r\n let _this = this;\r\n\r\n _this.addPhoto(data);\r\n // FluxCartActions.updateCartVisible(true);\r\n }", "function _start(objClicked,jQueryMatchedObj) {\r\n // Hide some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\r\n $('embed, object, select').css({ 'visibility' : 'hidden' });\r\n // Call the function to create the markup structure; style some elements; assign events in some elements.\r\n // Unset total images in imageArray\r\n settings.imageArray.length = 0;\r\n // Unset image active information\r\n settings.activeImage = 0;\r\n if (jQueryMatchedObj.data('imageArray')){\r\n storedArray = jQueryMatchedObj.data('imageArray');\r\n for ( var i = 0; i < storedArray.length; i++ ) {\r\n settings.imageArray.push(storedArray[i]);\r\n }\r\n // We have an image set? Or just an image? Letīs see it.\r\n } else if ( jQueryMatchedObj.length == 1 ) {\r\n settings.imageArray.push(new Array(objClicked.getAttribute('href'),\r\n objClicked.getAttribute('title'),\r\n objClicked.getAttribute('context'),\r\n $(objClicked).offset(),\r\n objClicked.getAttribute('alt'),\r\n settings.imgIdFunction(objClicked)\r\n ));\r\n } else {\r\n // Add an Array (as many as we have), with href and title attributes, inside the Array that stores the image references\r\n for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {\r\n settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),\r\n jQueryMatchedObj[i].getAttribute('title'),\r\n jQueryMatchedObj[i].getAttribute('context'),\r\n $(jQueryMatchedObj[i]).offset(),\r\n jQueryMatchedObj[i].getAttribute('alt'),\r\n settings.imgIdFunction(jQueryMatchedObj[i])\r\n ));\r\n }\r\n }\r\n while ( settings.imageArray[settings.activeImage][5] != settings.imgIdFunction(objClicked) ) {\r\n settings.activeImage++;\r\n }\r\n // Call the function that prepares image exhibition\r\n //$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();\r\n _set_interface();\r\n _set_image_to_view();\r\n }", "function setImage()\n {\n var img = getId(\"captured_image\");\n \n var path = \"file:\" + Native.getImagePath();\n \n img.setAttribute(\"src\", path);\n }", "function firstImgPastaClicked() {\n console.log(\"view recipe \");\n imageNum = 0;\n passMealId(imageNum);\n}", "function showImage(i) {\n \n // optional parameter i\n i = i || cur;\n \n // fade out image so that background shines through\n // background can contain loading gfx\n ppyStageWrap.addClass(lclass);\n ppyStage.fadeTo((opts.duration/2), 0);\n \n // if there are multiple popeyes opened at the same time,\n // make sure the current one gets a higher z-index\n var allPpy = $('.' + eclass);\n allPpy.css('z-index',opts.zindex-1);\n \n //both ppy and placeholder (for IE7) need high z-index\n $self.css('z-index',opts.zindex).parent().css('z-index',opts.zindex);\n \n // once image has loadded...\n var preloader = new Image();\n preloader.onload = function() {\n \n // remove loading class\n ppyStageWrap.removeClass(lclass);\n \n // set css\n var cssStageTo = {\n width: preloader.width,\n height: preloader.height\n };\n var cssStageIm = {\n backgroundImage: 'url(' + a[i].href + ')',\n backgroundPosition: 'left top'\n };\n \n hideCaption();\n \n // show transitional animation\n ppyStage.animate( cssStageTo, {\n queue: false,\n duration: opts.duration,\n easing: opts.easing,\n complete: function(){\n \n if(opts.navigation == 'hover' && ismouseover) {\n showNav();\n }\n \n enlarged = true;\n debug('$.fn.popeye.showImage: Entering ENLARGED MODE','info');\n \n // add extra class, expanded box can be styled accordingly\n $self.addClass(eclass);\n \n // switch buttons\n ppySwitchCompact.removeClass('ppy-hidden');\n ppySwitchEnlarge.addClass('ppy-hidden');\n \n updateCounter();\n \n // set new bg image and fade it in\n $(this).css(cssStageIm).fadeTo((opts.duration/2),1);\n \n // show caption\n showCaption(cap[i]);\n \n preloadNeighbours();\n }\n });\n };\n \n // preload image\n preloader.src = a[i].href;\n \n }", "function mouseClicked(){\n if(current_img == null) current_img = flowers_img;\n if(mouseX>=0 && mouseX<width && mouseY>=0 && mouseY<height)\n image(current_img, mouseX - 37, mouseY - 50, 75, 100);\n}", "function renderImg() {\n const idx = $(this).attr(\"id\"),\n newClass = $(this).attr(\"class\").includes(\"animated\") ? \"static\" : \"animated\",\n giphyName = $(this).attr(\"data-name\");\n\n $(this).attr(\"src\", imgObj[giphyName][idx][newClass]);\n $(this).attr(\"class\", `${newClass} card-img-top`);\n}", "function back_from_image_doc() {\n\tif(action == 'delivered' || action == 'pick-up') {\n\t\tshow('page-signature');\n\t} else {\n\t\tshow('page-album');\n\t}\n}", "function display_advertise_images() {\n}", "show() {\n // applyTextTheme\n image(this.image, this.x, this.y, this.width, this.height)\n }", "function ImageFlow(){this.defaults={animationSpeed:50,aspectRatio:1.964,buttons:!1,captions:!0,circular:!1,imageCursor:\"default\",ImageFlowID:\"imageflow\",imageFocusM:1,imageFocusMax:4,imagePath:\"\",imageScaling:!0,imagesHeight:.67,imagesM:1,onClick:function(){document.location=this.url},opacity:!1,opacityArray:[10,8,6,4,2],percentLandscape:118,percentOther:100,preloadImages:!0,reflections:!0,reflectionGET:\"\",reflectionP:.5,reflectionPNG:!1,reflectPath:\"\",scrollbarP:.6,slider:!0,sliderCursor:\"e-resize\",sliderWidth:14,slideshow:!1,slideshowSpeed:1500,slideshowAutoplay:!1,startID:1,glideToStartID:!0,startAnimation:!1,xStep:150};var t=this;this.init=function(e){for(var i in t.defaults)this[i]=void 0!==e&&void 0!==e[i]?e[i]:t.defaults[i];var n=document.getElementById(t.ImageFlowID);if(n&&(n.style.visibility=\"visible\",this.ImageFlowDiv=n,this.createStructure())){this.imagesDiv=document.getElementById(t.ImageFlowID+\"_images\"),this.captionDiv=document.getElementById(t.ImageFlowID+\"_caption\"),this.navigationDiv=document.getElementById(t.ImageFlowID+\"_navigation\"),this.scrollbarDiv=document.getElementById(t.ImageFlowID+\"_scrollbar\"),this.sliderDiv=document.getElementById(t.ImageFlowID+\"_slider\"),this.buttonNextDiv=document.getElementById(t.ImageFlowID+\"_next\"),this.buttonPreviousDiv=document.getElementById(t.ImageFlowID+\"_previous\"),this.buttonSlideshow=document.getElementById(t.ImageFlowID+\"_slideshow\"),this.indexArray=[],this.current=0,this.imageID=0,this.target=0,this.memTarget=0,this.firstRefresh=!0,this.firstCheck=!0,this.busy=!1;var o=this.ImageFlowDiv.offsetWidth,s=Math.round(o/t.aspectRatio);document.getElementById(t.ImageFlowID+\"_loading_txt\").style.paddingTop=.5*s-22+\"px\",n.style.height=s+\"px\",this.loadingProgress()}},this.createStructure=function(){for(var e,i,n,o,s=t.Helper.createDocumentElement(\"div\",\"images\"),r=t.ImageFlowDiv.childNodes.length,a=0;r>a;a++)e=t.ImageFlowDiv.childNodes[a],e&&1==e.nodeType&&\"IMG\"==e.nodeName&&(t.reflections===!0&&(i=t.reflectionPNG?\"3\":\"2\",n=t.imagePath+e.getAttribute(\"src\",2),n=t.reflectPath+\"reflect\"+i+\".php?img=\"+n+t.reflectionGET,e.setAttribute(\"src\",n)),o=e.cloneNode(!0),s.appendChild(o));if(t.circular){var l=t.Helper.createDocumentElement(\"div\",\"images\"),c=t.Helper.createDocumentElement(\"div\",\"images\");if(r=s.childNodes.length,r<t.imageFocusMax&&(t.imageFocusMax=r),r>1){var u;for(u=0;r>u;u++)e=s.childNodes[u],u<t.imageFocusMax&&(o=e.cloneNode(!0),l.appendChild(o)),r-u<t.imageFocusMax+1&&(o=e.cloneNode(!0),c.appendChild(o));for(u=0;r>u;u++)e=s.childNodes[u],o=e.cloneNode(!0),c.appendChild(o);for(u=0;u<t.imageFocusMax;u++)e=l.childNodes[u],o=e.cloneNode(!0),c.appendChild(o);s=c}}if(t.slideshow){var h=t.Helper.createDocumentElement(\"div\",\"slideshow\");s.appendChild(h)}var d=t.Helper.createDocumentElement(\"p\",\"loading_txt\"),p=document.createTextNode(\" \");d.appendChild(p);var f=t.Helper.createDocumentElement(\"div\",\"loading\"),m=t.Helper.createDocumentElement(\"div\",\"loading_bar\");f.appendChild(m);var g=t.Helper.createDocumentElement(\"div\",\"caption\"),v=t.Helper.createDocumentElement(\"div\",\"scrollbar\"),y=t.Helper.createDocumentElement(\"div\",\"slider\");if(v.appendChild(y),t.buttons){var b=t.Helper.createDocumentElement(\"div\",\"previous\",\"button\"),w=t.Helper.createDocumentElement(\"div\",\"next\",\"button\");v.appendChild(b),v.appendChild(w)}var x=t.Helper.createDocumentElement(\"div\",\"navigation\");x.appendChild(g),x.appendChild(v);var _=!1;if(t.ImageFlowDiv.appendChild(s)&&t.ImageFlowDiv.appendChild(d)&&t.ImageFlowDiv.appendChild(f)&&t.ImageFlowDiv.appendChild(x)){for(r=t.ImageFlowDiv.childNodes.length,a=0;r>a;a++)e=t.ImageFlowDiv.childNodes[a],e&&1==e.nodeType&&\"IMG\"==e.nodeName&&t.ImageFlowDiv.removeChild(e);_=!0}return _},this.loadingProgress=function(){var e=t.loadingStatus();(100>e||t.firstCheck)&&t.preloadImages?t.firstCheck&&100==e?(t.firstCheck=!1,window.setTimeout(t.loadingProgress,100)):window.setTimeout(t.loadingProgress,40):(document.getElementById(t.ImageFlowID+\"_loading_txt\").style.display=\"none\",document.getElementById(t.ImageFlowID+\"_loading\").style.display=\"none\",window.setTimeout(t.Helper.addResizeEvent,1e3),t.refresh(),t.max>1&&(t.MouseWheel.init(),t.MouseDrag.init(),t.Touch.init(),t.Key.init(),t.slideshow&&t.Slideshow.init(),t.slider&&(t.scrollbarDiv.style.visibility=\"visible\")))},this.loadingStatus=function(){for(var e=t.imagesDiv.childNodes.length,i=0,n=0,o=null,s=0;e>s;s++)o=t.imagesDiv.childNodes[s],o&&1==o.nodeType&&\"IMG\"==o.nodeName&&(o.complete&&n++,i++);var r=Math.round(n/i*100),a=document.getElementById(t.ImageFlowID+\"_loading_bar\");a.style.width=r+\"%\",t.circular&&(i-=2*t.imageFocusMax,n=1>r?0:Math.round(i/100*r));var l=document.getElementById(t.ImageFlowID+\"_loading_txt\"),c=document.createTextNode(\"loading images \"+n+\"/\"+i);return l.replaceChild(c,l.firstChild),r},this.refresh=function(){this.imagesDivWidth=t.imagesDiv.offsetWidth+t.imagesDiv.offsetLeft,this.maxHeight=Math.round(t.imagesDivWidth/t.aspectRatio),this.maxFocus=t.imageFocusMax*t.xStep,this.size=.5*t.imagesDivWidth,this.sliderWidth=.5*t.sliderWidth,this.scrollbarWidth=(t.imagesDivWidth-2*Math.round(t.sliderWidth))*t.scrollbarP,this.imagesDivHeight=Math.round(t.maxHeight*t.imagesHeight),t.ImageFlowDiv.style.height=t.maxHeight+\"px\",t.imagesDiv.style.height=t.imagesDivHeight+\"px\",t.navigationDiv.style.height=t.maxHeight-t.imagesDivHeight+\"px\",t.captionDiv.style.width=t.imagesDivWidth+\"px\",t.captionDiv.style.paddingTop=\"0px\",t.scrollbarDiv.style.width=t.scrollbarWidth+\"px\",t.scrollbarDiv.style.marginTop=\"0px\",t.scrollbarDiv.style.marginLeft=Math.round(t.sliderWidth+(t.imagesDivWidth-t.scrollbarWidth)/2)+\"px\",t.sliderDiv.style.cursor=t.sliderCursor,t.sliderDiv.onmousedown=function(){return t.MouseDrag.start(this),!1},t.buttons&&(t.buttonPreviousDiv.onclick=function(){t.MouseWheel.handle(1)},t.buttonNextDiv.onclick=function(){t.MouseWheel.handle(-1)});for(var e=t.reflections===!0?t.reflectionP+1:1,i=t.imagesDiv.childNodes.length,n=0,o=null,s=0;i>s;s++)o=t.imagesDiv.childNodes[s],null!==o&&1==o.nodeType&&\"IMG\"==o.nodeName&&(this.indexArray[n]=s,o.url=o.getAttribute(\"longdesc\"),o.xPosition=-n*t.xStep,o.i=n,t.firstRefresh&&(null!==o.getAttribute(\"width\")&&null!==o.getAttribute(\"height\")?(o.w=o.getAttribute(\"width\"),o.h=o.getAttribute(\"height\")*e):(o.w=o.width,o.h=o.height)),o.w>o.h/(t.reflectionP+1)?(o.pc=t.percentLandscape,o.pcMem=t.percentLandscape):(o.pc=t.percentOther,o.pcMem=t.percentOther),t.imageScaling===!1&&(o.style.position=\"relative\",o.style.display=\"inline\"),o.style.cursor=t.imageCursor,n++);this.max=t.indexArray.length,t.imageScaling===!1&&(o=t.imagesDiv.childNodes[t.indexArray[0]],this.totalImagesWidth=o.w*t.max,o.style.paddingLeft=t.imagesDivWidth/2+o.w/2+\"px\",t.imagesDiv.style.height=o.h+\"px\",t.navigationDiv.style.height=t.maxHeight-o.h+\"px\"),t.firstRefresh&&(t.firstRefresh=!1,t.imageID=t.startID-1,t.imageID<0&&(t.imageID=0),t.circular&&(t.imageID=t.imageID+t.imageFocusMax),maxId=t.circular?t.max-t.imageFocusMax-1:t.max-1,t.imageID>maxId&&(t.imageID=maxId),t.glideToStartID===!1&&t.moveTo(-t.imageID*t.xStep),t.startAnimation&&t.moveTo(5e3)),t.max>1&&t.glideTo(t.imageID),t.moveTo(t.current)},this.moveTo=function(e){this.current=e,this.zIndex=t.max;for(var i=0;i<t.max;i++){var n=t.imagesDiv.childNodes[t.indexArray[i]],o=i*-t.xStep;if(t.imageScaling)if(o+t.maxFocus<t.memTarget||o-t.maxFocus>t.memTarget)n.style.visibility=\"hidden\",n.style.display=\"none\";else{var s=(Math.sqrt(1e4+e*e)+100)*t.imagesM,r=e/s*t.size+t.size;n.style.display=\"block\";var a=n.h/n.w*n.pc/s*t.size,l=0;switch(a>t.maxHeight){case!1:l=n.pc/s*t.size;break;default:a=t.maxHeight,l=n.w*a/n.h}var c=t.imagesDivHeight-a+a/(t.reflectionP+1)*t.reflectionP;switch(n.style.left=r-n.pc/2/s*t.size+\"px\",l&&a&&(n.style.height=a+\"px\",n.style.width=l+\"px\",n.style.top=c+\"px\"),n.style.visibility=\"visible\",0>e){case!0:this.zIndex++;break;default:this.zIndex=t.zIndex-1}switch(n.i==t.imageID){case!1:n.onclick=function(){t.glideTo(this.i)};break;default:this.zIndex=t.zIndex+1,\"\"!==n.url&&(n.onclick=t.onClick)}n.style.zIndex=t.zIndex}else{if(o+t.maxFocus<t.memTarget||o-t.maxFocus>t.memTarget)n.style.visibility=\"hidden\";else switch(n.style.visibility=\"visible\",n.i==t.imageID){case!1:n.onclick=function(){t.glideTo(this.i)};break;default:\"\"!==n.url&&(n.onclick=t.onClick)}t.imagesDiv.style.marginLeft=e-t.totalImagesWidth+\"px\"}e+=t.xStep}},this.glideTo=function(e){var i,n;t.circular&&(e+1===t.imageFocusMax&&(n=t.max-t.imageFocusMax,i=-n*t.xStep,e=n-1),e===t.max-t.imageFocusMax&&(n=t.imageFocusMax-1,i=-n*t.xStep,e=n+1));var o=-e*t.xStep;this.target=o,this.memTarget=o,this.imageID=e;var s=t.imagesDiv.childNodes[e].getAttribute(\"alt\");if((\"\"===s||t.captions===!1)&&(s=\"&nbsp;\"),t.captionDiv.innerHTML=s,t.MouseDrag.busy===!1&&(this.newSliderX=t.circular?(e-t.imageFocusMax)*t.scrollbarWidth/(t.max-2*t.imageFocusMax-1)-t.MouseDrag.newX:e*t.scrollbarWidth/(t.max-1)-t.MouseDrag.newX,t.sliderDiv.style.marginLeft=t.newSliderX-t.sliderWidth+\"px\"),t.opacity===!0||t.imageFocusM!==t.defaults.imageFocusM){t.Helper.setOpacity(t.imagesDiv.childNodes[e],t.opacityArray[0]),t.imagesDiv.childNodes[e].pc=t.imagesDiv.childNodes[e].pc*t.imageFocusM;for(var r=0,a=0,l=0,c=t.opacityArray.length,u=1;u<t.imageFocusMax+1;u++)r=u+1>c?t.opacityArray[c-1]:t.opacityArray[u],a=e+u,l=e-u,a<t.max&&(t.Helper.setOpacity(t.imagesDiv.childNodes[a],r),t.imagesDiv.childNodes[a].pc=t.imagesDiv.childNodes[a].pcMem),l>=0&&(t.Helper.setOpacity(t.imagesDiv.childNodes[l],r),t.imagesDiv.childNodes[l].pc=t.imagesDiv.childNodes[l].pcMem)}i&&t.moveTo(i),t.busy===!1&&(t.busy=!0,t.animate())},this.animate=function(){switch(t.target<t.current-1||t.target>t.current+1){case!0:t.moveTo(t.current+(t.target-t.current)/3),window.setTimeout(t.animate,t.animationSpeed),t.busy=!0;break;default:t.busy=!1}},this.glideOnEvent=function(e){t.slideshow&&t.Slideshow.interrupt(),t.glideTo(e)},this.Slideshow={direction:1,init:function(){t.slideshowAutoplay?t.Slideshow.start():t.Slideshow.stop()},interrupt:function(){t.Helper.removeEvent(t.ImageFlowDiv,\"click\",t.Slideshow.interrupt),t.Slideshow.stop()},addInterruptEvent:function(){t.Helper.addEvent(t.ImageFlowDiv,\"click\",t.Slideshow.interrupt)},start:function(){t.Helper.setClassName(t.buttonSlideshow,\"slideshow pause\"),t.buttonSlideshow.onclick=function(){t.Slideshow.stop()},t.Slideshow.action=window.setInterval(t.Slideshow.slide,t.slideshowSpeed),window.setTimeout(t.Slideshow.addInterruptEvent,100)},stop:function(){t.Helper.setClassName(t.buttonSlideshow,\"slideshow play\"),t.buttonSlideshow.onclick=function(){t.Slideshow.start()},window.clearInterval(t.Slideshow.action)},slide:function(){var e=t.imageID+t.Slideshow.direction,i=!1;e===t.max&&(t.Slideshow.direction=-1,i=!0),0>e&&(t.Slideshow.direction=1,i=!0),i?t.Slideshow.slide():t.glideTo(e)}},this.MouseWheel={init:function(){window.addEventListener&&t.ImageFlowDiv.addEventListener(\"DOMMouseScroll\",t.MouseWheel.get,!1),t.Helper.addEvent(t.ImageFlowDiv,\"mousewheel\",t.MouseWheel.get)},get:function(e){var i=0;e||(e=window.event),e.wheelDelta?i=e.wheelDelta/120:e.detail&&(i=-e.detail/3),i&&t.MouseWheel.handle(i),t.Helper.suppressBrowserDefault(e)},handle:function(e){var i=!1,n=0;e>0?t.imageID>=1&&(n=t.imageID-1,i=!0):t.imageID<t.max-1&&(n=t.imageID+1,i=!0),i&&t.glideOnEvent(n)}},this.MouseDrag={object:null,objectX:0,mouseX:0,newX:0,busy:!1,init:function(){t.Helper.addEvent(t.ImageFlowDiv,\"mousemove\",t.MouseDrag.drag),t.Helper.addEvent(t.ImageFlowDiv,\"mouseup\",t.MouseDrag.stop),t.Helper.addEvent(document,\"mouseup\",t.MouseDrag.stop),t.ImageFlowDiv.onselectstart=function(){var e=!0;return t.MouseDrag.busy&&(e=!1),e}},start:function(e){t.MouseDrag.object=e,t.MouseDrag.objectX=t.MouseDrag.mouseX-e.offsetLeft+t.newSliderX},stop:function(){t.MouseDrag.object=null,t.MouseDrag.busy=!1},drag:function(e){var i=0;if(e||(e=window.event),e.pageX?i=e.pageX:e.clientX&&(i=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft),t.MouseDrag.mouseX=i,null!==t.MouseDrag.object){var n=t.MouseDrag.mouseX-t.MouseDrag.objectX+t.sliderWidth;n<-t.newSliderX&&(n=-t.newSliderX),n>t.scrollbarWidth-t.newSliderX&&(n=t.scrollbarWidth-t.newSliderX);var o,s;t.circular?(o=(n+t.newSliderX)/(t.scrollbarWidth/(t.max-2*t.imageFocusMax-1)),s=Math.round(o)+t.imageFocusMax):(o=(n+t.newSliderX)/(t.scrollbarWidth/(t.max-1)),s=Math.round(o)),t.MouseDrag.newX=n,t.MouseDrag.object.style.left=n+\"px\",t.imageID!==s&&t.glideOnEvent(s),t.MouseDrag.busy=!0}}},this.Touch={x:0,startX:0,stopX:0,busy:!1,first:!0,init:function(){t.Helper.addEvent(t.navigationDiv,\"touchstart\",t.Touch.start),t.Helper.addEvent(document,\"touchmove\",t.Touch.handle),t.Helper.addEvent(document,\"touchend\",t.Touch.stop)},isOnNavigationDiv:function(e){var i=!1;if(e.touches){var n=e.touches[0].target;(n===t.navigationDiv||n===t.sliderDiv||n===t.scrollbarDiv)&&(i=!0)}return i},getX:function(t){var e=0;return t.touches&&(e=t.touches[0].pageX),e},start:function(e){t.Touch.startX=t.Touch.getX(e),t.Touch.busy=!0,t.Helper.suppressBrowserDefault(e)},isBusy:function(){var e=!1;return t.Touch.busy&&(e=!0),e},handle:function(e){if(t.Touch.isBusy&&t.Touch.isOnNavigationDiv(e)){var i=t.circular?t.max-2*t.imageFocusMax-1:t.max-1;t.Touch.first&&(t.Touch.stopX=(i-t.imageID)*(t.imagesDivWidth/i),t.Touch.first=!1);var n=-(t.Touch.getX(e)-t.Touch.startX-t.Touch.stopX);0>n&&(n=0),n>t.imagesDivWidth&&(n=t.imagesDivWidth),t.Touch.x=n;var o=Math.round(n/(t.imagesDivWidth/i));o=i-o,t.imageID!==o&&(t.circular&&(o+=t.imageFocusMax),t.glideOnEvent(o)),t.Helper.suppressBrowserDefault(e)}},stop:function(){t.Touch.stopX=t.Touch.x,t.Touch.busy=!1}},this.Key={init:function(){document.onkeydown=function(e){t.Key.handle(e)}},handle:function(e){var i=t.Key.get(e);switch(i){case 39:t.MouseWheel.handle(-1);break;case 37:t.MouseWheel.handle(1)}},get:function(t){return t=t||window.event,t.keyCode}},this.Helper={addEvent:function(t,e,i){t.addEventListener?t.addEventListener(e,i,!1):t.attachEvent&&(t[\"e\"+e+i]=i,t[e+i]=function(){t[\"e\"+e+i](window.event)},t.attachEvent(\"on\"+e,t[e+i]))},removeEvent:function(t,e,i){t.removeEventListener?t.removeEventListener(e,i,!1):t.detachEvent&&(void 0===t[e+i]&&alert(\"Helper.removeEvent \\xbb Pointer to detach event is undefined - perhaps you are trying to detach an unattached event?\"),t.detachEvent(\"on\"+e,t[e+i]),t[e+i]=null,t[\"e\"+e+i]=null)},setOpacity:function(e,i){t.opacity===!0&&(e.style.opacity=i/10,e.style.filter=\"alpha(opacity=\"+10*i+\")\")},createDocumentElement:function(e,i,n){var o=document.createElement(e);return o.setAttribute(\"id\",t.ImageFlowID+\"_\"+i),void 0!==n&&(i+=\" \"+n),t.Helper.setClassName(o,i),o},setClassName:function(t,e){t&&(t.setAttribute(\"class\",e),t.setAttribute(\"className\",e))},suppressBrowserDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,!1},addResizeEvent:function(){var e=window.onresize;window.onresize=\"function\"!=typeof window.onresize?function(){t.refresh()}:function(){e&&e(),t.refresh()}}}}", "async function loadingImg() {\r\n let img = await prom; // continuation of function will halt till prom is resolved\r\n\r\n let id = self.createID()\r\n self.fill_ID_ImageHash(id,img)\r\n img.id = id\r\n \r\n // now we can set options for image, or do something else with it\r\n if (ops) {\r\n img.set(ops)\r\n };\r\n\r\n\r\n if (canv) {\r\n canv.add(img);\r\n } else {\r\n self.canvas.add(img)\r\n }\r\n\r\n if (cb) {\r\n cb(img)\r\n\r\n };\r\n\r\n //return img\r\n }", "function TB_image() {\n\tvar t = this.title || this.name ;\n\tTB_show(t,this.href,'image');\n\treturn false;\n}", "exibe(){\n image(this.imagem, this.x1, 0, width, height); //exibe a imagem na tela\n image(this.imagem, this.x2, 0, width, height);\n }", "function mediaHandler ( info, tab ) {\n sendItem( { 'imageUrl': info.srcUrl } );\n}", "function phaseInImg(item, img) {\n item.classList.remove('replace');\n let previewImage = item.querySelector('.burger-preview');\n item.removeChild(previewImage);\n item.appendChild(img)\n .addEventListener('animationend', function phaseOutPreview(e) {\n e.target.classList.remove('reveal');\n e.target.removeEventListener('animationend', phaseOutPreview);\n })\n }", "function displayVenuePhotoClick(increment){\n var string,maxLength;\n var url='';\n var venue=displayInfo.venue;\n displayInfo.imagePointer+=increment;\n console.log(' image counter: '+ displayInfo.imagePointer);\n //images will be either in the imageArray or photos\n //\n if(displayInfo.imagePointer <0 )\n displayInfo.imagePointer = 0;\n if (venue.photos) {\n if(displayInfo.imagePointer>=(venue.photos.length-1))\n displayInfo.imagePointer=venue.photos.length-1;\n string=venue.photos[displayInfo.imagePointer];\n //geturl is a function from google\n url = string.getUrl({'maxWidth': displayInfo.panelWidth, 'maxHeight': 200});\n\n }else if(venue.imageArray && venue.imageArray.length){\n if(displayInfo.imagePointer>=(venue.imageArray.length-1))\n displayInfo.imagePointer=venue.imageArray.length-1;\n url = postingHost+postingPicturePath+'/'+venue.imageArray[displayInfo.imagePointer].id+'/'+venue.imageArray[displayInfo.imagePointer].image;\n }\n\n console.log('loading image:' + url);\n if (url !== '')\n $('#venue-details-image').css('background-image', 'url(' + url + ')');\n else\n $('#venue-details-image').css('background-image', 'url(\"\")');\n\n}", "function setImg(){\n var css = (scope.rating/5.0 * 65).toString() + 'px';\n element.find(\"span.nonEmptyStars\").css(\"width\",css);\n\n //sometimes returned result doesnt include photo property\n if ('photos' in scope.model.data[scope.index]){\n\n var url = scope.model.data[scope.index].photos[0].getUrl({maxWidth:80});\n element.find(\"img.attraction_img\").attr('src',url);\n }\n else {\n element.find(\"img.attraction_img\").attr('src',\"img/img_not_available.jpg\");\n }\n }", "function setImg(){\n var css = (scope.rating/5.0 * 65).toString() + 'px';\n element.find(\"span.nonEmptyStars\").css(\"width\",css);\n\n //sometimes returned result doesnt include photo property\n if ('photos' in scope.model.data[scope.index]){\n\n var url = scope.model.data[scope.index].photos[0].getUrl({maxWidth:80});\n element.find(\"img.attraction_img\").attr('src',url);\n }\n else {\n element.find(\"img.attraction_img\").attr('src',\"img/img_not_available.jpg\");\n }\n }", "function masterImage(mstrObj){\n //Image Tool Kit\n //console.log(\"in the pit\");\n //properties\n //required\n\n if(mstrObj == undefined){alert(\"canvas object parameter is not defined.\"); return;}\n if(mstrObj.home == undefined){alert(\"canvas object needs \\\"home:'container id string'\\\".\"); return;}\n var home = mstrObj.home;\n\n var iUN = mstrObj.iUN || Math.round(Math.random() * 10000);//see iUN get and set\n var canvas_type = mstrObj.type || \"thumbnail\";//NOTE may not need #remove\n var canvas_mode = mstrObj.mode || \"default\";//NOTE may not need #remove\n\n\n //at 100 x100 or 50 x50 the image is adjusted perfectly\n //100 x 80 the image is stretched\n //NOTE image 4:3 aspect ratio multiply by 3/4ths or .75\n var type_str = (canvas_mode != \"default\") ? canvas_type + \"_\" + canvas_mode : canvas_type;\n\n //used to set the various canvas default dimensions (if they arent manually entered)\n switch(type_str)\n {\n case \"thumbnail\":\n var default_width = 50;\n var default_height = 50;\n break;\n\n case \"profile\":\n var default_width = 100;\n var default_height = 100;\n break;\n\n case \"profile_edit\":\n var default_width = 200;\n var default_height = 200;\n break;\n\n case \"image\":\n var default_width = 100;\n var default_height = 75;\n break;\n }//end switch\n\n\n\n\n var canvas_width = mstrObj.width || default_width;\n var canvas_height = mstrObj.height || default_height;\n\n\n //HTML generated variable\n //window['CANVAS_IMG_URL'] = \"<?php echo JUri::root(); ?>components/com_arc/xfiles/images/\";\n var img_default = window['ARC_IMG_URL'] + \"flame.png\";\n\n //properties\n var canvas = \"\";\n var context_obj = \"\";\n var action = mstrObj.action || \"\";\n var prefix = mstrObj.varName || \"masImg\";//get set\n var fill_content = \"\";\n //console.log(display);\n var custom_class = \"\";\n var add_to_class = \"false\";\n var custom_id = \"\";\n var id_type = \"default\";\n var first_run = \"true\";\n var sli_ctrl_inputA = \"\";\n var\tsli_ctrl_inputB = \"\";\n var mousedown = false;\n var touchdown = false;\n var last_panel_clicked_id = \"\";//remove\n var last_x = \"default\";\n var last_y = \"default\";\n var offset_x = 0;\n var offset_y = 0;\n var img_label = \"default\";\n var slide_limit = 500;\n //var display_size = \"default\";\n\n var img_url = (mstrObj != undefined && mstrObj.url != undefined) ? mstrObj.url : img_default;\n\n //obj_globals\n var src_x = 0;\n var src_y = 5;\n var img_w = 500;\n var img_h = 500;\n var can_x = 0;\n var can_y = 0;\n var can_w = canvas_width;\n var can_h = canvas_height;\n\n //NOTE I don't need this. won't be saving this to local storage #remove\n /*try{\n if(localStorage != undefined && localStorage.canvas_tutorial != undefined && localStorage.canvas_tutorial != \"\")\n {\n var local_str = localStorage.canvas_tutorial;\n var local_ary = local_str.split(\",\");\n img_url = local_ary[0];\n src_x = local_ary[1];\n src_y = local_ary[2];\n img_w = local_ary[3];\n img_h = local_ary[4];\n can_x = local_ary[5];\n can_y = local_ary[6];\n can_w = local_ary[7];\n can_h = local_ary[8];\n }//end if\n }catch(e){\n console.log(\"nope. reload failed.\")\n }*/\n\n var obj_els = {};\n var event_ids = [];\n\n\n //methods\n this.setContent = function(sC){fill_content = sC;}//\n this.get_event_ids = function(){return event_ids;}\n this.setCustomClass = function(clsStr,addPar){custom_class = clsStr; add_to_class = addPar || true;/*addPar is nothing yet*/}\n this.setCustomId = function(cId){custom_id = cId; id_type = \"custom\";}\n\n var image_object=new Image();\n\n\n var create_canvas = function(c_cont){\n\n var bigDaddy = (document.getElementById(c_cont)) ? document.getElementById(c_cont) : document.getElementsByClassName(c_cont)[0];\n //clears container\n //if(clearHome == \"true\"){}\n bigDaddy.innerHTML = \"\";//\n\n /******************************** Sample Code *****************************************\n\n ***************************************************************************************/\n\n //alert(\"data object is \" + dataObject);\n //gets container\n\n\n var add_custom_class = (custom_class != \"\") ? custom_class : \"\";\n\n canvas = document.createElement(\"canvas\");\n canvas.id = prefix + \"_ImgCanvas\" + \"_\" + iUN;\n\n event_ids.push(canvas.id);\n\n canvas.className = prefix + \"__ImgCanvas\" + iUN + \" \" + prefix + \"__ImgCanvas \" + prefix + \" ImgCanvas \" + add_custom_class;\n\n if(fill_content != \"\"){canvas.innerHTML = fill_content;}\n\n bigDaddy.appendChild(canvas);\n\n context_obj = canvas.getContext('2d');\n canvas.width = canvas_width;\n canvas.height = canvas_height;\n\n }//end create_preview\n\n var draw_me = function() {\n\n //console.log(\"draw running\");\n\n //clear the canvas\n //canvas.width = canvas.width;\n\n if (canvas.getContext) {\n\n image_object.onload=function(){\n\n //needs this to keep drawing movements smooth\n canvas.width = canvas_width;\n canvas.height = canvas_height;\n\n context_obj.drawImage(image_object, src_x, src_y, img_w, img_h, can_x, can_y, can_w, can_h);\n //console.log(\"image_object\",image_object);//try here\n\n }//end onload//\n\n\n image_object.src=img_url;\n //console.log(\"image_object\",image_object);//nothing to run yet here so its \"\"\n //var dataURL = canvas.toDataURL(\"image/png\");\n //console.log(\"image_object height = \",image_object.height);\n }//end if\n\n\n }//end draw_me\n\n var canvas_editor = function()\n {\n\n\n\n }//end canvas_editor\n\n\n this.display = function(){\n switch(canvas_mode)\n {\n case \"edit\":\n //prep edit elements that add canvas\n control_panel();\n //draw it\n draw_me();\n break;\n\n default:\n create_canvas(home);\n draw_me();\n break;\n\n }//end switch\n }//end display\n\n\n /******************************** SCRAP SECTION BELOW ****************************************/\n\n //NOTE i don't need this panel array - i will need a btn array in its place.\n var ctrl_ary = [\n {\n \"label\":\"POSIION\",\n \"contents\":\"IP\",\n \"title\":\"Image Position\",\n },\n {\n \"label\":\"SCALE\",\n \"contents\":\"IS\",\n \"title\":\"Image Scale\",\n },\n {\n \"label\":\"BORDERS\",\n \"contents\":\"CB\",\n \"title\":\"Canvas Borders\",\n },\n {\n \"label\":\"BORDER SCALE\",\n \"contents\":\"BS\",\n \"title\":\"Canvas Border scale\",\n },\n {\n \"label\":\"BACKGROUND COLOR\",\n \"contents\":\"BC\",\n \"title\":\"Background Color\",\n },\n {\n \"label\":\"RESET\",\n \"contents\":\"RE\",\n \"title\":\"Reset All\",\n }\n\n ];//end ctrl_ary\n\n var size_ary = [\n {\n \"label\":\"XS\",\n \"contents\":\"XS\",\n \"title\":\"for extra small images\",\n \"size\":\"100\",\n \"scale\":\"200%\",\n \"zoom\":\"5X\",\n \"limit\":\"150\"\n },{\n \"label\":\"S\",\n \"contents\":\"S\",\n \"title\":\"for small images\",\n \"size\":\"640\",\n \"scale\":\"100%\",\n \"zoom\":\"4X\",\n \"limit\":\"700\"\n },\n {\n \"label\":\"M\",\n \"contents\":\"M\",\n \"title\":\"for medium images\",\n \"size\":\"1280\",\n \"scale\":\"50%\",\n \"zoom\":\"3X\",\n \"limit\":\"1330\"\n },\n {\n \"label\":\"L\",\n \"contents\":\"L\",\n \"title\":\"for large images\",\n \"size\":\"2560\",\n \"scale\":\"25%\",\n \"zoom\":\"2X\",\n \"limit\":\"2610\"\n },\n {\n \"label\":\"XL\",\n \"contents\":\"XL\",\n \"title\":\"for extra large images\",\n \"size\":\"5120\",\n \"scale\":\"12.5%\",\n \"zoom\":\"1X\",\n \"limit\":\"5170\"\n }\n\n ];//end size_ary\n\n //size_ary.reverse();\n\n var control_panel = function(){\n\n //object properties\n\n\n //local variables\n\n //jqm collapsible\n var bigDaddy = document.getElementsByClassName(home)[0];\n //clear the container\n bigDaddy.innerHTML = \"\";\n\n var edit_box = document.createElement(\"div\");\n edit_box.id = \"edit_box\" + iUN;\n edit_box.className = \"edit_box\" + iUN + \" edit_box \";//test_orange\n //collapsible set\n\n\n //make the other Stuff\n\n //edit_sectionB\n var edit_sectionB = document.createElement(\"div\");\n edit_sectionB.id = \"edit_sectionB\" + iUN;\n edit_sectionB.className = \"edit_sectionB\" + iUN + \" edit_sectionB \";//test_blue\n\n //canvas_cont\n var canvas_cont = document.createElement(\"div\");\n canvas_cont.id = \"canvas_cont\" + iUN;\n canvas_cont.className = \"canvas_cont\" + iUN + \" canvas_cont \";//test_purple\n obj_els[\"edit_home_id\"] = canvas_cont.id;\n\n\n\n //edit_slider_box\n var edit_slider_box = document.createElement(\"div\");\n edit_slider_box.id = \"edit_slider_box\" + iUN;\n edit_slider_box.className = \"edit_slider_box\" + iUN + \" edit_slider_box \";//test_yellow\n\n //edit_lock_box\n var edit_lock_box = document.createElement(\"div\");\n edit_lock_box.id = \"edit_lock_box\" + iUN;\n edit_lock_box.className = \"edit_lock_box\" + iUN + \" edit_lock_box test_pink\";\n\n //edit_lock_box\n var edit_slider_cont = document.createElement(\"div\");\n edit_slider_cont.id = \"edit_slider_cont\" + iUN;\n edit_slider_cont.className = \"edit_slider_cont\" + iUN + \" edit_slider_cont \";//test_green\n\n\n edit_slider_box.appendChild(edit_lock_box);\n edit_slider_box.appendChild(edit_slider_cont);\n\n edit_sectionB.appendChild(canvas_cont);\n\n //edit_resize_box\n var edit_resize_box = document.createElement(\"div\");\n edit_resize_box.id = \"edit_resize_box\" + iUN;\n edit_resize_box.className = \"edit_resize_box\" + iUN + \" edit_resize_box \";\n\n\n //$(\".ctrl_cont\").addClass(\"hibernate\");\n //$(\".col_label\").removeClass(\"hide\");\n edit_box.appendChild(edit_resize_box);\n edit_box.appendChild(edit_sectionB);\n edit_box.appendChild(edit_slider_box);\n\n //edit_cmd_label\n var edit_cmd_label = document.createElement(\"div\");\n edit_cmd_label.id = \"edit_cmd_label\" + iUN;\n edit_cmd_label.className = \"edit_cmd_label\" + iUN + \" edit_cmd_label test_orange\";\n\n\n var ctrl_box = document.createElement(\"div\");\n ctrl_box.id = \"ctrl_box\" + iUN;\n ctrl_box.className = \"ctrl_box\" + iUN + \" ctrl_box edit_sectionA \";\n\n\n\n edit_box.appendChild(ctrl_box);\n edit_box.appendChild(edit_cmd_label);\n\n\n bigDaddy.appendChild(edit_box);\n\n\n\n\n var test_nbr = 3;\n //content for ctrl_box\n for(var x = 0; x < ctrl_ary.length ; x++){\n\n var ec_Nm = \"edit_ctrl_btn\" + x;\n var edit_ctrl_btn = document.createElement(\"button\");\n edit_ctrl_btn.id = \"edit_ctrl_btn\" + iUN + \"_\" + x;\n edit_ctrl_btn.className = \"edit_ctrl_btn\" + iUN + \"_\" + x + \" edit_ctrl_btn\" + x + \" edit_ctrl_btn \";\n edit_ctrl_btn.setAttribute(\"href\",\"#\");\n edit_ctrl_btn.dataset.nbr = x;\n edit_ctrl_btn.dataset.contents = ctrl_ary[x].contents;\n edit_ctrl_btn.title = ctrl_ary[x].title;\n //edit_ctrl_btn.innerHTML = \"<h5>\" + ctrl_ary[x].label + \"</h5>\";\n obj_els[ec_Nm] = edit_ctrl_btn;\n\n //helps set up the correct call inside the event listener\n obj_els[\"contents\" + x] = ctrl_ary[x].contents;\n\n\n obj_els[ec_Nm].addEventListener(\"click\",function(e){\n //i used this.dataset so it doesn't pass the updated x of the for loop\n //and everything ending up being on click of the last index nbr passed\n e.preventDefault();\n var sNbr = this.dataset.nbr;\n var my_contents = this.dataset.contents\n run_contents(my_contents);\n })//end c_Nm\n\n ctrl_box.appendChild(edit_ctrl_btn);\n\n }//end for\n\n\n //content for edit_resize_box\n for(var y = 0; y < size_ary.length ; y++){\n\n var er_Nm = \"edit_resize_btn\" + y;\n var edit_resize_btn = document.createElement(\"button\");\n edit_resize_btn.id = \"edit_resize_btn\" + iUN + \"_\" + y;\n edit_resize_btn.className = \"edit_resize_btn\" + iUN + \"_\" +y + \" edit_resize_btn\" + y + \" edit_resize_btn \";\n edit_resize_btn.setAttribute(\"href\",\"#\");\n edit_resize_btn.dataset.nbr = y;\n edit_resize_btn.dataset.contents = size_ary[y].contents;\n edit_resize_btn.title = size_ary[y].title;\n edit_resize_btn.innerHTML = \"<h6>\" + size_ary[y].zoom + \"</h6>\";\n obj_els[er_Nm] = edit_resize_btn;\n\n //helps set up the correct call inside the event listener\n obj_els[\"contents\" + y] = size_ary[y].contents;\n\n\n obj_els[er_Nm].addEventListener(\"click\",function(e){\n //i used this.dataset so it doesn't pass the updated x of the for loop\n //and everything ending up being on click of the last index nbr passed\n e.preventDefault();\n var sNbr = this.dataset.nbr;\n var my_contents = this.dataset.contents\n run_contents(my_contents);\n })//end c_Nm\n\n edit_resize_box.appendChild(edit_resize_btn);\n\n }//end for\n\n create_canvas(obj_els[\"edit_home_id\"]);\n run_contents(\"IP\");\n\n }//end control_panel\n\n\n\n var run_contents = function(str)\n {\n switch(str)\n {\n case \"IP\":\n //image position\n add_slider_input(0);\n break;\n\n case \"IS\":\n //image scale\n add_slider_input(1);\n break;\n\n case \"CB\":\n //canvas border\n add_slider_input(2);\n break;\n\n case \"BS\":\n //canvas border scale\n add_slider_input(3);\n break;\n\n case \"BC\":\n\n break;\n\n case \"RE\":\n reset_canvas();\n break;\n\n //resize section\n case \"XS\":\n reset_canvas();\n\n img_w = size_ary[0].size;\n img_h = img_w;\n can_w = canvas_width;\n can_h = canvas_width;\n slide_limit = size_ary[0].limit;\n img_label = size_ary[0].label;\n\n control_panel();\n draw_me();\n\n break;\n\n case \"S\":\n reset_canvas();\n\n img_w = size_ary[1].size;\n img_h = img_w;\n can_w = canvas_width;\n can_h = canvas_width;\n slide_limit = size_ary[1].limit;\n img_label = size_ary[1].label;\n\n control_panel();\n draw_me();\n break;\n\n case \"M\":\n reset_canvas();\n\n img_w = size_ary[2].size;\n img_h = img_w;\n can_w = canvas_width;\n can_h = canvas_width;\n slide_limit = size_ary[2].limit;\n img_label = size_ary[2].label;\n\n control_panel();\n draw_me();\n break;\n\n case \"L\":\n reset_canvas();\n\n img_w = size_ary[3].size;\n img_h = img_w;\n can_w = canvas_width;\n can_h = canvas_width;\n slide_limit = size_ary[3].limit;\n img_label = size_ary[3].label;\n //canvas.width = canvas.width;\n\n control_panel();\n draw_me();\n\n break;\n\n case \"XL\":\n reset_canvas();\n\n img_w = size_ary[4].size;\n img_h = img_w;\n can_w = canvas_width;\n can_h = canvas_width;\n slide_limit = size_ary[4].limit;\n img_label = size_ary[4].label;\n //canvas.width = canvas.width;\n control_panel();\n draw_me();\n\n break;\n\n }//end switch\n\n }//end run_contents\n\n var reset_canvas = function()\n {\n src_x = 0;\n src_y = 0;\n img_w = 500;\n img_h = 500;\n can_x = 0;\n can_y = 0;\n can_w = canvas_width;\n can_h = canvas_width;\n //canvas.width = canvas.width;\n create_canvas(obj_els[\"edit_home_id\"]);\n draw_me();\n\n }//end reset_canvas\n\n //html5 slider research\n //https://codepen.io/collection/DgYaMj/2/\n //http://thenewcode.com/757/Playing-With-The-HTML5-range-Slider-Input\n //http://danielstern.ca/range.css/#/\n //http://www.cssportal.com/style-input-range/\n\n\n var add_slider_input = function(nbr)\n {\n var home = document.getElementsByClassName(\"edit_slider_cont\")[0];\n home.innerHTML = \"\";\n\n \t\t\t//reset slide input\n\t\t\tsli_ctrl_inputA = \"\";\n\t\t\tsli_ctrl_inputB = \"\";\n\n var styleA = (nbr == 0 || nbr == 1) ? \"goofy\" : \"default\";//may need to make this different with html range slider\n var styleB = (nbr == 0 || nbr == 1) ? \"default\" : \"goofy\";//reverse for html slider\n var my_limit = (nbr == 0 || nbr == 1) ? slide_limit: canvas_width;//\n\n //SLIDER A\n var sli_ctrl_contA = document.createElement(\"div\");\n sli_ctrl_contA.id = \"sli_ctrl_contA\";\n sli_ctrl_contA.className = \"sli_ctrl_contA\";//\n\n //input\n /*\n var sli_ctrl_inputA = document.createElement(\"input\");\n sli_ctrl_inputA.id = \"sli_ctrl_inputA\";\n sli_ctrl_inputA.className = \"sli_ctrl_inputA\";//\n sli_ctrl_inputA.setAttribute(\"data-slider-id\",\"sli_ctrl_inputA\");//\n sli_ctrl_inputA.setAttribute(\"data-slider-min\",\"-\" + my_limit);//\n sli_ctrl_inputA.setAttribute(\"data-slider-max\",my_limit);//\n sli_ctrl_inputA.setAttribute(\"data-slider-step\",\"1\");//\n var set_valA = slide_data(\"A\",nbr);\n var goof_A = set_valA * -1;//natural opposite effect\n var ctrl_valA = (style == \"goofy\") ? goof_A : set_valA;\n sli_ctrl_inputA.setAttribute(\"data-slider-value\", ctrl_valA);//\n //sli_ctrl_inputA.setAttribute(\"data-slider-handle\",\"custom\");//ninja stars section\n sli_ctrl_inputA.type = \"text\";\n sli_ctrl_inputA.onfocus = function(){this.select();}\n */\n\n sli_ctrl_inputA = document.createElement(\"input\");\n sli_ctrl_inputA.id = \"sli_ctrl_inputA\";\n sli_ctrl_inputA.className = \"sli_ctrl_inputA sli_ctrl_input slider\";\n sli_ctrl_inputA.name = \"sli_ctrl_inputA\";\n //sli_ctrl_inputA.dataset.type = \"range\";\n sli_ctrl_inputA.type = \"range\";\n sli_ctrl_inputA.setAttribute(\"min\",\"-\" + my_limit);\n //max changes depending on user access\n //verified server side\n //entered range number can't be greater than db record of your max access\n sli_ctrl_inputA.setAttribute(\"max\",my_limit);\n var set_valA = slide_data(\"A\",nbr);\n var goof_A = set_valA * -1;//natural opposite effect\n var ctrl_valA = (styleA == \"goofy\") ? goof_A : set_valA;\n sli_ctrl_inputA.setAttribute(\"value\",ctrl_valA);\n\n sli_ctrl_contA.appendChild(sli_ctrl_inputA);//\n\n //A onchange function below\n\n\n var sli_ctrl_boxA = document.createElement(\"input\");\n sli_ctrl_boxA.id = \"sli_ctrl_boxA\";\n sli_ctrl_boxA.className = \" sli_ctrl_boxA\";//\n sli_ctrl_boxA.value = set_valA;//src_x;\n sli_ctrl_boxA.type = \"number\";\n sli_ctrl_boxA.onfocus = function(){this.select(); }\n\n sli_ctrl_boxA.oninput = function(){\n sli_ctrl_inputA.value = sli_ctrl_boxA.value;\n slide_data(\"A\",nbr,{\"value\" :\tsli_ctrl_boxA.value, \"val_oper\": \"add\"});\n //src_x = sli_ctrl_inputA.value;\n sliderA.setValue();\n draw_me();\n }//end on oninput\n\n\n\n //sli_ctrl_contA.appendChild(sli_ctrl_boxA);\n\n //END SLIDER A\n\n //SLIDER B\n var sli_ctrl_contB = document.createElement(\"div\");\n sli_ctrl_contB.id = \"sli_ctrl_contB\";\n sli_ctrl_contB.className = \"sli_ctrl_contB\";\n\n //input\n /*\n var sli_ctrl_inputB = document.createElement(\"input\");\n sli_ctrl_inputB.id = \"sli_ctrl_inputB\";\n sli_ctrl_inputB.className = \"sli_ctrl_inputB\";//\n sli_ctrl_inputB.setAttribute(\"data-slider-id\",\"sli_ctrl_inputB\");//\n sli_ctrl_inputB.setAttribute(\"data-slider-min\",\"-\" + my_limit);\n sli_ctrl_inputB.setAttribute(\"data-slider-max\",my_limit);//\n sli_ctrl_inputB.setAttribute(\"data-slider-step\",\"1\");//\n var set_valB = slide_data(\"B\",nbr);\n var goof_B = set_valB * -1;//natural opposite effect\n var ctrl_valB = (style == \"goofy\") ? goof_B : set_valB;\n sli_ctrl_inputB.setAttribute(\"data-slider-value\",ctrl_valB);\n sli_ctrl_inputB.setAttribute(\"data-slider-orientation\",\"vertical\");\n //sli_ctrl_inputB.setAttribute(\"data-slider-handle\",\"custom\");//ninja stars section\n sli_ctrl_inputB.type = \"text\";\n sli_ctrl_inputB.onfocus = function(){this.select();}\n */\n\n\n sli_ctrl_inputB = document.createElement(\"input\");\n sli_ctrl_inputB.id = \"sli_ctrl_inputB\";\n sli_ctrl_inputB.className = \"sli_ctrl_inputB sli_ctrl_input slider\";\n sli_ctrl_inputB.name = \"sli_ctrl_inputB\";\n //sli_ctrl_inputB.dataset.type = \"range\";\n sli_ctrl_inputB.type = \"range\";\n sli_ctrl_inputB.setAttribute(\"min\",\"-\" + my_limit);\n //max changes depending on user access\n //verified server side\n //entered range number can't be greater than db record of your max access\n sli_ctrl_inputB.setAttribute(\"max\",my_limit);\n var set_valB = slide_data(\"B\",nbr);\n var goof_B = set_valB * -1;//natural opposite effect\n var ctrl_valB = (styleB == \"goofy\") ? goof_B : set_valB;\n sli_ctrl_inputB.setAttribute(\"value\",ctrl_valB);\n\n sli_ctrl_contB.appendChild(sli_ctrl_inputB);\n\n\n //console.info(\"sli_ctrl_inputB\");//\n //console.dir(sli_ctrl_inputB);\n\n var sli_ctrl_boxB = document.createElement(\"input\");\n sli_ctrl_boxB.id = \"sli_ctrl_boxB\";\n sli_ctrl_boxB.className = \"sli_ctrl_boxB\";//\n sli_ctrl_boxB.value = set_valB;//src_y;\n sli_ctrl_boxB.type = \"number\";\n sli_ctrl_boxB.onfocus = function(){this.select(); }\n\n //boxB input event\n sli_ctrl_boxB.oninput = function(){\n sli_ctrl_inputB.value = sli_ctrl_boxB.value;\n slide_data(\"B\",nbr,{\"value\" : \tsli_ctrl_boxB.value, \"val_oper\": \"add\"});\n //src_y = sli_ctrl_inputB.value;\n sliderB.setValue();\n draw_me();\n }//end on oninput\n\n\n\n //sli_ctrl_contB.appendChild(sli_ctrl_boxB);\n\n home.appendChild(sli_ctrl_contA);\n home.appendChild(sli_ctrl_contB);\n\n /*\n var sliderA = new Slider('#sli_ctrl_inputA', {\n formatter: function(value) {\n return 'Current value: ' + value;\n }\n });//end new slider script\n\n console.info(\"sliderA\");\n console.dir(sliderA);\n //http://seiyria.com/bootstrap-slider/\n\n var sliderB = new Slider('#sli_ctrl_inputB', {\n formatter: function(value) {\n return 'Current value: ' + value;\n }\n });//end new slider script\n */\n\n //$('input').slider();//calls both sliders\n //$('#sli_ctrl_inputA').slider();//\n //$(\"#lat_slider\").on('change',function(){slideUpdate({'mode':gEd_mode,'dir':'lattitude'});});\n //$(\"#lon_slider\").on('change',function(){slideUpdate({'mode':gEd_mode,'dir':'longitude'});});\n\n\n //$(\"#sli_ctrl_contB\").on('change',function(){\n sli_ctrl_inputB.oninput = function(e){\n console.log(\"slider B = \",sli_ctrl_inputB.value);\n\t\t\t\t\t\timage_update({\"ltr\":\"B\", \"nbr\":nbr, \"style\":styleB, \"mode\":\"motion\", \"slide_el\":sli_ctrl_inputB, \"box_el\":sli_ctrl_boxB});\n\n };//end on blur\n\n //A onchange function\n //$(\"#sli_ctrl_contA\").on('change',function(){\n sli_ctrl_inputA.oninput = function(){\n console.log(\"slider A = \",sli_ctrl_inputA.value);\n\t\t\t\t\t\timage_update({\"ltr\":\"A\", \"nbr\":nbr, \"style\":styleA, \"mode\":\"motion\", \"slide_el\":sli_ctrl_inputA, \"box_el\":sli_ctrl_boxA});\n\n };//end on blur//\n //http://seiyria.com/bootstrap-slider/\n\n //END SLIDER B\n\n\t\t\t\t\t\tcanvas_mouse_events(\"set\");\n\n\t\t\t\t\t\tcanvas.onmouseover = function(e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\tcanvas_mouse_events(\"set\");\n\n\t\t\t\t\t\t\twindow.onmousemove = function(e)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmove_my_image(e);\n\t\t\t\t\t\t\t}//end canvas mousemove\n\n }//on mouse over\n\n //mouse has 4 events (mO,mD, mU, mM) touch only has 3 (tS,tE,tM)\n //so i had to do more with less - it was pretty straight forward after that.\n\n canvas.ontouchstart = function(e)\n {\n touchdown = true;\n e.preventDefault();\n\t\t\t\t\t\t\tget_touch_offset(e)\n\t\t\t\t\t\t\tcanvas_mouse_events(\"set\");\n //alert(\"touch started\");\n\n canvas.ontouchmove = function(e)\n\t\t\t\t\t\t\t{\n //alert(\"move started\");\n\t\t\t\t\t\t\t\tmove_my_image(e);\n\t\t\t\t\t\t\t}//end canvas mousemove\n\n }//end ontouchstart\n\n //i put this in a separate function so i can use it for touch and mouse\n //canvas events\n var move_my_image = function(e)\n {\n //console.log(e);\n\t\t\t\t\t\t\t\tif(mousedown == true || touchdown == true)\n\t\t\t\t\t\t\t\t{\n //alert(\"im goin in\");\n //stops the mouse from hightlighting everyting on the page\n\t\t\t\t\t\t\t\t//e.preventDefault();\n var motion_method = (mousedown == true) ? \"mouse\" : (touchdown == true) ? \"touch\" : \"error\";\n\t\t\t\t\t\t\t\t\t//e.clientX,Y = mouse position in the browser window\n\t\t\t\t\t\t\t\t\tvar y = (mousedown == true) ? e.clientY : e.touches[0].clientY;//this number is a large # like 400 or 600\n\t\t\t\t\t\t\t\t\tvar x = (motion_method == \"mouse\") ? e.clientX : e.touches[0].clientX;\n\t\t\t\t\t\t\t\t\tvar pos = (motion_method == \"mouse\") ? getMousePos(e) : getTouchPos(e);\n\t\t\t\t\t\t\t\t\tvar pos_x = pos.x; //converts to a small number like 37\n\t\t\t\t\t\t\t\t\tvar pos_y = pos.y;\n\n //if(motion_method == \"touch\"){alert(\"pos_x = \" + pos_x + \", pos_y = \" + pos_y\n // + \", x = \" + x + \", y = \" + y)}\n\n\n\t\t\t\t\t\t\t\t\tif(last_x != \"default\" && last_x != x)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//i use \"default\" initially so i can tell if the object\n\t\t\t\t\t\t\t\t\t\t//ever moved at all, if never used i set it in the else\n\n\t\t\t\t\t\t\t\t\t\tif(x < last_x)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//then its going right\n\t\t\t\t\t\t\t\t\t\t\t//this if helps me determine which way the mouse is moving\n\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"x is less\");\n\t\t\t\t\t\t\t\t\t\t\t//calculate how far away the new mouse position is from the\n\t\t\t\t\t\t\t\t\t\t\t//last mouse position\n\t\t\t\t\t\t\t\t\t\t\t//var new_x = last_x - x;\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"new_x = \",new_x);\n\t\t\t\t\t\t\t\t\t\t\t//var cur_val_x = parseInt(sli_ctrl_inputA.value);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputA.value = cur_val_x - new_x //pos_x;//cur_val_x - 50;\n\n\t\t\t\t\t\t\t\t\t\t\t//what i need is to calculate how far img is from the\n\t\t\t\t\t\t\t\t\t\t\t//point of origin basically the img_last_x then i need to\n\t\t\t\t\t\t\t\t\t\t\t//calculate how far the mouse is from that position and\n\t\t\t\t\t\t\t\t\t\t\t//use it as an offset.\n\n\n\t\t\t\t\t\t\t\t\t\t\tvar cur_val_x = parseInt(sli_ctrl_inputA.value);\n\t\t\t\t\t\t\t\t\t\t\tvar new_x = pos_x + offset_x;\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"new_x = \",new_x);\n console.log(\"styleA = \",styleA);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputA.value = new_x;\n\n\n\n\t\t\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//if it uses this section then its going left\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"x is more\");\n\t\t\t\t\t\t\t\t\t\t\t//var new_x = x - last_x;\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"new_x = \",new_x);\n\t\t\t\t\t\t\t\t\t\t\t//var cur_val_x = parseInt(sli_ctrl_inputA.value);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputA.value = cur_val_x + new_x//pos_x//cur_val_x + 50;\n\n\t\t\t\t\t\t\t\t\t\t\tvar cur_val_x = parseInt(sli_ctrl_inputA.value);\n\t\t\t\t\t\t\t\t\t\t\tvar new_x = pos_x + offset_x;\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"new_x = \",new_x);\n console.log(\"styleA = \",styleA);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputA.value = new_x;\n\n\t\t\t\t\t\t\t\t\t\t}//end else x\n\t\t\t\t\t\t\t\t\t\t//console.log(\"new x val= \",sli_ctrl_inputA.value);\n\t\t\t\t\t\t\t\t\t\tif(nbr == 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tsli_ctrl_inputA.value = new_x;\n\t\t\t\t\t\t\t\t\t\t\timage_update({\"ltr\":\"A\", \"nbr\":nbr, \"style\":styleA, \"mode\":\"motion\", \"slide_el\":sli_ctrl_inputA, \"box_el\":sli_ctrl_boxA});//\n\t\t\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tsrc_x = new_x * -1;\n\t\t\t\t\t\t\t\t\t\t\tdraw_me();\n\t\t\t\t\t\t\t\t\t\t}//end else\n\n\n\t\t\t\t\t\t\t\t\t}//end if last_x\n\n\t\t\t\t\t\t\t\t\tif(last_y != \"default\")\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//what is important here is whether im above\n\t\t\t\t\t\t\t\t\t\t//or below the origin\n\n\t\t\t\t\t\t\t\t\t\tif(y < last_y && last_y != y)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//then its going up\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"y is less\");\n\t\t\t\t\t\t\t\t\t\t\t//var new_y = last_y - y;\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"new_y = \",new_y);\n\t\t\t\t\t\t\t\t\t\t\t//var cur_val_y = parseInt(sli_ctrl_inputB.value);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputB.value = cur_val_y - new_y//pos_y//poscur_val_y - 50;\n\n\t\t\t\t\t\t\t\t\t\t\t//then its going up\n\t\t\t\t\t\t\t\t\t\t\tvar new_y = pos_y + offset_y;\n\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm pos_y = \",pos_y);\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm new_y = \",new_y);\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm offset_y = \",offset_y);\n\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputB.value = new_y;\n\n\t\t\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"y is more\");\n\t\t\t\t\t\t\t\t\t\t\t//var new_y = y - last_y;\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"new_y = \",new_y);\n\t\t\t\t\t\t\t\t\t\t\t//var cur_val_y = parseInt(sli_ctrl_inputB.value);\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputB.value = cur_val_y + new_y//pos_y//cur_val_y + 50;\n\t\t\t\t\t\t\t\t\t\t\t//then its going up\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"y is less\");\n\n\t\t\t\t\t\t\t\t\t\t\t//var cur_val_y = parseInt(sli_ctrl_inputB.value);\n\t\t\t\t\t\t\t\t\t\t\t//var new_y = pos_y - cur_val_y;\n\t\t\t\t\t\t\t\t\t\t\tvar new_y = pos_y + offset_y;\n\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm pos_y = \",pos_y);\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm new_y = \",new_y);\n\t\t\t\t\t\t\t\t\t\t\t//console.log(\"mm offset_y = \",offset_y);\n\n\t\t\t\t\t\t\t\t\t\t\t//sli_ctrl_inputB.value = new_y;\n\n\t\t\t\t\t\t\t\t\t\t}//end else x\n\n\n\n\t\t\t\t\t\t\t\t\t\t//console.log(\"new input value = \",sli_ctrl_inputB.value);\n\t\t\t\t\t\t\t\t\t\tif(nbr == 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tsli_ctrl_inputB.value = new_y * -1;\n\t\t\t\t\t\t\t\t\t\t\timage_update({\"ltr\":\"B\", \"nbr\":nbr, \"style\":styleB, \"mode\":\"motion\", \"slide_el\":sli_ctrl_inputB, \"box_el\":sli_ctrl_boxB});\n\t\t\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t//using this without modification creates\n\t\t\t\t\t\t\t\t\t\t\t//and opposite effect during moving.\n\t\t\t\t\t\t\t\t\t\t\t//src_y = new_y;\n\n\t\t\t\t\t\t\t\t\t\t\t//modify with new_y * -1\n\t\t\t\t\t\t\t\t\t\t\tsrc_y = new_y * -1;\n\n\t\t\t\t\t\t\t\t\t\t\tdraw_me();\n\t\t\t\t\t\t\t\t\t\t}//end else\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t// i use this the clear the default word and to set the\n\t\t\t\t\t\t\t\t\t//last move for each subsequent mousemove after it runs the\n\t\t\t\t\t\t\t\t\t//above processes\n\t\t\t\t\t\t\t\t\tlast_x = x;\n\t\t\t\t\t\t\t\t\tlast_y = y;\n\t\t\t\t\t\t\t\t\t//console.log(\"mouse-x = \",x);\n\t\t\t\t\t\t\t\t\t//console.log(\"last_x = \",last_x);\n\t\t\t\t\t\t\t\t\t//console.log(\"pos_x = \",pos_x);\n\t\t\t\t\t\t\t\t\t//console.log(\"pos_y = \",pos_y);\n\n\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//clear the tracker\n\t\t\t\t\t\t\t\t\t//last_x = \"\";\n\t\t\t\t\t\t\t\t\t//last_y = \"\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t//end if\n\n }//end move my image\n\n\n }//end add_slider_input\n\n\n function getTouchPos(e) {\n var rect = canvas.getBoundingClientRect();\n //alert(\"touch x = \" + e.touches[0].clientX);\n return {\n x: e.touches[0].clientX - rect.left,\n y: e.touches[0].clientY - rect.top\n };\n }\n\n\n var getMousePos = function(e) {\n\n\t\t\t//this section returns the mouse position minus the\n\t\t\t//canvas' top or left window position. \"rect\"\n\n\t\t\tvar canvas_el = document.getElementById(\"tutorial\");\n\t\t\tvar rect = canvas.getBoundingClientRect();\n\n\t\t\t//console.log(\"rect.left\" + rect.left);\n\n\t\t\treturn {\n\t\t\t\tx: (e.clientX - rect.left) ,\n\t\t\t\ty: (e.clientY - rect.top)\n\t\t\t};\n\n\t\t}//- canvas_size/2 - canvas_size/2\n\n\t\tvar canvas_mouse_events = function(aVar,cId)\n\t\t{\n\n\t\t\t//this function adds and removes events that affects the canvas\n\t\t\t//once you are outside of the canvas and you let the mouse up\n\t\t\t//this is designed to clear these mouse events from the memory so\n\t\t\t//no event occurs again until you are \"mouseover\"'d the canvans where\n\t\t\t//which will set up these events again.\n\t\t\tvar action = aVar || \"remove\";\n\t\t\tvar canvas_id = cId;\n\t\t\tvar canvas_el = document.getElementById(cId);\n\n\t\t\tif(action == \"set\"){\n\n\t\t\t\t\t\tcanvas.onmousedown = function(e){\n\t\t\t\t\t\t\tmousedown = true;\n e.preventDefault();\n\t\t\t\t\t\t\tvar d = new Date();\n\t\t\t\t\t\t\t//console.log(\"onmousedown mousedown = \",mousedown);\n\t\t\t\t\t\t\t//console.log(\"time = \",d.toLocaleString());\n\t\t\t\t\t\t\tvar pos = getMousePos(e)\n\t\t\t\t\t\t\tvar pos_x = pos.x;\n\t\t\t\t\t\t\tvar pos_y = pos.y;\n\t\t\t\t\t\t\t//x is dealing with different values so\n\t\t\t\t\t\t\t//the math is addition not subtraction\n\n\t\t\t\t\t\t\t//this offset number has to be\n\t\t\t\t\t\t\t//permanent not recalculating so it\n\t\t\t\t\t\t\t//doesn't migrate to another position\n\n\t\t\t\t\t\t\t//pos_x - src_x; & pos_y - src_y; produced errant results\n\t\t\t\t\t\t\t//pos_x/y is always negative - you cant click on other\n\t\t\t\t\t\t\t//side of origin - so to properly calculate the offset\n\t\t\t\t\t\t\t//change mouse position read out from the positive int\n\t\t\t\t\t\t\t//representing the amount of canvas points from the\n\t\t\t\t\t\t\t//origin to a more accurate negative number representing\n\t\t\t\t\t\t\t//the actual canvas position\n\t\t\t\t\t\t\tvar act_x = (pos_x * -1);\n\t\t\t\t\t\t\tvar act_y = (pos_y * -1);\n\n\t\t\t\t\t\t\toffset_x = act_x - src_x;\n\n\t\t\t\t\t\t\toffset_y = act_y - src_y;\n\n\t\t\t\t\t\t\tcanvas_mouse_events(\"set\");\n\t\t\t\t\t\t}//end onmousedown\n\n\n window.onmouseup = function()\n {\n mousedown = false;\n\n }//end onmousedown\n\n window.ontouchend = function()\n {\n touchdown = false;\n\n }//end ontouchend\n\n\n\t\t\t}else\n {\n\t\t\t\t\t\tmousedown = false;\n\t\t\t\t\t\tcanvas.onmousedown = \"\";\n\t\t\t\t\t\tcanvas.onmousemove = \"\";\n\n touchdown = false;//\n canvas.ontouchstart = \"\";\n canvas.ontouchmove = \"\";\n\n\t\t\t}//end else\n\t\t}//end canvas_mouse_events\n\n var get_touch_offset = function(e)\n {\n var d = new Date();\n\t\t\t\t\t\t\t//console.log(\"onmousedown mousedown = \",mousedown);\n\t\t\t\t\t\t\t//console.log(\"time = \",d.toLocaleString());\n\t\t\t\t\t\t\tvar pos = getTouchPos(e);\n\t\t\t\t\t\t\tvar pos_x = pos.x;\n\t\t\t\t\t\t\tvar pos_y = pos.y;\n\n\t\t\t\t\t\t\tvar act_x = (pos_x * -1);\n\t\t\t\t\t\t\tvar act_y = (pos_y * -1);\n\n\t\t\t\t\t\t\toffset_x = act_x - src_x;\n\n\t\t\t\t\t\t\toffset_y = act_y - src_y;\n //alert(\" offset_x & y = \" + offset_x + \"\\n \" + offset_y);\n\n }//end get touch offset\n\n var image_update = function(mObj){\n\t\t\t//console.info(\"image update running\");\n\n\t\t\tvar style = mObj.style;\n\t\t\tvar ltr = mObj.ltr;\n\n\t\t\tvar nbr = mObj.nbr;\n\t\t\tvar mode = mObj.mode;//\"motion\" or not (\"input\" as other)\n\n\t\t\tvar slide_el = mObj.slide_el;\n\t\t\tvar box_el = mObj.box_el;\n\n\t\t\tvar target_el = (mode == \"motion\") ? slide_el : box_el;\n\n\t\t\tif(mode == \"motion\")\n\t\t\t{\n\t\t\t\t//make regular and goofy foot (opposite) values\n\t\t\t\tvar val_regular_input = target_el.value;\n\t\t\t\tvar val_goof_input = target_el.value * -1;\n\t\t\t\tvar input_val = (style == \"goofy\") ? val_goof_input : val_regular_input;\n\t\t\t\tbox_el.value = input_val;//unique to motion\n\t\t\t}else\n\t\t\t{\n\t\t\t\tif(ltr = \"A\"){\n\t\t\t\t\tsli_ctrl_inputA.value = box_el.value;\n\t\t\t\t}else{\n\t\t\t\t\tsli_ctrl_inputB.value = box_el.value;\n\t\t\t\t}\n\n\t\t\t\tvar input_val = box_el.value;\n\t\t\t\t//slide_data(\"B\",nbr,{\"value\" : \tsli_ctrl_boxB.value, \"val_oper\": \"add\"});\n\t\t\t\t//src_y = sli_ctrl_inputB.value;\n\n\t\t\t}\n\n\t\t\tslide_data(ltr,nbr,{\"value\" :\tinput_val, \"val_oper\": \"add\"});\n\n\n\t\t\tif(mode == \"input\"){\n\t\t\t\tif(ltr == \"A\")\n\t\t\t\t{\n\t\t\t\t\t//make these \"object properties\"\n\t\t\t\t\tsliderA.setValue();//unique to input\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\tsliderB.setValue();//unique to input\n\t\t\t\t}\n\t\t\t}//end if mode == input\n\n\t\t\tdraw_me();\n\n\t\t}//end image_update\n\n var slide_data = function(ltr,nbr,obj)\n {\n //span_set2 view_span span3 view_span3\n var slide_ltr = ltr;\n var nbr = nbr;\n var val = (obj != undefined && obj.value != undefined) ? obj.value : \"\";\n var val_oper = (obj != undefined && obj.val_oper != undefined) ? obj.val_oper : \"get_value\";\n\n var slide_id = ltr+nbr;\n var span_id_str = \"span\" + slide_id;\n var targetSpan = document.getElementById(span_id_str);\n\n if(val != \"\" && val_oper == \"add\" || val_oper == \"both\"){\n //A covers x and width\n //B covers y and height\n switch(slide_id)\n {\n case \"A0\":\n src_x = val;\n //targetSpan.innerText = val;\n break;\n case \"B0\":\n src_y = val;\n //targetSpan.innerText = val;\n break;\n\n case \"A1\":\n img_w = val;\n //targetSpan.innerText = val;\n break;\n case \"B1\":\n img_h = val;\n //targetSpan.innerText = val;\n break;\n\n case \"A2\":\n can_x = val;\n //targetSpan.innerText = val;\n break;\n case \"B2\":\n can_y = val;\n //targetSpan.innerText = val;\n break;\n\n case \"A3\":\n can_w = val;\n //targetSpan.innerText = val;\n break;\n case \"B3\":\n can_h = val;\n //targetSpan.innerText = val;\n break;\n }//end switch\n }//end if\n\n if(val_oper == \"get_value\" || val_oper == \"both\"){\n switch(slide_id)\n {\n case \"A0\":\n return src_x;\n break;\n case \"B0\":\n return src_y;\n break;\n case \"A1\":\n return img_w;\n break;\n case \"B1\":\n return img_h;\n break;\n case \"A2\":\n return can_x;\n break;\n case \"B2\":\n return can_y;\n break;\n\n case \"A3\":\n return can_w;\n break;\n case \"B3\":\n return can_h;\n break;\n }//end switch\n }//end if\n\n }//end slide_dataA\n\n\n /*\n\n //this.draw_me = function(){ draw_me(); };\n */\n\n\n }", "function func(e) {\r\n // console.log(e.target.parentNode.getAttribute('class'));\r\n var p = e.target\r\n while (p.className !== \"music_image\") {\r\n p = p.parentNode\r\n }\r\n // var change = p.querySelector('img').src;\r\n\r\n changePreview(p.id);\r\n }", "function Start() {\r\n //when viewing an image (not a webpage). iFrames, or pdfs may not have body/head\r\n if (!doc.body || !doc.head || (win == top && doc.body.children.length == 1 && !doc.body.children[0].children.length)) {\r\n ShowImages();\r\n return;\r\n }\r\n //do elements\r\n DoElements(doc.body, false);\r\n //show body\r\n AddClass(doc.documentElement, 'wizmage-show-html wizmage-running');\r\n //create eye\r\n eye.style.display = 'none';\r\n eye.style.width = eye.style.height = '16px';\r\n eye.style.position = 'fixed';\r\n eye.style.zIndex = '100000000';\r\n eye.style.cursor = 'pointer';\r\n eye.style.padding = '0';\r\n eye.style.margin = '0';\r\n eye.style.opacity = '.5';\r\n doc.body.appendChild(eye);\r\n //create temporary div, to eager load background img light for noEye to avoid flicker\r\n if (_settings.isNoEye) {\r\n for (let i = 0; i < 8; i++) {\r\n let div = doc.createElement('div');\r\n div.style.opacity = div.style.width = div.style.height = '0';\r\n div.className = 'wizmage-pattern-bg-img wizmage-light wizmage-shade-' + i;\r\n doc.body.appendChild(div);\r\n }\r\n }\r\n //mutation observer\r\n observer = new WebKitMutationObserver(function (mutations: any) {\r\n for (let i = 0; i < mutations.length; i++) {\r\n let m = mutations[i];\r\n if (m.type == 'attributes') {\r\n if (m.attributeName == 'class') {\r\n if (m.target.tagName == 'HTML') {\r\n if (m.target.className.indexOf('wizmage-show-html') == -1)\r\n AddClass(m.target, 'wizmage-show-html');\r\n }\r\n let oldHasLazy = m.oldValue != null && m.oldValue.indexOf('lazy') > -1, newHasLazy = m.target.className != null && m.target.className.indexOf('lazy') > -1;\r\n if (oldHasLazy != newHasLazy)\r\n DoElements(m.target, true);\r\n } else if (m.attributeName == 'style' && m.target.style.backgroundImage.indexOf('url(') > - 1) {\r\n let oldBgImg, oldBgImgMatch;\r\n if (m.oldValue == null || !(oldBgImgMatch = /background(?:-image)?:[^;]*url\\(['\"]?(.+?)['\"]?\\)/.exec(m.oldValue)))\r\n oldBgImg = '';\r\n else\r\n oldBgImg = oldBgImgMatch[1];\r\n let imgUrlMatch = /url\\(['\"]?(.+?)['\"]?\\)/.exec(m.target.style.backgroundImage);\r\n if (imgUrlMatch && oldBgImg != imgUrlMatch[1]) {\r\n DoElement.call(m.target);\r\n }\r\n }\r\n else if (m.attributeName == 'srcset' && m.target.tagName == 'SOURCE' && m.target.srcset)\r\n DoElement.call(m.target.parentElement);\r\n }\r\n else if (m.addedNodes != null && m.addedNodes.length > 0)\r\n for (let j = 0; j < m.addedNodes.length; j++) {\r\n let el = m.addedNodes[j];\r\n if (!el.tagName) //eg text nodes\r\n continue;\r\n if (el.tagName == 'IFRAME')\r\n DoIframe(el);\r\n else\r\n DoElements(el, true);\r\n }\r\n }\r\n });\r\n observer.observe(doc, { subtree: true, childList: true, attributes: true, attributeOldValue: true });\r\n //CheckMousePosition every so often\r\n setInterval(CheckMousePosition, 250);\r\n setInterval(UpdateElRects, 3000);\r\n for (let to of [250, 1500, 4500, 7500])\r\n setTimeout(UpdateElRects, to);\r\n //ALT-a, ALT-z\r\n doc.addEventListener('keydown', DocKeyDown);\r\n //notice when mouse has moved\r\n doc.addEventListener('mousemove', DocMouseMove);\r\n win.addEventListener('scroll', WindowScroll);\r\n //empty iframes\r\n let iframes = doc.getElementsByTagName('iframe');\r\n for (let i = 0, max = iframes.length; i < max; i++) {\r\n DoIframe(iframes[i]);\r\n }\r\n hasStarted = true;\r\n }", "function ImageController(){\n\t\tvar imageService = new ImageService()\n\t\t$.get(window.location.pathname + '-image-tag.html', function(data){\n\t\t\t$('.main-container').append(data)\n\t\t})\n\t\timageService.getImage(function(imageData){\n\t\t\t$('body').css('background-image', `url(\"${imageData.url}\")`);\n\t\t\tconsole.log(imageData.large_url)\n\t\t\t$('.image-link').attr('href', imageData.large_url!==null? imageData.large_url : imageData.url)\n\t\t})\n\t}", "function image_process_streamization() { \r\n\r\n}", "render() {\n image(this.image, this.x, this.y, this.width, this.height);\n }", "function firstImageLoaded( img )\n {\n This.widget.getAnalytics().fireOpenSlate();\n\n if( true == m_disableGallery ) return;\n Logger.log(\"ImageGalleryAdView::firstImageLoaded() - first image of the gallery loaded, gallery will now open\");\n\n m_isLoadingImage = false;\n m_currentTimeOut = 0;\n disableActivityIndicator();\n\n var slate = AssetLoaderInstance.createSlate( img );\n m_currentImage = slate;\n\n // Innovid requested this value to be ignored\n if( true )//m_galleryUrls[m_currentGalleryIndex].fit == true )\n {\n m_currentImage.width = 1920;\n m_currentImage.height = 1080;\n }\n m_currentImage.y = (1080 * 0.5) - (m_currentImage.height * 0.5);\n m_currentImage.x = (1920 * 0.5) - (m_currentImage.width * 0.5);\n\n m_imageContainer&&m_imageContainer.addChild( m_currentImage );\n\n disablePlaceHolder();\n showControls();\n updateText();\n }", "function preview() {\n currentImg.textContent = newIndex + 1; //passing current img index to currentImg varible with adding +1\n let imageURL = gallery[newIndex].src; //getting user clicked img url\n previewImg.src = imageURL; //passing user clicked img url in previewImg src\n }", "function LoadSuccess() {\n // Image: set properties\n that.Properties($i);\n // Image: all image loaded\n SetupAfterAllLoaded();\n }", "aiMediumPickHandler(data) {\n this.aiMediumMoveFromX = Number(data.target.response[5]);\n this.aiMediumMoveFromY = Number(data.target.response[7]);\n this.aiMediumMoveToX = Number(data.target.response[9]);\n this.aiMediumMoveToY = Number(data.target.response[11]);\n\n this.checkValidPlay(this.aiMediumMoveFromY,this.aiMediumMoveFromX,this.aiMediumMoveToY,this.aiMediumMoveToX);\n }", "function settingImage()\r\n\t{\r\n\t\t\r\n\t\t\t$('.control-section').html(g_search_info_level2.currentsection);\r\n\t\t\t$('.code-section').html(g_search_info_level2.currentcode);\r\n\t\t\t$('.kmstart').html(g_search_info.kmstart);\r\n\t\t\t$('.kmend').html(g_search_info.kmend);\r\n\t\t\t$('#video-detail .selectedkm').html('');\r\n\t\t\t$('.latitute').html('');\r\n\t\t\t$('.longtitute').html('');\r\n\t\t\t$('#video-player').html('');\r\n\r\n\t\t\t//getImageSet();\r\n\t}", "function uploadTileImage() {\n BinaryUpload.Uploader().Upload(\"/images/l_Sliderx96.png\", \"/SiteAssets/l_Sliderx96.png\");\n //setImageUrl();\n createConfigList();\n }", "selectImage(imgSrc) {\n const {onImageSelected} = this.props;\n if (typeof onImageSelected === \"function\") {\n onImageSelected(imgSrc);\n }\n }", "function openImage(){\n console.log(\"Image will open\");\n }", "function ImageHelper() { }", "function OnGetReportImage(response, eventArgs)\n{\n $(eventArgs).attr(\"src\", response);\n}", "function checkImagesHandler() {\n\t\t$( '.LootTransformedImage' ).each( function () {\n\t\t\tvar $img = $( this );\n\t\t\tif ( isElementInViewport( $img ) ) {\n\t\t\t\t$img.replaceWith( $img.data( 'replace-with' ) );\n\t\t\t}\n\t\t} );\n\t\tif ( leadOnly && endIsNigh() ) {\n\t\t\tleadOnly = false;\n\t\t\tloadRest();\n\t\t}\n\t}", "function processImage() {\n // if there is an image tag inside the container\n // and it has a src setted\n if(f.o.src && f.o.src != \"\")\n {\n\n // if container size if not setted resize it to the image size\n if (Math.floor(f.$el.height()) <= 0) { f.o.clearhg = true; f.$el.height(f.o.naturalimghg); } \n if (Math.floor(f.$el.width()) <= 0) { f.o.clearwd = true; f.$el.width(f.o.naturalimgwd ); }\n\n // get the container size\n f.o.containerwd = f.$el.width();\n f.o.containerhg = f.$el.height();\n\n // get the size of the visible area for the image we need this \n // to not draw the image outside the parent container\n f.o.imghg = ((f.o.naturalimgwd/f.o.naturalimghg < f.o.containerwd/f.o.containerhg) ? \n f.o.containerhg :\n Math.ceil(f.o.containerwd/f.o.naturalimgwd * f.o.naturalimghg)); \n\n f.o.imgwd = ((f.o.naturalimgwd/f.o.naturalimghg < f.o.containerwd/f.o.containerhg) ? \n Math.ceil(f.o.containerhg/f.o.naturalimghg * f.o.naturalimgwd) :\n f.o.containerwd);\n\n }\n else {\n // if no principal image takes the container size \n f.o.imgwd = f.o.containerwd = f.$el.width();\n f.o.imghg = f.o.containerhg = f.$el.height();\n }\n // calculate margin for horizontal alingment inside the container\n f.o.marginleft = (f.o.containerwd > f.o.imgwd) ? (f.o.containerwd/2) - (f.o.imgwd/2) : 0;\n\n }" ]
[ "0.6447416", "0.62845635", "0.6281084", "0.62159145", "0.621066", "0.6153429", "0.61533403", "0.6094539", "0.60593873", "0.60593694", "0.6036751", "0.60072666", "0.59906185", "0.5980346", "0.59531915", "0.590552", "0.59044224", "0.58976215", "0.58701044", "0.5860727", "0.5857784", "0.58338994", "0.5829657", "0.58273435", "0.58259004", "0.58256626", "0.58182156", "0.5802242", "0.57994694", "0.57948655", "0.57934576", "0.5791733", "0.57819647", "0.578076", "0.5778205", "0.57762074", "0.57686967", "0.5761209", "0.5753442", "0.5753221", "0.57493055", "0.57451296", "0.5744938", "0.5733479", "0.57330656", "0.57286227", "0.5724058", "0.5723468", "0.5722283", "0.57091254", "0.57003206", "0.56953794", "0.5689819", "0.5688379", "0.568545", "0.56833416", "0.5673873", "0.567283", "0.56717217", "0.56717217", "0.56694", "0.56692785", "0.56648815", "0.5662142", "0.565971", "0.5658593", "0.5658527", "0.56545913", "0.5652934", "0.5651226", "0.5645586", "0.56454486", "0.56415594", "0.564025", "0.5640206", "0.5635924", "0.56303245", "0.56294364", "0.5624075", "0.56206936", "0.56184", "0.5617028", "0.5617028", "0.56167567", "0.5612248", "0.5609743", "0.5608907", "0.560841", "0.560787", "0.5607178", "0.56070876", "0.56063235", "0.5594827", "0.55945176", "0.5594222", "0.5593642", "0.55910236", "0.5588871", "0.55879873", "0.5587041", "0.55830544" ]
0.0
-1
angular .module(appName) .filter(name, pagination)
function pagination() { return function (input, pageth, elPerPage) { if (!input || !input.length) return; // var videoPerPage = window.constants.VIDEO_PER_PAGE; // elPerPage = parseInt(elPerPage); pageth = parseInt(pageth); elPerPage = parseInt(elPerPage); let numEl = input.length; let start = (pageth - 1) * elPerPage; let end = start + elPerPage; // //console.log('==========') // //console.log(`num ele ${numEl}`); // //console.log(`page: ${pageth}`); // //console.log(`elperpage: ${elPerPage}`); // //console.log(`start: ${start}`); // //console.log(`end: ${end}`); // if (pageth > numEl / elPerPage + 1) return; // pageth > num pages return input.slice(start, end); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pagination() {\r\n\t\t\t\t$scope.pageSize = $scope.shownoofrec;\r\n\t\t\t\t\r\n\t\t\t\t$scope.currentPage = 0;\r\n\t\t\t\t$scope.totalPages = 0;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$scope.nextDisabled = false;\r\n\t\t\t\t$scope.previousDisabled = true;\r\n\t\t\t\t\r\n\t\t\t\tif(self.Filtervehicles.length <= 10 ) {\r\n\t\t\t\t\t$scope.nextDisabled = true;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(self.Filtervehicles.length < 100) {\r\n\t\t\t\t\t$scope.totalnoof_records = self.Filtervehicles.length;\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfindrecord_count();\r\n\t\t\t\t}\r\n\t\t\t}", "function pagerFilter(data){\n if (typeof data.length == 'number' && typeof data.splice == 'function'){ // is array\n data = {\n total: data.length,\n rows: data\n };\n }\n var dg = $(this);\n var opts = dg.datagrid('options');\n var pager = dg.datagrid('getPager');\n pager.pagination({\n \tonBeforeRefresh:function(){\n \t\tdg.datagrid(\"reload\");\n \t},\n onSelectPage:function(pageNum, pageSize){\n opts.pageNumber = pageNum;\n opts.pageSize = pageSize;\n pager.pagination('refresh',{\n pageNumber:pageNum,\n pageSize:pageSize\n });\n dg.datagrid('loadData',data);\n }\n });\n if (!data.originalRows){\n data.originalRows = (data.rows);\n }\n var start = (opts.pageNumber-1)*parseInt(opts.pageSize);\n var end = start + parseInt(opts.pageSize);\n data.rows = (data.originalRows.slice(start, end));\n return data;\n}", "filterParameter() {\n return this.resourceName + '_filter'\n }", "filterParameter() {\n return this.resourceName + '_filter'\n }", "_setupPagingAndFiltering() {\r\n const that = this;\r\n\r\n that.$.pager.$.pageSizeSelector.classList.add('underlined');\r\n that.$.pager.$.pageSizeSelector.dropDownAppendTo = 'body';\r\n\r\n that._filterInfo = { query: '' };\r\n that._applyFilterTemplate();\r\n that.$.header.classList.toggle('smart-hidden', that.filterRow && !that.filterTemplate);\r\n }", "function FilterSortItems() {\n var pageSize = 10;\n var currentPage = 0;\n localStorage.setItem(\"CurrentPage\", currentPage);\n CarryoutItemsList(10, 0);\n}", "filterInstances() {\n let hidden_filters = ['offset', 'limit', 'page'];\n let filters = this.getFiltersPrepared(this.qs_url);\n\n for(let filter in filters) {\n if(hidden_filters.includes(filter)){\n delete filters[filter];\n }\n }\n\n this.$router.push({\n name: this.$route.name,\n params: this.$route.params,\n query: filters,\n });\n }", "filter() {\n\t}", "filter() {\n\t}", "function list(req, res, next){\n // Validate params.\n var errors = [];\n\n // Pagination\n const PAGE_SIZE_DEFAULT = 5;\n var page = req.query.page != null ? parseInt(req.query.page) : 1;\n var page_size = req.query.page_size != null ? parseInt(req.query.page_size) : PAGE_SIZE_DEFAULT;\n\n if(!Number.isInteger(page) || page < 1) errors.push(\"'page' must be a positive integer\");\n\n if(!Number.isInteger(page_size) || page_size < 5 || page_size > 20) errors.push(\"'page_size' must be a integer between 5 and 20\");\n\n // Filtering\n var filters_params = [];\n var filters_fields = req.query.filter == null ? [] : req.query.filter.split(';');\n var filters_values = req.query.filter_value == null ? [] : req.query.filter_value.split(';');\n var filters_types = req.query.filter_type == null ? [] : req.query.filter_type.split(';');\n\n // Error if filters parameters doesn't match size.\n if(filters_fields.length != filters_types.length || filters_types.length != filters_values.length)\n errors.push(\"filtering parameters' size mismatch\");\n\n else{\n // Filtering options.\n var allow_filters = [\n {field: 'name', type: 'contains', value: 'string'},\n {field: 'active', type: 'equal', value: 'boolean', admin: true}\n ];\n\n // Check if filter paramenters are valid.\n for(var i = 0, len_params = filters_types.length; i < len_params; i++){\n var inArray = false;\n\n var filter_param = {\n field: filters_fields[i].trim().toLowerCase(),\n value: filters_values[i].trim(),\n type: filters_types[i].trim().toLowerCase()\n }\n\n for(var j = 0, len_allow = allow_filters.length; j < len_allow; j++){\n var allow_filter = allow_filters[j];\n if(filter_param.field == allow_filter.field && filter_param.type == allow_filter.type){\n inArray = true;\n j = len_allow;\n\n // Check if filter is only for admins.\n if(allow_filter.admin != null && req.auth.role != \"admin\") errors.push(\"You are not allow to use filter '\" + filter_param.field + \" \" + filter_param.type + \"'\");\n\n // Check boolean value.\n if(allow_filter.value == \"boolean\"){\n var value = filter_param.value.toLowerCase();\n\n if(value != \"true\" && value != \"false\") errors.push(\"Invalid filter value for '\" + filter_param.field + \" \"+ filter_param.type + \"': must be true or false.\");\n else{\n filter_param.value = value == \"true\" ? true : false;\n }\n }\n }\n }\n\n // If not valid, error.\n if(!inArray) errors.push(\"Invalid filter: '\" + filter_param.field + \" \"+ filter_param.type + \"'\");\n\n // Else, put it on the filters_params.\n else filters_params.push(filter_param);\n }\n }\n\n // Field selection.\n var field_selection = [];\n\n // Include\n var includes = req.query.include == null ? [] : req.query.include.split(\";\");\n\n var allow_includes = [\n {field: \"stock\", admin: true}\n ];\n\n // Check if include paramenters are valid.\n for(var i = 0, len_params = includes.length; i < len_params; i++){\n var inArray = false;\n var include = includes[i];\n\n for(var j = 0, len_allow = allow_includes.length; j < len_allow; j++){\n var allow_include = allow_includes[j];\n if(include == allow_include.field){\n inArray = true;\n j = len_allow;\n\n // Check if include is only for admins.\n if(allow_include.admin != null && req.auth.role != \"admin\") errors.push(\"You are not allow to use include '\" + include + \"'\");\n }\n }\n\n // If not valid, error.\n if(!inArray) errors.push(\"Invalid include: '\" + include + \"'\");\n else field_selection.push({field: include, type: 'include'});\n }\n\n // Exclude\n var excludes = req.query.exclude == null ? [] : req.query.exclude.split(\";\");\n\n var allow_excludes = [\n {field: \"popularity\"}\n ];\n\n // Check if exclude paramenters are valid.\n for(var i = 0, len_params = excludes.length; i < len_params; i++){\n var inArray = false;\n var exclude = excludes[i];\n\n for(var j = 0, len_allow = allow_excludes.length; j < len_allow; j++){\n var allow_exclude = allow_excludes[j];\n if(exclude == allow_exclude.field){\n inArray = true;\n j = len_allow;\n\n // Check if exclude is only for admins.\n if(allow_exclude.admin != null && req.auth.role != \"admin\") errors.push(\"You are not allow to use exclude '\" + exclude + \"'\");\n }\n }\n\n // If not valid, error.\n if(!inArray) errors.push(\"Invalid exclude: '\" + exclude + \"'\");\n else field_selection.push({field: exclude, type: 'exclude'});\n }\n\n // Sorting\n var sorting_params = [];\n var sort_fields = req.query.sort == null ? [] : req.query.sort.split(';');\n var sort_order = req.query.sort_order == null ? [] : req.query.sort_order.split(';');\n\n // Error if sorts parameters doesn't match size.\n if(sort_fields.length != sort_order.length)\n errors.push(\"sorting parameters' size mismatch\");\n\n else{\n // Sorting options.\n var allow_sorts = [\n {by: 'name', order: 'ASC'},\n {by: 'name', order: 'DESC'},\n {by: 'popularity', order: 'ASC'},\n {by: 'popularity', order: 'DESC'}\n ];\n\n // Check if sort paramenters are valid.\n for(var i = 0, len_params = sort_fields.length; i < len_params; i++){\n var inArray = false;\n\n var sort_param = {\n by: sort_fields[i].trim().toLowerCase(),\n order: sort_order[i].trim().toUpperCase()\n }\n\n for(var j = 0, len_allow = allow_sorts.length; j < len_allow; j++){\n var allow_sort = allow_sorts[j];\n if(sort_param.by == allow_sort.by && sort_param.order == allow_sort.order){\n inArray = true;\n j = len_allow;\n }\n }\n\n // If not valid, error.\n if(!inArray) errors.push(\"Invalid sort: '\" + sort_param.by + \" \"+ sort_param.order + \"'\");\n\n // Else, put it on the sorting_params.\n else sorting_params.push(sort_param);\n }\n }\n\n if(errors.length > 0) next({status: 400, errors: errors});\n // End of params validation.\n\n\n else{\n var pages;\n\n // Filtering.\n var filters = {};\n\n // Only active products.\n filters[\"active\"] = true;\n\n // Add filters of the filtets_params array.\n for(var i = 0, len = filters_params.length; i < len; i++){\n var filter = filters_params[i];\n\n if(filter.type == 'contains') filters[filter.field] = new RegExp(filter.value, 'i');\n if(filter.type == \"equal\") filters[filter.field] = filter.value;\n }\n\n\n // Count all documents that match.\n Product.countDocuments(filters).then(function(count){\n\n // Get page size.\n pages = Math.ceil(count / page_size);\n\n // If no product, pages = 1.\n if(pages == 0) pages = 1;\n\n // Validate page value.\n if(page > pages) return Promise.reject({name: 'InvalidPage'});\n\n\n // Get the products.\n else{\n var default_fields = [\"name\", \"description\", \"price\", \"popularity\"];\n\n for(var i = 0, len = field_selection.length; i < len; i++){\n if(field_selection[i].type == \"include\") default_fields.push(field_selection[i].field);\n else default_fields = default_fields.filter(function(_field){ return _field != this}, field_selection[i].field)\n }\n\n // Field selection.\n var fields = {};\n\n for(var i = 0, len = default_fields.length; i < len; i++){\n fields[default_fields[i]] = 1\n }\n\n // Pagination.\n var options = {\n sort: {},\n skip: (page - 1) * page_size,\n limit: page_size\n }\n\n for(var i = 0, len = sorting_params.length; i < len; i++){\n options.sort[sorting_params[i].by] = sorting_params[i].order == \"ASC\" ? 1 : -1;\n }\n\n if(options.sort.name != -1) options.sort.name = 1;\n\n return Product.find(filters, fields, options);\n }\n }).then(function(products){\n\n // Success response.\n var options = [];\n\n // Sorting\n if(sorting_params.length > 0){\n var sort = [], sort_order = [];\n\n for(var i = 0, len = sorting_params.length; i < len; i++){\n var sorting_param = sorting_params[i];\n sort.push(sorting_param.by);\n sort_order.push(sorting_param.order);\n }\n\n options.push(\"sort=\" + sort.join(\";\"));\n options.push(\"sort_order=\" + sort_order.join(\";\"));\n }\n\n // Filtering\n if(filters_params.length > 0){\n var filter = [], filter_value = [], filter_type = [];\n\n for(var i = 0, len = filters_params.length; i < len; i++){\n var filter_param = filters_params[i];\n filter.push(filter_param.field);\n filter_value.push(filter_param.value);\n filter_type.push(filter_param.type);\n }\n\n options.push(\"filter=\" + filter.join(\";\"));\n options.push(\"filter_value=\" + filter_value.join(\";\"));\n options.push(\"filter_type=\" + filter_type.join(\";\"));\n }\n\n // Field selection\n var includes = [], excludes = [];\n\n for(var i = 0, len = field_selection.length; i < len; i++){\n if(field_selection[i].type == \"include\") includes.push(field_selection[i].field);\n else excludes.push(field_selection[i].field);\n }\n\n if(includes.length > 0) options.push(\"include=\" + includes.join(\";\"));\n if(excludes.length > 0) options.push(\"exclude=\" + excludes.join(\";\"));\n\n var next_page = \"\";\n\n if(page < pages){\n next_page = \"/api/v1/products?page=\" + (page + 1);\n if(page_size != PAGE_SIZE_DEFAULT) next_page += '&page_size=' + page_size;\n if(options.length > 0) next_page += \"&\" + options.join(\"&\");\n }\n\n var previous_page = \"\";\n\n if(page > 1){\n previous_page = \"/api/v1/products?page=\" + (page - 1);\n if(page_size != PAGE_SIZE_DEFAULT) previous_page += '&page_size=' + page_size;\n if(options.length > 0) previous_page += \"&\" + options.join(\"&\");\n }\n\n\n res.status(200).json({\n request: req.object,\n pagination: {\n current: page,\n pages: pages,\n size: page_size,\n next: next_page,\n previous_page: previous_page\n },\n sorting: sorting_params,\n filters: filters_params,\n select: field_selection,\n data_size: products.length,\n data: products\n });\n\n // Catch errors.\n }).catch(function(error){\n if(error.name == 'InvalidPage') next({status:422, errors: [\"page not found\"]});\n else next({status: 500});\n });\n }\n}", "function getpagedPagedReceipts(filter) {\n //initiallize receiptfilter if it is not defined\n if ($scope.receiptFilter == undefined) {\n $scope.receiptFilter = {};\n angular.extend($scope.receiptFilter, ReceiptFilterModel);\n }\n //contruct params of not null fields\n var params;\n (filter == undefined) ? params = constructFilter($scope.receiptFilter) : params = constructFilter(filter);\n $scope.busyloading = true;\n //filter model on receipts over Recource POST attribute\n var f = { Page: params.Page, PageSize: params.PageSize, filt: JSON.stringify(params) }\n $q.all({\n receiptP: $scope.RestPromice.getReceipts(f)\n }).then(function (d) {\n var result = d.receiptP;\n if (result.data != null) {\n $scope.paging.total = result.data.PageCount;\n //var cp = (result.data.CurrentPage == 0) ? 1 : result.data.CurrentPage;\n var cp = result.data.CurrentPage;\n $scope.paging.current = cp; $scope.currentPage = cp;\n $scope.loadedReceipts = result.data.Results;\n }\n if (result.data.length < 1 || result.data == null) { tosterFactory.showCustomToast('No Results found', 'info'); }\n }).finally(function () { //finally(callback, notifyCallback)\n $scope.busyloading = false;\n });\n }", "function filterAppController($scope,$filter,nameFilter){\n $scope.itens = \"\";\n $scope.result = \"\";\n $scope.result_html = \"\";\n \n $scope.checkIfTooMuch = function (){\n \n $scope.result_html = filterFactory()($scope.itens,\"valor\");//\"Please enter data first\";\n $scope.result = $filter('uppercase')($scope.result_html);\n \n }\n}", "function figureOutItemsToDisplay() {\n vm.filteredItems = $filter('filter')(vm.images, {\n $: vm.search\n });\n vm.filterLength = vm.filteredItems.length;\n var begin = ((vm.currentPage - 1) * vm.itemsPerPage);\n var end = begin + vm.itemsPerPage;\n vm.pagedItems = vm.filteredItems.slice(begin, end);\n }", "function getPage(start, number, params) {\n\n var result;\n var totalRows;\n\n getRandomsItems(function cb(randomsItems) {\n var filtered = params.search.predicateObject ? $filter('customFilter')(randomsItems, params.search.predicateObject) : randomsItems;\n console.log(\"Filtro:\" + JSON.stringify(params.search.predicateObject));\n\n if (params.sort.predicate) {\n filtered = $filter('orderBy')(filtered, params.sort.predicate, params.sort.reverse);\n }\n\n result = filtered.slice(start, start + number);\n totalRows = randomsItems.length;\n\n /*console.log(\"Result : \" + JSON.stringify(result));\n console.log(\"Total Rows : \" + JSON.stringify(totalRows));*/\n });\n\n\n var deferred = $q.defer();\n\n $timeout(function () {\n\n deferred.resolve({\n data: result,\n numberOfPages: Math.ceil(totalRows / number)\n });\n\n }, 1500);\n\n return deferred.promise;\n\n }", "list(filters = null, pageNumber = null, pageSize = null) {\n return super.list(filters, pageNumber, pageSize);\n }", "function getPage(filter){\nconsole.log('inside getPage');\n return function(page, model) {\n model.subscribe('todos', function () {\n\tif(filter =='active')\n\t{\n\tmodel.set('_page.newTodo', 'rajesh active');\n\t\tconsole.log('inside regtpage to render');\n\t\t}\n page.render();\n });\n }\n}", "getProducts() {\n this.productService.getProducts({ page: 1, perPage: 5, filter: '' }).subscribe(products => {\n this.products = products.docs;\n this.docsTotal = products.total;\n }, err => {\n console.log(err);\n });\n }", "function getPage(params) {\n var start = params.pagination.start || 0;\n var number = params.pagination.number || 10;\n var deferred = $q.defer();\n\n var filtered = params.search.predicateObject ? $filter('filter')(randomsItems, params.search.predicateObject) : randomsItems;\n\n if (params.sort.predicate) {\n filtered = $filter('orderBy')(filtered, params.sort.predicate, params.sort.reverse);\n }\n\n var result = filtered.slice(start, start + number);\n\n $timeout(function () {\n //note, the server passes the information about the data set size\n deferred.resolve({\n data: result,\n count: filtered.length,\n numberOfPages: Math.ceil(filtered.length / number)\n });\n }, 100);\n\n\n return deferred.promise;\n }", "function paginationResults(model,filter){\r\n return async (req, res, next) => {\r\n \r\n const page = parseInt(req.query.page)\r\n const limit = parseInt(req.query.limit)\r\n \r\n const startIndex = (page - 1) * limit;\r\n const endIndex = page * limit;\r\n \r\n const results = {}\r\n \r\n \r\n if (endIndex < await model.countDocuments().exec()){\r\n results.next = {\r\n page: page + 1,\r\n limit: limit\r\n }\r\n }\r\n \r\n if (startIndex > 0){\r\n results.previous = {\r\n page: page - 1,\r\n limit: limit\r\n }\r\n }\r\n \r\n if (filter==\"newIn\"){\r\n \r\n try{\r\n results.results = await model.find().limit(limit).skip(startIndex).exec()\r\n res.paginationResults = results;\r\n next();\r\n } catch(err){\r\n res.status(500).json({message : err})\r\n }\r\n\r\n } else if(filter==\"highLow\"){\r\n\r\n try{\r\n results.results = await model.find().sort({\"price\" : -1}).limit(limit).skip(startIndex).exec()\r\n res.paginationResults = results;\r\n next();\r\n } catch(err){\r\n res.status(500).json({message : err})\r\n }\r\n\r\n } else if(filter==\"lowHigh\"){\r\n\r\n try{\r\n results.results = await model.find().sort({\"price\" : 1}).limit(limit).skip(startIndex).exec()\r\n res.paginationResults = results;\r\n next();\r\n } catch(err){\r\n res.status(500).json({message : err})\r\n }\r\n\r\n }\r\n\r\n \r\n }\r\n}", "function search(page) {\n\n page = page || 0;\n $scope.loadingProduct = true;\n var config = {\n params: {\n page: page,\n pageSize: 6,\n filter: $scope.filterMovies\n }\n };\n debugger\n apiService.get('/api/Product/getallproduct', config,\n productLoadCompleted,\n productLoadFailed);\n debugger\n apiService.get('/api/ProductCategoryMaster/GetAllProductCategoryMaster', config,\n ProductCategoryLoadCompleted,\n ProductCategoryLoadFailed);\n }", "function initCommonFilters() {\n Main.appModule\n .filter('zeroAsEmpty', [zeroAsEmpty])\n .filter('dateAsString', [dateAsStringFilter])\n .filter('longText', [longTextFilter]);\n }", "getProducts() {\n this.productService.getProducts({ page: 1, perPage: 10, filter: '' }).subscribe(products => {\n this.products = products.docs;\n }, err => {\n console.log(err);\n });\n }", "function query_api(data){\n return $http.get('/api/base/search/', {params: data || {}}).success(function(data){\n $scope.results = $scope.display = data.objects;\n });\n }", "[consts.SET_FILTERED_CATEGORY_PAGE_NUM](state, pgNum) {\n state.activePgNumFiltered = pgNum;\n }", "function filterBySearchText(data,query) {\t\t\t\t\t\n\t\t\t\t\t\t\t\t\treturn $filter('filter')(data, query,false);\n\t\t\t\t\t\t}", "function applyFilter() {\n return { params: { filter: { tags: ['Menu'] } } };\n}", "function pagfun() {\n if ($scope.currentPage != $scope.paging.current) {\n $scope.currentPage = $scope.paging.current;\n $scope.receiptFilter.Page = $scope.currentPage;\n getpagedPagedReceipts();\n }\n }", "function list(start, number, params,filter) {\n var deferred = $q.defer();\n\n if(!params.search.predicateObject){\n params.search.predicateObject = {};\n params.search.predicateObject.start = start;\n params.search.predicateObject.number = number;\n filter.start = params.search.predicateObject.start;\n filter.number = params.search.predicateObject.number;\n }else{\n params.search.predicateObject.start = start;\n params.search.predicateObject.number = number;\n filter.start = params.search.predicateObject.start;\n filter.number = params.search.predicateObject.number;\n }\n $http.post(config.endpoints.sos.InvitationDetail+'/list',filter).success(function(response, status, headers, config) {\n deferred.resolve({\n data: response.data.list,\n numberOfPages: response.data.pages\n });\n }).error(function(response, status, headers, config) {\n console.log('Failed to get InvitationDetail : ' + JSON.stringify(response));\n deferred.reject(response.error);\n }\n );\n return deferred.promise;\n }", "filter() {\n //remove fields for pagination, sroting and limiting in req.query, which go in the options\n //object for mongo query, not the filter object\n //if dont remove then mongo will look for properties with this name\n const queryObj = { ...this.queryObj }; //create copy do remove from this.queryObj which other methods sue\n const exludedFields = ['sort', 'page', 'limit', 'fields'];\n exludedFields.forEach((el) => delete queryObj[el]);\n //convert to JSON string so can use regex to add mongo operators to query string\n let queryStr = JSON.stringify(queryObj);\n queryStr = queryStr.replace(\n /\\b(gte|lte|lt|gt)\\b/g,\n (match) => `$${match}`\n );\n\n //replace previous query object\n this.query = this.query.find(JSON.parse(queryStr));\n return this;\n }", "fetchAlldonateUser(limit = _const_api_constant__WEBPACK_IMPORTED_MODULE_3__[\"API_CONFIG\"].pageSize, page = 1, where) {\n const skip = (page - 1) * limit;\n let filter = {\n limit,\n skip,\n where,\n };\n let httpParams = new _angular_common_http__WEBPACK_IMPORTED_MODULE_1__[\"HttpParams\"]();\n httpParams = httpParams.append('filter', JSON.stringify(filter));\n return this._http.get(this.baseUrl + _const_api_constant__WEBPACK_IMPORTED_MODULE_3__[\"API_ENDPOINT\"].donate.fetchAll, {\n params: httpParams\n });\n }", "function filter() {\n \n}", "makePipelinePagaing(req) {\n if ((req.query.page || req.query.perPage) && !req.query.full) {\n const { skip, limit } = this.getPaging(req);\n return [\n {\n $skip: skip,\n },\n {\n $limit: limit,\n }\n ];\n }\n return [];\n }", "initPagination(){\n this.getPagination().initPagination();\n }", "filterList(queryString) {\n this.doFilter(queryString);\n }", "filterList(queryString) {\n this.doFilter(queryString);\n }", "async paginate(per_page = null, page = null) {\r\n if (!_.isNil(per_page)) {\r\n per_page = parseInt(per_page);\r\n } else {\r\n if (Request.has('per_page')) {\r\n per_page = parseInt(Request.get('per_page'));\r\n } else {\r\n per_page = 20;\r\n }\r\n }\r\n if (!_.isNil(page)) {\r\n page = parseInt(page);\r\n } else {\r\n if (Request.has('page')) {\r\n page = parseInt(Request.get('page'));\r\n } else {\r\n page = 1;\r\n }\r\n }\r\n let params = {\r\n offset: (page - 1) * per_page,\r\n limit: per_page,\r\n where: this.getWheres(),\r\n include: this.getIncludes(),\r\n order: this.getOrders(),\r\n distinct: true\r\n };\r\n\r\n if (!_.isArray(this.getAttributes()) && this.getAttributes().length > 0) {\r\n params = _.assign(params, { attributes: this.getAttributes() });\r\n }\r\n let model = this.Models();\r\n if (this.getScopes().length > 0) {\r\n _.forEach(this.getScopes(), scope => {\r\n model = model.scope(scope);\r\n });\r\n }\r\n const result = await model.findAndCountAll(params);\r\n\r\n const paginator = new LengthAwarePaginator(result.rows, result.count, per_page, page);\r\n return paginator;\r\n }", "get filterCollection() {\n return this.searchFilter.getAttribute(\"collection\");\n }", "function launchFilter() {\n component.filterChanged = true;\n component.visibleRows = grid.api.core.getVisibleRows().length;\n if (isFiltering()) {\n if (!component.wasFiltering) {\n component.defaultPageSize = component.scope.gridOptions.paginationPageSize;\n component.previousPage = component.model.page;\n component.wasFiltering = true;\n component.scope.gridOptions.paginationPageSize = component.model.values.length;\n component.model.page = 1;\n }\n } else {\n component.wasFiltering = false;\n component.scope.gridOptions.paginationPageSize = component.defaultPageSize;\n component.model.page = component.previousPage;\n }\n }", "initFilterEndpoint() {\n this.router.get('/search', (req, res) => {\n if (!req.query || !req.query.filter) return res.status(200).send([]);\n // TODO parse filter\n return this.getDAO().getByCriteria(req.query.filter, { user: req.user })\n .then(result => res.status(200).send(result)).catch(err => {\n debug('[search]', err.message);\n return this.sendErr(res, 400, err.message);\n });\n });\n }", "payees(filter, limit) {\n\t\treturn this.payeeModel.all().then(payees => this.limitToFilter(this.filterFilter(payees, {name: filter}), limit));\n\t}", "function getAllHotelFaciltiesByPanigation(pagination)\n {\n WidgetsServices.getAllHotelFacilties(pagination).success(function(res){\n if(res.data.length > 0)\n {\n $scope.hotel_facilties = res.data;\n if(res.prev_page_url != null ){ $scope.prev_page_url = res.prev_page_url }\n if(res.next_page_url != null ){ $scope.next_page_url = res.next_page_url }\n $scope.last_page = res.last_page;\n $scope.current_page = res.current_page;\n $scope.total = Math.ceil(res.total / limit );\n console.clear();\n }\n })\n }", "function PaginatedTableController($scope) {\n 'use strict';\n\n // Inheriting controllers must define:\n // $scope.columns = [ /* ...varies... */ ];\n\n // Inheriting controllers may define:\n // $scope.additionalSearchRules(), takes and returns a (potentially\n // modified) searchList.\n // $scope.pageSize, default is 50.\n\n // Inheriting controllers must call:\n // $scope.initializeTable(), providing an array of entities to display\n // in the table. Entities must have a UIMixin applied first.\n // $scope.createSearchData(), if data relevant to search, but not part of\n // the row entities themselves, changes.\n\n // Inheriting controllers may call:\n // $scope.turnOffSelection() to kill all watchers related to selection.\n\n $scope.pageSize = 50;\n $scope.pageIndex = 0; // current page displayed\n $scope.emptyTableMessage = \"Loading...\";\n\n $scope.fullList = [];\n $scope.searchList = []; // search-matched subset of the full list\n $scope.selectedList = []; // those whose checkbox is checked\n $scope.pageList = []; // the things actually shown in the UI\n $scope.reverseSort = undefined; // will be boolean if user sorts\n $scope.sortedColumn = undefined; // will be int (index of columns array)\n\n // Scan through the fullList and keep only those matching the search text.\n // Searching doesn't look at objects directly; see $createSearchData().\n var search = function(searchText) {\n console.debug(\"search()\", searchText);\n if (!searchText) {\n $scope.searchList = $scope.fullList;\n } else {\n $scope.searchList = forEach($scope.fullList, function (entity) {\n if (entity._searchText.contains(searchText.toLowerCase())) {\n console.debug(\"...found in\", entity._searchText.replace(/\\s/g, ' '));\n return entity;\n }\n else { console.debug(\"...not found\"); }\n });\n }\n\n // Allow the specific controller to do additional filtering of the\n // matching entities, e.g. for makeups.\n if (typeof $scope.additionalSearchRules === 'function') {\n $scope.searchList = $scope.additionalSearchRules($scope.searchList);\n }\n\n // Re-calculate what goes on this page based on the new search results.\n $scope.setPage(0);\n };\n // Obviously, run search any time the search text changes.\n $scope.$watch('searchText', search);\n // It's also critical to re-run search any time the $scope.fullList\n // changes, so that changes propagate to searchList, which sets the page,\n // and thus propagates to pageList, which actually drives the UI.\n $scope.$watch('fullList', function () {\n console.debug(\"$watch fullList\");\n search($scope.searchText);\n });\n\n $scope.initializeTable = function (entityList) {\n console.debug(\"initializeTable()\");\n $scope.searchList = $scope.fullList = entityList;\n $scope.createSearchData();\n search();\n // Now that loading is done, if the ng-repeat in the table markup\n // has nothing to display, it will show this message.\n $scope.emptyTableMessage = 'Nothing to show';\n };\n\n $scope.createSearchData = function () {\n forEach($scope.fullList, function (e) { e.createSearchData(); });\n };\n\n $scope.setPage = function (pageIndex) {\n console.debug(\"setPage()\", pageIndex, \"current index:\", $scope.pageIndex);\n if (pageIndex < 0) { pageIndex = 0; }\n // Use floor not ceil because pageIndex counts from zero.\n var lastPageIndex = Math.floor($scope.searchList.length / $scope.pageSize);\n if (pageIndex === 'last' || pageIndex > lastPageIndex) {\n pageIndex = lastPageIndex;\n }\n $scope.pageIndex = pageIndex;\n $scope.pageList = $scope.searchList.slice(\n pageIndex * $scope.pageSize, (pageIndex + 1) * $scope.pageSize);\n console.debug(\"new index:\", $scope.pageIndex, \"slicing at:\", pageIndex * $scope.pageSize, (pageIndex + 1) * $scope.pageSize);\n };\n // I don't think I need this b/c I explicitly call setPage() in every case\n // $scope.$watch('pageIndex', $scope.setPage);\n\n $scope.pageRange = function () {\n return range(Math.ceil($scope.searchList.length / $scope.pageSize));\n };\n\n $scope.sortBy = function (colIndex) {\n var column = $scope.columns[colIndex];\n\n // Only provide sorting on columns marked sortable.\n if (!column.sortable) { return; }\n\n if ($scope.reverseSort === undefined) {\n $scope.reverseSort = false;\n }\n if ($scope.sortedColumn === colIndex) {\n $scope.reverseSort = !$scope.reverseSort;\n }\n\n // If things are being slow, we might not have cached the search data\n // by the time someone searches/sorts. Allow for its absence w/o error.\n if (\n $scope.fullList.length === 0 ||\n $scope.fullList[0]._searchObject === undefined\n ) { return; }\n\n // The stability of javascript sorting is implementation-depedendent.\n // http://blog.8thlight.com/will-warner/2013/03/26/stable-sorting-in-ruby.html\n // http://stackoverflow.com/questions/3026281/array-sort-sorting-stability-in-different-browsers\n // We can ensure stable sorting by sorting otherwise-equal elements\n // by their original position in the list. So determine those original\n // positions here.\n forEach($scope.fullList, function (entity, position) {\n entity._originalPosition = position;\n });\n var sortFunc = function (a, b) {\n var A = a._searchObject[column.colClass];\n var B = b._searchObject[column.colClass];\n\n if (isStringNumeric(A, 'strict') && isStringNumeric(B, 'strict')) {\n // Are A and B numeric? If so, compare them as numbers, b/c\n // '10' > '100', but 100 > 10.\n A = +A;\n B = +B;\n } else if (typeof A === 'string') {\n // Otherwise compare them as strings in lower case.\n A = A.toLowerCase();\n B = B.toLowerCase();\n } else {\n // Anything that isn't a number or a string should be treated\n // like an empty string (e.g. NaN, null, undefined).\n A = B = '';\n }\n\n var direction = $scope.reverseSort ? -1 : 1;\n if (A < B) { return direction * -1; }\n if (A > B) { return direction; }\n\n // These elements appear equal. To ensure stable sorting, sort by\n // their original position before the sort started.\n return (a._originalPosition - b._originalPosition) * direction;\n };\n // Watchers on $scope.fullList will spread the news of this sorting change\n // to $scope.searchList and pageList.\n $scope.fullList.sort(sortFunc);\n\n // Force an alteration to the reference to make the UI respond via a\n // $watch.\n $scope.fullList = $scope.fullList.slice(0);\n\n $scope.sortedColumn = colIndex;\n };\n\n $scope.trackSelection = function (event, entityId, isSelected) {\n if (\n isSelected === true &&\n !arrayContains($scope.selectedList, entityId)\n ) {\n $scope.selectedList.push(entityId);\n } else if (isSelected === false) {\n arrayRemove($scope.selectedList, entityId);\n }\n };\n // Listen to rows whose checkboxes change and track them.\n var selectionChangeOff = $scope.$on(\n '/row/selectionChange', $scope.trackSelection);\n\n $scope.toggleSelectAll = function (checked) {\n $scope.$broadcast('/table/toggleSelectAll', checked);\n };\n\n $scope.turnOffSelection = function () {\n selectionChangeOff();\n };\n}", "function getPackList(start, number,params, filter) {\n var deferred = $q.defer();\n if(!params.search){\n params.search = {};\n }\n if(!params.search.predicateObject){\n params.search.predicateObject = {};\n params.search.predicateObject.pageNum = start/number+1;\n params.search.predicateObject.pageSize = number;\n }else{\n params.search.predicateObject.pageNum = start/number+1;\n params.search.predicateObject.pageSize = number;\n }\n filter.pageNum = params.search.predicateObject.pageNum;\n filter.pageSize = params.search.predicateObject.pageSize;\n $http.post(config.endpoints.personalCenter.personalCenter+'/getPackList',filter).success(function(response, status, headers, config) {\n deferred.resolve({\n data: response.data.list,\n numberOfPages: response.data.pages\n });\n }).error(function(response, status, headers, config) {\n deferred.reject(response.error);\n }\n );\n return deferred.promise;\n }", "function onChange(pagination, filters, sorter, extra) {\n console.log('params', pagination, filters, sorter, extra);\n }", "applyFindFilters(filters) { throw 'Not Implemented' }", "function _Filter(gridPanel, getFilter) {\n var store = gridPanel.getStore();\n store.filterBy(getFilter);\n store.applyPaging();\n}", "function getAllGalleryByPanigation(pagination)\n {\n WidgetsServices.getAllGallery(pagination).success(function(res){\n if(res.data.length > 0)\n {\n $scope.gallerys = res.data;\n if(res.prev_page_url != null ){ $scope.prev_page_url = res.prev_page_url }\n if(res.next_page_url != null ){ $scope.next_page_url = res.next_page_url }\n $scope.last_page = res.last_page;\n $scope.current_page = res.current_page;\n $scope.total = Math.ceil(res.total / limit );\n }\n });\n }", "function onApplyFilters() {\n $rootScope.$broadcast('search-input_refresh-search');\n\n $timeout(paginateFunctions);\n }", "function getFilteredCars(){\n Data.get('getCarsFiltered?'+$scope.filterText).then(function (results) {\n\n if(results.status == 200){\n //if the results has more thn one car\n $scope.cars = results.value;\n $scope.no_car = false;\n }else{\n //Create a few to show no cars available for applied filters\n $scope.cars =[];\n $scope.no_car = true;\n $scope.$apply;\n\n }\n $scope.loading = false;\n $scope.$apply;\n\n });\n }", "list_filter(req, res) {\n return businesses\n .findAll({\n where: {\n status: req.params.status,\n },\n offset: req.params.offset,\n limit: req.params.limit,\n })\n\n .then((result) => res.status(201).send(result))\n .catch((error) => res.status(400).send(error))\n\n }", "function applyFilters(queryString) {\n let url = location.origin + location.pathname;\n url = queryString ? url + \"?\" + queryString : url;\n window.history.pushState(\"filtered users\", \"کاربران فیلتر شده\", url);\n $.get(window.location.origin+window.location.pathname+\"/json?\" + queryString, function(res, status) {\n if (status) {\n showTranslators(res.translators);\n showUsers(res.customers);\n showPagination(parseInt(res.translators_count),parseInt(res.translator_current_page),10,window.location.origin+window.location.pathname, window.location.search,3,\".translator-pagination\",\"t_\");\n showPagination(parseInt(res.customerss_count),parseInt(res.customer_current_page),10,window.location.origin+window.location.pathname, window.location.search,3,\".customer-pagination\",\"c_\");\n }\n });\n}", "setFilter(filter) {\n\t\tthis.fetchExternalData(\n\t\t\t\tfilter, \n\t\t\t\tthis.state.currentPage, \n\t\t\t\tthis.state.externalResultsPerPage,\n\t\t\t\tthis.state.externalSortColumn,\n\t\t\t\tthis.state.externalSortAscending);\n }", "fetchAllUrls(limit = _const_api_constant__WEBPACK_IMPORTED_MODULE_3__[\"API_CONFIG\"].pageSize, page = 1, where) {\n const skip = (page - 1) * limit;\n let filter = {\n limit,\n skip,\n where,\n };\n let httpParams = new _angular_common_http__WEBPACK_IMPORTED_MODULE_1__[\"HttpParams\"]();\n httpParams = httpParams.append('filter', JSON.stringify(filter));\n return this._http.get(this.baseUrl + _const_api_constant__WEBPACK_IMPORTED_MODULE_3__[\"API_ENDPOINT\"].url.fetchAll, {\n params: httpParams\n });\n }", "function filter($rootScope, $http, $timeout, $location, $compile, $cookieStore, gridService) {\n return {\n restrict: 'AE',\n require: 'ngModel',\n transclude: true,\n \n link: function (scope, element, attrs, ngModel) {\n \telement.bind(\"keydown\", function(event) {\n\t\t\tvar that = this;\n \t\tvar model = attrs.ngModel;\n\n\t\t\t//keydown hint\n\t\t\telement.next().css('display', 'block');\n\n\t\t\tif(event.keyCode === 229){\n\t\t\t\treturn;\n\t\t\t}\n\n \t\tif(event.which === 38){\n \t\t\tkeyUpOrDown(element, element.next(), 'up');\n \t\treturn;\n \t}\n\n \t\tif(event.which === 40){\n \t\t\tkeyUpOrDown(element, element.next(), 'down');\n \t\treturn;\n \t}\n\n\n if(event.which === 13) { \n scope.$apply(function(){\n \t\n \tvar value = element.val();\n if(value == undefined || value == null || value =='') return;\n\n\t\t\t\t\t// full search\n \tif(model == 'full'){\n \t\tmodel = 'name';\n \t\t\n \t\tif(value.indexOf('in investor')>0){\n \t\t\tmodel = 'investor';\n \t\t\tvalue = value.slice(0, value.length-13);\n \t\t}else if(value.indexOf('in keyword')>0){\n \t\t\tmodel = 'keyword';\n \t\t\tvalue = value.slice(0, value.length-12);\n \t\t}\n \t\t\n \t\tdoSearch($rootScope, scope, $http, $location, $cookieStore, gridService, value, model);\n \t\telement.next().css('display', 'none');\n\t\t\t\t\t\telement.next().children().removeClass('result-select');\n \t\treturn;\n \t}\n\n\n \t\n var bool =parseAndStorage(model, value, $cookieStore);\n \n if(model == 'keyword') scope.keyword = ''\n if(model == 'location') scope.location = '';\n if(model == 'investor') scope.investor = '';\n if(model == 'name') scope.name = '';\n \n if(bool)\n \treturn;\n \telse{\n \t\tvar el = $compile(appendElement(model, value))(scope);\n \t\telement.parent().children('span').first().append(el);\n \t}\n \n element.next().css('display', 'none');\n\t\t\t\t\telement.next().children().removeClass('result-select');\n\n if(!$('#div-'+model).is(\":visible\"))\n \t$('#div-'+model).css('display', 'inline-block');\n \n \n if(model == 'keyword'){\n\t // add relation tags\n\t \t$http.get('./api/tag/rel/get?name='+value).success(function(data){\n\t \t\tif(data.tags.length > 0){\n\t \t\t\t$rootScope.relItems = data.tags;\n\t \t\t\t$('.tag-rel').show();\n\t \t\t}else{\n\t \t\t\t$('.tag-rel').hide();\n\t \t\t}\n\t \t\t\n\t \t})\n }\n \n \n }); \n event.preventDefault();\n\n }\n \n });\n\n\t\t\telement.bind(\"keyup\", function(event) {\n\n\t\t\t\tvar keys = {\n\t\t\t\t\tESC: 27,\n\t\t\t\t\tTAB: 9,\n\t\t\t\t\tRETURN: 13,\n\t\t\t\t\tLEFT: 37,\n\t\t\t\t\tUP: 38,\n\t\t\t\t\tRIGHT: 39,\n\t\t\t\t\tDOWN: 40\n\t\t\t\t};\n\n\t\t\t\tif(event.keyCode === keys.LEFT || event.keyCode === keys.RIGHT\n\t\t\t\t\t|| event.keyCode === keys.DOWN || event.keyCode === keys.UP)\n\t\t\t\t\treturn;\n\n\t\t\t\tvar value = element.val();\n\t\t\t\tif(value == '' || value ==null) return;\n\n\t\t\t\tvar model = attrs.ngModel;\n\n\t\t\t\tvar url = '/api/search/'+model;\n\t\t\t\tvar req = {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\turl: url,\n\t\t\t\t\tdata: value\n\t\t\t\t}\n\n\t\t\t\t$http(req)\n\t\t\t\t\t.success(function(data) {\n\t\t\t\t\t\tscope.ajaxKeywordItems = data.tags;\n\t\t\t\t\t\tscope.ajaxInvestorItems = data.investors;\n\t\t\t\t\t\tscope.ajaxLocationItems = data.locations;\n\t\t\t\t\t\tscope.ajaxNameItems =data.names;\n\n\t\t\t\t\t\tif( model == 'full'){\n\t\t\t\t\t\t\tvar full = {};\n\t\t\t\t\t\t\tvar tags = [];\n\t\t\t\t\t\t\tvar investors = [];\n\t\t\t\t\t\t\tif(data.tags.length > 0)\n\t\t\t\t\t\t\t\ttags.push(data.tags[0]);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\ttags = null;\n\n\t\t\t\t\t\t\tif(data.investors.length > 0)\n\t\t\t\t\t\t\t\tinvestors.push(data.investors[0])\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tinvestors = null;\n\n\t\t\t\t\t\t\tfull.tags = tags;\n\t\t\t\t\t\t\tfull.investors = investors;\n\t\t\t\t\t\t\tfull.names = data.names;\n\n\t\t\t\t\t\t\tscope.ajaxFullItems = full;\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t})\n\t\t\t});\n\n \telement.bind(\"click\", function(event) {\n \t\tif(attrs.ngModel == 'full')\n \t\t\t$('.search-span').show();\n\n\t\t\t\tif(attrs.ngModel == 'add' && $(\"#add-company\").val() != \"\")\n\t\t\t\t\t$('.name-result-span').show();\n \t\t\n \t\tevent.stopPropagation();\n \t});\n \t\n \telement.bind(\"focusout\", function(event) {\n \t\t//element.next().css('display', 'none');\n \t})\n }\n }\n}", "_applyShowPagination(value, old) {\n if (value) {\n if (this.__pages.length > 1) {\n this.__pagination.show();\n }\n } else {\n this.__pagination.hide();\n }\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(res) {\n console.log(\"sj::\"+lowercaseQuery);\n return (res.indexOf(query) == 0);\n };\n\n }", "function getPage(scope) {\n var query = angular.extend({}, scope.gridState);\n\n // Add filter if available\n if (scope.gridFilters)\n query = angular.extend(query, scope.gridFilters);\n\n gridDataProvider.getPage(query);\n }", "function createFilterFor(query) {\n var lowercaseQuery = angular.lowercase(query);\n return function filterFn(state) {\n return (state.value.indexOf(lowercaseQuery) === 0);\n };\n\n\n\n\n\t }", "get filters(){\n\t\treturn [controllerFilter];\n\t}", "function filterUsers(req, res, next) {\n if (filters.indexOf(req.params.filter)<0) {\n next();\n } else {\n switch (req.params.filter) {\n case \"tweets\":\n getMoreTweets(req, res, next);\n break;\n case \"last\":\n getLastUsers(req, res, next);\n break;\n }\n }\n }", "debugEndpointProvider() {\n console.log(this.epProvider.getEndPointByName('allData'));\n console.log(this.epProvider.buildEndPointWithQueryStringFromObject({\n limit: 10,\n sort: 'title',\n page: 1,\n filter: 'marketing-automation,ad-network',\n direction: 1,\n }, '/fetch-all'));\n }", "index({ query, profile }, res) {\n\t\tconst { filter, skip, limit, sort, projection } = aqp(query, {\n\t\t\tskipKey: 'page',\n\t\t});\n\n\t\tconst page = (skip) ? skip : 1;\n\t\tconst perPage = (limit && limit <= 100) ? limit : 50;\n\n\t\tMedia.paginate(filter, { select: projection, sort:sort , page: page, limit: perPage, }).then((result) => {\n\t\t\tres.status(200).json(result)\n\t\t}).catch((err) => {\n\t\t\tres.status(500).json(err)\n\t\t})\n\t}", "getFilteredMovies (city, theater) {\n return apiClient.get(`/api/movies/?city=${city}&theater=${theater}`)\n }", "function FilterCtrl($scope, Cities) {\n\t$scope.cities = Cities;\n}", "[UPDATE_FILTERS]({commit, state}, filters) {\n let obj = {};\n \n state.page = 1;\n \n if (state.infiniteLoaderState && typeof state.infiniteLoaderState.reset === 'function')\n state.infiniteLoaderState.reset();\n \n if (filters.genres !== undefined)\n state.genres_filter = filters.genres;\n if (filters.text !== undefined)\n state.text_filter = filters.text;\n if (filters.year !== undefined)\n state.year_filter = filters.year;\n if (filters.combine_filter !== undefined)\n state.combine_filter = filters.combine_filter;\n \n if (filters.genres && filters.genres.length) {\n obj.with_genres = filters.genres.join(state.combine_filter);\n }\n \n if (filters.votes) {\n obj['vote_average.gte'] = filters.votes;\n state.votes_filter = filters.votes;\n }\n if (filters.year) {\n if (filters.year > -1) {\n obj.year = filters.year;\n } else {\n delete state.filters['year'];\n }\n }\n \n commit(SET_FILTERS, obj);\n }", "filter(filter) {\r\n this.query.set(\"$filter\", filter);\r\n return this;\r\n }", "function changeBookingListPropertyFilter(event)\n{\n event.preventDefault();\n page = 1;\n\n getBookingListLimited();\n}", "async index(req, res) {\n const { q } = req.query;\n const name = q || '';\n const { page } = req.query;\n const atualPage = page || '1';\n\n const { id } = req.params;\n if (id) {\n const student = await Student.findByPk(id);\n return res.json(student);\n }\n\n const students = await Student.findAndCountAll({\n where: { name: { [Op.iLike]: `%${name}%` } },\n order: [['name', 'ASC']],\n limit: 5,\n offset: (atualPage - 1) * 5,\n });\n return res.json(students);\n }", "static get PAGE_ITEMS() {\n return 10;\n }", "filterChanged() {\n this.updateQueryString({\n [this.pageParameter]: 1,\n [this.filterParameter]: this.encodedFilters\n })\n }", "list_category_filter(req, res){\n\n return businesses\n .findAll({\n where: {\n category: req.params.category,\n status: req.params.status,\n },\n offset: req.params.offset,\n limit: req.params.limit,\n })\n\n .then((result) => res.status(201).send(result))\n .catch((error) => res.status(400).send(error))\n\n }", "_paginate (entities, page, pageSize) {\n\t\treturn entities.slice((page - 1) * pageSize, (page - 1) * pageSize + pageSize)\n\t}", "function addFilters() {\n var filters = [];\n for (var key in arguments) {\n filters.push(arguments[key]);\n }\n renderFilters(filters);\n}", "getByUsername(username) {\n return this.list({\n filter: {\n username,\n },\n });\n }", "function createFilterFor(query) {\n \tconst lowercaseQuery = angular.lowercase(query);\n\n \treturn function filterFn(item) {\n \t\treturn (angular.lowercase(item.display).indexOf(lowercaseQuery) > -1);\n \t};\n }", "function VMMgmtCtrl($scope, Util){\n $scope.selected || ($scope.selected = {});\n Util.pagination($scope, 'vms', 5);\n}", "getFilteredMovies () {\n let filteredMovies = moviesFilterService.getFilteredMoviesByRating(this.data.movies);\n filteredMovies = moviesFilterService.getFilteredMoviesByGenres(filteredMovies);\n\n return filteredMovies;\n }", "function showEnsFilters() {\t\r\n\r\n}", "function productsPanel() {\n var directive = {\n templateUrl: 'app/productsPanel/productsPanel.html',\n restrict: 'E',\n link: function () {},\n controllerAs: 'vm',\n controller: productsPanelCtrl\n };\n\n return directive;\n\n function productsPanelCtrl($scope, $resource, cartService) {\n var vm = this;\n\n /**\n * Public methods\n */\n vm.searchTerm = '';\n vm.search = search;\n vm.addToCart = addToCart;\n vm.getProductsFilter = getProductsFilter;\n\n init();\n return vm;\n\n /**\n * Private methods\n */\n function init () {\n var r = $resource('api/products/:q', {q: '@q'});\n vm.products = r.query();\n }\n\n function search (){\n var r = $resource('api/products/:q', {q: '@q'});\n if(vm.searchTerm && vm.searchTerm.length > 2){\n vm.products = r.query({q: vm.searchTerm});\n }\n }\n\n function getProductsFilter(query){\n var r = $resource('api/products/:qp/:q', {qp: '@qp', q: '@q'});\n vm.products = r.query({qp: vm.searchTerm, q: query});\n console.log(query);\n }\n\n function addToCart(id){\n cartService.addToCart(id);\n }\n }\n\n}", "filterChanged() {\n this.updateQueryString({\n [this.pageParameter]: 1,\n [this.filterParameter]: this.$store.getters.currentEncodedFilters,\n })\n }", "function initPagination() {\n ctrl.page = {\n number: ctrl.page.number || 0,\n size: 10\n };\n }", "setFilterData(filters) {\n if (filters) {\n this.filterData = filters;\n }\n }", "function showTen (page, filtered, filterResult) {\n // Hide all the items in Student list from HTML index\n for (let i = 0; i < liStudents.length; i +=1) {\n liStudents[i].style.display = 'none';\n }\n \n // set page to equal the upper limit of what needs to be displayed based on what page link was clicked\n page = parseInt(page) * 10;\n\n // if filtered is false it displays the 10 values on the current page link clicked\n // else the below will determine the number of pages for searched value and reset/recreate the pagination links\n // and display the list values the search results array wit the ability to navigate back/forth between pages \n if (! filtered) {\n for (let i = page - 10; i < page; i +=1) {\n if (i === liStudents.length) {\n break;\n } else {\n liStudents[i].style.display ='block';\n } \n }\n } else { \n numPages = Math.ceil(filterResult.length / 10);\n paginationUl.innerHTML = '';\n createPageEle('li','a', numPages);\n pageA[pageNum-1].className = 'active';\n for (let i = page - 10; i < page; i += 1) {\n if (i === filterResult.length) {\n break;\n } else {\n filterResult[i].style.display = \"block\";\n } \n \n } \n }\n}", "filter() {\n //Create a copy of the queryStr\n const queryStrCopy = {...this.queryStr};\n\n //Removing different types of filters from the queryStrCopy\n const removeFields = ['sort', 'fields', 'q', 'limit', 'page'];\n removeFields.forEach( el => delete queryStrCopy[el])\n\n //Advanced filters using the following operators\n //lt : less than\n //lte : less than equal to\n //gt: greater than\n //gte : greater than equal to\n //When we pass the operator through the url the dollar sign is not appended \n //to the start of the operator like $gt or $lte\n //So we need to do that programatically\n let queryStr = JSON.stringify(queryStrCopy);\n // /\\b(gt|gte|lt|lte|in)\\b is the regrex pattern used\n queryStr = queryStr.replace(/\\b(gt|gte|lt|lte|in)\\b/g, match => `$${match}`)\n\n //Convert the string back to a JSON object using JSON.parse()\n this.query = this.query.find(JSON.parse(queryStr));\n return this;\n }", "function instantSearchName() {\n var name = document.getElementById(\"nameSearchField\").value;\n var format = \"json\";\n var url = \"https://data.brreg.no/enhetsregisteret/enhet.\" + format + \"?page=\" + page + \"&size=\" + pageSize + \"&$filter=startswith(navn,'\" + name + \"')\";\n getJSON(url);\n}", "function test_request_filter_on_request_page() {}", "function query(filterBy='') {\n return httpService.get(\"order\", { params: filterBy});\n}", "static get PAGE_ITEMS() {\n return 50;\n }", "function filter_1_3 (){\n filterType = \"\";\n filterAgeMin = 1;\n filterAgeMax = 3;\n loadTableWithFilters();\n\n}", "function activatePagination(){\n $('.page-link').click(function(){\n sendFilterRequest($(this));\n return false;\n });\n}", "function getSearchResults(request) {\n return \"Search Results.\";\n}", "function customGridFilter(type, $scope) {\n return [{\n title: 'Filter',\n icon: 'ui-grid-icon-filter',\n action: function ($event) {\n switch (type) {\n case \"EntOrgDetail\":\n $scope.entOrgDetailGridOptions.enableFiltering = !$scope.entOrgDetailGridOptions.enableFiltering;\n $scope.entOrgDetailGridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL);\n break;\n case \"RFMDetails\":\n $scope.rFMDetailsGridOptions.enableFiltering = !$scope.rFMDetailsGridOptions.enableFiltering;\n $scope.rFMDetailsGridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL);\n break;\n case \"TransformationDetail\":\n $scope.transformationDetailGridOptions.enableFiltering = !$scope.transformationDetailGridOptions.enableFiltering;\n $scope.transformationDetailGridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL);\n break;\n case \"Tags\":\n $scope.tagsGridOptions.enableFiltering = !$scope.tagsGridOptions.enableFiltering;\n $scope.tagsGridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL);\n break;\n case \"EntOrgHierarchy\":\n $scope.entOrgHierarchyGridOptions.enableFiltering = !$scope.entOrgHierarchyGridOptions.enableFiltering;\n $scope.entOrgHierarchyGridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL);\n break;\n case \"MasterBridgeLocation\":\n $scope.masterBridgeLocationGridOptions.enableFiltering = !$scope.masterBridgeLocationGridOptions.enableFiltering;\n $scope.masterBridgeLocationGridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL);\n break;\n case \"MasterBridgeMaster\":\n $scope.masterBridgeMasterGridOptions.enableFiltering = !$scope.masterBridgeMasterGridOptions.enableFiltering;\n $scope.masterBridgeMasterGridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL);\n break;\n case \"NaicsCodeStew\":\n $scope.naicsCodeStewGridOptions.enableFiltering = !$scope.naicsCodeStewGridOptions.enableFiltering;\n $scope.naicsCodeStewGridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL);\n break;\n case \"RankingStew\":\n $scope.rankingStewGridOptions.enableFiltering = !$scope.rankingStewGridOptions.enableFiltering;\n $scope.rankingStewGridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL);\n break;\n case \"TransactionHistory\":\n $scope.transactionHistoryGridOptions.enableFiltering = !$scope.transactionHistoryGridOptions.enableFiltering;\n $scope.transactionHistoryGridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL);\n break;\n }\n }\n }];\n }", "function filterByUser(param) {\n self.selectionModel.allMatter = param;\n if (param == 1) {\n self.viewModel.filters.for = \"mymatter\";\n } else {\n self.viewModel.filters.for = \"allmatter\";\n }\n self.viewModel.filters\n getMatterList(undefined, 'calDays');\n }", "function ProductsListCtrlFn(productResource) {\n\n var vm = this;\n //vm.products = productResource.query();\n\n //productResource.get({ id: 5 }, OnGetSuccess, OnGetError);\n //productResource.get({ id: 5 }, function (data) {\n // vm.products = data;\n //});\n\n productResource.query(function (data) {\n vm.products = data;\n });\n\n // { param:\"test\" } => /api/products?param=test\n //vm.searchCriteria = \"GDN\";\n //productResource.query({ search: vm.searchCriteria }, function (data) {\n // vm.products = data;\n //});\n\n // productResourceSrvc.query({ $filter: \"contains(ProductCode, 'GDN')\"}, function (data) {\n // vm.products = data;\n // });\n\n }", "function showMoreItemsPerPage(params) {\n var numberOfItems;\n numberOfItems = '' + (settings.numberOfItems || 50);\n params = (params || '?Grid-page=1&Grid-orderBy=~&Grid-filter=~&Grid-size=50').replace(/50/g, numberOfItems);\n location.replace(href + params);\n }", "function runFilterV2Lists(name, filter) {\n var list = GlideList2.get(name);\n if (!list) {\n list = GlideList2.getByName(name);\n }\n if (list)\n list.setFilterAndRefresh(filter);\n}", "function paginatedResults(model) {\r\n return (req, res, next) => {\r\n\r\n //get the page an the limit query to a variable\r\n const page = parseInt(req.query.page)\r\n const limit = parseInt(req.query.limit)\r\n \r\n //convert the limit and page for a zero based array\r\n const startIndex = (page - 1) * limit\r\n const endIndex = page* limit\r\n \r\n //make an result object\r\n const results = {}\r\n \r\n //clac next result\r\n if (endIndex < model.length) {\r\n results.next = {\r\n page: page + 1,\r\n limit: limit\r\n }\r\n }\r\n \r\n //clac previous result\r\n if (startIndex > 0){\r\n results.previous = {\r\n page: page - 1,\r\n limit: limit\r\n }\r\n \r\n }\r\n \r\n //slice the array from start to end index\r\n results.results = model.slice(startIndex, endIndex)\r\n \r\n //set the paginated object to a variable in the response\r\n res.paginatedResults = results\r\n next()\r\n \r\n }\r\n}", "getFilters() {\r\n let filters = {};\r\n filters.limit = this.state.limit;\r\n filters.offset = this.state.offset;\r\n filters.md5sum = this.state.tag_md5sum;\r\n filters.controller = 'tagmanager/scans';\r\n filters.omit_tag = this.state.tagTitle ? 't' : 'f';\r\n return filters;\r\n }", "function filterPublications( e ) {\n\n var filter = searchfield.value;\n var regex = filterValueToRegex( filter );\n var nrVisibleItems = 0;\n\n for (var i = 0, len = index.length; i < len; i++) {\n\n var item = index[i];\n var itemMatchesFilter = item.content.match( regex );\n\n if( itemMatchesFilter && !item.visible ) {\n\n item.element.classList.remove('hidden');\n index[i].visible = true;\n }\n else if( !itemMatchesFilter && item.visible ) {\n\n item.element.classList.add('hidden');\n index[i].visible = false;\n }\n\n if( item.visible ) nrVisibleItems++;\n }\n\n countField.innerHTML = nrVisibleItems;\n}", "primaryAccounts(filter, limit) {\n\t\treturn this.accountModel.all().then(accounts => this.limitToFilter(this.filterFilter(accounts, {name: filter}), limit));\n\t}", "filter(filters) {\n for (const prop of Object.keys(filters)) {\n if (typeof filters[prop] === 'function') {\n continue;\n }\n const val = this.getGraphQLValue(filters[prop]);\n if (val === '{}') {\n continue;\n }\n this.head.push(`${prop}:${val}`);\n }\n return this;\n }" ]
[ "0.61229646", "0.6085161", "0.59750646", "0.59750646", "0.59553766", "0.59512067", "0.5924951", "0.58912855", "0.58912855", "0.58519495", "0.5836397", "0.5797054", "0.57962877", "0.57875603", "0.57799774", "0.5751559", "0.5743671", "0.57076985", "0.5661386", "0.5651151", "0.56219554", "0.56199706", "0.56074363", "0.5596092", "0.5595375", "0.5581855", "0.5571631", "0.5544976", "0.5534347", "0.5528936", "0.5525944", "0.5514229", "0.5509428", "0.550385", "0.550385", "0.5500042", "0.5476716", "0.5476242", "0.54673636", "0.54630643", "0.54623187", "0.545169", "0.54480493", "0.5438791", "0.54301214", "0.5427698", "0.5425517", "0.5409782", "0.54068357", "0.5391721", "0.53880155", "0.5379846", "0.5362837", "0.5360168", "0.5358254", "0.53503996", "0.5335237", "0.5335093", "0.5334738", "0.5331686", "0.5331121", "0.5323658", "0.5323384", "0.53105503", "0.52967644", "0.52928424", "0.528545", "0.5276225", "0.52746433", "0.52722555", "0.52678007", "0.5258483", "0.5258087", "0.5257683", "0.5242516", "0.52402383", "0.5238589", "0.52333814", "0.52268255", "0.5226303", "0.52260834", "0.52240163", "0.5223763", "0.5219982", "0.52192795", "0.5214643", "0.52122015", "0.52081305", "0.52070373", "0.52045584", "0.52001506", "0.5188222", "0.51861274", "0.51849264", "0.51793957", "0.51787645", "0.5175451", "0.5170548", "0.51662856", "0.5164305", "0.51600856" ]
0.0
-1
This function is in charge of loading up all the cupcakes we have in the db so we can display them on the page. The function calls the getCupcakes() method of Class CupcakeList and stores the instance in our cupcakes global variable like mentioned above. The function also calls the createHTML function that will generate the list element with the cupcake information We add eventlisteners to each individual delete button as well
async function loadCupcakes() { let response = await CupcakeList.getCupcakes(); cupcakes = response; console.log(cupcakes) $cupcakeList.empty(); for (let cc of cupcakes.cupcakes) { console.log(cc) const html = createHTML(cc); $cupcakeList.append(html); let delBtn = document.getElementById(`del-btn-${cc.id}`); delBtn.addEventListener("click",deleteCupcake); let editBtn = document.getElementById(`edit-btn-${cc.id}`); editBtn.addEventListener("click",showEditForm); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateAndAppendCupcakeHtml(cupcake) {\n let html = `\n <li>\n Flavor:${cupcake.flavor}, \n Rating: ${cupcake.rating}, \n Size: ${cupcake.size}\n </li>\n <img src=${cupcake.image}><img>\n `;\n $updateCupcakeList.append(html);\n}", "async function showCupcakes() {\n let response = await axios.get(BASE_URL);\n let cupcakes = response.data.cupcakes;\n\n $cupcakeList.empty();\n addCupcakesToDOM(cupcakes);\n}", "function generateCupcakeHTML(cupcake) {\r\n return `\r\n <div data-cupcake-id=${cupcake.id}>\r\n <li>\r\n ${cupcake.flavor} / ${cupcake.size} / ${cupcake.rating}\r\n <button class=\"delete-button\">X</button>\r\n </li>\r\n <img class=\"Cupcake-img\"\r\n src=\"${cupcake.image}\"\r\n alt=\"(no image provided)\">\r\n </div>\r\n `;\r\n}", "async function deleteCupcake() {\r\n let $id = $(this).data('id');\r\n let response = await CupcakeList.deleteCupcake($id,cupcakes);\r\n cupcakes = response;\r\n console.log(cupcakes)\r\n $(this).parent().parent().parent().remove();\r\n }", "async function displayCupcakes() {\n const response = await axios.get(`${BASE_URL}/cupcakes`);\n\n for (let cupcake of response.data.cupcakes) {\n let addCupcake = $(cupcakeHTML(cupcake));\n $(\"#menu-list\").append(addCupcake);\n }\n}", "async function makeCupcake() {\n\t// Get values\n\tconst flavor = $('#flavor').val();\n\tconst size = $('#size').val();\n\tconst rating = $('#rating').val();\n\tconst image = $('#image').val() ? $('#image').val() : null;\n\t// API POST Request\n\tif (image !== null) {\n\t\tconst response = await axios.post(BASE_URL, { flavor, size, rating, image });\n\t} else {\n\t\tconst response = await axios.post(BASE_URL, { flavor, size, rating });\n\t}\n\t// Append new cupcake to DOM\n\tcupcake = response.data.cupcake;\n\t$cupcakeList.prepend(makeLI(cupcake));\n}", "async function createCupcake() {\r\n let flavor = $flavor.val();\r\n let size = $size.val();\r\n let rating = $rating.val();\r\n let image = $ccImage.val();\r\n\r\n let newCupcake = {flavor,size,rating,image}\r\n await CupcakeList.createCupcake(newCupcake)\r\n await loadCupcakes();\r\n }", "async function getAndDisplayCupcakes() {\n\n let cupcakes = await getCupcakes();\n\n for (let cupcake of cupcakes) {\n generateAndAppendCupcakeHtml(cupcake);\n }\n}", "async function showCupcakesOnStart(){\n\n let response = await axios.get(`${BASE_URL}cupcakes`);\n let cupcakes = response.data.cupcakes;\n\n for (let cupcake of cupcakes){\n let $cupcakeDiv = $('<div>');\n let $cupcakeImg = $('<img>').attr(\"src\", cupcake.image);\n let $cupcakeFlavor = $('<h3>').text(cupcake.flavor);\n let $cupcakeRating = $('<h3>').text(cupcake.rating);\n let $cupcakeSize = $('<h3>').text(cupcake.size);\n $cupcakeDiv.append($cupcakeFlavor)\n .append($cupcakeImg)\n .append($cupcakeRating)\n .append($cupcakeSize)\n let $cupcakeListItem = $('<li>').append($cupcakeDiv);\n $cupcakeList.append($cupcakeListItem);\n }\n\n}", "async function showInitialCupcakes() {\r\n const response = await axios.get(`${BASE_URL}/cupcakes`);\r\n\r\n for (let cupcakeData of response.data.cupcakes) {\r\n let newCupcake = $(generateCupcakeHTML(cupcakeData));\r\n $(\"#cupcakes-list\").append(newCupcake);\r\n }\r\n}", "function createHTML(cupcake) {\r\n const cupcakeHTML = $(`\r\n <div class=\"card col-3 m-3 card-${cupcake.id}\">\r\n <h1 class=\"text-center\">${cupcake.flavor}</h1>\r\n <img src=\"${cupcake.image}\" class=\"card-img-top\" id=\"cupcake-image\">\r\n <div class=\"card-body d-flex justify-content-center flex-column\">\r\n <h3>Size: <span class=\"h3-size ms-2\">${cupcake.size}</span></h3>\r\n <h3>Rating: <span class=\"h3-rating ms-2\">${cupcake.rating}</span></h3>\r\n <div class=\"d-flex flex-row\">\r\n <button class=\"btn btn-sm btn-success ms-2\" id=\"edit-btn-${cupcake.id}\" data-id=\"${cupcake.id}\">Edit</button>\r\n <button class=\"btn btn-sm btn-danger ms-2\" id=\"del-btn-${cupcake.id}\" data-id=\"${cupcake.id}\">X</button>\r\n </div> \r\n </div>\r\n </div>\r\n `);\r\n return cupcakeHTML;\r\n }", "async function displayCupcakes() {\n\tresponse = await axios.get(BASE_URL);\n\tcupcakes = response.data.cupcakes;\n\tfor (cupcake of cupcakes) {\n\t\t$cupcakeContainer.append(makeDiv(cupcake));\n\t}\n}", "function renderCafe(doc) {\n let li = document.createElement('li')\n let name = document.createElement('span')\n let city = document.createElement('span')\n // creating element for deleting\n let cross = document.createElement('div')\n\n li.setAttribute('data-id', doc.id) // to get the document's ID from firestore\n // setting the text contents for the elts we created\n name.textContent = doc.data().name\n city.textContent = doc.data().city\n cross.textContent = 'x'\n\n // next, gotta append the name & city to the li\n li.appendChild(name)\n li.appendChild(city)\n li.appendChild(cross)\n\n // lastly, gotta append the li we created to the ul element of cafeList\n cafeList.appendChild(li)\n\n // deleting data\n cross.addEventListener('click', (e) => {\n let id = e.target.parentElement.getAttribute(\"data-id\") // note that this 'data-id' is actually the doc.id... ref line 22\n db.collection('cafes').doc(id).delete()\n })\n}", "function renderCafe(doc) {\n let li = document.createElement('li');\n li.setAttribute('data-id', doc.id);\n\n let name = document.createElement('span');\n name.textContent = doc.data().name;\n li.appendChild(name);\n\n let city = document.createElement('span');\n city.textContent = doc.data().city;\n li.appendChild(city);\n\n let deleteButton = document.createElement('div');\n deleteButton.textContent = 'x';\n li.appendChild(deleteButton);\n deleteButton.addEventListener('click', (evt) => {\n evt.stopPropagation();\n let id = evt.target.parentElement.getAttribute('data-id');\n db.collection('cafes').doc(id).delete();\n })\n\n cafeList.append(li);\n}", "function renderCafe(doc) {\n let li = document.createElement('li');\n let name = document.createElement('span');\n let city = document.createElement('span');\n let cross = document.createElement('div');\n // We don't need to put 'doc.data.id' because the id is stored at the top of the document, no inside the data!\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().name; // remember to call the method data() WITH PARENTHESIS!!!\n city.textContent = doc.data().city;\n cross.textContent = 'x';\n\n li.appendChild(name);\n li.appendChild(city);\n li.appendChild(cross);\n cafeList.appendChild(li); // Add this custom li to the ul #cafe-list\n\n // Deleting data:\n cross.addEventListener('click', (e) => {\n e.stopPropagation();\n let id = e.target.parentElement.getAttribute('data-id') // We set the data-id attribute as doc.id of the database\n db.collection('cafes').doc(id).delete();\n })\n}", "function renderCafe(doc) {\n\tlet li = document.createElement('li');\n\tlet name = document.createElement('span');\n\tlet city = document.createElement('span');\n\tlet cross = document.createElement('div');\n\t// setting data into our element/attribute\n\tli.setAttribute('data-id', doc.id);\n\tname.textContent = doc.data().name;\n\tcity.textContent = doc.data().city;\n\tcross.textContent = 'x';\n\t// append our elements\n\tli.appendChild(name);\n\tli.appendChild(city);\n\tli.appendChild(cross);\n\t//append to cafeList - document\n\tcafeList.appendChild(li);\n\n\t//delete data by Id from firestore db\n\tcross.addEventListener('click', (e) => {\n\t\te.stopPropagation();\n\t\tlet id = e.target.parentElement.getAttribute('data-id');\n //console.log(id);\n db.collection('cafes').doc(id).delete();\n\t})\n}", "function renderCafe(doc){\n let li = document.createElement('tr');\n li.setAttribute('class', 'table-success');\n let blank = document.createElement('td');\n blank.setAttribute('class', 'table-success');\n let name = document.createElement('td');\n name.setAttribute('class', 'table-success');\n let city = document.createElement('td');\n city.setAttribute('class', 'table-success');\n\n let tdDelete = document.createElement('td');\n let tdUpdate = document.createElement('td');\n var btnDelete = document.createElement(\"BUTTON\");\n btnDelete.setAttribute('class', 'btn btn-danger');\n btnDelete.textContent = 'X'; \n tdDelete.appendChild(btnDelete);\n\n\n var btnUpdate = document.createElement(\"BUTTON\");\n btnUpdate.setAttribute('class', 'btn btn-warning');\n btnUpdate.textContent = '!';\n tdUpdate.appendChild(btnUpdate);\n\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().name;\n city.textContent = doc.data().city;\n\n li.appendChild(blank);\n li.appendChild(name);\n li.appendChild(city);\n li.appendChild(tdDelete);\n li.appendChild(tdUpdate);\n\n cafeTableList.appendChild(li);\n\n // deleting data\n btnDelete.addEventListener('click', (e) => {\n e.stopPropagation();\n let id = doc.id;\n db.collection('cafes').doc(id).delete();\n });\n // updating data\n btnUpdate.addEventListener('click', (e) => {\n idCafe = doc.id;\n window.location.href = '../../pages/products/update.html?id='+doc.id+'?imageUrl='+'https://firebasestorage.googleapis.com/v0/b/daniela-store.appspot.com/o/'+doc.id;\n });\n}", "function addCupFunction() {\r\n\tvar cupID = ++rowCount;\r\n\t$(\"div#row_to_insert table tbody tr\").attr(\"name\", cupID);\r\n\tvar str = $(\"div#row_to_insert table tbody\").html();\r\n\r\n\t// append html as a cup\r\n\t$(\"#table_order tr#add_new\").before(str);\r\n\t$(\"div#row_to_insert table tbody tr\").attr(\"name\", \"cup0\");\r\n\r\n\t// create cup object\r\n\tvar cup = new Cup(cupID);\r\n\tlistCup[cupID] = cup;\r\n\r\n\tdisableCheckoutButton(false);\r\n}", "function allCats() {\n\n let cats = document.querySelector(\"body > main > section > ul\")\n fetch(\"database.json\")\n .then(response => response.json())\n .then(json => {\n Object.entries(json.cats).forEach(entry => {\n const [id, cat] = entry\n const {name, description, image, breed} = cat;\n let li = htmlFactory('li');\n let img = htmlFactory('img', 'src', image)\n let h3 = htmlFactory('h3');\n h3.textContent = name;\n let pOne = htmlFactory('p');\n pOne.innerHTML = `<span>Breed: </span> ${json.breed[breed]}`\n let pTwo = htmlFactory('p');\n pTwo.innerHTML = `<span>Description: </span> ${description}`\n let ul = htmlFactory('ul', 'class', 'buttons');\n let liOne = htmlFactory('li', 'class', 'btn edit');\n let editLink = htmlFactory(\"a\", 'href', `${id}`)\n editLink.textContent = 'Change Info'\n liOne.appendChild(editLink)\n let liTwo = htmlFactory('li', 'class', 'btn delete');\n let deleteLink = htmlFactory(\"a\", 'href', `${id}`)\n deleteLink.textContent = 'New Home'\n liTwo.appendChild(deleteLink)\n ul.append(liOne, liTwo)\n\n li.append(img, h3, pOne, pTwo, ul)\n // console.log(li)\n cats.appendChild(li)\n // let option = document.createElement(\"option\");\n // option.setAttribute(\"value\", key);\n // option.textContent = value;\n // breeds.appendChild(option)\n });\n });\n}", "function populateTable(){\n var tableContent = '';\n // empty array to store all of our cuisine types\n var cuisines = [];\n // empty string to eventually store our select cuisine menu data\n var cuisineContent = '';\n\n // jquery AJAX call for JSON\n $.getJSON('/recipes/recipelist', function (data){\n\n // adds all recipe info from database to the global variable\n recipeListData = data;\n\n // for each item in our JSON, add a table row and cells to the content string\n $.each(data, function(){\n tableContent += '<tr>';\n // this checks the global selectedRecipes to see if the recipe has been selected already\n // if it has, it puts it in the table with a checked checkbox\n if (selectedRecipes.indexOf(this.name) === -1) {\n tableContent += '<td><input type=\"checkbox\" id=\"' + this.name.replace(/\\s+/g, '_') + 'Checkbox\" class=\"recipeCheckbox\"></td>';\n } else {\n tableContent += '<td><input type=\"checkbox\" id=\"' + this.name.replace(/\\s+/g, '_') + 'Checkbox\" class=\"recipeCheckbox\" checked></td>';\n }\n tableContent += '<td><a href=\"#\" class=\"linkshowuser\" rel=\"' + this.name + '\">' + this.name + '</a></td>';\n tableContent += '<td>' + this.cuisine + '</td>';\n tableContent += '</tr>';\n });\n\n // inject the whole content string into our existing HTML table\n $('#recipeList table tbody').html(tableContent);\n\n // create cuisine array to populate the select cuisine menu\n $.each(data, function(i){\n if (cuisines.indexOf(this.cuisine)=== -1) {\n cuisines.push(this.cuisine);\n }\n });\n\n // this function populates the Select Cuisine menu with all of the cuisines from the global recipeListData\n (function(){\n cuisineContent += '<option value=\"select\" selected>All Cuisines</option>';\n cuisines.forEach(function(item){\n cuisineContent += '<option value=\"' + item +'\">' + item + \"</option>\";\n });\n //menuContent += '</select>';\n })();\n\n $('#cuisine-select select').html(cuisineContent);\n });\n}", "function populateList(){\n var members = membersXMLDoc.getElementsByTagName(\"Member\");//Retrieving xml document.\n var html = \"<ul id='delete-button-list'>\";// Creating the unordered list.\n //Iterating through the members and adding a li element for each of them.\n for (var i = 0; i < members.length; i++) {\n //Selecting the needed information from each member instance.\n var firstname = members[i].getElementsByTagName(\"Firstname\")[0].childNodes[0].nodeValue;\n //Inserting delete button list item into the list with the firstname of the member.\n html +=\"<li class='delete-button' value=\" + i + \">Delete: \" + firstname + \"</li>\";\n }\n //Closing unordered list and adding it into the list-container.\n html += \"</ul>\";\n $('#list-container').append(html);\n\n /* Adding functionality to the delete list items to delete the selected member from the xml\n file and reload the list, table and select element.\n */\n $(\".delete-button\").click(function(){\n membersXMLDoc.getElementsByTagName(\"Member\")[$(this).val()].remove();\n /*\n Saving xml document as a string into a cookie. New lines and returns were removed\n using a regular expression as only the first line of the document was being saved.\n Note: In a future release this should be saving to the server side.\n */\n document.cookie += \"=;expires=Thu, 05 Oct 1990 00:00:01 GMT;\";\n document.cookie = new XMLSerializer().serializeToString(membersXMLDoc).replace(/[\\r\\n]/g, '');\n removeCurrentContent();\n populateSelectElement();\n populateTable();\n populateList();\n });\n }", "function listCatches() // Refreshes the list | Sorts them by id \n {\n fetch(CREATE_AND_LIST__URL)\n .then(res => res.json())\n .then(data => \n {\n elements.catchesForm.innerHTML = \"\";\n \n for (var catche in data) \n {\n var obj = data[catche];\n var catchDiv = document.createElement('div');\n catchDiv.classList.add('catch');\n var dataId = document.createAttribute('data-id');\n dataId.value = catche;\n catchDiv.setAttributeNode(dataId);\n \n catchDiv.innerHTML = `<label>Angler</label>`\n + `<input type=\"text\" class=\"angler\" value=\"${obj.angler}\" />`\n + `<hr>`\n + `<label>Weight</label>` \n + `<input type=\"number\" class=\"weight\" value=\"${obj.weight}\" />`\n + `<hr>`\n + `<label>Species</label>`\n + `<input type=\"text\" class=\"species\" value=\"${obj.species}\" />`\n + `<hr>`\n + `<label>Location</label>`\n + `<input type=\"text\" class=\"location\" value=\"${obj.location}\" />`\n + `<hr>`\n + `<label>Bait</label>`\n + `<input type=\"text\" class=\"bait\" value=\"${obj.bait}\" />`\n + `<hr>`\n + `<label>Capture Time</label>`\n + `<input type=\"number\" class=\"captureTime\" value=\"${obj.captureTime}\" />`\n + `<hr>`;\n //+ `<button class=\"update\">Update</button>`\n //+ `<button class=\"delete\">Delete</button>`;\n\n //Create update button\n let updateBtn = document.createElement(\"button\");\n updateBtn.classList.add(\"update\");\n updateBtn.textContent = \"Update\";\n updateBtn.addEventListener('click', updateCatch);\n catchDiv.appendChild(updateBtn);\n //Create delete button\n let deleteBtn = document.createElement(\"button\");\n deleteBtn.classList.add(\"delete\");\n deleteBtn.textContent = \"Delete\";\n deleteBtn.addEventListener('click', deleteCatch);\n catchDiv.appendChild(deleteBtn);\n\n elements.catchesForm.appendChild(catchDiv);\n }\n })\n .catch(e => console.log(e));\n }", "function getCocktail() {\n\n var cocktailURL = \"https://www.thecocktaildb.com/api/json/v1/1/search.php?s=\" + cockName;\n\n $.getJSON(cocktailURL, function (response) {\n if (response.drinks === null) {\n \n M.toast({\n html: \"<div class='message'>Not found!</div>\",\n classes: 'rounded',\n displayLength: 1500,\n\n })\n }\n\n //display the coctail detail page\n // display the image\n $(\".blueLagoon\").hide();\n\n $(\".cocktailThumb\").attr(\"src\", response.drinks[0].strDrinkThumb);\n // display the instructions\n $(\"#strInstructions\").html(response.drinks[0].strInstructions);\n\n $(\"#strDrink\").text(response.drinks[0].strDrink);\n // clear the ingredients list\n $(\"#strIngredients\").html(\"\");\n // display the ingredients as a list, with the measures beside them\n if (response.drinks[0].strIngredient1 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient1 + \" \" + response.drinks[0].strMeasure1);\n\n }\n if (response.drinks[0].strIngredient2 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient2 + \" \" + response.drinks[0].strMeasure2);\n\n }\n if (response.drinks[0].strIngredient3 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient3 + \" \" + response.drinks[0].strMeasure3);\n\n }\n if (response.drinks[0].strIngredient4 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient4 + \" \" + response.drinks[0].strMeasure4);\n\n }\n if (response.drinks[0].strIngredient5 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient5 + \" \" + response.drinks[0].strMeasure5);\n }\n if (response.drinks[0].strIngredient6 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient6 + \" \" + response.drinks[0].strMeasure6);\n }\n if (response.drinks[0].strIngredient7 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient7 + \" \" + response.drinks[0].strMeasure7);\n }\n if (response.drinks[0].strIngredient8 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient8 + \" \" + response.drinks[0].strMeasure8);\n }\n if (response.drinks[0].strIngredient9 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient9 + \" \" + response.drinks[0].strMeasure9);\n }\n if (response.drinks[0].strIngredient10 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient10 + \" \" + response.drinks[0].strMeasure10);\n }\n if (response.drinks[0].strIngredient11 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient11 + \" \" + response.drinks[0].strMeasure11);\n }\n if (response.drinks[0].strIngredient12 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient12 + \" \" + response.drinks[0].strMeasure12);\n }\n if (response.drinks[0].strIngredient13 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient13 + \" \" + response.drinks[0].strMeasure13);\n }\n if (response.drinks[0].strIngredient14 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient14 + \" \" + response.drinks[0].strMeasure14);\n }\n if (response.drinks[0].strIngredient15 !== null) {\n $(\"#strIngredients\").append(\"<li>\" + response.drinks[0].strIngredient15 + \" \" + response.drinks[0].strMeasure15);\n }\n\n window.scrollTo(0, 0);\n fillCards(response);\n\n });\n}", "function renderCafe(doc) {\n let li = document.createElement(\"li\");\n let name = document.createElement(\"span\");\n let city = document.createElement(\"span\");\n\n li.setAttribute(\"data-id\", doc.id);\n name.textContent = doc.data().name;\n city.textContent = doc.data().city;\n\n li.appendChild(name);\n li.appendChild(city);\n\n cafeList.appendChild(li);\n\n //delete data\n}", "static render(){\n let find_card = document.querySelector('.card')\n if (User.all.length !== 0 ){\n if(find_card === null){\n listCardsDiv.style.display = 'table'\n randJokeParentDiv.style.display = 'none'\n\n //iterate through each list belonging to this user\n\n let thisUserLists = List.all\n thisUserLists.forEach(list => {\n\n let cardDiv = document.createElement('div')\n\n //create card elements\n //iterate thru user list names and each of their associated jokes\n\n let listCard = document.createElement('div')\n listCard.className ='card'\n listCard.style.display = 'inline-table'\n let cardContentDiv = document.createElement('div')\n cardContentDiv.className = 'content'\n let headerDiv = document.createElement('div')\n headerDiv.className = 'content'\n headerDiv.innerHTML = `${list.name}`\n\n let ulJokeDiv = document.createElement('div')\n ulJokeDiv.className = 'ui celled list'\n\n list.jokes.forEach(joke => {\n let jokeListItem = document.createElement('div')\n jokeListItem.className = 'item'\n jokeListItem.dataset.id = joke.id\n jokeListItem.innerHTML = `${joke.phrase}`\n let line_break = document.createElement('br')\n let deleteJokeButton = document.createElement('button')\n deleteJokeButton.className = 'mini ui red button'\n deleteJokeButton.type = 'button'\n deleteJokeButton.dataset.deleteJokeId = joke.id\n deleteJokeButton.innerText = 'Delete Joke'\n deleteJokeButton.onclick = (event) => {\n event.preventDefault()\n let list_joke = event.currentTarget\n fetch(`http://localhost:3000/joke_lists/delete`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'application/json'\n },\n body: JSON.stringify({\n 'list_id': list.id,\n 'joke_id': joke.id\n })\n })\n list_joke.parentElement.remove()\n }\n jokeListItem.append(line_break, deleteJokeButton)\n ulJokeDiv.appendChild(jokeListItem)\n\n })\n let btnDiv = document.createElement('div')\n btnDiv.className = 'ui bottom attached button'\n btnDiv.innerHTML = \"<i class='trash alternate outline icon'></i> Delete List\"\n btnDiv.dataset.id = list.id\n btnDiv.onclick = event => {\n fetch(`http://localhost:3000/lists/${list.id}`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': `application/json`\n }\n })\n event.target.parentElement.remove()\n }\n //append div 'items' to div 'ui bulleted list', append bulleted list, img, div class header to content div\n\n listCard.append(headerDiv, ulJokeDiv, btnDiv)\n\n\n //append content div to cardDiv (class= card), append cardDiv to cardParent (look this up)\n let uiCardsDiv = document.getElementById('ui-cards-div')\n uiCardsDiv.append(listCard)\n })\n }\n else{\n if (listCardsDiv.style.display === 'none'){\n listCardsDiv.style.display = 'table'\n randJokeParentDiv.style.display = 'none'\n }\n }\n }\n else{\n modal.style.display = \"block\";\n login_form.addEventListener('submit', (e)=>{\n e.preventDefault()\n User.fetchUser()\n })\n }\n }", "function makeCake(){\n\t// Ik maak een variable cake met een array erin.\n\tvar cake = ['slagroom', 'frambozen', 'chocolade',];\n\n\treturn {\n\t\t//Hier maak ik gebruk van een object literal\n\t\tgetCake: function() {\n\t\t\t/* \tHier log ik een zinnetje met daarin cake.pop(). \n\t\t\t*\tcake alleen geeft mij de volledige array terug. \n\t\t\t*\tcake.pop() verwijderd het laatste element in de array en stuurt die terug. \n\t\t\t*\tReference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop\n\t\t\t*/\n\t\t\tconsole.log('Ik heb nu een ' + cake.pop() + 'taart');\n\t\t}\n\t};\n}", "function addFoodList(){\n var pricing = getPrice[0].innerHTML;\n var priceVal = pricing.replace(/[^0-9.]/g, \"\");\n var getting = priceVal * getValue;\n var newLine = '<div class=\"orderBox\">';\n newLine += '\t <p class=\"nameOfFood\">';\n newLine += look[\"0\"].textContent +' x '+ getValue ;\n newLine +=' $ '\n newLine += ' <span class = subtotal>'\n newLine += parseFloat(getting);\n newLine += ' </span>'\n newLine += ' </p>';\n newLine += ' <div class= \"closeBtn\">';\n newLine += ' <i class=\"fa fa-times closing\"></i>'\n newLine += ' </div>'\n newLine += '</div>';\n $('.foodList').append(newLine);\n deleteItem ();\n lengthCheck();\n } // fires in line 44", "function populateItems() {\n $(\"#dvLoading\").show();\n var projectName = datastore.getId();\n var projectTitle = datastore.getTitle();\n $('#project-data h2').text(projectTitle);\n\n // Update the list, once on inital open and subsequently on\n // changes to the datastore.\n function updateList() {\n console.log(\"starting updateList\");\n var items = datastore.getTable(tableName).query();\n var numItems = 0;\n \n // Rebuild the list of items\n $('#project-data tbody').empty().append(\n _.chain(items)\n // Sort by created date\n .sortBy(function (record) {\n return record.get(sortParameter);\n }) //.reverse() for descending ordering\n // Convert to list items like this:\n // <li id=\"{record ID}\"><button>X</button>{text}</li>\n .map(function (record) {\n var fileName = record.get('LOCAL_FILENAME').split('/');\n var filePath = projectName + '/' + fileName[fileName.length-1];\n var thumbnail_url = client.thumbnailUrl(filePath, {size: \"large\"});\n \n numItems++;\n var html = _.template('<tr id=\"${id}\"><td id=\"num\">${number}.</td><td id=\"thumb\"><a href=\"${pictureUrl}\" target=\"_blank\"><img src=\"${thumbnail}\" alt=\"Thumbnail\"></a></td><td id=\"date\">${date}</td><td id=\"location\">${location}</td><td id=\"artifact\">${artifact}</td><td id=\"description\">${description}</td><td id=\"gps\">${GPS}</td><td id=\"edit\"><a href=\"#\" id=\"record_edit\"><span class=\"glyphicon glyphicon-pencil\"></span></a><a href=\"#\" id=\"record_delete\"><span class=\"glyphicon glyphicon-trash\"></span></a></td></tr>', {\n id: record.getId(),\n number: numItems,\n pictureUrl: record.get('INTERNET_URL'),\n thumbnail: thumbnail_url,\n date: record.get('DATE'),\n location: record.get('LOCATION'),\n artifact: record.get('ARTIFACT_TYPE'),\n description: record.get('DESCRIPTION'),\n GPS: record.get('LONGITUDE').toString() + \" \" + record.get('LATITUDE').toString()\n });\n\n return $(html);\n\n }).value()\n );\n \n $(\"#dvLoading\").hide();\n\n //updateUIBasedOnRole();\n\n // Reflect the latest ACLs in the sharing dialog\n //$('#public').val(datastore.getRole('public'));\n //$('#team').val(datastore.getRole('team'));\n //$('.role').prop('disabled', datastore.getEffectiveRole() === 'viewer');\n\n // Handle deleting a record\n $(\"#project-data tr a#record_delete\").confirm({\n title:\"Delete record\",\n text: \"Are you sure you want to delete this record?\",\n confirm: function(button) {\n var recordId = $(button).parents('tr').attr('id');\n var filePath = getImageFilePath(recordId);\n\n // Delete the datastore record\n datastore.getTable(tableName).get(recordId).deleteRecord();\n\n // Delete the image associated with that record\n client.remove(filePath,\n function (error, data) {\n if (error) {\n return console.log(\"ERROR: \" + error); // Something went wrong.\n }\n \n // otherwise file is deleted \n }); \n },\n cancel: function(button) {\n // do nothing\n },\n confirmButton: \"Yes I am\",\n cancelButton: \"No\"\n });\n\n // Handle editing a record\n $(\"#project-data tr a#record_edit\").click(function (e) {\n e.preventDefault();\n // Get the proper record details\n var recordId = $(this).parents('tr').attr('id');\n selectedRecId = recordId;\n var record = datastore.getTable(tableName).get(recordId);\n var location = record.get('LOCATION');\n var artifact = record.get('ARTIFACT_TYPE');\n var description = record.get('DESCRIPTION');\n\n // Show the form\n $('#form-modal').addClass('md-show');\n\n // Display current values in form\n $('#form_location').val(location);\n $('#form_artifact_dropdown').val(artifact);\n $('#form_description').val(description);\n });\n }\n\n // Update on changes.\n datastore.recordsChanged.addListener(updateList);\n \n // Update UI with initial data.\n updateList();\n\n }", "function makePage(){\n\n codeFellows.makeList();\n disneyLand.makeList();\n}", "function renderCafe(doc){\r\n let li = document.createElement('li');\r\n let todo = document.createElement('span');\r\n let deadline = document.createElement('span');\r\n let cross = document.createElement('button');\r\n li.setAttribute('data-id', doc.id);\r\n todo.textContent = doc.data().todo;\r\n deadline.textContent = doc.data().deadline;\r\n cross.textContent='Delete_this';\r\n li.appendChild(todo);\r\n li.appendChild(deadline);\r\n li.appendChild(cross);\r\nconsole.log(li);\r\n plan.appendChild(li);\r\n\r\n //deleting data\r\n cross.addEventListener('click',(e)=>{\r\n e.stopPropagation();\r\n let id = e.target.parentElement.getAttribute('data-id');\r\n db.collection(email1).doc(email1).collection('todo').doc(id).delete();\r\n });\r\n}", "async function handleCupcakeForm(evt) { \n evt.preventDefault();\n\n //CODE REVIEW: These variables don't nede the dollar sign because it's just the values and not jquery data\n let $flavor = $(\"#cupcake-flavor\").val();\n let $rating = $(\"#cupcake-rating\").val();\n let $size = $(\"#cupcake-size\").val();\n let $image = $(\"#cupcake-image\").val();\n\n const newCupcake = {\n flavor: $flavor,\n rating: $rating,\n size: $size,\n image: $image\n };\n\n console.log(\"this ran\");\n console.log(\"newCupcake=\",newCupcake);\n await addNewCupcake(newCupcake);\n\n generateAndAppendCupcakeHtml(newCupcake);\n}", "function fillDonutCreation() {\r\n\tlogger.info(\"fillDonutCreation(): Filling donut creation list.\");\r\n var donutCreateTemplate = _.template($(\"#donutCreateTemplate\").html());\r\n\r\n // Populate donut menu\r\n $(\"#donutSelection > tbody\").empty(); // Clear old entries\r\n for (var i = 0; i < constants.donuts.length; i++) {\r\n if (!player.donuts[i]) {\r\n continue;\r\n }\r\n\r\n var donut = constants.donuts[i];\r\n var donutInfo = donutCreateTemplate({\r\n img: `<img src=\"img/${donut.imagePath}\" style=\"max-height: ${constants.imgSize}px; max-width: ${constants.imgSize}px;\" />`,\r\n flavor: donut.flavor,\r\n cost: displayMoney(donut.cost),\r\n createId: `create${i}`,\r\n sellForId: `sellFor${i}`,\r\n id: i\r\n });\r\n\r\n $(\"#donutSelection > tbody\").append(donutInfo);\r\n }\r\n\r\n if (!player.unlockedDonuts.size) {\r\n $(\"#donutSelection > tbody\").append(\"No donuts. Head to the Upgrades tab to buy some ingredients!\");\r\n }\r\n\r\n // Fill with user's previous prices\r\n for (var i = 0; i < constants.donuts.length; i++) {\r\n if (!player.donuts[i]) {\r\n continue;\r\n }\r\n\r\n $(`#create${i}`).val(player.selectedQuantities[i]);\r\n $(`#sellFor${i}`).val(player.sellPrices[i]);\r\n }\r\n\r\n $(\"#donutSelling\").hide();\r\n $(\"#donutSelection\").show();\r\n logger.info(\"fillDonutCreation(): Filled donut creation list.\");\r\n}", "function GoodsList() {\n\n // Collection of the good local objects\n this.collection = [];\n\n // Directions of the sortings. If true -- ascending\n // Yeah, there is grammar issue, but it is left to support older patterns\n this.ascedningName = true;\n this.ascedningPrice = true;\n\n\n // Item pushing override (definiton)\n this.push = (good) => {\n this.collection.push(good);\n };\n\n // Good deleting definition\n // It is an async process\n this.delete = (good) => {\n return new Promise((resolve, reject) => {\n setTimeout(()=>{\n this.collection.splice(this.collection.indexOf(good), 1);\n resolve('Good deleted')\n }\n , serverResponseTime);\n\n }\n \n )};\n\n\n // Good adding definition\n // It is an async process\n this.add = (good) => {\n\n return new Promise((resolve, reject) => {\n setTimeout(()=>{\n this.push(good);\n resolve('Good added')\n }\n , serverResponseTime);\n\n }\n\n )};\n\n // forEach override (definition)\n this.forEach = (callback) => {\n this.collection.forEach(callback);\n };\n\n // Name field sorting.\n // NOTE: String are 'compared' via localeCompare method\n this.sortByName = () => {\n const callback = this.ascedningName ? ((x, y) => {return ('' + x.name).localeCompare(y.name);}) \n : ((x, y) => {return ('' + y.name).localeCompare(x.name);}); \n this.collection.sort(callback);\n\n // NOTE: It re-renders automatically after sorting\n this.render();\n };\n\n\n // Price field sorting\n this.sortByPrice = () => {\n const callback = this.ascedningPrice ? ((x, y) => {return y.price-x.price;}) : ((x, y) => {return x.price-y.price;}); \n this.collection.sort(callback);\n\n // NOTE: It re-renders automatically after sorting\n this.render();\n };\n\n // Main method of the object, that renders dynamic elements into the page (table)\n this.render = () => {\n\n // Firstly we empty the table\n $('#table_body').empty();\n\n // Then, for each good item in the collection we perfom render\n // NOTE: This part can be taken out to a separate renderSelf method, which potentially could help optimize rendering\n // For example: we could re-render only edited part, not all dynamic elements, or just append added element to content.\n this.forEach((good, number) => {\n\n // Forming new row\n good.row = new Row(_.template($(\"#row_template\").html()), '#table_body', number, good);\n\n // If good hasn't mached sorting, it is hidden\n if(good.hidden){\n good.row.hide();\n } else {\n good.row.show();\n }\n \n\n // Forming edit form for the good\n good.formEdit = new FormEdit(good, $('#modal_fade'), $('#loading'), number, $('#edit_'+number), $(\"#modal_edit_template\"), '#edit_cities_template');\n\n // Forming description modal\n good.row.defineModalDescription(_.template($('#modal_description_template').html()), 'modal_description_'+number, 'modal_description_close_'+number);\n\n // Forming delete modal\n good.row.defineModalDelete(_.template($('#modal_delete_template').html()), 'modal_delete_'+number, 'yes_'+number, 'no_'+number);\n \n /* \n * This sets trigger to a 'delete' button to open delete modal\n * Reason for not incapsulating this into row object like modal itself \n * Is because it manipulates directly with GoodsList data (good local objects)\n */\n \n good.row.modalDelete.jQueryYes.click(() => {\n const deletePromise = this.delete(good);\n deletePromise.then((resolved)=>{\n this.render();\n $('#modal_fade').removeClass('modal_fade_trick');\n $('#loading').css('display', 'none');\n });\n $('#loading').css('display', 'block');\n good.row.modalDelete.jQueryElement.css('display', 'none');\n }); \n\n });\n \n };\n}", "function drawCats() {\r\n loadCats()\r\n\r\n let catElem = document.getElementById(\"moody-cats\")\r\n let catTemplate = \"\"\r\n\r\n catArray.forEach(newCat => {\r\n catTemplate +=\r\n `\r\n <div class=\"cat-border bg-dark kitten ${newCat.mood} text-light\">\r\n <img class = \"kitten\" src = \"https://robohash.org/${newCat.name}?set=set4&size=150x150\">\r\n <div class = \"d-flex justify-content-center\">Name: ${newCat.name}</div>\r\n <div class = \"d-flex justify-content-center\">Mood: ${newCat.mood}</div>\r\n <div class = \"d-flex justify-content-center\">Affection: ${newCat.affection}</div>\r\n <div class=\"d-flex space-between\"></div>\r\n <button class=\"btn-cancel m-1\" onclick=\"pet('${newCat.id}')\">Pet cat</button>\r\n <button class=\"m-1\" onclick=\"catnip('${newCat.id}')\">Catnip</button>\r\n <div class=\"d-flex justify-content-center\"><i class=\"action fa fa-trash text-danger\" onclick=\"removeCat('${newCat.id}')\"></i></div>\r\n </div>\r\n </div>\r\n `\r\n }\r\n )\r\n catElem.innerHTML = catTemplate\r\n}", "function displayDrinks() {\n // $(\"body\").css(\"background-image\", \"url(./assets/css/images/wood.jpg)\");\n $(\"#drinkList\").empty();\n for (var i = 0; i < drinksArray.length; i++) {\n var drink = $(\"<li>\");\n // console.log(drinksArray[i].strDrink);\n drink.text(drinksArray[i].strDrink);\n drink.addClass(\"drinks\");\n $(\"#drinkList\").append(drink);\n }\n // console.log(drinksArray);\n drinksArray = [];\n chooseDrink();\n}", "function addToList(placeObj) {\n var $listItem = document.createElement('div');\n $listItem.className = \"list-item\";\n $listItem.setAttribute(\"id\", placeId(placeObj));\n\n if (placeObj.img !== null) {\n /*\n var $img = createEl('img', \"list-img\", $listItem);\n $img.setAttribute(\"src\", placeObj.img);\n */\n $listItem.style[\"background-image\"] = \"url(\" + placeObj.img + \")\";\n } else {\n $listItem.style[\"background\"] = \"linear-gradient(#44728C, #082E43)\";\n }\n\n var $info = createEl('div', \"info\", $listItem);\n $info.innerHTML = placeObj.content;\n\n var $price = createEl(\"div\", \"price\", $info);\n $price.innerHTML = PRICE_INFO[placeObj.price];\n\n var $type = createEl(\"div\", \"type \" + placeObj.type, $info);\n $type.innerHTML = capitalize(placeObj.type);\n\n if (placeObj.link !== null) {\n var $link = createEl(\"a\", \"link\", $info);\n $link.innerHTML = \"Link\";\n $link.setAttribute(\"href\", placeObj.link);\n $link.setAttribute(\"target\", \"_blank\");\n }\n\n var $cancel = createEl('button', \"cancel corner-button\", $listItem);\n $cancel.innerHTML = \"×\";\n $cancel.addEventListener(\"click\", function() {\n hide($listItem);\n placeObj.canceled = true;\n\n repopulateItems();\n });\n\n var $favoriteCheckbox = createEl('input', \"favorite-checkbox\", $listItem);\n $favoriteCheckbox.setAttribute(\"id\", \"checkbox-\" + placeObj.index);\n $favoriteCheckbox.setAttribute(\"type\", \"checkbox\");\n\n var $favorite = createEl('label', \"favorite corner-button\", $listItem);\n $favorite.innerHTML = \"♡\";\n $favorite.setAttribute(\"for\", \"checkbox-\" + placeObj.index);\n $favorite.addEventListener(\"click\", function() {\n //a bit unintuitive but click event happens before the actual checkbox changes, so it's the opposite of what it should be\n placeObj.favorite = !$favoriteCheckbox.checked;\n\n if (onlyFaves) {\n repopulateItems();\n }\n });\n\n $list.appendChild($listItem);\n\n return $listItem;\n }", "function createContent(cafe) {\n\tvar popupData = \"<h3>\" + cafe.name + \"</h3>\" +\n\t\t\"<div>\"+cafe.location+\"</div>\" +\t\t\n\t\t\"<div class='donuts'>Nearby Donuts Shops</div>\";\n\treturn popupData;\n}", "function setCocktail(mood) {\n if (mood === \"Happy\") {\n var userCocktails = happyCocktailIDs;\n } else if (mood === \"Sad\") {\n var userCocktails = sadCocktailIDs;\n } else if (mood === \"Party\" || mood === \"Excited\") {\n var userCocktails = excitedCocktailIDs;\n } else if (mood === \"Chill\") {\n var userCocktails = chillCocktailIDs;\n } else if (mood === \"Classy\") {\n var userCocktails = classyCocktailIDs;\n }\n console.log(\"Drinks\");\n var randomID = Math.floor(Math.random() * userCocktails.length);\n var cocktailID = userCocktails[randomID];\n var cocktailDBQueryURL = `https://www.thecocktaildb.com/api/json/v1/1/lookup.php?i=${cocktailID}`;\n\n $.ajax({\n url: cocktailDBQueryURL,\n method: \"GET\",\n }).then(function (response) {\n console.log(response);\n var info = response.drinks[0];\n var ingredients = [\n info.strIngredient1,\n info.strIngredient2,\n info.strIngredient3,\n info.strIngredient4,\n info.strIngredient5,\n info.strIngredient6,\n info.strIngredient7,\n info.strIngredient8,\n ];\n var measurements = [\n info.strMeasure1,\n info.strMeasure2,\n info.strMeasure3,\n info.strMeasure4,\n info.strMeasure5,\n info.strMeasure6,\n info.strMeasure7,\n info.strMeasure8,\n ];\n $(\"#drink-name\").text(info.strDrink);\n $(\"#drink-image\").attr(\"src\", info.strDrinkThumb);\n $(\"#drink-image\").attr(\"style\", \"width: 200px\");\n $(\"#drink-instructions\").text(info.strInstructions);\n $(\"li\").remove();\n for (var i = 0; i < ingredients.length; i++) {\n if (ingredients[i] === null || measurements[i] === null) {\n return;\n } else {\n var newIng = $(\"<li>\").attr(\"style\", \"color:white; text-align: left\");\n newIng.text(measurements[i] + \" \" + ingredients[i]);\n $(\"#ingredients-list\").append(newIng);\n }\n }\n console.log(ingredients);\n console.log(measurements);\n });\n }", "function populateApp(){\n for (let i = 0; i < myGroceryList.length; i++){\n console.log()\n groceryItem.innerHTML += `\n <div class=\"item\">\n <p>${myGroceryList[i]}</p>\n <div class=\"item-btns\">\n <i class=\"fa fa-edit\"></i>\n <i class=\"fa fa-trash-o\"></i>\n </div>\n </div>`\n clearBtnToggle()\n queryEditBtn()\n queryDeleteBtn()\n }\n}", "function createHtmlForCatagory(){\n\t\t\tvar query = CatagoryTable.where({});\n\t\t /*var query = todoItemTable.where(function(dated){\n\t\t\t\t\t\t\t\t\t\t\treturn this.id <= dated\n\t\t\t\t\t\t\t\t\t\t\t},2);*/\n\t\t\t\n\t\t\tquery.read().then(function(todoItems) {\n\t\t\t\tvar listItems = $.map(todoItems, function(item) {\n\t\t\t\t\t\n\t\t\t\t\t\tvar html='';\n\t\t\t\t\t\t\thtml +='<tr class=\"panel panel-default\" data-id=\"'+item.id+'\">';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thtml +='<td> '+item.name+'</td>';\n\t\t\t\t\t\t\thtml +='<td> '+item.short_description+'</td>';\n\t\t\t\t\t\t\thtml +='<td> '+statusProd[item.status]+'</td>';\n\t\t\t\t\t\t\thtml +=\"<td><span class='col-lg-1'><span class='glyphicon glyphicon-edit edit' data-id='\"+item.id+\"' data-name='\"+item.name+\"' data-short_description='\"+item.short_description+\"' data-status='\"+item.status+\"' data-catagory_images='\"+item.catagory_images+\"' ></span></span><span class='col-lg-1'><span class='delete glyphicon glyphicon-remove-circle' data-id='\"+item.id+\"'></span></span></td>\";\n\t\t\t\t\t\t\thtml +='</tr>';\n\t\t\t\t\t\treturn $(html)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t $('#todo-items').empty().append(listItems).toggle(listItems.length > 0);\n\t\t\t\t $('.preLoader').hide();\n\t\t\t\n\t\t\t}, handleError);\n \n\t\t}", "function createList(){\n for (var i = 0; i < petData.animals.length; i++) {\n\n if (petData.animals[i].primary_photo_cropped != null){\n var petList = $(\"<a>\").addClass(\"nav-link active\").attr(\"id\", \"result-list\").attr(\"href\", \"#\").attr(\"data-index\", i);\n var petName = petData.animals[i].name;\n var petThumb = $(\"<img>\").addClass(\"img-thumbnail\").attr(\"src\", petData.animals[i].primary_photo_cropped.small);\n \n petList = petList.append(petThumb, petName);\n $(\"#list-results\").append(petList);\n \n // if pet doesnt have a photo this doesnt run. The first time it does run, firstValidIndex is permanently set to the index of the first animal who has a photo. This is so that the pet card index matches the index on the list, since some indexs wont be valid\n if (firstValidIndex < 0){\n firstValidIndex = i;\n }\n\n } else {\n // Generate nothing\n } \n }\n\n // makes sure that if you go through all of the animals and none have a photo, the list starts at 0 despite how many animals are found. You set it to 0 as a safeguard in case its called later because -1 will make the program crash.\n if (firstValidIndex < 0){\n firstValidIndex = 0;\n $(\"#noResultsModal\").addClass(\"show\").attr(\"style\", \"display: block;\");\n $(\".blackbox\").removeClass(\"hide\")\n $(\"#hidePetCard\").addClass(\"hide\")\n\n\n }\n\n }", "function renderCoffees(coffees) {\n let html = '';\n // coffees.sort implements the compare function to sort by property id\n coffees.sort(function (a,b) {\n return a.id - b.id;\n });\n for(let i = 0; i < coffees.length; i++) {\n html += renderCoffee(coffees[i]);\n }\n return html;\n}", "function renderTheUI() {\n //below is how you make it usable\n const toDoList = document.getElementById(\"toDoList\");\n //textContent is an attribute that it has\n toDoList.textContent = \"\";\n\n //for everything in this list do the thing (this function) this function is not named\n toDos.forEach(function(toDo) {\n //these are creating html elements (document.createElement creates html element without being in the html file)\n const newLi = document.createElement(\"li\");\n const checkbox = document.createElement(\"input\");\n const deleteButton = document.createElement(\"button\");\n\n //create a function to use when you press delete\n function deleteToDo() {\n //I want my list toDos to be filled with filtered items that are not\n //filter is a built in function for lists, which runs a function against your lists\n //item is creating another anonomys function (instead of function ()) and\n //alternative to write [after .filter( ] this could be: function(item){ } item => {return item !== toDos;}\n toDos = toDos.filter(item => {\n return item.id !== toDo.id;\n });\n }\n\n //for above this is what the object item and toDo look like\n // {\n // title\n // complete\n // id\n // };\n deleteButton.addEventListener(\"click\", event => {\n deleteToDo();\n renderTheUI();\n });\n\n checkbox.type = \"checkbox\";\n\n newLi.textContent = toDo.title;\n deleteButton.textContent = \"Delete!\";\n\n toDoList.appendChild(newLi);\n newLi.appendChild(checkbox);\n newLi.appendChild(deleteButton);\n });\n }", "function CakeBoardsBoxesContent() {\n const flags = [\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n ];\n const candles = [\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n ];\n\n const cutlery = [\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n ];\n const plates = [\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n ];\n const napkins = [\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n ];\n const balloons = [\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n { title: 'Option' },\n ];\n\n return (\n <div>\n <div>\n Flags\n <ul>\n {flags.map((flag) => (\n <li key={flag.id}>\n <button>{flag.title}</button>\n </li>\n ))}\n </ul>\n </div>\n <div>\n Candles\n <ul>\n {candles.map((candle) => (\n <li key={candle.id}>\n <button>{candle.title}</button>\n </li>\n ))}\n </ul>\n </div>\n <div>\n Cutlery\n <ul>\n {cutlery.map((cutleryOption) => (\n <li key={cutleryOption.id}>\n <button>{cutleryOption.title}</button>\n </li>\n ))}\n </ul>\n </div>\n <div>\n Plates\n <ul>\n {plates.map((plate) => (\n <li key={plate.id}>\n <button>{plate.title}</button>\n </li>\n ))}\n </ul>\n </div>\n <div>\n Napkins\n <ul>\n {napkins.map((napkin) => (\n <li key={napkin.id}>\n <button>{napkin.title}</button>\n </li>\n ))}\n </ul>\n </div>\n <div>\n Balloons\n <ul>\n {balloons.map((balloon) => (\n <li key={balloon.id}>\n <button>{balloon.title}</button>\n </li>\n ))}\n </ul>\n </div>\n </div>\n );\n}", "function refreshScouts() { \n scoutDB.fetchScouts(function(scouts) {\n var scoutList = document.getElementById('scout-items');\n scoutList.innerHTML = '';\n\n for(var i = 0; i < scouts.length; i++) {\n // Read the scout items backwards (most recent first).\n var scout = scouts[(scouts.length - 1 - i)];\n\n var li = document.createElement('li');\n li.id = 'scout-' + scout.timestamp;\n var checkbox = document.createElement('input');\n checkbox.type = \"checkbox\";\n checkbox.className = \"scout-checkbox\";\n checkbox.setAttribute(\"data-id\", scout.timestamp);\n\n li.appendChild(checkbox);\n\n var span = document.createElement('span');\n span.innerHTML = scout.text;\n\n li.appendChild(span);\n\n scoutList.appendChild(li);\n\n // Setup an event listener for the checkbox.\n checkbox.addEventListener('click', function(e) {\n var id = parseInt(e.target.getAttribute('data-id'));\n\n scoutDB.deleteScout(id, refreshScouts);\n });\n }\n\n });\n}", "function Taco() {\n this.init = function() {\n this.filling = \"\";\n this.tortilla = \"\";\n this.rice = \"\";\n this.bean = \"\";\n this.cheese = \"\";\n this.sauce = \"\";\n this.veggie = [];\n this.extras = [];\n };\n\n this.filling = \"\";\n this.tortilla = \"\";\n this.rice = \"\";\n this.bean = \"\";\n this.cheese = \"\";\n this.sauce = \"\";\n this.veggie = [];\n this.extras = [];\n this.price = 0;\n this.quantity = 1;\n this.components = [\"filling\", \"tortilla\", \"rice\", \"bean\", \"cheese\", \"sauce\"];\n\n\n this.location = \".fixing\";\n\n this.addToScreen = function(ingredient) {\n this.add(ingredient);\n this.print(ingredient);\n };\n\n this.add = function(ingredient) {\n if (ingredient !== undefined) {\n if ((ingredient.type !== \"veggie\") && (ingredient.type !== \"extras\")) {\n this[ingredient.type] = ingredient;\n } else {\n this[ingredient.type].push(ingredient);\n }\n this.updatePrice(ingredient.price);\n }\n };\n\n this.print = function(ingredient) {\n if (ingredient !== undefined) {\n var fixing = $(\"<li>\" + ingredient.name + \"</li>\");\n $(this.location + \".\" + ingredient.type).append(fixing);\n }\n };\n\n this.remove = function(ingredient) {\n if (ingredient !== undefined) {\n //Remove from the view.\n $(this.location + \" li\").filter(\":contains('\" + ingredient.name + \"')\").remove();\n if ((ingredient.type !== \"veggie\") && (ingredient.type !== \"extras\")) {\n this[ingredient.type] = undefined;\n } else {\n //Find the veggie/extra and remove it\n for (var i = 0; i < this[ingredient.type].length; i++) {\n if (this[ingredient.type][i].name == ingredient.name) {\n this[ingredient.type].splice(i, 1);\n break;\n }\n }\n }\n this.updatePrice(-1 * ingredient.price);\n }\n };\n\n this.updatePrice = function(change) {\n var num = parseFloat(change);\n if (!isNaN(num)) {\n this.price += num;\n $(\"#currentTaco .price\").html(\"Price:$\" + (this.price * this.quantity).toFixed(2));\n } else {\n $(\"#currentTaco .price\").html(\"Invalid Quantity!\");\n }\n };\n\n this.clear = function() {\n $(\".selected\").removeClass(\"selected\");\n this.remove(this[\"filling\"]);\n this.remove(this[\"tortilla\"]);\n this.remove(this[\"rice\"]);\n this.remove(this[\"bean\"]);\n this.remove(this[\"cheese\"]);\n this.remove(this[\"sauce\"]);\n this.clearVeggies();\n this.clearExtras();\n $(\"#accordion\").accordion(\"option\", \"active\", 0);\n moveTo(0);\n this.price = 0;\n this.updatePrice(0);\n };\n\n this.clearVeggies = function() {\n $(\".selected.veggie\").removeClass(\"selected\");\n for (var i = this.veggie.length - 1; i > -1; i--) {\n this.remove(this.veggie[i]);\n }\n };\n\n this.clearExtras = function() {\n $(\".selected.extras\").removeClass(\"selected\");\n for (var i = this.extras.length - 1; i > -1; i--) {\n this.remove(this.extras[i]);\n }\n };\n }", "function buildStaffList(staff) { \n cleanContainer();\n $.each(staff, function(index, value) {\n createStaffCard(value);\n });\n $('#loadingMessage').remove();\n $('#directory').removeClass('hidden'); \n }", "function populate_meal_list()\n{\n // Get the meal list (container) and clear it of any items\n var meal_list_element = document.getElementById('meal_unordered_list');\n meal_list_element.innerHTML = \"\";\n\n for (var i = 0; i < meals.length; i++)\n {\n add_meal_list_element(meals[i].id, meals[i].name, meals[i].image_path);\n }\n}", "function buildBody() {\r\n \r\n $(\"#list\").html( //build button and category header\r\n `\r\n <br>\r\n <a href='../index.html'>\r\n <button id=\"button1\"><img src='../images/back.png' width=20px'>\r\n </img>Go Back!\r\n </button>\r\n </a>\r\n <h4><em>Animals from the ${catArr[rowID].catType} category</em></h4>\r\n \r\n `\r\n );\r\n\r\n $(\"#list\").addClass(\"list\"); //add #list to class 'list'\r\n\r\n//display animal name, scientific info, colors, and photo\r\n for (let i = 0; i < anmlArr.length; i++) {\r\n if (anmlArr[i].category == catArr[rowID].catType) {\r\n $(\"#list\").append(\r\n `\r\n <p>\r\n <strong>Name: ${anmlArr[i].animal}</strong> with scientific name of\r\n <em>${anmlArr[i].scientific}</em> and colors of: <em>${anmlArr[i].colors}</em><br>\r\n <img src='${anmlArr[i].photoDepiction}' width='100px' height='70px'></img><br>\r\n </p>\r\n \r\n `\r\n );\r\n };\r\n };\r\n\r\n}", "function renderChecklist() {\n function renderTodos(list) {\n $(\"#to-dos\").empty(); // This will empty the html\n\n // Creating a for loop so that we can dynamically create our todos onto the page\n for (var i = 0; i < list.length; i++) {\n\n // Create a new variable that will hold a <p> tag.\n // Set the value of the list at \"i\" as text to the \"<p>\" element.\n var p = $(\"<p id='p-color'>\");\n p.text(list[i]);\n\n // Create a button based off of the number at i, which will cause it to be unique at every iteration.\n // Give button an attribute of \"data-to-do\" at i and a class called \"checkbox\".\n // Add a checkmark as the text of the button.\n var btnCheck = $(\"<button>\");\n btnCheck\n .attr(\"data-to-do\", i)\n .addClass(\"btn btn-checkbox checkbox\")\n .text(\"✓\");\n\n // Append the button to the todo item\n p = p.prepend(btnCheck);\n\n // Add the button and the p tag to the todos div \n $(\"#to-dos\").append(p);\n }\n }\n\n $(\"#add-to-do\").on(\"click\", function (event) {\n event.preventDefault();\n\n // Obtain value from textbox and store it as a variable\n var toDoTask = $(\"#to-do\").val().trim();\n\n // Add new todo to localStorage\n list.push(toDoTask);\n\n // Update ToDo's\n renderTodos(list);\n\n // Save the todos into local storage.\n // We need JSON.stringify to convert them into a string inside the storage.\n localStorage.setItem(\"todoList\", JSON.stringify(list));\n\n // Clear the textbox when finished.\n $(\"#to-do\").val(\"\");\n });\n\n // When user clicks the checkbox, that respective thing will disappear \n $(document).on(\"click\", \".checkbox\", function () {\n\n // Get the unique number of the specified button and hold it in a variable.\n var toDeleteNumber = $(this).attr(\"data-to-do\");\n\n // Deletes specified ID number of button\n list.splice(toDeleteNumber, 1);\n\n // Update the todos on the page.\n renderTodos(list);\n\n // Save the todos into local storage\n // JSON.stringify again\n\n localStorage.setItem(\"todoList\", JSON.stringify(list));\n });\n\n // Load the todos from the localStorage so if it's a returning user, it shall display\n // JSON.parse is needed to re-string the array that gets received.\n var list = JSON.parse(localStorage.getItem(\"todoList\"));\n\n // Checks to see if todolist exists in localStorage and is already an array. \n // If not, then set the array to empty.\n // Otherwise, our list of arrays shows\n if (!Array.isArray(list)) {\n list = [];\n }\n\n // Update the todos!!!\n renderTodos(list);\n }", "function ShoppingListController(ShoppingListFactory) {\n var list = this;\n var origTitle = \"Shopping List #1\";\n\n //User factory to create a new Shopping List Service\n var shoppingList = ShoppingListFactory();\n\n list.items = shoppingList.getItems();\n\n list.title = origTitle + \" (\" + list.items.length + \" items )\";\n\n list.warning = \"COOKIES DETECTED\";\n\n list.itemName = \"\";\n list.itemQuantity = \"\";\n\n list.addItem = function () {\n shoppingList.addItem(list.itemName, list.itemQuantity);\n list.title = origTitle + \" (\" + list.items.length + \" items )\";\n }\n\n list.removeItem = function (itemIndex) {\n console.log(\"´this´ is: \", this);\n this.lastRemoved = \"Last item removed was: \" + this.items[itemIndex].name;\n shoppingList.removeItem(itemIndex);\n this.title = origTitle + \" (\" + list.items.length + \" items )\";\n };\n }", "function setUpMainMenu() {\n\t//aey - loop through the array of loaded trucks\n\t//aey - print name, location description, etc.\n\t//aey - each menu item is a link/button that, when clicked, takes you to that trucks menu\n\t//aey - you can do this because you take the id of the current truck and build the appropriate html\n\n\tlet mainMenuString = \"<table id=\\\"mainMenuTable\\\" style=\\\"width:100%\\\">\";\n\tmainMenuString += \"<tr><td><div id=\\\"menuTitleText\\\">Main menu</div><div id=\\\"menuSubtitleText\\\">Please choose a truck:</div></td></tr>\";\n\n\t//aey - check if zero first\n\tif (localTruckArray.length === 0) {\n\t\tmainMenuString += \"<tr><td>There are no trucks loaded in the local client database.</td></tr></table>\";\n\t\treturn mainMenuString;\n\t}\n\t//aey - otherwise, proceed on with the table\n\n\t//aey - loop through trucks in local array\n\tlet n = localTruckArray.length;\n\tfor (let i = 0; i < n; i++) {\n\t\tlet curID = localTruckArray[i].id;\n\t\tlet curName = localTruckArray[i].name;\n\t\tlet curCuis = localTruckArray[i].cuisine;\n\n\t\t/* aey - construct one row of the main menu table */\n\n\t\t//aey - header row\n\t\tmainMenuString += \"<tr>\";\n\n\t\t//aey - setting up the menu row td tag\n\t\t//aey - first we set up the id\n\t\t//aey - then we set up the class\n\t\tmainMenuString += \"<td class=\\\"\";\n\n\t\tif (n === 1) mainMenuString += \"singleItem\\\" style=\\\"border-radius: 25px; \"; //aey - just in case if only one item, then all corners are round; set style, class singleitem never used\n\t\telse {\n\t\t\tif (i === 0) mainMenuString += \"mainMenuFieldBegin \"; //aey - beginning, top corners round\n\t\t\telse if (i === n - 1) mainMenuString += \"mainMenuFieldEnd \"; //aey - end, bottom corners round\n\t\t\t//aey - otherwise no need to change corners\n\n\t\t\t//aey - set class; change the color every other item for readability; change the class for the current row\n\t\t\tif ((i % 2 === 0) && (n !== 1)) mainMenuString += \" menuFieldEven\"; //for evens\n\t\t\telse mainMenuString += \" menuFieldOdd\"; //for odds\n\t\t}\n\n\t\tmainMenuString += \"\\\">\"; //end of td tag\n\n\t\t//aey - add the button\n\t\tmainMenuString += \"<button id=\\\"mainMenuTitleButton\\\" class=\\\"button1\\\"\" + \"onclick=\\\"pickAMenu('truck','\" + curID + \"')\\\">\" + curName + \"<br/></button><table style=\\\"width:100%\\\"><tr><td style=\\\"width:50%\\\">\";\n\t\t//aey - set up tiny table for the \"currently open/closed\" and \"pricerange elements\"\n\n\t\t//aey - create \"is open\" div (as seen on the main menu\n\t\tmainMenuString += isOpenTextPanel2(curID);\n\t\t//aey - print price range\n\t\tmainMenuString += \"</td><td><div id=\\\"priceRangeMainMenu\\\">Price range: <br/>\" + calculatePriceRange(localTruckArray[i].menu) + \"</div></td></tr></table>\";\n\n\t\tmainMenuString += \"</td></tr>\";\n\t}\n\tmainMenuString += \"</table>\";\n\treturn mainMenuString;\n}", "function populateCases(cases){\n // Create a searchable, sortable list using list.js and d3\n var options = {\n valueNames: ['name', 'count', 'class'],\n };\n var scale = d3.scale.linear()\n .domain([0, d3.max(cases, function(d){ return d.set().count(); })])\n .range([0, 100]);\n\n // Populate the list of samples\n var items = _caseList.select('.list').selectAll('li')\n .data(cases);\n var newItems = items.enter()\n .append('li')\n .on('mouseenter', function(d){ callListeners('mouseenter.case', _obj, d); })\n .on('mouseleave', function(d){ callListeners('mouseleave.case', _obj, d); });\n \n newItems.append('span')\n .classed('name', true)\n .html(function(d){ return d.label(); });\n newItems.append('span')\n .classed('count', true)\n .classed('hidden', true)\n .html(function(d){ return d.set().count(); });\n newItems.append('div')\n .classed('bar', true)\n .style('width', function(d){ return scale(d.set().count()) + \"%\"; });\n newItems.append('button')\n .attr('title', \"Add\")\n .html(\"+\")\n .on('click', function(d){ callListeners('add.case', _obj, d); });\n \n \n // It appears that list.js is storing some things when a List\n // object is created, preventing things from working correctly if\n // you attempt to just re-create a List object where there was an\n // old one. Therefore, we must only create the List object once,\n // but we are free to completely replace the HTML with the original\n // values when the 'Def.' button is clicked\n if(!_caseListObj){\n _caseListObj = new List('samples', options);\n _caseList.select('.clear-sort')\n .on('click', function(d){\n d3.selectAll('#samples .sort')\n .classed('asc', false)\n .classed('desc', false);\n d3.selectAll('#samples .list li').remove();\n populateCases(cases);\n });\n\n var matching = _caseListObj.matchingItems;\n var str = matching.length + \" sample\" + (matching.length == 1 ? \"\" : \"s\");\n _caseCount.text(str);\n \n _caseListObj.on('searchComplete', function(){\n var matching = _caseListObj.matchingItems;\n var str = matching.length + \" sample\" + (matching.length == 1 ? \"\" : \"s\");\n _caseCount.text(str);\n callListeners('searched.cases', _obj, matching);\n });\n }\n }", "function display_tests_list(){\n\tcall_webservice(9,\"&p=\"+currentProject);\n\tvar html=\"<table>\", oldType=\"\", type, nb=0;\n\t$(\"#tests_list\").html(\"\");\n\tif ( currentProjectType == 'JS' ){\n\t\t$(\"#tests #script_ctn\").html(\"\");\n\t\t$(\"#tests #script_ctn\").append(\"<script src='projets/\"+currentProjectFolder+\"/code/\"+currentProjectFolder+\".js'></script>\");\n\t\t$(\"#tests #script_ctn\").append(\"<script src='projets/\"+currentProjectFolder+\"/tests/tests.js'></script>\");\n\t}\n\t$(\"#tests .block_title span\").html(\"Tests (\"+dataRetourJSON.list.length+\")\");\n\tfor (i=0;i<dataRetourJSON.list.length;i++){\n\t\ttype = dataRetourJSON.list[i].type;\n\t\t\n\t\t// Nouvelle categorie\n\t\tif ( type != oldType ){\n\t\t\t\n\t\t\t// remplir la liste de test de la categorie precedente\n\t\t\tif ( oldType != \"\" ){\n\t\t\t\t$(\"#tests_\"+oldType+\"s\").html(html+\"</table>\");\n\t\t\t\t$(\"#section_\"+oldType+\" span\").html(oldType+\"s (\"+nb+\")\");\n\t\t\t\tnb = 0;\n\t\t\t}\n\t\t\thtml = \"<table cellspacing=0>\";\n\t\t\t\n\t\t\t// Ajouter la nouvelle categorie\n\t\t\t$(\"#tests_list\").append(\"<div class='section_title' id='section_\"+type+\"'> <span>\"+type+\"s (\"+nb+\")</span> &nbsp; <img width=18 height=18 src='img/run_test.png' onclick='run_tests(\\\"\"+type+\"\\\")' title='Lancer tous les tests \"+type+\"s'/></div>\");\n\t\t\t$(\"#tests_list\").append(\"<div id='tests_\"+type+\"s'></div>\");\n\t\t\toldType = type;\n\t\t}\n\t\thtml += \"<tr id='test_\"+dataRetourJSON.list[i].id+\"'><td class='test_name' title='\"+dataRetourJSON.list[i].desc+\"'>\"+dataRetourJSON.list[i].name+\"</td>\";\n\t\thtml += \"<td class='test_status'><img src='img/test\"+dataRetourJSON.list[i].status+\".png' title='\"+dataRetourJSON.list[i].debug+\"'/></td>\";\n\t\thtml += \"<td class='test_date'>\"+convert_datetime_to_fr(dataRetourJSON.list[i].last_run)+\"</td>\";\n\t\thtml += \"<td class='test_run'><img width=16 height=16 src='img/run_test.png' onclick='run_test(\\\"\"+dataRetourJSON.list[i].id+\"\\\",\\\"\"+type+\"\\\",\\\"\"+dataRetourJSON.list[i].name+\"\\\")' title='Lancer ce test'/></td></tr>\";\n\t\tnb++;\n\t}\n\t// remplir la liste de test de la categorie precedente\n\t$(\"#tests_\"+oldType+\"s\").html(html+\"</table>\");\n\t$(\"#section_\"+oldType+\" span\").html(oldType+\"s (\"+nb+\")\");\n}", "function clearList() {\n for (i in cats) {\n var div = document.getElementById(i)\n while (div.hasChildNodes()) {\n var nodes = div.childNodes;\n div.removeChild(nodes[0]);\n }\n }\n drinkIdx = 0;\n breakfastIdx = 0;\n lunchIdx = 0;\n dinnerIdx = 0;\n sweetIdx = 0;\n clearTotal();\n}", "function updateRecipes(recipeList) {\n\talert(\"recipe length\");\n\talert(recipeList);\n\tfor (var i = 0; i < recipeList.length(); i++)\n\t{\n\t\tvar recipeName = recipeList[i].name;\n\t\t$('#recipe_list').prepend('<li>' + recipeName + '</li>');\n\t}\n\talert(\"Exit update recipes visually\");\n}", "function draw(coffees) {\n\n var str = `<thead><tr>\n <th>Icon</th>\n <th>Name</th>\n <th>Description</th>\n <th>Price</th>\n <th>Stock</th>\n <th>Remove</th>\n </tr></thead>\n <tbody><tr>`;\n\n var str2 = JSON.stringify(coffees);\n\n var list = Object.keys(coffees);\n for (var i = 0; i < list.length; i++) {\n var coffee = coffees[list[i]];\n coffee.idProdus = Object.keys(coffees)[i];\n str += `<td><img src=\"${coffee.img}\" style=\"width: 40px; height: 40px\"/></td>\n <td style=\"width: 150px\"><button onclick='change(${JSON.stringify(coffee)}, ${i})'>${coffee.name}</button></td>\n <td><p>${coffee.description}</p></td>\n <td><p>${coffee.price}</p></td>\n <td><p>${coffee.stock}</p></td>\n <td style=\"width: 35px\"><button onclick='deleteItem(\"${coffee.idProdus}\", ${i})'>Delete</button></td>`\n if (i % 1 == 0) {\n str += ` </tr>\n <tr>`\n }\n }\n str += \"</tr></tbody>\";\n document.querySelector(\"#coffees table\").innerHTML = str;\n}", "function displayRecipes(apiData, ingredient){\n clearRecipes();\n recipeList = [];\n \n // gives the user a message if no recipes return from ingredient search\n if(apiData.meals == null){\n var recipe = document.createElement(\"div\");\n recipe.id = \"recipe-card\";\n \n var recipeName = document.createElement(\"p\");\n recipeName.id = \"rec-name\";\n ingredient = ingredient.replace(\"_\",\" \");\n recipeName.textContent = \"There are presently no recipes including \" + ingredient + \".\";\n\n recipe.appendChild(recipeName);\n recipeListEl.appendChild(recipe);\n }\n else{\n for(i=0; i<apiData.meals.length; i++){\n recipeList.push(apiData.meals[i].strMeal);\n }\n // automatically displays all recipes if there are less than 6 associated with an ingredient\n if(recipeList.length < 6){\n for(i=0; i<recipeList.length; i++){\n var recipe = document.createElement(\"div\");\n recipe.id = \"recipe-card\";\n \n var recipeName = document.createElement(\"p\");\n recipeName.id = \"rec-name\";\n recipeName.textContent = recipeList[i];\n \n var recipeBtnEl = document.createElement(\"button\");\n recipeBtnEl.id = \"rec-detail-btn\";\n recipeBtnEl.classList.add(\"btn\");\n recipeBtnEl.textContent = \"Get Details\";\n \n recipe.appendChild(recipeName);\n recipe.appendChild(recipeBtnEl);\n recipeListEl.appendChild(recipe);\n } \n }\n else {\n largeRecNum(ingredient);\n }\n }\n}", "function listRecipes() {\n $(\"#recipe-list\").empty();\n if (recipeData.meals === null) {\n displayError();\n } else {\n for (var i = 0; i < 25; i++) {\n // Add image and title.\n recipeList.push(recipeData.meals[i]);\n var index = recipeList.indexOf(recipeData.meals[i]);\n $(\"#recipe-list\").append(`\n <div class=\"recipe-card\">\n <div class=\"card-thumbnail\">\n <img id=\"recipe-img\" src=${recipeData.meals[i].strMealThumb} height=\"300\" width=\"300\" alt=\"mealImg\">\n </div>\n <h2 class=\"card-title\">${recipeData.meals[i].strMeal}</h2>\n <button class=\"recipe-button card-footer\" value=${index}>Select</button>\n </div>\n `) \n }\n }\n}", "function displayList(arrayOfPokemon){\n arrayOfPokemon.forEach(pokemon => {\n let pokemonInfo = document.createElement('div');\n pokemonInfo.className = 'list';\n\n let listing = document.createElement('h2');\n listing.textContent = pokemon.name;\n pokemonInfo.appendChild(listing);\n\n let sprite = document.createElement('img');\n sprite.src = pokemon.sprite;\n sprite.className = 'sprite';\n pokemonInfo.appendChild(sprite);\n\n let addButton = document.createElement('button');\n addButton.textContent = 'Add to Lineup';\n addButton.className = 'add-btn';\n addButton.addEventListener('click',displayCards);\n pokemonInfo.appendChild(addButton);\n\n document.querySelector('#pokemon-list').appendChild(pokemonInfo)\n });\n}", "function populateCategory() {\n\n // Empty content string\n var tableContent = '';\n tableContent += '<a href=\"#\" class=\"ReceivedOffers\" rel=\"Received\" title=\"Show Details\">Received Offers</a> | ';\n tableContent += '<a href=\"#\" class=\"SentOffers\" rel=\"Sent\" title=\"Show Details\">Offers Status</a>';\n\n // Inject the whole content string into our existing HTML table\n $('#category').html(tableContent);\n\n $('#CatogryInfo').on('click', 'a.ReceivedOffers', populateReceivedOffers);\n $('#CatogryInfo').on('click', 'a.SentOffers', populateSentOffers);\n}", "static renderMixtapes(mixtapesInfo){\n clearContainer(mixtapesContainer())\n Mixtape.all = []\n mixtapesInfo.forEach(mixtape => {\n let new_mixtape = new Mixtape(mixtape.id, mixtape.title, mixtape.description, mixtape.artist, mixtape.likes, mixtape.opinions)\n Mixtape.all.push(new_mixtape)\n // let mixtape = new Mixtape(mixtapeInfo.id, mixtapeInfo.title, mixtapeInfo.description, mixtapeInfo.artist, mixtapeInfo.likes, mixtapeInfo.opinions,)\n // mixtape.save\n let div = document.createElement(\"div\")\n let h3 = document.createElement(\"h3\")\n let p = document.createElement('p')\n let p2 = document.createElement('p')\n let likeButton = document.createElement('button')\n let ul = document.createElement('ul')\n let tapeLikes = document.createElement('p')\n let deleteButton = document.createElement('button')\n let form = document.createElement(\"form\")\n let input = document.createElement(\"input\")\n let submitOpinion = document.createElement(\"button\")\n\n let mixtapeOpinions = Opinion.renderOpinions(mixtape.opinions) \n //filling in that imaginary box with that inforamtion \n div.id = mixtape.id\n div.style.padding = \"40px\"\n div.style.backgroundColor = \"#FADCF3\"\n div.className = 'card'\n h3.innerText = mixtape.title\n p.innerText = mixtape.artist\n p2.innerText = mixtape.description\n tapeLikes.innerText = mixtape.likes\n likeButton.innerText = \"♥\"\n likeButton.addEventListener('click', Mixtape.likeMixtape.bind(mixtape))\n deleteButton.innerText = \"x\"\n deleteButton.addEventListener(\"click\", Mixtape.deleteMixtape.bind(mixtape))\n\n input.type = \"text\"\n input.placeholder = \"type your opinion here...\"\n submitOpinion.type = \"submit\"\n submitOpinion.innerText = \"Submit\"\n form.addEventListener(\"submit\", Mixtape.createOpinion.bind(mixtape))\n form.appendChild(input)\n form.appendChild(submitOpinion)\n\n //appending to child bringing that imagainary box to life on the browser to see\n div.appendChild(h3)\n div.appendChild(p)\n div.appendChild(tapeLikes)\n div.appendChild(p2)\n div.appendChild(likeButton)\n div.appendChild(deleteButton)\n mixtapeOpinions.forEach(li => ul.appendChild(li))\n div.appendChild(ul)\n div.appendChild(form)\n mixtapesContainer().appendChild(div)\n\n\n })\n }", "function renderCafe2(doc){\r\nlet li = document.createElement('li');\r\n\r\nlet done = document.createElement('span');\r\nlet deadline2 = document.createElement('span');\r\nlet cross = document.createElement('button');\r\nli.setAttribute('data-id', doc.id);\r\ndone.textContent = doc.data().done;\r\ndeadline2.textContent = doc.data().deadline2;\r\ncross.textContent='Delete_this';\r\nli.appendChild(done);\r\nli.appendChild(deadline2);\r\nli.appendChild(cross);\r\nconsole.log(li);\r\nplan2.appendChild(li);\r\n\r\ncross.addEventListener('click',(e)=>{\r\n e.stopPropagation();\r\n let id = e.target.parentElement.getAttribute('data-id');\r\n db.collection(email1).doc(email1).collection('done').doc(id).delete();\r\n});\r\n}", "function addToppings(event) {\n if (event === undefined) {\n event = window.event;\n }\n // \"callerElement\" stores the variable of the checkbox that is checked\n var callerElement = event.target || event.srcElement;\n // \"toppings\" holds the value of the checkbox, which is the string\n var toppings = callerElement.value;\n // If the element is checked, \"push\" the string value of that checkbox to the pizzaToppings array\n if (callerElement.checked) {\n pizzaToppings.push(toppings);\n // Also, like in the book example, I use an unordered list, and add the array nodes to the list\n var newTopping = document.createElement(\"li\");\n newTopping.innerHTML = toppings;\n document.getElementById(\"toppingslist\").appendChild(newTopping); \n }\n // if a box is unchecked, remove it from the array and \"splice\" the array back together, and remove the\n // list item from the html\n else {\n // create a variable that holds all of the li elements in the toppingslist list\n var toppingsItems = document.querySelectorAll(\"#toppingslist li\")\n // run a for loop to check each element and remove it if it is unchecked\n for (var i = 0; i < pizzaToppings.length; i++) {\n if (toppingsItems[i].innerHTML === toppings) {\n pizzaToppings.splice(i, 1);\n toppingsItems[i].parentNode.removeChild(toppingsItems[i]);\n break;\n }\n }\n }\n}", "function buildListing(){\n\tvar c_ads_library = Alloy.createCollection('categoryAds'); \n\tvar ads = c_ads_library.getLatestAdsByCategory(0, ads_counter, 999, _.pluck(favorites, \"m_id\"));\n\t \n\tif(ads.length <= 0){\n\t\tactivityIndicator.hide();\n\t\t$.ads_listing.remove(activityIndicator);\n\t\tbuild_no_ads_logo(_.pluck(favorites, \"m_id\"));\n\t\treturn;\t\n\t}\n\tads_counter += 999;\n\tfor(var a = 0; ads.length > a; a++){\n\t\t\n\t\tvar tbr = Ti.UI.createTableViewRow({\n\t\t\theight: Ti.UI.SIZE,\n\t\t\tselectedBackgroundColor: \"#FFE1E1\"\n\t\t});\n\t\t\n\t\tvar view_ad = $.UI.create(\"View\",{\n\t\t\tbottom: 10,\n\t\t\tleft: 10,\n\t\t\tright: 10,\n\t\t\tlayout: \"vertical\",\n\t\t\tm_id: ads[a].m_id,\n\t\t \ta_id: ads[a].a_id,\n\t\t \twidth : Ti.UI.FILL,\n\t\t \theight: Ti.UI.SIZE,\n\t\t\tbackgroundColor: \"#ffffff\",\n\t\t\tborderColor: \"#C6C8CA\",\n\t\t\tborderRadius:4,\n\t\t});\n\t\t\n\t\tif(ads[a].youtube != \"\" && ads[a].youtube != null){\n\t\t\tvar bannerImage = Ti.UI.createView({\n\t\t\t\twidth : Ti.UI.FILL,\n\t\t\t\theight: 200,\n\t\t\t\tbackgroundColor: \"#ffffff\",\n\t\t\t\tborderColor: \"#C6C8CA\",\n\t\t\t\tborderRadius:4,\n\t\t\t});\n\t\t\tvar webView = Ti.UI.createWebView({\n\t\t\t url: 'http://www.youtube.com/embed/'+ads[a].youtube+'?autoplay=1&autohide=1&cc_load_policy=0&color=white&controls=0&fs=0&iv_load_policy=3&modestbranding=1&rel=0&showinfo=0',\n\t\t\t enableZoomControls: false,\n\t\t\t scalesPageToFit: false,\n\t\t\t scrollsToTop: false,\n\t\t\t scalesPageToFit :true,\n\t\t\t disableBounce: true,\n\t\t\t showScrollbars: false\n\t\t\t});\n\t\t\tbannerImage.add(webView);\n\t\t}else{\n\t\t\tvar bannerImage = Ti.UI.createImageView({\n\t\t \t defaultImage: \"/images/warm-grey-bg.png\",\n\t\t\t image :ads[a].img_path,\n\t\t\t width : Ti.UI.FILL,\n\t\t\t m_id: ads[a].m_id,\n\t\t\t a_id: ads[a].a_id,\n\t\t\t height: Ti.UI.SIZE,//ads_height,\n\t\t\t});\n\t\t}\n\t\t\n\t\t\n\t\tvar label_merchant = $.UI.create(\"Label\", {\n\t\t\tfont: { fontWeight: 'bold', fontSize: 16},\n\t\t\ttext: ads[a].merchant,\n\t\t\ttop: 10,\n\t\t\tleft: 10,\n\t\t\tright: 10,\n\t\t\ttextAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,\n\t\t\twidth: Ti.UI.FILL,\n\t\t\theight: Ti.UI.SIZE,\n\t\t\tcolor: \"#404041\"\n\t\t});\n\t\t\n\t\tvar label_ads_name = $.UI.create(\"Label\", {\n\t\t\ttext: ads[a].ads_name,\n\t\t\tleft: 10,\n\t\t\tright: 10,\n\t\t\tfont: {fontSize: 14},\n\t\t\ttextAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,\n\t\t\twidth: Ti.UI.FILL,\n\t\t\theight: Ti.UI.SIZE,\n\t\t\tcolor: \"#626366\"\n\t\t});\n\t\t\n\t\tvar dateDescription = ads[a].active_date+\" - \"+ads[a].expired_date;\n\t\tif(ads[a].active_date == \"0000-00-00\" && ads[a].expired_date ==\"0000-00-00\"){\n\t\t\tdateDescription = \"Start from now!\";\n\t\t}else if(ads[a].active_date == \"0000-00-00\" && ads[a].expired_date !=\"0000-00-00\"){\n\t\t\tdateDescription = \"Until \"+ads[a].expired_date+\"!\";\n\t\t}else if(ads[a].active_date != \"0000-00-00\" && ads[a].expired_date ==\"0000-00-00\"){\n\t\t\tdateDescription = \"Start from \"+ads[a].active_date+\"!\";\n\t\t}\n\t\tvar label_date_period = $.UI.create(\"Label\", {\n\t\t\ttext: dateDescription,\n\t\t\ttextAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,\n\t\t\tfont:{fontSize: 12},\n\t\t\tleft: 10,\n\t\t\tright: 10,\n\t\t\tbottom: 10,\n\t\t\twidth: Ti.UI.FILL,\n\t\t\theight: Ti.UI.SIZE,\n\t\t\tcolor: \"#ED1C24\"\n\t\t});\n\t\t\n\t\tvar line = $.UI.create(\"View\",{\n\t\t\tbackgroundColor: \"#C6C8CA\",\n\t\t\theight: 0.5,\n\t\t\twidth: Ti.UI.FILL\n\t\t});\n\t\t\n\t\tview_ad.add(bannerImage);\n\t\tview_ad.add(line);\n\t\tview_ad.add(label_merchant);\n\t\tview_ad.add(label_ads_name);\n\t\tview_ad.add(label_date_period);\n\t\ttbr.add(view_ad);\n\t\t$.ads_listing.appendRow(tbr);\n\n\t\tbannerImage.addEventListener('load', function(e){\n\t\t\tactivityIndicator.hide();\n\t\t\t$.ads_listing.remove(activityIndicator);\n\t\t});\n\t\t\n\t\tsetTimeout(function(e){\n\t\t\tloading = false;\n\t\t}, 1000);\n\t\t\n\t\tif(ads[a].youtube == \"\"){ \n\t\t\tbannerImage.addEventListener('click', function(e) {\n\t\t\t \tgoAd(e.source.m_id);\n\t\t\t});\n\t\t}\n\t}\n\tsetTimeout(function(e){\n\t\tactivityIndicator.hide();\n\t\t$.ads_listing.remove(activityIndicator);\n\t\tloading = false;\n\t\tconsole.log(\"remove indicator\");\n\t}, 1000);\n\t\n\tvar no_ads = _.difference(_.pluck(favorites, \"m_id\"), _.pluck(ads, \"m_id\"));\n\tvar no_ads_tbr = build_no_ads_logo(no_ads);\n\tconsole.log(no_ads_tbr);\n\tconsole.log(\"no_ads_tbr\");\n\t$.ads_listing.appendRow(no_ads_tbr);\n}", "function renderCafe(doc){\n \n // create the list item\n let li = document.createElement(\"li\");\n li.setAttribute('data-id', doc.id); //Each document gets an id.\n let name = document.createElement('span'); \n let amount = document.createElement('span');\n let subject = document.createElement('span');\n \n // get the content\n name.textContent = doc.data().name;\n amount.textContent = doc.data().amount;\n subject.textContent = doc.data().subject;\n \n // append row\n li.appendChild(name);\n li.appendChild(amount);\n li.appendChild(subject);\n \n // insert the list item into body\n itemList.appendChild(li);\n\n}", "static render(dogs) {\n this.dogs = dogs;\n $('#app').empty();\n for (let dog of dogs) {\n $('#app').prepend(\n `<div id=\"${dog._id} class=\"card\">\n <div class=\"card-header\">\n <h2>${dog.name}'s Meals</h2>\n <div>\n <div class=\"card-body\">\n <div class=\"card\">\n <div class=\"row\">\n <div class=\"col-sm\">\n <input type=\"text\" id=\"${dog._id}-mealType-name\" class=\"form-control\" placeholder=\"Meal Type\">\n </div>\n <div class=\"col-sm\">\n <input type=\"text\" id=\"${dog._id}-mealType-quantity\" class=\"form-control\" placeholder=\"Quantity\">\n </div>\n </div>\n <br>\n <button id=\"${dog._id}-new-meal\" onclick=\"DOMManager.addMeal('${dog._id}')\" class=\"btn btn-success form-control\">I fed this doggo.</button>\n <br>\n <button class=\"btn btn-danger form-control\" onclick=\"DOMManager.deleteDog('${dog._id}')\">This dog has checked out!</button>\n </div>\n </div>\n </div><br>\n `\n );\n\n for (let meal of dog.meals) {\n $(`#${dog._id}`).find('.card-body').append(\n `<p>\n <span id=\"meal-${meal._id}\"><strong>Name: </strong> ${meal.mealType}</span>\n <span id=\"meal-${meal._id}\"><strong>Quantity: </strong> ${meal.quantity}</span>\n <button class=\"btn btn-primary\" onclick=\"DOMManager.deleteMeal('${dog._id}', '${meal._id}')\"<Delete Meal</button>\n </p>`\n );\n }\n }\n }", "function makeCoffeeTable() {\n createTableTitle('Beans Needed By Location Each Day');\n createTable('coffeeTable'); //create empty table\n createHeaderRow('coffeeTable', 'Daily Location Total'); //create header row\n for (var index in allStores) {\n createCoffeeRow('coffeeTable', allStores[index]);\n }\n createCoffeeTotalsRow(); //create coffee table totals row\n}", "function populate() {\n Artists.getAll().then(function(artistData) {\n var allListByName = Filter.sorted(artistData);\n var standbyList = Filter.standbyInOrder(artistData);\n var seatedList = Filter.seated(artistData);\n var lotteryList = Filter.lotteryInOrder(artistData);\n var lotteryListByName = Filter.lottery(artistData);\n var checkedOutList = Filter.sorted(Filter.checkedOutToday(artistData));\n\n buildNames($('.artist-names'), allListByName, {\n withSymbols: true\n });\n buildNames($('.lottery-names'), lotteryList, {\n withOrder: true\n });\n buildNames($('.standby-names'), standbyList, {\n withOrder: true\n });\n buildNames($('.seated-names'), seatedList);\n\n buildNames($('.lottery-sorted-names'), lotteryListByName, {\n disableClick: true\n });\n buildNames($('.standby-sorted-names'), standbyList, {\n disableClick: true\n });\n buildNames($('.seated-sorted-names'), seatedList, {\n disableClick: true\n });\n buildNames($('.checkedout-sorted-names'), checkedOutList, {\n disableClick: true\n });\n\n buildNameOptions($('[data-select-raw=artist]'), allListByName);\n\n $('.count-artists').text(artistData.length);\n $('.count-lottery').text(lotteryList.length);\n $('.count-standby').text(standbyList.length);\n $('.count-seated').text(seatedList.length);\n $('.count-checkedout').text(checkedOutList.length);\n });\n }", "function makeList() {\n if (!showingList) {\n\n listOfData.appendChild(ulEl);\n showingList = true;\n\n imageSelectionOne.removeEventListener('click', handleImage);\n imageSelectionTwo.removeEventListener('click', handleImage);\n imageSelectionThree.removeEventListener('click', handleImage);\n }\n}", "function goodsListFactory(userProfile, utils) {\n var goodsList = [];\n var goodsListObj = {\n\n constructor: function () {\n },\n\n getList: function (callback) {\n var action = \"getGoodsList\";\n var data = {\n action: action,\n };\n\n var session = userProfile.getSession();\n data.sessionID = (session ? session.id : '');\n\n utils.httpRequest(data, function success(response) {\n var errorMessage = \"\";\n if (!response.error) {\n if (response.data) {\n goodsList = response.data;\n }\n } else {\n errorMessage = response.error;\n }\n if (callback)\n callback(goodsList, errorMessage);\n }, function error(response, status, headers) {\n var errorMessage = (response ? \"Error: \" + response : \"Error: status=\" + status);\n if (callback)\n callback(errorMessage);\n });\n },\n\n getGoodsById: function (id) {\n if (!id) return null;\n\n id = parseInt(id);\n if (isNaN(id)) return null;\n\n var itemFound = null;\n for (var i = 0; i < goodsList.length; i++) {\n if (goodsList[i].id === id) {\n itemFound = goodsList[i];\n break;\n }\n }\n return itemFound;\n },\n\n createItem: function (goods, callback) {\n var action = \"createItem\";\n var data = {\n action: action,\n goods: goods\n };\n\n var session = userProfile.getSession();\n data.sessionID = (session ? session.id : '');\n\n utils.httpRequest(data, function success(response) {\n var errorMessage = \"\";\n if (!response.error) {\n if (response.data) {\n goodsList.push(response.data);\n }\n } else {\n errorMessage = response.error;\n }\n if (callback)\n callback(errorMessage);\n }, function error(response, status, headers) {\n var errorMessage = (response ? \"Error: \" + response : \"Error: status=\" + status);\n if (callback)\n callback(errorMessage);\n });\n },\n\n deleteItems: function (goodsItems, callback) {\n var action = \"deleteItems\";\n var data = {\n action: action,\n goodsItems: goodsItems\n };\n\n var session = userProfile.getSession();\n data.sessionID = (session ? session.id : '');\n\n utils.httpRequest(data, function success(response) {\n var errorMessage = \"\";\n if (!response.error) {\n if (response.data) {\n response.data.forEach(function (item) {\n var index = -1;\n for (var i = 0; i < goodsList.length; i++) {\n if (item.id === goodsList[i].id) {\n index = i;\n break;\n }\n }\n goodsList.splice(index, 1);\n });\n }\n } else {\n errorMessage = response.error;\n }\n if (callback)\n callback(errorMessage);\n }, function error(response, status, headers) {\n var errorMessage = (response ? \"Error: \" + response : \"Error: status=\" + status);\n if (callback)\n callback(errorMessage);\n });\n },\n\n editItem: function (goods, callback) {\n var action = \"editItem\";\n var data = {\n action: action,\n goods: goods\n };\n\n var session = userProfile.getSession();\n data.sessionID = (session ? session.id : '');\n\n utils.httpRequest(data, function success(response) {\n var errorMessage = \"\";\n if (!response.error) {\n \n } else {\n errorMessage = response.error;\n }\n if (callback)\n callback(errorMessage);\n }, function error(response, status, headers) {\n var errorMessage = (response ? \"Error: \" + response : \"Error: status=\" + status);\n if (callback)\n callback(errorMessage);\n });\n\n }\n };\n goodsListObj.constructor();\n return goodsListObj;\n}", "function renderCoffees(coffees) {\n var html = '';\n for(var i = 0; i < coffees.length; i++) {\n html += renderCoffee(coffees[i]);\n }\n return html;\n}", "function renderCoffees(coffees) {\n var html = '';\n for(var i = 0; i < coffees.length; i++) {\n html += renderCoffee(coffees[i]);\n }\n return html;\n}", "function constructCardList(cards) {\n if (cards.length !== 0) {\n let ul = document.createElement(\"ul\");\n cards.forEach(function(card) {\n // add the plus icon\n let image = document.createElement(\"img\");\n image.src = \"images/plus.png\";\n image.alt = \"Add \" + card.name + \" to current deck\";\n let figure = document.createElement(\"figure\");\n figure.appendChild(image);\n\n let info = card.name + \" [\" + card.set + \"]\"\n let para = document.createElement(\"p\");\n para.appendChild(document.createTextNode(info));\n\n let li = document.createElement(\"li\");\n li.id = card.id;\n li.appendChild(para);\n li.appendChild(figure);\n ul.appendChild(li);\n });\n\n // EVENT DELEGATION\n // display detailed information about a card when the user clicks on a list item\n ul.addEventListener(\"click\", (event) => {\n // if the add button is clicked, we perform a different action\n let closestListItem = event.target.closest(\"#pokemon-list li\");\n fetchCardDataById(closestListItem.id)\n .then(cardData => {\n if (event.target.tagName === \"IMG\") {\n addToDeckView(cardData);\n } else {\n loadModal(cardData);\n }\n })\n .catch(error => console.error(\"Failure to fetch card data with error=\" + error));\n });\n document.getElementById(\"pokemon-list\").appendChild(ul);\n } else {\n let ul = document.createElement(\"ul\");\n let li = document.createElement(\"li\");\n li.appendChild(document.createTextNode(\"No results found. Try a different search term?\"));\n ul.appendChild(li);\n document.getElementById(\"pokemon-list\").appendChild(ul);\n }\n }", "function renderCafe1(doc){\r\n let li = document.createElement('li');\r\n \r\n let doing = document.createElement('span');\r\n let deadline1 = document.createElement('span');\r\n let cross = document.createElement('button');\r\n li.setAttribute('data-id', doc.id);\r\n doing.textContent = doc.data().doing;\r\n deadline1.textContent = doc.data().deadline1;\r\n cross.textContent='Delete_this';\r\n li.appendChild(doing);\r\n li.appendChild(deadline1);\r\n li.appendChild(cross);\r\n console.log(li);\r\n plan1.appendChild(li);\r\n cross.addEventListener('click',(e)=>{\r\n e.stopPropagation();\r\n let id = e.target.parentElement.getAttribute('data-id');\r\n db.collection(email1).doc(email1).collection('doing').doc(id).delete();\r\n });\r\n\r\n}", "async function fetchCocktail() {\n // turn loading anim on\n loader.classList.remove('hidden');\n const id = await getCocktailId();\n const response = await fetch(`${baseEndpoint}/${id}`);\n const data = await response.json();\n\n // display picture\n cocktailName.textContent = data.name;\n const photo = `\n <img src=\"${baseEndpoint}/${id}/photo\" width=\"350\" alt=\"Cocktail picture\">\n `;\n pictureDiv.insertAdjacentHTML('beforeend', photo);\n\n // display doses\n data.doses.forEach(ingredient => {\n const dose = `\n <p class=\"step\">\n <span class=\"dose-nbr\">${ingredient.description}</span>\n <span class=\"dose-item\">${ingredient.ingredient.name}</span>\n `;\n ingredientsDiv.insertAdjacentHTML('beforeend', dose);\n });\n\n // display recipe\n const recipeStr = data.recipe;\n const recipeArray = recipeStr\n .replace(/[\\n\\r]+/g, '')\n .replace(/\\s{2,10}/g, ' ')\n .split('.');\n recipeArray.map(step => step.trim());\n recipeArray.forEach(displayRecipe);\n\n // display average rating\n const { reviews } = data;\n displayRating(reviews);\n // turn the loading anim off\n setTimeout(() => {\n loader.classList.add('hidden');\n }, 1200);\n return data;\n}", "function apiCall(){\n $.ajax({url: queryURL, method: 'GET'}).done(function getFood (response){\n\n //code loops through response array\n for(var i=0; i<response.list.item.length; i++){\n\n //new object with the foods name and database number\n var userFoodInfo = {\n name:response.list.item[i].name,\n\n id:response.list.item[i].ndbno\n }\n //pushes newly created obj to the food array \n foods.push(userFoodInfo);\n\n //displays the food item to the screen \n $('.results').append('<div><h3 id='+foods[i].id+' class=\\'result-item\\'>'+foods[i].name+'</h3></div>'); \n\n }\n\n //sets the results on click handler \n $('.result-item').on('click', function(){\n var self = $(this); \n \n //sets resultId to the elements id\n var resultId = self.attr('id');\n //gets the text of the element for use in the getNutrients call\n var name = self.text(); \n \n //call to get the nutrients for the food \n getNutrients(resultId ,name);\n \n //lets user know they've slected an item \n playSound(confirmSound);\n self.css('border-width', '3px'); \n self.css('color', 'gold'); \n self.css('border-color', 'darkgreen');\n $('.added').fadeTo('fast', 1); \n $('.added').animate({fontSize:\"50px\"}, 500); \n \n setTimeout(function(){\n self.hide();\n $('.added').fadeTo('fast', 0); \n $('.added').animate({fontSize:\"0px\"}); \n },550); \n })\n\n });\n }", "function renderCoffees(coffees) {\n var html = '';\n for(var i = 0; i < coffees.length; i++) {\n html += renderCoffee(coffees[i]); //same as: html = html + renderCoffee(coffees[i])\n }\n return html;\n}", "function generateContent(data) {\n\tif(add.textContent.trim() !== data.album.name){\n\t\tadd.style.display = 'block';\n\t\tadd.innerHTML = '<div id=\"addButton\" class=\"ui basic green button\" data=\"\" data-tooltip=\"Add this album to your collection!\" data-position=\"top center\">Add</div>';\n\t\tvar addButton = document.getElementById('addButton');\n\t\taddButton.addEventListener('click', (e) =>{\n\t\t\tadd.style.display = 'none';\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\tvar params = {\n\t\t\t\tadded: Date.now(),\n\t\t\t\ttitle: data.album.name,\n\t\t\t\tartist: data.album.artist,\n\t\t\t\timage: data.album.image[3]['#text']\t\t\t\t\n\t\t\t};\n\t\t\txhr.open(\"POST\", \"/collection\", true); ///<----- test nothing here\n\t\t\txhr.setRequestHeader('Content-Type', 'application/json');\n\t\t\txhr.send(JSON.stringify(params));\n\t\t})\n\t}\n\tartist.innerHTML = '<a href=\"/artist/' + encodeURIComponent(data.album.artist) + '\">' + data.album.artist + '</a> - ';\n\talbum.textContent = data.album.name;\n\t\n\ttitle.textContent = artist.textContent + album.textContent;\n\tvar img = data.album.image[3]['#text'];\n\t\n\timage.innerHTML = '<img class=\"ui image\" src=\"' + img + '\">';\n\tbg.style.backgroundImage = 'url(' + img + ')';\n\tdata.album.tags.tag.forEach((i) => {\n\t\ttags.innerHTML += '<a id=\"tag\" href=\"/tag/' + encodeURIComponent(i.name) + '\" class=\"ui tag label\">' + i.name + '</a>'\n\t})\n\tif(data.album.wiki){\n\t\tsummary = data.album.wiki.summary;\n\t\treview.innerHTML = summary;\n\t}\n\tif(data.album.tracks.track.length > 0){\n\t\tdata.album.tracks.track.forEach((i) => {\n\t\t\ttracks.push(i.name)\n\t\t});\n\t\tvar html = '<tbody>'\n\t\tfor(var i=0; i<tracks.length; i++){\n\t\t\thtml += '<div class=\"ui text container\"><tr><td id=\"trackName\">' + tracks[i] + '<button id=\"yt\" class=\"ui small basic disabled button\">Listen</button>' + '</td></tr></div>'\n\t\t}\n\t\tplaylist.innerHTML = \"<a id='playButton' class='ui basic disabled button'>Play All</a>\"\n\t\thtml+='</tbody>'\n\t\ttable.innerHTML = html;\n\t\ttrackName = document.querySelectorAll('#trackName');\n\n\t\tyoutubecache();\n\n\t\tfunction youtube(i){\n\t\t\tif(i<tracks.length){\n\t\t\t\tvar search = encodeURIComponent(data.album.artist) + ' ' + encodeURIComponent(data.album.name) + ' ' + encodeURIComponent(tracks[i]);\n\n\t\t\t\tfunction youtubeListener(){\n\t\t\t\t\tgenerateYoutube(JSON.parse(this.responseText), i, false)\n\t\t\t\t}\n\t\t\t\tvar params = {\n\t\t\t\t\tyoutube: search\n\t\t\t\t}\n\t\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t\txhr.onload = youtubeListener;\n\t\t\t\txhr.open('POST', '/api');\n\t\t\t\txhr.setRequestHeader('Content-Type', 'application/json');\n\t\t\t\txhr.send(JSON.stringify(params));\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t};\n\n\t\tfunction youtubecache(){\n\t\t\ttracks.unshift(data.album.artist + ' ' + data.album.name)\n\t\t\tfunction youtubeListener(){\n\t\t\t\tif(JSON.parse(this.responseText) === 'youtube'){\n\t\t\t\t\ttracks.shift()\n\t\t\t\t\tyoutube(0)\n\t\t\t\t} else {\n\t\t\t\t\ttracks.shift()\n\t\t\t\t\tgenerateYoutubeCache(JSON.parse(this.responseText))\n\t\t\t\t}\n\t\t\t\t// generateYoutube(JSON.parse(this.responseText), i)\n\t\t\t}\n\t\t\tvar params = {\n\t\t\t\tyoutubecache: tracks\n\t\t\t}\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\txhr.onload = youtubeListener;\n\t\t\txhr.open('POST', '/api');\n\t\t\txhr.setRequestHeader('Content-Type', 'application/json');\n\t\t\txhr.send(JSON.stringify(params));\n\t\t}\n\n\t\tfunction generateYoutubeCache(data){\n\t\t\tvar youtubeSongs = {}\n\t\t\tdata.forEach((i) => {\n\t\t\t\tvar index = tracks.indexOf(i.split('+')[0])\n\t\t\t\tvar id = i.split('+')[1]\n\t\t\t\tgenerateYoutube(id, index, true)\n\t\t\t})\n\t\t}\n\n\t\t\tvar id = [];\n\t\t\tfunction generateYoutube(data, i, cache) {\n\t\t\t\tif(data === 'notfound'){\n\t\t\t\t\ttrackName.item(i).innerHTML = tracks[i] + '<button id=\"yt\" class=\"ui small basic grey disabled button\">Listen</button>';\n\t\t\t\t\tid.push(undefined);\n\t\t\t\t} else {\n\t\t\t\t\ttrackName.item(i).innerHTML = tracks[i] + '<a target=\"_blank\" id=\"yt\" class=\"ui small basic blue button\" href=\"https://www.youtube.com/watch?v=' + data + '\">Listen</a>'\n\t\t\t\t\tid.push(data)\n\t\t\t\t}\n\t\t\t\tif(cache === false){\n\t\t\t\t\tyoutube(id.length)\n\t\t\t\t}\n\t\t\t\tif(id.length === tracks.length){\n\t\t\t\t\tvar cleanId = [];\n\t\t\t\t\tfor(var i=0; i<id.length;i++){\n\t\t\t\t\t\tif(id[i] !== undefined){\n\t\t\t\t\t\t\tcleanId.push(id[i])\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tplaylist.innerHTML = \"<a target='_blank' href='http://www.youtube.com/watch_videos?video_ids=\" + cleanId.join(',') + \"' id='playButton' class='ui basic blue button'>Play All</a>\";\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t} else {\n\t\ttable.innerHTML = '<div class=\"ui negative message\"></i><div class=\"ui center aligned container\">Darn! We couldn\\'t find the tracklist for <strong>' + data.album.artist + '-' + data.album.name + '</strong>.</div></div>'\n\t}\n}", "function distcrops(){\r\n document.getElementById(\"bt\").style.display=\"block\";\r\n document.getElementById(\"vt\").style.display=\"none\";\r\n document.getElementById(\"dc\").style.display=\"none\";\r\n document.getElementById(\"tf\").style.display=\"none\";\r\n document.getElementById(\"ff\").innerHTML = \"\";\r\n document.getElementById(\"detail\").innerHTML = \"\";\r\n document.getElementById(\"lists\").style.display=\"block\";\r\n var pp=\"\";\r\n var namelist = \"<table class='table table-hover'><thread><tr> <th>cropid</th><th>cropname</th><th>cropcost</th></tr></thead>\";\r\n pp += namelist;\r\n //document.getElementById(\"ff\").innerHTML += namelist;\r\n for(var i=0;i<cropslist.length;i++)\r\n {\r\n //var namelist = \"<li>\" +cropslist[i]+ \"</li>\";\r\n //document.getElementById(\"ff\").innerHTML += namelist;\r\n var namelist = \"<tbody><tr> <td>\"+ \r\n cropslist[i][0] +\"</td><td>\"+ \r\n cropslist[i][1] +\"</td><td>\"+\r\n cropslist[i][2] +\"</td><td>\"+ \r\n cropslist[i][3] +\"</td><td>\"+ \r\n cropslist[i][4] +\"</td></tr>\";\r\n pp+=namelist;\r\n //document.getElementById(\"ff\").innerHTML += namelist;\r\n }\r\n var namelist = \"<tr><th><button class='btn btn-success btn-lg' onclick='cropinsertform()'>ADD NEW</button></th></tr></tbody>\";\r\n pp+=namelist;\r\n var namelist = \"</table>\";\r\n pp+=namelist;\r\n document.getElementById(\"ff\").innerHTML = pp;\r\n //var temp = `<button onclick=\"cropinsertform()\">ADD NEW</button>`;\r\n //document.getElementById(\"ff\").innerHTML += temp;\r\n var ff = document.getElementById(\"ff\");\r\n ff.style.display = \"block\";\r\n}", "function orderDetail() {\r\n\r\n\t\tcrud.page(null, loadFood, $(\"#food-page\"));\r\n\t\t$(\"#find-food\").on(\"click\", function() {\r\n\t\t\t$(\"#food-page\").page({\r\n\t\t\t\tpageNo : 1\r\n\t\t\t});\r\n\t\t\tloadFood();\r\n\t\t});\r\n\r\n\t\tfunction loadFood() {\r\n\r\n\t\t\tvar tbody = $(\"#food-dialog tbody\").empty();\r\n\r\n\t\t\tvar name = $.trim($(\"#food-name\").val());\r\n\t\t\tvar options = $(\"#food-page\").page(\"options\");\r\n\t\t\tvar query = {\r\n\t\t\t\tname : name,\r\n\t\t\t\tpageNo : options.pageNo,\r\n\t\t\t\tpageSize : options.pageSize\r\n\t\t\t}\r\n\r\n\t\t\tvar selectedList = $(\".food\").data(\"list\");\r\n\r\n\t\t\tvar str = \"<tr>\";\r\n\t\t\tstr += \"<td><input type='checkbox'></td>\";\r\n\t\t\tstr += \"<td></td>\";\r\n\t\t\tstr += \"<td></td>\";\r\n\t\t\tstr += \"<td></td>\";\r\n\t\t\tstr += \"<td><img class='inline'></td>\";\r\n\t\t\tstr += \"<td><button class='btn btn-small btn-primary'>\" + $.message(\"view\") + \"</button></td>\";\r\n\t\t\tstr += \"</tr>\";\r\n\r\n\t\t\t$.ajax({\r\n\t\t\t\turl : \"json/Food_find\",\r\n\t\t\t\tasync : false,\r\n\t\t\t\tdata : query,\r\n\t\t\t\tsuccess : function(data) {\r\n\t\t\t\t\t$.each(data.list || [], function(index, food) {\r\n\t\t\t\t\t\tvar tr = $(str).data(\"row\", food);\r\n\t\t\t\t\t\t// tr.find(\":checkbox\").prop(\"checked\",\r\n\t\t\t\t\t\t// detectData(selectedList, \"id\", food));\r\n\t\t\t\t\t\ttr.find(\"td\").eq(1).text(index + 1);\r\n\t\t\t\t\t\ttr.find(\"td\").eq(2).text(food.name);\r\n\t\t\t\t\t\ttr.find(\"td\").eq(3).text(food.price);\r\n\t\t\t\t\t\ttr.find(\"img\").attr(\"src\", food.path);\r\n\t\t\t\t\t\ttbody.append(tr);\r\n\t\t\t\t\t});\r\n\t\t\t\t\tcrud.page(data, loadFood, $(\"#food-page\"));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\tcheck.general($(\"#food-parent\"), $(\"#food-dialog\").find(\"td :checkbox\"));\r\n\t\t}\r\n\t}", "function pullContacts() {\r\n\tconAll.sort();\r\n\tfor (var i = 0; i < conAll.length; i++) {\r\n\t\tlist = list + '<li><a href=\"#\" style=\"color: #FFF;\"><div id=\"list_content\"><span style=\"float: right; margin-right: 20px; width: 30px;\"><img onclick=\"call('+conAll[i][3]+')\" src=\"call.png\" style=\"width: 12px; height: 12px; padding-left: 30px;\"><br /><em style=\"font-family: monospace; font-size: 10px;\">'+conAll[i][4]+'</em></span><span onclick=\"showDetails('+i+')\">'+conAll[i][0]+ ' '+conAll[i][1]+ ' <br /><em style=\"font-size: 12px; margin-top: 3px;\">'+conAll[i][3]+'</em></span></div><img id=\"icon\" src=\"user-icon.png\"></a></li>';\r\n\t}\r\n\tlist = list + '</ul>';\r\n\tdocument.getElementById(\"list\").innerHTML = list;\r\n}", "function makeListItems() {\n const jokes = jokeFacade.getJokes();\n let jokeList = jokes.map(joke => `<li> ${joke} </li>`);\n const listItemsAsStr = jokeList.join(\"\");\n document.getElementById(\"jokes\").innerHTML = listItemsAsStr;\n}", "function updateList() {\n console.log(\"starting updateList\");\n var items = datastore.getTable(tableName).query();\n var numItems = 0;\n \n // Rebuild the list of items\n $('#project-data tbody').empty().append(\n _.chain(items)\n // Sort by created date\n .sortBy(function (record) {\n return record.get(sortParameter);\n }) //.reverse() for descending ordering\n // Convert to list items like this:\n // <li id=\"{record ID}\"><button>X</button>{text}</li>\n .map(function (record) {\n var fileName = record.get('LOCAL_FILENAME').split('/');\n var filePath = projectName + '/' + fileName[fileName.length-1];\n var thumbnail_url = client.thumbnailUrl(filePath, {size: \"large\"});\n \n numItems++;\n var html = _.template('<tr id=\"${id}\"><td id=\"num\">${number}.</td><td id=\"thumb\"><a href=\"${pictureUrl}\" target=\"_blank\"><img src=\"${thumbnail}\" alt=\"Thumbnail\"></a></td><td id=\"date\">${date}</td><td id=\"location\">${location}</td><td id=\"artifact\">${artifact}</td><td id=\"description\">${description}</td><td id=\"gps\">${GPS}</td><td id=\"edit\"><a href=\"#\" id=\"record_edit\"><span class=\"glyphicon glyphicon-pencil\"></span></a><a href=\"#\" id=\"record_delete\"><span class=\"glyphicon glyphicon-trash\"></span></a></td></tr>', {\n id: record.getId(),\n number: numItems,\n pictureUrl: record.get('INTERNET_URL'),\n thumbnail: thumbnail_url,\n date: record.get('DATE'),\n location: record.get('LOCATION'),\n artifact: record.get('ARTIFACT_TYPE'),\n description: record.get('DESCRIPTION'),\n GPS: record.get('LONGITUDE').toString() + \" \" + record.get('LATITUDE').toString()\n });\n\n return $(html);\n\n }).value()\n );\n \n $(\"#dvLoading\").hide();\n\n //updateUIBasedOnRole();\n\n // Reflect the latest ACLs in the sharing dialog\n //$('#public').val(datastore.getRole('public'));\n //$('#team').val(datastore.getRole('team'));\n //$('.role').prop('disabled', datastore.getEffectiveRole() === 'viewer');\n\n // Handle deleting a record\n $(\"#project-data tr a#record_delete\").confirm({\n title:\"Delete record\",\n text: \"Are you sure you want to delete this record?\",\n confirm: function(button) {\n var recordId = $(button).parents('tr').attr('id');\n var filePath = getImageFilePath(recordId);\n\n // Delete the datastore record\n datastore.getTable(tableName).get(recordId).deleteRecord();\n\n // Delete the image associated with that record\n client.remove(filePath,\n function (error, data) {\n if (error) {\n return console.log(\"ERROR: \" + error); // Something went wrong.\n }\n \n // otherwise file is deleted \n }); \n },\n cancel: function(button) {\n // do nothing\n },\n confirmButton: \"Yes I am\",\n cancelButton: \"No\"\n });\n\n // Handle editing a record\n $(\"#project-data tr a#record_edit\").click(function (e) {\n e.preventDefault();\n // Get the proper record details\n var recordId = $(this).parents('tr').attr('id');\n selectedRecId = recordId;\n var record = datastore.getTable(tableName).get(recordId);\n var location = record.get('LOCATION');\n var artifact = record.get('ARTIFACT_TYPE');\n var description = record.get('DESCRIPTION');\n\n // Show the form\n $('#form-modal').addClass('md-show');\n\n // Display current values in form\n $('#form_location').val(location);\n $('#form_artifact_dropdown').val(artifact);\n $('#form_description').val(description);\n });\n }", "function fillCustomerMenus() {\n // empty all menu elements\n $(\"#allmenu\").empty();\n $(\"#beers\").empty();\n $(\"#wines\").empty();\n $(\"#spirits\").empty();\n // Initialize menu cards with specific menu items\n $(getAllDrinks(allBeveragesJSON())).appendTo(\"#allmenu\");\n $(getDrinks(beveragesJSON(\"beers\"))).appendTo(\"#beers\");\n $(getDrinks(beveragesJSON(\"wines\"))).appendTo(\"#wines\");\n $(getDrinks(beveragesJSON(\"spirits\"))).appendTo(\"#spirits\");\n}", "function renderTicketList(doc){\n let li, firstName, lastName, totalAttend, email, phoneNumber, cross, extraInfo, editTicket, assignSeat, print, Seat\n try {\n li = document.createElement('li');\n firstName = document.createElement('spanner');\n lastName = document.createElement('spanner');\n totalAttend = document.createElement('spanner');\n email = document.createElement('spanner');\n phoneNumber = document.createElement('spanner');\n cross = document.createElement('spanner');\n extraInfo = document.createElement('div');\n print = document.createElement('spanner');\n editTicket = document.createElement('spanner');\n assignSeat = document.createElement('spanner');\n Seat = document.createElement('div');\n li.setAttribute('data-id', doc.id);\n\n } catch (e) {\n console.log(\"Could be testing\")\n if (e instanceof ReferenceError) {\n return true\n }\n }\n \n //assigning values to the elements.\n\n\n firstName.textContent = doc.data().firstName;\n lastName.textContent = doc.data().lastName;\n totalAttend.textContent = \"# of tickets: \" + doc.data().totalAttend;\n email.textContent = doc.data().email;\n phoneNumber.textContent = doc.data().phoneNumber;\n cross.textContent = 'X';\n editTicket.textContent = 'EDIT';\n assignSeat.textContent = 'ASSIGN SEAT';\n print.textContent = 'PRINT';\n extraInfo.textContent = 'Additional Info: '+ doc.data().extraInfo;\n Seat.textContent = 'Seat: ' + doc.data().Seat;\n\n\n //Creating element from the render list.\n //updating the list of objects.\n li.appendChild(firstName);\n li.appendChild(lastName);\n li.appendChild(email);\n li.appendChild(phoneNumber);\n li.appendChild(cross);\n li.appendChild(editTicket);\n li.appendChild(assignSeat);\n li.appendChild(print);\n li.appendChild(totalAttend);\n li.appendChild(extraInfo);\n li.appendChild(Seat);\n ticketList.appendChild(li);\n //Updating the list\n\n\n //Deleting Data\n cross.addEventListener('click', (e) => {\n var con = confirm(\"Are you sure you want to delete this ticket?\");\n\n if (con == true){\n e.stopPropagation();\n let id = e.target.parentElement.getAttribute('data-id');\n db.collection('test').doc(id).delete();\n console.log(\"working\");\n\n }\n\n });\n\n\n //all of these buttons carry over multiple values to the new windo\n //Used to identify which show or which ticket is being edited.\n\n //create edit ticket button\n editTicket.addEventListener('click', (e) => {\n e.stopPropagation();\n let ticketId = e.target.parentElement.getAttribute('data-id');\n var parentWindow = window.parent;\n\n var newWindow = window.open(\"editTicket.html\", \"\", \"width=1000,height=700\");\n \n newWindow.newticketId = ticketId;\n newWindow.parentWindow = parentWindow;\n\n });\n\n \n //Create seat assign button \n assignSeat.addEventListener('click', (e) => {\n e.stopPropagation();\n let ticketId = e.target.parentElement.getAttribute('data-id');\n var parentWindow = window.parent;\n var newWindow = window.open(\"seatAssign.html\", \"\", \"width=1000,height=1000\");\n newWindow.newticketId = ticketId;\n newWindow.newshowId = newshowId;\n newWindow.parentWindow = parentWindow;\n\n });\n\n print.addEventListener('click', (e) => {\n e.stopPropagation();\n\n var show = doc.data().showID\n var docRef = db.collection(\"Shows\").doc(show);\n\n docRef.get().then((showdata) => {\n if (showdata.exists) {\n var date = document.getElementById(\"date\");\n date.innerHTML = showdata.data().showDate;\n var time = document.getElementById(\"time\");\n time.innerHTML = showdata.data().time;\n seat = doc.data().Seat\n pieces = seat.split(\"_\")\n if(pieces.length < 4){\n var row = document.getElementById(\"row\");\n row.innerHTML = pieces[2];\n var seat = document.getElementById(\"seat\");\n seat.innerHTML = pieces[1];\n }else{\n alert(\"multiple tickets coming later\");\n }\n printJS('ticket', 'html')\n }else{\n alert(\"No such show\")\n }\n })\n\n\n\n });\n\n\n}", "function populateDOM(cont) {\n let counter = -1;\n $(\"#showSongs\").html(\"\");\n for (let i = 0; i < cont.songs.length; i++) {\n let songItem = cont.songs[i];\n counter++; \n $(\"#showSongs\").append(\n `<div class=\"songList\" id=\"songItem--${counter}\"> \n <div class=\"title\"> ${songItem.title} </div> \n <div class=\"artist\"> ${songItem.artist} </div> \n <div class=\"album\"> ${songItem.album} </div>\n <button class=\"deletebutton\">Delete It</button> \n </div>`);\n }\n// call function to populate artist select options\n // append artist and album selectors here with array data\n popArtistFilter(cont);\n popAlbumFilter(cont);\n }", "function getAllCategories(callBack) {\r\n selectAll(function (results) {\r\n var len = results.length;\r\n var i;\r\n\r\n //loop continues for every value in db table\r\n for (i = 0; i < len; i++) {\r\n listOfCategories[i] = results[i];\r\n }\r\n setDatabaseName('dbCat', ['users', 'items', 'categories', 'subcategories ', 'events', 'watchlist']);\r\n setCurrObjectStoreName('subcategories');\r\n // need to get all the subcats and items before building the html\r\n startDB(function () {\r\n getAllSubcategories(callBack);\r\n }); // async func\r\n });\r\n}", "function populateShadowBoxes() {\n // Clear the lists\n var uls = [myUL1, myUL2, myUL3, myUL4, myUL5];\n uls.forEach(function(item) {\n while(item.firstChild){\n item.removeChild(item.firstChild);\n }\n });\n\n // Populate the relationship lists\n relationshipPopulate();\n\n // Populate the My Wishlist list\n wishlistPopulate();\n}", "function refreshList()\r\n{\r\n $(\".jokes\").remove();\r\n}", "function displayRecipe(data) {\n var Recipe = data.meals[0];\n var RecipeDiv = document.getElementById(\"event-list-group\");\n \n var recipeContainer = document.createElement(\"div\");\n $(recipeContainer).addClass(\"recipe-container columns\");\n\n var RecipeImg = document.createElement(\"img\");\n RecipeImg.id = \"::img\";\n RecipeImg.style.cssText = \"width:300px;height:300px;\";\n $(RecipeImg).addClass(\"inline-img col-auto\");\n RecipeImg.src = Recipe.strMealThumb;\n recipeContainer.appendChild(RecipeImg);\n\n var contentDiv = document.createElement(\"div\");\n $(contentDiv).addClass(\"col-auto\");\n\n var RecipeIngredients = document.createElement(\"ul\");\n $(RecipeIngredients).addClass(\"inline-ul\");\n contentDiv.appendChild(RecipeIngredients);\n\n recipeContainer.appendChild(contentDiv);\n\n RecipeDiv.appendChild(recipeContainer);\n\n $(\"<label>\")\n .addClass(\"form-checkbox\")\n .html(\"<input class='recipe-checkbox' type='checkbox'><i class='form-icon'></i> Add Recipe\")\n .appendTo(contentDiv);\n\n\n var getIngredients = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strMeal\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getArea = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strArea\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getCategory = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strCategory\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getSource = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strSource\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n var getVideo = Object.keys(Recipe)\n .filter(function (ingredient) {\n return ingredient.indexOf(\"strYoutube\") == 0;\n })\n .reduce(function (ingredients, ingredient) {\n if (Recipe[ingredient] != null) {\n ingredients[ingredient] = Recipe[ingredient];\n }\n return ingredients;\n }, {});\n\n let value = getIngredients[\"strMeal\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = value;\n RecipeIngredients.appendChild(listItem);\n\n let area = getArea[\"strArea\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = area;\n RecipeIngredients.appendChild(listItem);\n\n let category = getCategory[\"strCategory\"];\n listItem = document.createElement(\"li\");\n listItem.innerHTML = category;\n RecipeIngredients.appendChild(listItem);\n\n let recipeSource = getSource[\"strSource\"];\n if (recipeSource) {\n var link = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe Link\")\n .attr(\"href\", `${recipeSource}`)\n .attr(\"target\", \"_blank\")\n .appendTo(link);\n }\n\n let recipeVideo = getVideo[\"strYoutube\"];\n if (recipeVideo) {\n var videolink = $(\"<li>\").appendTo(listItem);\n $(\"<a>\")\n .text(\"Recipe YouTube Video\")\n .attr(\"href\", `${recipeVideo}`)\n .attr(\"target\", \"_blank\")\n .appendTo(videolink);\n }\n}", "function populate_meal_editor(meal)\n{\n // Set the meal name, image path, and recipe fields/text areas\n var meal_name_iput = document.getElementById('meal_name_input');\n meal_name_iput.value = meal.name;\n var meal_image_path_input = document.getElementById('meal_image_input');\n meal_image_path_input.value = meal.image_path;\n var meal_instructions_text_area = document.getElementById('recipe_text_area');\n meal_instructions_text_area.value = meal.recipe;\n\n // Clear the current ingredient list and then populate it with the ingredients\n var ingredient_list = document.getElementById('ingredients_unordered_list')\n ingredient_list.innerHTML = \"\";\n\n for (var ingredient in meal.ingredients) {\n if (meal.ingredients.hasOwnProperty(ingredient)) {\n add_ingredient_element_to_list(ingredient_list, ingredient)\n }\n }\n\n // Setup the onclick functionality\n document.getElementById('ingredient_add_button').onclick = add_ingredient;\n}", "function buildList(){\n\t\t\tvar wrapper = document.getElementById('list-wrapper')\n\t\t\t//wrapper.innerHTML = ''\n\n\t\t\t//fetching data from backend\n\t\t\tvar url = 'http://127.0.0.1:8000/mydocuments/task-list/'\n\t\t\tvar urledit = 'http://127.0.0.1:8000/mydocuments/edit/'\n\n\t\t\tfetch(url)\n\t\t\t.then((resp) => resp.json())\n\t\t\t.then(function(data){\n\t\t\t\tconsole.log('Data001:', data) //display at console\n // render the data into the document\n\t\t\t\tvar list = data\n\t\t\t\tfor (var i in list){\n\n // check for exceptions\n\t\t\t\t\ttry{\n\t\t\t\t\t\tdocument.getElementById(`data-row-${i}`).remove()\n\t\t\t\t\t}catch(err){\n\n\t\t\t\t\t}\n\n\n // render title\n\n\t\t\t\t\tvar title = `<span class=\"title\">${list[i].title}</span>`\n\t\t\t\t\tvar type = `<span class=\"type\">${list[i].type}</span>`\n\t\t\t\t\tvar list_date = `<span class=\"list_date\">${list[i].list_date.substring(0,10)}</span>`\n var check01\n\n /*\n if (list[i].is_published == true){\n\t\t\t\t\t\ttitle = `<strike class=\"title\">${list[i].title}</strike>`\n\t\t\t\t\t}*/\n\n\n //console.log('** item =',list[i].title, list[i].is_published );\n\t\t\t\t\tif (list[i].is_published == true){\n\n\t\t\t\t\t\tcheck01 = `<input type=\"checkbox\" name=\"name-${i}\" id=\"${i}\" checked><span><label for=\"${i}\"></label></span>`\n }\n else{\n check01 = `<input type=\"checkbox\" name=\"name-${i}\" id=\"${i}\"><span><label for=\"${i}\"></label></span>`\n }\n\n // console.log('item =',i,list[i].is_published);\n\n\t\t\t\t\t// render individual items\n\t\t\t\t\tvar item = `\n\t\t\t\t\t\t<div id=\"data-row-${i}\" class=\"task-wrapper flex-wrapper\">\n\n\n <!-- display title -->\n\t\t\t\t\t\t\t<div style=\"flex:7\">${title}</div>\n\n <!-- display type -->\n\t\t\t\t\t\t\t<div style=\"flex:6\">${type}</div>\n\n <!-- display list_date -->\n\t\t\t\t\t\t\t<div style=\"flex:5\">${list_date}</div>\n\n <!-- display switch -->\n\t\t\t\t\t\t\t<div id=\"switch-row-${i}\" style=\"flex:3\">\n\t\t\t\t\t\t\t <div class=\"switch-button switch-button-xs\">\n\t\t\t\t\t\t\t ${check01}\n </div>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div style=\"flex:2\">\n\t\t\t\t\t\t\t <!-- <a href=\"${urledit}${list[i].id}\" class=\"badge badge-pill badge-success\">Edit</a> -->\n <a href=\"${urledit}${list[i].id}\" class=\"btn btn-sm btn-outline-dark edit\">Edit</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div style=\"flex:1\">\n\t\t\t\t\t\t\t\t<button class=\"btn btn-sm btn-outline-dark delete\">Delete</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`\n\t\t\t\t\twrapper.innerHTML += item\n\t\t\t\t}\n\n\nif (list_snapshot.length > list.length){\n\t\t\t\t\tfor (var i = list.length; i < list_snapshot.length; i++){\n\t\t\t\t\t\tdocument.getElementById(`data-row-${i}`).remove()\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlist_snapshot = list\n\n\n\t\t\t\tfor (var i in list){\n\t\t\t\t\tvar deleteBtn = document.getElementsByClassName('btn btn-sm btn-outline-dark delete')[i]\n\t\t\t\t\tvar publishSwitch = document.getElementById(`switch-row-${i}`)\n\t\t\t\t\tvar title = document.getElementsByClassName('title')[i]\n\n\t\t\t\t\tdeleteBtn.addEventListener('click', (function(item){\n\t\t\t\t\t\treturn function(){\n\t\t\t\t\t\t\tdeleteItem(item)\n\t\t\t\t\t\t}\n\t\t\t\t\t})(list[i]))\n\n\t\t\t\t\tpublishSwitch.addEventListener('click', (function(item){\n\t\t\t\t\t\treturn function(){\n\t\t\t\t\t\t\tchangePublishItem(item)\n\t\t\t\t\t\t}\n\t\t\t\t\t})(list[i]))\n\n\t\t\t\t\ttitle.addEventListener('click', (function(item){\n\t\t\t\t\t\treturn function(){\n\t\t\t\t\t\t\tclickTitleItem(item)\n\t\t\t\t\t\t}\n\t\t\t\t\t})(list[i]))\n\n\n\t\t\t\t}\n\nfunction deleteItem(item){\n\t\t\tconsole.log('Delete clicked item =', item)\n\n\t\t\tfetch(`http://127.0.0.1:8000/mydocuments/task-delete/${item.id}/`,\n\t\t\t{\n\t\t\t\tmethod:'DELETE',\n\t\t\t\theaders:{\n\t\t\t\t\t'Content-type':'application/json',\n\t\t\t\t\t'X-CSRFToken':csrftoken,\n\t\t\t\t}\n\t\t\t}).then((response) => {\n\t\t\t\tbuildList()\n\t\t\t})\n}\n\nfunction clickTitleItem(item){\n\t\t\tconsole.log('clicked item =', item.is_published)\n\t\t}\n\n\n\nfunction changePublishItem(item){\n //console.log('item =>', item)\n\t\t\tconsole.log('1. item.id =>', item.id)\n\t\t\tconsole.log('2. item.is_published =>', item.is_published)\n\n var new_ispublished = !item.is_published\n\t\t\t//item.is_published = !item.is_published\n\t\t\tconsole.log('3. new_ispublished =>', new_ispublished)\n\n\n\n\n\t\t\tfetch(`http://127.0.0.1:8000/mydocuments/task-update/${item.id}/`,\n\t\t\t{\n\t\t\t\tmethod:'POST',\n\t\t\t\theaders:{\n\t\t\t\t\t'Content-type':'application/json',\n\t\t\t\t\t'X-CSRFToken':csrftoken,\n\t\t\t\t},\n\t\t\t\tbody:JSON.stringify({'title':item.title, 'is_published':new_ispublished})\n\t\t\t}).then((response) => {\n\t\t\t\tbuildList()\n\t\t\t})\n\n\n\n\t\t}\n\n})\n}", "function populateList(choices) {\n // first empty the list\n acList.empty();\n // then add all choices as children\n choices.forEach( function(optionText) {\n var opt = $('<div>');\n opt.width(200);\n opt.html(optionText);\n opt.css('color', 'blue');\n opt.css('border', '1px solid blue');\n opt.css('background-color','white');\n opt.on('mouseover', function(){opt.css('background-color', 'yellow')});\n opt.on('mouseout', function(){opt.css('background-color', 'white')});\n opt.on('click', function(){\n acInput.val(optionText);\n if(options.click) options.click(optionText);\n acList.empty();\n });\n acList.append(opt);\n });\n }", "function buildStaffList(staff) {\n cleanContainer();\n $.each(staff, function(index, value) {\n createStaffCard(value);\n });\n $('#loadingMessage').remove();\n $('#directoryContainer').removeClass('hidden');\n }", "function populateTable() {\r\n\r\n\tvar tableContent = '';\r\n $.getJSON( '/cars', function( data ) {\r\n\t\r\n\t\t// Stick our user data array into a userlist variable in the global object\r\n\t\tcarListData = data;\r\n\t\t\r\n // For each item in our JSON, add a table row and cells to the content string\r\n $.each(data, function(){\r\n\t\t\ttableContent += '<tr>';\r\n\t\t\ttableContent += '<td>' + this.make + '</td>';\r\n\t\t\ttableContent += '<td>' + this.model + '</td>';\r\n\t\t\ttableContent += '<td>' + this.year + '</td>';\r\n\t\t\ttableContent += '<td>' + this.value + '</td>';\r\n\t\t\ttableContent += '<td>' + this.mileage + '</td>';\r\n\t\t\ttableContent += '<td>' + this.transmission + '</td>';\r\n\t\t\ttableContent += '<td>' + this.colour + '</td>';\r\n\t\t\ttableContent += '<td><a href=\"#\" class=\"linkdeletecar\" rel=\"' + this._id + '\">delete</a></td>';\r\n\t\t\ttableContent += '</tr>';\r\n });\r\n\r\n // Inject the whole content string into our existing HTML table\r\n $('#carList table tbody').html(tableContent);\r\n });\r\n}", "'click #view-medicines'(event, instance){\n\n temp_list = [];\n\t\tvar template = Template.instance();\n\t\tmedicine.remove({});\n\t\tvar pqr = myContract.medicineLength(function (err, res){\n\t\tconsole.log(res);\n\t\t\tfor(var i=0; i<res; i++)\n\t\t\t{\n\t\t\t\tmyContract.viewMedicine(i, function (err, res2){\n\t\t\t\t\tif(res2[1]!=\"\"){\n\t\t\t\t\t\t\tmedicine.insert({index:res2[0]['c'], name:res2[1], maxTemp:res2[2]['c'], minTemp:res2[3]['c']});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t})\n\n\t}", "function Cats() {\n /**\n * Navigates to the Cats Page.\n */\n this.navigate = function() {\n browser.get('http://localhost:3000/#cats');\n };\n\n /**\n * Returns a promise resolving to all the cats rows.\n * @return {!angular.$q.Promise} Promise with rows.\n */\n this.getCatRows = function() {\n return element.all(by.repeater('cat in cats'));\n };\n\n /**\n * H2 Header element at the top.\n * @type {!angular.JQLite}\n */\n this.h2Header = element(by.css('[ui-view] h2'));\n\n /**\n * Sidebar link on the left.\n * @type {!angular.JQLite}\n */\n this.activeSidebarLink = element(by.css('.norris-sidebar li.active a'));\n\n /**\n * \"Name\" form input in the table.\n * @type {!angular.JQLite}\n */\n this.inputCatName = element(by.model('editCat.name'));\n\n /**\n * \"Color\" form input in the table.\n * @type {!angular.JQLite}\n */\n this.inputCatColor = element(by.model('editCat.color'));\n\n /**\n * Button for adding a new Cat.\n * @type {!angular.JQLite}\n */\n this.addCatButton = element(by.buttonText('+'));\n}", "function CreateCat() {\n //Validate the pet name which must be present\n var sPetName=document.getElementById(\"inputPetName\").value;\n if (sPetName=='')\n {\n alert (\"Error, name missing\"); return;\n }\n\n //Determine if this cat has a scratching problem\n var scratches=document.getElementById(\"scratches\").checked;\n\n //Instantiate the Cat, which inherits from pet\n var Cat1= new Cat(sPetName, \"Cat\", scratches); //We are saying that \"Tiger\" is not the scratching kind of cat by passing false.\n\n console.log(Cat1.getInfo() + \" Can Scratch: \" + Cat1.getCanScratch());\n var warning=\"\";\n if (Cat1.getCanScratch()) warning=\"Warning - This cat can scratch!\";\n\n // Create a new list item to hold the pet\n var node = document.createElement(\"LI\");\n\n //Add an image to the pet\n var petImage = document.createElement(\"img\");\n petImage.setAttribute(\"src\", \"../img/cat.jpg\");\n petImage.setAttribute(\"height\", \"100\");\n petImage.setAttribute(\"width\", \"100\");\n node.appendChild(petImage);\n\n // Append the text to <li>\n var textnode = document.createTextNode(Cat1.getInfo() + \" \" + warning); // Create a text node\n node.appendChild(textnode);\n\n //Create a button to remove the pet\n var nodeButton = document.createElement(\"button\");\n nodeButton.innerHTML=\"remove\";\n nodeButton.className = \"button\";\n node.appendChild(nodeButton);\n\n //This will make our remove button work when it is clicked\n nodeButton.addEventListener('click', function(e) {\n e.currentTarget.parentNode.remove();\n }, false);\n\n // Append the text to the pet list\n document.getElementById(\"petObjects\").appendChild(node); // Append <li> to <ul> with id=\"myList\"\n\n //document.getElementById(\"output\").innerHTML=\"Added a new cat named \" + Cat1.getInfo() + \" \" + warning;\n}", "function renderCafe(doc){\n let li = document.createElement('li');\n let name = document.createElement('span');\n\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().name;\n \n\n li.appendChild(name);\n cafeList.appendChild(li);\n\n \n}" ]
[ "0.70023316", "0.68733466", "0.6830285", "0.6762316", "0.6643639", "0.65214336", "0.65027267", "0.6493298", "0.6473084", "0.64505863", "0.63219684", "0.6290712", "0.58831215", "0.57692075", "0.5597494", "0.5576444", "0.5563202", "0.55607176", "0.5525044", "0.5514034", "0.53895664", "0.53762484", "0.5340757", "0.52652854", "0.52514255", "0.521215", "0.52120924", "0.5184776", "0.517785", "0.5174755", "0.515329", "0.51491797", "0.51404893", "0.5115949", "0.5102402", "0.50984824", "0.50958127", "0.507273", "0.5065145", "0.50402546", "0.5029213", "0.5022174", "0.5010947", "0.5003342", "0.49850017", "0.49804848", "0.49668723", "0.49639013", "0.49618515", "0.4957586", "0.49516657", "0.4949798", "0.49486786", "0.49406728", "0.4931739", "0.49298018", "0.49262616", "0.492528", "0.4915025", "0.49104634", "0.49054256", "0.49019188", "0.49018756", "0.4901683", "0.48925447", "0.48902816", "0.48854843", "0.48833716", "0.487112", "0.48695827", "0.48647535", "0.48641625", "0.48641625", "0.48620772", "0.48466423", "0.4817987", "0.4816866", "0.48150063", "0.48138815", "0.4810307", "0.4809543", "0.48086745", "0.48062292", "0.48014432", "0.47955784", "0.4795261", "0.47931555", "0.47919396", "0.47915244", "0.4788481", "0.47865817", "0.47823933", "0.47810823", "0.4780709", "0.4778373", "0.47781742", "0.47689635", "0.47686157", "0.475986", "0.47593397" ]
0.8008406
0
This function does what its name implies, creates HTML for a given cupcake. It creates a list element,a button for deleting, and an image to hold the img of the cupcake
function createHTML(cupcake) { const cupcakeHTML = $(` <div class="card col-3 m-3 card-${cupcake.id}"> <h1 class="text-center">${cupcake.flavor}</h1> <img src="${cupcake.image}" class="card-img-top" id="cupcake-image"> <div class="card-body d-flex justify-content-center flex-column"> <h3>Size: <span class="h3-size ms-2">${cupcake.size}</span></h3> <h3>Rating: <span class="h3-rating ms-2">${cupcake.rating}</span></h3> <div class="d-flex flex-row"> <button class="btn btn-sm btn-success ms-2" id="edit-btn-${cupcake.id}" data-id="${cupcake.id}">Edit</button> <button class="btn btn-sm btn-danger ms-2" id="del-btn-${cupcake.id}" data-id="${cupcake.id}">X</button> </div> </div> </div> `); return cupcakeHTML; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCupcakeHTML(cupcake) {\r\n return `\r\n <div data-cupcake-id=${cupcake.id}>\r\n <li>\r\n ${cupcake.flavor} / ${cupcake.size} / ${cupcake.rating}\r\n <button class=\"delete-button\">X</button>\r\n </li>\r\n <img class=\"Cupcake-img\"\r\n src=\"${cupcake.image}\"\r\n alt=\"(no image provided)\">\r\n </div>\r\n `;\r\n}", "function generateAndAppendCupcakeHtml(cupcake) {\n let html = `\n <li>\n Flavor:${cupcake.flavor}, \n Rating: ${cupcake.rating}, \n Size: ${cupcake.size}\n </li>\n <img src=${cupcake.image}><img>\n `;\n $updateCupcakeList.append(html);\n}", "function buildBody() {\r\n \r\n $(\"#list\").html( //build button and category header\r\n `\r\n <br>\r\n <a href='../index.html'>\r\n <button id=\"button1\"><img src='../images/back.png' width=20px'>\r\n </img>Go Back!\r\n </button>\r\n </a>\r\n <h4><em>Animals from the ${catArr[rowID].catType} category</em></h4>\r\n \r\n `\r\n );\r\n\r\n $(\"#list\").addClass(\"list\"); //add #list to class 'list'\r\n\r\n//display animal name, scientific info, colors, and photo\r\n for (let i = 0; i < anmlArr.length; i++) {\r\n if (anmlArr[i].category == catArr[rowID].catType) {\r\n $(\"#list\").append(\r\n `\r\n <p>\r\n <strong>Name: ${anmlArr[i].animal}</strong> with scientific name of\r\n <em>${anmlArr[i].scientific}</em> and colors of: <em>${anmlArr[i].colors}</em><br>\r\n <img src='${anmlArr[i].photoDepiction}' width='100px' height='70px'></img><br>\r\n </p>\r\n \r\n `\r\n );\r\n };\r\n };\r\n\r\n}", "function createWishList(index){\r\n\tvar wishTable = document.getElementById(\"wishTable\");\r\n\tvar wishRow = wishTable.insertRow(index+1);\r\n\tvar itemImage = document.createElement('img');\r\n\tvar deleteButton = document.createElement('button');\r\n\tdeleteButton.setAttribute('content', 'test content');\r\n\tdeleteButton.setAttribute('class', 'btn');\r\n\tdeleteButton.innerHTML = 'X';\r\n\tdeleteButton.style.color = \"#FF8D48\";\r\n\tdeleteButton.style.fontSize = \"20px\";\r\n\tdeleteButton.style.border = \"none\";\r\n\tdeleteButton.style.width = \"100px\";\r\n\tdeleteButton.style.height = \"100px\";\r\n\tdeleteButton.style.backgroundColor = \"white\";\r\n\r\n\tdeleteButton.onclick = function(){deleteWishItems(index, wishTable)};\r\n\r\n\titemImage.src = \"images/\"+ wishItems[index].color + \".png\"\r\n\titemImage.style.height = '150px';\r\n\titemImage.style.width = '150px';\r\n\r\n\tvar itemI = wishRow.insertCell(0);\r\n\tvar itemN = wishRow.insertCell(1);\r\n\tvar itemS = wishRow.insertCell(2);\r\n\tvar itemC = wishRow.insertCell(3);\r\n\tvar itemP = wishRow.insertCell(4);\r\n\tvar itemD = wishRow.insertCell(5);\r\n\r\n\titemI.appendChild(itemImage);\r\n\titemN.innerHTML = wishItems[index].itemName;\r\n\titemS.innerHTML = wishItems[index].size;\r\n\titemC.innerHTML = wishItems[index].color;\r\n\titemP.innerHTML = \"$\" + itemPrice;\r\n\titemD.appendChild(deleteButton);\r\n\titemD.style.textAlign = \"right\";\r\n\r\n}", "async function makeCupcake() {\n\t// Get values\n\tconst flavor = $('#flavor').val();\n\tconst size = $('#size').val();\n\tconst rating = $('#rating').val();\n\tconst image = $('#image').val() ? $('#image').val() : null;\n\t// API POST Request\n\tif (image !== null) {\n\t\tconst response = await axios.post(BASE_URL, { flavor, size, rating, image });\n\t} else {\n\t\tconst response = await axios.post(BASE_URL, { flavor, size, rating });\n\t}\n\t// Append new cupcake to DOM\n\tcupcake = response.data.cupcake;\n\t$cupcakeList.prepend(makeLI(cupcake));\n}", "function createElem(foodElem)\n{\n\tvar listelem;\n\tvar elemName, elemNum, elemUnit, elemComm, elemPic;\n\n\tvar divL, divM, divR;\n\tvar elemImg;\n\tvar tplaceholder;\n\n\n\t// Div: Left\n\tdivL = document.createElement(\"div\");\n\tdivL.classList.add(\"food_div_L\");\n\n\telemImg = document.createElement(\"img\");\n\ttplaceholder = foodElem[4];\n\tif (tplaceholder.length > 0)\n\t{\n\t\telemImg.src = tplaceholder;\n\t}\n\telse\n\t{\n\t\telemImg.src = \"./images/forkAndKnife.png\";\n\t}\n\telemImg.classList.add(\"food_img\");\n\t\n\n\tdivL.appendChild(elemImg);\n\n\n\t// Div: Mid\n\tdivM = document.createElement(\"div\");\n\tdivM.classList.add(\"food_div_M\");\n\n\telemName = document.createElement(\"span\");\n\telemName.innerHTML = foodElem[0];\n\telemName.classList.add(\"food_name\");\n\n\telemComm = document.createElement(\"span\");\n\ttplaceholder = foodElem[3];\n\tif (tplaceholder.length > 0)\n\t{\n\t\telemComm.innerHTML = tplaceholder;\n\t}\n\telse\n\t{\n\t\telemComm.innerHTML = \"No Description.\";\n\t}\n\telemComm.classList.add(\"food_comments\");\n\n\tdivM.appendChild(elemName);\n\tdivM.appendChild(document.createElement(\"hr\"));\n\tdivM.appendChild(elemComm);\n\n\n\t// Div: Right\n\tdivR = document.createElement(\"div\");\n\tdivR.classList.add(\"food_div_R\");\n\n\t// divR.addEventListener(\"mousedown\", );\n\n\telemNum = document.createElement(\"div\");\n\telemNum.innerHTML = foodElem[1];\n\telemNum.classList.add(\"food_num\");\n\n\telemUnit = document.createElement(\"div\");\n\telemUnit.innerHTML = foodElem[2];\n\telemUnit.classList.add(\"food_unit\");\n\n\tdivR.appendChild(elemNum);\n\tdivR.appendChild(elemUnit);\n\n\n\tlistelem = document.createElement(\"li\");\n\tlistelem.classList.add(\"foodElem\");\n\n\t// listelem.addEventListener(\"mousedown\", listenerLM_SwipeDel);\n\tlistelem.addEventListener(\"click\", listener_clickElem)\n\n\tlistelem.appendChild(divL);\n\tlistelem.appendChild(divM);\n\tlistelem.appendChild(divR);\n\n\treturn listelem;\n}", "function draw(coffees) {\n\n var str = `<thead><tr>\n <th>Icon</th>\n <th>Name</th>\n <th>Description</th>\n <th>Price</th>\n <th>Stock</th>\n <th>Remove</th>\n </tr></thead>\n <tbody><tr>`;\n\n var str2 = JSON.stringify(coffees);\n\n var list = Object.keys(coffees);\n for (var i = 0; i < list.length; i++) {\n var coffee = coffees[list[i]];\n coffee.idProdus = Object.keys(coffees)[i];\n str += `<td><img src=\"${coffee.img}\" style=\"width: 40px; height: 40px\"/></td>\n <td style=\"width: 150px\"><button onclick='change(${JSON.stringify(coffee)}, ${i})'>${coffee.name}</button></td>\n <td><p>${coffee.description}</p></td>\n <td><p>${coffee.price}</p></td>\n <td><p>${coffee.stock}</p></td>\n <td style=\"width: 35px\"><button onclick='deleteItem(\"${coffee.idProdus}\", ${i})'>Delete</button></td>`\n if (i % 1 == 0) {\n str += ` </tr>\n <tr>`\n }\n }\n str += \"</tr></tbody>\";\n document.querySelector(\"#coffees table\").innerHTML = str;\n}", "function renderCafe(doc){\r\n let li = document.createElement('li');\r\n let todo = document.createElement('span');\r\n let deadline = document.createElement('span');\r\n let cross = document.createElement('button');\r\n li.setAttribute('data-id', doc.id);\r\n todo.textContent = doc.data().todo;\r\n deadline.textContent = doc.data().deadline;\r\n cross.textContent='Delete_this';\r\n li.appendChild(todo);\r\n li.appendChild(deadline);\r\n li.appendChild(cross);\r\nconsole.log(li);\r\n plan.appendChild(li);\r\n\r\n //deleting data\r\n cross.addEventListener('click',(e)=>{\r\n e.stopPropagation();\r\n let id = e.target.parentElement.getAttribute('data-id');\r\n db.collection(email1).doc(email1).collection('todo').doc(id).delete();\r\n });\r\n}", "function generateCat(){\r\n let cat = document.createElement('img')\r\n\r\n cat.src = 'images/cat.jpg'\r\n cat.alt = 'cat'\r\n cat.title = 'cute cat'\r\n\r\n document.getElementById('cats-box').appendChild(cat)\r\n}", "function generateDiyRecipeHTML(rec) {\n $(` \n <li data-recid=${rec.id} class=\"list-group-item\">\n <i class=\"diyDelete far fa-trash-alt mr-2 btn\"></i>\n <a class=\"diyRecipeLink btn\">${rec.name}</a> \n </li>`\n ).appendTo($diyList)\n }", "async function createCupcake() {\r\n let flavor = $flavor.val();\r\n let size = $size.val();\r\n let rating = $rating.val();\r\n let image = $ccImage.val();\r\n\r\n let newCupcake = {flavor,size,rating,image}\r\n await CupcakeList.createCupcake(newCupcake)\r\n await loadCupcakes();\r\n }", "function myRecipeCardMaker(text){\r\n if(my_recipe_cards){\r\n var card = document.createElement('div');\r\n card.className = 'card';\r\n card.innerHTML = '<div class=\"images\" style=\"background-image: url('+text.img+');\"></div>' +\r\n '<div class=\"name\">' +\r\n '<h1>'+text.name+'</h1>' +\r\n '</div>' +\r\n '<div class=\"other\">' +\r\n '<p><span>Description: </span><br>'+text.description+'</p>' +\r\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\r\n '<p><span>Instructions: </span><br>'+text.instructions+'</p>' +\r\n '<a href=\"view-recipe.html\" style=\"color:blue;cursor:pointer;\" onclick=\"view_recipe(\\'' +text.img+ '\\' , \\''+text.name+'\\' , \\'' +text.description+ '\\' , \\''+text.ingredients+'\\' , \\''+text.instructions+'\\')\">View more</a>' +\r\n '</div>' +\r\n '<div class=\"del-btn\">' +\r\n '<i class=\"fas fa-trash\" onclick=\"delMyRecipe(\\'' +text.img+ '\\' , \\''+text.name+'\\' , \\'' +text.description+ '\\' , \\''+text.ingredients+'\\' , \\''+text.instructions+'\\')\"></i>' +\r\n '</div>';\r\n my_recipe_cards.appendChild(card); \r\n } \r\n}", "function drawCats() {\r\n loadCats()\r\n\r\n let catElem = document.getElementById(\"moody-cats\")\r\n let catTemplate = \"\"\r\n\r\n catArray.forEach(newCat => {\r\n catTemplate +=\r\n `\r\n <div class=\"cat-border bg-dark kitten ${newCat.mood} text-light\">\r\n <img class = \"kitten\" src = \"https://robohash.org/${newCat.name}?set=set4&size=150x150\">\r\n <div class = \"d-flex justify-content-center\">Name: ${newCat.name}</div>\r\n <div class = \"d-flex justify-content-center\">Mood: ${newCat.mood}</div>\r\n <div class = \"d-flex justify-content-center\">Affection: ${newCat.affection}</div>\r\n <div class=\"d-flex space-between\"></div>\r\n <button class=\"btn-cancel m-1\" onclick=\"pet('${newCat.id}')\">Pet cat</button>\r\n <button class=\"m-1\" onclick=\"catnip('${newCat.id}')\">Catnip</button>\r\n <div class=\"d-flex justify-content-center\"><i class=\"action fa fa-trash text-danger\" onclick=\"removeCat('${newCat.id}')\"></i></div>\r\n </div>\r\n </div>\r\n `\r\n }\r\n )\r\n catElem.innerHTML = catTemplate\r\n}", "function createContent(cafe) {\n\tvar popupData = \"<h3>\" + cafe.name + \"</h3>\" +\n\t\t\"<div>\"+cafe.location+\"</div>\" +\t\t\n\t\t\"<div class='donuts'>Nearby Donuts Shops</div>\";\n\treturn popupData;\n}", "function genereateDeleteCircle() {\n let img = gen('img');\n img.src = TODOLISTURL + 'X.png';\n img.alt = 'Event delete box';\n img.classList.add('deleteBox');\n img.addEventListener('click', deleteTask)\n return img;\n }", "function createHTMLThumb(obj,i){\n var btn = document.createElementNS(\"http://www.w3.org/1999/xhtml\", \"div\");\n btn.setAttribute(\"style\",\"width:135px; height: auto;text-align: center; position: relative;\");\n btn.setAttribute(\"class\", \"ok-button\");\n btn.setAttribute(\"type\", \"button\");\n btn.setAttribute(\"onclick\", \"showPrev( \\\"\"+obj.name+\"\\\", \"+obj.DownVotes+\", \"+obj.UpVotes+\", \\\"\"+obj.date+\"\\\", \\\"\"+obj.usage+\"\\\", \\\"\"+obj.Tags+\"\\\", \"+JSON.stringify(obj.json).toString()+\", \\\"\"+obj.patternType+\"\\\");\");\n \n setSmallContainer(btn);\n switch (obj.patternType){\n case \"pv\":\n baseShiftPV = (SmallfixWidthPV+10)*i;\n drawSmallPV(obj.name, JSON.stringify(obj.json));\n break;\n case \"comco\":\n baseShiftComco = (SmallfixWidth+Smalldeltax)*i;\n drawSmallCompCo(obj.name, obj.json);\n break;\n case \"mulco\":\n baseShiftMulco = (SmallfixWidth)*i;\n drawSmallMulco(obj.name, obj.json);\n break;\n baseShift = 0;\n }\n \n return btn;\n}", "function todoList(todoItem) {\r\n\r\n var todoObj = todoItem.data();\r\n \r\n todoObj.id = todoItem.id;\r\n\r\n\r\n var p = document.createElement('p');\r\n\r\n var textNode = document.createTextNode(todoObj.todo);\r\n\r\n p.appendChild(textNode);\r\n p.setAttribute('id', todoObj.id);\r\n getDiv.appendChild(p);\r\n\r\n var EditBtn = document.createElement('button');\r\n var EditTextnode = document.createTextNode('Edit Item');\r\n EditBtn.appendChild(EditTextnode);\r\n p.appendChild(EditBtn);\r\n EditBtn.setAttribute('onclick' , 'EditNode(this)');\r\n\r\n var deleteBtn = document.createElement('button');\r\n var deleteTextNode = document.createTextNode(\"delete\");\r\n deleteBtn.appendChild(deleteTextNode);\r\n deleteBtn.setAttribute('onclick' , 'deleteItem(this)');\r\n p.appendChild(deleteBtn);\r\n\r\n var todoImage = document.createElement('img');\r\n todoImage.setAttribute('src' , todoObj.image);\r\n todoImage.setAttribute('width' , '50px');\r\n todoImage.setAttribute('height' , '50px');\r\n console.log(todo)\r\n p.appendChild(todoImage);\r\n\r\n\r\n}", "function createHtmlForCatagory(){\n\t\t\tvar query = CatagoryTable.where({});\n\t\t /*var query = todoItemTable.where(function(dated){\n\t\t\t\t\t\t\t\t\t\t\treturn this.id <= dated\n\t\t\t\t\t\t\t\t\t\t\t},2);*/\n\t\t\t\n\t\t\tquery.read().then(function(todoItems) {\n\t\t\t\tvar listItems = $.map(todoItems, function(item) {\n\t\t\t\t\t\n\t\t\t\t\t\tvar html='';\n\t\t\t\t\t\t\thtml +='<tr class=\"panel panel-default\" data-id=\"'+item.id+'\">';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\thtml +='<td> '+item.name+'</td>';\n\t\t\t\t\t\t\thtml +='<td> '+item.short_description+'</td>';\n\t\t\t\t\t\t\thtml +='<td> '+statusProd[item.status]+'</td>';\n\t\t\t\t\t\t\thtml +=\"<td><span class='col-lg-1'><span class='glyphicon glyphicon-edit edit' data-id='\"+item.id+\"' data-name='\"+item.name+\"' data-short_description='\"+item.short_description+\"' data-status='\"+item.status+\"' data-catagory_images='\"+item.catagory_images+\"' ></span></span><span class='col-lg-1'><span class='delete glyphicon glyphicon-remove-circle' data-id='\"+item.id+\"'></span></span></td>\";\n\t\t\t\t\t\t\thtml +='</tr>';\n\t\t\t\t\t\treturn $(html)\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t $('#todo-items').empty().append(listItems).toggle(listItems.length > 0);\n\t\t\t\t $('.preLoader').hide();\n\t\t\t\n\t\t\t}, handleError);\n \n\t\t}", "function createDeleteButton() {\n const deleteButtonElement = document.createElement('button');\n deleteButtonElement.className = \"btn bg-transparent delete-button\";\n\n const trashImgElement = document.createElement(\"img\");\n trashImgElement.src = \"images/recycle.png\";\n\n deleteButtonElement.appendChild(trashImgElement);\n return deleteButtonElement;\n}", "function createHTML(postsData) {\n var ourHTMLString = '';\n var thumbUrl = '';\n\n ourHTMLString = \"<ul class=listado_equipo>\";\n for (i = 0; i < postsData.length; i++) {\n\n if(postsData[i].better_featured_image != null){\n thumbUrl = postsData[i].better_featured_image.source_url;\n }else{\n thumbUrl = 'http://www.carey.cl/wp-content/uploads/2010/01/no-image-133x166.jpg';\n }\n\n //console.log(thumbUrl);\n ourHTMLString += '<li><div class=click-to-top><img src='+ thumbUrl + ' width=197 height=247 class=lazy /><div><span>' + postsData[i].title.rendered +'<br>'+ postsData[i].acf.cargo_esp +'</span></div></div></li>';\n //ourHTMLString += postsData[i].content.rendered;\n\n }\n ourHTMLString += \"</ul>\";\n equipo.innerHTML = ourHTMLString;\n}", "function addDelButton(itemNo) { \t\t\t\t\t\t\t\t// itemNo targets specific list item\n\t\tvar delBut = document.createElement(\"img\");\t\t\t\t\t// create element\n\t\tdelBut.name = \"delBut\" + itemNo;\t\t\t\t\t\t\t// fill in element details\n\t\tdelBut.src = \"https://raw.github.com/WhatTheFunkNGC/colabhang/master/lister/img/deleteBtn.jpg\";\n\t\tdelBut.width = 25;\n\t\tdelBut.height = 25;\n\t\tdelBut.align = \"top\";\n\t\tdelBut.onclick = function() { \t\t\t\t\t\t\t\t// on click calls remove function with param targeting the specific line\n\t\t\t\tconsole.log(\"Delete Press\");\n\t\t\t\tremoveItemFromList(\"listTxt\",itemNo);\n\t\t}; \n\t\treturn delBut;\t\t\t\t\t\t\t\t\t\t\t\t// return button element\n\t}", "function createItem(data){\n l = document.createElement('li');\n var card = document.createElement('div');\n card.className = \"ui card small-item\";\n l.appendChild(card);\n var d_img = document.createElement('div');\n d_img.className = \"blurring dimmable image small-item\";\n card.appendChild(d_img);\n var img = document.createElement('img');\n img.src = \"/uploads/covers/\" + data.cover;\n d_img.appendChild(img);\n var d_dimmer = document.createElement('div');\n d_dimmer.className = \"ui dimmer\";\n var d_cotent = document.createElement('div');\n d_cotent.className = \"content\";\n d_dimmer.appendChild(d_cotent);\n var i_icon = document.createElement('i');\n i_icon.className = \"large play icon\";\n d_cotent.appendChild(i_icon);\n d_img.appendChild(d_dimmer);\n var p = document.createElement('p');\n p.align = \"center\";\n p.innerHTML = data.name;\n l.appendChild(p);\n l.onclick = function(){\n return window.location.href=\"/music?music_id=\"+data._id;\n };\n}", "function createEntry(listTitle, entryName, urlStr, entryID, backGroundColor){\r\n let entry = mySubWindow.document.createElement(\"div\");\r\n let userList = mySubWindow.document.getElementById(\"userList\");\r\n entry.id = \"container\";\r\n let entryImage = mySubWindow.document.createElement(\"img\");\r\n if (urlStr == null || urlStr == \"null\") {\r\n entryImage.src = \"https://i.imgur.com/wiUoT13.png\"\r\n }else{\r\n entryImage.src = basePosterURL + \"w92\" + urlStr;\r\n }\r\n entryImage.className = \"center-img\";\r\n entry.appendChild(entryImage);\r\n \r\n let dText = mySubWindow.document.createElement(\"div\");\r\n let title = mySubWindow.document.createElement(\"h2\");\r\n entry.style.backgroundColor=backGroundColor\r\n let removeBtn = mySubWindow.document.createElement(\"button\");\r\n removeBtn.className = \"btn btn-outline-danger\"\r\n removeBtn.innerHTML = \"remove\"\r\n removeBtn.onclick = function() {\r\n removeEntry(listTitle, entryName, entryID)\r\n }\r\n\r\n let upArrCon = mySubWindow.document.createElement(\"p\");\r\n \r\n let downArrCon = mySubWindow.document.createElement(\"p\")\r\n let upArr = mySubWindow.document.createElement(\"i\")\r\n let downArr = mySubWindow.document.createElement(\"i\")\r\n let upBtn = mySubWindow.document.createElement(\"button\");\r\n let downBtn = mySubWindow.document.createElement(\"button\");\r\n\r\n \r\n upArrCon.id = \"arrOffset\";\r\n downArrCon.id = \"arrOffset\";\r\n upBtn.id = \"upArrow\"\r\n downBtn.id =\"downArrow\"\r\n\r\n upArr.className = \"arrow up\";\r\n \r\n upBtn.onclick = function() {\r\n changeOrder(listTitle, entryName, entryID,\"up\")\r\n }\r\n downBtn.onclick = function() {\r\n changeOrder(listTitle, entryName, entryID,\"down\")\r\n }\r\n\r\n downArr.className = \"arrow down\";\r\n upBtn.appendChild(upArr);\r\n downBtn.appendChild(downArr);\r\n upArrCon.appendChild(upBtn);\r\n downArrCon.appendChild(downBtn);\r\n\r\n dText.className = \"center-txt\";\r\n title.textContent = entryName;\r\n dText.appendChild(title);\r\n dText.append(removeBtn);\r\n dText.appendChild(upArrCon);\r\n dText.appendChild(downArrCon);\r\n \r\n entry.appendChild(dText);\r\n\r\n let tableRow = mySubWindow.document.createElement(\"tr\");\r\n let tableOrder = mySubWindow.document.createElement(\"td\");\r\n let orderText = mySubWindow.document.createElement(\"h1\");\r\n orderText.style.textAlign = \"center\";\r\n orderText.innerHTML = totalEntryCount + 1;\r\n orderText.className=\"tableElement\"\r\n tableOrder.appendChild(orderText);\r\n let tableTitle = mySubWindow.document.createElement(\"td\");\r\n tableTitle.appendChild(entry)\r\n tableTitle.style.width=\"100%\"\r\n tableRow.appendChild(tableOrder);\r\n tableRow.appendChild(tableTitle);\r\n userList.appendChild(tableRow);\r\n}", "function catGenerator(){\n var img = document.createElement('img');\n var div = document.getElementById('flex-img');\n img.src=\"emoji.png\";\n \n img.setAttribute('id' , 'image')\n div.appendChild(img);\n}", "function generateCat() {\n let image = document.createElement('img');\n let div =document.getElementById('flex-cat-gen');\n image.src = \"./static/images/tenor.gif\"\n div.appendChild(image);\n}", "function renderCafe(doc) {\n let li = document.createElement('li');\n li.setAttribute('data-id', doc.id);\n\n let name = document.createElement('span');\n name.textContent = doc.data().name;\n li.appendChild(name);\n\n let city = document.createElement('span');\n city.textContent = doc.data().city;\n li.appendChild(city);\n\n let deleteButton = document.createElement('div');\n deleteButton.textContent = 'x';\n li.appendChild(deleteButton);\n deleteButton.addEventListener('click', (evt) => {\n evt.stopPropagation();\n let id = evt.target.parentElement.getAttribute('data-id');\n db.collection('cafes').doc(id).delete();\n })\n\n cafeList.append(li);\n}", "function renderCafe(doc) {\n let li = document.createElement('li')\n let name = document.createElement('span')\n let city = document.createElement('span')\n // creating element for deleting\n let cross = document.createElement('div')\n\n li.setAttribute('data-id', doc.id) // to get the document's ID from firestore\n // setting the text contents for the elts we created\n name.textContent = doc.data().name\n city.textContent = doc.data().city\n cross.textContent = 'x'\n\n // next, gotta append the name & city to the li\n li.appendChild(name)\n li.appendChild(city)\n li.appendChild(cross)\n\n // lastly, gotta append the li we created to the ul element of cafeList\n cafeList.appendChild(li)\n\n // deleting data\n cross.addEventListener('click', (e) => {\n let id = e.target.parentElement.getAttribute(\"data-id\") // note that this 'data-id' is actually the doc.id... ref line 22\n db.collection('cafes').doc(id).delete()\n })\n}", "function fruitShow(){\n var fruit = document.getElementById('fruit-list');\n console.log(fruit);\n for(var i = 0; i < fruitStand.length; i++) {\n var createListEle = fruitStand[i].createLi();\n fruit.appendChild(createListEle);\n var genImg = fruitStand[i].showImage();\n fruit.appendChild(genImg);\n }\n}", "function CreateCat() {\n //Validate the pet name which must be present\n var sPetName=document.getElementById(\"inputPetName\").value;\n if (sPetName=='')\n {\n alert (\"Error, name missing\"); return;\n }\n\n //Determine if this cat has a scratching problem\n var scratches=document.getElementById(\"scratches\").checked;\n\n //Instantiate the Cat, which inherits from pet\n var Cat1= new Cat(sPetName, \"Cat\", scratches); //We are saying that \"Tiger\" is not the scratching kind of cat by passing false.\n\n console.log(Cat1.getInfo() + \" Can Scratch: \" + Cat1.getCanScratch());\n var warning=\"\";\n if (Cat1.getCanScratch()) warning=\"Warning - This cat can scratch!\";\n\n // Create a new list item to hold the pet\n var node = document.createElement(\"LI\");\n\n //Add an image to the pet\n var petImage = document.createElement(\"img\");\n petImage.setAttribute(\"src\", \"../img/cat.jpg\");\n petImage.setAttribute(\"height\", \"100\");\n petImage.setAttribute(\"width\", \"100\");\n node.appendChild(petImage);\n\n // Append the text to <li>\n var textnode = document.createTextNode(Cat1.getInfo() + \" \" + warning); // Create a text node\n node.appendChild(textnode);\n\n //Create a button to remove the pet\n var nodeButton = document.createElement(\"button\");\n nodeButton.innerHTML=\"remove\";\n nodeButton.className = \"button\";\n node.appendChild(nodeButton);\n\n //This will make our remove button work when it is clicked\n nodeButton.addEventListener('click', function(e) {\n e.currentTarget.parentNode.remove();\n }, false);\n\n // Append the text to the pet list\n document.getElementById(\"petObjects\").appendChild(node); // Append <li> to <ul> with id=\"myList\"\n\n //document.getElementById(\"output\").innerHTML=\"Added a new cat named \" + Cat1.getInfo() + \" \" + warning;\n}", "function renderCafe1(doc){\r\n let li = document.createElement('li');\r\n \r\n let doing = document.createElement('span');\r\n let deadline1 = document.createElement('span');\r\n let cross = document.createElement('button');\r\n li.setAttribute('data-id', doc.id);\r\n doing.textContent = doc.data().doing;\r\n deadline1.textContent = doc.data().deadline1;\r\n cross.textContent='Delete_this';\r\n li.appendChild(doing);\r\n li.appendChild(deadline1);\r\n li.appendChild(cross);\r\n console.log(li);\r\n plan1.appendChild(li);\r\n cross.addEventListener('click',(e)=>{\r\n e.stopPropagation();\r\n let id = e.target.parentElement.getAttribute('data-id');\r\n db.collection(email1).doc(email1).collection('doing').doc(id).delete();\r\n });\r\n\r\n}", "function viewRecipeCardMaker(text){\r\n if(view_recipe_card){\r\n var card = document.createElement('div');\r\n card.className = 'big-card';\r\n card.innerHTML = '<div class=\"big-image\" style=\"background-image: url('+text.img+');\"></div>' +\r\n '<div class=\"name\">' +\r\n '<h1>'+text.name+'</h1>' +\r\n '</div>' +\r\n '<div class=\"view-other\">' +\r\n '<p><span>Description: </span><br>'+text.description+'</p>' +\r\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\r\n '<p><span>Instructions: </span><br>'+text.instructions+'</p>' +\r\n '</div>';\r\n view_recipe_card.appendChild(card);\r\n } \r\n}", "function createListItem(){\r\n //use createElement to create all the buttons \r\n console.log(\"create a item...\");\r\n\tvar listItem=document.createElement(\"li\");\r\n\tvar checkBox=document.createElement(\"input\");\r\n\tvar label=document.createElement(\"label\");\r\n\tvar inputText=document.createElement(\"input\");\r\n\tvar editButton=document.createElement(\"button\");\r\n\tvar deleteButton=document.createElement(\"button\");\r\n\t\r\n\r\n\t//set type information\r\n\tcheckBox.type=\"checkbox\";\r\n\tinputText.type=\"text\";\r\n\teditButton.className=\"edit\";\r\n\tdeleteButton.className=\"delete\";\r\n\teditButton.innerText=\"Edit\";\r\n\tdeleteButton.innerText=\"Delete\";\r\n label.innerText=input.value;\r\n\r\n\t//append buttons to listItem\r\n\t//well,have to follow the order- -!\r\n\tlistItem.appendChild(checkBox);\r\n\tlistItem.appendChild(label);\r\n\tlistItem.appendChild(inputText);\r\n\tlistItem.appendChild(editButton);\r\n\tlistItem.appendChild(deleteButton);\r\n\t\r\n\r\n\treturn listItem;\r\n\t\r\n\r\n}", "function renderCafe2(doc){\r\nlet li = document.createElement('li');\r\n\r\nlet done = document.createElement('span');\r\nlet deadline2 = document.createElement('span');\r\nlet cross = document.createElement('button');\r\nli.setAttribute('data-id', doc.id);\r\ndone.textContent = doc.data().done;\r\ndeadline2.textContent = doc.data().deadline2;\r\ncross.textContent='Delete_this';\r\nli.appendChild(done);\r\nli.appendChild(deadline2);\r\nli.appendChild(cross);\r\nconsole.log(li);\r\nplan2.appendChild(li);\r\n\r\ncross.addEventListener('click',(e)=>{\r\n e.stopPropagation();\r\n let id = e.target.parentElement.getAttribute('data-id');\r\n db.collection(email1).doc(email1).collection('done').doc(id).delete();\r\n});\r\n}", "function myRecipeCardMaker(text) {\n if(my_recipe_cards){\n let card = document.createElement('div');\n let delBtn = document.createElement('div');\n let i = document.createElement('i');\n\n delBtn.className = \"del-btn\";\n i.className = \"fas fa-trash\";\n\n card.className = 'card';\n card.innerHTML = '<div class=\"images\" style=\"background-image: url('+text.img+');\"></div>' +\n '<div class=\"name\">' +\n '<h1>'+text.name+'</h1>' +\n '</div>' +\n '<div class=\"other\">' +\n '<p><span>Description: </span><br>'+text.description+'</p>' +\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\n '<p><span>Instructions: </span><br>'+text.instructions+'</p>' +\n '<a href=\"view-recipe.html\" style=\"color:blue;cursor:pointer;\" onclick=\"view_recipe(\\'' +text.img+ '\\' , \\''+text.name+'\\' , \\'' +text.description+ '\\' , \\''+text.ingredients+'\\' , \\''+text.instructions+'\\')\">View more</a>' +\n '</div>';\n\n delBtn.appendChild(i);\n card.appendChild(delBtn);\n my_recipe_cards.appendChild(card); \n\n delBtn.addEventListener(\"click\", () => {\n delMyRecipe(text.img, text.name, text.description, text.ingredients, text.instructions);\n });\n } \n}", "function createAToy() {\n const toyEl = document.createElement('div')\n toyEl.className = 'card'\n const name = inputName.value\n const image = inputImage.value\n\n toyEl.innerHTML = `\n <h2>${name}</h2>\n <img src=${image} class=\"toy-avatar\" />\n <p class=\"num-of-likes\">0 likes </p>\n <button class=\"like-btn\">Like <3</button>\n <!-- <button class=\"delete-btn\">Delete</button> -->\n `;\n toyCollection.appendChild(toyEl);\n addAToy(name, image)\n}", "function generateItemHTML(item) {\r\n var itemId = item.id;\r\n var html = \"<div class='indentItems'>\";\r\n html += \" <div class='leftCell' id='cellItem_\" + itemId + \"'>\";\r\n html += \" <h3>\" + item.itemName + \"</h3><br/>\";\r\n html += \" <img src='../images/\" + item.itemImage.name + \"' height='100' width='100'/><br/>\";\r\n html += \" <label>\" + item.itemDesc + \"</label><br/>\";\r\n html += \" <label><b>&pound;\" + item.itemPrice + \"</b></label><br/>\";\r\n html += \" </div>\";\r\n //admin controls, only available on crud page\r\n html += \" <div class='adminView' id='adminCellItem_\" + itemId + \"'>\";\r\n html += \" <button type='button' class='btn btn-danger deleteAction'>Delete</button><br/>\";\r\n html += \" <button type='button' class='btn btn-info updateActionItem'>Update</button><br/>\";\r\n html += \" </div>\";\r\n //checkbox to add to compare div\r\n html += \" <div class='checkbox'><input class='cellChkbox' type='checkbox' name='compare' value='Add to Compare' id='compareCheckBox_\" + itemId + \"'/><label for='compareCheckBox_\" + itemId + \"'> Add to compare</label></div>\";\r\n //checkbox to add to watchlist\r\n html += \" <div id='watchItem_\" + itemId + \"' class='checkbox'><input class='watchChkbox' type='checkbox' name='watch' value='Add to Watchlist' id='watchCheckBox_\" + itemId + \"'/><label for='watchCheckBox_\" + itemId + \"'> Add to watchlist</label></div>\";\r\n html += \" <div class='buyItem'><button id='buy' class='btn btn-success buy' value='Buy'>Buy</button></div>\";\r\n html += \" </div>\";\r\n \r\n return html;\r\n}", "function generateCatto() {\n var image = document.createElement('img'); \n var div = document.getElementById('cat-flex-gen'); \n image.src = \"http://thecatapi.com/api/images/get?format=src&type=gif&size=small\"\n div.appendChild(image);\n}", "function renderCafe(doc) {\n\tlet li = document.createElement('li');\n\tlet name = document.createElement('span');\n\tlet city = document.createElement('span');\n\tlet cross = document.createElement('div');\n\t// setting data into our element/attribute\n\tli.setAttribute('data-id', doc.id);\n\tname.textContent = doc.data().name;\n\tcity.textContent = doc.data().city;\n\tcross.textContent = 'x';\n\t// append our elements\n\tli.appendChild(name);\n\tli.appendChild(city);\n\tli.appendChild(cross);\n\t//append to cafeList - document\n\tcafeList.appendChild(li);\n\n\t//delete data by Id from firestore db\n\tcross.addEventListener('click', (e) => {\n\t\te.stopPropagation();\n\t\tlet id = e.target.parentElement.getAttribute('data-id');\n //console.log(id);\n db.collection('cafes').doc(id).delete();\n\t})\n}", "async function loadCupcakes() {\r\n let response = await CupcakeList.getCupcakes();\r\n cupcakes = response;\r\n console.log(cupcakes)\r\n $cupcakeList.empty();\r\n\r\n for (let cc of cupcakes.cupcakes) {\r\n console.log(cc)\r\n const html = createHTML(cc);\r\n $cupcakeList.append(html);\r\n let delBtn = document.getElementById(`del-btn-${cc.id}`);\r\n delBtn.addEventListener(\"click\",deleteCupcake);\r\n let editBtn = document.getElementById(`edit-btn-${cc.id}`);\r\n editBtn.addEventListener(\"click\",showEditForm);\r\n }\r\n }", "function cat_generate(){\n var image = document.createElement('img');\n image.setAttribute('id','cat_gen');\n var div = document.getElementById('flex-cat-gen');\n image.src=\"http://thecatapi.com/api/images/get?format=src&type=gif&size=small\";\n div.appendChild(image);\n }", "function generateProductsHTML(index, item) {\n return `<div class=\"product-container\" position=${index}>\n <img class=\"product-image\" id=\"image${item.id}\" src=\"${item.image}\">\n <div class=\"productInfo-container\">\n <div class=\"product-name\">${item.name}</div>\n <div class=\"product-price\">${item.price}</div>\n </div>\n <div class=\"product-buy\" id=\"${item.id}\">${item.button_text}</div> \n </div>`\n}", "function createListElement() {\n\tvar li = document.createElement(\"li\");\n\tvar delbtn=document.createElement(\"button\");\n delbtn.appendChild(document.createTextNode(\"DELETE\"));\n\tli.appendChild(document.createTextNode(input.value));\n\tli.appendChild(delbtn);\n\n\tul.appendChild(li);\n\tinput.value = \"\";\n\tdelbtn.onclick=removeParent;\n}//this will create the delte button for every new element in the list", "function createListHTML(list, container) {\n container.innerHTML = \"\"; //first, clean up any existing LI elements\n for (var i = 0; i < 6; i++) {\n\n container.innerHTML = container.innerHTML + \"<li class=\\\"up\\\" data-index='\" + list[i][\"id\"] + \"'>\" + \"<span>\" + list[i][\"text\"] + \"</span>\" + \"</li>\";\n\n\n //OR shorter version: container.innerHTML += \"<li class=\"upper\" data-index='\" + list[i][\"\"id\"\"] + \"'>\" + list[i][\"text\"] + \"</li>\";\n }\n }", "function displayPets(pets) {\n\n var pet_collection = document.getElementById(\"pet_collection\");\n console.log(pets);\n \n //clone the template content, fill with values, add the remaining dynamic data, and append to parent:\n for (var i = 0; i < pets.length; i++) {\n\n var template_pet = document.getElementById(\"template_pet\").content.cloneNode(true);\n\n //img element:\n var pet_image = template_pet.getElementById(\"pet_image\");\n\n\n console.log(\"Images for item\" + i + pets[i].Images.length);\n\n //check if there's an uploaded image for the pet\n var isAvailable = pets[i].Images.length > 0 && pets[i].Images[0].Image != \"\";\n //show default if none\n var image = isAvailable ?\n \"data:image;base64,\" + pets[i].Images[0].Image :\n \"../Content/images/clickme.png\";\n\n pet_image.setAttribute(\"src\", image);\n \n var petId = pets[i].Id;\n //visible name span:\n var span_name = template_pet.getElementById(\"span_name\");\n span_name.textContent = pets[i].Name;\n\n\n //details indicator:\n var italicizedText = document.createElement(\"i\");\n italicizedText.setAttribute(\"class\", \"materialize-icons right\");\n italicizedText.textContent = \"details\";\n span_name.appendChild(italicizedText);\n\n //to be revealed:\n var span_name_reveal = template_pet.getElementById(\"span_name_reveal\");\n span_name_reveal.textContent = pets[i].Name;\n var italicizedClose = italicizedText.cloneNode(true);\n italicizedClose.textContent = \"close\";\n span_name_reveal.appendChild(italicizedClose);\n\n //item general information\n var p_kind = template_pet.getElementById(\"p_kind\");\n p_kind.setAttribute(\"id\", \"item\" + petId + \"_kind\");\n p_kind.textContent = \"Category: \" + pets[i].Kind;\n var p_breed = template_pet.getElementById(\"p_breed\");\n p_breed.setAttribute(\"id\", \"pet\" + petId + \"_breed\");\n p_breed.textContent = \"Brand: \" + pets[i].Breed;\n\n //the \"additional info\" vector:\n var ul_constraints = template_pet.getElementById(\"ul_extra_infos\");\n pets[i].Constraints.forEach((constraint) => {\n var listItem = document.createElement(\"li\");\n listItem.setAttribute(\"class\", \"collection-item black-text\");\n listItem.textContent = constraint.Description;\n ul_constraints.appendChild(listItem);\n });\n\n \n \n var divReveal = template_pet.getElementById(\"div_reveal\");\n var divButton = document.createElement(\"div\");\n divButton.setAttribute(\"class\", \"center\");\n divButton.setAttribute(\"style\", \"margin-bottom:20px;\");\n\n var btnAction = document.createElement(\"button\");\n btnAction.setAttribute(\"class\", \"btn orange black-text darken-2\");\n\n //index has this search div, manage user items view doesn't; to distinguish the 2 views\n if (document.getElementById(\"div_search\") != null) {\n btnAction.textContent = \"add to favorites\";\n } else {\n btnAction.textContent = \"Delete Item\";\n btnAction.addEventListener(\"click\", deletePet(pets[i].Id)); \n }\n \n divButton.appendChild(btnAction);\n divReveal.appendChild(divButton);\n pet_collection.appendChild(template_pet);//the parent element in the document\n\n }\n\n }", "function renderCoffee(coffee) {\n\n var html = '<div class=\"product-container\">';\n // html += '<span>' + coffee.id + '</span>';\n html += '<h1 class=\"product-name\">' + coffee.name + '</h1>';\n html += '<p class=\"product-roast\">' + coffee.roast + '</p>';\n html += '</div>';\n\n return html;\n}", "function createCart(index){\r\n\tvar cartTable = document.getElementById(\"cartTable\");\r\n\tvar cartRow = cartTable.insertRow(index+1);\r\n\tvar itemImage = document.createElement('img');\r\n\tvar deleteButton = document.createElement('button');\r\n\tdeleteButton.setAttribute('content', 'test content');\r\n\tdeleteButton.setAttribute('class', 'btn');\r\n\tdeleteButton.innerHTML = 'X';\r\n\tdeleteButton.style.color = \"#FF8D48\";\r\n\tdeleteButton.style.fontSize = \"20px\";\r\n\tdeleteButton.style.border = \"none\";\r\n\tdeleteButton.style.width = \"100px\";\r\n\tdeleteButton.style.height = \"100px\";\r\n\tdeleteButton.style.backgroundColor = \"white\";\r\n\r\n\t/* Add delete button for each item */\r\n\r\n\tdeleteButton.onclick = function(){deleteItems(index, cartTable)};\r\n\r\n\titemImage.src = \"images/\"+ cartItems[index].color + \".png\"\r\n\titemImage.style.height = '150px';\r\n\titemImage.style.width = '150px';\r\n\r\n\tvar itemI = cartRow.insertCell(0);\r\n\tvar itemN = cartRow.insertCell(1);\r\n\tvar itemS = cartRow.insertCell(2);\r\n\tvar itemC = cartRow.insertCell(3);\r\n\tvar itemQ = cartRow.insertCell(4);\r\n\tvar itemP = cartRow.insertCell(5);\r\n\tvar itemD = cartRow.insertCell(6);\r\n\r\n\titemI.appendChild(itemImage);\r\n\titemN.innerHTML = cartItems[index].itemName;\r\n\titemS.innerHTML = cartItems[index].size;\r\n\titemC.innerHTML = cartItems[index].color;\r\n\titemP.innerHTML = \"$\" + itemPrice;\r\n\titemQ.innerHTML = cartItems[index].quantity;\r\n\titemD.appendChild(deleteButton);\r\n\titemD.style.textAlign = \"right\";\r\n\r\n}", "function createObjectImagePage(web, object, object_num) {\n\tvar objectListResult = \"\";\n\tvar objectListHead = \"<p><input type='image' src='images/object/\";\n\n\tfor (var i = 0; i < object_num; i++) {\n\t\tvar objectName = object + (i+1).toString();\n\t\tvar objectListMiddle = \"value='\" + objectName+ \"' onclick='addObjectImage(\\\"\" + objectName + \"\\\", \\\"\" + web + \"\\\")' \";\n\t\tobjectListResult += objectListHead + objectName + \".jpg' \" + objectListMiddle + \"/></p>\";\n\t}\n\tvar footer = \"<div data-role=footer data-id=fool data-position=fixed><div data-role=navbar><ul><li><a href=#home>Home</a></li><li><a href=#friends>Accounts</a></li><li><a href=#confirm>Setting</a></li>\";\n\tvar newPage = $(\"<div data-role='page' data-title='\"+web+object+\"' id=\"+web+object+\"><div data-role='header' data-position=fixed><a href=#\" + web+\"Page data-icon='back'>Back</a><h1>\"+object+\"</h1></div><div data-role='content' class=images>\"+objectListResult+\"</div>\"+footer+\"</div>\");\n\treturn newPage;\n\t//newPage.appendTo( $.mobile.pageContainer );\n\t//$.mobile.changePage(newPage);\n}", "function renderCafe(doc){\n let li = document.createElement('tr');\n li.setAttribute('class', 'table-success');\n let blank = document.createElement('td');\n blank.setAttribute('class', 'table-success');\n let name = document.createElement('td');\n name.setAttribute('class', 'table-success');\n let city = document.createElement('td');\n city.setAttribute('class', 'table-success');\n\n let tdDelete = document.createElement('td');\n let tdUpdate = document.createElement('td');\n var btnDelete = document.createElement(\"BUTTON\");\n btnDelete.setAttribute('class', 'btn btn-danger');\n btnDelete.textContent = 'X'; \n tdDelete.appendChild(btnDelete);\n\n\n var btnUpdate = document.createElement(\"BUTTON\");\n btnUpdate.setAttribute('class', 'btn btn-warning');\n btnUpdate.textContent = '!';\n tdUpdate.appendChild(btnUpdate);\n\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().name;\n city.textContent = doc.data().city;\n\n li.appendChild(blank);\n li.appendChild(name);\n li.appendChild(city);\n li.appendChild(tdDelete);\n li.appendChild(tdUpdate);\n\n cafeTableList.appendChild(li);\n\n // deleting data\n btnDelete.addEventListener('click', (e) => {\n e.stopPropagation();\n let id = doc.id;\n db.collection('cafes').doc(id).delete();\n });\n // updating data\n btnUpdate.addEventListener('click', (e) => {\n idCafe = doc.id;\n window.location.href = '../../pages/products/update.html?id='+doc.id+'?imageUrl='+'https://firebasestorage.googleapis.com/v0/b/daniela-store.appspot.com/o/'+doc.id;\n });\n}", "function buildObservatoryThumbs() {\n\t// iterate through observatories array (PC)\n\tfor (let i = 0; i < observatories.length; i++) {\n\t\t// declare htmlString var and add relevant html (PC)\n\t\tlet htmlString = \"<a class='obsThumb' href='#obs\" + observatories[i].id + \"'>\";\n\t\thtmlString += \"<img src='\" + observatories[i].thumb + \"'/>\";\n\t\thtmlString += \"<h1>\" + observatories[i].name + \"</h1>\";\n\t\thtmlString += \"<h2>\" + observatories[i].location + \"</h2>\";\n\t\thtmlString += \"</a>\";\n\n\t\t// add htmlString to innerhtml of thumbholder (PC)\n\t\tdocument.getElementById(\"obsThumbHolder\").innerHTML += htmlString;\n\t}\n}", "function createDeleteButton(){\n // Creating the containers structure\n var divTag = document.createElement(\"div\");\n divTag.setAttribute(\"class\",\"deleteButton\");\n //Creating and setting the button tags.\n var buttonTag = document.createElement(\"button\");\n buttonTag.setAttribute(\"class\",\"btn btn-delete\");\n buttonTag.setAttribute(\"type\",\"button\");\n buttonTag.setAttribute(\"name\",\"button\");\n buttonTag.innerHTML = \"Delete\";\n // Adding an action for the propertio onclick\n buttonTag.onclick = deleteItem;\n // Adding the button to the containers div\n divTag.appendChild(buttonTag);\n var containerTag = document.getElementsByClassName(\"product\");\n containerTag[containerTag.length-1].appendChild(divTag);\n}", "function appendheros(response){\r\n return `\r\n <div><img src = ${response.image.url}></div>\r\n <div>${response.name}</div>\r\n <div>\r\n <button class = \"delete-btn\">remove</button>\r\n </div>\r\n `\r\n}", "async function displayCupcakes() {\n const response = await axios.get(`${BASE_URL}/cupcakes`);\n\n for (let cupcake of response.data.cupcakes) {\n let addCupcake = $(cupcakeHTML(cupcake));\n $(\"#menu-list\").append(addCupcake);\n }\n}", "function buttonCreate() { \n\n\t// make sure the buttonArea is empty before redrawing\n\t$(\"#buttonArea\").empty(); \t\t//side note: Ask if this is correct and why it is correct\n\n\n\t// now create a loop to get through the array of animals I created\n\tfor(var i = 0; i<animals.length; i++) {\n\n\t\t// creating buttons dynamically in the array\n\t\tvar button= $(\"<button>\");\n\n\t\t//adding a class to the selected element\n\t\tbutton.addClass(\"animalButton\"); \n\n\t\t// adding the attribute \"data-animal\" to the animal selected within the array\n\t\tbutton.attr(\"data-animal\", animals[i]);\n\n\t\t//putting text on the dynamically created button\n\t\tbutton.text(animals[i]);\n\n\n\t\t// now adding the button to the html\n\t\t$(\"#buttonArea\").append(button);\n\n\t}\n}", "function generatecat() {\n var image = document.createElement('img');\n var div = document.getElementById('flex-box-img');\n image.src = \"../images/tenor.gif\";\n div.appendChild(image);\n}", "function generateHtml (todo){\n let html = ` <li class=\"list-group-item d-flex justify-content-between align-items-center\">\n <span>${todo}</span>\n <i class=\"far fa-trash-alt delete\"></i>\n</li>`;\n\nlist.innerHTML+=html;\n\n\n}", "function CreatingButton(){\n var createButton = document.createElement(\"button\");\n createButton.appendChild(document.createTextNode(\"Delete\"));\n list[i].appendChild(createButton);\n createButton.onclick = removeParent;\n}", "function createHTML(item) {\n return '<li class=\"item\" >\\n' +\n ' <img src=\"'+item.image+'\" alt=\"image\" class=\"itemPoint\" data-key=\"image\" data-value=\"'+item.image+'\">' +\n ' <span class=\"itemDetail\">'\n +item.gender+' / '+item.size+' / '+item.color+\n '</span>\\n' +\n ' </li>';\n}", "function upload() {\n let holder = document.createElement(\"div\");\n holder.id = \"post\" + count;\n let flyer1 = document.createElement(\"div\");\n let flyer = document.createElement(\"img\");\n flyer.src = \"flyer.jpg\";\n flyer.alt = \"Bake Sale\";\n flyer.style = \"width: 80px; margin: 10px; z-index: 1;\";\n flyer1.appendChild(flyer);\n let trash = document.createElement(\"div\");\n trash.innerHTML = \"<button class=\\\"trash\\\" style=\\\"text-align:center;\\\" id=\\\"\" + count + \"\\\" onclick=\\\"toTrash(this.id)\\\">Delete</button>\";\n holder.appendChild(flyer1);\n holder.appendChild(trash);\n\n document.getElementById(\"post-area-\" + type).appendChild(holder); \n \n document.getElementById(\"post-area-\" + type).style.position = \"absolute\";\n document.getElementById(\"post-area-\" + type).style.top = \"20%\";\n document.getElementById(\"post-area-\" + type).style.left = \"10%\";\n document.getElementById(\"post-area-\" + type).style.right = \"30%\";\n closeUpload();\n count += 1;\n}", "function displayList(arrayOfPokemon){\n arrayOfPokemon.forEach(pokemon => {\n let pokemonInfo = document.createElement('div');\n pokemonInfo.className = 'list';\n\n let listing = document.createElement('h2');\n listing.textContent = pokemon.name;\n pokemonInfo.appendChild(listing);\n\n let sprite = document.createElement('img');\n sprite.src = pokemon.sprite;\n sprite.className = 'sprite';\n pokemonInfo.appendChild(sprite);\n\n let addButton = document.createElement('button');\n addButton.textContent = 'Add to Lineup';\n addButton.className = 'add-btn';\n addButton.addEventListener('click',displayCards);\n pokemonInfo.appendChild(addButton);\n\n document.querySelector('#pokemon-list').appendChild(pokemonInfo)\n });\n}", "function MakeList(array,string) {\n \n var list = document.createElement('ul');\n list.setAttribute(\"id\",\"main-list-text\")\n \n for (var i = 0; i < array.length; i++) {\n \n var item = document.createElement('li');\n item.setAttribute(\"class\",\"list-item\");\n\n var pic = document.createElement('img');\n pic.setAttribute(\"class\",\"list-image\")\n pic.src = i + '.jpg';\n\n item.appendChild(pic);\n \n var name = document.createTextNode(array[i][0]);\n item.appendChild(name);\n\n item.appendChild(document.createTextNode(\" - \"));\n\n var description = document.createTextNode(array[i][1]);\n item.appendChild(description);\n\n item.appendChild(document.createTextNode(\" Price: $\"));\n var price = document.createTextNode(array[i][2]);\n item.appendChild(price);\n\n var button = document.createElement(\"button\");\n button.setAttribute(\"class\",\"cart-button\");\n button.innerHTML = \"Add to cart\";\n\n button.onclick = function(){AddToCart(item)};\n\n item.appendChild(button);\n\n list.appendChild(item);\n }\n \n return list;\n }", "function renderToys(toy) {\n //toyCollectionDiv.innerHTML = ''\n let h2 = document.createElement('h2')\n h2.innerText = toy.name\n\n let div = document.createElement('div')\n div.setAttribute('class', \"card\")\n ////////////////////\n let img = document.createElement('img')\n img.setAttribute('src', toy.image)\n img.setAttribute('class', 'toy-avatar')\n img.setAttribute('style','width:200px;height:200px;')\n\n\n let p = document.createElement('p')\n p.innerText = `${toy.likes} likes`\n\n let btn = document.createElement('button')\n btn.setAttribute('class', 'like-btn')\n btn.setAttribute('id', toy.id)\n btn.innerText = \"like\"\n \n //////////////////////////Our code below\n // div.innerHTML =\n // `<h2>${toy.name}</h2>x\n // <br>\n // <p><img src=\"${toy.image}\" style= \"width:200px;height:200px;\"></p>\n // <br>\n // <p>Likes: ${toy.likes || 0}</p>\n // <br>\n // <button class='like-btn' style= \"width:50px;height:30px;font-size: 14px;\">Like</button>\n // <button class='delete-btn' style= \"width:50px;height:30px;font-size: 14px;\">Delete</button>\n // `\n div.append(h2, img, p, btn)\n toyCollectionDiv.append(div)\n}", "function distcrops(){\r\n document.getElementById(\"bt\").style.display=\"block\";\r\n document.getElementById(\"vt\").style.display=\"none\";\r\n document.getElementById(\"dc\").style.display=\"none\";\r\n document.getElementById(\"tf\").style.display=\"none\";\r\n document.getElementById(\"ff\").innerHTML = \"\";\r\n document.getElementById(\"detail\").innerHTML = \"\";\r\n document.getElementById(\"lists\").style.display=\"block\";\r\n var pp=\"\";\r\n var namelist = \"<table class='table table-hover'><thread><tr> <th>cropid</th><th>cropname</th><th>cropcost</th></tr></thead>\";\r\n pp += namelist;\r\n //document.getElementById(\"ff\").innerHTML += namelist;\r\n for(var i=0;i<cropslist.length;i++)\r\n {\r\n //var namelist = \"<li>\" +cropslist[i]+ \"</li>\";\r\n //document.getElementById(\"ff\").innerHTML += namelist;\r\n var namelist = \"<tbody><tr> <td>\"+ \r\n cropslist[i][0] +\"</td><td>\"+ \r\n cropslist[i][1] +\"</td><td>\"+\r\n cropslist[i][2] +\"</td><td>\"+ \r\n cropslist[i][3] +\"</td><td>\"+ \r\n cropslist[i][4] +\"</td></tr>\";\r\n pp+=namelist;\r\n //document.getElementById(\"ff\").innerHTML += namelist;\r\n }\r\n var namelist = \"<tr><th><button class='btn btn-success btn-lg' onclick='cropinsertform()'>ADD NEW</button></th></tr></tbody>\";\r\n pp+=namelist;\r\n var namelist = \"</table>\";\r\n pp+=namelist;\r\n document.getElementById(\"ff\").innerHTML = pp;\r\n //var temp = `<button onclick=\"cropinsertform()\">ADD NEW</button>`;\r\n //document.getElementById(\"ff\").innerHTML += temp;\r\n var ff = document.getElementById(\"ff\");\r\n ff.style.display = \"block\";\r\n}", "function savedRecipeCardMaker(text){\n if(saved_recipe_cards){\n let card = document.createElement('div');\n card.className = 'card';\n card.innerHTML = '<div class=\"images\" style=\"background-image: url('+text.img+');\"></div>' +\n '<div class=\"name\">' +\n '<h1>'+text.name+'</h1>' +\n '</div>' +\n '<div class=\"other\">' +\n '<p><span>Calories: </span>'+text.calories+'</p>' +\n '<p><span>Cautions: </span>'+text.cautions+'</p>' +\n '<p><span>Diet Labels: </span>'+text.dietLabels+'</p>' +\n '<p><span>Health Labels: </span><br>'+text.healthLabels+'</p>' +\n '<p><span>Ingredients: </span><br>'+text.ingredients+'</p>' +\n '<a href='+text.url+' target=\"_blank\">Instructions</a>' +\n '</div>' +\n '<div class=\"del-btn\">' +\n '<i class=\"fas fa-trash\" onclick=\"delSavedRecipe(\\'' +text.img+ '\\' , \\''+text.name+'\\' , \\'' +text.calories+ '\\' , \\''+text.cautions+'\\' , \\''+text.dietLabels+'\\' , \\''+text.healthLabels+'\\' , \\''+text.ingredients+'\\' , \\''+text.url+'\\')\"></i>' +\n '</div>';\n saved_recipe_cards.appendChild(card); \n }\n}", "function generateBrowserStructure() {\n\t\tif(photos.length > 0) {\n\t\t\tphotoElem.innerHTML = formatIMGURL(photos[0]);\n\n\t\t\tvar ulElem = document.createElement(\"ul\");\n\t\t\tphotos.forEach(function(currPhoto) {\n\t\t\t\tvar liElem = document.createElement(\"li\");\n\t\t\t\tvar aElem = document.createElement(\"a\");\n\t\t\t\taElem.innerHTML = formatIMGURL(currPhoto);\n\t\t\t\taElem.setAttribute(\"href\", \"#\");\n\t\t\t\taElem.onclick = function() {\n\t\t\t\t\tphotoElem.innerHTML = formatIMGURL(currPhoto);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tliElem.appendChild(aElem);\n\t\t\t\tulElem.appendChild(liElem);\n\t\t\t});\n\t\t\tlistElem.appendChild(ulElem);\n\t\t} else {\n\t\t\tpictureElem.innerHTML = \"<p>No images were found!</p>\";\n\t\t}\n\t}", "function add_delBttn (obj, text)\r\n {\r\n bttn = obj.add(\"button\", undefined, \"X\");\r\n //bttn = obj.add(\"image {helpTip:\\\"Remove asset\\\", image: \\\"\"+(icons_folder+\"delete_asset.png\")+\"\\\"}\");\r\n bttn.preferredSize = [20,20];\r\n bttn.helpTip = text;\r\n // give onClick\r\n bttn.onClick = function () { delete_BG_asset (this); };\r\n return bttn;\r\n }", "function buildPetBox() {\n var petsHere = document.getElementById(\"petsSection\")\n console.log(petsHere);\n console.log(petData.data[0].url)\n \n for (var i = 0; i < 4; i++) {\n var elements = petData.data[i];\n console.log(elements);\n\n // creates an element for the info to sit in\n var petBlock = document.createElement(\"div\")\n petBlock.classList.add(\"petBlock\") \n // creates an image tag\n var petPic = document.createElement(\"img\")\n petPic.classList.add(\"PetPic\")\n var checkPic = petData.data[i].primary_photo_cropped\n if (checkPic.length = 0){\n console.log(\"No Image\") \n }\n petPic.setAttribute(\"src\", petData.data[i].primary_photo_cropped.small);\n // create a tag for the pets name\n var petName = document.createElement(\"h3\")\n petName.classList.add(\"petName\")\n petName.textContent = petData.data[i].name;\n //creates a tag for pet description\n var petDes = document.createElement(\"p\")\n petDes.classList.add(\"petDes\")\n petDes.textContent = petData.data[i].description\n // //link to pet page\n var petLinkBtn = document.createElement(\"button\")\n petLinkBtn.classList.add(\"petLinkBtn\")\n petLinkBtn.textContent = \"View Pet\"\n petLinkBtn.setAttribute(\"href\", petData.data[i].url);\n \n\n\n //append children to the pest here section\n petsHere.appendChild(petBlock)\n petBlock.appendChild(petPic)\n petBlock.appendChild(petName)\n petBlock.appendChild(petDes)\n petBlock.appendChild(petLinkBtn)\n \n }\n}", "function create_recipe_tile(recipe_info) {\n recipe = recipe_info.split(\"|\");\n\n recipeDiv = document.createElement(\"div\");\n recipeDiv.className = \"recipe\";\n\n recipeIcon = document.createElement(\"img\");\n recipeIcon.src = \"/static/images/tempRecipe.png\";\n \n recipeDetails = document.createElement(\"div\");\n recipeDetails.className = \"recipe-details\";\n recipeDetails.setAttribute(\"href\", `/account/${recipe[2]}/${recipe[0].replace(\" \", \"-\")}`);\n recipeDetails.addEventListener(\"click\", function () { window.location = this.getAttribute(\"href\"); });\n\n recipeTitle = document.createElement(\"h3\");\n recipeTitle.innerText = recipe[0];\n\n recipeDescription = document.createElement(\"span\");\n recipeDescription.className = \"description\";\n recipeDescription.innerText = recipe[1].substring(0, 120) + \"...\";\n\n recipeAttr = document.createElement(\"div\");\n recipeAttr.className = \"recipe-attr\";\n\n recipeCreator = document.createElement(\"span\");\n recipeCreator.className = \"creator\";\n recipeCreator.innerText = recipe[2];\n\n recipeID = document.createElement(\"span\");\n recipeID.className = \"id\";\n recipeID.innerText = recipe[3];\n\n recipeAttr.appendChild(recipeCreator);\n recipeAttr.appendChild(recipeID);\n\n recipeDetails.appendChild(recipeTitle);\n recipeDetails.appendChild(recipeDescription);\n recipeDetails.appendChild(recipeAttr);\n\n recipeDiv.appendChild(recipeIcon);\n recipeDiv.appendChild(recipeDetails);\n return recipeDiv;\n}", "function generateWildPokemon(){\n var wildPokemonImg = $(\"<img>\")\n wildPokemonImg.attr(\"src\", wildPokemonSprite)\n wildPokemonImg.height(150).width(150);\n $(\"#wild-pokemon\").append(wildPokemonImg)\n $(\"#wild-name\").text(wildPokeName);\n}", "function addToList(placeObj) {\n var $listItem = document.createElement('div');\n $listItem.className = \"list-item\";\n $listItem.setAttribute(\"id\", placeId(placeObj));\n\n if (placeObj.img !== null) {\n /*\n var $img = createEl('img', \"list-img\", $listItem);\n $img.setAttribute(\"src\", placeObj.img);\n */\n $listItem.style[\"background-image\"] = \"url(\" + placeObj.img + \")\";\n } else {\n $listItem.style[\"background\"] = \"linear-gradient(#44728C, #082E43)\";\n }\n\n var $info = createEl('div', \"info\", $listItem);\n $info.innerHTML = placeObj.content;\n\n var $price = createEl(\"div\", \"price\", $info);\n $price.innerHTML = PRICE_INFO[placeObj.price];\n\n var $type = createEl(\"div\", \"type \" + placeObj.type, $info);\n $type.innerHTML = capitalize(placeObj.type);\n\n if (placeObj.link !== null) {\n var $link = createEl(\"a\", \"link\", $info);\n $link.innerHTML = \"Link\";\n $link.setAttribute(\"href\", placeObj.link);\n $link.setAttribute(\"target\", \"_blank\");\n }\n\n var $cancel = createEl('button', \"cancel corner-button\", $listItem);\n $cancel.innerHTML = \"×\";\n $cancel.addEventListener(\"click\", function() {\n hide($listItem);\n placeObj.canceled = true;\n\n repopulateItems();\n });\n\n var $favoriteCheckbox = createEl('input', \"favorite-checkbox\", $listItem);\n $favoriteCheckbox.setAttribute(\"id\", \"checkbox-\" + placeObj.index);\n $favoriteCheckbox.setAttribute(\"type\", \"checkbox\");\n\n var $favorite = createEl('label', \"favorite corner-button\", $listItem);\n $favorite.innerHTML = \"♡\";\n $favorite.setAttribute(\"for\", \"checkbox-\" + placeObj.index);\n $favorite.addEventListener(\"click\", function() {\n //a bit unintuitive but click event happens before the actual checkbox changes, so it's the opposite of what it should be\n placeObj.favorite = !$favoriteCheckbox.checked;\n\n if (onlyFaves) {\n repopulateItems();\n }\n });\n\n $list.appendChild($listItem);\n\n return $listItem;\n }", "function fillInProjectImages(project) {\n var htmlStr = \"<div class= \\\"projectdisplay\\\">\";\n\n htmlStr += \"<button class=\\\"leftbutton\\\"><</button>\";\n htmlStr += \"<img src=\\\"images/\" + project.id + \"/img_1.png\\\"\";\n htmlStr += \"title=\\\"\" + project.imageDescriptions[0] + \"\\\" />\";\n htmlStr += \"<button class=\\\"rightbutton\\\">></button>\";\n htmlStr += \"<p>\" + project.imageDescriptions[0] + \"</p></div>\";\n\n return htmlStr;\n}", "function generateCat(){\n var image = document.createElement('img')\n var div = document.getElementById('flex-cat-gen')\n image.src = \"https://cdn2.thecatapi.com/images/MTU2NjE0Nw.gif\"\n div.appendChild(image);\n}", "function createActionImagePage(web, action, action_num) {\n\tvar actionListResult = \"\";\n\tvar actionListHead = \"<p><input type='image' src='images/action/\";\n\n\tfor (var i = 0; i < action_num; i++) {\n\t\tvar actionName = action + (i+1).toString();\n\t\tvar actionListMiddle = \"value='\" + actionName+ \"' onclick='addActionImage(\\\"\" + actionName + \"\\\", \\\"\" + web + \"\\\")' \";\n\t\tactionListResult += actionListHead + actionName + \".jpg' \" + actionListMiddle + \"/></p>\";\n\t}\n\tconsole.log(actionListResult);\n\tvar footer = \"<div data-role=footer data-id=fool data-position=fixed><div data-role=navbar><ul><li><a href=#home>Home</a></li><li><a href=#friends>Accounts</a></li><li><a href=#confirm>Setting</a></li>\";\n\tvar newPage = $(\"<div data-role='page' data-title='\"+web+action+\"' id=\"+web+action+\"><div data-role='header' data-position=fixed><a href=#\" + web + \"Page data-icon='back'>Back</a><h1>\"+action+\"</h1></div><div data-role='content' class=images>\"+actionListResult+\"</div>\"+footer+\"</div>\");\n\treturn newPage;\n\t//newPage.appendTo( $.mobile.pageContainer );\n\t//$.mobile.changePage(newPage);\n}", "function catGenerator(){\r\n var image= document.createElement(\"img\");\r\n var div= document.getElementById(\"flex-cat-gen\");\r\n image.src= \"https://media.giphy.com/media/v6aOjy0Qo1fIA/giphy.gif\" ;\r\n div.appendChild(image);\r\n}", "function createList(e) {\n for (var i = 0; i < data.messages.length; i++) {\n chattyContent += `<li><button class=\"delete\">Delete</button>\n ${data.messages[i].name}: ${data.messages[i].message}<br></li>`\n document.getElementById(\"putHtmlHere\").innerHTML = chattyContent;\n }\n}", "createImages() {\n var html = `\n <ul class=\"image-list\">\n ${this._images.map(image => `\n <li class=\"item\" style=\"background-image:url(${image})\" id=\"${image}\">\n </li>`).join('\\n')}\n </ul>\n `;\n\n this.render(html);\n }", "function getAirOpsHtml() {\n var addTitle = \"Add an operation targeting the selected zone.\",\n opsHtml = \"<table style=\\\"width: 100%\\\"><tr><th>Zone</th><th>Mission</th><th colspan=\\\"2\\\">Aircraft</th></tr>\";\n\n for (var i = 0; i < airOps.length; i++) {\n var zone = airOps[i].Zone == \"H5G\" ? \"Midway\" : airOps[i].Zone,\n editId = \"airopedit-\" + i,\n delId = \"airopdelete-\" + i;\n opsHtml += \"<tr><td>\" + zone + \"</td><td>\" + airOps[i].Mission + \"</td><td>\" + airOps[i].AircraftTotals + \"</td>\" +\n \"<td class=\\\"right\\\">\" +\n \"<img id=\\\"\" + editId + \"\\\" class=\\\"airopbutton\\\" title=\\\"Edit this mission\\\" src=\\\"\" + searchDir + \"editicon.png\\\" />\" +\n \"<img id=\\\"\" + delId + \"\\\" class=\\\"airopbutton\\\" title=\\\"Delete this mission\\\" src=\\\"\" + searchDir + \"delicon.png\\\" />\" +\n \"</td></tr>\";\n }\n opsHtml += \"<tr><td><img id=\\\"airopadd\\\" class=\\\"airopbutton\\\" title=\\\"\" + addTitle + \"\\\" src=\\\"\" + searchDir + \"addicon.png\\\" />\" +\n \"</td></tr></table>\";\n return opsHtml;\n}", "function generateContent(data) {\n\tif(add.textContent.trim() !== data.album.name){\n\t\tadd.style.display = 'block';\n\t\tadd.innerHTML = '<div id=\"addButton\" class=\"ui basic green button\" data=\"\" data-tooltip=\"Add this album to your collection!\" data-position=\"top center\">Add</div>';\n\t\tvar addButton = document.getElementById('addButton');\n\t\taddButton.addEventListener('click', (e) =>{\n\t\t\tadd.style.display = 'none';\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\tvar params = {\n\t\t\t\tadded: Date.now(),\n\t\t\t\ttitle: data.album.name,\n\t\t\t\tartist: data.album.artist,\n\t\t\t\timage: data.album.image[3]['#text']\t\t\t\t\n\t\t\t};\n\t\t\txhr.open(\"POST\", \"/collection\", true); ///<----- test nothing here\n\t\t\txhr.setRequestHeader('Content-Type', 'application/json');\n\t\t\txhr.send(JSON.stringify(params));\n\t\t})\n\t}\n\tartist.innerHTML = '<a href=\"/artist/' + encodeURIComponent(data.album.artist) + '\">' + data.album.artist + '</a> - ';\n\talbum.textContent = data.album.name;\n\t\n\ttitle.textContent = artist.textContent + album.textContent;\n\tvar img = data.album.image[3]['#text'];\n\t\n\timage.innerHTML = '<img class=\"ui image\" src=\"' + img + '\">';\n\tbg.style.backgroundImage = 'url(' + img + ')';\n\tdata.album.tags.tag.forEach((i) => {\n\t\ttags.innerHTML += '<a id=\"tag\" href=\"/tag/' + encodeURIComponent(i.name) + '\" class=\"ui tag label\">' + i.name + '</a>'\n\t})\n\tif(data.album.wiki){\n\t\tsummary = data.album.wiki.summary;\n\t\treview.innerHTML = summary;\n\t}\n\tif(data.album.tracks.track.length > 0){\n\t\tdata.album.tracks.track.forEach((i) => {\n\t\t\ttracks.push(i.name)\n\t\t});\n\t\tvar html = '<tbody>'\n\t\tfor(var i=0; i<tracks.length; i++){\n\t\t\thtml += '<div class=\"ui text container\"><tr><td id=\"trackName\">' + tracks[i] + '<button id=\"yt\" class=\"ui small basic disabled button\">Listen</button>' + '</td></tr></div>'\n\t\t}\n\t\tplaylist.innerHTML = \"<a id='playButton' class='ui basic disabled button'>Play All</a>\"\n\t\thtml+='</tbody>'\n\t\ttable.innerHTML = html;\n\t\ttrackName = document.querySelectorAll('#trackName');\n\n\t\tyoutubecache();\n\n\t\tfunction youtube(i){\n\t\t\tif(i<tracks.length){\n\t\t\t\tvar search = encodeURIComponent(data.album.artist) + ' ' + encodeURIComponent(data.album.name) + ' ' + encodeURIComponent(tracks[i]);\n\n\t\t\t\tfunction youtubeListener(){\n\t\t\t\t\tgenerateYoutube(JSON.parse(this.responseText), i, false)\n\t\t\t\t}\n\t\t\t\tvar params = {\n\t\t\t\t\tyoutube: search\n\t\t\t\t}\n\t\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t\txhr.onload = youtubeListener;\n\t\t\t\txhr.open('POST', '/api');\n\t\t\t\txhr.setRequestHeader('Content-Type', 'application/json');\n\t\t\t\txhr.send(JSON.stringify(params));\n\t\t\t} else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t};\n\n\t\tfunction youtubecache(){\n\t\t\ttracks.unshift(data.album.artist + ' ' + data.album.name)\n\t\t\tfunction youtubeListener(){\n\t\t\t\tif(JSON.parse(this.responseText) === 'youtube'){\n\t\t\t\t\ttracks.shift()\n\t\t\t\t\tyoutube(0)\n\t\t\t\t} else {\n\t\t\t\t\ttracks.shift()\n\t\t\t\t\tgenerateYoutubeCache(JSON.parse(this.responseText))\n\t\t\t\t}\n\t\t\t\t// generateYoutube(JSON.parse(this.responseText), i)\n\t\t\t}\n\t\t\tvar params = {\n\t\t\t\tyoutubecache: tracks\n\t\t\t}\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\txhr.onload = youtubeListener;\n\t\t\txhr.open('POST', '/api');\n\t\t\txhr.setRequestHeader('Content-Type', 'application/json');\n\t\t\txhr.send(JSON.stringify(params));\n\t\t}\n\n\t\tfunction generateYoutubeCache(data){\n\t\t\tvar youtubeSongs = {}\n\t\t\tdata.forEach((i) => {\n\t\t\t\tvar index = tracks.indexOf(i.split('+')[0])\n\t\t\t\tvar id = i.split('+')[1]\n\t\t\t\tgenerateYoutube(id, index, true)\n\t\t\t})\n\t\t}\n\n\t\t\tvar id = [];\n\t\t\tfunction generateYoutube(data, i, cache) {\n\t\t\t\tif(data === 'notfound'){\n\t\t\t\t\ttrackName.item(i).innerHTML = tracks[i] + '<button id=\"yt\" class=\"ui small basic grey disabled button\">Listen</button>';\n\t\t\t\t\tid.push(undefined);\n\t\t\t\t} else {\n\t\t\t\t\ttrackName.item(i).innerHTML = tracks[i] + '<a target=\"_blank\" id=\"yt\" class=\"ui small basic blue button\" href=\"https://www.youtube.com/watch?v=' + data + '\">Listen</a>'\n\t\t\t\t\tid.push(data)\n\t\t\t\t}\n\t\t\t\tif(cache === false){\n\t\t\t\t\tyoutube(id.length)\n\t\t\t\t}\n\t\t\t\tif(id.length === tracks.length){\n\t\t\t\t\tvar cleanId = [];\n\t\t\t\t\tfor(var i=0; i<id.length;i++){\n\t\t\t\t\t\tif(id[i] !== undefined){\n\t\t\t\t\t\t\tcleanId.push(id[i])\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tplaylist.innerHTML = \"<a target='_blank' href='http://www.youtube.com/watch_videos?video_ids=\" + cleanId.join(',') + \"' id='playButton' class='ui basic blue button'>Play All</a>\";\n\t\t\t\t}\n\t\t\t};\n\t\t\t\n\t} else {\n\t\ttable.innerHTML = '<div class=\"ui negative message\"></i><div class=\"ui center aligned container\">Darn! We couldn\\'t find the tracklist for <strong>' + data.album.artist + '-' + data.album.name + '</strong>.</div></div>'\n\t}\n}", "function crearPokemon(pokemon) {\n\n listaPokemon.innerHTML += `\n <button class=\"btn-poke\" onclick=\"destacar(${pokemon.id})\"> <img src='./Img/pokeball.png' class=\"pokeball\"> <img src='${pokemon.sprites.front_default}' class=\"poke-img-btn\"> #${pokemon.id.toString().padStart(3, 0)} <p>${pokemon.name}</p></button>\n `;\n\n}", "function createListElement() {\n var li = document.createElement(\"li\");\n li.className = \"list-group-item list-group-item-info\";\n li.setAttribute(\"id\", \"li\");\n var cbox = document.createElement(\"input\");\n cbox.setAttribute(\"type\", \"checkbox\");\n cbox.className = \"checkbox\";\n li.appendChild(cbox);\n li.appendChild(document.createTextNode(input.value));\n ul.appendChild(li);\n input.value = \"\";\n var delbtn = document.createElement(\"i\");\n delbtn.className = \"far fa-trash-alt float-right\";\n delbtn.setAttribute(\"id\", \"del\");\n li.appendChild(delbtn);\n delbtn.onclick = removeParent;\n}", "function estructuraPrincipalItem(itemProperly){\n estructuraItem = \"\";\n for (properly in itemProperly){\n estructuraItem += '<div class=\"content-item-' + properly + '\"><span class=\"item-' + properly + '\">' + itemProperly[properly] + '</span></div>';\n }\n estructuraItem += '<div class=\"content-item-action\"><button id=\"' + itemProperly[\"id\"] + '\" class=\"button-delete\" type=\"button\" onclick=\"eliminaProducto(' + itemProperly[\"id\"] + ')\">X</button></div>';\n return estructuraItem;\n}", "function generateCat(){\nlet image = document.createElement('img');\nlet div = document.getElementById('flex-cat-gen');\nimage.src ='https://cataas.com//cat/gif';\ndiv.appendChild(image);\n}", "function buildAlbumBtn(item, network){\n\n // Target where to put the list of albums\n var list = document.getElementById('album_photo_container');\n\n // construct the button\n var o = document.createElement('button');\n o.className = \"btn btn-info\";\n o.style.margin = \"3px 3px 3px 3px\";\n o.innerHTML = item.name;\n\n // Add the controls\n o.onclick = function(){\n // Trigger get \n getPhotos( network, item.id );\n //alert(network + item.id);\n };\n\n // Append to the list\n list.appendChild(o);\n}", "function deleteButton() {\n var delbtn = document.createElement(\"i\");\n delbtn.className = \"far fa-trash-alt float-right\";\n delbtn.setAttribute(\"id\", \"del\");\n var cbox = document.createElement(\"input\");\n cbox.setAttribute(\"type\", \"checkbox\");\n cbox.className = \"checkbox\";\n //Adds to existing list\n listItems[i].insertBefore(cbox, listItems[i].firstChild);\n listItems[i].appendChild(delbtn);\n delbtn.onclick = removeParent;\n}", "function makeFoodDiv(item) {\r\n var foodObj = document.createElement(\"div\");\r\n $(foodObj).addClass(\"col-sm-3 col-xs-6\");\r\n\r\n var foodA = document.createElement(\"a\");\r\n $(foodA).attr(\"href\", \"#\");\r\n $(foodA).append('<img class=\"img-responsive portfolio-item\" src=\"' + item.photoCollection + '\">');\r\n\r\n var foodName = document.createElement(\"p\");\r\n $(foodName).addClass(\"colName\");\r\n $(foodName).append(item.name);\r\n\r\n//Adding a Listener to each food object\r\n $(foodA).click(function() {\r\n updateTitle(item);\r\n updateNickname(item);\r\n updateImg(item);\r\n updateDesc(item);\r\n updateSubtitle(item);\r\n\r\n console.log(item);\r\n }\r\n\r\n );\r\n $(foodObj).append(foodA).append(foodName);\r\n return foodObj;\r\n}", "createNewApplicationDom(object) {\n const container = document.createElement('div');\n const text = document.createElement('p');\n const button = document.createElement('i');\n const picture = document.createElement('img');\n container.className = 'available-applications';\n picture.setAttribute('src', object.picture);\n\n text.innerHTML = `${object.firstName} ${object.lastName}<br><br>\n Job: ${object.job}`;\n button.setAttribute('class', 'fas fa-check accept-application-button accept button')\n\n container.append(text, picture, button);\n\n return container;\n }", "function _genHtml() {\n var code = '<div id=\"' + settings.imageContainer + '\" class=\"bgstretcher\"><ul>';\n jQuery.each(settings.albums, function(album, imageArray) {\n for(i = 0; i < imageArray.length; i++){\n code += '<li class=\"' + album + '\"><img src=\"' + imageArray[i] + '\" alt=\"\" /></li>';\n }\n });\n code += '</ul></div>';\n $(code).appendTo('body');\n }", "function renderCafe(doc) {\n let li = document.createElement('li');\n let name = document.createElement('span');\n let city = document.createElement('span');\n let cross = document.createElement('div');\n // We don't need to put 'doc.data.id' because the id is stored at the top of the document, no inside the data!\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().name; // remember to call the method data() WITH PARENTHESIS!!!\n city.textContent = doc.data().city;\n cross.textContent = 'x';\n\n li.appendChild(name);\n li.appendChild(city);\n li.appendChild(cross);\n cafeList.appendChild(li); // Add this custom li to the ul #cafe-list\n\n // Deleting data:\n cross.addEventListener('click', (e) => {\n e.stopPropagation();\n let id = e.target.parentElement.getAttribute('data-id') // We set the data-id attribute as doc.id of the database\n db.collection('cafes').doc(id).delete();\n })\n}", "function showDestinations2(dest) {\n var tableContent1 = \"<tr><td>Bluray Cover</td><td>Title</td><td></td></tr>\\n\";\n for (var i = 0; i < dest.length; ++i) {\n var record = dest[i];\n var button = buyButtonStyle('Br', record.Id);\n var image = myimage2(record.Id);\n tableContent1 += \"<tr><td>\"+ image + \"</td><td>\" + record.Title + \"</td><td>\" + button + \"</td></tr>\\n\";\n }\n document.getElementById(\"showBlurays\").innerHTML =tableContent1;\n\n}", "function createTodo(text){\r\n var markup = \r\n '<li class=\"ui-state-default\"> <div class=\"row\"><label class=\"custom-checkbox pt-2 col-10\"> <i class=\"far fa-square pt-2\"></i>&nbsp;'+text+'</label><button id=\"removeButton\" class=\"remove-item btn removeButton\"><i class=\"fas fa-times\"></i></button></div><hr class=\"mb-0 mt-1\"></li>';\r\n $(markup).appendTo(\"#sortable\").hide().slideDown();\r\n $('.add-todo').val('');\r\n countTodos();\r\n}", "function createdeleteanchor(meal) {\n\n var deleteAnchor = $(dc('a'))\n .attr('id', 'deletePictureAnchor')\n .attr('class', 'carousel_caption deletePictureAnchor grid_3')\n .html('Delete Picture');\n \n // Click handler\n deleteAnchor.click(function() {\n\n // Return immediately if the carousel is rotating\n if(!elm || true == elm.isrotating()) {\n return;\n }\n\n // Return immediately if there are no more pictures\n if(meal.picInfo.length <= 0) {\n return;\n }\n\n if(promptdeletepic) {\n if(usesimpleprompt) {\n var answer = confirm(\"Delete this picture?\");\n if(answer) removepic();\n }\n else {\n var dpprompt = createdeletepicprompt(\n function() {\n removepic();\n enable_scroll();\n $.unblockUI();\n },\n function() {\n enable_scroll();\n $.unblockUI();\n },\n function() {\n promptdeletepic = false;\n removepic();\n enable_scroll();\n $.unblockUI();\n }\n );\n\n disable_scroll();\n $.blockUI({message: dpprompt});\n\n }\n }\n else {\n removepic();\n }\n \n // Encapsulate in a function\n function removepic() {\n\n // Remove picture from carousel\n elm.removepicture(function(removed, pinfo) {\n \n if(removed) {\n \n // Find index of removed photo\n var ii = findpicidx(meal.picInfo, pinfo.timestamp);\n \n // Remove this picture\n if(ii >= 0) {\n meal.picInfo.splice(ii, 1);\n }\n \n var changepic = false;\n \n // Delete from mongo\n deletePicAjax(meal, pinfo);\n \n // Was this a key picture\n if(pinfo.timestamp == meal.keytimestamp) {\n \n changepic = true;\n meal.keytimestamp = 0;\n \n }\n \n // If this was the first picture\n if(!meal.keytimestamp && ii == 0) {\n changepic = true;\n }\n \n // Changing the displaypic\n if(changepic) {\n var pinfo0;\n \n // Get new key picture\n if(meal.picInfo.length > 0) {\n pinfo0 = meal.picInfo[0];\n }\n \n // Set new display picture\n if(setgriddisplay) {\n setgriddisplay(meal, pinfo0);\n }\n }\n \n // Update grid picture count\n if(setgridcount)\n setgridcount(meal);\n }\n });\n }\n });\n\n return deleteAnchor;\n }", "function app_render_favorites() {\r\n\r\n $('.app_favorites_content').empty();\r\n\r\n for (let i = 0; i < appData.favList.length; i++) {\r\n let imgSource = appData.favList[i];\r\n let myHTML = `\r\n <div class=\"app_content_cell app_favorites_cell fade-in\">\r\n <div class=\"app_content_cell_options\" onclick=\"app_fav_remove(this, ${i})\">\r\n <i class=\"fas fa-times\"></i>\r\n </div>\r\n <img class=\"fade-in-fwd\" src=\"${imgSource}\">\r\n </div>`;\r\n\r\n // Append Favorite\r\n $('.app_favorites_content').prepend(myHTML);\r\n }\r\n}", "function MakeTableAnimalsWeb(){\n console.log('Cargando animalitos Web...');\n var pagBodyTableAnimals = getID('divMakeAninmals');\n var makeTable = \"\";\n var min = 0;\n var max = app.ANIMALS.length;\n \n var pag = `<div class=\"row\" id=\"pagWeb\" style=\"padding-left:0px\">`;\n var icon = \"\";\n for (var j = min; j < max; j++) {\n var animal = app.ANIMALS[j];\n icon += `\n <div class=\"col m3 l1 \">\n <div class=\"cardAnimals cardAnimals-1 \">\n <img src=\"img/${animal.key}.jpeg\" width=\"65px\" onclick=\"OpenModalAnimals('${animal.key}', ${j})\">\n <div class=\"footcard \">${animal.value}</div>\n </div>\n </div>`;\n }\n makeTable += pag + icon + \"</div>\";\n pagBodyTableAnimals.innerHTML += `<div class=\"col m12 l12 hide-on-small-only\">${makeTable}</div>`;\n $('#pagWeb').show(); \n}", "function makeHTML([title, rating, index]) {\n return `\n <li id=\"${index}\">\n ${title}: ${rating} \n <button class=\"remove\">\n REMOVE\n </button>\n </li>\n `\n}", "function createBone(bone_spec) {\n var bone = document.createElement(\"li\");\n bone.classList.add(\"bone\");\n var bone_img = document.createElement(\"img\");\n bone_img.classList.add(\"bonepic\");\n bone_img.style.cursor = \"pointer\";\n\n bone_img.onmouseover = function(){iconBig(this);createTT(this.parentElement, bone_spec)};\n bone_img.onmouseout = function(){iconNormal(this);deleteTT()};\n bone_img.onclick = function(){addBone(bone_spec)};\n\n bone_img.src = bone_spec.img_link;\n\n bone.appendChild(bone_img);\n document.getElementById(bone_spec.type).appendChild(bone);\n}", "function makeCrystalButtons () {\n for (var i = 0; i < 4; i++) {\n var crystalImage = $(\"<img>\")\n crystalImage.attr(\"src\", crystals[i].img)\n crystalImage.attr(\"value\", crystals[i].value)\n crystalImage.addClass(\"crystal\")\n $(\"#crystals\").append(crystalImage)\n }\n }", "function createButtons() {\n $(\"#buttons\").empty();\n \n // Create a for loop that goes through the puppy array and creates a button for each item\n for (var i = 0; i < puppyArray.length; i++) {\n \n var button = $(\"<button>\");\n button.addClass(\"puppyButton\");\n button.attr(\"data-puppy\", puppyArray[i]);\n button.text(puppyArray[i]);\n \n // Append the buttons in the HTML\n $(\"#buttons\").append(button);\n }\n }", "async function showCupcakesOnStart(){\n\n let response = await axios.get(`${BASE_URL}cupcakes`);\n let cupcakes = response.data.cupcakes;\n\n for (let cupcake of cupcakes){\n let $cupcakeDiv = $('<div>');\n let $cupcakeImg = $('<img>').attr(\"src\", cupcake.image);\n let $cupcakeFlavor = $('<h3>').text(cupcake.flavor);\n let $cupcakeRating = $('<h3>').text(cupcake.rating);\n let $cupcakeSize = $('<h3>').text(cupcake.size);\n $cupcakeDiv.append($cupcakeFlavor)\n .append($cupcakeImg)\n .append($cupcakeRating)\n .append($cupcakeSize)\n let $cupcakeListItem = $('<li>').append($cupcakeDiv);\n $cupcakeList.append($cupcakeListItem);\n }\n\n}", "function create_specials() {\n\n var items = [\"Whiskey Aurora\", \"Falling Star Flight\", \"Light-Year Lemon Drop\", \"Dark Matter Derby\", \"Martian Mojito\"];\n var prices = [10.95, 13.95, 8.95, 8.95, 9.95];\n var specials_pics = [\"specials_pic_1.jpeg\", \"specials_pic_2.jpeg\", \"specials_pic_3.jpeg\", \"specials_pic_4.jpeg\", \"specials_pic_5.jpeg\"];\n \n/* for loop to add table data for special item name, price, and image */\n var HTML_code = \"<tr>\";\n for (var i = 0; i <= 4; i++) {\n HTML_code +=\n \"<td class='item-name'>\" + items[i] + \"</td>\" +\n \"<td class='item-price'>\" + \"$\" + prices[i] + \"</td>\" +\n \"<td class='item-pic'>\" + \"<img src= images/\" + specials_pics[i] + \">\" +\n \"</td>\" + \"</tr>\";\n }\n\n return HTML_code;\n}", "function createAnimalButton(animal) {\n var button = document.createElement(\"button\");\n var image = document.createElement(\"img\");\n button.className = \"animal-button\";\n button.addEventListener(\"click\", function (event) { return clickStyle(event, animal); });\n image.src = imageURL(animal);\n button.appendChild(image);\n answer.innerHTML = '';\n return button;\n }", "function appendItem(src,item,date){\n //create elements for each food photo and caption\n var fig = document.createElement('figure')\n fig.style.display = 'table;'\n\n var img = document.createElement(\"img\");\n img.src = src;\n img.width = 300;\n img.height = 200;\n\n var caption = document.createElement( 'figcaption' );\n caption.innerHTML = capitalizeFirstLetter(item) + \" Fresh Until: \" + date\n caption.style.textAlign = 'center';\n\n var foodDiv = document.createElement('div')\n foodDiv.style.display = \"inline-block\"\n\n //append each item to its html parent\n outputDiv.appendChild(foodDiv);\n foodDiv.appendChild(fig)\n fig.appendChild(img)\n fig.appendChild(caption)\n\n}" ]
[ "0.77532405", "0.767045", "0.62606305", "0.6174829", "0.6156835", "0.60523254", "0.60271835", "0.5993952", "0.5938058", "0.5921592", "0.58983594", "0.5883417", "0.588202", "0.58751285", "0.5870688", "0.58662444", "0.5864301", "0.58614475", "0.58340585", "0.58247584", "0.582262", "0.5817572", "0.5814403", "0.5788852", "0.57620984", "0.57556444", "0.575383", "0.5753398", "0.5741897", "0.57415307", "0.57370114", "0.5732984", "0.57231414", "0.5714627", "0.5714618", "0.5709685", "0.57077956", "0.57053894", "0.568347", "0.5679461", "0.56768346", "0.56704867", "0.56584996", "0.56517535", "0.56488746", "0.56435275", "0.56420326", "0.5641635", "0.56218123", "0.5619781", "0.5619532", "0.5611079", "0.5608309", "0.56054896", "0.56046516", "0.55986714", "0.5597878", "0.55960184", "0.5591536", "0.5581364", "0.5577465", "0.557707", "0.55663455", "0.5561233", "0.5556333", "0.55545056", "0.5551254", "0.554676", "0.5543363", "0.55431765", "0.55402166", "0.55396783", "0.553934", "0.55301875", "0.5527203", "0.5526309", "0.5526155", "0.552513", "0.55249006", "0.5517539", "0.5510762", "0.55018467", "0.5501495", "0.5498278", "0.54967546", "0.5493967", "0.5490793", "0.54881465", "0.54846096", "0.5484095", "0.548332", "0.5482963", "0.54793495", "0.5478478", "0.54781187", "0.5478002", "0.54760015", "0.5475445", "0.5471365", "0.5470055" ]
0.7386581
2
this is a function we use for creating a cupcake. This createCupcake function calls the createCupcake method of the CupcakeList class and passes in the values from our form. We then call the loadCupcakes function again to load the page with the newly created cupcake
async function createCupcake() { let flavor = $flavor.val(); let size = $size.val(); let rating = $rating.val(); let image = $ccImage.val(); let newCupcake = {flavor,size,rating,image} await CupcakeList.createCupcake(newCupcake) await loadCupcakes(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function makeCupcake() {\n\t// Get values\n\tconst flavor = $('#flavor').val();\n\tconst size = $('#size').val();\n\tconst rating = $('#rating').val();\n\tconst image = $('#image').val() ? $('#image').val() : null;\n\t// API POST Request\n\tif (image !== null) {\n\t\tconst response = await axios.post(BASE_URL, { flavor, size, rating, image });\n\t} else {\n\t\tconst response = await axios.post(BASE_URL, { flavor, size, rating });\n\t}\n\t// Append new cupcake to DOM\n\tcupcake = response.data.cupcake;\n\t$cupcakeList.prepend(makeLI(cupcake));\n}", "async function loadCupcakes() {\r\n let response = await CupcakeList.getCupcakes();\r\n cupcakes = response;\r\n console.log(cupcakes)\r\n $cupcakeList.empty();\r\n\r\n for (let cc of cupcakes.cupcakes) {\r\n console.log(cc)\r\n const html = createHTML(cc);\r\n $cupcakeList.append(html);\r\n let delBtn = document.getElementById(`del-btn-${cc.id}`);\r\n delBtn.addEventListener(\"click\",deleteCupcake);\r\n let editBtn = document.getElementById(`edit-btn-${cc.id}`);\r\n editBtn.addEventListener(\"click\",showEditForm);\r\n }\r\n }", "async function handleCupcakeForm(evt) { \n evt.preventDefault();\n\n //CODE REVIEW: These variables don't nede the dollar sign because it's just the values and not jquery data\n let $flavor = $(\"#cupcake-flavor\").val();\n let $rating = $(\"#cupcake-rating\").val();\n let $size = $(\"#cupcake-size\").val();\n let $image = $(\"#cupcake-image\").val();\n\n const newCupcake = {\n flavor: $flavor,\n rating: $rating,\n size: $size,\n image: $image\n };\n\n console.log(\"this ran\");\n console.log(\"newCupcake=\",newCupcake);\n await addNewCupcake(newCupcake);\n\n generateAndAppendCupcakeHtml(newCupcake);\n}", "function generateAndAppendCupcakeHtml(cupcake) {\n let html = `\n <li>\n Flavor:${cupcake.flavor}, \n Rating: ${cupcake.rating}, \n Size: ${cupcake.size}\n </li>\n <img src=${cupcake.image}><img>\n `;\n $updateCupcakeList.append(html);\n}", "function generateCupcakeHTML(cupcake) {\r\n return `\r\n <div data-cupcake-id=${cupcake.id}>\r\n <li>\r\n ${cupcake.flavor} / ${cupcake.size} / ${cupcake.rating}\r\n <button class=\"delete-button\">X</button>\r\n </li>\r\n <img class=\"Cupcake-img\"\r\n src=\"${cupcake.image}\"\r\n alt=\"(no image provided)\">\r\n </div>\r\n `;\r\n}", "function createHTML(cupcake) {\r\n const cupcakeHTML = $(`\r\n <div class=\"card col-3 m-3 card-${cupcake.id}\">\r\n <h1 class=\"text-center\">${cupcake.flavor}</h1>\r\n <img src=\"${cupcake.image}\" class=\"card-img-top\" id=\"cupcake-image\">\r\n <div class=\"card-body d-flex justify-content-center flex-column\">\r\n <h3>Size: <span class=\"h3-size ms-2\">${cupcake.size}</span></h3>\r\n <h3>Rating: <span class=\"h3-rating ms-2\">${cupcake.rating}</span></h3>\r\n <div class=\"d-flex flex-row\">\r\n <button class=\"btn btn-sm btn-success ms-2\" id=\"edit-btn-${cupcake.id}\" data-id=\"${cupcake.id}\">Edit</button>\r\n <button class=\"btn btn-sm btn-danger ms-2\" id=\"del-btn-${cupcake.id}\" data-id=\"${cupcake.id}\">X</button>\r\n </div> \r\n </div>\r\n </div>\r\n `);\r\n return cupcakeHTML;\r\n }", "async function showInitialCupcakes() {\r\n const response = await axios.get(`${BASE_URL}/cupcakes`);\r\n\r\n for (let cupcakeData of response.data.cupcakes) {\r\n let newCupcake = $(generateCupcakeHTML(cupcakeData));\r\n $(\"#cupcakes-list\").append(newCupcake);\r\n }\r\n}", "async function showCupcakes() {\n let response = await axios.get(BASE_URL);\n let cupcakes = response.data.cupcakes;\n\n $cupcakeList.empty();\n addCupcakesToDOM(cupcakes);\n}", "async function addNewCupcake(newCupcake) {\n const response = await axios({\n url: `${BASE_URL}/cupcakes`,\n method: \"POST\",\n data: newCupcake\n })\n\n return response.data.cupcake;\n}", "function addCupFunction() {\r\n\tvar cupID = ++rowCount;\r\n\t$(\"div#row_to_insert table tbody tr\").attr(\"name\", cupID);\r\n\tvar str = $(\"div#row_to_insert table tbody\").html();\r\n\r\n\t// append html as a cup\r\n\t$(\"#table_order tr#add_new\").before(str);\r\n\t$(\"div#row_to_insert table tbody tr\").attr(\"name\", \"cup0\");\r\n\r\n\t// create cup object\r\n\tvar cup = new Cup(cupID);\r\n\tlistCup[cupID] = cup;\r\n\r\n\tdisableCheckoutButton(false);\r\n}", "async function showCupcakesOnStart(){\n\n let response = await axios.get(`${BASE_URL}cupcakes`);\n let cupcakes = response.data.cupcakes;\n\n for (let cupcake of cupcakes){\n let $cupcakeDiv = $('<div>');\n let $cupcakeImg = $('<img>').attr(\"src\", cupcake.image);\n let $cupcakeFlavor = $('<h3>').text(cupcake.flavor);\n let $cupcakeRating = $('<h3>').text(cupcake.rating);\n let $cupcakeSize = $('<h3>').text(cupcake.size);\n $cupcakeDiv.append($cupcakeFlavor)\n .append($cupcakeImg)\n .append($cupcakeRating)\n .append($cupcakeSize)\n let $cupcakeListItem = $('<li>').append($cupcakeDiv);\n $cupcakeList.append($cupcakeListItem);\n }\n\n}", "async function displayCupcakes() {\n const response = await axios.get(`${BASE_URL}/cupcakes`);\n\n for (let cupcake of response.data.cupcakes) {\n let addCupcake = $(cupcakeHTML(cupcake));\n $(\"#menu-list\").append(addCupcake);\n }\n}", "function _createCoffeeShop(email, brandId, address, phone, coffeeCode, longitude, latitude, callback) // this creates a new CoffeeShop\n{\n\n validate.valCoffeeshop(email, brandId, address, phone, coffeeCode, longitude, latitude, function (data)\n {\n if (data)\n {\n CoffeeShop.createCoffeeShop(email, brandId, address, phone, coffeeCode, longitude, latitude, function (data2)\n {\n\n callback(data2)\n })\n } else callback(false)\n })\n\n}", "async function deleteCupcake() {\r\n let $id = $(this).data('id');\r\n let response = await CupcakeList.deleteCupcake($id,cupcakes);\r\n cupcakes = response;\r\n console.log(cupcakes)\r\n $(this).parent().parent().parent().remove();\r\n }", "async function getAndDisplayCupcakes() {\n\n let cupcakes = await getCupcakes();\n\n for (let cupcake of cupcakes) {\n generateAndAppendCupcakeHtml(cupcake);\n }\n}", "async function displayCupcakes() {\n\tresponse = await axios.get(BASE_URL);\n\tcupcakes = response.data.cupcakes;\n\tfor (cupcake of cupcakes) {\n\t\t$cupcakeContainer.append(makeDiv(cupcake));\n\t}\n}", "function makeCake(){\n\t// Ik maak een variable cake met een array erin.\n\tvar cake = ['slagroom', 'frambozen', 'chocolade',];\n\n\treturn {\n\t\t//Hier maak ik gebruk van een object literal\n\t\tgetCake: function() {\n\t\t\t/* \tHier log ik een zinnetje met daarin cake.pop(). \n\t\t\t*\tcake alleen geeft mij de volledige array terug. \n\t\t\t*\tcake.pop() verwijderd het laatste element in de array en stuurt die terug. \n\t\t\t*\tReference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop\n\t\t\t*/\n\t\t\tconsole.log('Ik heb nu een ' + cake.pop() + 'taart');\n\t\t}\n\t};\n}", "function createPage(){\nvar header = document.createElement('h3');\nheader.innerText = \"Shopping List\";\ndocument.body.appendChild(header);\ncreateForm();\npopulateList();\n}", "function setUpForm()\r\n {\r\n var form = {\r\n patients : patients,\r\n phlebotomists : phlebotomists,\r\n pscs : pscs,\r\n labTests : labTests,\r\n diagnoses : diagnoses\r\n };\r\n\r\n if (appId)\r\n {\r\n form.title = \"Updating Appointment \" + appId;\r\n // fill form with preexisting appointment info\r\n } else\r\n form.title = \"Create New Appointment\";\r\n\r\n container.append(appointmentFormTemplate(form));\r\n\r\n // Updating fields\r\n $(\"select#patient\").change(function()\r\n {\r\n $(\"span#patient\").html(patients[$(this).val()].name);\r\n $(\"span#physician\").html(patients[$(this).val()].physician.name);\r\n }).change();\r\n\r\n $(\"select#phlebotomist\").change(function()\r\n {\r\n $(\"span#phlebotomist\").html(phlebotomists[$(this).val()].name);\r\n }).change();\r\n\r\n $(\"select#psc\").change(function()\r\n {\r\n $(\"span#psc\").html(pscs[$(this).val()].name);\r\n }).change();\r\n\r\n $(\"input#addLabTest\").click(function()\r\n {\r\n $(\"div#labTestsBlock\").append(labTestTemplate(form));\r\n\r\n $(\"select#labTests\").change(function()\r\n {\r\n $(this).parent().children(\"span#labTest\").html(labTests[$(this).val()].name);\r\n }).change();\r\n\r\n $(\"select#diagnosis\").change(function()\r\n {\r\n $(this).parent().children(\"span#diagnosis\").html(diagnoses[$(this).val()].name);\r\n }).change();\r\n });\r\n\r\n $(\"input#pushAppointment\").click(function()\r\n {\r\n // convert to XML and send to server\r\n var app = {\r\n date : $(\"input#date\").val(),\r\n time : $(\"input#time\").val(),\r\n patient : $(\"select#patient\").val(),\r\n physician : patients[$(\"select#patient\").val()].physician.id,\r\n psc : $(\"select#psc\").val(),\r\n phlebotomist : $(\"select#phlebotomist\").val(),\r\n labTests : {}\r\n };\r\n\r\n $.each(_.map($(\"div#labTestsBlock\").children(\"div\"), function(val)\r\n {\r\n return {\r\n id : $(val).children(\"p\").children(\"select\")[0].value,\r\n dxcode : $(val).children(\"p\").children(\"select\")[1].value\r\n };\r\n }), function(i, o)\r\n {\r\n app.labTests[o.id] = o.dxcode;\r\n });\r\n\r\n var xml = appointmentXMLTemplate(app);\r\n\r\n function success(resp)\r\n {\r\n container.empty();\r\n var app = $(resp).children().children(\"uri\").html();\r\n var title = appId ? \"Appointment \" + appId + \" Updated\" : \"New Appointment Created\";\r\n container.append(\"<h3>\" + title + \"</h3><p style='padding-left:40px;'><a href='\" + app + \"'>\" + app + \"</a></p>\");\r\n appointmentWidget.refresh();\r\n }\r\n function error(resp)\r\n {\r\n container.empty();\r\n container.append($(resp.responseText).children(\"error\"));\r\n }\r\n\r\n if (appId)\r\n {\r\n $.ajax({\r\n url : serverURL + \"Appointments/\" + appId,\r\n method : \"PUT\",\r\n async : false,\r\n contentType : \"application/xml\",\r\n data : xml.trim()\r\n }).done(success).fail(error);\r\n } else\r\n {\r\n $.ajax({\r\n url : serverURL + \"Appointments\",\r\n method : \"POST\",\r\n async : false,\r\n contentType : \"application/xml\",\r\n data : xml.trim()\r\n }).done(success).fail(error);\r\n }\r\n });\r\n\r\n if (appId)\r\n {\r\n var app = appointments[appId];\r\n\r\n $(\"input#date\")[0].defaultValue = app.appointment.date;\r\n $(\"input#time\")[0].defaultValue = app.appointment.time;\r\n $(\"select#patient\").val(app.patient.id).change();\r\n $(\"select#phlebotomist\").val(app.phlebotomist.id).change();\r\n $(\"select#psc\").val(app.psc.id).change();\r\n\r\n // For as many labtests as this appointment has, click addLabTest\r\n // They are returned in order, so fill them in order\r\n for (var i = 0; i < app.labTests.tests.length; i++)\r\n $(\"input#addLabTest\").click();\r\n\r\n $.each($(\"select#labTests\"), function(i)\r\n {\r\n $(this).val(app.labTests.tests[i].labTest.id).change();\r\n });\r\n\r\n $.each($(\"select#diagnosis\"), function(i)\r\n {\r\n $(this).val(app.labTests.tests[i].diagnosis.dxcode).change();\r\n });\r\n\r\n } else\r\n {\r\n $(\"input#date\")[0].defaultValue = \"2015-05-20\";\r\n $(\"input#time\")[0].defaultValue = \"10:00\";\r\n }\r\n }", "function _createCoffeeBrand(CoffeeBrandName, NumbersOfCoffeesNeeded, callback)\n{\n validate.valBrand(CoffeeBrandName, NumbersOfCoffeesNeeded, function (data)\n {\n if (data)\n {\n CoffeeBrand.createCoffeeBrand(CoffeeBrandName, NumbersOfCoffeesNeeded, function (data2)\n {\n callback(data2)\n })\n } else callback(false)\n })\n\n\n}", "function fillDonutCreation() {\r\n\tlogger.info(\"fillDonutCreation(): Filling donut creation list.\");\r\n var donutCreateTemplate = _.template($(\"#donutCreateTemplate\").html());\r\n\r\n // Populate donut menu\r\n $(\"#donutSelection > tbody\").empty(); // Clear old entries\r\n for (var i = 0; i < constants.donuts.length; i++) {\r\n if (!player.donuts[i]) {\r\n continue;\r\n }\r\n\r\n var donut = constants.donuts[i];\r\n var donutInfo = donutCreateTemplate({\r\n img: `<img src=\"img/${donut.imagePath}\" style=\"max-height: ${constants.imgSize}px; max-width: ${constants.imgSize}px;\" />`,\r\n flavor: donut.flavor,\r\n cost: displayMoney(donut.cost),\r\n createId: `create${i}`,\r\n sellForId: `sellFor${i}`,\r\n id: i\r\n });\r\n\r\n $(\"#donutSelection > tbody\").append(donutInfo);\r\n }\r\n\r\n if (!player.unlockedDonuts.size) {\r\n $(\"#donutSelection > tbody\").append(\"No donuts. Head to the Upgrades tab to buy some ingredients!\");\r\n }\r\n\r\n // Fill with user's previous prices\r\n for (var i = 0; i < constants.donuts.length; i++) {\r\n if (!player.donuts[i]) {\r\n continue;\r\n }\r\n\r\n $(`#create${i}`).val(player.selectedQuantities[i]);\r\n $(`#sellFor${i}`).val(player.sellPrices[i]);\r\n }\r\n\r\n $(\"#donutSelling\").hide();\r\n $(\"#donutSelection\").show();\r\n logger.info(\"fillDonutCreation(): Filled donut creation list.\");\r\n}", "function startCreateTripPage() {\n\t$(\"#txtFromSteertAddress\").val(\"\");\n\t$(\"#txtFromCity\").val(\"\");\n\t$(\"#txtFromState\").val(\"\");\n\t$(\"#txtFromZipCode\").val(\"\");\n\t$('#lblFromSteertAddress').css('display', 'none');\n\t$('#lblFromCity').css('display', 'none');\n\t$('#lblFromState').css('display', 'none');\n\t$('#lblFromZipCode').css('display', 'none');\n\n\t$(\"#txtToSteertAddress\").val(\"\");\n\t$(\"#txtToCity\").val(\"\");\n\t$(\"#txtToState\").val(\"\");\n\t$(\"#txtToZipCode\").val(\"\");\n\t$('#lblToZipCode').css('display', 'none');\n\n\t$(\"#txtTruckID\").val(\"\");\n\t$(\"#txtOdometer\").val(\"\");\n\t$('#lblTruckID').css('display', 'none');\n\t$('#lblOdometer').css('display', 'none');\n\n\t$(\"#form_FromLocation\").css(\"display\", \"block\");\n\t$(\"#form_ToLocation\").css(\"display\", \"none\");\n\t$(\"#form_CreateTrip\").css(\"display\", \"none\");\n\t$(\"#divToAddress\").css('display', 'block');\n\t$(\"#divToEndTrip\").css('display', 'none');\n\n\tvar now = new Date();\n\tvar day = (\"0\" + now.getDate()).slice(-2);\n\tvar month = (\"0\" + (now.getMonth() + 1)).slice(-2);\n\tvar today = (month) + \"/\" + (day) + \"/\" + now.getFullYear();\n\t$('#txtCuDate').val(today);\n\n\tif (useToEndTripDiv == \"yes\") {\n\t\t$(\"#form_FromLocation\").css(\"display\", \"none\");\n\t\t$(\"#form_ToLocation\").css(\"display\", \"block\");\n\t\t$(\"#divToAddress\").css('display', 'none');\n\t\t$(\"#divToEndTrip\").css('display', 'block');\n\t} else {\n\t\tGlobalcontrollerref.myControllers.insControllerfnAjaxCall.fireAjaxCall(\"GET\", ServiceUrl + \"TripService/ShowVehicleList?CreatedById=0&DriverId=\" + JSON.parse(localStorage.DriverUserDetails).userid, {}, \"json\", C_TruckListSuccess, C_TruckListError);\n\t}\n\tuseToEndTripDiv = \"no\";\n}", "function createContent(cafe) {\n\tvar popupData = \"<h3>\" + cafe.name + \"</h3>\" +\n\t\t\"<div>\"+cafe.location+\"</div>\" +\t\t\n\t\t\"<div class='donuts'>Nearby Donuts Shops</div>\";\n\treturn popupData;\n}", "function addProduct () {\n event.preventDefault();\n var addCoffee = document.getElementById(\"new-coffee\");\n var addRoast = document.getElementById(\"new-roast\");\n var newCoffee = {\n name: addCoffee.value,\n roast: addRoast.value\n };\n coffees.push(newCoffee);\n outputHTML.innerHTML = renderCoffees(coffees);\n}", "function load_page (num_toppings, size) {\n\n document.querySelector('#addtocart').disabled = false;\n removeMessages();\n\n // set size option with selection, but keep hidden\n var size_selection = document.getElementById('size');\n if (size_selection.options[0].innerHTML == size)\n size_selection.selectedIndex = 0;\n else\n size_selection.selectedIndex = 1; \n\n var count_toppings = 0;\n\n // only display toppings if pizza type selection is not cheese\n if (count_toppings < num_toppings) {\n\n // show topping options for customer to select and submit\n document.getElementById('topping-selections').style.display = 'block'; \n document.getElementById('topping-title').style.display = 'block'; \n document.getElementById('1').style.display = 'block'; \n document.getElementById('topping1').style.display = 'inline-block'; \n\n // set toppings based on pizza order selections\n var ul = document.getElementById('topping-selections');\n var topping1 = document.getElementById('topping1');\n var item = [];\n \n // if special, get items included\n if (num_toppings == 4) {\n for (var i = 0; i < topping1.length; i++) {\n if (topping1.options[i].text.includes(\"*\")) {\n item[count_toppings++] = topping1.options[i].value;\n }\n }\n num_toppings = count_toppings;\n }\n\n // create selection for each additional topping in pizza type\n for (var i = 1; i < num_toppings; i++) { \n\n var new_dropdown = topping1.cloneNode(true);\n new_dropdown.name = \"topping\" + (i+1);\n new_dropdown.id = \"topping\" + (i+1);\n\n var li = document.createElement(\"li\");\n li.id = (i+1);\n li.appendChild(new_dropdown);\n ul.appendChild(li);\n ul.style.display = 'inline-block'; \n }\n }\n else {\n document.getElementById('topping-selections').style.display = 'none'; \n document.getElementById('topping-title').style.display = 'none'; \n document.getElementById('1').style.display = 'none'; \n document.getElementById('topping1').style.display = 'none';\n }\n\n // if special, set selection to next included\n if (num_toppings > 3) {\n for (var i = 0; i < item.length; i++){\n var t = 0;\n var found = false;\n while ((t < topping1.length) && (!found)) { \n if (topping1.options[t].value == item[i]) {\n var el_id = \"topping\" + (i+1);\n var el = document.getElementById(el_id)\n el.selectedIndex = t;\n found = true;\n }\n t++;\n }\n }\n }\n}", "function buildPage(){\n addItems('make', make);\n addItems('model', model);\n addItems('keywords', keywords);\n checkAll();\n}", "function makePage(){\n\n codeFellows.makeList();\n disneyLand.makeList();\n}", "function CallCreate() {\n if (_contentBody != null && _contentBody != \"MasterBody\") { \n $(\"#\" + _contentBody).LoadView({ url: \"~/\" + _controller + \"Create?windowId=\" + _contentBody });\n }\n else {\n window.location.href = \"Create\";\n }\n }", "function makeListing() {\n\tconsole.log(\"Make Listing Button Pressed.\");\n\n\t//numberOfWhateverUnits variables initialized in 'make-a-listing-page.js'\n\tpost = {\n\t\tnumFashion: numberOfFashionUnits,\n\t\tnumElectronics: numberOfElectronicsUnits,\n\t\tnumCollectables: numberOfCollectablesUnits,\n\t\tquantity: 1, //default for now. Possibly based on user input down the road. \n\t\titemName: selectedItemType,\n\t\tprice: price\n\t}\n\n\t$.ajax({\n method: \"POST\",\n url: \"/api/new-listing\",\n data: post\n })\n .done(function(data) {\n \tif (data.success)\n \t\twindow.location = data.redirectTo;\n });\n}", "create() {\n\t\t$.when($.ajax(CREATE_URL))\n\t\t\t.then((data, textStatus, jqXHR) => {\n\t\t\t\tif (data.success) {\n\t\t\t\t\tthis.update(data);\n\t\t\t\t\t//save deck_id if we've just created a new deck.\n\t\t\t\t\tthis.vent.pub('save');\n\t\t\t\t\tthis.vent.pub('appReady');\n\t\t\t\t} else {\n\t\t\t\t\tthis.vent.pub('error');\n\t\t\t\t}\n\t\t\t});\n\t}", "function newCatMachine() {\n\t //event listener already added to button in initial render\n\n\t //select inputs and button\n\t var name = document.getElementById(\"new-cat-name\").value;\n\t var url = document.getElementById('new-cat-url').value;\n\n\t //add to model using constructor\n\t var newCat = new Cat(name, url);\n\t cats.push(newCat);\n\n\t //rerender nav\n\t renderNavBar();\n\n\t}", "function postCreate(data){\n $.post(location, data).done(function(_data){\n clearForm();\n updateTableCrate(_data);\n });\n }", "function addCategory(){\n var categoryName = document.getElementById(\"cat-name-input\").value; // Get category name from input\n var categoryBudget = document.getElementById(\"cat-budget-input\").value; // Get budget from input\n\n // If user inputs are okay, make AJAX request\n if(verifyInputs(categoryName,categoryBudget,\"category\")){\n // Create data for request\n var data;\n data = '{\"name\":\"' + categoryName + '\",\"budget\":' + categoryBudget + '}';\n\n // Make AJAX request to post new category to category list\n makeReq(\"POST\", \"/budget/cats\", 201, getCats, data);\n\n // Clear input boxes\n document.getElementById(\"cat-name-input\").value = \"\";\n document.getElementById(\"cat-budget-input\").value = \"\";\n }\n}", "function makeCake(size,flavor){\n\tlet ingredients = [];\n\tlet cake \n\t// find recipe\n\tsearchRecipe(flavor);\n\t\n\t// get ingredients\n\tfetchIngredients('/api/shopper')\n\t// .then(ingredient => ingredients.push(ingredient));\n\n\t// mix and cook ingredients\n\tmixAndCook(ingredients)\n\t// .then(result => cake = result);\n\n\t// decorate and final touch\n\tdecorate(cake);\n\n\t// cake is ready!\n\treturn cake; \n}", "function addToList(cakeId, cakeName, quantity, selectedText , price, description, productImage) {\n const item = {\n cakeId: cakeId, \n cakeName: cakeName,\n quantity: quantity, \n weight: selectedText, \n price: price, \n description: description,\n productImage: productImage\n }\n formList.push(item);\n console.log(formList);\n// clear the form for the next input \n clearForm();\n console.log(`Total Submission: ${formList.length}`.formList);\n}", "function addProf() {\n var profName = document.getElementById(\"prof-name\").value;\n var profEmail = document.getElementById(\"prof-email\").value;\n var profPhone = document.getElementById(\"prof-tel\").value;\n var profBuilding = document.getElementById(\"prof-building\").value;\n var profRoom = document.getElementById(\"prof-room\").value;\n \n var profDays = [];\n var profDaysList = document.getElementsByClassName(\"prof-days\");\n for(var i = 0; i < profDaysList.length; i++) profDays[i] = profDaysList[i].value;\n var profStart = [];\n var profStartList = document.getElementsByClassName(\"prof-start-times\");\n for(var i = 0; i < profStartList.length; i++) profStart[i] = profStartList[i].value;\n var profEnd = [];\n var profEndList = document.getElementsByClassName(\"prof-end-times\");\n for(var i = 0; i < profEndList.length; i++) profEnd[i] = profEndList[i].value;\n \n var profObject = {\n\tname: profName,\n\temail: profEmail,\n\tphone_number: profPhone,\n\tbuilding: profBuilding,\n\toffice_number: profRoom,\n\toffice_days: profDays.slice(),\n\toffice_begin: profStart.slice(),\n\toffice_end: profEnd.slice()\n };\n \n if(_profList) {\n\tfor(var i = 0; i < _profList.length; i++) {\n if(profName == _profList[i].name) {\n window.alert(\"You already have this professor!\");\n return;\n }\n\t}\n }\n \n _profList.push(profObject);\n saveResources();\n updateUI();\n setupCanvas();\n \n closePopUps(\"add-prof\");\n }", "function makeObject(checkboxArray){\n\tvar clinic = {};\n\tvar form = {}\n\tvar submit = [];\n\tvar counter = 0;\n\n\tsubmits.push({\n\t\tcompleteRows: completeRows,\n\t\ttotalRows: rowCount,\n\t\tsubmit: checkboxArray\n\t});\n\n\t// If the clinic already has this form\n\tif(containsForm() === true){\n\t\tpostObjects(phArray);\n\t}else{\n\t\t// If the clinic contains no forms\n\t\tsubmits = []\n\t\tsubmits.push({\n\t\t\tcompleteRows: completeRows,\n\t\t\ttotalRows: rowCount,\n\t\t\tsubmit: checkboxArray\n\t\t});\n\n\t\tfor(key in phArray){\n\n\t\t\t// If the clinic does not contain this spesific form. Returns true\n\t\t\tif(phArray[key].clinic.cID === facilityID){\n\t\t\t\t\n\t\t\t\tphArray[key].clinic.forms.push({\n\t\t\t\t\tname: formName,\n\t\t\t\t\tfID: formID,\n\t\t\t\t\tformCompleteRows: completeRows,\n\t\t\t\t\tformTotalRows: rowCount,\n\t\t\t\t\tsubmitCount: 1,\n\t\t\t\t\tsubmits: submits\n\t\t\t\t});\n\t\t\t\tpostObjects(phArray);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// phArray does not contain clinic\n\t\tforms = [];\n\n\t\tforms.push({\n\t\t\tname: formName,\n\t\t\tfID: formID,\n\t\t\tformCompleteRows: completeRows,\n\t\t\tformTotalRows: rowCount,\n\t\t\tsubmitCount: 1,\n\t\t\tsubmits: submits\n\t\t});\n\n\t\tclinic = {\n\t\t\tname: facilityName,\n\t\t\tcID: facilityID,\n\t\t\tforms: forms\n\t\t}\n\t\t\n\t\tphArray.push({\n\t\t\tclinic: clinic\n\t\t});\n\n\t\tpostObjects(phArray);\n\t}\n}", "function makeChore(newChore) {\n console.log('in makeChore', newChore);\n // ajax call to server to get chore table\n $.ajax({\n type: 'POST',\n url: '/chores',\n data: newChore\n }).then(function (response) {\n console.log('Response from server.', response);\n getChores();\n }).catch(function (error) {\n console.log('Error in POST', error)\n alert('Unable to add chore please try again.');\n });\n}", "addClient(data) {\n\t\t//page 1\n\t\tutil.selectDropDown(p1.group, data.Group, 'Group', 'Client Settings');\n\t\tif (data.ClientName != undefined)\n\t\t\tdata.ClientName = data.ClientName + util.randomnumbergeneration(9999);\n\t\tutil.inputValidation(p1.clientNameInput, data.ClientName, 'Client Name', 'Client Settings')\n\t\tutil.inputValidation(p1.address1, data.Address1, \"Address 1\", \"Client Settings\");\n\t\tutil.inputValidation(p1.address2, data.Address2, \"Address 2\", \"Client Settings\");\n\t\tutil.inputValidation(p1.city, data.city, \"city\", \"Client Settings\");\n\t\tutil.inputValidation(p1.state, data.state, \"state\", \"Client Settings\");\n\t\tutil.elementClickable(p1.nextBtn)\n\n\t\t//page2\n\t\tutil.inputValidation(p2.internalClientNum, data.InternalClientNum, 'InternalClientNum', 'Add Client');\n\t\tbrowser.actions().sendKeys(protractor.Key.TAB).perform()\n\t\tbrowser.actions().sendKeys(data.ClientIdLbxNum).perform()\n\t\tutil.elementClickable(p2.nextBtn)\n\n\t\t//page3\n\t\tutil.elementClickable(p3.addSortpatternBtn);\n\t\tutil.inputValidation(p3.workType, data.WorkType, 'WorkType', 'Add Client');\n\t\tutil.inputValidation(p3.sortPattern, data.SortPattern, 'SortPattern', 'Add Client');\n\t\tutil.inputValidation(p3.description, data.Description, 'Description', 'Add Client');\n\t\tutil.elementClickable(p3.slaApplyBtn)\n\t\tutil.elementClickable(p3.nextBtn)\n\n\t\t//page4\n\t\tutil.elementClickable(p4.nextBtn)\n\n\t\t//page5\n\t\tutil.inputValidation(p5.capturePassConfigName, data.capturePassConfigName, 'capturePassConfigName', 'Add Client');\n\t\tutil.inputValidation(p5.encodePassConfigName, data.encodePassConfigName, 'encodePassConfigName', 'Add Client');\n\t\tif (data.RearImageCapture == 'yes')\n\t\t\tutil.elementClickable(p5.rearImageCapture);\n\t\tif (data.FrontGreyScaleCapture == 'yes')\n\t\t\tutil.elementClickable(p5.frontGreyScaleCapture);\n\t\tif (data.RearGreyScaleCapture == 'yes')\n\t\t\tutil.elementClickable(p5.rearGreyScaleCapture);\n\t\tif (data.VerifyMICRData == 'yes')\n\t\t\tutil.elementClickable(p5.verifyMICRData);\n\t\tif (data.EnableMicroFilm == 'yes')\n\t\t\tutil.elementClickable(p5.enableMicroFilm);\n\t\tif (data.FrontImageCapture == 'yes')\n\t\t\tutil.elementClickable(p5.chkFrontImageCapture);\n\t\tif (data.NodisplayImages == 'yes')\n\t\t\tutil.elementClickable(p5.displayImages.get(0));\n\t\telse\n\t\t\tutil.elementClickable(p5.displayImages.get(1));\n\t\tutil.elementClickable(p5.captureToFile);\n\t\tutil.elementClickable(p5.useControlDocument);\n\t\tutil.inputValidation(p5.imageDataRetention, data.imageDataRetention, 'capturePassConfigName', 'Add Client');\n\t\tutil.elementClickable(p5.nextBtn)\n\n\t\t//page6\n\t\tutil.inputValidation(p6.captureDirectory, data.captureDirectory, 'Capture Directory', 'Add Client');\n\t\tutil.selectDropDown(p6.fileName, data.fileName, 'fileName', 'Add Client');\n\t\tutil.elementClickable(p6.nextbtn)\n\n\t\t//page7\n\t\tutil.elementClickable(p7.availableStages)\n\t\tutil.elementClickable(p7.rightarrowbtn.get(1));\n\t\tutil.elementClickable(p7.nextBtn7)\n\n\t\t//page8\n\t\tutil.inputValidation(p8.maxItems_Pocket, data.maxItems_Pocket, 'MaxItems Pocket', 'Add Client');\n\t\tutil.inputValidation(p8.rejectPocketID, data.rejectPocketID, 'Reject PocketID', 'Add Client');\n\t\tutil.elementClickable(p8.nextBtn)\n\n\t\t//page9\n\t\tutil.inputValidation(p9.micrVerifedPocket, data.micrVerifedPocket, 'Micr Verifed Pocket', 'Add Client');\n\t\tutil.inputValidation(p9.micrReviewPocket, data.micrReviewPocket, 'Micr Review Pocket', 'Add Client');\n\t\tutil.elementClickable(p9.nextBtn)\n\n\t\t//page10\n\t\tutil.selectDropDown(p10.selectMedia, data.selectMedia, 'selectMedia', 'Add Client');\n\t\tutil.elementClickable(p10.availableFormats);\n\t\tutil.elementClickable(p10.arrowrytBtn.get(2));\n\t\tutil.inputValidation(p10.noOfCopies, '1', 'Micr Review Pocket', 'Add Client');\n\t\tutil.elementClickable(p10.nextBtn);\n\t\tbrowser.sleep(2000)\n\t\tutil.elementClickable(p10.archiveIndexAvailableFormatfieldData)\n\t\tutil.elementClickable(p7.rightarrowbtn.get(3));\n\t\tutil.elementClickable(p10.nextBtn1)\n\n\t\t//page11\n\t\tutil.elementClickable(p11.nextBtn)\n\n\t\t//page12\n\t\tutil.selectDropDown(this.dataSourceDpn, data.DataSource, 'Data Source ', 'Add Client');\n\t\tutil.selectDropDown(this.sourceImageFormatDpn, data.SourceImageFormat, 'SourceImageFormat ', 'Add Client');\n\t\tif (data.EnableFreeScanScheduling == 'yes') {\n\t\t\tutil.elementClickable(this.enableFreeScanSchedulingChkbox);\n\t\t\tutil.selectDropDown(this.extractPeriodDpn, data.ExtractPeriod, 'ExtractPeriod ', 'Add Client');\n\t\t\tutil.inputValidation(this.extractOn, data.ExtractOn, 'ExtractOn', 'Add Client');\n\t\t\tif (data.includedataRdBtn_No = 'yes')\n\t\t\t\tutil.elementClickable(this.includedataRdBtn_Yes);\n\t\t\telse\n\t\t\t\tutil.elementClickable(this.includedataRdBtn_No);\n\t\t\tif (data.ProcessDate != undefined) {\n\t\t\t\tutil.elementClickable(this.initiatedate)\n\t\t\t\tthis.presentDate.click()\n\t\t\t}\n\t\t}\n\t\tutil.scrolldown(this.submitBtn)\n\t\tbrowser.sleep(2000)\n\t\t// util.elementClickable(this.submitBtn);\n\t\t// browser.sleep(4000)\n\t\tutil.multipleClickOnElement(this.submitBtn).multipleClickOnElement(this.submitconfirmdialogbtn).elementClickable(this.yes);;\n\t\t// util.elementClickable(this.submitconfirmdialogbtn);\n\t\t// if (data.TestResultType != 'Inline')\n\t\t// util.elementClickable(this.submitconfirmdialogbtn);\n\t\treturn util.resultMessage(data.TestResultType);\n\t}", "function loadCreatingCourseForm(){\n\t\t$(\".create_course_open_modal\").click(function(){\n\t\t\t$(\"#course_editing_modal\").empty();\n\t\t\t$(\"#course_creating_modal\").load(\"../Tab_Course/course_create.php\", function(){\n\t\t\t\tadd_prereq();\n\t\t\t\tremoveAddedPrereq();\n\t\t\t\tclickPrereqSearch();\n\t\t\t\tcreationConfirmation();\n\t\t\t});\n\t\t});\n\t}", "function makeCats(){\n\t\t\tvar formtag = document.getElementsByTagName(\"form\");\n\t\t\tselectLi = snatchelement(\"select\");\n\t\t\tmakeSelect = document.createElement(\"select\");\n\t\t\tmakeSelect.setAttribute(\"id\", \"posplayed\");\n\t\tfor(var i=0; j=posplayed.length; i<j, i++){\n\t\t\tvar maketime = document.createElement(\"option\");\n\t\t\tvar optText = posplayed[i];\n\t\t\tmaketime.setAttribute(\"value\", optText);\n\t\t\tmaketime.innerHTML = optText;\n\t\t\tmakeSelect.appendChild(maketime);\n\t\t}\n\t\tselectLi.appendChild(makeSelect);\n\t}", "function createPage() {\r\n\r\n clearSection(setPoolSize);\r\n clearSection(setPlayerNames);\r\n clearSection(setRatings);\r\n clearSection(playerPool);\r\n clearSection(generator);\r\n clearSection(prepTeam);\r\n\r\n homeTeam.className = \"col card bg-light border-dark\";\r\n awayTeam.className = \"col card bg-light border-dark\";\r\n \r\n populateSection(homeTeam, \"H3\", \"Home Team\");\r\n home.forEach((home)=>populateSection(homeTeam, \"P\", home.getName() + \" / \" + home.getRating() ));\r\n populateSection(homeTeam, \"H4\", \"Rating: \" + homeScore)\r\n \r\n populateSection(awayTeam, \"H3\", \"Away Team\");\r\n away.forEach((away)=>populateSection(awayTeam, \"P\", away.getName() + \" / \" + away.getRating() ));\r\n populateSection(awayTeam, \"H4\", \"Rating: \" + awayScore);\r\n\r\n reset.focus();\r\n }", "function addClient() {\n var clients = [],\n nameUnique = true,\n abbreviationUnique = true,\n dynamicData = {};\n\n clients = DOM.$clienttablebody.find(\"tr\");\n\n dynamicData[\"name\"] = DOM.$clientnameinput.val();\n dynamicData[\n \"abbreviation\"\n ] = DOM.$clientabbreviationinput.val().toUpperCase();\n dynamicData[\"position\"] = clients.length + 1;\n\n if (\n dynamicData[\"name\"] !== \"\" &&\n dynamicData[\"abbreviation\"] !== \"\" &&\n isValid(dynamicData[\"name\"]) &&\n isValid(dynamicData[\"abbreviation\"])\n ) {\n clients.each(function() {\n {\n if ($(this).attr(\"data-name\") == dynamicData[\"name\"]) {\n nameUnique = false;\n }\n if (\n $(this).attr(\"data-abbreviation\") == dynamicData[\"abbreviation\"]\n ) {\n abbreviationUnique = false;\n }\n }\n });\n if (nameUnique) {\n if (abbreviationUnique) {\n addClientToDB(dynamicData).done(function(data) {\n renderClient(JSON.parse(data));\n DOM.$clientnameinput.val(null);\n DOM.$clientabbreviationinput.val(null);\n });\n } else {\n alert(\"Abbreviation is not unquie\");\n }\n } else {\n alert(\"Name is not unquie\");\n }\n } else {\n alert(\"Please enter name and abbreviation\");\n }\n }", "function createCats(cats) {\n\n}", "static async createCoop(req,res){\n\t\t// // try and catch to find if not exist and create new coop\n\t\ttry{ \n\t\t\tconst {coopName,coopLocation,tin} = req.body;\n\t\t\tconst UserId= req.user.userFind.id;\n\t\t\tconst Op = Sequelize.Op;\n\t\t// \t// find if exist\n\t\t\tconst findOne = await Coop.findOne({where: {tin}});\n\t\t\tif (!findOne) {\n\t\t\t\tconst coudinary_links = await cloud(req.files);\n\t\t\t\tconst createcoop = Coop.create({\n\t\t\t\t\tcoopName,\n\t\t\t\t\tcoopLocation,\n\t\t\t\t\ttin,\n\t\t\t\t\tUserId,\n\t\t\t\t\tRBCertificate:coudinary_links[0],\n\t\t\t\t\tRAClearance:coudinary_links[1],\n\t\t\t\t\tcoopAgrees:coudinary_links[2],\n\t\t\t\t\tcoopSignL:coudinary_links[3],\n\t\t\t\t\tleaderCert:coudinary_links[4]\n\t\t\t\t}).then(result =>{\n\t\t\t\t\treturn res.render('add-coop',{\n\t\t\t\t\t\tuser:req.user.userFind,\n\t\t\t\t\t\trole:{\n\t\t\t\t\t\t\tisEax:req.user.role.isEax(req.user.userFind),\n\t\t\t\t\t\t\tisCoop:req.user.role.isCoop(req.user.userFind),\n\t\t\t\t\t\t\tisBidder:req.user.role.isBidder(req.user.userFind),\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmessage:'cooperative created successfully!',\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tcatch(err){\n\t\t\treturn res.render('500');\n\t\t}\n\t}", "function productcreate()\r\n{\r\n //call the GetXmlHttpObject() to see what browser you are using\r\n xmlhttp = GetXmlHttpObject();\r\n if (xmlhttp == null) {\r\n alert(\"Browser does not support HTTP Request\");\r\n return;\r\n }\r\n\t//sets the variables that make up the URL\r\n var type = document.getElementById('p-type').value;\r\n\tvar name = document.getElementById('p-name').value;\r\n\tvar price = document.getElementById('p-price').value;\r\n\tvar sprice = document.getElementById('p-sprice').value;\r\n\tvar dis = document.getElementById('p-dis').value;\r\n var action = \"xx\";\r\n var url = \"../includes/pro-create.php\";\r\n url = url + \"?action=\" + action;\r\n url = url + \"&type=\" + type;\r\n\t\turl = url + \"&name=\" + name;\r\n\t\turl = url + \"&price=\" + price;\r\n\t\turl = url + \"&sprice=\" + sprice;\r\n\t\turl = url + \"&dis=\" + dis;\r\n\t//opens and sends the HTTP request\r\n xmlhttp.open(\"GET\", url, true);\r\n xmlhttp.send(null);\r\n\t//calls the showKitsetData function when the readystate changes\r\n xmlhttp.onreadystatechange = showCubaData2;\r\n \r\n}", "function createCase(){\n /**\n * This function reads the data from the doctor and the patient, and consequently creates a case.\n * Finally it fills the case's input inside the analysis request form.\n */\n var patientuid = $('input#ar_0_Patient').attr('uid');\n var doctoruid = $('input#ar_0_Doctor').attr('uid');\n var clientuid = $('input#ar_0_Client_uid').val();\n var request_data = {\n obj_path: '/Plone/batches',\n obj_type: 'Batch',\n Patient: \"catalog_name:bika_patient_catalog|portal_type:Patient|UID:\" + patientuid,\n Doctor:\"portal_type:Doctor|UID:\" + doctoruid,\n Client:\"portal_type:Client|UID:\" + clientuid\n };\n $.ajaxSetup({async: false});\n $.ajax({\n type: \"POST\",\n dataType: \"json\",\n url: window.portal_url + \"/@@API/create\",\n data: request_data,\n success: function(data){\n // To obtain the case's uid\n window.bika.lims.jsonapi_read({\n catalog_name: 'bika_catalog',\n content_type: 'Batch',\n id: data['obj_id']\n }, function (dataobj) {\n // Writing the case's uid inside the analysis request creation's form. Thus when the analysis\n // request form submits, it will catch the case's uid and create it.\n $('form#analysisrequest_edit_form input#ar_0_Batch').attr('uid', dataobj.objects[0]['UID']);\n $('form#analysisrequest_edit_form input#ar_0_Batch_uid').val(dataobj.objects[0]['UID']);\n });\n // The case's input also needs their id.\n $('form#analysisrequest_edit_form input#ar_0_Batch').val(data['obj_id']);\n },\n error: function(XMLHttpRequest, statusText) {\n window.bika.lims.portalMessage(statusText);\n window.scroll(0,0);\n $(\"input[class~='context']\").prop(\"disabled\", false);\n }\n });\n $.ajaxSetup({async: true});\n }", "function makePizza(crust, size , slices){\n var pizza = {};\n pizza.crust = crust;\n pizza.size = size;\n pizza.slices = slices;\n pizza.ingredients = [];\n return {\n addIngredients : function(str){\n pizza.ingredients.push(str)\n },\n displayIngredaints : function(){\n return \"the ingredients are : \"+ pizza.ingredients.join(\",\")\n },\n bakePizza : function(){\n setTimeout(function(){\n console.log( \"Your \"+ pizza.crust +\" \" + pizza.size + \" \" + pizza.slices + \" slice is finished\")\n },2000)\n },\n eatSlice : function(){\n if(piz.slices > 0 ){\n return piz.slices -= 1 ;\n }\n return \"you have eated your pizza \"\n }\n }\n }", "function addNewCoffee(e) {\n e.preventDefault(); // don't submit the form, we just want to update the data\n\n console.log(localStorage);\n\n // Declare empty newCoffee object to store the new coffee info (id, name, roast)\n const newCoffee = {};\n\n // Add the id property to newCoffee object by using coffees array length plus 1\n newCoffee.id = coffees.length + 1;\n\n // Declare newCoffee variable to store the new user coffee name\n const newCoffeeName = addCoffee.value;\n if (newCoffeeName.length > 0 && isNaN(newCoffeeName)) {\n newCoffee.name = newCoffeeName;\n } else {\n console.log(\"Invalid coffee name entry.\");\n\n //set default for undefined coffee name entry\n newCoffee.name = \"newCoffee\";\n }\n\n // Declare newRoast variable to store the new user selected roast type\n const newRoast = addRoast.value;\n newCoffee.roast = newRoast;\n\n // Add newly created coffee object to coffees and filteredCoffees array then re-render\n coffees.push(newCoffee);\n filteredCoffees.push(newCoffee);\n\n // Add newly created coffee object to localStorage\n localStorage.setItem(`${newCoffee.id}`, JSON.stringify(newCoffee));\n tbody.innerHTML = renderCoffees(filteredCoffees);\n}", "function CrearCuento(){\n SeleccionLibro();\n BorrarPaginasCuento();\n\n var Cuento = {Nombre:$('#InputNombre').val(),Coleccion:$('#SelectorColecciones').val()};\n InsertarCuentos(Cuento);\n GetIDCuento(Cuento);\n CargarCuentos();\n}", "function createRecipe() {\r\n\r\n\t\tvar steps = new Array();\r\n\t\t$('input[name^=\"step\"]').each(function(index) {\r\n\t\t\tvar step = {\r\n\t\t\t\tlabel : $(this).val(),\r\n\t\t\t\torder : (index + 1)\r\n\t\t\t};\r\n\t\t\tif (step.label) {\r\n\t\t\t\tsteps.push(step);\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tvar recipeIngredients = new Array();\r\n\t\t$('input[name^=\"ingredient\"]').each(function(index) {\r\n\t\t\tvar ingredient = {\r\n\t\t\t\tlabel : $(this).val(),\r\n\t\t\t\tid : ($(this).attr('data-id') ? $(this).attr('data-id') : '')\r\n\t\t\t};\r\n\t\t\tvar recipeIngredient = {\r\n\t\t\t\t'ingredient': ingredient,\r\n\t\t\t\t'amount': $('.amount', $(this).parent('li')).val()\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tif (ingredient.label) {\r\n\t\t\t\trecipeIngredients.push(recipeIngredient);\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tvar recipe = {\r\n\t\t\t'title' : $('#createRecipeForm > input[name=\"title\"]').val(),\r\n\t\t\t'recipeSteps' : steps,\r\n\t\t\t'recipeIngredients' : recipeIngredients\r\n\t\t};\r\n\t\t\r\n\t\t/*for (var i in recipe.recipeIngredients){\r\n\t\t\trecipe.recipeIngredients[i]['recipe'] = recipe;\r\n\t\t}*/\r\n\r\n\t\tvar json = JSON.stringify(recipe);\r\n\t\t$.ajax({\r\n\t\t\turl : \"recipe\",\r\n\t\t\ttype : \"POST\",\r\n\t\t\tdata : JSON.stringify(recipe),\r\n\t\t\tsuccess : onCreateSuccess,\r\n\t\t\tdataType : \"json\",\r\n\t\t\tcontentType : \"application/json\"\r\n\t\t});\r\n\r\n\t\treturn false;\r\n\t}", "async createClub(testController) {\n await testController.typeText('#create-clubs-form-clubName', 'Test Club');\n await testController.typeText('#create-clubs-form-image', 'https://churchonthesound.org/wp-content/uploads/2020/03/This-is-a-test.jpg');\n await testController.typeText('#create-clubs-form-email', '[email protected]');\n await testController.typeText('#create-clubs-form-website', 'https://youtube.com');\n await testController.typeText('#create-clubs-form-description', 'This is just a test club and it is going to be deleted soon.');\n await testController.click('#create-clubs-form-submit');\n }", "function populateTable(){\n var tableContent = '';\n // empty array to store all of our cuisine types\n var cuisines = [];\n // empty string to eventually store our select cuisine menu data\n var cuisineContent = '';\n\n // jquery AJAX call for JSON\n $.getJSON('/recipes/recipelist', function (data){\n\n // adds all recipe info from database to the global variable\n recipeListData = data;\n\n // for each item in our JSON, add a table row and cells to the content string\n $.each(data, function(){\n tableContent += '<tr>';\n // this checks the global selectedRecipes to see if the recipe has been selected already\n // if it has, it puts it in the table with a checked checkbox\n if (selectedRecipes.indexOf(this.name) === -1) {\n tableContent += '<td><input type=\"checkbox\" id=\"' + this.name.replace(/\\s+/g, '_') + 'Checkbox\" class=\"recipeCheckbox\"></td>';\n } else {\n tableContent += '<td><input type=\"checkbox\" id=\"' + this.name.replace(/\\s+/g, '_') + 'Checkbox\" class=\"recipeCheckbox\" checked></td>';\n }\n tableContent += '<td><a href=\"#\" class=\"linkshowuser\" rel=\"' + this.name + '\">' + this.name + '</a></td>';\n tableContent += '<td>' + this.cuisine + '</td>';\n tableContent += '</tr>';\n });\n\n // inject the whole content string into our existing HTML table\n $('#recipeList table tbody').html(tableContent);\n\n // create cuisine array to populate the select cuisine menu\n $.each(data, function(i){\n if (cuisines.indexOf(this.cuisine)=== -1) {\n cuisines.push(this.cuisine);\n }\n });\n\n // this function populates the Select Cuisine menu with all of the cuisines from the global recipeListData\n (function(){\n cuisineContent += '<option value=\"select\" selected>All Cuisines</option>';\n cuisines.forEach(function(item){\n cuisineContent += '<option value=\"' + item +'\">' + item + \"</option>\";\n });\n //menuContent += '</select>';\n })();\n\n $('#cuisine-select select').html(cuisineContent);\n });\n}", "create() {\n this.id = 0;\n this.familyName = null;\n this.givenNames = null;\n this.dateOfBirth = null;\n\n this.validator.resetForm();\n $(\"#form-section-legend\").html(\"Create\");\n this.sectionSwitcher.swap('form-section');\n }", "function new_customer(e){\r\n\t\te.preventDefault();\r\n\t\ttest.templateScenariosPromise = prepare_scenario_check();\r\n\t\t//after the template data has loaded, we create the the customer\r\n\t\ttest.templateScenariosPromise.always(create_customer);\r\n \t}", "async function addCakeToDB(cake) {\n const Cake = schema.Cake;\n let newCake = new Cake({\n _id: await getNextSequenceValue('cakeId'),\n name: cake.name,\n comment: cake.comment,\n imageUrl: cake.imageUrl,\n yumFactor: cake.yumFactor\n });\n\n return new Promise((resolve, reject) => {\n Cake.findOneAndUpdate(\n { _id: newCake.id },\n newCake,\n { upsert: true },\n err => {\n if (err) {\n reject(err);\n }\n resolve(newCake);\n }\n );\n });\n}", "async createHouse() {\n try {\n \n \n window.event.preventDefault()\n /** @type {HTMLFormElement} */\n // @ts-ignore\n const formElem = window.event.target\n const houseData = {\n bedrooms: formElem.bedrooms.value,\n bathrooms: formElem.bathrooms.value,\n levels: formElem.levels.value,\n imgUrl: formElem.imgUrl.value,\n year: formElem.year.value,\n price: formElem.price.value,\n description: formElem.description.value\n }\n \n housesService.createHouse(houseData)\n// the form portion ends here\n // this little bit is a snippet from bootstrap that allows the form to reset to default on submit. \n formElem.reset()\n \n bootstrap.Modal.getInstance(document.getElementById('form-modal')).toggle()\n } catch (error) {\n console.error(error, 'aint goin happen')\n }\n }", "async function loadEditorPage(orderId, pizzaId) {\n\n const pageContent = await fetch('js/views/pizza-editor.html')\n const pageHTML = await pageContent.text()\n mainContent.innerHTML = pageHTML\n const form = document.querySelector('#pizza-editor-form')\n\n if (parseInt(orderId))\n document.querySelector('#order-id').innerHTML = `Order Id-${orderId}`\n else\n document.querySelector('#order-id').innerHTML = `New Order`\n\n //if the pizza id is not null that means the person is updating the pizza info\n //so, we need to load the pizza info into the UI\n if (pizzaId) {\n //we are editing a pizza info, so we need to populate the existing pizza information\n console.log('editing')\n const pizza = await orderRepo.getPizza(orderId, pizzaId)\n console.log(pizza.name)\n\n // document.querySelector('#name').value = pizza.size\n document.querySelector('#size').value = pizza.size\n document.querySelector('#name').value = pizza.name\n for (const topping of pizza.toppings) {\n console.log(topping)\n document.querySelector(`#${topping}`).checked = true\n }\n\n }\n\n //when they submit the pizza we send the order id and pizza id\n //to tell the saveOrder method, whether it is edit or add new\n //or whether we are creating new order or adding to existing one\n\n form.onsubmit = (event) => saveOrder(event, orderId, pizzaId)\n\n}", "function saveCat(){\n var name = document.getElementById(\"edit-cat-header\").value;\n var newBudget = document.getElementById(\"edit-budget-input\").value;\n\n // If user inputs are okay, make AJAX request\n if(verifyInputs(name,newBudget,\"category\")){\n // Create data for request\n var data;\n data = '{\"name\":\"' + name + '\",\"budget\":' + newBudget + '}';\n\n // Make AJAX request to post new category to category list\n makeReq(\"PUT\", \"/budget/cats/\"+name, 201, getCats, data);\n }\n document.getElementById(\"edit-cat-modal\").style.display=\"none\";\n}", "function addCat(event) {\r\n event.preventDefault()\r\n\r\n let form = event.target\r\n\r\n let newCat = {\r\n id: createId(),\r\n name: form.name.value,\r\n mood: \"tolerant\",\r\n affection: 5,\r\n }\r\n /** this section attempts to check in the local storage if the entered\r\n username already exists. It does this by indexing through the kittens array\r\n and compares the kitten.name property to the form input.\r\n */\r\n\r\n for (let i = 0; i < catArray.length; i++) {\r\n if (catArray[i].name == form.name.value) {\r\n alert(\"you can't have kittens with the same name...they'll get confused\")\r\n reset.form()\r\n }\r\n }\r\n\r\n if (form.name.value == \"\") {alert(\"you must enter a name for your kitten\")}\r\n //this section checks to make sure that the value in the form being submitted isn't blank\r\n\r\n\r\n else\r\n catArray.push(newCat)\r\n saveCats()\r\n form.reset()\r\n drawCats()\r\n}", "async function creatCat() {\n console.log('creatCat')\n let name = $('#inputName').val();\n let sex = $('#inputGender :selected').val();\n let age = +$('#inputAges').val();\n let weight = +$('#inputWeigth').val();\n let someInfo = $('#inputInfo').val();\n let imgNumb = $('#inputImgName').val();\n let img = \"cat\" + imgNumb + \".jpg\";\n\n if (name && sex && age && weight && img) {\n let newCat = {\n name,\n sex,\n age,\n weight,\n img,\n someInfo\n }\n try {\n let result = await $.ajax({\n url: baseUrl + appKey + \"/\" + endPoint,\n method: \"POST\",\n headers,\n data: JSON.stringify(newCat)\n })\n listCats();\n } catch (error) {\n console.log(error)\n //showError(error)\n }\n $('#inputName').val(\"\");\n $('#inputGender :selected').val(\"\");\n $('#inputAges').val(\"\");\n $('#inputWeigth').val(\"\");\n $('#inputInfo').val(\"\");\n $('#inputImgName').val(\"\");\n }\n }", "function createPage() {\n init();\n generateCard();\n makeCommentsWork();\n makeCommentIconsWork();\n makeReactionsWork();\n displayCharLimit();\n}", "function SetUpItems (data, response)\n{\n\t// clear html of needed divs\n\t$('#selectCarNumber').html(\"\");\n\t$('#selectCarBtn').html(\"\");\n\t$('#addCarBtnDIV').html(\"\");\n\n\t// make user select car\n\tlet selCar = $('#selectCarNumber');\n\t$(selCar).html(\"\");\n\n\t// create select and assign properties\n\tlet select = document.createElement('select');\n\t$(select).prop({\"name\" : \"carSelect\", \"id\" : \"whichCarSel\"});\n\n\t// // append the car number to the select\n\t$(selCar).append(select);\n\n\t// get what cars the user owns\n\tFillUserCars();\n\n\t// set up button\n\tlet selBtnDiv = $('#selectCarBtnDIV');\n\tlet selCarBtn = document.createElement(\"input\");\n\t$(selCarBtn).prop({\"type\" : \"button\", \"id\" : \"selCarBtn\", \"value\" : \"Control Car #\" + $(select).val()});\n\t$(selBtnDiv).append(selCarBtn);\n\n\t\t\n\t// add option to add another car\n\tlet addCarBtnDiv = $('#addCarBtnDIV');\n\tlet addCarBtn = document.createElement(\"input\");\n\t$(addCarBtn).prop({\"type\" : \"button\", \"id\" : \"addCarBtn\", \"value\" : \"Add Car #X\"});\n\t$(addCarBtnDiv).append(addCarBtn);\n\n\t// option to delete a car\n\tlet delCarBtnDiv = $('#addCarBtnDIV');\t\t\t\n\tlet delCarBtn = document.createElement(\"input\");\n\t$(delCarBtn).prop({\"type\" : \"button\", \"id\" : \"delCarBtn\", \"value\" : \"Delete Car #\" + $(select).val()});\n\t$(delCarBtnDiv).append(delCarBtn);\n\n\t// add select changed event handler to update button\n\t$(select).change( () => {\n\t\t$(selCarBtn).prop(\"value\", \"Control Car #\" + $(select).val());\n\t\t$(delCarBtn).prop(\"value\", \"Delete Car #\" + $(select).val());\n\t\t$carID = $(select).val()\n\t});\n\n\t// add car Btn event handler, adds next availiable car to DB\n\t$(addCarBtn).click ( () => {\n\t\tlet sendData = {};\n\t\tsendData['action'] = \"addNewCar\";\n\t\tsendData['carID'] = carToAddID;\n\n\t\tAjaxRequest('./webservice.php', 'POST', sendData, 'json', RefreshCarCount, Fail)\n\n\t\t// see which spot we can add in\n\t\tGetOpenCarSlot();\n\t});\n\n\t// delete car Btn event handler, deletes car in select\n\t$(delCarBtn).click ( () => {\n\t\tlet sendData = {};\n\t\tsendData['action'] = \"deleteCar\";\n\t\tsendData['carID'] = $carID;\n\n\t\tAjaxRequest('./webservice.php', 'POST', sendData, 'json', RefreshCarCount, Fail)\n\n\t\t// see which spot we can add in\n\t\tGetOpenCarSlot();\n\t});\n\n\t// select car btn click event handler, opens car control page\n\t$(selCarBtn).click ( () => {\n\n\t\tlet data = {};\n\t\tdata['action'] = \"addNewCar\";\n\t\tdata['carID'] = data['data'];\n\n\t\tAjaxRequest('./webservice.php', 'POST', data, 'json', DisplayControls, Fail)\n\n\t\t// start timers\n\t\tlet interval = 200;\n\t\tajaxIntervalID = setInterval(AjaxData, interval);\n\t\tpullDataIntervalID = setInterval(ReceiveData, interval * 3);\n\t\tloop();\t\n\t});\n\n\t\n\t//Update which slot is open for add\n\tGetOpenCarSlot();\n}", "function CreateCat() {\n //Validate the pet name which must be present\n var sPetName=document.getElementById(\"inputPetName\").value;\n if (sPetName=='')\n {\n alert (\"Error, name missing\"); return;\n }\n\n //Determine if this cat has a scratching problem\n var scratches=document.getElementById(\"scratches\").checked;\n\n //Instantiate the Cat, which inherits from pet\n var Cat1= new Cat(sPetName, \"Cat\", scratches); //We are saying that \"Tiger\" is not the scratching kind of cat by passing false.\n\n console.log(Cat1.getInfo() + \" Can Scratch: \" + Cat1.getCanScratch());\n var warning=\"\";\n if (Cat1.getCanScratch()) warning=\"Warning - This cat can scratch!\";\n\n // Create a new list item to hold the pet\n var node = document.createElement(\"LI\");\n\n //Add an image to the pet\n var petImage = document.createElement(\"img\");\n petImage.setAttribute(\"src\", \"../img/cat.jpg\");\n petImage.setAttribute(\"height\", \"100\");\n petImage.setAttribute(\"width\", \"100\");\n node.appendChild(petImage);\n\n // Append the text to <li>\n var textnode = document.createTextNode(Cat1.getInfo() + \" \" + warning); // Create a text node\n node.appendChild(textnode);\n\n //Create a button to remove the pet\n var nodeButton = document.createElement(\"button\");\n nodeButton.innerHTML=\"remove\";\n nodeButton.className = \"button\";\n node.appendChild(nodeButton);\n\n //This will make our remove button work when it is clicked\n nodeButton.addEventListener('click', function(e) {\n e.currentTarget.parentNode.remove();\n }, false);\n\n // Append the text to the pet list\n document.getElementById(\"petObjects\").appendChild(node); // Append <li> to <ul> with id=\"myList\"\n\n //document.getElementById(\"output\").innerHTML=\"Added a new cat named \" + Cat1.getInfo() + \" \" + warning;\n}", "async function randomCocktail() {\n setSubmitButtonMessage(false);\n const response = await fetch(\n \"https://www.thecocktaildb.com/api/json/v1/1/random.php\"\n );\n const data = await response.json();\n const {\n idDrink,\n strDrink,\n strIngredient1,\n strIngredient2,\n strIngredient3,\n strIngredient4,\n strMeasure1,\n strMeasure2,\n strMeasure3,\n strMeasure4,\n strInstructions,\n strDrinkThumb,\n } = data.drinks[0];\n\n setCocktail({\n idDrink,\n strDrink,\n strIngredient1,\n strIngredient2,\n strIngredient3,\n strIngredient4,\n strMeasure1,\n strMeasure2,\n strMeasure3,\n strMeasure4,\n strInstructions,\n strDrinkThumb,\n });\n setLoading(false);\n }", "function crear_CLick() {\n // Valdacion dell cliente\n var isAllValid = true;\n if ($(\"#Nombre\").val().trim() == '') {\n $(\"#Nombre\").siblings('span.error').css('visibility', 'visible');\n isAllValid = false;\n } else {\n $(\"#Nombre\").siblings('span.error').css('visibility', 'hidden');\n }\n\n if ($(\"#TipoClienteId\").val().trim() == '') {\n $(\"#TipoClienteId\").siblings('span.error').css('visibility', 'visible');\n isAllValid = false;\n } else {\n $(\"#TipoClienteId\").siblings('span.error').css('visibility', 'hidden');\n }\n\n var data = {\n ClienteId: 0,\n Nombre: $(\"#Nombre\").val().trim(),\n RFC: $(\"#RFC\").val().trim(),\n TipoClienteId: $(\"#TipoClienteId\").val().trim(),\n TipoPersonaSat: $(\"#TipoPersonaSat\").val().trim(),\n Telefonos: telefonoItems.lista,\n Correos: emailItems.lista,\n Direcciones: direccionesItems.lista\n };\n\n var token = $('[name=__RequestVerificationToken]').val();\n\n $.ajax({\n url: '/Clientes/Create',\n type: 'POST',\n data: { __RequestVerificationToken: token, cliente: data },\n success: ((d) => {\n if (d == true) {\n window.location.href = '/Clientes/Index';\n } else {\n alert('Error al guardar los datos del cliente');\n }\n }),\n error: ((e) => {\n console.log(e);\n alert(\"Error, intente nuevamente\");\n })\n });\n}", "function distcrops(){\r\n document.getElementById(\"bt\").style.display=\"block\";\r\n document.getElementById(\"vt\").style.display=\"none\";\r\n document.getElementById(\"dc\").style.display=\"none\";\r\n document.getElementById(\"tf\").style.display=\"none\";\r\n document.getElementById(\"ff\").innerHTML = \"\";\r\n document.getElementById(\"detail\").innerHTML = \"\";\r\n document.getElementById(\"lists\").style.display=\"block\";\r\n var pp=\"\";\r\n var namelist = \"<table class='table table-hover'><thread><tr> <th>cropid</th><th>cropname</th><th>cropcost</th></tr></thead>\";\r\n pp += namelist;\r\n //document.getElementById(\"ff\").innerHTML += namelist;\r\n for(var i=0;i<cropslist.length;i++)\r\n {\r\n //var namelist = \"<li>\" +cropslist[i]+ \"</li>\";\r\n //document.getElementById(\"ff\").innerHTML += namelist;\r\n var namelist = \"<tbody><tr> <td>\"+ \r\n cropslist[i][0] +\"</td><td>\"+ \r\n cropslist[i][1] +\"</td><td>\"+\r\n cropslist[i][2] +\"</td><td>\"+ \r\n cropslist[i][3] +\"</td><td>\"+ \r\n cropslist[i][4] +\"</td></tr>\";\r\n pp+=namelist;\r\n //document.getElementById(\"ff\").innerHTML += namelist;\r\n }\r\n var namelist = \"<tr><th><button class='btn btn-success btn-lg' onclick='cropinsertform()'>ADD NEW</button></th></tr></tbody>\";\r\n pp+=namelist;\r\n var namelist = \"</table>\";\r\n pp+=namelist;\r\n document.getElementById(\"ff\").innerHTML = pp;\r\n //var temp = `<button onclick=\"cropinsertform()\">ADD NEW</button>`;\r\n //document.getElementById(\"ff\").innerHTML += temp;\r\n var ff = document.getElementById(\"ff\");\r\n ff.style.display = \"block\";\r\n}", "createForm () {\n if (document.getElementById('leaderboardButton')) {\n document.getElementById('leaderboardButton').remove();\n }\n crDom.createLeaderboardButton();\n crDom.createForm();\n crDom.createCategoriesChoice(this.filter.category);\n crDom.createDifficultyChoice(this.filter.difficulty);\n crDom.createRangeSlider(this.filter.limit);\n crDom.createStartButton();\n }", "static addCat(event){\n event.preventDefault()\n fetch('http://localhost:3000/cats', {\n \tmethod:\"POST\",\n \theaders: {\"Content-Type\": \"application/json\"},\n \tbody: JSON.stringify({\n name: document.querySelector('form').children[1].value,\n breed: document.querySelector('form').children[3].value,\n floof: document.querySelector('form').children[4].value,\n image: document.querySelector('form').children[2].value\n })\n })\n .then(res => res.json())\n .then(cat => {\n debugger\n let catInstance = new Cat(cat)\n document.querySelector(\"#cats\").appendChild(catInstance.render())\n })\n }", "function makeCats () {\n\t\tvar formTag = document.getElementsByTagName(\"form\"),\n\t\t\t selectDiv = $(\"select\"),\n\t\t\t makeSelect = document.createElement(\"select\");\n\t\t\t makeSelect.setAttribute(\"id\", \"dayTimes\");\n\t\tfor(var i=0, j=bestTimes.length; i<j; i++) {\n\t\t\tvar createOption = document.createElement(\"option\");\t\t\n\t\t\tvar optText = bestTimes[i];\t\n\t\t\tcreateOption.setAttribute(\"value\", optText);\n\t\t\tcreateOption.innerHTML = optText;\n\t\t\tmakeSelect.appendChild(createOption)\t\t\n\t\t}\n\t\tselectDiv.appendChild(makeSelect);\n\t}", "function formPreRequisits(){\n $.get({\n async: false,\n url: '\\getbus',\n dataType: 'JSON'\n }).done((response)=>{\n let checkBoxHtml = '';\n const checkBoxes = response.bus;\n $.each(checkBoxes, (checkBox, key)=>{\n checkBoxHtml += '<input type=\"checkbox\" class=\"chk-col-blue checkall\" name=\"buid[]\" id=\"' + key + '\" value=\"'+ key +'\" /><label for=\"' + key + '\">' + checkBox + '</label>';\n });\n $('.bus').html(checkBoxHtml);\n });\n \n $.get({\n async: false,\n url: '\\getusers',\n dataType: 'JSON'\n }).done((response)=>{\n var selectOpts = response.users;\n var optionsCount, pointer;\n optionsCount = pointer = response.users.length;\n if (users.children().length > 1) {\n users.children().first().siblings().remove();\n }\n while (pointer > 0) {\n var index = optionsCount - pointer;\n users.append('<option value=\"' + selectOpts[index] + '\">' + selectOpts[index] + '</option>');\n pointer--;\n }\n }).then(()=>{\n users.chosen('destroy');\n users.chosen({no_results_text: \"Oops, nothing found!\"});\n });\n}", "function listCatches() // Refreshes the list | Sorts them by id \n {\n fetch(CREATE_AND_LIST__URL)\n .then(res => res.json())\n .then(data => \n {\n elements.catchesForm.innerHTML = \"\";\n \n for (var catche in data) \n {\n var obj = data[catche];\n var catchDiv = document.createElement('div');\n catchDiv.classList.add('catch');\n var dataId = document.createAttribute('data-id');\n dataId.value = catche;\n catchDiv.setAttributeNode(dataId);\n \n catchDiv.innerHTML = `<label>Angler</label>`\n + `<input type=\"text\" class=\"angler\" value=\"${obj.angler}\" />`\n + `<hr>`\n + `<label>Weight</label>` \n + `<input type=\"number\" class=\"weight\" value=\"${obj.weight}\" />`\n + `<hr>`\n + `<label>Species</label>`\n + `<input type=\"text\" class=\"species\" value=\"${obj.species}\" />`\n + `<hr>`\n + `<label>Location</label>`\n + `<input type=\"text\" class=\"location\" value=\"${obj.location}\" />`\n + `<hr>`\n + `<label>Bait</label>`\n + `<input type=\"text\" class=\"bait\" value=\"${obj.bait}\" />`\n + `<hr>`\n + `<label>Capture Time</label>`\n + `<input type=\"number\" class=\"captureTime\" value=\"${obj.captureTime}\" />`\n + `<hr>`;\n //+ `<button class=\"update\">Update</button>`\n //+ `<button class=\"delete\">Delete</button>`;\n\n //Create update button\n let updateBtn = document.createElement(\"button\");\n updateBtn.classList.add(\"update\");\n updateBtn.textContent = \"Update\";\n updateBtn.addEventListener('click', updateCatch);\n catchDiv.appendChild(updateBtn);\n //Create delete button\n let deleteBtn = document.createElement(\"button\");\n deleteBtn.classList.add(\"delete\");\n deleteBtn.textContent = \"Delete\";\n deleteBtn.addEventListener('click', deleteCatch);\n catchDiv.appendChild(deleteBtn);\n\n elements.catchesForm.appendChild(catchDiv);\n }\n })\n .catch(e => console.log(e));\n }", "function createClues(){\n for (var i = 1; i <= numberOfClues; i++){\n $('<div></div>', {\n \"class\": 'create-input',\n id: 'clue-' + i\n }).insertBefore('#create-clues-form').after('<br/>');\n $('<label></label', {\n for: 'clue' + i,\n text: 'Clue ' + i + ' Text:'\n }).appendTo('#clue-' + i).after('<br/>');\n $('<textarea></textarea', {\n \"class\": 'clue-info',\n id: 'clueInfo' + i,\n name: 'clue' + i \n }).appendTo('#clue-' + i).after('<br/>', '<br/>');\n $('<label></label', {\n for: 'clue' + i + '-loc',\n text: 'Clue ' + i + ' Location:'\n }).appendTo('#clue-' + i).after('<br/>');\n $('<input/>', {\n type: 'text',\n \"class\": 'clue-loc',\n id: 'clue' + i + '-loc',\n name: 'clue' + i + '-loc',\n css: {\n 'margin-right': '5px'\n },\n prop: {\n 'readonly': 'true'\n }\n }).appendTo('#clue-' + i);\n $('<button/>', {\n type: 'button',\n \"class\": 'button alt-gradient-button',\n id: 'clue' + i,\n onclick: 'createClueMap(this.id)',\n text: 'map'\n }).appendTo('#clue-' + i);\n }\n $('#c2-2').css('display', 'block');\n}", "function buildPizza(size, toppings, price){\n this.size = size;\n this.toppings = toppings;\n this.price = price;\n}", "function makeCollectionCdePicker(nameControl) {\n $('#'+nameControl).autocomplete({\n source: function (request, response) {\n $.ajax({\n url: \"/collections/component/search.cfc\",\n data: { term: request.term, method: 'getCollectionCdeAutocomplete' },\n dataType: 'json',\n success : function (data) { response(data); },\n\t\t\t\terror : function (jqXHR, textStatus, error) {\n\t\t\t\t\thandleFail(jqXHR,textStatus,error,\"making a collection code search autocomplete\");\n\t\t\t\t}\n })\n },\n\t\tselect: function (event, result) {\n\t\t\tevent.preventDefault();\n\t\t\t$('#'+nameControl).val(\"=\" + result.item.value);\n\t\t},\n minLength: 1\n\t});\n}", "function createCard(){\n event.preventDefault();\n\n var newCard = new Card(titleInput.value, urlInput.value);\n addCardToList(newCard);\n increaseCardCounter();\n}", "function nuevaCita(e){\n e.preventDefault();\n\n //Extraer infomracion\n const {mascota,propietario,telefono,fecha,hora,sintomas} = citaObj;\n\n //validar\n if(mascota === '' || propietario === '' || telefono === '' || fecha === '' || hora === '' || sintomas === ''){\n ui.imprimirAltera('Llena todos los campos', 'error');\n return;\n }\n if(editando){\n ui.imprimirAltera(`Se actualizo correctamente.`)\n\n //Pasar el objeto de la cita a edicion\n administrarCitas.editarCita({...citaObj});\n\n //Quitar modo edicion\n formulario.querySelector('button[type=\"submit\"]').textContent = 'Crear Cita';\n editando = false;\n \n\n\n }else{\n //Generar id\n citaObj.id = Date.now();\n\n //Crear cita\n administrarCitas.agregarCita({...citaObj});\n ui.imprimirAltera(`Cita para ${citaObj.mascota} agregada.`)\n }\n\n\n //Restabelcer datos'\n reiniciarObj();\n formulario.reset();\n\n //Mostrar HTML citas\n ui.imprimirCitas(administrarCitas);\n\n}", "function createBattle(event) {\n\tvar opponentName = document.getElementById('oppName').value;\n\t$.ajax({\n\t\t\ttype : 'POST',\n\t\t\turl : '/api/create_battle',\n\t\t\tdata : opponentName,\n\t\t\tsuccess : showBattle,\n\t\t\terror : myBattlesReqFail,\n\t});\n}", "function createCatalysts() {\n if (dinoStegosaurus.foodEaten + dinoTriceratops.foodEaten === foodAmountCatalyst) {\n\n tornado = new CatalystTornado(100, 100, 20, 100, catalystTornadoImage);\n }\n if (dinoStegosaurus.foodEaten + dinoTriceratops.foodEaten === foodAmountCatalyst + 10) {\n fire = new CatalystFire(50, 100, 20, 100, catalystFireImage);\n }\n if (dinoStegosaurus.foodEaten + dinoTriceratops.foodEaten === foodAmountCatalyst + 20) {\n meteor = new CatalystMeteor(50, 100, 20, 100, catalystMeteorImage);\n }\n}", "function create() {\n if (document.getElementById('compose').value == '') {\n showModal('Error', 'Please compose your entry above before submitting.')\n return\n }\n \n let entryContent = document.getElementById('compose').value\n\n if (tagLocation) {\n entryContent += ` @_location ${lat} ${lon}`\n }\n\n entryContent += ` @_time ${getCurrentTimeString()}`\n\n postFromButton('submitEntryButton', 'Submitting...', '/jrnlAPI/create',\n {\n entry: entryContent\n },\n (data)=>{\n if (data.success == true) {\n document.getElementById('compose').value = ''\n let tagGPS = document.getElementById('tagGPS')\n tagGPS.checked = false\n tagCurrentLocation(tagGPS)\n showModal('Entry added', `<strong>Your entry has been added successfully.</strong><br /><small>stdout: \"${data.stdo}\" stderr: \"${data.stde}\"</small>`)\n }\n })\n}", "function createExercise(){\n var name = $('#name').val();\n var time = $('#time').val();\n var cals = $('#cals').val();\n var date = $('#date').val();\n\n var url = window.location.origin.replace(/[0-9]{4}/g, 4000);\n url += '/exercises';\n var options = {};\n if (name.length !==0 && time.length !== 0 && cals.length !== 0 && date.length !== 0){\n options.url = url;\n options.type = 'POST';\n options.data = {name:name, time:time, calories: cals, date:date};\n options.success = exerciseCreated;\n\n $.ajax(options);\n } else {\n alert('All fields are required :-))!');\n }\n }", "function create() {\n jQuery.support.cors = true;\n var coupon = {\n CouponID: 0,\n Title: $('#txtAdd_Title').val(),\n Description: $('#txtAdd_Description').val(),\n DiscountPercentage: $('#txtAdd_DiscountPercentage').val(),\n RetailID: $('#txtAdd_RetailID').val(),\n StartDate: $('#txtAdd_StartDate').val(),\n EndingDate: $('#txtAdd_EndingDate').val()\n };\n var cr = JSON.stringify(coupon);\n $.ajax({\n url: serviceUrl,\n type: 'POST',\n data: JSON.stringify(coupon),\n contentType: \"application/json;charset=utf-8\",\n success: function (data) {\n $('#couponCreate')\n .text('Coupon successfully created.');\n updateList();\n },\n error: function (_httpRequest, _status, _httpError) {\n // XMLHttpRequest, textStatus, errorThrow\n $('#couponCreate')\n .text('Error while adding Coupon. XMLHttpRequest:'\n + _httpRequest + ' Status: ' + _status\n + ' Http Error: ' + _httpError);\n }\n });\n}", "createTest() {\n //it takes the collection\n let collection = this.collection;\n //it takes the values\n let inputClientNumber = $('#input-client-number').val();\n let inputBike = $('#input-bike').val();\n let csrfToken = $('#csrf-token').val();\n $.ajax({\n type: \"POST\",\n url: baseURL + \"Test\",\n data: {\n _token: csrfToken,\n badgeNo: inputClientNumber,\n distinctiveSign: inputBike\n },\n success: () => {\n collection.fetch(); //Refresh when server answers\n },\n complete: () => {\n $(\"#popupField\").hide();\n }\n });\n }", "function create_item() {\n document.getElementById('modify-header').textContent = 'Creating new Item';\n create_form('meat_shop_item','content-div');\n}", "function createtest()\r\n{\r\n //call the GetXmlHttpObject() to see what browser you are using\r\n xmlhttp = GetXmlHttpObject();\r\n if (xmlhttp == null)\r\n {\r\n alert(\"Browser does not support HTTP Request\");\r\n return;\r\n }\r\n //sets the variables that make up the URL\r\n var spacer = \"vv\";\r\n\tvar url = \"../includes/pro-create.php\";\r\n url = url + \"?spacer\" + spacer;\r\n\t\turl = url + \"&sid=\" + Math.random();\r\n\r\n //opens and sends the HTTP request\r\n xmlhttp.open(\"GET\", url, true);\r\n xmlhttp.send(null);\r\n //calls the showKitsetData function when the readystate changes\r\n xmlhttp.onreadystatechange = showCubaData2;\r\n}", "function makeCollectionPicker(nameControl,idControl) {\n $('#'+nameControl).autocomplete({\n source: function (request, response) {\n $.ajax({\n url: \"/collections/component/search.cfc\",\n data: { term: request.term, method: 'getCollectionAutocomplete' },\n dataType: 'json',\n success : function (data) { response(data); },\n\t\t\t\terror : function (jqXHR, textStatus, error) {\n\t\t\t\t\thandleFail(jqXHR,textStatus,error,\"making a collection search autocomplete\");\n\t\t\t\t}\n })\n },\n select: function (event, result) {\n\t\t\tif (idControl) { \n\t\t\t\t// if idControl is non null, non-empty, non-false\n\t\t\t\t$('#'+idControl).val(result.item.id);\n\t\t\t}\n },\n minLength: 1\n\t}).autocomplete(\"instance\")._renderItem = function(ul,item) { \n\t\t// this overrides the renderItem to display meta \"collection name (count)\" instead of just the value in the picklist.\n\t\treturn $(\"<li>\").append(\"<span>\" + item.value + \" (\" + item.meta + \")</span>\").appendTo(ul);\n\t};\n}", "function staffadd()\r\n{\r\n //call the GetXmlHttpObject() to see what browser you are using\r\n xmlhttp = GetXmlHttpObject();\r\n if (xmlhttp == null) {\r\n alert(\"Browser does not support HTTP Request\");\r\n return;\r\n }\r\n\t//sets the variables that make up the URL\r\n var name = document.getElementById('s-name').value;\r\n\tvar title = document.getElementById('s-title').value;\r\n\tvar bio = document.getElementById('s-bio').value;\r\n var action = \"xx\";\r\n var url = \"../includes/staff-create.php\";\r\n url = url + \"?action=\" + action;\r\n url = url + \"&name=\" + name;\r\n\t\turl = url + \"&title=\" + title;\r\n\t\turl = url + \"&bio=\" + bio;\r\n\t//opens and sends the HTTP request\r\n xmlhttp.open(\"GET\", url, true);\r\n xmlhttp.send(null);\r\n\t//calls the showKitsetData function when the readystate changes\r\n xmlhttp.onreadystatechange = showCubaData4;\r\n \r\n}", "function makeCats() {\n var formTag = document.getElementsByTagName(\"form\"), //formTag is an array\n selectLi = $(\"select\"),\n makeSelect = document.createElement(\"select\");\n makeSelect.setAttribute(\"id\", \"workouts\");\n for (var i = 0, j = workoutType.length; i<j; i++) {\n var makeOption = document.createElement(\"option\");\n var optText = workoutType [i];\n makeOption.setAttribute(\"value\", optText);\n makeOption.innerHTML = optText;\n makeSelect.appendChild(makeOption);\n }\n selectLi.appendChild(makeSelect);\n }", "create() {\n try {\n this._toggleEditThrobber();\n var latin_name = document.getElementById('latin_name').value;\n var outputEl = this._clearOutput();\n var jsonObj = this.dao.retrieve(latin_name);\n if (!jsonObj || !jsonObj.species) throw `Error reading taxonomic data. Is the latin name spelled correctly?`; \n this._showOutput(latin_name, jsonObj);\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleEditThrobber();\n }", "function createCountry () {\n let countryName = $('#newCountryText');\n let capitalName = $('#newCapitalText');\n addCountry(countryName.val(), capitalName.val());\n countryName.val('');\n capitalName.val('');\n fixLinks();\n }", "function create_category(){\n $('section').on('click', '#create_category_btn', function(event){\n event.preventDefault();\n var cate_name = $(\"#create_category_name\").val(); \n if(cate_name != \"\"){\n \n $.ajax({\n type: 'post',\n url: 'http://localhost/pencil/categories/create',\n dataType: 'text',\n data: {\n cate_name: cate_name\n },\n success : function(data){\n list_category();\n console.log(data);\n if(data == \"false\"){\n toastr.error(\"Category Already Exists!\"); \n }else{\n $(\"#create_category_name\").val(\"\");\n $('.category_create_btn').click();\n toastr.success(\"Category Created!\");\n }\n }\n });\n }else{\n toastr.warning(\"Field empty!\");\n }\n });\n }", "function openScreen() {\n businessInfo = {\n businessName: [],\n businessId: [],\n businessImages: [],\n businessAddress: [],\n businessRating: [],\n businessReviewCount: [],\n };\n\n\n var cuisineType = $(\"<div class='cuisine-type'>\");\n cuisineType.html(\"<h1 id='cuisine-header' class='cuisine-type'> What type of cuisine \" + userName2 + \"? </h1>\");\n $(\"#main-section\").append(cuisineType);\n var foodTypes = [\"Italian\", \"Chinese\", \"Mediterranean\", \"Mexican\", \"Indian\", \"Sushi\"];\n var counter = 1;\n for(var i = 0; i < foodTypes.length; i++) {\n var foodList = $(\"<label>\");\n foodList.attr(\"class\", \"food-list radio\");\n foodList.attr(\"id\", \"food-list\" + counter);\n foodList.html(\"<input value=\" + foodTypes[i] + \" \" + \"type='radio' name='optradio' class='food-value'>\" + foodTypes[i]);\n $(\"#cuisine-header\").append(foodList);\n counter++;\n }\n\n var getStarted = $(\"<p>\");\n getStarted.attr(\"id\", \"get-started\");\n getStarted.html(\"<a id='get-started-text'>Submit</a>\");\n $(\"#cuisine-header\").append(getStarted);\n}", "function creaBoxRecensioneDaFare(id,recensione,ifOspitato){\r\n recensioniDaFare[id] = recensione;\r\n\r\n var altroUtente;\r\n if(ifOspitato === \"Ospitato\") altroUtente = recensione.ospitante;\r\n else altroUtente = recensione.ospitato;\r\n\r\n\r\n var nuovaRecensione = $(\".div-recensione:first\").clone();\r\n nuovaRecensione.children(\".recensione-da-fare-partita\").text(stringPartita(recensione.homeTeam,recensione.awayTeam));\r\n nuovaRecensione.children(\".recensione-da-fare-id\").val(recensione._id + \"-recensione-da-fare\");\r\n if(ifOspitato === \"Ospitante\"){\r\n nuovaRecensione.children(\".recensione-da-fare-tipologia\").text(\"Hai ospitato:\");\r\n }\r\n else{\r\n nuovaRecensione.children(\".recensione-da-fare-tipologia\").text(\"Sei stato ospitato da:\");\r\n }\r\n nuovaRecensione.children(\".recensione-da-fare-altro\").text(altroUtente);\r\n nuovaRecensione.children(\".recensione-da-fare-tipologia\").children(\"a\").addClass(\"if\" + ifOspitato + \"img\");\r\n $(nuovaRecensione).appendTo(\"#recensioni-da-fare\");\r\n}", "function generateSectionCheckboxes() {\n var dataDef = {\"requestType\": \"getSections\", \"session\": getCookie(\"token\"), \"username\": getCookie(\"username\")};\n var urlDef = \"/cgi-bin/request.py\";\n var dataTypeDef = \"json\";\n //$.post(urlToSubmitTo, dataToSubmit, successFunctionToRunOnReturn, expectedReturnType)\n $.post(urlDef, dataDef, setSections, dataTypeDef);\n}", "populate() {\n this.div.innerHTML = ''\n\n this.createHeader()\n this.createAddButton()\n this.createAddForm()\n this.createExpensesDiv()\n }", "function addPurchase(){\n var purchaseName = document.getElementById(\"purchase-name-input\").value; // Get the purchase name from input\n var purchaseAmount = document.getElementById(\"purchase-amount-input\").value; // Get the purchase amount from input\n var purchaseDate = document.getElementById(\"purchase-date\").value; // Get purchase date from input\n var purchaseDateSplit = purchaseDate.split(\"-\"); // Split the date at \"-\" (format is year-month-day)\n var year = purchaseDateSplit[0]; // Get the year\n var month = purchaseDateSplit[1]; // Get the month\n var day = purchaseDateSplit[2]; // Get the day\n\n var cat_dropdown = document.getElementById(\"cat-dropdown\"); // Get the category list dropdown\n\n // If the user inputs are okay, make AJAX request\n if(verifyInputs(purchaseName,purchaseAmount,\"purchase\")){\n var purchaseAmountNum;\n // If the user put a $ before the number, remove it\n if(purchaseAmount.startsWith(\"$\")){\n purchaseAmountNum = purchaseAmount.slice(1);\n }else{\n purchaseAmountNum = purchaseAmount;\n }\n var category = cat_dropdown.options[cat_dropdown.selectedIndex].text; // Get the selected category\n\n // Create the data for the request\n var data;\n \tdata = '{\"name\":\"' + purchaseName + '\",\"amount\":' + purchaseAmountNum + ',\"category\":\"' + category + '\",\"date\":\"' + purchaseDate +'\"}';\n\n // Make AJAX request to post new purchase to purchase list\n makeReq(\"POST\", \"/budget/purchases\", 201, getCats, data);\n\n // Clear input boxes\n \tdocument.getElementById(\"purchase-name-input\").value = \"\";\n document.getElementById(\"purchase-amount-input\").value = \"\";\n }\n}", "checksCreate(data, cb) {\n handleRequest('html', data, 'get', cb);\n }", "function addParkingStandsPopup(that){\n // Input form for Objects\n var tmp = '<form id=\"saveMarker\" class=\"tabledisplay\">' +\n '<p><label> <strong>Name: </strong></label>' +\n '<input type=\"text\" id=\"name\" name=\"name\" required=\"true\"/>' +\n '</p><br><p><label><strong>Type: </strong></label>' +\n '<select type=\"text\" id=\"type\" name=\"type\" required=\"true\">' +\n '<option value=\"Parking\">Parking</option><option value=\"Stands\">Stands</option></select>' +\n '</p><br><p><label><strong>Capacity: </strong></label>' +\n '<input type=\"number\" min=\"0\" id=\"cap\" name=\"capacity\" required=\"true\">' +\n '</p><br><p><label><strong>Price: </strong></label>' +\n '<input type=\"number\" min=\"0\" id=\"price\" name=\"price\" required\"true\">' +\n '</p><br><p><label><strong>Description: </strong></label>' +\n '<textarea class=\"form-control\" rows=\"1\" id=\"info\" name=\"description\"></textarea>' +\n '<input class=\"hidden\" value=\"-9999\" type=\"text\" id=\"picture\" name=\"picture\"/>' +\n '<div style=\"text-align:center;\"><button type=\"submit\" value=\"Save\" class=\"btn btn-primary trigger-submit\">Save</button></div>' + '</div>' +\n '</form>';\n createObjectCreationPopup(tmp);\n}", "function addTopping() {\n //console.log('Add a new topping');\n let data = {};\n\n //Retrieve new topping details and create a JSON object\n $(\"div[id^='student-new-']\").each(function () {\n let field = $(this).attr(\"id\").substr(12); //The last part of an ID is the field name. There are 12 characters before the field name.\n let value = $(this).html(); //content of div\n data[field] = value;\n });\n\n //send the request via fetch\n const url = baseUrl_API + \"/api/v1/toppings\";\n\n fetch(url, {\n method: \"POST\",\n headers: {\n Authorization: \"Bearer \" + jwt,\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data),\n })\n .then(checkFetch)\n .then(() => showToppings()) //reload the topping list\n .catch((err) => showMessage(\"Errors\", err));\n}", "function selectCuisine(){\n //console.log($('select[name=\"cuisine\"]').val());\n if ($('select[name=\"cuisine\"]').val() === \"select\"){\n populateTable();\n } else {\n var tableContent = '';\n // jquery AJAX call for JSON\n $.getJSON('/recipes/recipelist', function (data){\n // adds all recipe info from database to the global variable\n recipeListData = data;\n\n // for each item in our JSON, add a table row and cells to the content string\n $.each(data, function(){\n if (this.cuisine === $('select[name=\"cuisine\"]').val()){\n tableContent += '<tr>';\n if (selectedRecipes.indexOf(this.name) === -1) {\n tableContent += '<td><input type=\"checkbox\" id=\"' + this.name.replace(/\\s+/g, '_') + 'Checkbox\" class=\"recipeCheckbox\"></td>';\n } else {\n tableContent += '<td><input type=\"checkbox\" id=\"' + this.name.replace(/\\s+/g, '_') + 'Checkbox\" class=\"recipeCheckbox\" checked></td>';\n }\n tableContent += '<td><a href=\"#\" class=\"linkshowuser\" rel=\"' + this.name + '\">' + this.name + '</a></td>';\n tableContent += '<td>' + this.cuisine + '</td>';\n tableContent += '</tr>';\n }\n });\n\n // inject the whole content string into our existing HTML table\n $('#recipeList table tbody').html(tableContent);\n });\n }\n}" ]
[ "0.7346524", "0.685683", "0.6635601", "0.632516", "0.62356895", "0.62309295", "0.58870226", "0.58545685", "0.5793856", "0.57675123", "0.5728257", "0.5715081", "0.56606233", "0.5653223", "0.5548992", "0.54937255", "0.5357425", "0.53390926", "0.5289341", "0.52825797", "0.52370125", "0.52177626", "0.52085686", "0.519254", "0.5174701", "0.5171806", "0.5158023", "0.5152129", "0.5142441", "0.5129613", "0.51202285", "0.508842", "0.50661594", "0.504644", "0.49815476", "0.4966921", "0.49431998", "0.49340042", "0.49328452", "0.49112415", "0.48997542", "0.48915672", "0.48852956", "0.487071", "0.48667854", "0.4860303", "0.48602992", "0.48593822", "0.48523346", "0.4851519", "0.48474413", "0.4841869", "0.48386464", "0.48359147", "0.48321992", "0.48274007", "0.4825724", "0.48115745", "0.47988784", "0.4797542", "0.4778312", "0.4777661", "0.4767708", "0.47660106", "0.47629046", "0.47579223", "0.47517148", "0.47483677", "0.47420695", "0.47338495", "0.4733714", "0.47278574", "0.47248343", "0.47134414", "0.470983", "0.4705981", "0.47036248", "0.46984187", "0.46939436", "0.46880883", "0.46764028", "0.46738106", "0.46725243", "0.4672071", "0.46685663", "0.46685308", "0.46521825", "0.46517298", "0.46393344", "0.46379408", "0.46373", "0.4636514", "0.4634973", "0.4632618", "0.463225", "0.46257916", "0.46210387", "0.4620927", "0.46190354", "0.46069148" ]
0.7673387
0
This function does what its name implies, deletes a given cupcake It calls the deleteCupcake method of class CupcakeList and stores the updated CupcakeList object into the global cupcakes variable so we have an updated frontend object list to work with without making another get request.
async function deleteCupcake() { let $id = $(this).data('id'); let response = await CupcakeList.deleteCupcake($id,cupcakes); cupcakes = response; console.log(cupcakes) $(this).parent().parent().parent().remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function loadCupcakes() {\r\n let response = await CupcakeList.getCupcakes();\r\n cupcakes = response;\r\n console.log(cupcakes)\r\n $cupcakeList.empty();\r\n\r\n for (let cc of cupcakes.cupcakes) {\r\n console.log(cc)\r\n const html = createHTML(cc);\r\n $cupcakeList.append(html);\r\n let delBtn = document.getElementById(`del-btn-${cc.id}`);\r\n delBtn.addEventListener(\"click\",deleteCupcake);\r\n let editBtn = document.getElementById(`edit-btn-${cc.id}`);\r\n editBtn.addEventListener(\"click\",showEditForm);\r\n }\r\n }", "function generateCupcakeHTML(cupcake) {\r\n return `\r\n <div data-cupcake-id=${cupcake.id}>\r\n <li>\r\n ${cupcake.flavor} / ${cupcake.size} / ${cupcake.rating}\r\n <button class=\"delete-button\">X</button>\r\n </li>\r\n <img class=\"Cupcake-img\"\r\n src=\"${cupcake.image}\"\r\n alt=\"(no image provided)\">\r\n </div>\r\n `;\r\n}", "async function createCupcake() {\r\n let flavor = $flavor.val();\r\n let size = $size.val();\r\n let rating = $rating.val();\r\n let image = $ccImage.val();\r\n\r\n let newCupcake = {flavor,size,rating,image}\r\n await CupcakeList.createCupcake(newCupcake)\r\n await loadCupcakes();\r\n }", "async function showCupcakes() {\n let response = await axios.get(BASE_URL);\n let cupcakes = response.data.cupcakes;\n\n $cupcakeList.empty();\n addCupcakesToDOM(cupcakes);\n}", "async function makeCupcake() {\n\t// Get values\n\tconst flavor = $('#flavor').val();\n\tconst size = $('#size').val();\n\tconst rating = $('#rating').val();\n\tconst image = $('#image').val() ? $('#image').val() : null;\n\t// API POST Request\n\tif (image !== null) {\n\t\tconst response = await axios.post(BASE_URL, { flavor, size, rating, image });\n\t} else {\n\t\tconst response = await axios.post(BASE_URL, { flavor, size, rating });\n\t}\n\t// Append new cupcake to DOM\n\tcupcake = response.data.cupcake;\n\t$cupcakeList.prepend(makeLI(cupcake));\n}", "function removeClimb() {\n fetch(`${url}`, {\n method: 'DELETE'\n }).then(res => res.json()).then((results) => alert(`Deleted Climb: ${results.confirmation._id}`))\n\n history.goBack()\n }", "function delete_checklist(args, done) {\n var checklist = args.checklist;\n\n var cardent = seneca.make$('card/card');\n var projectent = seneca.make$('sys/project');\n\n cardent.load$(checklist, function(err, checklist) {\n projectent.load$(checklist.parent, function(err, project) {\n // Remove checklist from project.checklists\n project.checklists = project.checklists.filter(function(checklistId) {\n return checklistId !== checklist.id;\n });\n\n project.save$();\n\n cardent.remove$({id:checklist.id}, function(err, out) {\n if (err) return done(err);\n done(null, {deleted:true});\n });\n });\n });\n }", "function generateAndAppendCupcakeHtml(cupcake) {\n let html = `\n <li>\n Flavor:${cupcake.flavor}, \n Rating: ${cupcake.rating}, \n Size: ${cupcake.size}\n </li>\n <img src=${cupcake.image}><img>\n `;\n $updateCupcakeList.append(html);\n}", "async deleteSandwich(sandwich) {\n // Can't delete the last sandwich in the cart\n if (this.items.length === 1) {\n return\n }\n\n // Remove the sandwich from the server\n await fetch(`http://localhost:3001/cart/${sandwich.id}`, {\n method: 'DELETE',\n })\n\n // Remove the sandwich locally\n this.items = this.items.filter(x => x !== sandwich)\n if (this.selectedSandwich.id === sandwich.id) {\n this.selectSandwich(this.items[0])\n } else {\n this.render()\n }\n }", "function makeCake(){\n\t// Ik maak een variable cake met een array erin.\n\tvar cake = ['slagroom', 'frambozen', 'chocolade',];\n\n\treturn {\n\t\t//Hier maak ik gebruk van een object literal\n\t\tgetCake: function() {\n\t\t\t/* \tHier log ik een zinnetje met daarin cake.pop(). \n\t\t\t*\tcake alleen geeft mij de volledige array terug. \n\t\t\t*\tcake.pop() verwijderd het laatste element in de array en stuurt die terug. \n\t\t\t*\tReference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop\n\t\t\t*/\n\t\t\tconsole.log('Ik heb nu een ' + cake.pop() + 'taart');\n\t\t}\n\t};\n}", "function renderCafe(doc) {\n let li = document.createElement('li')\n let name = document.createElement('span')\n let city = document.createElement('span')\n // creating element for deleting\n let cross = document.createElement('div')\n\n li.setAttribute('data-id', doc.id) // to get the document's ID from firestore\n // setting the text contents for the elts we created\n name.textContent = doc.data().name\n city.textContent = doc.data().city\n cross.textContent = 'x'\n\n // next, gotta append the name & city to the li\n li.appendChild(name)\n li.appendChild(city)\n li.appendChild(cross)\n\n // lastly, gotta append the li we created to the ul element of cafeList\n cafeList.appendChild(li)\n\n // deleting data\n cross.addEventListener('click', (e) => {\n let id = e.target.parentElement.getAttribute(\"data-id\") // note that this 'data-id' is actually the doc.id... ref line 22\n db.collection('cafes').doc(id).delete()\n })\n}", "static deleteFoods(foods) {\n foods.forEach(food => {\n fetch(`${this.url}/foods/${food.id}`, {\n method: 'DELETE'\n })\n .then(response => response.json())\n .then(data => {\n Food.delete(data.id);\n AppContainer.renderFoods();\n })\n .catch(err => alert(err))\n })\n \n }", "function deleteCm(evt) {\n var target = evt.target;\n console.log(target.getAttribute('delete'));\n coffeemakers = JSON.parse(localStorage.getItem('coffeemakers'));\n delete coffeemakers[target.getAttribute('delete')];\n localStorage.setItem('coffeemakers', JSON.stringify(coffeemakers));\n get_list();\n}", "function delFromList () {\n /* get rid of the button and bullet from our arrays before deleting it */\n listItems.splice(delBtns.indexOf(this), 1)\n delBtns.splice(delBtns.indexOf(this), 1)\n\n /* also get rid of the drop zone below the element being deleted */\n dropZones.splice(delBtns.indexOf(this), 1)\n\n redrawList()\n}", "function renderCafe(doc) {\n let li = document.createElement('li');\n li.setAttribute('data-id', doc.id);\n\n let name = document.createElement('span');\n name.textContent = doc.data().name;\n li.appendChild(name);\n\n let city = document.createElement('span');\n city.textContent = doc.data().city;\n li.appendChild(city);\n\n let deleteButton = document.createElement('div');\n deleteButton.textContent = 'x';\n li.appendChild(deleteButton);\n deleteButton.addEventListener('click', (evt) => {\n evt.stopPropagation();\n let id = evt.target.parentElement.getAttribute('data-id');\n db.collection('cafes').doc(id).delete();\n })\n\n cafeList.append(li);\n}", "async function deleteFlower(idFlower, owner) {\n //write your query delete here\n await FlowerOwner.destroy({\n where: {\n flowerName: idFlower,\n ownerName: owner\n }\n })\n return response\n }", "update(cache, { data }) {\n console.log(data);\n const existingcocktails = cache.readQuery({ query: GET_COCKTAILS });\n const updatedCocktails = existingcocktails.cocktails.filter(\n (cocktail) => cocktail.id !== data.deleteCocktail.id\n );\n cache.writeQuery({\n query: GET_COCKTAILS,\n data: {\n cocktails: updatedCocktails,\n },\n });\n }", "function clearList() {\n for (i in cats) {\n var div = document.getElementById(i)\n while (div.hasChildNodes()) {\n var nodes = div.childNodes;\n div.removeChild(nodes[0]);\n }\n }\n drinkIdx = 0;\n breakfastIdx = 0;\n lunchIdx = 0;\n dinnerIdx = 0;\n sweetIdx = 0;\n clearTotal();\n}", "deleteFood(food){\n let foods = this.items.foods[food]\n foods.pop();\n if(foods.length < 1){\n delete this.items.foods[food]\n }\n }", "function list_destroy(prop)\n {\n if (!me.notebooks[prop.id]) {\n return;\n }\n\n notebookslist.remove(prop.id);\n delete me.notebooks[prop.id];\n\n if (me.selected_list == prop.id) {\n for (id in me.notebooks) {\n if (me.notebooks[id]) {\n notebookslist.select(id);\n break;\n }\n }\n }\n }", "async function displayCupcakes() {\n const response = await axios.get(`${BASE_URL}/cupcakes`);\n\n for (let cupcake of response.data.cupcakes) {\n let addCupcake = $(cupcakeHTML(cupcake));\n $(\"#menu-list\").append(addCupcake);\n }\n}", "async function deleteHabit(_, args) {\n const db = getDb();\n // save deleted habit\n const deleteObject = await db\n .collection(\"users\")\n .findOneAndUpdate(\n { email: args.email },\n { $pull: { habitList: { _id: ObjectID(args._id) } } },\n { returnOriginal: true }\n );\n\n // Get the deleted habit from deleteObject\n const deletedHabit = deleteObject.value.habitList.find((habit) => {\n if (habit._id == args._id) {\n return habit;\n }\n });\n\n // Push deleted habit on to deletedhabits list\n await db\n .collection(\"users\")\n .updateOne(\n { email: args.email },\n { $push: { deletedHabits: deletedHabit } }\n );\n\n // return the habit object\n return deletedHabit;\n}", "deleteCategory(trigger) {\n\t\t\tthis.$http.put('category/deactivate/'+trigger.catId, {}, {\n\t\t\t\theaders: {Authorization: JSON.parse(localStorage.user).token}\n\n\t\t\t}).then((res) => {\n\t\t\t\tif(res.status == 200) {\n\t\t\t\t\t// If the updates were successfully persisted to the database, update the state to reflect the changes\n\t\t\t\t\tthis.$store.commit('deleteCategory', trigger.catIndex);\n\t\t\t\t\tthis.displayFlashMsg('Your category was successfully deleted!', 'success');\n\t\t\t\t}\n\n\t\t\t}).catch((res) => {\n\t\t\t\tthis.handleApiError(res);\n\t\t\t});\n\t\t}", "function renderCafe(doc) {\n\tlet li = document.createElement('li');\n\tlet name = document.createElement('span');\n\tlet city = document.createElement('span');\n\tlet cross = document.createElement('div');\n\t// setting data into our element/attribute\n\tli.setAttribute('data-id', doc.id);\n\tname.textContent = doc.data().name;\n\tcity.textContent = doc.data().city;\n\tcross.textContent = 'x';\n\t// append our elements\n\tli.appendChild(name);\n\tli.appendChild(city);\n\tli.appendChild(cross);\n\t//append to cafeList - document\n\tcafeList.appendChild(li);\n\n\t//delete data by Id from firestore db\n\tcross.addEventListener('click', (e) => {\n\t\te.stopPropagation();\n\t\tlet id = e.target.parentElement.getAttribute('data-id');\n //console.log(id);\n db.collection('cafes').doc(id).delete();\n\t})\n}", "async function deleteCat(){\n let url = \"/api/produktkategorier/\" + deleteCategorySelector.value;\n fetch(url, {method: \"DELETE\"});\n populateCategoryDropDown();\n}", "async function addNewCupcake(newCupcake) {\n const response = await axios({\n url: `${BASE_URL}/cupcakes`,\n method: \"POST\",\n data: newCupcake\n })\n\n return response.data.cupcake;\n}", "function delete_meal_from_meal_list()\n{\n if (!current_meal.is_calendar_meal) {\n if (confirm(\"Are you sure you want to remove \" + current_meal.name + \" from your meals? (This cannot be undone)\")) {\n // Get the meal id\n var meal_id = current_meal.id;\n\n // Remove that one item from the calendar in HTML\n var meal_element_to_be_removed = document.getElementById(\"meal_list_item_\" + meal_id);\n meal_element_to_be_removed.parentElement.removeChild(meal_element_to_be_removed);\n\n // Delete the meal from the Users_Meals in the database\n var meal_record_to_remove = firebase_database.ref(\"Users_Meals/\" + user.uid + \"/\" + meal_id);\n meal_record_to_remove.remove();\n\n // Remove the meal from the \"meals\" in memory\n for (var i = 0; i < meals.length; i++) {\n if (meals[i].id == meal_id) {\n meals.splice(i, 1);\n break;\n }\n }\n }\n }\n}", "removeFromList(name) {\n console.log(\"Requested to remove word \" + name);\n let success = this.list.delete(name);\n console.log(\"Remove \" + name + \" success: \" + success);\n }", "function renderCafe(doc){\r\n let li = document.createElement('li');\r\n let todo = document.createElement('span');\r\n let deadline = document.createElement('span');\r\n let cross = document.createElement('button');\r\n li.setAttribute('data-id', doc.id);\r\n todo.textContent = doc.data().todo;\r\n deadline.textContent = doc.data().deadline;\r\n cross.textContent='Delete_this';\r\n li.appendChild(todo);\r\n li.appendChild(deadline);\r\n li.appendChild(cross);\r\nconsole.log(li);\r\n plan.appendChild(li);\r\n\r\n //deleting data\r\n cross.addEventListener('click',(e)=>{\r\n e.stopPropagation();\r\n let id = e.target.parentElement.getAttribute('data-id');\r\n db.collection(email1).doc(email1).collection('todo').doc(id).delete();\r\n });\r\n}", "function deleteListItem() {\n item.remove();\n }", "function renderCafe(doc) {\n let li = document.createElement('li');\n let name = document.createElement('span');\n let city = document.createElement('span');\n let cross = document.createElement('div');\n // We don't need to put 'doc.data.id' because the id is stored at the top of the document, no inside the data!\n li.setAttribute('data-id', doc.id);\n name.textContent = doc.data().name; // remember to call the method data() WITH PARENTHESIS!!!\n city.textContent = doc.data().city;\n cross.textContent = 'x';\n\n li.appendChild(name);\n li.appendChild(city);\n li.appendChild(cross);\n cafeList.appendChild(li); // Add this custom li to the ul #cafe-list\n\n // Deleting data:\n cross.addEventListener('click', (e) => {\n e.stopPropagation();\n let id = e.target.parentElement.getAttribute('data-id') // We set the data-id attribute as doc.id of the database\n db.collection('cafes').doc(id).delete();\n })\n}", "function handleDeleteList(todoAppData, todoViewSetter, todoService) {\n\tdelete todoAppData.lists[todoAppData.selectedList.name];\n\ttodoAppData.selectedList = todoAppData.lists[Object.keys(todoAppData.lists)[0]];\n\ttodoService.saveListsToLocalStore(todoAppData.lists);\n\ttodoViewSetter.deleteSelectedListMenuItem();\n\ttodoViewSetter.setSelectedList(todoAppData.selectedList);\n}", "function refreshList()\r\n{\r\n $(\".jokes\").remove();\r\n}", "removeFromCustomers() {\n KebapHouse.customers.splice(0, 1);\n }", "'click .delete'() {\n \t\tMeteor.call('lists.remove', this._id, (error) => {\n\t\t\tif (error) {\n\t\t\t\tBert.alert( 'An error occured: ' + error + '! Only the creator of the list can delete it.', 'danger', 'growl-top-right' );\n\t\t\t} else {\n\t\t\t\tBert.alert( 'List removed successfully!', 'success', 'growl-top-right' );\n\t\t\t\tFlowRouter.go('/');\n\t\t\t}\n\t\t});\n\t}", "function deleteCollection() {\n // If an operation is in progress, usually involving the server, don't do it.\n if (processing) { return false; }\n if (currentCollection == null) {\n alert(\"Please select a collection first.\");\n return false;\n }\n // If photo happens to be growing, cut it short.\n snapImageToLandingPad();\n // Get the selected collection and verify deletion.\n var collectionName = parent.fraControl.document.getElementById(\n \"collectionsList\").value;\n if (confirm(\"Are you sure you want to delete the collection '\"\n + collectionName + \"'?\")) {\n // Show the please wait floatover.\n showPleaseWait();\n // Make AJAX call.\n dojo.io.bind({\n url: \"deleteCollection.action\",\n content: {name: collectionName},\n error: function(type, errObj) { alert(\"AJAX error!\"); },\n load: function(type, data, evt) {\n setPicLocations();\n updatePics();\n resetLandingPad();\n setShadowDefaultSize();\n resetVars();\n alert(data);\n hidePleaseWait();\n updateCollectionsList();\n },\n mimetype: \"text/plain\",\n transport: \"XMLHTTPTransport\"\n });\n }\n}", "async function showInitialCupcakes() {\r\n const response = await axios.get(`${BASE_URL}/cupcakes`);\r\n\r\n for (let cupcakeData of response.data.cupcakes) {\r\n let newCupcake = $(generateCupcakeHTML(cupcakeData));\r\n $(\"#cupcakes-list\").append(newCupcake);\r\n }\r\n}", "function deleteContact() {\n let index = 0;\n let lengthAddresses = ADDRESSES.length;\n\n for (i=0; i<lengthAddresses; i++) {\n if (ADDRESSES[index].checked) {\n ADDRESSES.splice(index,1);\n }\n else {\n index++;\n }\n }\n if (allchecked) {\n allchecked = false;\n }\n displayTbl(ADDRESSES);\n}", "function alreadyBoughtController(ShoppingListCheckOffServiceFactory){\n var boughtList = this;\n\n\t//console.log(ShoppingListCheckOffServiceFactory);\n //get boughtList from service\n boughtList.items = ShoppingListCheckOffServiceFactory.getBoughtList();\n\n //function that calls the service function that cancels previous transaction\n boughtList.cancelTransaction = function(itemIndex){\n ShoppingListCheckOffServiceFactory.cancelTransaction(itemIndex);\n };\n\n }", "function delCat(e) {\n database.database_call(\n \"UPDATE note SET category_id=1 WHERE category_id=\" + args[0] + \"\"\n );\n\n database.database_call(\"DELETE FROM category WHERE id=\" + args[0] + \"\");\n $.name.value = \"\";\n alerted.note(\n \"The current category was deleted!\\n All notes in this category have been left unclassified\",\n 1\n );\n goBack(\"category_list\");\n}", "function renderCafe2(doc){\r\nlet li = document.createElement('li');\r\n\r\nlet done = document.createElement('span');\r\nlet deadline2 = document.createElement('span');\r\nlet cross = document.createElement('button');\r\nli.setAttribute('data-id', doc.id);\r\ndone.textContent = doc.data().done;\r\ndeadline2.textContent = doc.data().deadline2;\r\ncross.textContent='Delete_this';\r\nli.appendChild(done);\r\nli.appendChild(deadline2);\r\nli.appendChild(cross);\r\nconsole.log(li);\r\nplan2.appendChild(li);\r\n\r\ncross.addEventListener('click',(e)=>{\r\n e.stopPropagation();\r\n let id = e.target.parentElement.getAttribute('data-id');\r\n db.collection(email1).doc(email1).collection('done').doc(id).delete();\r\n});\r\n}", "function deleteFromList() {\r\n\r\n refreshArray();\r\n if (items.length > 0) {\r\n items[index].parentNode.removeChild(items[index]);\r\n inputText.value = \"\";\r\n }\r\n}", "function createHTML(cupcake) {\r\n const cupcakeHTML = $(`\r\n <div class=\"card col-3 m-3 card-${cupcake.id}\">\r\n <h1 class=\"text-center\">${cupcake.flavor}</h1>\r\n <img src=\"${cupcake.image}\" class=\"card-img-top\" id=\"cupcake-image\">\r\n <div class=\"card-body d-flex justify-content-center flex-column\">\r\n <h3>Size: <span class=\"h3-size ms-2\">${cupcake.size}</span></h3>\r\n <h3>Rating: <span class=\"h3-rating ms-2\">${cupcake.rating}</span></h3>\r\n <div class=\"d-flex flex-row\">\r\n <button class=\"btn btn-sm btn-success ms-2\" id=\"edit-btn-${cupcake.id}\" data-id=\"${cupcake.id}\">Edit</button>\r\n <button class=\"btn btn-sm btn-danger ms-2\" id=\"del-btn-${cupcake.id}\" data-id=\"${cupcake.id}\">X</button>\r\n </div> \r\n </div>\r\n </div>\r\n `);\r\n return cupcakeHTML;\r\n }", "function deleteCategory(catOut) {\n// var db = ScriptDb.getMyDb();\n var db = ParseDb.getMyDb(applicationId, restApiKey, \"list\");\n\n if (PropertiesService.getScriptProperties().getProperty(\"categories\") == null) {\n return; \n }\n var categories = db.load(PropertiesService.getScriptProperties().getProperty(\"categories\"));\n // Logger.log(categories);\n // if there are no more books in catOut, delete it from list.\n // Logger.log(getBooksInCategory(catOut));\n if (getBooksInCategory(catOut).length == 0) {\n // Logger.log(categories);\n for (var i = 0; i < categories.list.length ; i++) {\n if (categories.list[i] == catOut) {\n var tmp = categories.list[0];\n categories.list[0] = categories.list[i];\n categories.list[i] = tmp;\n categories.list.shift();\n categories.list = categories.list.sort();\n db.save(categories);\n break;\n }\n }\n }\n}", "async function displayCupcakes() {\n\tresponse = await axios.get(BASE_URL);\n\tcupcakes = response.data.cupcakes;\n\tfor (cupcake of cupcakes) {\n\t\t$cupcakeContainer.append(makeDiv(cupcake));\n\t}\n}", "async function getAndDisplayCupcakes() {\n\n let cupcakes = await getCupcakes();\n\n for (let cupcake of cupcakes) {\n generateAndAppendCupcakeHtml(cupcake);\n }\n}", "function deleteList() {\n //set local state of open back to false\n setOpen(false);\n //trigger delete list reducer which end result is permanent delete of list from database\n dispatch({ type: 'DELETE_LIST', payload: id });\n //redirect user back to home page\n history.push('/user');\n\n }", "function devourBurger() {\n var id = $(this).data(\"id\");\n\n $.ajax({\n method: \"DELETE\",\n url: \"/api/burger/\" + id\n })\n .done(function() {\n getBurgers();\n });\n }", "function deleteFromLook() {\n $.ajax({\n url: \"/api/looks/\" + lookId,\n type: \"DELETE\",\n success: function(data) {\n console.log(\"returned data from delete: \", data);\n }\n });\n }", "function renderCafe1(doc){\r\n let li = document.createElement('li');\r\n \r\n let doing = document.createElement('span');\r\n let deadline1 = document.createElement('span');\r\n let cross = document.createElement('button');\r\n li.setAttribute('data-id', doc.id);\r\n doing.textContent = doc.data().doing;\r\n deadline1.textContent = doc.data().deadline1;\r\n cross.textContent='Delete_this';\r\n li.appendChild(doing);\r\n li.appendChild(deadline1);\r\n li.appendChild(cross);\r\n console.log(li);\r\n plan1.appendChild(li);\r\n cross.addEventListener('click',(e)=>{\r\n e.stopPropagation();\r\n let id = e.target.parentElement.getAttribute('data-id');\r\n db.collection(email1).doc(email1).collection('doing').doc(id).delete();\r\n });\r\n\r\n}", "function deletePicklist(picklist_index) {\n // deletes picklist from object\n delete picklists[picklist_index];\n // deletes the div, modals, and <br>\n $(\".from-picklist-\" + picklist_index).remove();\n // closes the modal\n $(\".modal\").css(\"display\", \"none\");\n}", "function DeleteCoffeeByName(name){\n //create DELETE method\n const xhr = new XMLHttpRequest();\n var path = 'https://localhost:5001/api/coffee/' + name;\n xhr.open('DELETE', path, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader('Accept', 'application/json');\n xhr.setRequestHeader(\"Access-Control-Allow-Origin\", \"*\");\n xhr.send();\n\n xhr.onreadystatechange = function() {\n if (xhr.readyState != 4) {\n return\n }\n } \n }", "function deleteBurger() {\n var id = $(this).data(\"id\");\n $.ajax({\n method: \"DELETE\",\n url: \"/api/todos/\" + id\n }).done(function() {\n getBurgers();\n });\n }", "delete(groceryListId, itemName, callback) {\n GroceryItem.findOne({where: {groceryListID: groceryListId, name: itemName}})\n .then((item) => {\n item.destroy()\n .then(() => {\n callback(null);\n })\n .catch((err) => {\n callback(err);\n }) \n })\n .catch((err) => {\n callback(err);\n })\n }", "function deleteItem(pokemonId) {\n $.ajax({\n method: 'DELETE',\n url: 'http://localhost:8080/pokemon/' + pokemonId\n }).done(function (pokemon) {\n })\n}", "function deleteList(){\n\tlocalStorage.removeItem(list.key); // <===== SAVING TO LOCAL STORAGE\n\tlist = new signUpList(\"list\",\"signUpList\");\n\tupdateList();\n}", "function deleteAllJenkinsUrl(){\n\n var db = getDatabase();\n\n db.transaction(function(tx) {\n var rs = tx.executeSql('DELETE FROM jenkins_data;');\n }\n );\n\n loadAllJenkinsUrl(); //refresh combo\n }", "DELETE_FROM_CART(state, reference) {\n delete state.cart[reference];\n }", "function removeItem(button, myList, mySavedList, contentSection, myProject) {\n clearListItem(button.value, myList, mySavedList);\n loadHome(contentSection, myList, mySavedList, myProject);\n}", "function removeCupFunction(element) {\r\n\tvar str = element.parent('p').parent('td').parent('tr');\r\n\tvar cupID = str.attr(\"name\");\r\n\r\n\t// delete cup in Object\r\n\tdelete listCup[cupID];\r\n\r\n\t// hide html element\r\n\tstr.hide();\r\n\t// update total price\r\n\tupdateTotalPriceFunction();\r\n\r\n\t// checkout button stage\r\n\tif (parseFloat(getListCupLength()) > 0) {\r\n\t\tdisableCheckoutButton(false);\r\n\t} else {\r\n\t\tdisableCheckoutButton(true);\r\n\t}\r\n}", "function removetopping(element) {\n\n var cid = ((element.id).split('-'))[1];\n\n var topid = $(\"#topid-\" + cid)[0].value;\n var DELETE_JSON = \"\";\n ToppingCrustDeletionJson = [{ vendor_type_id: \"\", vendor_id: \"\", vendor_users_id: \"\", vendor_items_id: \"\", topping_id: \"\", crust_id: \"\", session_id: \"\", UUID: \"\"}]\n\n ToppingCrustDeletionJson[0].vendor_type_id = vendor_type_id;\n ToppingCrustDeletionJson[0].vendor_id = vendor_id;\n ToppingCrustDeletionJson[0].vendor_users_id = vendor_users_id;\n ToppingCrustDeletionJson[0].vendor_items_id = vendor_item_id;\n ToppingCrustDeletionJson[0].topping_id = topid;\n ToppingCrustDeletionJson[0].crust_id = 0;\n ToppingCrustDeletionJson[0].session_id = vendor_session_id;\n ToppingCrustDeletionJson[0].UUID = UUID;\n DELETE_JSON = JSON.stringify(ToppingCrustDeletionJson);\n var isdeleted = DeleteToppingOrCrust(DELETE_JSON);\n\n $(\"#toppingrow-\" + cid).remove();\n /* $(\"#removerow-\" + cid).remove();\n $(\"#toptxt-\" + cid).remove();\n $(\"#topcost-\" + cid).remove();\n $(\"#topid-\" + cid).remove();\n $(\"#crust-\" + cid).remove();*/\n}", "function deleteRoomList(data) {\r\n let n = roomsName.indexOf(data);\r\n roomsName.splice(n, 1);\r\n rooms.splice(n, 1);\r\n console.log(rooms);\r\n let room = select(`#${data}`);\r\n room.remove();\r\n}", "function DelVendor(id){\n $.ajax({\n url:`/vendors/${id}`,\n method: 'DELETE',\n contentType:'application/json',\n success: function(data){\n refreshList()\n },\n error: function(request, msg, error){\n alert('Oops...Something went wrong...!')\n refreshList()\n }\n })\n refreshList()\n}", "function deleteChangeOrder() {\n if (\n !confirm(\n 'Are you sure you want to permanently delete this pricing element?'\n )\n )\n return;\n\n console.log('PROJECT = ', PROJECT_DATA);\n for (var i = 0; i < PROJECT_DATA.changeOrders.length; i++) {\n if (PROJECT_DATA.changeOrders[i].id == selectedChangeOrder) {\n console.log('CHANGE ORDER FOUNDDDD');\n PROJECT_DATA.changeOrders.splice(i, 1);\n console.log(PROJECT_DATA, 'PROJ ID = ', projectID);\n break;\n }\n }\n\n $.ajax({\n type: 'POST',\n url: 'Project',\n data: {\n domain: 'changeorder',\n action: 'deleteChangeOrder',\n projectID: projectID,\n changeOrderID: selectedChangeOrder,\n },\n complete: function (data) {\n console.log('Response From Pricing Element Deletion', data);\n alert('Deleted Pricing Element');\n goToProjectManager();\n },\n });\n}", "function deleteChore(event) {\n console.log('deleter clicked');\n console.log(event.target);\n\n const choreId = $(event.target).data('choreid');\n\n console.log(`Deleting chore with id ${choreId}`);\n $.ajax({\n method: \"DELETE\",\n url: `/chores/${choreId}`,\n }).then(function (response) {\n getChores();\n })\n}", "function deleteListItem(){\n\t\tli.classList.add(\"delete\")\n\t\tsaveData();\n\t}", "_deleteItem() {\n this.splice('cart', this.itemNumber, 1);\n if (this.itemNumber > (this.cart.length - 1)) {\n window.history.go(-1);\n }\n console.log(this.cart);\n this.setCartItem();\n this._computeNewItemNumber(this.itemNumber)\n }", "\"groceryLists.remove\"(_id) {\n if (!this.userId) {\n throw new Meteor.Error(\"Not authorized\");\n }\n\n GroceryLists.remove({ _id, userId: this.userId });\n }", "deleteDrink(drink) {\n return apiClient.delete(`/drinks/${drink.id}`);\n }", "onDelete(_id){\n\n\t\t\tconst currentGrocToDelete =this.props.cart;\n\t\t\t// Determine at which index in array is the groc to be deleted\n\t\t\tconst indexToDelete = currentGrocToDelete.findIndex( \n\t\t\tfunction(cart){\n\t\t\t return cart._id === _id;\n\t\t\t})\n\t\t\t//use slice to remove the groc at the specified index\n\t\t\tlet cartAfterDelete= [...currentGrocToDelete.slice(0,indexToDelete),...currentGrocToDelete.slice(indexToDelete +1)];\n\n\n \t\t\tthis.props.deleteCartItem(cartAfterDelete);\n }", "function deleteFile() {\n\n if (window.confirm(\"Delete this item from wardrobe?\") == true) {\n console.log('delete files');\n let updates = {};\n clothesList_TOP.forEach((element) => {\n if (element.selected) {\n updates['/Posts/' + googleUser.uid + '/' + element.type + '/' + element.id] = null;\n }\n });\n clothesList_OUTERWEAR.forEach((element) => {\n if (element.selected) {\n updates['/Posts/' + googleUser.uid + '/' + element.type + '/' + element.id] = null;\n }\n });\n clothesList_BOTTOM.forEach((element) => {\n if (element.selected) {\n updates['/Posts/' + googleUser.uid + '/' + element.type + '/' + element.id] = null;\n }\n });\n clothesList_Other.forEach((element) => {\n if (element.selected) {\n updates['/Posts/' + googleUser.uid + '/' + element.type + '/' + element.id] = null;\n }\n });\n database.ref().update(updates);\n } else {\n }\n}", "function removeListItem (item) {\r\n lastDeleted = item;\r\n document.getElementById(item).style.display = 'none';\r\n var index = masterList.indexOf(item);\r\n if (index >= 0) {\r\n masterList.splice( index, 1 );\r\n } \r\n let updateList = `${masterList}`;\r\n db.collection(\"list\").doc(\"h2a0tUXKobzdSeY3DoDW\").set({\r\n checklist1: updateList\r\n })\r\n .then(function() {\r\n console.log(\"Document written with ID: \", docRef.id);\r\n })\r\n .catch(function(error) {\r\n console.error(\"Error adding document: \", error);\r\n });\r\n //itemList.innerHTML = '';\r\n if (hideUndo){\r\n undoButton.style.display = \"block\";\r\n hideUndo = false;\r\n }\r\n undoTextArea.textContent =`undo remove ${lastDeleted}`;\r\n\r\n //importList();\r\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}", "deleteClient(client) {\n console.log(client);\n this.destroy({url: `https://api.backendless.com/v1/data/Clients/${client.objectId}`},\n {\n success: () => {\n console.log('client deleted!');\n },\n error: () => {\n console.log('client was NOT deleted!');\n }\n });\n }", "deleteList(listID){\n let index = _store.State.lists.findIndex(list => list.id == listID)\n _store.State.lists.splice(index, 1)\n _store.saveState()\n }", "function deleteList(c) {\n\tconst taskDel = document.querySelector(`.item-${c}`);\n\ttaskDel.firstElementChild.addEventListener(\"click\", () => {\n\t\tif (confirm(\"Are you sure?\")) {\n\t\t\ttaskDel.remove();\n\t\t\tconsole.log(taskDel.textContent);\n\t\t\tremoveFromStorage(taskDel.textContent);\n\t\t}\n\t});\n}", "deleteFromList() {\n list.splice((this.id), 1)\n }", "function handleDreamsDelete() {\n var currentDream = $(this)\n .parent()\n .parent()\n .parent()\n .data(\"dream\");\n deleteDream(currentDream.id);\n window.location.href = \"/my-dreams\";\n }", "cocktailHour() {\n this.cocktails.splice(this.index, 1);\n this.drinks += 1;\n if (this.drinks === 3) {\n this.secondsToSober = 5;\n this.drunk = true;\n drunkDrums.setVolume(0.6);\n drunkDrums.loop();\n setTimeout(() => {\n drunkDrums.stop();\n this.drunk = false;\n this.drinks = 0;\n }, 5000);\n }\n }", "function deleteList(){\n if(confirm(\"Tem Sertesa que deseja excluir a tabela?\")){\n list = '';\n setList(list);\n }\n}//fim", "deletePacman(){\n this.remove(this.pacman);\n }", "deleteList() {\n this.items = [];\n }", "function deleteContacts(){\n console.log(\"deleting selected contacts\")\n var ids = [];\n $(\"li\").each(function() {\n // console.log($( this )[0].children[0].classList.length);\n let card = $(this)[0].children[0];\n // console.log(card);\n if(card.classList.length == 2){\n console.log(\"id : \", card.id);\n ids.push(card.id);\n }\n });\n console.log(ids);\n\n $.post(\"/delete\", { 'ids': ids } ).done(function(data){\n console.log(data);\n location.reload();\n });\n}", "async updateConcerts(context, concerts) {\n await fetch(\"https://showtimelespetitsmusclesback.herokuapp.com/concerts/\" + concerts._id, {\n method: \"PUT\",\n body: JSON.stringify(concerts),\n \"headers\": {\n \"Content-type\": \"application/json\",\n }\n },\n );\n const pos = context.state.concerts.findIndex(\n (p) => p.id === concerts.id\n );\n if (pos > -1) {\n // remove from the store\n context.state.concerts.splice(pos, 1, concerts);\n }\n context.commit(\"setConcertList\", context.state.concerts);\n\n }", "function retirerDuGroupe(idG, idC, index) {\n fetch(`${GROUPE_API_URL}?idC=${idC}&idG=${idG}&action=delete`)\n .then(data => data.json())\n .then(\n (data) => {\n showAlert(data.message, 1);\n document.querySelector('#contact' + index).remove();\n }\n )\n .catch(err => {\n // console.log(err);\n });\n}", "function generateCart(cartList) {\n $(\"#cartList\").empty();\n for (let i=0; i < cartList.length;i++) {\n $(\"#cartList\").append('<li id=\"'+cartList[i]+'\">'+cartList[i]+'<button class=\"remove\" value=\"'+i+'\">Remove</button></li>');\n }\n removeItem(cart);\n}", "function deleteClient(client, index) {\n //build the details list\n //check if the user has the requested permission\n var details = [\n {\n name: \"Client Id\", value: client.clientId\n },\n {\n name: \"Description\", value: client.description,\n }\n ];\n\n var modalOptions = {\n headerText: 'Please Confirm',\n message: 'Are you sure you want to delete this client?',\n buttons: { ok: 'Yes', cancel: 'No' },\n modalType: 'confirm',\n details: details\n };\n\n var modal = modalService.modal(modalOptions);\n modal.then(function (result) {\n clientFactory.deleteClient(client.clientId)\n .then(function (data) {\n //vm.gridClientsOptions.dataList.splice(index, 1);\n\n var originalIndex = vm.gridClientsOptions.dataList.indexOf(client);\n if (originalIndex != -1) {\n vm.gridClientsOptions.dataList.splice(originalIndex, 1);\n }\n });\n }, function () {\n\n });\n }", "function deleteClient(client, index) {\n //build the details list\n //check if the user has the requested permission\n var details = [\n {\n name: \"Client Id\", value: client.clientId\n },\n {\n name: \"Description\", value: client.description,\n }\n ];\n\n var modalOptions = {\n headerText: 'Please Confirm',\n message: 'Are you sure you want to delete this client?',\n buttons: { ok: 'Yes', cancel: 'No' },\n modalType: 'confirm',\n details: details\n };\n\n var modal = modalService.modal(modalOptions);\n modal.then(function (result) {\n clientFactory.deleteClient(client.clientId)\n .then(function (data) {\n //vm.gridClientsOptions.dataList.splice(index, 1);\n\n var originalIndex = vm.gridClientsOptions.dataList.indexOf(client);\n if (originalIndex != -1) {\n vm.gridClientsOptions.dataList.splice(originalIndex, 1);\n }\n });\n }, function () {\n\n });\n }", "async function showCupcakesOnStart(){\n\n let response = await axios.get(`${BASE_URL}cupcakes`);\n let cupcakes = response.data.cupcakes;\n\n for (let cupcake of cupcakes){\n let $cupcakeDiv = $('<div>');\n let $cupcakeImg = $('<img>').attr(\"src\", cupcake.image);\n let $cupcakeFlavor = $('<h3>').text(cupcake.flavor);\n let $cupcakeRating = $('<h3>').text(cupcake.rating);\n let $cupcakeSize = $('<h3>').text(cupcake.size);\n $cupcakeDiv.append($cupcakeFlavor)\n .append($cupcakeImg)\n .append($cupcakeRating)\n .append($cupcakeSize)\n let $cupcakeListItem = $('<li>').append($cupcakeDiv);\n $cupcakeList.append($cupcakeListItem);\n }\n\n}", "function deleteContact(req, res, next) {\n List\n .findById(req.params.list_id)\n .populate('services')\n .exec(function (err, list) {\n if (err) {\n res.send(404, new Error('List not found'));\n return next(false);\n }\n\n var index = list.contacts.indexOf(req.params.contact_id);\n if (index == -1) {\n res.send(404, new Error('Contact not found'));\n return next(false);\n }\n else {\n list.contacts.splice(index, 1);\n list.save(function (err) {\n if (err) {\n res.send(500, new Error('Unknown error saving list'));\n return next(false);\n }\n // Unsubscribe contact from services\n if (list.services.length) {\n Contact\n .findById(req.params.contact_id)\n .populate('_profile')\n .exec(function (err, contact) {\n if (!err && contact) {\n list.services.forEach(function (service) {\n if (service.auto_remove) {\n service.unsubscribe(contact._profile);\n }\n });\n }\n });\n }\n res.send(204);\n return next();\n });\n }\n });\n}", "deleteItems(idList,callback) {\n if (!this.hasPermission(Models.Permissions.delete)) {\n callback(null,{'errors':{'general': t(\"You do not have permission to delete this item\")}});\n return;\n }\n const itemList = idList.map(function(item) {\n return item;\n });\n if (!itemList || !itemList.length) return;\n const params = {method:'DELETE'}\n Backend.request(\"/api/\"+this.itemName+\"/item/\"+itemList.join(\",\"),params, function(err,response) {\n if (!response || response.status !== 200) {\n callback(null,{'errors':{'general': t(\"Системная ошибка\")}});\n return;\n }\n response.json().then(function(jsonObject) {\n callback(null,jsonObject);\n })\n });\n }", "function list_delete(list) {\t\t\t\n\tif (window.XMLHttpRequest) {\n\t\treq = new XMLHttpRequest();\n\t} else {\n\t\t req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\treq.open(\"POST\", \"/lists\", true);\n\treq.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\")\n\treq.send(\"type=list_delete&list=\" + encodeURIComponent(list));\n\n\treq.onreadystatechange = function() {\n\t\tif (req.readyState==4 && req.status==200) {\n\t\t\tdocument.getElementById('prompt').innerHTML = req.responseText;\t\t\t\t\t\n\t\t} else {\n\t\t}\n\t}\n}", "function removeClimb(index){\n\tclimbLib = removeClimbFromLibrary(climbLib, index);\n\t//re renderTable(table, library)\n\trenderTable(climbTbl, climbLib);\n}", "remove() {\n for (let f of this.fixtures) {\n f.remove();\n }\n }", "function deleteList() {\n\n items.length = 0;\n localStorage.removeItem('list');\n insertItemsToList(items, itemsList);\n}", "function killList() {\n let specList = document.getElementById(\"requirements\");\n specList.innerHTML = \"\";\n count = 1;\n fetch((URL + \"?remove=true\"))\n .then(checkStatus)\n .then(function(data) {\n console.log(data);\n })\n .catch(reportError);\n }", "function deleting() {\n\tvar j = 0;\n\tvar boxes = document.getElementsByClassName('chk');\n\tvar box = new Array();\n\n\tfor ( var i = 0; i < boxes.length; i++) {\n\t\tif (boxes[i].checked) {\n\t\t\tbox[j] = boxes[i].value;\n\t\t\tj++;\n\t\t}\n\t}\n\tvar str = box.join();\n\n\t$.ajax({\n\t\turl : \"/category/deleteSelected\",\n\t\tdata : {\n\t\t\tid : str\n\t\t},\n\t\tsuccess : function(result) {\n\t\t\twindow.location.assign(\"category\");\n\t\t\t//alert(\"successful\");\n\n\t\t}\n\t});\n\n}", "function handleDeleteFoodSuccess(data) {\n var deletedFoodId = data._id;\n // remove console logs from production\n console.log('removing the following food from the page:', deletedFoodId);\n $('div[data-food-id=' + deletedFoodId + ']').remove();\n }", "function clearList() {\n shoppingList = [];\n displayList();\n}", "remove(fruit) {\n const index = this.contactarray.indexOf(fruit);\n if (index >= 0) {\n this.contactarray.splice(index, 1);\n }\n }" ]
[ "0.64524615", "0.58138084", "0.5637916", "0.5599224", "0.54098934", "0.53802365", "0.5373107", "0.53454834", "0.53035015", "0.5276876", "0.5218314", "0.51598454", "0.5117401", "0.50604266", "0.5028493", "0.5021291", "0.5000801", "0.49943683", "0.49820977", "0.49787343", "0.49764514", "0.4971032", "0.4965829", "0.49518254", "0.49284244", "0.49201062", "0.49181333", "0.4914746", "0.4875091", "0.48652983", "0.48621228", "0.48537365", "0.48406368", "0.48315996", "0.4824267", "0.4811453", "0.48091725", "0.47957498", "0.47914428", "0.47876182", "0.47819105", "0.47810128", "0.47805184", "0.4775872", "0.47708863", "0.47634158", "0.4746283", "0.47460815", "0.47455272", "0.47392982", "0.47389457", "0.47298425", "0.47246772", "0.47144464", "0.47051764", "0.47034177", "0.47023386", "0.46962395", "0.46935666", "0.46848598", "0.46764323", "0.46704638", "0.46672767", "0.46594203", "0.465509", "0.4653763", "0.4652572", "0.46509787", "0.46500513", "0.4649429", "0.46493918", "0.4647469", "0.46467018", "0.46322617", "0.46227628", "0.46222952", "0.4620368", "0.46126738", "0.46106204", "0.46082392", "0.46069965", "0.4605702", "0.4602124", "0.4596272", "0.45948318", "0.45909274", "0.45899466", "0.45899466", "0.4588175", "0.4586402", "0.45860592", "0.4582257", "0.45810127", "0.45802012", "0.45739797", "0.4572912", "0.45705503", "0.4567601", "0.4565205", "0.45622352" ]
0.8137888
0
to reset all boxes after all filled
function reset() { for (var i = 1; i <= 9; i++) { document.getElementById('box' + i).innerHTML = ""; } // turn.innerHTML="X-turn" x.style.background = "green"; x.style.color="#fff" o.style.background = "#fff"; o.style.color="#000"; count = 1; //set the value of count to 1 after reset }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetGame() {\n // Clear the main boxes and the minimap boxes\n for(var rIndex = 0; rIndex < NUM_ROWS; rIndex++) {\n for(var cIndex = 0; cIndex < NUM_COLS; cIndex++) {\n // Clear main boxes\n boxes[rIndex][cIndex].classList.remove(xClass, oClass);\n boxes[rIndex][cIndex].textContent = \"\";\n // Clear minimap boxes\n miniboxes[rIndex][cIndex].classList.remove(xClass, oClass);\n miniboxes[rIndex][cIndex].textContent = \"\";\n }\n }\n\n // Hide end game text\n $(victoryText).hide();\n\n // Reset number of filled boxes\n boxCount = 0;\n\n // Start the game again\n gameOver = false;\n }", "function reset()\n{\n\tvar pillContainers = ['pill1Container','pill2Container','pill3Container','pill4Container','pill5Container','pill6Container']\n\t\n\tfor(var i = 0; i<boxes.length; i++)\n\t{\n\t\t$('#'+boxes[i]).empty();\n\t}\n\t\n\tfor(var i = 0; i< pillContainers.length; i++)\n\t{\n\t\t$('#'+pillContainers[i]).empty();\n\t\tregeratePill(pillContainers[i]);\n\t}\n\t\n\t\n}", "reset() {\n this.domSquares.forEach(square => {\n this.setSquare(square, '');\n });\n }", "function resetGameBoxes() {\n for(const box of divs.game_boxes) {\n box.setAttribute('state', 0);\n }\n}", "function resetGrid(){\n $('.box').css({'background-color': '#EDEDED'});\n $('.box').off();\n }", "function clearBoxes() {\n progressMessage.setProgressMessage(\"clear bounding boxes\");\n if (boxpolys != null) {\n for (var i = 0; i < boxpolys.length; i++) {\n boxpolys[i].setMap(null);\n }\n }\n boxpolys = null;\n}", "function clearBoxes() {\n if (boxpolys != null) {\n for (var i = 0; i < boxpolys.length; i++) {\n boxpolys[i].setMap(null);\n }\n }\n boxpolys = null;\n }", "function clearBoxes() {\n if (boxpolys != null) {\n for (var i = 0; i < boxpolys.length; i++) {\n boxpolys[i].setMap(null);\n };\n };\n boxpolys = null;\n }", "function pressReset(){\r\n\tfor (var i = 0; i < boardArray.length; i++) {\r\n\t\tboardArray[i] = undefined;\r\n\t\tvar event_Id = \"box_\"+i;\r\n\t\tvar box_canvas = document.getElementById(event_Id);\r\n\t\tvar box_context = box_canvas.getContext(\"2d\");\r\n\t\tbox_context.clearRect(0, 0, box_canvas.width, box_canvas.height);\r\n\t}\r\n\tisTurnCirlce = true;\r\n\twinGame = false;\r\n}", "function clearBox(){\n $(\"#message\").text(\"\");\n gameOver=false;\n $(\"#box1\").text(\"\");\n $(\"#box2\").text(\"\");\n $(\"#box3\").text(\"\");\n $(\"#box4\").text(\"\");\n $(\"#box5\").text(\"\");\n $(\"#box6\").text(\"\");\n $(\"#box7\").text(\"\");\n $(\"#box8\").text(\"\");\n $(\"#box9\").text(\"\");\n countGame=0;//set count game 0\n arr1=[[\"\",\"\",\"\"],[\"\",\"\",\"\"],[\"\",\"\",\"\"]];}", "static clearAll() {\n const manager = FocusRingManager.instance;\n manager.rings_.forEach(ring => {\n ring.rects = [];\n });\n manager.updateFocusRings_(null, null);\n }", "reset() {\n this.grid = this.getEmptyBoard();\n }", "function emptyBoxes() {\n $(\"#extremalBox\").empty();\n $(\"#diffBox\").empty();\n $(\"#spearmanBox\").empty();\n $(\"#serialBox\").empty();\n}", "function reset() {\n setPieces(round);\n }", "function resetBox(box) {\n if ($scope.clipboardBox == box) {\n $scope.clipboardBox = null; // Remove from Clipboard if this was the Clipboard\n }\n\n box.job = null;\n box.task = null;\n box.empty = true;\n }", "function reset(){\n\t\tsetSorting(false);\n\t\t// setDataBottom(new Array(rectNum).fill(new Rect(0,Math.round(maxWidth/rectNum),0)));\n\t\tsetLightUp([]);\n\t\t// setLightUpBottom([]);\n\n\t}", "function clearBoxes() {\n if (boxpolys != null) {\n for (var i = 0; i < boxpolys.length; i++) {\n boxpolys[i].setMap(null);\n }\n }\n boxpolys = null;\n}", "function clearBoxes() {\n if (boxpolys != null) {\n for (var i = 0; i < boxpolys.length; i++) {\n boxpolys[i].setMap(null);\n }\n }\n boxpolys = null;\n}", "function reset_all() {\n\t// Global variables\n\tactive_atom = null;\n\tatoms = [];\n\tbonds = [];\n\tformula_dict = {};\n\tformula = \"\";\n\n\t// Canvas stuff\n\tclear_canvas();\n\n\t// Right sidebar properties\n\t$(\"#prop\").find(\"section\").empty();\n\t// $(\"#neighbors\").empty();\n\t// $(\"#factor\").empty();\n\t// $(\"#formula\").empty();\n\n\t// Left selection sidebar\n\t$(\"input\").val(\"\");\n\t$(\"select\").val(\"default\");\n\t$(\"#bondBtn\").html(\"Add to canvas!\");\n\t$(\"#newAtom\").addClass(\"hidden\");\n\t$(\"#newGroup\").addClass(\"hidden\");\n\t$(\"#newRing\").addClass(\"hidden\");\n\t// Because the first atom doesn't need a bond\n\t$(\"#boSelect\").addClass(\"hidden\");\n\t$(\"#boSelectLabel\").addClass(\"hidden\");\n\n\t// Top toolbar\n\tdisable_pick_atom_to_erase();\n\tdisable_pick_bond();\n\tdisable_pick_ring_base();\n\tdisable_pick_atom_to_change();\n\tdisable_pick_atom_to_move();\n\n}", "function resetMuda() {\n $('#square-one').text('');\n $('#square-two').text('');\n $('#square-three').text('');\n $('#square-four').text('');\n $('.letterpickbox div').css('color', 'black');\n $('.wordpickbox div').css('color', 'black');\n}", "function resetboxes(){\n\tvar testElements = document.getElementsByClassName('box');\n\tvar boxindex = 0;\n\n\tArray.prototype.filter.call(testElements, function(box){\n\t\tboxindex = boxindex + 1;\n\t\tbox.style.display = \"inline-block\";\n\t\tbox.getElementsByClassName('keybind')[0].innerHTML = boxindex;\n\t});\n}", "reset() {\n this.grid = this.getEmptyBoard();\n }", "function clearBoxes()\t{\n\tvar boxDiv = document.querySelectorAll(\"div.box\");\n\tfor (var i = 0; i < boxDiv.length; i++)\t{\n\t\t//console.log(boxDiv[i]);\n\t\tvar boxDivChild = boxDiv[i];\n\t\tvar boxDivParent = boxDivChild.parentElement;\n\t\tboxDivParent.removeChild(boxDivChild);\n\t\t}\n//// now we need to reset the array, remove all the boxes \n\tresetArray(boxes);\n}", "function reset(){\n $('#selection-area').empty();\n $('#species-info').empty().css('background-color', panelColor);\n $('#last-dropdown-area').empty();\n $('.counties').css('fill', mapColor);\n $('.labels').css('fill', panelColor);\n }", "function initalize() {\n // lock reset button\n $(\"#reset_btn\").prop(\"disabled\",true);\n\n // set initial values of boxes\n for (i=0;i<10;i++){\n boxVal[i] = i;\n }\n updateScreen();\n}", "function resetBoard() {\n $(\".zero\").empty();\n $(\".one\").empty();\n $(\".two\").empty();\n $(\".three\").empty();\n $(\".four\").empty();\n $(\".five\").empty();\n $(\".six\").empty();\n $(\".seven\").empty();\n $(\".eight\").empty();\n}", "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n turn = 0;\n playerBet = 0;\n winNumber = 0;\n lossNumber = 0;\n winRatio = 0;\n updateBet();\n updateCredits();\n updateJackpot();\n updatePayout();\n for (var index = 0; index < 3; index++) {\n reelContainers[index].removeAllChildren();\n }\n\n}", "function reset() {\n graphics.clearAll();\n for (var i = 0; i < grid.length; i++) {\n for (var j = 0; j < grid[i].length; j++) {\n $(\"#\" + grid[i][j]).parent().removeClass(\"red\");\n squares[grid[i][j]] = \"empty\";\n p2Move = false;\n }\n }\n timesPlayed = 0;\n $(\"#screen3\").children().hide();\n $(\"#screen1\").children().show();\n talker.notice(\"start up\");\n}", "function resetBox() {\n for ( i = 0 ; i < box.length ; i++ ) {\n if (box[i].hasChildNodes()) {\n box[i].removeChild(box[i].getElementsByTagName(\"img\")[0]);\n box[i].setAttribute(\"ondrop\",\"drop(event)\");\n box[i].setAttribute(\"ondragover\",\"allowDrop(event)\");\n box[i].setAttribute(\"ondragleave\",\"dragLeave(event)\");\n box[i].style.backgroundColor = \"\";\n }\n box[i].classList.remove(\"fade\");\n }\n grid.classList.remove(\"fade\");\n}", "function clearBox2(){\n countPlayer1=0;\n countPlayer2=0;\n countTIE=0;\n $(\"#message\").text(\"\");\n gameOver=false;\n $(\"#box1\").text(\"\");//replace the text with empty string\n $(\"#box2\").text(\"\");\n $(\"#box3\").text(\"\");\n $(\"#box4\").text(\"\");\n $(\"#box5\").text(\"\");\n $(\"#box6\").text(\"\");\n $(\"#box7\").text(\"\");\n $(\"#box8\").text(\"\");\n $(\"#box9\").text(\"\");\n countGame=0;\n arr1=[[\"\",\"\",\"\"],[\"\",\"\",\"\"],[\"\",\"\",\"\"]];//the board will be empty\n XO=\"X\";\n $(\"#TIE\").text(\"TIE: \"+\" \"+(0));\n $(\"#player1\").text(\"player1: \"+(0));\n $(\"#player2\").text(\"player2: \"+(0));}", "function resetBoard() {\n \n // prevents a game reset when a game is in progress\n if (self.gameBoard.gameStatus === \"Game in progress\") {\n alert(\"Whoa! One game at a time!\");\n return;\n }\n else if (self.gameBoard.gameStatus === \"Waiting for players\") {\n alert(\"We need two players to start a game.\")\n return;\n }\n // clears the board for a new game\n else {\n for (var i = 0; i < self.gameBoard.boxes.length; i++) {\n self.gameBoard.boxes[i].isX = false;\n self.gameBoard.boxes[i].isO = false;\n self.gameBoard.$save(self.gameBoard.boxes[i]);\n }\n\n //resets the game status for the new game\n self.gameBoard.gameStatus = \"Game in progress\";\n self.gameBoard.$save(self.gameBoard.gameStatus);\n }\n \n }", "function clearAll(){\n\n\t//clear all 9 boxes\n\tdocument.getElementById(\"r1c1\").innerHTML=\"\";\n\tdocument.getElementById(\"r1c2\").innerHTML=\"\";\n\tdocument.getElementById(\"r1c3\").innerHTML=\"\";\n\tdocument.getElementById(\"r2c1\").innerHTML=\"\";\n\tdocument.getElementById(\"r2c2\").innerHTML=\"\";\n\tdocument.getElementById(\"r2c3\").innerHTML=\"\";\n\tdocument.getElementById(\"r3c1\").innerHTML=\"\";\n\tdocument.getElementById(\"r3c2\").innerHTML=\"\";\n\tdocument.getElementById(\"r3c3\").innerHTML=\"\";\n\n\t//reseet gameOver so players can play again\n\tgameOver = false;\n}", "handleReset() {\n if(!solving) {\n resetStartEnd();\n grid = Array(800).fill(null);\n this.setState({squares: grid});\n for(let i = 0; i < 800; ++i) {\n document.getElementsByClassName('square')[i].style = 'background-color: white';\n }\n }\n }", "function refr() {\n $.each(box, function() {\n $(this).html('');\n });\n selectionMade = false;\n o.removeClass('red');\n x.removeClass('red');\n x.one('click', xselect);\n o.one('click', oselect);\n avail = [0, 1, 2, 3, 4, 5, 6, 7, 8];\n moveCount = 0;\n aiMove = false;\n }", "function clear_boxes() {\n for (var tt of tooltips) { tt.remove(); tooltips.delete(tt); }\n for (var box of boxes) { box.remove(); boxes.delete(box); }\n while (vgvContainer.lastChild) { vgvContainer.remove(vgvContainer.lastChild); }\n}", "function resetDroppableBox() {\r\n for (let i = 0; i < idArray.length; i++) {\r\n wordObjects[idArray[i]].reset();\r\n // the project resets\r\n idArray = [];\r\n outputArray = [];\r\n $droppableBox.empty();\r\n }\r\n}", "function reset() {\n for (var i = 1; i <= 9; i++) {\n document.getElementById('box' + i).innerHTML = \"\";\n }\n // turn.innerHTML=\"X-turn\"\n x.style.background=\"green\";\n o.style.background=\"#fff\";\n count=1; //set the value of count to 1 after reset \n}", "function reset() {\n if (ref_div_main.children.length != 0) {\n for (let i = 0; i < (cant_bloques); i++) {\n ref_div_main.children[0].remove()\n }\n }\n blocksPositions = {}\n objArray = []\n first_row_index = []\n last_row_index = []\n ref_div_main.style.display = 'none'\n}", "reset(event) {\n\n var client = event.data.client\n\n $(client.cardId).empty();\n client.items.board = Array()\n client.items.selected = Array()\n\n // Bingo row, column, and diagonal indexes\n client.items.bingoRow = Array()\n client.items.bingoCol = Array()\n client.items.bingoDiag = Array()\n client.items.all = client.shuffle(client.items.all)\n client.resetCounters()\n client.update()\n\n }", "reset() {\n this._counter++;\n this._size = 0;\n this._colObjects = [];\n this._updateSides();\n }", "function reset(){\n for(var i = 0; i < height; i++) {\n for(var j = 0; j < width; j++) {\n block2D[i][j] = 0;\n }\n }\n}", "function reset() {\n\t\t\tclear_board()\n\t\t}", "function clear() {\r\n\r\n\t\tturn = \"\";\r\n\t\tgrid = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\r\n\t\tmsg(\"\");\r\n\t\t// We use map to generate a new empty array\r\n\t\t$(\".tile\").map(function () {\r\n\t\t\t$(this).text(\"\");\r\n\r\n\t\t});\r\n\r\n\t\twinner = 0;\r\n\t\tcount = 0;\r\n\t}", "function resetBoard(full){\n\tif(full){\n\t\tdocument.getElementById('drawBody').innerHTML = '';\n\t\tfor(var i = 0; i < 100; i++){\n\t\t$(\"#\"+i+\"\").removeClass();\n\t\t}\n\t} else {\n\t\tfor(var i = 0; i < 100; i++){\n\t\t\tif (!$(\"#\"+i+\"\").hasClass(\"filled\") && $(\"#\"+i+\"\").hasClass(\"playable\")) {\n\t\t\t\t$(\"#\"+i+\"\").removeClass(\"playable\");\n\t\t\t}\n\t\t}\n\t}\n}", "function reset () {\n\t\tfillZero(xs,9);\n\t\tfillZero(os,9);\n\t\tremoveSelected(circles);\n\t\tcurrent = null;\n\t\tcounter = null;\n\t\twin = false;\n\t\tdisplay.textContent = \"tic tac toe\";\n\t}", "function resetGame () {\n\tFIELD = createGrid();\n\tfor(var i = 0; i < NB_ROW; i++){\n\t\tfor(var j = 0; j < NB_LIG; j++){\n\t\t\tFIELDVIEW[i][j].red.alpha = 0;\n\t\t\tFIELDVIEW[i][j].yellow.alpha = 0;\n\n\t\t\tFIELDVIEW[i][j].empty.interactive = true;\n\t\t}\n\t}\n\tdocument.getElementById(\"winner\").innerHTML = \"\";\n}", "function clearBoard() {\n for (i=0; i<=maxX; i++) {\n for (j=0; j<=maxY; j++) {\n with (cellArray[arrayIndexOf(i,j)]) {\n isExposed = false;\n isBomb = false;\n isFlagged = false;\n isMarked = false;\n isQuestion = false;\n neighborBombs = 0; } } } }", "function clearSudoku() {\r\n for ( let cell of filledSudoku ){\r\n cell.value = '';\r\n }\r\n document.querySelector('table').style.border = 'none';\r\n document.querySelector('#check>p').textContent = \"\";\r\n }", "function clearAll()\n{\n\tlet original_box= document.getElementById(\"grid\");\t//access the grid\n\tlet trs=original_box.getElementsByTagName(\"tr\");\t//get all the elements of tr\n\t\n\tfor (let i=0; i<numRows; i++)\t\t\t\t\t\t//loop through the rows and columns\n\t{\n\t\tlet tds= trs[i].getElementsByTagName(\"td\");\t\t//to access the columns of the boxes in each row\n\t\tfor (let j=0; j<numCols; j++)\n\t\t{\n\t\t\ttds[j].style.backgroundColor=\"white\";\t\t//reset the color to white.\n\t\t}\n\t}\n}", "function clearAll() {\n for (let i = 0; i < 11; i++) {\n setNone(i);\n }\n running = false;\n }", "function reset() {\n $boundary\n .css('height', 'auto')\n .find('.placeholder')\n .remove()\n .end()\n .find('.draggable')\n .attr('style', '');\n }", "function resetArray(boxesArray) \t{\n\tboxesArray.length=0;\n}", "function clearBoard(){\n\tfor(var i = 0; i < theBoxes.length; i++) {\n\t\ttheBoxes[i].innerHTML =\"\";\n\t\ttheBoxes[i].style.backgroundColor = \"white\";\n\t}\n\tif (clearButton.innerText === \"Play Again\"){\n\t\tclearButton.innerText = \"Clear\";\n\t} \n\n}", "reset() {\n for (let i = 0; i < this.allNodes.length; i++) { this.allNodes[i].reset(); }\n for (let i = 0; i < this.Splitter.length; i++) {\n this.Splitter[i].reset();\n }\n for (let i = 0; i < this.SubCircuit.length; i++) {\n this.SubCircuit[i].reset();\n }\n }", "function clearFlipBoxes() {\n console.log(\"Flip boxes being cleared\");\n flipBoxesContainer.innerHTML = \"\";\n }", "reset() {\n\t\tfor (let i = 0; i < this.tiles.length; i++) {\n\t\t\tthis.tiles[i].unsetPiece();\n\t\t}\n\t\tfor (let i = 0; i < this.whitePieces.length; i++) {\n\t\t\tthis.whitePieces[i].unsetTile();\n\t\t\tthis.whitePieces[i].animation = null;\n\t\t\tthis.blackPieces[i].unsetTile();\n\t\t\tthis.blackPieces[i].animation = null;\n\t\t}\n\t}", "resetCandidate(){\r\n this.candidates.fill(0b111111111);\r\n this.candidates_row.fill(0b111111111);\r\n this.candidates_column.fill(0b111111111);\r\n this.candidates_block.fill(0b111111111);\r\n\r\n this.shadow.candidates.fill(0b111111111);\r\n this.shadow.candidates_row.fill(0b111111111);\r\n this.shadow.candidates_column.fill(0b111111111);\r\n this.shadow.candidates_block.fill(0b111111111);\r\n\r\n for(let i=1; i<=9; i++){\r\n for(let j=1; j<=9; j++){\r\n if(this.getNumber(i, j) > 0){\r\n this.setNumber(i, j, this.getNumber(i, j));\r\n }\r\n }\r\n }\r\n }", "function clearGrid() {\n for (let i = 0; i < numRectanglesWide; i++) {\n for (let j = 0; j < numRectanglesHigh; j++) {\n setAndPlotRectangle(i, j, false);\n }\n }\n }", "function clearGrid() {\n\t$('.box').css('background', '#faebd7');\n}", "reset(color1, color2) {\n for (let i = 0; i < this.length(); i++) {\n let slot = this.getSlot(i);\n slot.classList.remove(color1);\n slot.classList.remove(color2);\n slot.classList.remove('filled');\n slot.style.border = '2px solid black';\n }\n }", "function resetBoard(){\n return function(){\n for (i = 0; i < winBoard.length; i++){\n $(\"#\" + winBoard[i].box).removeClass(\"winning-boxes\");\n gameOver = false;\n winBoard[i].value = \"\";\n playerIsX = false;\n fillCount = 0;\n outputToHTML(winBoard[i].box, i, \"&nbsp;\");\n $(\"#win-celebrate\").hide(\"slow\");\n $(\".ticbox\").hide(\"fast\");\n $(\"#selectors-row\").show(\"fast\");\n }\n }\n}", "function reset() \n{\n for (var i = 0; i < $cell.length; i++) \n {\n \t$cell[i].className = 'cell';\n \t$cell[i].innerHTML = '';\n }\n bombs.posX = [];\n bombs.posY = [];\n}", "function clearAll () {\n\tfor (var i = 0; i < num; i++) {\n\t\tp[i].finish();\n\t\tdelete p[i];\n\t}\n\tPelota.prototype.ID = 0;\n\tnum = 0;\n\tsetTimeout(function () {\n\t\tctx.clearRect(0, 0, can.width, can.height);\n\t}, 100);\n}", "function reset() {\n $holder.children().remove();\n $(\"#boardLine\").children().remove();\n boardLine = createBoardLine();\n\n // create an array of tiles\n tiles = createRandomTiles(7, json);\n // changed my mind, didnt want to reset highscore but kept functionality\n // highScore = 0;\n // $highScore.text(`High Score: ${highScore}`);\n score = updateScore(boardLine);\n $score.text(`Score: ${score}`);\n }", "function Reset() {\n boxesTaken = 0;\n won = false;\n displayMessage = false;\n twoNoMovesInARow = 0;\n initializeBoard();\n}", "function clear() {\r\n for(var i=0;i<squares.length; i++){\r\n squares[i].textContent = \"\";\r\n }\r\n}", "function clearBox(box) {\n\t\tfor (var i = box.options.length - 1; i >= 0; i--) {\n\t\t\tbox.remove(i);\n\t\t}\n\t}", "function resetDefault(){\n fillDefault();\n}", "function reset() {\n $('#check').removeAttr(\"disabled\");\n $('.blocks').html('');\n $('#color').html('').append(pickColor());\n $('#wordHint').attr(\"disabled\", \"disabled\");\n $('#genNewWord').attr(\"disabled\", \"disabled\");\n $('#checkWord').attr(\"disabled\", \"disabled\");\n $('#dragTarget ul').html('');\n $('#dragWord').find('div').each(function (index) {\n $(this).html('');\n });\n $(\"#genWord\").removeAttr(\"disabled\");\n $(\".lifes\").find(\"li\").each(function (index) {\n $(this).show();\n });\n\n count = 0;\n lifes = 4;\n}", "function resetGrid () {\n gridCounter = 0;\n $('#pass-button').hide();\n $('#reset-cells-button').show();\n\n $('#reset-cells-button').off().on(\"click\", function () {\n for(var i = 0; i < numberInGrid.length; i++) {\n $('.game-cell').css('background-color', 'red');\n generateNumber(); // ensure that correct orientation mode is selected\n selectCell();\n }\n });\n }", "function resetElements()\n{\n\tvalidMemes = new Array;\n\tgameLogic = gameLogicI;\n\tmemesCoords = new Array;\t\n\n\tmixMemes();\n}", "function reset_game_board(){\n $('.community_cards').empty();\n $('.players_cards').empty();\n $('.feedback').empty();\n }", "function resetBoard() {\n for (var i = boxes.length - 1; i >= 0; i--) {\n boxes[i].innerHTML = '';\n boxes[i].setAttribute('class', 'clear');\n }\n OMoves = [];\n XMoves = [];\n winCounter = 0;\n counter = 1;\n turnText.innerHTML = 'Kick off the game, Player X';\n}", "function resetGrid() {\n grid.forEach(box => (box.textContent = \"\"));\n}", "function clearBoard(){\r\n \tfor(var i=0; i< squares.length; i++){\r\n \t\tsquares[i].textContent= '';\r\n \t}\r\n }", "function reset() {\r\n\tarray = [0, 1, 2, 3, 4, 5, 6, 7, 8];\r\n\tsquaresChosenByComputer = [];\r\n\tsquaresChosenByPlayer = [];\r\n\t$(\"#message\").html(\"\");\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\t$(\"#\" + i).html(\"\");\r\n\t\t$(\"#\" + i).css(\"background-color\", backgroundColor);\r\n\t}\r\n}", "function reset(){\n while(gridSquare.firstChild){\n gridSquare.removeChild(gridSquare.firstChild);\n }\n}", "function resetAll() {\n\n // Palette1 checked by default\n paletteOne.checked = true;\n\n // Reset form fields\n document.querySelector('#email-input').value = '';\n document.querySelector('#phone-input').value = '';\n document.querySelector('#linkedin-input').value = '';\n document.querySelector('#github-input').value = '';\n document.querySelector('#name-input').value = '';\n document.querySelector('#job-input').value = '';\n\n // Default Name & Rol in preview card\n outputName.innerHTML = 'Nombre Apellidos';\n outputJob.innerHTML = 'Front-end developer';\n\n // Default inputImage y addImpage \n const imageUrl = './assets/images/queen.gif';\n profileImage.style.backgroundImage = `url(${imageUrl})`;\n profilePreview.style.backgroundImage = `url(${imageUrl})`;\n\n // Icons hidden & Default Color\n previewOne();\n emailIcon.classList.add('hidden');\n phoneIcon.classList.add('hidden');\n linkedinIcon.classList.add('hidden');\n githubIcon.classList.add('hidden');\n}", "function resetGrid(){\n let divCount = prompt(\"How many boxes per side do you need?\");\n clearGrid();\n createGrid(divCount);\n}", "function resetGrid() {\n gridPositionsi = [0];\n gridPositionsj = [0];\n userMoves = [0];\n id =0;\n $('.gridsquare'+width).removeClass('cursor'+width);\n $('.gridsquare'+width).removeClass('correct-square')\n $('.gridsquare'+width).removeClass('incorrect-square');\n $('#0').html('<div class=\"cursor'+width+'\"></div>');\n $('.cursor'+width).addClass('animated infinite pulse')\n}", "function resetPuzzlePieces(){\n //empty the thumbnail container\n // debugger;\n \tpiecesBoards.innerHTML = \"\";\n \tcreatePuzzlePieces(this.dataset.puzzleref);\n // foreach has specify a callback function in the array\n // empty the drop zones\n dropZones.forEach(zone => {\n // removeChild\n while (zone.firstChild) zone.removeChild(zone.firstChild);\n // ouputs a message and writes into the console of the browser Chrome\n console.log(\"Ciao, see you later!\");\n });\n }", "function resetAll() {\n playerMoney = 1000;\n winnings = 0;\n jackpot = 5000;\n turn = 0;\n playerBet = 5;\n maxBet = 20;\n winNumber = 0;\n lossNumber = 0;\n winRatio = false;\n\n resetText();\n\n setEnableSpin();\n}", "function resetGame() {\n newSquares = Array(9).fill(null);\n setSquares(newSquares);\n setXTurn(true);\n }", "clearGrid() {\n for(let col = 0; col < this.width; col++) {\n for(let row = 0; row < this.height; row++) {\n this.grid[col][row] = DEAD;\n }\n }\n }", "function reset() {\n gridPoints = []; // resets the gridPoints so that it clears the walls etc. on reset.\n gridPointsByPos = [];\n openSet.clear();\n closedSet.clear();\n gctx.clearRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT);\n grid.createGrid();\n\n}", "function clear() {\n\t$(\".square\").remove();\n\tload(present_size);\n\tset_running();\n}", "function reset() {\n for (c = 0; c < tileColumnCount; c++) {\n tiles[c] = [];\n for (r = 0; r < tileRowCount; r++) {\n tiles[c][r] = { x: c * (tileW + 3), y: r * (tileH + 3), state: 'e' }; //state is e for empty\n }\n }\n tiles[0][0].state = 's';\n tiles[tileColumnCount - 1][tileRowCount - 1].state = 'f';\n\n output.innerHTML = 'Green is start. Red is finish.';\n}", "resetCandidate(){\r\n this.candidates.fill(0b111111111);\r\n this.candidates_row.fill(0b111111111);\r\n this.candidates_column.fill(0b111111111);\r\n this.candidates_block.fill(0b111111111);\r\n\r\n for(let i=1; i<=9; i++){\r\n for(let j=1; j<=9; j++){\r\n if(this.getNumber(i, j) > 0){\r\n this.setNumber(i, j, this.getNumber(i, j));\r\n }\r\n }\r\n }\r\n }", "function resetEverything() {\n coords = [];\n cellMap = new Map();\n showMaze = false;\n showSoln = false;\n solnSet = [];\n countMoves = 0;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n user = new User();\n}", "function clearBoxes() {\n document.getElementById(\"a\").value = \"\"; \n document.getElementById(\"b\").value = \"\";\n document.getElementById(\"c\").value = \"\";\n}", "function resetAll(){\n\t\t lastNumber = 0;\n\t\t screenNum=\"\";\n\t\t cont = true;\n\t\t numbers = [];\n\t\t symbols = [];\n\t\t mixArray = [];\n\t\t i = 0;\n\t\t tmp = \"\";\n\t\t dotCounter = 0;\n\t}", "function clearAll(board) {\n\tJXG.JSXGraph.freeBoard(board);\n\tboard = JXG.JSXGraph.initBoard('box', {\n\t\tboundingbox : [-5, 8, 8, -5],\n\t\taxis : true,\n\t\tshowCopyright : false\n\t});\n\treturn board;\n}", "function clearBoard() {\r\n for (var i = 0;i< squares.length;i++) {\r\n squares[i].textContent = '';}\r\n }", "function clearBoardRect() {\n wordsAroundNewLetter.length = 0;\n usedRectArray.length = 0;\n m.clear();\n for(j = 0; j < filledBoardRect.length; j++){\n mod = (filledBoardRect[j] % 15);\n qut = Math.floor(filledBoardRect[j] / 15);\n\n if (mod === 0) {\n x = 14 * rectLength + 5;\n y = (qut - 1) * rectBreadth + 210;\n emptyBoardRect(x, y);\n if (filledBoardRect[j] in multiplier) {\n var rectType = multiplier[filledBoardRect[j]];\n if (rectType === '2xLS') {\n ls2(x, y);\n }\n else if (rectType === '3xWS'){\n ws3(x, y)\n }\n }\n }\n else {\n x = (mod - 1) * rectLength + 5;\n y = qut * rectBreadth + 210\n emptyBoardRect(x, y);\n if (filledBoardRect[j] in multiplier) {\n var rectType = multiplier[filledBoardRect[j]];\n if (rectType === '2xLS') {\n ls2(x, y);\n }\n else if (rectType === '3xLS'){\n ls3(x, y)\n }\n else if (rectType === '2xWS'){\n ws2(x, y)\n }\n else if (rectType === '3xWS'){\n ws3(x, y)\n }\n else if (rectType === 'star'){\n getStar(x, y)\n }\n }\n }\n }\n filledBoardRect.length = 0;\n word.length = 0;\n selectLetter = null;\n wordss.length = 0;\n rackPreviousState();\n}", "setEmpty() {\n this.filled = false;\n this.color = null;\n }", "function clearAll(){\r\n\tb1.textContent='';\r\n\tb2.textContent='';\r\n\tb3.textContent='';\r\n\tb4.textContent='';\r\n\tb5.textContent='';\r\n\tb6.textContent='';\r\n\tb7.textContent='';\r\n\tb8.textContent='';\r\n\tb9.textContent='';\r\n}", "function clearAll() {\n CURRENT_STATE = STATES.READY;\n nodesArrays = Array.from(Array(GRID_SIZE_Y), () => new Array(GRID_SIZE_X));\n Graph.clearGraph();\n NodeHandler.createNodeGrid();\n}", "function clearBoard(event) {\n\t\tfor (i = 0; i < squares.length; i++) {\n\t\t\tsquares[i].className = \"col-sm-2 unUsedSquare\";\n\t\t\tsquares[i].style.backgroundColor= \"white\";\n\t\t\tsquares[i].innerHTML=\"\";\n\t\t}\n\t}", "clearSelectedClues() {\n Object.keys(directions).forEach((dir) => {\n let direction = directions[dir];\n Object.keys(this.puzzle[direction]).forEach((number) => {\n for (let i = 0; i < this.puzzle[direction][number].length; i++) {\n this.puzzle[direction][number][i].state = boxState.NORMAL;\n }\n this.clues[direction][number].isSelected = false;\n });\n });\n }", "function resetSquares() {\n for (let i = 1; i <= 9; i++) {\n\n //Resets all game squares to empty\n document.getElementById(`square-${i}`).innerHTML = '';\n }\n //Resets who's turn it is\n document.getElementById(\"game-turn\").innerHTML = \"Your\";\n\n //Shakey!\n shakey();\n\n //Change background back to normal\n document.body.style.backgroundColor = \"darkslategray\";\n}" ]
[ "0.75381696", "0.73891705", "0.738151", "0.73590696", "0.73221654", "0.73040706", "0.71595556", "0.71354365", "0.7122732", "0.7103897", "0.71007913", "0.7097022", "0.7090489", "0.7086114", "0.70860475", "0.7076454", "0.7058642", "0.7058642", "0.7049226", "0.70392424", "0.7003612", "0.69966924", "0.6970933", "0.6955875", "0.69558454", "0.69526845", "0.69423306", "0.6942313", "0.6923853", "0.69210935", "0.6919713", "0.69191957", "0.68798363", "0.6870386", "0.68507206", "0.6840974", "0.6820844", "0.6814842", "0.6809708", "0.6809047", "0.6806288", "0.6803461", "0.6796994", "0.67923754", "0.67876744", "0.67842656", "0.67836213", "0.6783003", "0.6777361", "0.67551523", "0.67546326", "0.67541045", "0.67486125", "0.67437935", "0.6739242", "0.6737398", "0.6737051", "0.6721169", "0.67166436", "0.67112553", "0.67106295", "0.6707486", "0.6704398", "0.67005074", "0.6699627", "0.66932994", "0.6685838", "0.6685705", "0.6685203", "0.66771483", "0.6658901", "0.6656266", "0.66535276", "0.66439223", "0.6643802", "0.66259277", "0.66241455", "0.66199696", "0.66193646", "0.6615454", "0.66138715", "0.6611364", "0.66112834", "0.66019344", "0.6597902", "0.659126", "0.6590661", "0.6589288", "0.658691", "0.6575905", "0.65753204", "0.6574933", "0.6572512", "0.657099", "0.6566533", "0.6556978", "0.6552887", "0.6538195", "0.6537954", "0.6533031" ]
0.6835746
36
A streetview gets loaded for each marker upon a click
function getStreetView(data, status) { if (status == google.maps.StreetViewStatus.OK) { var nearStreetViewLocation = data.location.latLng; var heading = google.maps.geometry.spherical.computeHeading( nearStreetViewLocation, marker.position); var panoramaOptions = { position: nearStreetViewLocation, pov: { heading: heading, pitch: 30 } }; var panorama = new google.maps.StreetViewPanorama( document.getElementById('pano'), panoramaOptions); } else { infowindow.setContent('<div>' + marker.title + '</div>' + '<div>No Street View Found</div>'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadMap(){\n var fenway = {lat: 42.345573, lng: -71.098326};\n \n const map = this.map = new google.maps.StreetViewPanorama(\n document.getElementById('street-view'), {\n position: fenway\n \n });\n }", "function initMap() {\n // Constructor creates a new map - only center and zoom are required.\n map = new google.maps.Map(document.getElementById('map'), {\n //Set center of map\n center: {lat: 38.576661, lng: -121.493637},\n zoom: 13\n }); \n //\n //Create infowindow\n var largeInfowindow = new google.maps.InfoWindow();\n maxWidth: 200;\n //Create bounds that will be displayed on map\n var bounds = new google.maps.LatLngBounds();\n //Loop through our locations and display our markers\n for (var i = 0; i < locations.length; i++) {\n //Get our position from our array of locations\n var content = locations[i].content;\n var title = locations[i].title;\n var position = locations[i].location;\n //Create new markers where their locations are at\n var marker = new google.maps.Marker({\n title: title,\n id: i,\n map: map,\n position: position,\n animation: google.maps.Animation.DROP,\n });\n //Push markers to the map\n //markers.push(marker);\n locations[i].marker = marker;\n //Extend our map to where markers are\n bounds.extend(marker.position);\n //Open infowindow when marker is clicked\n marker.addListener('click', function() {\n populateInfoWindow(this, largeInfowindow);\n toggleBounce(this, marker);\n }) \n\n\n }\n\n //Function to display infowindow\n function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n //Make infowindow close on second click\n infowindow.addListener('closeclick', function() {\n infowindow.setMarker(null);\n })\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(nearStreetViewLocation, marker.position);\n //Possibly set infowindow here?\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' + '<div>No Street View Found!</div');\n }\n \n }\n\n\n //Create wiki url with our search string inside:\n var wikiUrl = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=' + marker.title;\n\n\n //Create ajax request object\n $.ajax({\n url: wikiUrl,\n dataType: \"jsonp\",\n success: function( response ) {\n var wikiStr = response[1];\n var wikipediaURL = 'https://en.wikipedia.org/wiki/' + wikiStr;\n infowindow.setContent('<h2>' + marker.title + '</h2>' + '</div><div id=\"pano\"></div>' + '<p>' + '<a href=\"' + wikipediaURL + '\">' + '</p><p>' + response[2] + '</p>');\n infowindow.open(map, marker);\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n\n },\n error: function(msg) {\n console.log(msg);\n }\n\n });\n }\n\n } \n\n //Fit map to bounds\n map.fitBounds(bounds);\n //Make markers bounce when clicked!\n function toggleBounce(marker) {\n //Create function to animate markers when clicked\n marker.setAnimation(google.maps.Animation.BOUNCE);\n setTimeout(function() {\n marker.setAnimation(google.maps.Animation.null);\n }, 500);\n \n }\n viewModel = new ViewModel();\n //Apply bindings so model will update when events are clicked\n ko.applyBindings(viewModel);\n\n }", "function populateInfoWindow(marker, infowindow, street, city) {\r\n // Check to make sure the infowindow is not already opened on this marker.\r\n if (infowindow.marker != marker) {\r\n infowindow.marker = marker;\r\n infowindow.setContent('');\r\n infowindow.open(map, marker);\r\n // Make sure the marker property is cleared if the infowindow is closed.\r\n infowindow.addListener('closeclick', function() {\r\n infowindow.setMarker = null;\r\n });\r\n\r\n var streetViewService = new google.maps.StreetViewService();\r\n var radius = 50;\r\n var infoContent = '<h4>' + marker.title + '</h4>' +\r\n '<p>' + street + \"<br>\" + city + \"</p>\";\r\n\r\n //create a streetview image code refrenced from udacity course\r\n function getStreetView(data, status) {\r\n if (status == google.maps.StreetViewStatus.OK) {\r\n var nearStreetViewLocation = data.location.latLng;\r\n var heading = google.maps.geometry.spherical.computeHeading(\r\n nearStreetViewLocation, marker.position);\r\n infowindow.setContent(infoContent + '<div id=\"pano\"></div>');\r\n var panoramaOptions = {\r\n position: nearStreetViewLocation,\r\n pov: {\r\n heading: heading,\r\n pitch: 30\r\n }\r\n };\r\n var panorama = new google.maps.StreetViewPanorama(\r\n document.getElementById('pano'), panoramaOptions);\r\n } else {\r\n infowindow.setContent(infoContent +\r\n '<div>No Street View Found</div>');\r\n }\r\n }\r\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\r\n // Open the infowindow on the correct marker.\r\n infowindow.open(map, marker);\r\n }\r\n}", "populateInfoWindow() {\n var infoWindow = viewmodel_1.viewModel.infoWindow;\n var map = viewmodel_1.viewModel.map;\n var self = this;\n initOpenWindow();\n /**\n * Display info when both async requests are fulfilled\n */\n Promise.all([this.streetViewService, this.yelpService])\n .then(() => {\n var content = $('<div id=\"infowindow-content\"><div id=\"pano\"></div></div>');\n content.append(self.yelpData.jquery);\n infoWindow.setContent(content.html()); // DOM manipulation is not done with jquery\n if (this.streetViewData.errorMessage) {\n content.children('#pano').html(this.streetViewData.errorMessage);\n infoWindow.setContent(content.html()); // DOM manipulation is not done with jquery\n }\n else {\n const panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), this.streetViewData.panoramaOptions);\n panorama.setPano(this.streetViewData.pano_id);\n panorama.setVisible(true);\n }\n });\n function initOpenWindow() {\n var content = $('<div id=\"infowindow-content\"><div id=\"pano\">Loading StreetView...</div></div>');\n content.append(self.yelpData.jquery);\n infoWindow.setContent(content.html());\n infoWindow.open(map, self);\n self.setIcon(Marker.highlightedIcon);\n }\n infoWindow.addListener('closeclick', () => {\n this.setIcon(Marker.defaultIcon);\n });\n infoWindow.addListener('position_changed', () => {\n var same = infoWindow.getPosition().equals(this.getPosition());\n if (same) {\n this.setIcon(Marker.highlightedIcon);\n }\n else {\n this.setIcon(Marker.defaultIcon);\n }\n });\n }", "function initMap() {\n //INIT STREET VIEW DATA SERVICE\n panorama = new google.maps.StreetViewPanorama(document.getElementById('street-view'),\n {\n position: {lat: 40.7587018, lng: -73.9849776},\n pov:{heading:heading,pitch:0},\n addressControl: false,\n addressControlOptions: false,\n disableDefaultUI: true,\n clickToGo:false\n });\n rotatePano();\n}", "function setMarkers(location) {\r\n //The markers are inidividually set using a for loop\r\n for (i = 0; i < location.length; i++) {\r\n location[i].holdMarker = new google.maps.Marker({\r\n //Sets the markers on the map within the initialize function\r\n position: new google.maps.LatLng(location[i].lat, location[i].lng),\r\n map: map,\r\n title: location[i].title,\r\n icon: {\r\n url: 'img/marker.png',\r\n size: new google.maps.Size(25, 40),\r\n origin: new google.maps.Point(0, 0),\r\n anchor: new google.maps.Point(12.5, 40)\r\n }\r\n });\r\n\r\n //function to place google street view images within info windows\r\n determineImage();\r\n\r\n var infowindow = new google.maps.InfoWindow({\r\n content: monuments[i].contentString\r\n });\r\n\r\n //Click marker to view infoWindow\r\n //zoom in and center location on click\r\n new google.maps.event.addListener(location[i].holdMarker, 'click', (function(marker, i) {\r\n return function() {\r\n //Binds infoWindow content to each marker\r\n if (location[i].url != undefined) {\r\n location[i].contentString = '<div> <img src=\"' + streetViewImage +\r\n '\" alt=\"Street View Image of ' + location[i].title + '\"><br><hr style=\"margin-bottom: 6px\"><strong>' +\r\n location[i].title + '</strong><br><p>' +\r\n location[i].streetAddress + '<br>' +\r\n location[i].cityAddress + '<br></p><a class=\"web-links\" href=\"' + location[i].url +\r\n '\" target=\"_blank\">' + location[i].url + '</a>' +\r\n '<p>' + location[i].shortDescription +\r\n '</p></div>';\r\n infowindow.setContent(location[i].contentString);\r\n } else {\r\n location[i].contentString = '<div> <img src=\"' + streetViewImage +\r\n '\" alt=\"Street View Image of ' + location[i].title + '\"><br><hr style=\"margin-bottom: 6px\"><strong>' +\r\n location[i].title + '</strong><br><p>' +\r\n location[i].streetAddress + '<br>' +\r\n location[i].cityAddress + '<br></p>' + \"Failed to load wiki Resources\" +\r\n '<p>' + \"Failed to load wiki Resources\" +\r\n '</p></div>';\r\n infowindow.setContent(location[i].contentString);\r\n }\r\n infowindow.open(map, this);\r\n var windowWidth = window.innerWidth;\r\n if (windowWidth <= 1080) {\r\n map.setZoom(14); // change Map zoom with change in window width\r\n } else if (windowWidth > 1080) {\r\n map.setZoom(16);\r\n }\r\n map.setCenter(marker.getPosition());\r\n location[i].picBoolTest = true;\r\n };\r\n })(location[i].holdMarker, i));\r\n }\r\n}", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n // Clear the infowindow content to give the streetview time to load.\n infowindow.setContent('');\n infowindow.marker = marker;\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n //this.marker.setIcon(defaultIcon);\n infowindow.marker = null;\n });\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n // In case the status is OK, which means the pano was found, compute the\n // position of the streetview image, then calculate the heading, then get a\n // panorama from that and set the options\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent('<div>' + marker.title + '</div><div id=\"pano\"></div>');\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' +\n '<div>No Street View Found</div>');\n }\n }\n // Use streetview service to get the closest streetview image within\n // 50 meters of the markers position\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n // Open the infowindow on the correct marker.\n infowindow.open(map, marker);\n }\n}", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n // Clear the infowindow content to give the streetview time to load.\n infowindow.setContent('');\n infowindow.marker = marker;\n infowindow.getMap();\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n //close infowinow\n infowindow.close();\n //on close, stop animation\n marker.setAnimation(null);\n });\n //init stretview service\n var streetViewService = new google.maps.StreetViewService();\n //set radius for streetview\n var radius = 50;\n // In case the status is OK, which means the pano was found, compute the\n // position of the streetview image, then calculate the heading, then get a\n // panorama from that and set the options\n function getStreetView(data, status) {\n //if status is ok\n if (status == google.maps.StreetViewStatus.OK) {\n //set info\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n //populate infowindow with good info\n infowindow.setContent('<div id=\"infowindowinfo\">' + marker.title + ' ' + '<div>URL & Phonenumber:' + ' ' + marker.url + ' - ' + marker.phonenumber +'</div></div><div id=\"pano\"></div>');\n //set options on the panorama\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 15\n }\n };\n //init panorama of location under pano id in infowindow\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n //if status isn't ok. change info window to tell user\n infowindow.setContent('<div>' + marker.title + '</div>' +\n '<div>No Street View Found</div>');\n }\n }\n // Use streetview service to get the closest streetview image within\n // 50 meters of the markers position using radius\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n // Open the infowindow on the correct marker.\n infowindow.open(map, marker);\n marker.addListener('click', function() {\n map.panTo(marker.getPosition());\n });\n\n }\n }", "function initialize() {\n var map;\n var panorama;\n var var_latitude = 39.7715865; // Google Map Latitude\n var var_longitude = 19.997841; // Google Map Longitude\n var pin = 'images/icons/pin.svg';\n\n //Map pin-window details\n var title = \"Hotel Himara - Click to see\";\n var hotel_name = \"Hotel Himara\";\n var hotel_address = \"Lorem ipsum dolor, 25, Himara\";\n var hotel_desc = \"5 star deluxe Hotel\";\n var hotel_more_desc = \"Lorem ipsum dolor sit amet, consectetur.\";\n\n var hotel_location = new google.maps.LatLng(var_latitude, var_longitude);\n var mapOptions = {\n center: hotel_location,\n zoom: 14,\n scrollwheel: false,\n streetViewControl: false,\n styles: [{\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#444444\"\n }]\n }, {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#f5f5f5\"\n }]\n }, {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"saturation\": -100\n }, {\n \"lightness\": 45\n }]\n }, {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"simplified\"\n }]\n }, {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#1dc1f8\"\n }, {\n \"visibility\": \"on\"\n }]\n }]\n };\n\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\n var contentString =\n '<div id=\"infowindow_content\">' +\n '<p><strong>' + hotel_name + '</strong><br>' +\n hotel_address + '<br>' +\n hotel_desc + '<br>' +\n hotel_more_desc + '</p>' +\n '</div>';\n\n var var_infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n var marker = new google.maps.Marker({\n position: hotel_location,\n map: map,\n icon: pin,\n title: title,\n maxWidth: 500,\n optimized: false,\n });\n google.maps.event.addListener(marker, 'click', function() {\n var_infowindow.open(map, marker);\n });\n panorama = map.getStreetView();\n panorama.setPosition(hotel_location);\n panorama.setPov( /** @type {google.maps.StreetViewPov} */ ({\n heading: 265,\n pitch: 0\n }));\n var openStreet = document.getElementById('openStreetView');\n if (openStreet) {\n document.getElementById(\"openStreetView\").onclick = function() {\n toggleStreetView()\n };\n }\n\n function toggleStreetView() {\n var toggle = panorama.getVisible();\n if (toggle == false) {\n panorama.setVisible(true);\n } else {\n panorama.setVisible(false);\n }\n }\n }", "function initMap() {\n var berkeley = {\n lat: 37.869085,\n lng: -122.254775\n };\n var sv = new google.maps.StreetViewService();\n exports.panorama = new google.maps.StreetViewPanorama(\n document.getElementById(\"pano\")\n ); // Set up the map.\n\n exports.map = new google.maps.Map(document.getElementById(\"map\"), {\n center: berkeley,\n zoom: 16,\n streetViewControl: false\n }); // Set the initial Street View camera to the center of the map\n\n sv.getPanorama(\n {\n location: berkeley,\n radius: 50\n },\n processSVData\n ); // Look for a nearby Street View panorama when the map is clicked.\n // getPanorama will return the nearest pano when the given\n // radius is 50 meters or less.\n\n exports.map.addListener(\"click\", function(event) {\n sv.getPanorama(\n {\n location: event.latLng,\n radius: 50\n },\n processSVData\n );\n });\n }", "function getStreetView(data, status) {\r\n if (status == google.maps.StreetViewStatus.OK) {\r\n let nearStreetViewLocation = data.location.latLng;\r\n let heading = google.maps.geometry.spherical.computeHeading(\r\n nearStreetViewLocation, marker.position);\r\n contentString = placeUrl + '<div id=\"pano\" class=\"pano-view\"></div>';\r\n infoWindow.setContent(contentString);\r\n let panoramaOptions = {\r\n position: nearStreetViewLocation,\r\n pov: {\r\n heading: heading,\r\n pitch: 30\r\n }\r\n };\r\n let panorama = new google.maps.StreetViewPanorama(\r\n document.getElementById('pano'), panoramaOptions);\r\n } else {\r\n contentString = placeUrl + '<div>' + marker.title + '</div>' + \r\n '<div>No Street View Found</div>';\r\n infoWindow.setContent(contentString);\r\n }\r\n }", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('<div>' + marker.title + '</div>');\n infowindow.open(map, marker);\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick',function(){\n infowindow.setMarker = null;\n });\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n // In case the status is OK, which means the pano was found, compute the\n // position of the streetview image, then calculate the heading, then get a\n // panorama from that and set the options\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent('<div>' + marker.title + '</div><div id=\"pano\"></div>');\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' +\n '<div>No Street View Found</div>');\n }\n }\n // Use streetview service to get the closest streetview image within\n // 50 meters of the markers position\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n // Open the infowindow on the correct marker.\n infowindow.open(map, marker);\n }\n}", "function setMarkers(location) { // this also can be changed\n\tvar defaultIcon = makeMarkerIcon('0091ff');\n\tvar highlightedIcon = makeMarkerIcon('FFFF24');\n\tfor(i=0; i<location.length; i++) {\n\t\tlocation[i].holdMarker = new google.maps.Marker({\n\t\t\t position: new google.maps.LatLng(location[i].lat, location[i].lng),\n\t\t\t map: map,\n\t\t\t title: location[i].title,\n\t\t\t icon: defaultIcon,\n\t\t\t id: i\n\t\t });\n\t\t //function to place google street view images within info windows\n\t\t determineImage();\n\t\t //Binds infoWindow content to each marker\n\t\t location[i].contentString = '<img src=\"' + streetViewImage +\n\t\t '\" alt=\"Street View Image of ' + location[i].title + '\"><br><hr style=\"margin-bottom: 5px\"><strong>' +\n\t\t location[i].title + '</strong><br><p>' +\n\t\t location[i].streetAddress + '<br>' +\n\t\t location[i].cityAddress + '<br></p><a class=\"web-links\" href=\"http://' + location[i].url + '\" target=\"_blank\">' + location[i].url + '</a>';\n\t\t var infowindow = new google.maps.InfoWindow({\n\t\t\t content: markers[i].contentString\n\t\t });\n\t\t //Click marker to view infoWindow\n\t\t //zoom in and center location on click\n\t\t new google.maps.event.addListener(location[i].holdMarker, 'click', (function(marker, i) {\n\t\t\t return function() {\n\t\t\t\t infowindow.setContent(location[i].contentString);\n\t\t\t\t infowindow.open(map,this);\n\t\t\t\t var windowWidth = $(window).width();\n\t\t\t\t if(windowWidth <= 1080) {\n\t\t\t\t\t map.setZoom(14);\n\t\t\t\t } else if(windowWidth > 1080) {\n\t\t\t\t\t map.setZoom(16);\n\t\t\t\t }\n\t\t\t\t map.setCenter(marker.getPosition());\n\t\t\t\t location[i].picBoolTest = true;\n\t\t\t };\n\t\t })(location[i].holdMarker, i));\n\t\t //Click nav element to view infoWindow\n\t\t //zoom in and center location on click\n\t\t var searchNav = $('#nav' + i);\n\t\t searchNav.click((function(marker, i) {\n\t\t\t return function() {\n\t\t\t\t infowindow.setContent(location[i].contentString);\n\t\t\t\t infowindow.open(map,marker);\n\t\t\t\t map.setZoom(16);\n\t\t\t\t map.setCenter(marker.getPosition());\n\t\t\t\t location[i].picBoolTest = true;\n\t\t\t };\n\t\t })(location[i].holdMarker, i));\n\t }\n}", "function setMarkers(location) {\n\n for(i=0; i<location.length; i++) {\n\n\n location[i].holdMarker = new google.maps.Marker({\n position: new google.maps.LatLng(location[i].lat, location[i].lng),\n map: map,\n title: location[i].title,\n //animation: google.maps.Animation.DROP,\n icon: {\n url: 'img/marker.png',\n size: new google.maps.Size(25, 40),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(12.5, 40)\n },\n shape: {\n coords: [1,25,-40,-25,1],\n type: 'poly'\n }\n //location[i].holdMarker('click', toggleBounce);\n });\n\n //function to animate the marker\n /*function toggleBounce() {\n if (location[i].holdMarker.getAnimation() !== null) {\n location[i].holdMarker.setAnimation(null);\n } else {\n location[i].holdMarker.setAnimation(google.maps.Animation.BOUNCE);\n }\n }*/\n\n\n\n //get google street view images for info windows\n determineImage();\n\n //Binds infoWindow content to each marker\n location[i].contentString = '<img src=\"' + streetViewImage +\n '\" alt=\"Street View Image of ' + location[i].title + '\"><br><hr style=\"margin-bottom: 5px\"><strong>' +\n location[i].title + '</strong><br><p>' +\n location[i].streetAddress + '<br>' +\n location[i].cityAddress + '<br></p><a class=\"web-links\" href=\"http://' + location[i].url +\n '\" target=\"_blank\">' + location[i].url + '</a>';\n\n var infowindow = new google.maps.InfoWindow({\n content: markers[i].contentString\n });\n\n //Click on marker to view infoWindow\n //zoom in and center location on click\n new google.maps.event.addListener(location[i].holdMarker, 'click', (function(marker, i) {\n\n return function() {\n infowindow.setContent(location[i].contentString);\n infowindow.open(map,this);\n var windowWidth = $(window).width();\n if(windowWidth <= 1080) {\n map.setZoom(14);\n } else if(windowWidth > 1080) {\n map.setZoom(16);\n }\n map.setCenter(marker.getPosition());\n //tryng to change the url of the image to animate on click\n //location[i].holdMarker.icon.url = 'img/marker2.png';\n //console.log(location[i].holdMarker.icon.url);\n\n location[i].picBoolTest = true;\n };\n })(location[i].holdMarker, i));\n\n //Click nav element to view infoWindow\n //zoom in and center location on click\n var searchNav = $('#nav' + i);\n searchNav.click((function(marker, i) {\n return function() {\n infowindow.setContent(location[i].contentString);\n infowindow.open(map,marker);\n map.setZoom(16);\n map.setCenter(marker.getPosition());\n location[i].picBoolTest = true;\n };\n })(location[i].holdMarker, i));\n }\n}", "function populateInfoWindow(marker, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n //Make infowindow close on second click\n infowindow.addListener('closeclick', function() {\n infowindow.setMarker(null);\n })\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(nearStreetViewLocation, marker.position);\n //Possibly set infowindow here?\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' + '<div>No Street View Found!</div');\n }\n \n }\n\n\n //Create wiki url with our search string inside:\n var wikiUrl = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=' + marker.title;\n\n\n //Create ajax request object\n $.ajax({\n url: wikiUrl,\n dataType: \"jsonp\",\n success: function( response ) {\n var wikiStr = response[1];\n var wikipediaURL = 'https://en.wikipedia.org/wiki/' + wikiStr;\n infowindow.setContent('<h2>' + marker.title + '</h2>' + '</div><div id=\"pano\"></div>' + '<p>' + '<a href=\"' + wikipediaURL + '\">' + '</p><p>' + response[2] + '</p>');\n infowindow.open(map, marker);\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n\n },\n error: function(msg) {\n console.log(msg);\n }\n\n });\n }\n\n }", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n // pan to the position of the marker\n offsetCenter(marker.getPosition(), 0, -70);\n // bounce the map marker\n marker.setAnimation(google.maps.Animation.BOUNCE);\n // set a timeout for the map marker to stop bouncing after 2 seconds\n setTimeout(function() {\n marker.setAnimation(google.maps.Animation.null);\n }, 2000);\n // Clear the infowindow content to give the streetview time to load.\n infowindow.setContent('');\n infowindow.marker = marker;\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n\n var streetViewService = new google.maps.StreetViewService();\n var radius = 500;\n\n\n // In case the status is OK, which means the pano was found, compute the\n // position of the streetview image, then calculate the heading, then get a\n // panorama from that and set the options\n var _getStreetView = function(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30 // will have us looking slightly up at the building\n }\n };\n // if streetview image is found, create a panorama and put it in the div with id pano\n // else put in error message\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' +\n '<div>Request to Google places to get streetview failed</div>');\n }\n };\n\n // Use streetview service to get the closest streetview image within\n // 50 meters of the markers position\n // get streetview is the callback to getpanoramabylocation\n var _populateStreetView = function () {\n streetViewService.getPanoramaByLocation(marker.position, radius, _getStreetView);\n // Open the infowindow on the correct marker.\n infowindow.open(map, marker);\n };\n\n var infoWindowContentString = '<div class=\"title\">' + marker.title + '</div>';\n\n // do an ajax request and wiki links for the city to display in infowindow\n //Wikipedia links\n\n var wikiUrl = 'http://en.wikipedia.org/w/api.php?action=opensearch&search=' + marker.title +\n '&format=json&callback=wikiCallback';\n $.ajax({\n url: wikiUrl,\n dataType: \"jsonp\"\n })\n .done(function(response) {\n var articleList = response[1];\n infoWindowContentString += '<div class=\"wikipedia-container\">' +\n '<h5>Relevant Wikipedia Links about this location </h5>' + '<ul class=\"wikipedia-links\">';\n\n for (var i = 0; i < Math.min(articleList.length, 4); i++) {\n var articleStr = articleList[i];\n var url = 'http://en.wikipedia.org/wiki/' + articleStr;\n infoWindowContentString += '<li><a class=\"wikipedia-links text-center\" target=\"_blank\" href=\"' + url + '\">' + articleStr + '</a></li>';\n }\n infoWindowContentString += '</ul></div>';\n infoWindowContentString += '<div id=\"pano\"></div>';\n infowindow.setContent(infoWindowContentString);\n _populateStreetView();\n\n }).fail(function(jqXHR, textStatus) {\n console.log(\"Error getting info from wikipedia: \" + textStatus);\n infoWindowContentString += '<div class=\"wikipedia-container\">' +\n '<h5>Could not get wikipedia locations for' + marker.title + '</h5></div>';\n infoWindowContentString += '<div id=\"pano\"></div>';\n infowindow.setContent(infoWindowContentString);\n _populateStreetView();\n });\n }\n}", "function setView() {\n places = JSON.parse(localStorage.getItem('places'));\n if (places) {\n for (var p of places) {\n var marker = L.marker(p.lokasi).addTo(mymap).bindPopup(p.sponsor);\n marker.on('click', showLocation);\n }\n }\n}", "loadMapView() {\n this._qs(\".map\").addEventListener(\"click\", () => this.mapView());\n }", "function getStreetView(data, status) {\r\n if (status == google.maps.StreetViewStatus.OK) {\r\n var nearStreetViewLocation = data.location.latLng;\r\n var heading = google.maps.geometry.spherical.computeHeading(\r\n nearStreetViewLocation, marker.position);\r\n //setting the infowindow with both street view panorama and the wikipedia link.\r\n infowindow.setContent('<div>' + marker.title + '</div><hr><div id=\"pano\"></div><div><a href=' + marker.wikiurl + '> Click here for more info </a></div>');\r\n var panoramaOptions = {\r\n position: nearStreetViewLocation,\r\n pov: {\r\n heading: heading,\r\n pitch: 30\r\n }\r\n };\r\n var panorama = new google.maps.StreetViewPanorama(\r\n document.getElementById('pano'), panoramaOptions);\r\n } else {\r\n infowindow.setContent('<div>' + marker.title + '</div>' +\r\n '<div>No Street View Found</div>');\r\n }\r\n }", "function getStreetView(data, status) {\r\n if (status == google.maps.StreetViewStatus.OK) {\r\n var nearStreetViewLocation = data.location.latLng;\r\n var heading = google.maps.geometry.spherical.computeHeading(\r\n nearStreetViewLocation, pointer.position);\r\n //setcontent to location title and wikipedia url\r\n detailwindow.setContent('<div>' + pointer.title + '</div><br><a href =\"' + articleUrl + '\">' + articleUrl + '</a><hr><div id=\"detail\"></div>');\r\n var wideviewOptions = {\r\n position: nearStreetViewLocation,\r\n pov: {\r\n heading: heading,\r\n pitch: 20\r\n }\r\n };\r\n var wideview = new google.maps.StreetViewPanorama(\r\n document.getElementById('detail'), wideviewOptions);\r\n } else {\r\n // streetview unavailable\r\n detailwindow.setContent('<div>' + pointer.title + '</div>' +\r\n '<div>No Street View Found</div>');\r\n }\r\n //open detailwindow on that pointer\r\n detailwindow.open(map, pointer);\r\n }", "function setMarkers(places) {\n var i;\n infowindow = new google.maps.InfoWindow();\n for (i = 0; i < places.length; i++) {\n places[i].holdmarker = new google.maps.Marker({\n position: new google.maps.LatLng(markers[i].lat, markers[i].lng),\n map: map,\n animation: google.maps.Animation.DROP,\n title: markers[i].title,\n clickable: true\n });\n\n //this is to add a click event handler for click the marker and show info window\n google.maps.event.addListener(places[i].holdmarker, 'click', (function(marker, i) {\n return function() {\n infowindow.setContent('<img src=\"http://maps.googleapis.com/maps/api/streetview?' +\n 'size=200x150&location=' + places[i].streetAddress + ', ' + places[i].cityAddress +\n '\" alt=\"Street View Image of ' + places[i].title + '\"><br><hr style=\"margin-bottom: 5px\"><strong>' +\n places[i].title + '</strong><br><p>' +\n places[i].streetAddress + '<br>' +\n places[i].cityAddress + '<br></p><a class=\"web-links\" href=\"http://' + places[i].url +\n '\" target=\"_blank\">' + places[i].url + '</a>');\n infowindow.open(map, places[i].holdmarker);\n markers[i].holdmarker.setAnimation(google.maps.Animation.BOUNCE);\n map.panTo(markers[i].holdmarker.getPosition());\n map.setZoom(16);\n setTimeout(function() {\n markers[i].holdmarker.setAnimation(null);\n }, 700);\n };\n })(marker, i));\n\n //this is to add a click event lisentner to the search result text----not used\n /*$('#search_result').on('click', '#nav' + i, (function(marker, i) {\n return function() {\n \tgoogle.maps.event.trigger(markers[i].holdmarker,'click');\n }\n })(marker, i));*/\n }\n\n\n}", "function highlight(position){\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'),{\n position: {\n lat: position.lat(),\n lng: position.lng()\n },\n pov: {\n heading: 34,\n pitch: 10\n }\n }\n );\n map.setStreetView(panorama);\n\n}", "function populateInfoWindow(marker, infowindow) {\r\n // Check to make sure the infowindow is not already opened on this marker.\r\n if (infowindow.marker != marker) {\r\n // Clear the infowindow content to give the streetview time to load.\r\n infowindow.setContent('');\r\n infowindow.marker = marker;\r\n // Make sure the marker property is cleared if the infowindow is closed.\r\n infowindow.addListener('closeclick', function() {\r\n infowindow.marker = null;\r\n });\r\n var streetViewService = new google.maps.StreetViewService();\r\n var radius = 500;\r\n // In case the status is OK, which means the pano was found, compute the\r\n // position of the streetview image, then calculate the heading, then get a\r\n // panorama from that and set the options\r\n function getStreetView(data, status) {\r\n if (status == google.maps.StreetViewStatus.OK) {\r\n var nearStreetViewLocation = data.location.latLng;\r\n var heading = google.maps.geometry.spherical.computeHeading(\r\n nearStreetViewLocation, marker.position);\r\n //setting the infowindow with both street view panorama and the wikipedia link.\r\n infowindow.setContent('<div>' + marker.title + '</div><hr><div id=\"pano\"></div><div><a href=' + marker.wikiurl + '> Click here for more info </a></div>');\r\n var panoramaOptions = {\r\n position: nearStreetViewLocation,\r\n pov: {\r\n heading: heading,\r\n pitch: 30\r\n }\r\n };\r\n var panorama = new google.maps.StreetViewPanorama(\r\n document.getElementById('pano'), panoramaOptions);\r\n } else {\r\n infowindow.setContent('<div>' + marker.title + '</div>' +\r\n '<div>No Street View Found</div>');\r\n }\r\n }\r\n // Use streetview service to get the closest streetview image within\r\n // 50 meters of the markers position\r\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\r\n // Open the infowindow on the correct marker.\r\n infowindow.open(map, marker);\r\n }\r\n }", "function getStreetView(data, status) {\n //if status is ok\n if (status == google.maps.StreetViewStatus.OK) {\n //set info\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n //populate infowindow with good info\n infowindow.setContent('<div id=\"infowindowinfo\">' + marker.title + ' ' + '<div>URL & Phonenumber:' + ' ' + marker.url + ' - ' + marker.phonenumber +'</div></div><div id=\"pano\"></div>');\n //set options on the panorama\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 15\n }\n };\n //init panorama of location under pano id in infowindow\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n //if status isn't ok. change info window to tell user\n infowindow.setContent('<div>' + marker.title + '</div>' +\n '<div>No Street View Found</div>');\n }\n }", "function showMarkers() {\n\n setAllMap(map);\n\n}", "initMap() {\n // creates InfoWindow to open\n let infowindow = new window.google.maps.InfoWindow();\n let bounds = new window.google.maps.LatLngBounds();\n\n const map = new window.google.maps.Map(document.getElementById('map'), {\n center: {lat: 44.388861, lng: -68.798958},\n zoom: 15\n\n });\n const gblMarkers = [];\n\n // display venues \n this.state.venues.forEach(locVenue => {\n // display venue name in window\n let venueName = `${locVenue.venue.name}`;\n \n // displays markers with Animation\n let marker = new window.google.maps.Marker({\n position: {lat: locVenue.venue.location.lat, lng: locVenue.venue.location.lng},\n map: map,\n\n animation: window.google.maps.Animation.BOUNCE,\n animation: window.google.maps.Animation.DROP,\n title: locVenue.venue.name,\n address: locVenue.venue.location.address,\n id: locVenue.venue.id,\n\n });\n\n // click on marker to display infowindow\n //old-marker.addListener('click', function(event) {\n //old-console.log('click event?', event);\n // change the content\n //0ld-infowindow.setContent(venueName);\n let info_Window = '<div class=\"info_window\">' +\n '<h6>' + locVenue.venue.name + '</h6>' +\n //infowindow.setContent(venueName);\n '<p>' + locVenue.venue.location.formattedAddress[0] + '</p>' +\n '<p>' + locVenue.venue.location.formattedAddress[1] + '</p>' +\n '</div>'\n marker.addListener('click', function(event) {\n console.log('click event?', event);\n if (marker.getAnimation() !== null) { marker.setAnimation(null); }\n else { marker.setAnimation(window.google.maps.Animation.BOUNCE); }\n setTimeout(() => { marker.setAnimation(null) }, 1000);\n });\n window.google.maps.event.addListener(marker, 'click', () => {\n infowindow.setContent(info_Window);\n map.setZoom(16);\n map.setCenter(marker.position);\n infowindow.open(this.map, marker);\n //map.panBy(0, -125);\n });\n \n gblMarkers.push(marker);\n // info_windows.push({ id: venue.id, name: venue.name, contents: infowindow});\n \n //old-infowindow.open(map, marker);\n });\n // Extend boundry on map for each marker\n //bounds.extend(marker.position);\n //old-gblMarkers.push(marker);\n //old-})\n // makes map fit to boundry\n //map.fitBounds(bounds);\n this.setState({ gblMarkers });\n }", "function setMarkers(location) {\n\n for (i = 0; i < location.length; i++) {\n location[i].holdMarker = new google.maps.Marker({\n position: new google.maps.LatLng(location[i].lat, location[i].lng),\n map: map,\n title: location[i].title,\n animation: google.maps.Animation.DROP\n });\n\n\n\n //Get Google Street View image\n\n var streetViewImage;\n var streetViewUrl = 'https://maps.googleapis.com/maps/api/streetview?size=180x90&location=';\n\n streetViewImage = streetViewUrl + location[i].lat + ',' + location[i].lng;\n\n //call weather API\n var currentTemperature;\n var contentString;\n\n $.ajax({\n // async: false,\n url: \"http://api.openweathermap.org/data/2.5/weather?lat=\" + location[i].lat + \"&lon=\"+ location[i].lng+\"&APPID=0d38d2be30cd0730296b1f76cfdc3159\",\n success: function(data) {\n console.log(\"data async\", data);\n currentTemperature = data.main.temp;\n }\n });\n\n\n location[i].contentString = '<img src=\"' + streetViewImage +\n '\" alt=\"Street View Image of ' + location[i].title + '\"><br><hr style=\"margin-bottom: 5px\"><strong>' +\n location[i].title + '</strong><p>' +\n '<br> current temp:' + currentTemperature +\n '<br>' + location[i].cityAddress + '<br></p><a class=\"web-links\" href=\"http://' + location[i].url +\n '\" target=\"_blank\">' + location[i].url + '</a>';\n\n\n //call street view function\n var infowindow = new google.maps.InfoWindow({\n content: markers[i].contentString\n });\n\n //view infoWindow\n new google.maps.event.addListener(location[i].holdMarker, 'click', (function(marker, i) {\n return function() {\n infowindow.setContent(location[i].contentString);\n infowindow.open(map, this);\n var windowWidth = $(window).width();\n location[i].picBoolTest = true;\n };\n })(location[i].holdMarker, i));\n\n\n google.maps.event.addListener(location[i].holdMarker, 'click', clickListener);\n\n var bouncingMarker = null;\n\n var clickListener = function() {\n if(bouncingMarker)\n bouncingMarker.setAnimation(null);\n if(bouncingMarker != this) {\n this.setAnimation(google.maps.Animation.BOUNCE);\n bouncingMarker = this;\n } else\n bouncingMarker = null;\n }\n\n //Click nav element to view infoWindow\n var searchNav = $('#loc' + i);\n searchNav.click((function(marker, i) {\n return function() {\n infowindow.setContent(location[i].contentString);\n infowindow.open(map, marker);\n location[i].picBoolTest = true;\n };\n })(location[i].holdMarker, i));\n }\n}", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker == marker) {\n return;\n } else if (infowindow.marker) {\n // Unhighlight the previous listing\n unsetIcon(infowindow.marker);\n }\n infowindow.addContent = function(stuff) {\n infowindow.setContent(infowindow.getContent() + stuff);\n }\n\n // Highlight the current listing\n setIcon(marker);\n\n infowindow.marker = marker;\n var title = '<h2>' + marker.title + '</h2><br>';\n\n // Make sure the marker is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n // Unhighlight the listing\n unsetIcon(infowindow.marker);\n infowindow.marker = null;\n });\n\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n\n // In case the status is OK, which means the pano was found, compute the\n // position of the streetview image, then calculate the heading, then get a\n // panorama from that and set the options\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var loc = marker.position;\n var imgUrl = 'http://maps.googleapis.com/maps/api/streetview'+\n '?size=600x400&location='+loc.lat()+','+loc.lng();\n var panorama = '<img class=\"image\" alt=\"'+marker.title+'\" src=\"'+\n imgUrl+'\" /><br>';\n\n /* ---------- NOTE ----------\n * I reused existing code to show an streetview image instead of a\n * panorama\n * ---------- NOTE ---------- */\n infowindow.setContent(title + panorama);\n } else {\n infowindow.setContent(title +\n '<div class=\"text\">No Image Found</div><br>');\n }\n };\n wikiArtcl(marker.title, infowindow);\n\n // Use streetview service to get the closest streetview image within\n // 50 meters of the markers pposition.\n streetViewService.getPanoramaByLocation(\n marker.position, radius, getStreetView);\n // Open the infowindow on the correct marker.\n infowindow.open(map, marker);\n}", "function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var loc = marker.position;\n var imgUrl = 'http://maps.googleapis.com/maps/api/streetview'+\n '?size=600x400&location='+loc.lat()+','+loc.lng();\n var panorama = '<img class=\"image\" alt=\"'+marker.title+'\" src=\"'+\n imgUrl+'\" /><br>';\n\n /* ---------- NOTE ----------\n * I reused existing code to show an streetview image instead of a\n * panorama\n * ---------- NOTE ---------- */\n infowindow.setContent(title + panorama);\n } else {\n infowindow.setContent(title +\n '<div class=\"text\">No Image Found</div><br>');\n }\n }", "function detailedAnnotationSelected(event)\r\n{\r\n let latitude = parseFloat(this.geo.latitude);\r\n let longitude = parseFloat(this.geo.longitude);\r\n\r\n let coordinate = new mapkit.Coordinate(latitude, longitude);\r\n\r\n map.setCenterAnimated(coordinate, true);\r\n\r\n element(\"information\").style.visibility = \"visible\";\r\n\r\n element(\"venueTitle\").innerHTML = this.name;\r\n element(\"venueDescription\").innerHTML = this.info;\r\n\r\n if(this.contact)\r\n {\r\n if(this.contact.web)\r\n {\r\n element(\"linkVenueWebsite\").href = this.contact.web;\r\n }\r\n\r\n if(this.contact.email)\r\n {\r\n element(\"linkVenueMail\").href = \"mailto:\" + this.contact.email;\r\n }\r\n\r\n if(this.contact.phone)\r\n {\r\n element(\"linkVenuePhone\").href = \"phone:\" + this.contact.phone;\r\n }\r\n }\r\n}", "function showMarkers() {\n setMapOnAll(map);\n \n }", "function getStreetView(data, status) {\n\n if (status == google.maps.StreetViewStatus.OK) {\n\n setModal();\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('panorama-content'), panoramaOptions);\n\n $('.place-title').text(marker.title);\n } else {\n $('.place-title').text('No Street View Found');\n }\n }", "function populateInfoWindow(marker, wikiArticles, infowindow) {\n if (infowindow.marker != marker) {\n infowindow.marker = marker;\n infowindow.setContent('');\n infowindow.addListener('closeclick', function() {\n infowindow.setMarker = null;\n });\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n\n // Function to getStreetView details and set the InfoWindow content.\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent('<div>' + '<h3>' + marker.title + '</h3>' + '<h4>Relevant Wikipedia Articles</h4>' + wikiArticles + '</div><div id=\"pano\"></div>');\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '<div>' + '<div>No Street View Found</div>');\n }\n }\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n infowindow.open(map, marker);\n }\n}", "function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent('<div>' + marker.title +'</div><div id=\"pano\"></div>');\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' +\n '<div>No Street View Found</div>');\n }\n }", "function launchMap() {\n var myLocation = {\n lat: 31.2397,\n lng: 121.4998\n };\n var map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: 31.2397,\n lng: 121.4998\n },\n zoom: 14\n });\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), {\n position: myLocation,\n pov: {\n heading: 34,\n pitch: 10\n }\n });\n map.setStreetView(panorama);\n}", "function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent('<div>' + marker.title + '</div><div id=\"pano\"></div>');\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' +\n '<div>No Street View Found</div>');\n }\n }", "function getStreetView(data, status) {\r\n if (status == google.maps.StreetViewStatus.OK) {\r\n var nearStreetViewLocation = data.location.latLng;\r\n var heading = google.maps.geometry.spherical.computeHeading(nearStreetViewLocation, marker.position);\r\n\r\n infowindow.setContent('<div>' + marker.title + '</div><div id=\"pano\"></div>');\r\n var panoramaOptions = {\r\n position: nearStreetViewLocation,\r\n pov: {\r\n heading: heading,\r\n pitch: 30\r\n }\r\n };\r\n var panorama = new google.maps.StreetViewPanorama(\r\n document.getElementById('pano'), panoramaOptions);\r\n } else {\r\n infowindow.setContent('<div>' + marker.title + '</div>' +\r\n '<div>No Street View Found</div>');\r\n }\r\n }", "function viewSuccess(lat, lng, eggId) {\n $.ajax({\n url: ajaxLocation+\"viewEgg.php\",\n data: {\n userId: user.id,\n eggId: eggId\n },\n type: \"post\",\n success: function(result) {\n }\n });\n\n $(\".tabs\").hide();\n $(\".eggViewer .eggViewerGift\").attr(\"style\",\"background-image: url('data:image/jpeg;base64,\"+gift+\"');\");\n var viewLocation = new google.maps.LatLng(lat, lng);\n var viewOptions = {\n zoom: 16,\n center: viewLocation,\n mapTypeId: that.mapTypeId,\n draggable: false,\n scrollwheel: false,\n panControl: false,\n disableDefaultUI: that.disableDefaultUI\n }\n var viewMap = new google.maps.Map(document.getElementById('eggViewerMap'), viewOptions);\n var viewMe = new google.maps.Marker({\n position: viewLocation,\n map: viewMap,\n optimized: false,\n zIndex: 99999,\n icon: 'img/smallMapsIcon.png',\n title: 'Your position!'\n });\n collectionSwiper.swipeTo(2);\n }", "function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n\n // heading variable controls the initial pitch of streetview\n var heading = google.maps.geometry.spherical.computeHeading(nearStreetViewLocation, marker.position);\n infoWindow.setContent('<div class=\"marker-title\">' + marker.title + '</div><div id=\"pano\"></div>');\n\n // Set the properties of streetview\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 10\n }\n };\n // Create the streetview panorama that appears in the infoWindow\n var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);\n } else {\n infoWindow.setContent('<div>' + marker.title + '</div>' + '<div>No Street View Found</div>');\n }\n }", "function ShowMarkerInfo(data){\n\t$(\".contentDetailsImage\").attr(\"src\", \"\");\n\tif($(\"#map\").hasClass(\"col-xs-10\")){\n\t\t$(\"#map\").removeClass(\"col-xs-10\");\n\t\t$(\"#map\").addClass(\"col-xs-8\");\n\t\t$(\".contentDetails\").addClass(\"col-xs-2\");\n\t\t$(\".contentDetails\").show();\n\t\tgoogle.maps.event.trigger(map, 'resize')\n\t}\n\t\n\t// get the image of the location\n\t$(\".contentDetailsImage\").attr(\"src\",\"https://maps.googleapis.com/maps/api/streetview?size=600x300&location=\"+data.lat+\",\"+data.lng+\"&fov=120&heading=235&pitch=10&key=AIzaSyCg219BZX5-sVkO5423wOAIwRF_OxW7F8E\"); \n\n\t// get the route of the location\n\t$(\".contentDetailsRoute\").html(data.directions);\n}", "fetchStreetView() {\n var SS = new streetview_service_1.StreetViewService();\n this.streetViewService = SS.injectPanorama(this)\n .then((result) => {\n this.streetViewData.pano_id = result.pano_id;\n this.streetViewData.panoramaOptions = result.panoramaOptions;\n })\n .catch(error => {\n this.streetViewData.errorMessage = 'No Street View Found';\n });\n }", "function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent('<div>' + marker.title + '</div><div id=\"pano\"></div>');\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' +\n '<div>No Street View Found</div>');\n }\n }", "function showMarkers() {\n setMapOnAll(ourMap);\n}", "function showStreetView(feature) {\n var panoramaOptions = {\n position: feature.position,\n zoom: 1,\n pov: {\n heading: feature.heading,\n pitch: 0,\n zoom: 1\n },\n visible: true\n };\n var panorama = new google.maps.StreetViewPanorama(document.getElementById(\"dialog-sw-canvas\"), panoramaOptions);\n\n map.setStreetView(panorama);\n $(\"#dialog-sw-canvas\").dialog(\"open\");\n google.maps.event.trigger(panorama,'resize');\n }", "function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent('<div>' + '<h3>' + marker.title + '</h3>' + '<h4>Relevant Wikipedia Articles</h4>' + wikiArticles + '</div><div id=\"pano\"></div>');\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '<div>' + '<div>No Street View Found</div>');\n }\n }", "function mattapanCenterView() {\n $('button#load-mattapan-view').on('click', function (event) {\n event.preventDefault()\n event.stopPropagation()\n map.setView([42.26722962533316,-71.09355255306583], 15);\n resetAddressForm()\n $('#geocode-label').hide()\n resetAddressForm()\n })\n}", "function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent('<div>' + marker.title + '</div><div id=\"pano\"></div>');\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' +\n '<div>No Street View Found</div>');\n }\n }", "function showMarkers() {\n setAllMap(map);\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: locations[0].lon,\n lng: locations[0].lat\n },\n zoom: 8\n });\n infowindow = new google.maps.InfoWindow({\n content: '<div class=\"info\">loading...</div>'\n });\n\n // I'm making this function for marker click because JShint.com don't recommend making a function\n // inside a for loop\n markerClick = function() {\n AppViewModel.showInfo(this);\n };\n //let's loop through the array to add location and marks and info and event listener\n for (var i = 0; i < AppViewModel.allLocations().length; i++) {\n marker[i] = new google.maps.Marker({\n map: map,\n animation: google.maps.Animation.DROP,\n position: {\n lat: locations[i].lon,\n lng: locations[i].lat\n }\n });\n google.maps.event.addListener(marker[i], 'click', markerClick);\n }\n}", "function showMarkers() {\r\n setMapOnAll(map);\r\n }", "function cityMap() {\n var mapProp = {\n center: new google.maps.LatLng(43.720448, 10.392116),\n zoom: 14,\n disableDefaultUI: true\n };\n map = new google.maps.Map(document.getElementById(\"city_map\"),\n mapProp);\n route_planned = false;\n last_content = Array(svm.length)\n addVmMarkers();\n}", "function showMarkers() {\r\n setMapOnAll(map);\r\n}", "function setMarkers(map) {\n\n // defines the clickable region of the icon\n // no real use yet\n // var shape = {\n // coords: [1, 1, 1, 20, 18, 20, 18, 1],\n // type: 'poly'\n // };\n\n for (var i=0; i<pins.length; i++) {\n // object (one pin)\n var pin = pins[i];\n\n var status = pin.fields.status;\n\n if (status === 'Barrier')\n var url = '/static/img/map-marker-barrier.png';\n else if (status === 'In Progress')\n var url = '/static/img/map-marker-in-progress.png';\n else if (status === 'Resolved')\n var url = '/static/img/map-marker-resolved.png';\n else if (status === 'Best Practice')\n var url = '/static/img/map-marker-best-practice.png';\n else\n var url = '/static/img/map-marker.png';\n\n var image = {\n url: url\n // size: new google.maps.Size(20, 32),\n // origin: new google.maps.Point(0, 0),\n // anchor: new google.maps.Point(0, 32)\n };\n\n if (pin.fields.address != null)\n var address = pin.fields.address;\n else\n var address = '';\n\n if (pin.fields.date_updated != null)\n var date = pin.fields.date_updated;\n else\n var date = '';\n\n // data of a detailed window\n var contentString = '<div id=\"content\" style=\"color: black\">'+\n '<div id=\"siteNotice\">'+\n '</div>'+\n '<h1 id=\"firstHeading\" class=\"firstHeading\">' + pin.fields.tag + '</h1>'+\n '<div id=\"bodyContent\">'+\n '<div><b>Status: </b>'+ status +'</div>'+\n '<div><b>Description: </b>'+ pin.fields.description +'</div>'+\n '<div><b>Address: </b>'+ address +'</div>'+\n '<div><b>Date created: </b>'+ pin.fields.date_created.slice(0,10) + \" \" + pin.fields.date_created.slice(11,19) +'</div>'+\n '<div><b>Date updated: </b>'+ date.slice(0,10) + \" \" + date.slice(11,19) +'</div>'+\n '<div><a href=\"/pins/' + (i+1) + '\">See more</a>' +\n '</div>'+\n '</div>';\n\n var infowindow = new google.maps.InfoWindow({\n content: contentString,\n maxWidth: 450\n });\n\n // creating the marker\n var marker = new google.maps.Marker({\n position: {\n lat: pin.fields.location_latitude, \n lng: pin.fields.location_longitude\n },\n map: map,\n icon: image,\n infowindow: infowindow,\n // shape: shape,\n // title: pin[0],\n zIndex: i // determines which pin is on top if they overlap\n });\n\n // listener for clicking on a pin\n marker.addListener('click', function() {\n this.infowindow.open(map, this);\n });\n\n\n }\n}", "function populateInfoWindow(marker, infowindow) {\n // Check to make sure the infowindow is not already opened on this marker.\n if (infowindow.marker != marker) {\n // Clear the infowindow content to give the streetview time to load.\n infowindow.setContent('');\n infowindow.marker = marker;\n // Make sure the marker property is cleared if the infowindow is closed.\n infowindow.addListener('closeclick', function() {\n infowindow.marker = null;\n });\n var streetViewService = new google.maps.StreetViewService();\n var radius = 50;\n // In case the status is OK, which means the pano was found, compute the\n // position of the streetview image, then calculate the heading, then get a\n // panorama from that and set the options\n function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent('<div>' + marker.title + '</div><div id=\"pano\"></div>');\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>' + marker.title + '</div>' +\n '<div>No Street View Found</div>');\n }\n }\n // Use streetview service to get the closest streetview image within\n // 50 meters of the markers position\n streetViewService.getPanoramaByLocation(marker.position, radius, getStreetView);\n // Open the infowindow on the correct marker.\n infowindow.open(map, marker);\n }\n }", "function getStaticStreetView(current_lat_lng_pair,street_div, bearing){\n //const fetch_refresh_link = `https://maps.googleapis.com/maps/api/streetview?size=400x400&location=${current_lat_lng_pair[\"lat\"]},${current_lat_lng_pair[\"lng\"]}&fov=90&heading=${bearing}&pitch=0&key=APIKEY`;\n const fetch_refresh_link = \"https://course-preview-s20.herokuapp.com/static_street_view/latitude=\"+current_lat_lng_pair.lat+\"&longitude=\"+current_lat_lng_pair.lng+\"&heading=\"+bearing;\n fetch(fetch_refresh_link).then(res=>{\n //Returns the promise\n return(res.json());\n }).then(res => {\n //Extract the data returne dfrom the promise and convert it into a image\n street_div.setAttribute(\"src\", \"data:image/png;base64, \" + res.image);\n }).catch(error => console.log(\"street view\",error));\n }", "function cervantesAnnotationSelected(event)\r\n{\r\n let coordinate = new mapkit.Coordinate(this.spatial.latitude, this.spatial.longitude);\r\n map.setCenterAnimated(coordinate, true);\r\n\r\n element(\"information\").style.visibility = \"visible\";\r\n\r\n element(\"venueTitle\").innerHTML = this.title;\r\n element(\"venueDescription\").innerHTML = this.description;\r\n}", "function showHotelOverlays() {\n if (markersArray) {\n for (var i in markersArray) {\n markersArray[i].setMap(gmap);\n }\n }\n}", "function showOverlays()\n{\n setAllMap(map);\n}", "function showMarkers() {\n\t\t\t \n\t\t\t setAllMap(map);\n\t\t\t\n\t\t\t}", "function showMarkers() {\n setAllMap(map);\n}", "function showMarkers() {\n setAllMap(map);\n}", "function showMarkers() {\n setAllMap(map);\n}", "function showMarkers() {\n setMapOnAll(mapa);\n}", "function showMarkers() {\r\n setMapOnAll(map);\r\n}", "function showMarkers() {\r\n setMapOnAll(map);\r\n}", "function showMarkers() {\r\n setMapOnAll(map);\r\n}", "function initMap() {\n\t//Create Location\n\tconst location = { lat: 40.74969014236962, lng: -73.98567608474801 };\n\t//Create Map\n\tconst map = new google.maps.Map({\n\t\tcenter: location,\n\t\tzoom: 16,\n\t\tgestureHandling: \"cooperative\",\n\t\tzoomControl: false,\n\t});\n\t//Create Panorama\n\tconst panorama = new google.maps.StreetViewPanorama(\n\t\tdocument.getElementById(\"panorama\"),\n\t\t{\n\t\t\tposition: location,\n\t\t\tpov: {\n\t\t\t\theading: 100000000,\n\t\t\t\tpitch: 0,\n\t\t\t},\n\t\t}\n\t);\n\n\t//Create icons\n\tconst iconBase =\n\t\t\"https://developers.google.com/maps/documentation/javascript/examples/full/images/\";\n\tconst icons = {\n\t\tinfo: {\n\t\t\ticon: iconBase + \"info-i_maps.png\",\n\t\t},\n\t};\n\tconst features = [\n\t\t{\n\t\t\tposition: new google.maps.LatLng(-33.91721, 151.2263),\n\t\t\ttype: \"info\",\n\t\t},\n\t];\n\n\t// Create markers.\n\t/* for (let i = 0; i < features.length; i++) {\n\t\tnew google.maps.Marker({\n\t\t\tposition: features[i].position,\n\t\t\ticon: icons[features[i].type].icon,\n\t\t\tmap: map,\n\t\t});\n\t} */\n\tmap.StreetViewPanorama(panorama);\n}", "function showMarkers() {\n setAllMap(map);\n }", "function addtoDetailWindow(pointer, detailwindow) {\r\n //intialzing streetviewservice\r\n var streetViewService = new google.maps.StreetViewService();\r\n //wikipedia api//\r\n //var articleurl for wkipedia link\r\n var articleUrl;\r\n //request for wiki api\r\n var wikiURL = 'https://en.wikipedia.org/w/api.php?action=opensearch&search=' + pointer.title + '&format=json&callback=wikiCallback';\r\n //wikipedia timeout if it takes more than 8 seconds\r\n var wikiTimeout = setTimeout(function() {\r\n alert(\"failed to load wikipedia page\");\r\n }, 10000);\r\n //ajax request\r\n $.ajax({\r\n url: wikiURL,\r\n dataType: \"jsonp\"\r\n //jsnop datatype\r\n }).done(function(response) {\r\n //timeout is cleared if wikipedia link is loaded successfully\r\n clearTimeout(wikiTimeout);\r\n //response from wikipedia api\r\n articleUrl = response[3][0];\r\n //getPanorama function is invoked\r\n streetViewService.getPanoramaByLocation(pointer.position, radius, getStreetView);\r\n });\r\n\r\n if (detailwindow.pointer != pointer) {\r\n detailwindow.pointer = pointer;\r\n //set content to pointer title\r\n detailwindow.setContent('<div>' + pointer.title + '</div>');\r\n //open detailwindow on that pointer\r\n detailwindow.open(map, pointer);\r\n // Make sure the pointer property is cleared if the detailwindow is closed.\r\n detailwindow.addListener('closeclick', function() {\r\n detailwindow.pointer = null;\r\n });\r\n //for getting wideview view we are setting radius to 50 if dont get any stretview it should show within 50m\r\n var radius = 50;\r\n // In case the status is OK, which means the wideview was found, compute the\r\n // position of the streetview image, then calculate the heading, then get a\r\n // wideview from that and set the options\r\n function getStreetView(data, status) {\r\n if (status == google.maps.StreetViewStatus.OK) {\r\n var nearStreetViewLocation = data.location.latLng;\r\n var heading = google.maps.geometry.spherical.computeHeading(\r\n nearStreetViewLocation, pointer.position);\r\n //setcontent to location title and wikipedia url\r\n detailwindow.setContent('<div>' + pointer.title + '</div><br><a href =\"' + articleUrl + '\">' + articleUrl + '</a><hr><div id=\"detail\"></div>');\r\n var wideviewOptions = {\r\n position: nearStreetViewLocation,\r\n pov: {\r\n heading: heading,\r\n pitch: 20\r\n }\r\n };\r\n var wideview = new google.maps.StreetViewPanorama(\r\n document.getElementById('detail'), wideviewOptions);\r\n } else {\r\n // streetview unavailable\r\n detailwindow.setContent('<div>' + pointer.title + '</div>' +\r\n '<div>No Street View Found</div>');\r\n }\r\n //open detailwindow on that pointer\r\n detailwindow.open(map, pointer);\r\n }\r\n }\r\n }", "function markerClickHandler(){\n var marker = this;\n viewModel.venues().forEach(function(Venue){\n Venue.marker.setAnimation(null);\n });\n marker.setAnimation(google.maps.Animation.BOUNCE);\n setTimeout(function(){\n marker.setAnimation(null);\n },750);\n infowindow.setContent(this.contentString);\n infowindow.open(map, this);\n}", "function showMarkers() {\r\n setMapOnAll(map);\r\n }", "function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, nearStreetViewLocation);\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: 150,\n pitch: 20\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div style = \"text-align:center\">' + titleContent + '<p>No Street View Image Found</p>' + ' </div>');\n }\n}", "function initMap() {\n var myLocation = {\n lat: +lat,\n lng: +long\n };\n var map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: +lat,\n lng: +long\n },\n zoom: 14\n });\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), {\n position: myLocation,\n pov: {\n heading: 34,\n pitch: 10\n }\n });\n map.setStreetView(panorama);\n}", "function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, marker.position);\n infowindow.setContent(infoContent);\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 30\n }\n };\n var panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent('<div>No Street View Found</div>' + infoContent);\n }\n }", "function showMarkers() {\r\n setMapOnAll(map);\r\n }", "function onPolyClick(e){\n clickedLatLng = e.latlng;\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function showMarkers() {\n setMapOnAll(map);\n}", "function onReady() {\n\n\tvar infoWin = new google.maps.InfoWindow();\n\n\tvar mapOptions = {\n\t\tcenter: {lat: 47.6, lng: -122.3},\n\t\tzoom: 12\n\t}\n\n\tvar mapElem = document.getElementById('map');\n\tvar map = new google.maps.Map(mapElem, mapOptions);\n\tvar position;\n\tvar storeMarkers = [];\n\tvar marker;\n\n\t$.getJSON('http://data.seattle.gov/resource/65fc-btcc.json')\n\t\t.done(function(coordinates) {\n\t\t\tcoordinates.forEach(function(coordinates) {\n\t\t\t\tvar targetLat = parseFloat(coordinates.location.latitude);\n\t\t\t\tvar targetLng = parseFloat(coordinates.location.longitude);\n\t\t\t\tposition = {lat: targetLat, lng: targetLng};\n\t\t\t\tmarker = new google.maps.Marker({\n\t\t\t\t\tposition: position,\n\t\t\t\t\tmap: map,\n\t\t\t\t\tlabel: coordinates.cameralabel,\n\t\t\t\t\turl: coordinates.imageurl.url,\n\t\t\t\t\tanimation: google.maps.Animation.DROP\n\t\t\t\t})\n\t\t\t\tstoreMarkers.push(marker);\n\t\t\t\tgoogle.maps.event.addListener(marker, 'click', onMarkerClick)\n\t\t\t\tgoogle.maps.event.addListener(marker, 'click', toggleBounce)\n\n\t\t\t\tfunction onMarkerClick() {\n\t\t\t\t\t// this refers to marker object\n\t\t\t\t\tmap.panTo(this.getPosition());\n\t\t\t\t\tinfoWin.setContent('<p>'\n + this.label + '<br>'\n + '<img src=\"' + this.url \n + '\" alt=\"Live camera image at'\n + this.label + '\"/>' \n + '</p>');\n\t\t\t\t\tinfoWin.open(map, this); \n\t\t\t\t}\n\t\t\t}) // for loop\n\n\t\t\tfunction toggleBounce() {\n\t\t\t\t if (marker.getAnimation() != null) {\n\t\t\t\t \tmarker.setAnimation(null);\n\t\t\t\t } else {\n\t\t\t\t \tmarker.setAnimation(google.maps.Animation.BOUNCE);\n\t\t\t\t }\n\t\t\t}\n\n\t\t\tgoogle.maps.event.addListener(map, 'click', closeWindow)\n\n\t\t\t// close info window when user clicks map\n\t\t\tfunction closeWindow() {\n\t\t\t\tinfoWin.close();\n\t\t\t}\n\n\t\t\t$(\"#search\").bind(\"search keyup\", function() {\n var check;\n var clientSearch = this.value.toLowerCase();\n storeMarkers.forEach(function(storeMarkers) {\n check = storeMarkers.label.toLowerCase();\n if (clientSearch == '') {\n storeMarkers.setMap(map);\n }\n if (check.indexOf(clientSearch) == -1) {\n storeMarkers.setMap(null);\n } \n })\n });\n\t\t}) //.done\n\n\t\t// if request fails\n\t\t.fail(function(error) {\n\t\t\talert(\"Failed to get JSON.\")\n\t\t}) \n\t\t.always(function() {\n\t\n\t\t})\n\n} //onReady", "function initPano() {\n panoObj.panorama = new google.maps.StreetViewPanorama(\n document.getElementById('pano'), {\n position: start_loc_google,\n pov: {\n heading: 34,\n pitch: 10\n },\n // remove default Street View controls\n addressControl: false,\n linksControl: true,\n panControl: false,\n enableCloseButton: false\n });\n}", "function showMarkers() {\n\t\t\t\t setMapOnAll(map);\n\t\t\t\t}", "function getStreetView(data, status) {\n if (status == google.maps.StreetViewStatus.OK) {\n var nearStreetViewLocation = data.location.latLng;\n var heading = google.maps.geometry.spherical.computeHeading(\n nearStreetViewLocation, location.marker.position);\n infowindow.setContent(infowindow.getContent() + '<div id=\"pano\"></div>');\n var panoramaOptions = {\n position: nearStreetViewLocation,\n pov: {\n heading: heading,\n pitch: 0\n }\n };\n var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);\n } else {\n infowindow.setContent(infowindow.getContent() + '<div>No Street View Found</div>');\n }\n }", "function pano(latLng, map) {\n\tvar panorama = new google.maps.StreetViewPanorama(\n\t\tdocument.getElementById('streetview'), {\n\t\tposition: latLng,\n\t});\n\tmap.setStreetView(panorama);\n}", "function locationMarkers(location) {\n\n for(i=0; i<location.length; i++) {\n location[i].holdMarker = new google.maps.Marker({\n position: new google.maps.LatLng(location[i].lat, location[i].lng),\n map: map,\n title: location[i].title,\n icon: {\n url: 'img/marker.png',\n size: new google.maps.Size(25, 40),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(12.5, 40)\n }\n });\n\nbounds.extend(location[i].holdMarker.position);\n\n\n//Binds infoWindow content to each marker\n\nlocation[i].contentString =location[i].title +\n location[i].title + '</strong><br><p>' +\n location[i].streetAddress + '<br>' +\n location[i].cityAddress + '<br></p><a class=\"web-links\" href=\"http://' + location[i].url +\n '\" target=\"_blank\">' + location[i].url + '</a>';\n\n//triggers infowindow upon click\n\n\nviewModel.showInfo = function(location){\n google.maps.event.trigger(location.holdMarker,'click');\n}\n\n\n//opens infowindow when link or marker is clicked\n location[i].holdMarker.addListener ( 'click', (function(marker, i) {\n return function() {\n infowindow.setContent(location[i].contentString);\n marker.setAnimation(google.maps.Animation.BOUNCE);\n infowindow.open(map,marker);\n map.setZoom(16);\n map.setCenter(location[i]);\n setTimeout(function () {\n infowindow.close();\n marker.setAnimation(google.maps.Animation.DROP);\n }, 1400);\n //***GET WIKIPEDIA INFO***\n getWikiInfo(marker.title);\n };\n })(location[i].holdMarker, i));\n\n }\n\n}", "function getStreetView(data, status) {\r\n if (status == google.maps.StreetViewStatus.OK) {\r\n var nearStreetViewLocation = data.location.latLng;\r\n var heading = google.maps.geometry.spherical.computeHeading(\r\n nearStreetViewLocation, marker.position);\r\n infowindow.setContent(infoContent + '<div id=\"pano\"></div>');\r\n var panoramaOptions = {\r\n position: nearStreetViewLocation,\r\n pov: {\r\n heading: heading,\r\n pitch: 30\r\n }\r\n };\r\n var panorama = new google.maps.StreetViewPanorama(\r\n document.getElementById('pano'), panoramaOptions);\r\n } else {\r\n infowindow.setContent(infoContent +\r\n '<div>No Street View Found</div>');\r\n }\r\n }", "function showMarkers() {\n setMapOnAll(map);\n }", "function mapFunctionDisplay(x, y, add) {\n// body...\nrequire([\n\"esri/Map\",\n\"esri/views/MapView\",\n\"esri/widgets/Search\",\n\"esri/layers/FeatureLayer\",\n\"esri/Graphic\",\n\"esri/layers/GraphicsLayer\",\n\"esri/geometry/Point\",\n\"esri/symbols/SimpleMarkerSymbol\",\n\"dojo/domReady!\"\n], function(Map, MapView, Search, FeatureLayer, Graphic, GraphicsLayer, Point, SimpleMarkerSymbol) {\nvar map = new Map({\n smartNavigation: false,\n basemap: \"dark-gray-vector\"\n});\n\n map.on(\"load\", function() {\n console.log('')\n });\n// Add the layer to the map\nvar trailsLayer = new FeatureLayer({\n url: \"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Trailheads/FeatureServer/0\",\n});\n\nmap.add(trailsLayer); // Optionally add layer to map\n\nvar view = new MapView({\n container: \"viewDiv\",\n center: [-98.35, 39.50],\n map: map,\n zoom: 3\n});\n// Search\nvar search = new Search({\n view: view\n});\nsearch.defaultSource.withinViewEnabled = true; // Limit search to visible map area only\nview.ui.add(search, \"top-right\"); // Add to the map\n// Add the trailheads as a search source\n// search.sources.push({\n// featureLayer: trailsLayer,\n// searchFields: [\"TRL_NAME\"],\n// displayField: \"TRL_NAME\",\n// exactMatch: false,\n// outFields: [\"TRL_NAME\", \"PARK_NAME\"],\n// resultGraphicEnabled: true,\n// name: \"Trailheads\",\n// placeholder: \"Santa\",\n// });\n// Find address\nfunction showPopup(address, pt) {\n view.popup.open({\n title: \"Find Address Result\",\n content: address + \"<br><br> Lat: \" + Math.round(pt.latitude * 100000)/100000 + \" Lon: \" + Math.round(pt.longitude * 100000)/100000,\n location: pt\n });\n}\n// view.on(\"click\", function(evt){\n// search.clear();\n// view.popup.clear();\n// var locatorSource = search.defaultSource;\n// locatorSource.locator.locationToAddress(evt.mapPoint)\n// .then(function(response) {\n// var address = response.address.Match_addr;\n// // Show the address found\n// showPopup(address, evt.mapPoint);\n// }, function(err) {\n// // Show no address found\n// showPopup(\"No address found for this location.\", evt.mapPoint);\n// });\n// });\nvar graphicsLayer = new GraphicsLayer();\n map.add(graphicsLayer);\n /*************************\n * Add a 3D point graphic\n *************************/\n // London\n var point = new Point({\n\n }),\n markerSymbol = new SimpleMarkerSymbol({\n color: [226, 119, 40],\n outline: { // autocasts as new SimpleLineSymbol()\n color: [255, 255, 255],\n width: 2\n }\n });\n var pointGraphic = new Graphic({\n\n symbol: markerSymbol\n });\n graphicsLayer.add(pointGraphic);\n})\n}", "function showOverlays() {\n setAllMap(map);\n}", "function initMap()\n{\n //initial map information\n var options = {\n zoom: 9,\n center: {lat: 42.3601, lng: -71.0589}\n };\n //initialize new map\n var map = new google.maps.Map(document.getElementById('map'), options);\n\n //Crete new Marker where user doubleclicks\n google.maps.event.addListener(map, 'dblclick', function(event)\n {\n //get lat and lng from where user doubleclicked\n obj = {\n \"lat\": event.latLng.lat(),\n \"lng\": event.latLng.lng()\n };\n //parse into json object for AJAX request\n dbParam = JSON.stringify(obj);\n\n //center map where user doubleclicked\n map.panTo(new google.maps.LatLng(obj.lat,obj.lng));\n\n //make new marker where user doubleclicked\n var marker = new google.maps.Marker(\n {\n position: event.latLng,\n map: map\n });\n\n var conf = confirm(\"Are you sure you this is where you would like your location??\");\n if (conf == true) {\n window.open(\"new_street_view.html\", \"Choose Street View!\");\n }\n else {\n window.location.reload(true);\n }\n //create infowindow that pops up with doubleclicked marker\n // var infowincontent = document.createElement('div');\n //\n // //in infowindow ask user if this is where they would like the locaiton\n // var strong = document.createElement('strong');\n // strong.textContent = \"Is this where you would like your new location?\";\n // infowincontent.appendChild(strong);\n // infowincontent.appendChild(document.createElement('br'));\n // infowincontent.appendChild(document.createElement('ul'));\n\n //create \"yes\" button for user to select if they want a new location at given marker\n //if clicked, send user to choose a street veiw for their new location\n // var li_1 = document.createElement(\"li\");\n // var yes = document.createElement(\"a\");\n // yes.href = \"new_street_view.html\";\n // var t = document.createTextNode(\"Yes\");\n // yes.appendChild(t);\n // li_1.appendChild(yes);\n // infowincontent.appendChild(li_1);\n //\n // //create \"no\" button for user to select if they want a new location at given marker\n // //if clicked, reload the page\n // var li_2 = document.createElement(\"li\");\n // var no = document.createElement(\"a\");\n // no.href = \"map_new_location.js\";\n // var t = document.createTextNode(\"No\");\n // no.appendChild(t);\n // li_2.appendChild(no);\n // infowincontent.appendChild(li_2);\n //\n // //when marker is clicked open infowindow content\n // (function(marker, infowincontent){\n // marker.addListener('click', function(){\n // infoWindow.setContent(infowincontent);\n // infoWindow.open(map, marker);\n // });\n // })(marker, infowincontent);\n xmlhttp.open(\"POST\", \"save_coords.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(\"z=\" + dbParam);\n });\n\n //initialize infowindow\n var infoWindow = new google.maps.InfoWindow;\n\n //make AJAX request to my_locations.php\n //get information on locations in tour\n xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n try{\n //when the AJAX request is completed parse the json object\n myObj = JSON.parse(this.responseText);\n\n //initialize count object to be 1\n //count will be the numbers in the markers\n var count = 1;\n\n //loop through locations returned by AJAX request\n for (i = 0; i < myObj.name.length; i++) {\n //latitude and logitude values of the current stop in the map\n var point = new google.maps.LatLng(\n parseFloat(myObj.latitude[i]),\n parseFloat(myObj.longitude[i]));\n\n\n //create infowindow that pops up when marker is clicked\n var infowincontent = document.createElement('div')\n\n //display name of location in infowindow\n var strong = document.createElement('strong');\n strong.textContent = myObj.name[i]\n infowincontent.appendChild(strong);\n infowincontent.appendChild(document.createElement('br'));\n var text = document.createElement('text');\n\n //in ifowindow create \"Open\" button\n //when clicked button takes you to the page of that location\n var para = document.createElement(\"a\");\n para.href = \"my_sources.html\";\n var t = document.createTextNode(\"Open\");\n para.appendChild(t);\n para.appendChild(document.createElement('br'));\n infowincontent.appendChild(para);\n\n //saves the information of the location that gets opened\n //done in save_tour\n var myid = myObj.id[i];\n (function(para, myid) {\n para.addEventListener(\"click\", function(){\n //window.alert(myid);\n save_tour(myid);\n });\n })(para, myid);\n\n //create marker\n var marker = new google.maps.Marker(\n {\n position: point,\n map: map,\n label: \"\" + count\n });\n\n if (count == 1)\n {\n map.setCenter(point);\n }\n count = count + 1;\n\n (function(marker, infowincontent){\n marker.addListener('click', function(){\n infoWindow.setContent(infowincontent);\n infoWindow.open(map, marker);\n });\n })(marker, infowincontent);\n }\n }\n //catch if there are no locaitons in the tour\n catch{\n var aa = 0;\n }\n }\n };\n xmlhttp.open(\"POST\", \"my_locations.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(null);\n\n //INPUT: id of a given location on tour\n function save_tour(id)\n {\n //create json object that get used in AJAX request\n obj = {\n \"location\": id\n };\n dbParam = JSON.stringify(obj);\n\n //AJAX request to location_id.php\n //saves given locaiton id to the session variable in php\n xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n return null;\n }\n }\n xmlhttp.open(\"POST\", \"location_id.php\", true);\n xmlhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xmlhttp.send(\"z=\" + dbParam);\n }\n}" ]
[ "0.7010471", "0.69724476", "0.6891523", "0.6786451", "0.67828614", "0.6757561", "0.668425", "0.6681528", "0.6676856", "0.66703945", "0.664944", "0.66344696", "0.6634468", "0.6628166", "0.6620713", "0.66052043", "0.65706676", "0.65585935", "0.652304", "0.65160793", "0.6514925", "0.6486939", "0.6473843", "0.6448063", "0.6442374", "0.644089", "0.6439687", "0.64334345", "0.6432081", "0.64319366", "0.643165", "0.6420858", "0.64167655", "0.6416596", "0.64136934", "0.64104104", "0.64012945", "0.63870865", "0.63830256", "0.6382093", "0.6373336", "0.6363149", "0.63591546", "0.63534343", "0.63444334", "0.6336464", "0.63356054", "0.6321519", "0.63183826", "0.6315572", "0.63098925", "0.6309137", "0.6302107", "0.6299001", "0.62970465", "0.62946314", "0.6286629", "0.6279422", "0.6269157", "0.62638295", "0.62638295", "0.62638295", "0.62626606", "0.6259567", "0.6259567", "0.6259567", "0.62591153", "0.6259081", "0.62549174", "0.6254662", "0.6254451", "0.62526476", "0.62454695", "0.6244979", "0.6242142", "0.62371963", "0.62322426", "0.62322426", "0.62322426", "0.62322426", "0.62322426", "0.62322426", "0.62322426", "0.62322426", "0.62322426", "0.62322426", "0.62322426", "0.62322426", "0.62322426", "0.6227529", "0.62235844", "0.6219671", "0.62153393", "0.62036234", "0.6199974", "0.6192436", "0.6176561", "0.6174788", "0.6173607", "0.6170536" ]
0.6221404
91
Extension of EventEmitter that represents an offset in a Place heirarchy. Stores references to all child nodes in the heirarchy.
function OffsetEventEmitter() { EventEmitter.call(this); this._children = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PlaceEventEmitter() {\n this._root = new OffsetEventEmitter();\n}", "function offsetTree(t, offset, offsetFunction) {\n for (var i = 0; i < t.length; i++) {\n var offsetpaths = offsetFunction(t[i], offset);\n if (offsetpaths.length == 1) {\n // replace array items in place\n Array.prototype.splice.apply(t[i], [0, t[i].length].concat(offsetpaths[0]));\n }\n\n if (t[i].childNodes && t[i].childNodes.length > 0) {\n offsetTree(t[i].childNodes, -offset, offsetFunction);\n }\n }\n }", "function append(node, item, offset) {\n\n\t\titem.offset = ++offset;\n\t\tsiblingIndex.add(item);\n\t\tnode.children.push(item);\n\t\titem.parent = node;\n\t\titem.id = id++;\n\t\ttree.push(item);\n\n\t}", "function mapDOMtoPosition() {\n var i;\n var node;\n for (i = 0; i < config.doi.length; i++) {\n node = config.doi[i][\"node\"];\n config.doi[i][\"id\"] = \"doi-\" + i;\n config.doi[i][\"y\"] = node.offsetTop;\n }\n config.doiSnappingPosition = screen.height / 2.5;\n // console.log(config.doi, config.doiSnappingPosition);\n // TODO sort based on offset?\n }", "function patch(nodes, location, offset) {\n var index = -1\n var start = offset\n var end\n var node\n\n while (++index < nodes.length) {\n node = nodes[index]\n\n if (node.children) {\n patch(node.children, location, start)\n }\n\n end = start + toString(node).length\n\n node.position = {\n start: location.toPoint(start),\n end: location.toPoint(end)\n }\n\n start = end\n }\n\n return nodes\n }", "function registerEvents(Position) {\n for(var e in events) {\n let event = events[e];\n Position.hook(e, emitEvent(event));\n }\n}", "emit(eventName, param) {\n var walk = (toks, tree, match) => {\n if (tree == null) {\n return;\n }\n let t = toks[0];\n if (toks.length === 1) {\n let h;\n if (t in tree) {\n for (h of Array.from(tree[t].__ehs)) {\n h(eventName, param, match.slice(0, -1));\n }\n }\n if ('*' in tree) {\n for (h of tree['*'].__ehs) {\n h(eventName, param, match + t);\n }\n }\n }\n else {\n if (t in tree) {\n walk(toks.slice(1), tree[t], match);\n }\n if ('*' in tree) {\n walk(toks.slice(1), tree['*'], match + t + \".\");\n }\n }\n };\n walk(eventName.split(\".\"), this.evTree, '');\n }", "function traverse(node, item, offset) {\n\t\tif(overlaps(node, item)) {\n\t\t\tif(iterate(siblingIndex.get(offset+1), item, offset+1)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tappend(node, item, offset);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "constructor($pos) {\n let node = $pos.nodeAfter;\n let $end = $pos.node(0).resolve($pos.pos + node.nodeSize);\n super($pos, $end);\n this.node = node;\n }", "function location(node, location, config) {\n var result = position(location)\n var tail\n var key\n var props\n\n if (node.type === 'element') {\n tail = node.children[node.children.length - 1]\n\n // Bug for unclosed with children.\n // See: <https://github.com/inikulin/parse5/issues/109>.\n if (!location.endTag && tail && tail.position && tail.position.end) {\n result.end = Object.assign({}, tail.position.end)\n }\n\n if (config.verbose) {\n props = {}\n\n for (key in location.attrs) {\n props[find(config.schema, key).property] = position(location.attrs[key])\n }\n\n node.data = {\n position: {\n opening: position(location.startTag),\n closing: location.endTag ? position(location.endTag) : null,\n properties: props\n }\n }\n }\n }\n\n return result\n}", "dispatchAt(x, y, type) {\r\n const object = this._getObjectUnderPointRecursive(x, y, this._stage);\r\n const target = (object === null) ? this._stage : object;\r\n let current = target;\r\n while (current !== null) {\r\n current.emit(type, { x: x, y: y, target: target });\r\n current = current.parent;\r\n }\r\n }", "function mkEventNode(cmdMap, emitter) {\n\treturn { parent: undefined, emitter: emitter, cmdMap: cmdMap};\n}", "function LevelUP (location, options) {\n this.__proto__.__proto__ = EventEmitter.prototype\n EventEmitter.call(this)\n this._options = extend(extend({}, defaultOptions), options)\n this._location = location\n this._status = 'new'\n}", "static async getTxChildListFromAddressByPageAndOffset (address, pageNumber, offset) {\n let txChildList = await EtherscanServices.getNormalTransactionByAddress(address, pageNumber, offset)\n return txChildList\n }", "appendInto(e){this.startNode=e.appendChild(createMarker()),this.endNode=e.appendChild(createMarker())}", "assignPosition(node, position) {\n\t\tif(node.parentNode && position<node.parentNode.position){\n\t\t\tposition = node.parentNode.position;\n\t\t}\n\t\twhile(this.positionMap.get(`${node.level},${position}`)){\n\t\t\tposition++;\n\t\t}\n\t\tnode.position = position;\n\t\tthis.positionMap.set(`${node.level},${position}`, true);\n\t\tfor(var i in node.children){\n\t\t\tthis.assignPosition(node.children[i], position+Number(i));\n\t\t}\n\t}", "function translateLoc(loc) {\n let result = `${twoSpace}wrapper.find('#${loc[0]}').`;\n for (let i = 1; i < loc.length; i++) {\n result += `childAt(${loc[i]}).`; \n }\n return result; \n}", "handlePosition(node) {\n return 'middle top'; // sets the position of the handle in the format of \"X-AXIS Y-AXIS\" such as \"left top\", \"middle top\"\n }", "on(name, cb) {\n let array = name.split(\".\"), adjustedLength = Math.max(array.length, 1), path = array.slice(0, adjustedLength - 1), last = array[adjustedLength - 1];\n let tree = this.evTree;\n for (let t of path) {\n tree = tree[t] || (tree[t] = { __ehs: [] });\n } // make tree via path\n if (!tree[last]) {\n tree[last] = { __ehs: [] };\n }\n tree[last].__ehs.push(cb); // store cb\n }", "function recursiveTraversalPosition(actNode, childShift) {\n\n\t\ttmpNodes.push(actNode);\n\n if (actNode.value === \"0\") {\n actNode.xPosition = rectLength * 1.5;\n actNode.yPosition = rectLength;\n } else {\n actNode.xPosition = actNode.parent.xPosition;\n actNode.yPosition = actNode.parent.yPosition + rectLength * 2;\n }\n\n actNode.xPosition += childShift;\n\n var shift = 0;\n var children = actNode.children;\n if (children === undefined)\n return 0;\n for (var i = 0; i < children.length; i++) {\n\n if (i > 0) {\n shift += rectLength * 2;\n }\n shift += recursiveTraversalPosition(children[i], shift * 2);\n\n }\n actNode.xPosition += shift;\n\n return shift;\n }", "posAtDOM(node, offset = 0) {\n return this.docView.posFromDOM(node, offset);\n }", "function markBranchNodeChanged( offset ) {\n\t\tvar item, newItem,\n\t\t\tadj = isReversed ? -1 : 1,\n\t\t\ti = offset - 1;\n\n\t\twhile ( i >= 0 ) {\n\t\t\titem = document.data.getData( i-- );\n\t\t\tif ( !(\n\t\t\t\tve.dm.LinearData.static.isOpenElementData( item ) &&\n\t\t\t\tve.dm.nodeFactory.lookup(\n\t\t\t\t\tve.dm.LinearData.static.getType( item )\n\t\t\t\t).prototype instanceof ve.dm.BranchNode\n\t\t\t) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ( item.internal && item.internal.changesSinceLoad !== undefined ) {\n\t\t\t\t// Guard against marking the same node twice\n\t\t\t\tif ( changedBranchNodes.indexOf( item ) === -1 ) {\n\t\t\t\t\tnewItem = ve.copy( item );\n\t\t\t\t\tchangedBranchNodes.push( newItem );\n\t\t\t\t\tnewItem.internal.changesSinceLoad += adj;\n\t\t\t\t\tdocument.data.splice( i + 1, 1, ve.deepFreeze( newItem ) );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// This is a branch node boundary, so go no further\n\t\t\tbreak;\n\t\t}\n\t}", "function findLeaf(node, offset) {\n\t\t\t\tif (offset === undef) {\n\t\t\t\t\toffset = node.nodeType === 3 ? node.length : node.childNodes.length;\n\t\t\t\t}\n\n\t\t\t\twhile (node && node.hasChildNodes()) {\n\t\t\t\t\tnode = node.childNodes[offset];\n\t\t\t\t\tif (node) {\n\t\t\t\t\t\toffset = node.nodeType === 3 ? node.length : node.childNodes.length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {node: node, offset: offset};\n\t\t\t}", "function findLeaf(node, offset) {\n\t\t\t\tif (offset === undef) {\n\t\t\t\t\toffset = node.nodeType === 3 ? node.length : node.childNodes.length;\n\t\t\t\t}\n\n\t\t\t\twhile (node && node.hasChildNodes()) {\n\t\t\t\t\tnode = node.childNodes[offset];\n\t\t\t\t\tif (node) {\n\t\t\t\t\t\toffset = node.nodeType === 3 ? node.length : node.childNodes.length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {node: node, offset: offset};\n\t\t\t}", "function findLeaf(node, offset) {\n\t\t\t\tif (offset === undef) {\n\t\t\t\t\toffset = node.nodeType === 3 ? node.length : node.childNodes.length;\n\t\t\t\t}\n\n\t\t\t\twhile (node && node.hasChildNodes()) {\n\t\t\t\t\tnode = node.childNodes[offset];\n\t\t\t\t\tif (node) {\n\t\t\t\t\t\toffset = node.nodeType === 3 ? node.length : node.childNodes.length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn {node: node, offset: offset};\n\t\t\t}", "assignPosition(node, position) {\n // update the position of the node\n node.position = position;\n \n // the base case\n if (node.children.length === 0)\n {\n leafNodeCounter = leafNodeCounter + 1;\n return node;\n }\n // recursive case\n else\n {\n leafNodeCounter = 0;\n for (var d = 0; d < node.children.length; d++)\n {\n // this is a really bad hack and there is definitely something better out there. \n // However, it gets the job done\n if (node.children[d].name === \"Protosomes\")\n {\n leafNodeCounter = leafNodeCounter + 2;\n }\n\n this.assignPosition(node.children[d], node.position + leafNodeCounter);\n }\n }\n\n }", "function ECHOTreeMap(instanceId, resourceType, refid, data) {\n if (refid == null) {\n refid = null;\n }\n if (data == null) {\n data = null;\n }\n ECHOTreeMap.__super__.constructor.call(this, instanceId, resourceType, refid);\n this._isSubtree = refid != null;\n if (data != null) {\n this._copyData(data);\n }\n }", "function EventEmitter(){}// Shortcuts to improve speed and size", "annotateNodes() {\n this.nodeIdMap.clear();\n this.nodeNIdMap.clear();\n\n let lastNode = null;\n let nid = 0;\n\n const loop = (nodes, parent, level) => {\n nodes.forEach((node, i) => {\n node.parent = parent;\n node.path = parent ? parent.path + (\",\" + i) : i.toString();\n node.level = level;\n node[\"aria-setsize\"] = nodes.length;\n node[\"aria-posinset\"] = i + 1;\n node.nid = nid++;\n if (lastNode) {\n node.prev = lastNode;\n lastNode.next = node;\n }\n this.nodeIdMap.set(node.id, node);\n this.nodeNIdMap.set(node.nid, node);\n lastNode = node;\n loop([...node.children()], node, level + 1);\n });\n };\n loop(this.rootNodes, null, 1);\n }", "function fromNodeOffset(node, offset) {\n if (node.nodeType === 3) {\n return text(node, offset);\n }\n\n if (offset === node.childNodes.length) {\n return end(node);\n }\n\n assert(offset >= 0 && offset < node.childNodes.length,\n 'invalid offset for', node, offset);\n\n return before(node.childNodes[offset]);\n}", "updateChildLocationForCell(top, cellWidget) {\n for (let i = 0; i < cellWidget.childWidgets.length; i++) {\n cellWidget.childWidgets[i].x = cellWidget.childWidgets[i].x;\n cellWidget.childWidgets[i].y = top;\n if (cellWidget.childWidgets[i] instanceof TableWidget) {\n this.updateChildLocationForTable(top, cellWidget.childWidgets[i]);\n }\n top += cellWidget.childWidgets[i].height;\n }\n }", "_customLocation() {\n if (this.state.somewhereElse) {\n this.getCoordsByAddress();\n } else {\n this._onForward();\n }\n }", "function getTextPositionOffset(parent, child, offset) {\n var range = document.createRange()\n , selection\n , contents\n\n if (!child) {\n selection = window.getSelection();\n child = selection.focusNode || parent;\n offset = selection.focusOffset || 0;\n }\n\n range.setStart(parent, 0);\n range.setEnd(child, offset);\n contents = range.cloneContents();\n\n return contents.textContent.trimLeft().length + contents.childNodes.length - 1;\n}", "pointerup(payload) {\n domEventSequences.pointerup(node, payload);\n }", "function getOffset(offset) {\n\t\t\t// Add all insertions before this location together to calculate\n\t\t\t// the current offset\n\t\t\tfor (var i = 0, l = insertions.length; i < l; i++) {\n\t\t\t\tvar insertion = insertions[i];\n\t\t\t\tif (insertion[0] >= offset)\n\t\t\t\t\tbreak;\n\t\t\t\toffset += insertion[1];\n\t\t\t}\n\t\t\treturn offset;\n\t\t}", "translate (offset) {\n this.position = this.tempPosition.plus(offset);\n }", "function mousedownLocation(event) {\n /* pop target dot to the top of the z-index */\n var parent = event.target.parent;\n event.target.remove();\n parent.addChild(event.target);\n\n event.target.children.dot.fillColor.alpha = 0.5;\n for (var i = 0; i < event.target.location.paths.length; i++) {\n event.target.location.paths[i].strokeColor = new paper.Color(0, 0, 0, 0.5);\n }\n\n event.target.scope.$apply(function () {\n event.target.scope.admin.showDetailPanel = true;\n event.target.scope.admin.location = event.target.location;\n });\n }", "function normalizeOffset(textNode, offset) {\n if (textNode.nodeType !== 3) {\n return -1;\n }\n // Find entry in textmap array (using binary search)\n var textmap = textMap,\n iEntry = textmap.length,\n entry;\n while (iEntry-- > 0) {\n entry = textmap[iEntry];\n if (textNode === entry.n) {\n //alert(entry.i+offset);\n return entry.i + offset;\n }\n }\n return -1;\n}", "setOffsets() {\n const startPt = this.startPt.minusPt(this.head);\n const endPt = this.endPt.minusPt(this.head);\n const controlPt = this.controlPt.minusPt(this.head);\n this.stateOffset = { startPt, endPt, controlPt };\n }", "childAfter(pos) {\n let { index, offset } = this.content.findIndex(pos);\n return { node: this.content.maybeChild(index), index, offset };\n }", "move(x, y) {\n for (child of iterate_descendants(this)) {\n child.abs_x += x\n child.abs_y += y\n }\n }", "updateProxyElementPositions() {\n Object.keys(this.groups).forEach(this.updateGroupProxyElementPositions.bind(this));\n }", "function readMultiLevelPtr(offsets) {\n let address = module + Number(offsets[0]);\n for (let i = 1; i < offsets.length; i += 1) {\n address = memory.readPtr(address);\n address += offsets[i];\n }\n return address;\n }", "moveTo() {\n return this.offsetTo.apply(this, arguments);\n }", "appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }", "appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }", "appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }", "function findNodeAround(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n try {\n (function c(node, st, override) {\n var type = override || node.type;\n if (node.start > pos || node.end < pos) { return }\n baseVisitor[type](node, st, c);\n if (test(type, node)) { throw new Found(node, st) }\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n }", "function findNodeAround(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n try {\n (function c(node, st, override) {\n var type = override || node.type;\n if (node.start > pos || node.end < pos) { return }\n baseVisitor[type](node, st, c);\n if (test(type, node)) { throw new Found(node, st) }\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n }", "insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}", "appendInto(container){this.startNode=container.appendChild(createMarker());this.endNode=container.appendChild(createMarker())}", "constructor(\n /// The start of the unchanged range pointed to by this fragment.\n /// This refers to an offset in the _updated_ document (as opposed\n /// to the original tree).\n from, \n /// The end of the unchanged range.\n to, \n /// The tree that this fragment is based on.\n tree, \n /// The offset between the fragment's tree and the document that\n /// this fragment can be used against. Add this when going from\n /// document to tree positions, subtract it to go from tree to\n /// document positions.\n offset, openStart = false, openEnd = false) {\n this.from = from;\n this.to = to;\n this.tree = tree;\n this.offset = offset;\n this.open = (openStart ? 1 /* Open.Start */ : 0) | (openEnd ? 2 /* Open.End */ : 0);\n }", "function getOffset(element, ancestor) {\n var left = 0,\n top = 0,\n originalElement = element;\n while (element != ancestor) {\n if (element === null) {\n console.log(originalElement);\n console.log(ancestor);\n }\n left += element.offsetLeft;\n top += element.offsetTop;\n element = element.parentNode;\n }\n return { left: left, top: top };\n }", "function setNewXPositions(last) {\n data.tree.eachBefore(d => {\n d.x = d.x / last\n d.x = d.x * graph.scale.vertical.value\n\n let element = d3.select('#node' + d.data.id)\n if (!element) return\n element.attr('transform', 'translate(' + [d.y, d.x] + ')')\n if (d.parent) {\n d3.select('#link' + d.data.id)\n .select('path')\n .attr('d', 'M' + [d.parent.y, d.parent.x] + 'V' + d.x + 'H' + d.y)\n\n if (graph.style.linkLabels) {\n if (d3.select('#label' + d.data.id)) {\n d3.select('#label' + d.data.id)\n .attr('y', (d.x - 5).toString())\n }\n }\n }\n })\n }", "appendInto(container){this.startNode=container.appendChild(createMarker());this.endNode=container.appendChild(createMarker());}", "absAnchorOut(nid) {\n const ltd = this.lastTreeData;\n if (ltd && (nid in ltd)) {\n const ndata = ltd[nid];\n return {\n x: ndata.position.x + ndata.anchorOut.x,\n y: ndata.position.y + ndata.anchorOut.y\n }\n }\n return {x: 0, y: 0};\n }", "set Offset(value) {\n this._offset = value;\n }", "announceUnionRegion(data, _indexInParent = -1) {\n let i = 0;\n for (const child of data.children) {\n child.announceToCurveProcessor(this, i++);\n }\n }", "appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }", "update(event, offset) {\n this.x = event.pageX - offset.left;\n this.y = event.pageY - offset.top;\n }", "shiftChildLocation(shiftTop, bodyWidget) {\n let widgetTop = bodyWidget.y + shiftTop;\n let footerMaxHeight = bodyWidget.page.boundingRectangle.height - (bodyWidget.page.boundingRectangle.height / 100) * 40;\n widgetTop = Math.max(widgetTop, footerMaxHeight);\n shiftTop = widgetTop - bodyWidget.y;\n let childTop = bodyWidget.y = widgetTop;\n for (let i = 0; i < bodyWidget.childWidgets.length; i++) {\n let childWidget = bodyWidget.childWidgets[i];\n if (childWidget instanceof ParagraphWidget) {\n childWidget.x = childWidget.x;\n childWidget.y = i === 0 ? childWidget.y + shiftTop : childTop;\n childTop += childWidget.height;\n }\n else {\n this.shiftChildLocationForTableWidget(childWidget, shiftTop);\n }\n }\n }", "on(event, selector, actionOrArray) {\n const actionChain = chainActions(actionOrArray)\n const handler = (ev) => {\n const matchedTarget =\n selector instanceof Node ? selector : ev.target.closest(selector)\n if (matchedTarget && rootNode.contains(matchedTarget)) {\n ev.$target = matchedTarget\n actionChain(ev)\n }\n }\n\n rootNode.addEventListener(event, handler)\n }", "function findNodeAround(node, pos, test, baseVisitor, state) {\n test = makeTest(test);\n if (!baseVisitor) { baseVisitor = base; }\n try {\n (function c(node, st, override) {\n var type = override || node.type;\n if (node.start > pos || node.end < pos) { return }\n baseVisitor[type](node, st, c);\n if (test(type, node)) { throw new Found(node, st) }\n })(node, state);\n } catch (e) {\n if (e instanceof Found) { return e }\n throw e\n }\n}", "function traverse (node) {\n const newNode = node.slice();\n const attrs = node[1];\n newNode[1] = {\n ...attrs,\n range: {\n start: positions[attrs.begin],\n end: positions[attrs.end]\n }\n };\n newNode[2] = node[2].map(traverse);\n return newNode;\n }", "function setNodePosition(){\n\t\t//console.log(print);\n\t\tvar change = 0;\n\t\tvar offset = Math.max(xOffset - leftPanelWidth,0);\n\n\t\t//set xpos of nodes, and check if node is an outside node\n\t\tlayerMap.forEach(function(d, i){\n\t\t\tif (i > 0){\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmp = [];\n\t\t\t\t\tnodesChildren[e].forEach(function(f){\n\t\t\t\t\t\tif (!nodesData[f].outside.isOutside){\n\t\t\t\t\t\t\ttmp.push(nodesData[f].xpos);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\t\n\t\t\t\t\tif (tmp.length == 0){\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t\tnodesData[e].xpos = -1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].xpos = (d3.min(tmp) + d3.max(tmp)) / 2;\n\t\t\t\t\t\tif (!d.fixed){\n\t\t\t\t\t\t\tnodesData[e].position.x = nodesData[e].xpos;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t}\n\t\t\t\t}); \n\t\t\t} else {\n\t\t\t\td.forEach(function(e){\n\t\t\t\t\tvar tmpX = nodesData[e].xpos;\t\n\t\t\t\t\tif (tmpX - nodeRadius > offset && tmpX + nodeRadius < offset + windowWidth){\n\t\t\t\t\t\tif (nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!nodesData[e].outside.isOutside){\n\t\t\t\t\t\t\tchange++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnodesData[e].outside.isOutside = true;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t});\n\n\n\t\t\n\t\t//Set the color, opacity of nodes based on the status of isOutside\n\t\tnodes.each(function(d){\n\t\t\t/*if (d.noLayer){\n\t\t\t\td.outside.isOutside = true;\n\t\t\t\td3.select(this)\n\t\t\t\t\t.attr(\"opacity\", 0.8)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\n\t\t\t}\t\t*/\t\t\t\t\n\t\t\tif (d.fixed && !(d.x - nodeRadius > offset && d.x + nodeRadius < offset + windowWidth)){\n\t\t\t\td.fixed = false\t\t\t\t\n\t\t\t\td3.select(this).classed(\"fixed\", false);\n\t \t\t\td.position.x = d.xpos;\n\t\t\t\td.position.y = height - nodeRadius - d.layer * unitLinkLength;\n\t\t\t}\n\t\t\tif (d.outside.isOutside && !d.noLayer){\n\t\t\t\tif (d.unAssigned){\n\n\t\t\t\t}\t\t\t\t\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.5)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\t\treturn cScale(d.index + 1);\n\t\t\t\t\t});\t\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\td3.select(this)\n\t\t\t\t\t.transition()\n\t\t\t\t\t.duration(500)\n\t\t\t\t\t.attr(\"opacity\", 0.7)\n\t\t\t\t\t.attr(\"r\", nodeRadius)\n\t\t\t\t\t.attr(\"fill\", \"red\");\t\t\t\t\n\t\t\t}\n\t\t\t//console.log(d.id + \" \" + d.outside.isOutside + \" \" + d.position.x);\n\t\t});\n\t\t//console.log(change)\n\n\t\t//when some node changes its status, the correspoding links, labels and the x position of inside nodes should also change.\n\t\tif (change > 0 || firstTime){\n\t\t\tfirstTime = false;\n\t\t\td3.select(htmlElement).selectAll(\".nodeLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.node.noLayer){\n\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (d.type == \"nodeLabel\" && d.node.outside){\n\t\t\t\t\t\tif ((!d.node.outside.isOutside && (print || d.node.type != \"anchor\")) || (d.node.outside.isOutside && d.node.degree >= 3)){\n\t\t\t\t\t\t\td.node.showLabel = true;\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\n\t\t\t\t\td.node.showLabel = false;\n\t\t\t\t\treturn 0;\t\t\t\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".linkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\tif (d.type == \"linkLabel\"){\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].noLayer){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t// if (nodesData[d.node.tgt].type == 'anchor' && !nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t// \td.show = true;\n\t\t\t\t\t\t// \treturn 1;\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tif ((d.node.src < nodesData.length && nodesData[d.node.src].noLayer == undefined && nodesData[d.node.src].outside.isOutside) \n\t\t\t\t\t\t\t|| (d.node.tgt < nodesData.length && nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)){\n\t\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\td.show = true;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\td3.select(htmlElement).selectAll(\".edgeLinkLabel\")\n\t\t\t\t.attr(\"opacity\", function(d){\n\t\t\t\t\t//console.log(d.index);\n\t\t\t\t\tif (!d.node.src.show || \n\t\t\t\t\t\t(nodesData[d.node.tgt].noLayer == undefined && nodesData[d.node.tgt].outside.isOutside)) {\n\t\t\t\t\t\td.show = false;\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\td.show = true;\n\t\t\t\t\treturn 1;\t\t\t\t\t\n\t\t\t\t});\n\t\t\t/*d3.select(htmlElement).selectAll(\".clickBoard\")\n\t\t\t\t.attr(\"fill\", function(d){\n\t\t\t\t\tif (d.content == \"edgeLinks\"){\n\t\t\t\t\t\tif (nodesData[d.node.tgt].outside.isOutside || !d.node.src.show){\n\t\t\t\t\t\t\treturn \"node\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} else if (d.type == \"linkLabel\"){\n\t\t\t\t\t\tif (nodesData[d.node.src].outside.isOutside || nodesData[d.node.tgt].outside.isOutside){\n\t\t\t\t\t\t\treturn \"none\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"transparent\";\n\t\t\t\t\t} \n\t\t\t\t\treturn d.node.showLabel ? \"transparent\" : \"none\";\n\t\t\t\t});*/\n\n\t\t\tlinks.classed(\"outsideLink\", function(d){\n\t\t\t\t/*if (d.type == \"edgeLink\"){\n\t\t\t\t\treturn d.target.outside.isOutside;\n\t\t\t\t}*/\n\t\t\t\tif (d.target.noLayer){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (d.source.outside && d.target.outside){\n\t\t\t\t\tif (d.target.type == 'anchor' && !d.target.outside.isOutside){\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn d.source.outside.isOutside || d.target.outside.isOutside;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\n\t\t\t\n\t\t\tforce.start();\n\t\t}\n\t}", "function _positions (elements) {\n for (var i = 0; i < elements.length; i++) {\n _position.call(this, elements[i].element, elements[i].event);\n };\n\n _scrollTop = document.body.scrollTop;\n _scrollLeft = document.body.scrollLeft;\n\n // custom scroll event\n _emit('scroll', {\n top: document.body.scrollTop,\n left: document.body.scrollLeft\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}", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling}", "function Emitter(id, el, events, ato) {\n _classCallCheck(this, Emitter);\n\n this.ato = ato;\n this.events = events;\n this.State = new _State__WEBPACK_IMPORTED_MODULE_2__[\"default\"](events.state || {});\n this.initialData = {\n id: id,\n el: el,\n ato: ato\n };\n this.after = {};\n this.detach('state');\n }", "offsetAll(){\n var self = this;\n this.components.forEach(function(item){\n item.set({left: item.left+self.left, top: item.top+self.top, scaleX: 1, scaleY: 1});\n });\n }", "function searchListenerTree(handlers, type, tree, i, typeLength) {\n if (!tree) {\n return null;\n }\n\n if (i === 0) {\n var kind = typeof type;\n if (kind === 'string') {\n var ns, n, l = 0, j = 0, delimiter = this.delimiter, dl = delimiter.length;\n if ((n = type.indexOf(delimiter)) !== -1) {\n ns = new Array(5);\n do {\n ns[l++] = type.slice(j, n);\n j = n + dl;\n } while ((n = type.indexOf(delimiter, j)) !== -1);\n\n ns[l++] = type.slice(j);\n type = ns;\n typeLength = l;\n } else {\n type = [type];\n typeLength = 1;\n }\n } else if (kind === 'object') {\n typeLength = type.length;\n } else {\n type = [type];\n typeLength = 1;\n }\n }\n\n var listeners= null, branch, xTree, xxTree, isolatedBranch, endReached, currentType = type[i],\n nextType = type[i + 1], branches, _listeners;\n\n if (i === typeLength) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n\n if(tree._listeners) {\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n listeners = [tree];\n } else {\n handlers && handlers.push.apply(handlers, tree._listeners);\n listeners = [tree];\n }\n }\n } else {\n\n if (currentType === '*') {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n branches = ownKeys(tree);\n n = branches.length;\n while (n-- > 0) {\n branch = branches[n];\n if (branch !== '_listeners') {\n _listeners = searchListenerTree(handlers, type, tree[branch], i + 1, typeLength);\n if (_listeners) {\n if (listeners) {\n listeners.push.apply(listeners, _listeners);\n } else {\n listeners = _listeners;\n }\n }\n }\n }\n return listeners;\n } else if (currentType === '**') {\n endReached = (i + 1 === typeLength || (i + 2 === typeLength && nextType === '*'));\n if (endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = searchListenerTree(handlers, type, tree, typeLength, typeLength);\n }\n\n branches = ownKeys(tree);\n n = branches.length;\n while (n-- > 0) {\n branch = branches[n];\n if (branch !== '_listeners') {\n if (branch === '*' || branch === '**') {\n if (tree[branch]._listeners && !endReached) {\n _listeners = searchListenerTree(handlers, type, tree[branch], typeLength, typeLength);\n if (_listeners) {\n if (listeners) {\n listeners.push.apply(listeners, _listeners);\n } else {\n listeners = _listeners;\n }\n }\n }\n _listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);\n } else if (branch === nextType) {\n _listeners = searchListenerTree(handlers, type, tree[branch], i + 2, typeLength);\n } else {\n // No match on this one, shift into the tree but not in the type array.\n _listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);\n }\n if (_listeners) {\n if (listeners) {\n listeners.push.apply(listeners, _listeners);\n } else {\n listeners = _listeners;\n }\n }\n }\n }\n return listeners;\n } else if (tree[currentType]) {\n listeners = searchListenerTree(handlers, type, tree[currentType], i + 1, typeLength);\n }\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i + 1, typeLength);\n }\n\n xxTree = tree['**'];\n if (xxTree) {\n if (i < typeLength) {\n if (xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n branches= ownKeys(xxTree);\n n= branches.length;\n while(n-->0){\n branch= branches[n];\n if (branch !== '_listeners') {\n if (branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i + 2, typeLength);\n } else if (branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i + 1, typeLength);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, {'**': isolatedBranch}, i + 1, typeLength);\n }\n }\n }\n } else if (xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength, typeLength);\n } else if (xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength, typeLength);\n }\n }\n\n return listeners;\n }", "function findAncestorOffsetKey(node){var searchNode=node;while(searchNode&&searchNode!==document.documentElement){var key=getSelectionOffsetKeyForNode(searchNode);if(key!=null){return key;}searchNode=searchNode.parentNode;}return null;}", "function setNewYPositions() {\n data.tree.eachBefore(d => {\n if (d.parent) {\n let horizontal = graph.scale.horizontal\n if (!graph.style.align)\n d.y = horizontal.value * d.data.data.value * horizontal.scalingFactor + d.parent.y\n else\n d.y = d.depth * horizontal.scalingFactor * horizontal.value\n\n let element = d3.select('#node' + d.data.id)\n if (!element) return\n element.attr('transform', 'translate(' + [d.y, d.x] + ')')\n\n if (d.parent) {\n if (d3.select('#link' + d.data.id).select('path')) {\n d3.select('#link' + d.data.id)\n .select('path')\n .attr('d', 'M' + [d.parent.y, d.parent.x] + 'V' + d.x + 'H' + d.y)\n }\n\n if (graph.style.linkLabels) {\n if (d3.select('#label' + d.data.id)) {\n d3.select('#label' + d.data.id)\n .attr('x', ((d.parent.y + d.y) / 2).toString())\n }\n }\n }\n }\n })\n }", "insertAfterNode(ref){this.startNode=ref;this.endNode=ref.nextSibling;}", "buildPointAnchors() {\r\n this.regionData.points.forEach((point, index) => {\r\n const anchor = this.createAnchor(this.paper, point.x, point.y);\r\n this.anchors.push(anchor);\r\n this.anchorsNode.add(anchor);\r\n this.subscribeAnchorToEvents(anchor, index);\r\n });\r\n }", "setOffset(offset) {\n if (Array.isArray(offset)) {\n this.offset = () => offset;\n } else {\n this.offset = offset;\n }\n }", "function calculateNodePositions(nodesView, nodesData)\n {\n nodesView.children().each(function(index, child)\n {\n var cid = $(child).data('node-cid');\n var node = nodesData[cid];\n var body = nodesView.closest('body');\n\n // groups have nested nodes inside of them\n if (node.binding === 'group')\n {\n for (var i = 0; i < node.data.length; i++)\n {\n console.log('here');\n var current = node.data[i];\n current.position = getCoordinatesForNode(current, body);\n }\n }\n\n node.position = getCoordinatesForNode(node, body);\n node.position.side = getSideForNode(node.position);\n });\n }", "function offsetPacker(packer) {\n return function(svgArea, spans, features) {\n var layout = packer(svgArea, spans, features);\n layout.offsets.forEach(function(offset) {\n offset.x += svgArea.left;\n offset.y += svgArea.top;\n });\n return layout;\n };\n}", "setChildren() {\n var children = Object.keys(this).filter(t=>t!=\"endOfWord\");\n\n children.forEach(entry => {\n if (!trieNode.prototype.isPrototypeOf(this[entry])) {\n this[entry] = Object.setPrototypeOf(this[entry], trieNode.prototype);\n }\n this[entry].setChildren();\n });\n }", "function setMaxOffset() {\n\n\t\tvar setChildren = function(node, offset) {\n\t\t\tnode.maxoffset = offset;\n\t\t\tnode.children.forEach(function(child) {\n\t\t\t\tsetChildren(child, offset);\n\t\t\t});\n\t\t};\n\n\t\tvar leaves = tree.filter(function(node) {\n\t\t\treturn node.children.length === 0;\n\t\t});\n\n\t\tvar roots = {}, currentRoot;\n\t\tleaves.forEach(function(leaf) {\n\t\t\tvar node = leaf, maxoffset = 0;\n\t\t\twhile(1) {\n\t\t\t\tmaxoffset = Math.max(maxoffset, node.offset);\n\t\t\t\tif(node.parent.offset >= 0) {\n\t\t\t\t\tnode = node.parent;\n\t\t\t\t} else {\n\t\t\t\t\tcurrentRoot = roots[node.id] || (roots[node.id] = node);\n\t\t\t\t\tcurrentRoot.maxoffset = Math.max(currentRoot.maxoffset, maxoffset);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfor(var rootId in roots) {\n\t\t\tsetChildren(roots[rootId], roots[rootId].maxoffset);\n\t\t}\n\n\t\ttree.forEach(function(leaf) {\n\t\t\tvar nextoffset = leaf.maxoffset+1;\n\t\t\tvar siblings = siblingIndex.get(nextoffset);\n\t\t\twhile(siblings.length > 0) {\n\t\t\t\tfor(var index in siblings) {\n\t\t\t\t\tif(overlaps(siblings[index], leaf)) {\n\t\t\t\t\t\tleaf.maxoffset = Math.max(leaf.maxoffset, siblings[index].maxoffset);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tsiblings = siblingIndex.get(++nextoffset);\n\t\t\t}\n\t\t});\n\t}", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "function finishNodeAt(node, type, pos, loc) {\n node.type = type;\n node.end = pos;\n if (this.options.locations)\n { node.loc.end = loc; }\n if (this.options.ranges)\n { node.range[1] = pos; }\n return node\n }", "positionAt(offset) {\n return (0, utils_1.positionAt)(offset, this.getText(), this.getLineOffsets());\n }", "function split(startI, endI, type, innerOffset, length) {\n let i = startI;\n while (b[i + 2] + off <= node.from)\n i = b[i + 3];\n let children = [], positions = [];\n sliceBuf(buf, startI, i, children, positions, innerOffset);\n let from = b[i + 1], to = b[i + 2];\n let isTarget = from + off == node.from && to + off == node.to && b[i] == node.type.id;\n children.push(isTarget ? node.toTree() : split(i + 4, b[i + 3], buf.set.types[b[i]], from, to - from));\n positions.push(from - innerOffset);\n sliceBuf(buf, b[i + 3], endI, children, positions, innerOffset);\n return new Tree(type, children, positions, length);\n }", "_flushUpdateZIndexOfChilden() {\n const _this = this;\n // Iterate over a clone:\n const _buffer = this.cloneObject(this._updateZIndexOfChildrenBuffer);\n this._updateZIndexOfChildrenBuffer = [];\n _buffer\n .map(_viewId => {\n const _view = _this.__views[_viewId];\n const _isRootView = _viewId === null;\n const _viewOrder = _isRootView ? _this.__viewsZOrder : _view.viewsZOrder;\n if (_viewOrder instanceof Array) {\n return _viewOrder;\n }\n else {\n return null;\n }\n })\n .filter(_viewOrder => {\n return _viewOrder !== null;\n })\n .map(_viewOrder => {\n let _zIndex = -1;\n return _viewOrder\n .map(_viewId => {\n const _view = _this.__views[_viewId];\n const _elemId = _view.elemId;\n if (_elemId) {\n _zIndex += 1;\n return [_elemId, _zIndex];\n }\n else {\n return null;\n }\n })\n .filter(_item => {\n return _item !== null;\n });\n })\n .forEach(_elemZIndexes => {\n _elemZIndexes.forEach(([_elemId, _zIndex]) => {\n ELEM.setStyle(_elemId, 'z-index', _zIndex, true);\n });\n });\n }", "function Emitter() {\r\n this.events = {};\r\n}", "function changedDescendants(old, cur, offset, f) {\n var oldSize = old.childCount, curSize = cur.childCount;\n outer: for (var i = 0, j = 0; i < curSize; i++) {\n var child = cur.child(i);\n for (var scan = j, e = Math.min(oldSize, i + 3); scan < e; scan++) {\n if (old.child(scan) == child) {\n j = scan + 1;\n offset += child.nodeSize;\n continue outer\n }\n }\n f(child, offset);\n if (j < oldSize && old.child(j).sameMarkup(child))\n { changedDescendants(old.child(j), child, offset + 1, f); }\n else\n { child.nodesBetween(0, child.content.size, f, offset + 1); }\n offset += child.nodeSize;\n }\n}", "render() {\n return (\n <div className=\"App\">\n <div>\n <span className=\"button1\" \n onClick={() => this.scrollToNode(this.red)}>\n Go to red</span>\n <span className=\"button2\" \n onClick={() => this.scrollToNode(this.green)}>\n Go to green</span>\n <span className=\"button3\" \n onClick={() => this.scrollToNode(this.yellow)}>\n Go to yellow</span>\n </div>\n <div className=\"container1\" ref={(node) => this.red = node}>\n <Hello color=\"red\" />\n </div>\n <div ref={(node) => this.green = node}>\n <Hello color=\"green\" />\n </div>\n <div ref={(node) => this.yellow = node}>\n <Hello color=\"yellow\" />\n </div>\n <span className=\"button1\" \n onClick={() => this.scrollToNode(this.red)}>\n Go to red</span> \n </div>\n );\n}", "function changedDescendants(old, cur, offset, f) {\n var oldSize = old.childCount, curSize = cur.childCount\n outer: for (var i = 0, j = 0; i < curSize; i++) {\n var child = cur.child(i)\n for (var scan = j, e = Math.min(oldSize, i + 3); scan < e; scan++) {\n if (old.child(scan) == child) {\n j = scan + 1\n offset += child.nodeSize\n continue outer\n }\n }\n f(child, offset)\n if (j < oldSize && old.child(j).sameMarkup(child))\n { changedDescendants(old.child(j), child, offset + 1, f) }\n else\n { child.nodesBetween(0, child.content.size, f, offset + 1) }\n offset += child.nodeSize\n }\n}", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n}", "constructor($from) {\n let $to = $from.node(0).resolve($from.pos + $from.nodeAfter.nodeSize)\n super($from, $to)\n // :: Node The selected node.\n this.node = $from.nodeAfter\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n \n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n \n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n \n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n \n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n \n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n \n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }" ]
[ "0.6935553", "0.51984113", "0.5137182", "0.50804555", "0.5039342", "0.49131727", "0.47989413", "0.4793834", "0.4783685", "0.47726554", "0.47673708", "0.46785817", "0.46739691", "0.46738926", "0.46738812", "0.46596697", "0.4644038", "0.46140343", "0.4613553", "0.4611032", "0.45987627", "0.45950767", "0.45858487", "0.45858487", "0.45858487", "0.4574881", "0.45740896", "0.4570801", "0.45657918", "0.45448068", "0.45360482", "0.45157093", "0.45113742", "0.45096862", "0.44914317", "0.4489302", "0.4473768", "0.44737616", "0.4434446", "0.4430041", "0.4412293", "0.44105613", "0.4410455", "0.43998018", "0.4397738", "0.4397738", "0.4397738", "0.43944582", "0.43944582", "0.4392554", "0.4391188", "0.43898398", "0.43866733", "0.43862292", "0.43853813", "0.43823528", "0.43802348", "0.43744344", "0.43559617", "0.43541554", "0.43481636", "0.43452948", "0.4339167", "0.4338976", "0.432822", "0.43266007", "0.4323792", "0.4322419", "0.43149194", "0.43129736", "0.43107542", "0.43103176", "0.4309709", "0.43085706", "0.42919168", "0.42856303", "0.42803395", "0.42769498", "0.42731613", "0.42729244", "0.42680424", "0.42680424", "0.42680424", "0.42587283", "0.42569342", "0.42551267", "0.42478973", "0.42441133", "0.4243618", "0.42430907", "0.42417663", "0.4241435", "0.42366254", "0.42366254", "0.42366254", "0.42366254", "0.42366254", "0.42366254", "0.42366254", "0.42366254" ]
0.69467854
0
Wrapper around OffsetEventEmitter to allow for listening and firing on instances of Place. Not an extension of EventEmitter, so not all of the original methods are necessarily supported.
function PlaceEventEmitter() { this._root = new OffsetEventEmitter(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OffsetEventEmitter() {\n EventEmitter.call(this);\n this._children = {};\n}", "function EventEmitter(){}// Shortcuts to improve speed and size", "function EventEmitter() {} // Shortcuts to improve speed and size", "function LokiEventEmitter() {}", "function LokiEventEmitter() {}", "function LokiEventEmitter() { }", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter() {}", "function EventEmitter(){}", "function EventEmitter(){}", "function EventEmitter() {\n }", "function EventEmitter() {\n }", "function EventEmitter(){\n}", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }" ]
[ "0.7669674", "0.6133002", "0.60935825", "0.6057339", "0.6057339", "0.5927509", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.59125257", "0.5800363", "0.5800363", "0.57319826", "0.57319826", "0.56898856", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821", "0.5642821" ]
0.8410292
0
Load the Google Analytics client library
function queryAccounts() { gapi.client.load('analytics', 'v3').then(function() { gapi.client.analytics.management.accounts.list().then(handleAccounts); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadGoogleAnalytics() {\n (function (i, s, o, g, r, a, m) {\n i['GoogleAnalyticsObject'] = r;\n i[r] = i[r] || function () {\n (i[r].q = i[r].q || []).push(arguments);\n }, i[r].l = 1 * new Date();\n a = s.createElement(o), m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src = g;\n m.parentNode.insertBefore(a, m);\n })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');\n\n ga('create', 'UA-71005337-1', 'auto');\n ga('send', 'pageview');\n}", "function gaLoad() {\r\n var ga = document.createElement('script');\r\n ga.type = 'text/javascript';\r\n ga.async = true;\r\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r\n var s = document.getElementsByTagName('script')[0];\r\n s.parentNode.insertBefore(ga, s);\r\n}", "function initAnalytics(){\n\tvar accountId = 'UA-2764682-9';\n\tjQuery.getScript('http://www.google-analytics.com/ga.js', function(){\n\t\ttry {\n\t\t\tvar pageTracker = _gat._getTracker(accountId);\n\t\t\tpageTracker._trackPageview();\n\t\t} catch(err) {}\n\t});\n}", "handleClientLoad() {\n this.gapi = window[\"gapi\"];\n var script = document.createElement(\"script\");\n script.src = \"https://apis.google.com/js/api.js\";\n document.body.appendChild(script);\n script.onload = () => {\n window[\"gapi\"].load(\"client:auth2\", this.initClient);\n };\n }", "handleClientLoad() {\n const script = document.createElement(\"script\");\n script.onload = () => {\n // Gapi isn't available immediately so we have to wait until it is to use gapi.\n this.loadClientWhenGapiReady(script);\n //window['gapi'].load('client:auth2', this.initClient);\n };\n script.src = \"https://apis.google.com/js/client.js\";\n document.body.appendChild(script);\n }", "function loadGaTransport() {\n if (!window['ga']) {\n window.ga = (...args) => {\n (ga.q = ga.q || []).push(args);\n };\n ga.l = 1*new Date();\n }\n return ga;\n}", "async function loadGapi() {\n //\n // Load gapi.js\n //\n if (window.gapi) {\n console.info('gapi.js already loaded.')\n } else {\n await logAction.promise(`loading ${GapiJavaScriptUrl}`, (resolve, reject) =>\n loadjs(GapiJavaScriptUrl, resolve, reject)\n )\n }\n\n //\n // Load and initialize client and auth2 libraries\n //\n let gapi = window.gapi\n await logAction.promise(`loading gapi modules ${GapiLibraries}`, (resolve, reject) =>\n gapi.load(GapiLibraries, { callback: resolve, onerror: reject })\n )\n return gapi\n}", "function initializeGoogleAnalytics(cb) {\n ga.initialize(cb);\n ga.trackOpen();\n}", "function loadLibrary() {\n\n if ( loaded ) {\n return onLibraryLoaded();\n }\n\n var googletag,\n gads,\n useSSL,\n node,\n readyStateLoaded = false\n ;\n\n window.googletag = window.googletag || {};\n window.googletag.cmd = window.googletag.cmd || [];\n\n // Called when GPT is Available\n window.googletag.cmd.push( onLibraryLoaded )\n\n gads = document.createElement( 'script' );\n gads.async = true;\n gads.type = 'text/javascript';\n gads.src = 'https://www.googletagservices.com/tag/js/gpt.js';\n\n node = document.getElementsByTagName( 'script' )[0];\n node.parentNode.insertBefore( gads, node );\n\n }", "function gaSSDSLoad(acct) {\n\t\"use strict\"; \n\tvar gaJsHost = ((\"https:\" === document.location.protocol) ? \"https://ssl.\" : \"http://www.\"),\n\tpageTracker,\n\ts;\n\ts = document.createElement('script');\n\ts.src = gaJsHost + 'google-analytics.com/ga.js';\n\ts.type = 'text/javascript';\n\ts.onloadDone = false;\n\tfunction init () {\n\t\tpageTracker = _gat._getTracker(acct);\n\t\tpageTracker._trackPageview();\n\t}\n\ts.onload = function () {\n\t\ts.onloadDone = true;\n\t\tinit();\n\t};\n\ts.onreadystatechange = function() {\n\t\tif (('loaded' === s.readyState || 'complete' === s.readyState) && !s.onloadDone) {\n\t\t\ts.onloadDone = true;\n\t\t\tinit();\n\t\t}\n\t};\n\tdocument.getElementsByTagName('head')[0].appendChild(s);\n}", "function apiClientLoad() {\n\n //gapi.client.load('oauth2', 'v2', apiClientLoaded);\n gapi.client.load('plus', 'v1', apiClientLoaded);\n}", "function getSDK() {\n return analytics;\n }", "function handleClientLoad() {\n gapi.load(\"client\", initClient);\n}", "handleClientLoad() {\n gapi.load(\"client:auth2\", this.initClient);\n }", "function _onLoad() {\n\t\t// Standard Google Universal Analytics code\n\t\t// noinspection OverlyComplexFunctionJS\n\t\t(function(i, s, o, g, r, a, m) {\n\t\t\ti['GoogleAnalyticsObject'] = r;\n\t\t\t// noinspection CommaExpressionJS\n\t\t\ti[r] = i[r] || function() {\n\t\t\t\t\t(i[r].q = i[r].q || []).push(arguments);\n\t\t\t\t}, i[r].l = 1 * new Date();\n\t\t\t// noinspection CommaExpressionJS\n\t\t\ta = s.createElement(o),\n\t\t\t\tm = s.getElementsByTagName(o)[0];\n\t\t\ta.async = 1;\n\t\t\ta.src = g;\n\t\t\tm.parentNode.insertBefore(a, m);\n\t\t})(window, document, 'script',\n\t\t\t'https://www.google-analytics.com/analytics.js', 'ga');\n\n\t\tga('create', TRACKING_ID, 'auto');\n\t\t// see: http://stackoverflow.com/a/22152353/1958200\n\t\tga('set', 'checkProtocolTask', function() { });\n\t\tga('require', 'displayfeatures');\n\t}", "function handleClientLoad() {\ngapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client', initClient);\n}", "function handleClientLoad() {\n // Load the API client and auth2 library\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\r\n gapi.load(\"client:auth2\", initClient);\r\n}", "function handleClientLoad() {\n console.log('Gapi client loaded successfully');\n console.log('Loading client module');\n gapi.load('client', () => {console.log('Google api client module loaded')});\n}", "function gaTracker(id){\n $.getScript('//www.google-analytics.com/analytics.js'); // jQuery shortcut\n window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;\n ga('create', id, 'auto');\n ga('send', 'pageview');\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n }", "function handleClientLoad() {\n gapi.load('client:auth2', initClient)\n}", "function handleClientLoad() {\n gapi.load(\"client:auth2\", initClient);\n}", "function handleClientLoad() {\n gapi.load(\"client:auth2\", initClient);\n}", "function handleClientLoad() {\n gapi.load(\"client:auth2\", initClient);\n}", "function handleClientLoad() {\n gapi.load(\"client:auth2\", initClient);\n}", "function handleClientLoad() {\n gapi.load(\"client:auth2\", initClient);\n}", "function handleClientLoad() {\r\n \"use strict\";\r\n gapi.load('client:auth2', initClient);\r\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n }", "function addGoogleAnalytics() {\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n ga('create', 'UA-84283855-1', 'auto');\n ga('send', 'pageview');\n}", "function loadGoogleMapsLibrary() {\r\n\t\tvar error;\r\n\t\terror = Estate.Check.ArgumentsCount(arguments.length, 0);\r\n\t\tif (error != \"\") throw new Error(error);\r\n\t\tif (mapKeysExists() == false) {\r\n\t\t\tthrow new Error(\"Cannot find an appropriate Google Maps key for this domain.\");\r\n\t\t}\r\n\r\n\t\tvar script = document.createElement(\"script\");\r\n\t\tscript.type = \"text/javascript\";\r\n\t\tscript.src = \"http://maps.google.com/maps?file=api&v=2.x&key=\" + getKey() + \"&async=2&callback=\" + config.instanceName + \".Init\";\r\n\t\tdocument.body.appendChild(script);\r\n\t}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\r\n gapi.load('client:auth2', initClient); //General syntax for gapi.load(): gapi.load(libraries, callbackFunction);\r\n}", "function handleClientLoad() {\r\n gapi.load('client:auth2', initClient);\r\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n }", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n }", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n }", "function initiateTracker() {\r\n\t\tvar _gaq = _gaq || [];\r\n\t\t_gaq.push([ '_setAccount', 'UA-29870367-2' ]);\r\n\t\t_gaq.push([ '_trackPageview' ]);\r\n\r\n\t\t(function() {\r\n\t\t\tvar ga = document.createElement('script');\r\n\t\t\tga.type = 'text/javascript';\r\n\t\t\tga.async = true;\r\n\t\t\tga.src = 'https://ssl.google-analytics.com/ga.js';\r\n\t\t\tvar s = document.getElementsByTagName('script')[0];\r\n\t\t\ts.parentNode.insertBefore(ga, s);\r\n\t\t})();\r\n\t}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n }", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n }", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n }", "function initGoogleAnalytics(trackingid, gtagId) {\n let gaScriptUrl = 'https://www.google-analytics.com/analytics.js';\n const gaDbg = getVal(\"wt.ga.dbg\", \"0\");\n if (gaDbg != '0') {\n gaScriptUrl = 'https://www.google-analytics.com/analytics_debug.js';\n }\n /**/\n (function(i, s, o, g, r, a, m) {\n i.GoogleAnalyticsObject = r;\n i[r] = i[r] || function() {\n (i[r].q = i[r].q || []).push(arguments);\n };\n i[r].l = 1 * new Date();\n a = s.createElement(o);\n m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src = g;\n a.onerror = function(err) {\n console.error(\"Google Analytics blocked. Ad blocker?\");\n };\n try {\n m.parentNode.insertBefore(a, m);\n } catch (err) {\n console.error(\"Google Analytics blocked. Ad blocker?\");\n }\n })(window, document, 'script', gaScriptUrl, 'ga');\n if (gaDbg === \"2\") {\n window.ga_debug = {trace: true};\n }\n ga('create', trackingid, 'auto');\n if (getBoolVal(\"wt.ga.off\", false)) {\n console.log('Turning off GA reporting');\n ga('set', 'sendHitTask', null);\n }\n ga('send', 'pageview');\n\n // GA4 - Global site tag (gtag.js) - Google Analytics\n if (!getBoolVal(\"wt.ga.off\", false) && gtagId) {\n let gtagJs = document.createElement('script');\n gtagJs.setAttribute('src', 'https://www.googletagmanager.com/gtag/js?id=' + gtagId);\n document.head.appendChild(gtagJs);\n\n window.dataLayer = window.dataLayer || [];\n window.gtag = function(){window.dataLayer.push(arguments);};\n window.gtag('js', new Date());\n const gtagCfg = (gaDbg != '0') ? { 'debug_mode': true } : {};\n window.gtag('config', gtagId, gtagCfg);\n } else {\n console.debug(\"gtag off\");\n }\n}", "function loadGmailApi() {\n gapi.client.setApiKey('AIzaSyA5d9KwNG-4h5BbbWsiLxeUnMlj1El8k84');\n gapi.client.load('gmail', 'v1');\n console.log(\"GAPI LOADED\");\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n init();\n}", "function handleClientLoad() {\n console.log(\"client load\")\n gapi.load('client:auth2', initClient);\n}", "function loadGoogleMapsApi() {\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = \"https://maps.googleapis.com/maps/api/js?key=\" + keys.googlemaps;\n document.head.appendChild(script);\n}", "function init() {\n gapi.load('auth2', function() {});\n}", "function loadCalendarApi() {\n console.log(\"loading calendar library\");\n gapi.client.load('calendar', 'v3', init);\n}", "function handleClientLoad() {\n gapi.load('client:auth2', initClient);\n }", "function loadLibraries() {\n gapi.load('client:auth2', {'callback': onClientLoad});\n gapi.load('picker', {'callback': () => { pickerApiLoaded = true; }});\n}", "function handleClientLoad() {\n\tgapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n\tgapi.load('client:auth2', initClient);\n}", "function handleClientLoad() {\n window.gapi.load('client:auth2', initClient);\n }", "function init() {\n gapi.load('client:auth2', initAuth);\n}", "async initClient() {\n this.gapi = window[\"gapi\"];\n const config = await this.getConfig();\n this.gapi.client\n .init(config.data)\n .then(() => {\n // Get the google auth instance\n this.GoogleAuth = this.gapi.auth2.getAuthInstance();\n if (!this.GoogleAuth) {\n throw new Error(\"Could not authorize Google API\");\n }\n\n // Listen for sign-in state changes.\n this.GoogleAuth.isSignedIn.listen(this.updateSigninStatus);\n\n // Handle the initial sign-in state.\n this.updateSigninStatus(this.GoogleAuth.isSignedIn.get());\n\n // Call the callback\n if (this.onLoadCallback) {\n this.onLoadCallback(this.signedIn);\n }\n })\n .catch((e) => {\n console.error(\"Error in setting up the google client:\");\n console.error(e);\n });\n }", "function loadScript() {\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp' +\n '&signed_in=false&callback=initialize';\n document.body.appendChild(script);\n}", "function handleClientLoad() {\n window.gapi.load('client:auth2', initClient);\n}", "function init() {\n if (!IS_ENABLED) {\n log('Analytics : IS_ENABLED is false, not init\\'ing');\n return;\n }\n if (window.hasOwnProperty('ga')) {\n log('Analytics : init : UA-16821714-5');\n ga('create', 'UA-16821714-5', 'auto');\n ga('send', 'pageview');\n\n bindClickFragments();\n } else {\n log('Analytics : init - no ga!');\n }\n\n _init = true;\n }", "function loadScript() {\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp' +\n '&key=AIzaSyDSR95TnB4HazUhCXzmZ_5EMeK2MYe_gxg'+\n '&libraries=drawing'+\n '&callback=initialize';\n document.body.appendChild(script);\n}", "function loadScript() {\n\tvar script = document.createElement('script');\n\tscript.type = 'text/javascript';\n\tscript.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp' + '&signed_in=false&callback=init';\n\tdocument.body.appendChild(script);\n}", "function googleApiClientReady() {\n loadAPIClientInterfaces();\n /*console.log(\"Getting ready\");\n gapi.auth.init(function() {\n window.setTimeout(checkAuth, 1);\n });*/\n}", "_initGtm() {\n var _a2;\n if (!SEnv2.is(\"production\") && !__isInIframe()) {\n console.log(`<yellow>[SFront]</yellow> Initializing tracking through the <magenta>google tag manager</magenta> with this id \"<cyan>${this.frontspec.google.gtm}</cyan>\"`);\n }\n const gtmScript = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\nnew Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\nj=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n})(window,document,'script','dataLayer','${this.frontspec.google.gtm}');`;\n const $script = document.createElement(\"script\");\n $script.innerHTML = gtmScript;\n $script.setAttribute(\"id\", \"s-front-gtm\");\n $script.setAttribute(\"type\", ((_a2 = this.frontspec.partytown) === null || _a2 === void 0 ? void 0 : _a2.enabled) ? \"text/partytown\" : \"text/javascript\");\n document.head.appendChild($script);\n }", "function gtw(){\n\t\t\n\t// Async API initialization. \n\tif(!gaConf.useSynchronousAPI) {\n\t\t// random var name for the account alias used in calls\n\t\tvar pfx = this.accountPrefix = \"haf\" + Math.floor(Math.random()*100) + \".\"; \n\t\t// Utility function for prefixing function calls with the account alias. \n\t\tfunction p(fnName) {\n\t\t\treturn pfx + fnName;\n\t\t}\n\t\t\n\t\twindow._gaq = window._gaq || [];\n\t\t\n\t\t// Get the account\n\t\t_gaq.push([p('_setAccount'), gaConf.account]);\t\t\n\t\t\n\t\t// Initialization methods are called through this. \n\t\tthis.setInit = function(fn, val) {\n\t\t\t_gaq.push([p(fn),val]);\n\t\t}\n\t\t\n\t\tthis.setCustomVar = function(index, name, value, opt_scope){\n\t\t\t_gaq.push([p('_setCustomVar'),index, name, value, opt_scope]);\n\t\t}\n\t\t\n\t\tthis.deleteCustomVar= function (index){\n\t\t\t_gaq.push([p('_deleteCustomVar'),index]);\n\t\t}\n\n\t\tthis.trackEvent = function(category, action, opt_label) {\n\t\t\t_gaq.push([p('_trackEvent'),category, action, opt_label]);\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\tthis.trackPageview = function (opt_pageURL){\n\t\t\tvar data = [p('_trackPageview')];\n\t\t\tif(opt_pageURL)\n\t\t\t\tdata.push(opt_pageURL);\n\t\t\t_gaq.push(data);\n\t\t}\n\t\t\n\t}\n\t// Sync API initialization. \n\telse {\n\t\t// Get the account\n\t\tvar tracker = _gat._getTracker(gaConf.account);\n\n\t\t// Initialization methods are called through this. \n\t\tthis.setInit = function(fn, val) {\n\t\t\ttracker[fn](val);\n\t\t}\n\n\t\tthis.setCustomVar = function(index, name, value, opt_scope){\n\t\t\ttracker._setCustomVar(index, name, value, opt_scope);\n\t\t}\n\t\t\n\t\tthis.deleteCustomVar= function (index){\n\t\t\ttracker._deleteCustomVar(index);\n\t\t}\n\t\t\n\t\tthis.trackEvent = function(category, action, opt_label) {\n\t\t\treturn tracker._trackEvent(category, action, opt_label);\n\t\t}\n\n\t\tthis.trackPageview = function (opt_pageURL){\n\t\t\ttracker._trackPageview(opt_pageURL);\n\t\t}\n\t\t\n\t}\n\t\n\t// Initial values and settings\n\tif (gaConf.domainName)\n\t\tthis.setInit('_setDomainName', gaConf.domainName);\t\t\n\n\t// allowHash is true by default, must look for the false value. \n\tvar allowHash = true;\n\tif (!(typeof gaConf.allowHash === 'undefined')) {\n\t\tallowHash = (gaConf.allowHash != \"false\");\t\t\n\t}\n\t\n\t// allowHash is true by default, only set to false if applies. \n\tif(!allowHash)\n\t\tthis.setInit('_setAllowHash', allowHash);\n\t\n\tif(gaConf.allowLinker)\n\t\tthis.setInit('_setAllowLinker', gaConf.allowLinker);\n\t\n\tif (gaConf.campaignCookieTimeout && !isNaN(gaConf.campaignCookieTimeout))\n\t\tthis.setInit('_setCampaignCookieTimeout', gaConf.campaignCookieTimeout);\n\t\n\tif (gaConf.sessionCookieTimeout && !isNaN(gaConf.sessionCookieTimeout))\n\t\tthis.setInit('_setSessionCookieTimeout', gaConf.sessionCookieTimeout);\n\t\n\tif (gaConf.visitorCookieTimeout && !isNaN(gaConf.visitorCookieTimeout))\n\t\tthis.setInit('_setVisitorCookieTimeout', gaConf.visitorCookieTimeout);\n\t\n}", "function loadScript() {\n var s = document.createElement(\"script\");\n s.src = \"https://maps.googleapis.com/maps/api/js?v=3.exp&\" +\n \"callback=initialize&libraries=places\";\n\n document.body.appendChild(s);\n }", "function onClientLoad() {\n console.log('onClientLoad');\n gapi.client.setApiKey('AIzaSyAP-3vnl3mxNhe2LPWaruEdRJI4rPl9Tx8');\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\n}", "function init() {\n myService = new google.gdata.analytics.AnalyticsService('gaExportAPI_acctSample_v2.0');\n scope = 'https://www.google.com/analytics/feeds';\n var button = document.getElementById('_ga_authButton');\n\n // Add a click handler to the Authentication button.\n button.onclick = function() {\n // Test if the user is not authenticated.\n if (!google.accounts.user.checkLogin(scope)) {\n // Authenticate the user.\n google.accounts.user.login(scope);\n } else {\n // Log the user out.\n google.accounts.user.logout();\n getStatus();\n }\n }\n getStatus();\n}", "function initGA() {\n if (analyticsTrackingId) {\n ReactGA.initialize(analyticsTrackingId)\n ReactGA.set({\n appName: environment || 'Production',\n appVersion: version\n })\n }\n}", "function onClientLoad() {\r\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\r\n}", "function onClientLoad() {\r\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\r\n}", "function loadGapi() {\n //'use strict';\n gapi.client.load('cycleendpoint', 'v1', function () {\n console.log(\"API Loaded\");\n // fetchData();\n });\n}", "function loadScript (url) {\n const index = window.document.getElementsByTagName('script')[0]\n const newScript = window.document.createElement('script')\n newScript.src = url\n newScript.async = true\n newScript.defer = true\n newScript.id = 'googleApiScript'\n index.parentNode.insertBefore(newScript, index)\n}", "async load() {\n\t\tif(gapi.client && gapi.client.oauth2) return gapi;\n\n\t\tconst apis = [{ \"name\": 'oauth2', \"version\": 'v2' }];\n\t\tvar options = {\n\t\t\tdiscoveryDocs: apis.map(api => this.apiToDiscoveryDoc(api)),\n\t\t\tclientId: this.clientId,\n\t\t\tscope: this.scopesString\n\t\t};\n\t\tawait this.loadAuth2();\n\t\t//await this.loadClientAuth2();\n\t\tawait this.initGapi(options);\n\t\tawait this.initAuth2();\n\t\tawait this.getCurrentUser();\n\t\treturn gapi;\n\t}", "function onClientLoad() {\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\n}", "function onClientLoad() {\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\n}", "function onClientLoad() {\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\n}", "function onClientLoad() {\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\n}", "function onClientLoad() {\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\n}", "function onClientLoad() {\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\n}", "function onClientLoad() {\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\n}", "function onClientLoad() {\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\n}", "function onClientLoad() {\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\n}", "function onClientLoad() {\n gapi.client.load('youtube', 'v3', onYouTubeApiLoad);\n}" ]
[ "0.723606", "0.70999223", "0.70138323", "0.6891897", "0.6887332", "0.67694545", "0.6648956", "0.64875066", "0.64681953", "0.64357466", "0.6371802", "0.6335416", "0.62964493", "0.6280137", "0.62377876", "0.6216007", "0.621135", "0.6210494", "0.61803883", "0.6161596", "0.6160085", "0.61496943", "0.61273694", "0.6107385", "0.6107385", "0.6107385", "0.6107385", "0.6107385", "0.60847616", "0.60730726", "0.60730726", "0.60730726", "0.60730726", "0.60730726", "0.60730726", "0.60730726", "0.60730726", "0.60730726", "0.60730726", "0.60730726", "0.60713226", "0.606053", "0.605188", "0.60474217", "0.60474217", "0.60474217", "0.60474217", "0.60474217", "0.60474217", "0.60474217", "0.60474217", "0.6034423", "0.60252047", "0.6022642", "0.6022642", "0.6022642", "0.5999541", "0.59877443", "0.59877443", "0.59877443", "0.59841263", "0.596535", "0.595603", "0.59507805", "0.59434944", "0.5924206", "0.5917728", "0.59152526", "0.59114075", "0.5901396", "0.5901396", "0.5899853", "0.5898306", "0.5891642", "0.5888201", "0.58859015", "0.58854145", "0.5874395", "0.585104", "0.58454657", "0.5834167", "0.5792149", "0.5773054", "0.57724816", "0.57540894", "0.5737797", "0.57326627", "0.57326627", "0.5730856", "0.5729606", "0.5726944", "0.5707268", "0.5707268", "0.5707268", "0.5707268", "0.5707268", "0.5707268", "0.5707268", "0.5707268", "0.5707268", "0.5707268" ]
0.0
-1
Insert User in Google Analytics Accounts
function insertUser() { var profiledata; var email = document.getElementById('email'); //Email Input Field var id = document.getElementById('account-id'); //Account ID input Field if( email.value == '' || id.value == '' ){ alert('Please fill out the field!!'); return; } else { var request = gapi.client.analytics.management.webproperties.list({ 'accountId': id.value }) request.execute(function (response) { if(response.code == 400 || response.code == 403 || response.code == 500){ alert('Invalid'); return; } else { profiledata = response; if (profiledata.result.items && profiledata.result.items.length) { var propertyId = profiledata.result.items[0].id; var accountId = id.value; var profileId = profiledata.result.items[0].defaultProfileId; var request = gapi.client.analytics.management.profileUserLinks.insert({ 'accountId': accountId, 'webPropertyId': propertyId, 'profileId': profileId, 'resource': { 'permissions': { 'effective': [ 'COLLABORATE', 'READ_AND_ANALYZE' ], 'local': [ 'COLLABORATE', 'READ_AND_ANALYZE' ] }, 'userRef': { 'email': email.value } } }); request.execute(function (response) { if(response.code == 400 || response.code == 403 || response.code == 500){ console.log(response); alert('Invalid'); return; } else { alert('User has been added succesfully'); console.log(response); return; } }); } } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addUser() {\n var user = {\n primaryEmail: '[email protected]',\n name: {\n givenName: 'Elizabeth',\n familyName: 'Smith'\n },\n // Generate a random password string.\n password: Math.random().toString(36)\n };\n user = AdminDirectory.Users.insert(user);\n Logger.log('User %s created with ID %s.', user.primaryEmail, user.id);\n}", "function storeUserCallback (err) {\n if (err) {console.log(\"account already in database, moving on\");}\n else {console.log(\"inserted user into db\");}\n //I set googleid as primary key so uniqueness is forced.\n }", "function addUserToCustomerIO(){\n if (hasSignedUp()) return;\n\n var email = $(\"#cio-email\").val();\n var firstName = $(\"#cio-firstname\").val();\n var source = $(\"#cio-source\").val();\n var id = email.replace('@', '_');\n id = id.replace('.', '_');\n\n _cio.identify({\n // Required Items\n id: id,\n email: email,\n created_at: Math.round( new Date().getTime()/1000), // seconds since the epoch\n\n // Optional (these are examples. You can name attributes what you wish)\n type: 'lead',\n first_name: firstName,\n source: 'leads',\n referrer: document.referrer\n });\n\n setSignedUp();\n }", "function storeGoogleUser(user = new User(), profile, token, callback) {\n console.log(profile.emails[0].value)\n user.google.id = profile.id\n user.google.token = token\n user.google.name = profile.displayName\n user.google.email = profile.emails[0].value\n user.save(err => {\n if (err) {\n throw err\n }\n callback(err, user)\n })\n}", "updateUser(googleId, email) {\n axios.post(`https://studyjs-ga.herokuapp.com/auth/google`, {\n googleId: googleId,\n username: email\n })\n .then((response) => {\n this.getUserData(localStorage.userToken)\n })\n .catch((err) => {console.log(err)})\n }", "function insert(data) {\n return baseService.post(`/api/campaigns/${data.user_id}`, data);\n}", "function registerUser(){\n Cloud.Users.create({\n username: \"push123x\",\n password: \"push123x\",\n password_confirmation: \"push123x\",\n first_name: \"Firstname\",\n last_name: \"Lastname\"\n }, function (e) {\n if (e.success) {\n \talert(\"User Created\");\n \tloginUser();\n } else {\n \talert(\"Error :\"+e.message);\n }\n });\n}", "function onSignIn(googleUser) {\n var profile = googleUser.getBasicProfile();\n console.log('ID: ' + profile.getId());\n console.log('Name: ' + profile.getName());\n console.log('Image URL: ' + profile.getImageUrl());\n console.log('Email: ' + profile.getEmail());\n console.log('id_token: ' + googleUser.getAuthResponse().id_token);\n \n //do not post all above info to the server because that is not secure.\n //just send the id_token\n \n var redirectUrl = 'account?action=login';\n \n //using jquery to post data dynamically\n var form = $('<form action=\"' + redirectUrl + '\" method=\"post\">' +\n '<input type=\"hidden\" name=\"id_token\" value=\"' +\n googleUser.getAuthResponse().id_token + '\" />' +\n '</form>');\n $('body').append(form);\n form.submit();\n}", "function onSignIn(googleUser) {\n var profile = googleUser.getBasicProfile();\n console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.\n console.log('Name: ' + profile.getName());\n console.log('Image URL: ' + profile.getImageUrl());\n console.log('Email: ' + profile.getEmail());\n\t \n\t // The ID token you need to pass to your backend:\n var id_token = googleUser.getAuthResponse().id_token;\n console.log(\"ID Token: \" + id_token);\n}", "function attachNewUserToIncident() {\n attachNewUser = true;\n $(\"#user_add_username\").val($(\"#user_name\").val());\n openAddUser();\n }", "function registerUser() {\n addUser()\n }", "setUser(id) {\n if (!this.service) {\n throw new Error('Google Analytics hasn\\'t been installed on this page');\n }\n if (this.enabled) {\n this.timeout(`user|${id}`, () => {\n console.log('Service', `Set user ID: ${id}`);\n this.service('set', 'userId', id);\n this.event('authentication', 'user-id available');\n }, 100);\n }\n }", "function setUserId(gtagFunction, analyticsId, id, options) {\r\n if (options && options.global) {\r\n gtagFunction(GtagCommand.SET, { 'user_id': id });\r\n }\r\n else {\r\n gtagFunction(GtagCommand.CONFIG, analyticsId, {\r\n update: true,\r\n 'user_id': id\r\n });\r\n }\r\n}", "function setUserId(gtagFunction, analyticsId, id, options) {\r\n if (options && options.global) {\r\n gtagFunction(GtagCommand.SET, { 'user_id': id });\r\n }\r\n else {\r\n gtagFunction(GtagCommand.CONFIG, analyticsId, {\r\n update: true,\r\n 'user_id': id\r\n });\r\n }\r\n}", "function onSignIn(googleUser) {\n\n var auth2 = gapi.auth2.getAuthInstance();\n auth2.disconnect();\n\n // useful data for your client-side scripts:\n let profile = googleUser.getBasicProfile();\n console.log(\"ID: \" + profile.getId());\n console.log('Full Name: ' + profile.getName());\n console.log('Given Name: ' + profile.getGivenName());\n console.log('Family Name: ' + profile.getFamilyName());\n console.log(\"Image URL: \" + profile.getImageUrl());\n console.log(\"Email: \" + profile.getEmail());\n let email = profile.getEmail();\n\n // if email matches RegEx (if its a valid email)\n const re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if(re.test(email)){\n // if email matches RegEx2 (if its a carnal mail)\n const re2=/^[^@\\s][email protected]$/;\n if(re2.test(email)){\n document.getElementById(\"msgError\").innerHTML = '';\n\n // ID token to pass to the backend:\n let id_token = googleUser.getAuthResponse().id_token;\n console.log(\"ID Token: \" + id_token);\n\n //ajax request to send data to the backend (to create user ?) so that we keep a trace of imports in database)\n $.ajax({\n type: \"POST\",\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n },\n url: \"user/login/\"+id_token ,\n data: {// all profile data\n _token : $('meta[name=\"csrf-token\"]').attr('content'),\n _token_google_client : id_token ,\n _id_google : profile.getId(),\n _full_name : profile.getName() ,\n _given_name : profile.getGivenName() ,\n _family_name : profile.getFamilyName() ,\n _image_url : profile.getImageUrl() ,\n _email : profile.getEmail(),\n },\n dataType: \"text\",\n //if succes then redirect to the dashboard with a session mail stored\n success:function(data) {\n console.log(data);\n window.location=\"/dashboard\"\n }\n });\n }else{\n //if email isnt a carnal mail\n document.getElementById(\"msgError\").innerHTML = \"Invalid email address, carnalmedia.com needed\";\n }\n }else{\n //if email isnt a valid email\n document.getElementById(\"msgError\").innerHTML = \"Please enter a valid email address.\";\n }\n\n\n }", "async function insertNewClientIntoDB() {\r\n const userEmail = sessionStorage.getItem('email');\r\n const userNickname = sessionStorage.getItem('nickname');\r\n const user = await getUserWithMail(userEmail);\r\n if (!user) {\r\n const userDataObj = {\r\n firstName: userNickname,\r\n lastName: \"\",\r\n dateOfBirth: \"\",\r\n phoneNumber: \"\",\r\n email: userEmail,\r\n role: \"user\"\r\n }\r\n\r\n await insertUser(userDataObj);\r\n\r\n }\r\n\r\n}", "function pushUserData(accountType){\n\tif (accountType === 'newAccount'){\t\n\t\tcreateUserInformation();\n\t}\n\tif (accountType === 'updateAccount'){\n\t\tupdateUserInformation();\n\t}\n}", "function insertUser(data) {\n\treturn db(\"team_members\").insert(data);\n}", "addNewUser({name, email, location}) {\n return mPool.collection(\"users\").\n insertOne({\n \"name\": name, \n \"email\": email,\n \"location\": location\n });\n }", "function register( trackingID_in, clientID_in, appName_in, appVersion_in, appID_in )\n{\n\tanalyticsVersion = 1;\n\tpropertyID = trackingID_in;\n\tclientID = clientID_in;\n\tappName = appName_in;\n\tappVersion = appVersion_in;\n\tappID = appID_in;\n\n}", "async registerUser(userInfo) {}", "function writeInitialUserData(userId, dAacc, email) {\n var database = firebase.database();\n firebase.database().ref('users/' + userId).set({\n dAaccount: dAacc,\n email: email,\n userExp: 0,\n coins: 0\n });\n }", "function insertNewUser({ username, firstname, lastname, email, password, admin }) {\n}", "function addToRegisteredUsers( obj ) {\n\t// alter this function if mongoDB is used later\n\tconsole.log(\"pushing the new user to the storage\");\n\tregisteredUsers.push(obj);\n\t//obj = {};\n}", "function writeUserData(userId, name, email, imageUrl) {\n firebase.database().ref('users/' + userId).set({\n username: name,\n email: email,\n profile_picture : imageUrl\n }).then(() =>\n firebase.database().ref('logins').push().set({\n userId: userId,\n email: email,\n logindate : Date()\n }) \n );\n }", "function onSignIn(googleUser) {\n // const profile = googleUser.getBasicProfile();\n const id_token = googleUser.getAuthResponse().id_token;\n $.ajax({\n url:`${url}/user/signin?loginVia=google`,\n method:'POST',\n headers:{\n token_id: id_token\n }\n })\n .done(response => {\n notif('top-end', 'success', 'Sign in Success');\n localStorage.setItem('token', response.token);\n user._id = response.userId;\n user.name = response.userName;\n isSignIn();\n })\n .fail(err => {\n notif('top-end', 'error', response.responseJSON.err)\n })\n}", "function createAccount(event) {\n event.preventDefault();\n var displayName = $('#userName').val();\n var email = $('#emailR').val();\n var password = $('#pwdR').val();\n var reenterPwd = $('#reenterpwd').val();\n\n firebase.auth().createUserWithEmailAndPassword(email, password)\n .then(function(user) {\n user.updateProfile({ displayName: displayName });\n $(\"#user-name\").html(\", \" + displayName);\n })\n .catch(function(error) {\n console.log('register error', error);\n });\n }", "function post_user(name, sub) {\n var key = datastore.key(USER);\n const new_user = { \"name\": name, \"sub\": sub };\n return datastore.save({ \"key\": key, \"data\": new_user }).then(() => { return key })\n}", "function addUserToDB(id , name) {\n url = serverURL + \"/sendUserInfo\";\n sendPostRequest(url, {'id': id,'name': name});\n}", "function onSignIn(googleUser) {\n var profile = googleUser.getBasicProfile();\n console.log('ID: ' + profile.getId()); \n console.log('Name: ' + profile.getName());\n console.log('Image URL: ' + profile.getImageUrl());\n console.log('Email: ' + profile.getEmail()); \n}", "function registerUser(){\r\n\tuserName = $(\"#userNameID\").val();//\"Ibrahim\";\r\n\tphoneNumber = $(\"#userPhoneNumber\").val();//\"01026357328\";\r\n\r\n\t/**analytics**/\r\n\tga('send', 'event', 'button', 'click', 'Register button');\r\n\t\r\n\tif(!validateRegisterationInfo(userName,phoneNumber)){\r\n\t\treturn;\r\n\t}\r\n\r\n\tnavigator.notification.activityStart(\"Please wait for registration process\", \"loading\");\r\n\tgetPhoneContacts();\r\n}", "function addUser(newCompanyName, newUsername, newPassword, newPhoneNumber) {\n // Make a new user object\n let userData = {\n company: newCompanyName,\n username: newUsername,\n password: newPassword,\n phoneNumber: newPhoneNumber,\n permission: \"customer\"\n };\n\n // Add it to the users branch in firebase\n addToBranch(\"users\", userData)\n}", "async function insertUser(db, option) {\n const curEmail = option.record.email;\n option.type = \"find\";\n option.query = { email: curEmail };\n let result = await dbUtil(db, option);\n if (result.length > 0) {\n log.debug(result);\n log.error(\"The email is already used for a user: \" + curEmail);\n return \"Please use another email address for user registration!\";\n }\n\n option.type = \"insertOne\";\n result = await dbUtil(db, option);\n const objectId = result.insertedId;\n log.info(\"New created user object id: \" + objectId);\n return objectId;\n}", "function onSignIn(googleUser) {\n var profile = googleUser.getBasicProfile();\n console.log('ID: ' + profile.getId());\n console.log('Name: ' + profile.getName());\n console.log('Image URL: ' + profile.getImageUrl());\n console.log('Email: ' + profile.getEmail());\n}", "function addUser() {\n }", "function create(opts, callback) {\n\tvar db = opts.db;\n\n\tvar username = opts.username;\n\tvar password = opts.password;\n\tvar email = opts.email;\n\tvar photoUrl = opts.photoUrl;\n\n\tif (!photoUrl) photoUrl = faker.image.avatar();\n\t\n\tvar ts = String.format(\"(NOW() - '{0} seconds'::INTERVAL)\", faker.random.number({min:0, max:864000}));\n\n\tvar statement = \n\t\"DO $$ \\n\" + \n\t\"DECLARE current_id integer;\\n\" + \n\t\"BEGIN\\n\" +\n\tsqlutil.formatInsertStatement('User', \n\t\t['username', 'password', 'email', 'photo_url', 'created_on'], \n\t\t[[username, password, email, photoUrl, {variable: ts}]], false) + \n\t' RETURNING uid INTO current_id;\\n' +\n\n\t\"INSERT INTO \\\"AnalyticsProfile\\\"(\\\"uid\\\", \\\"last_update\\\") VALUES (current_id, NOW());\\n\" +\n\t\"END $$;\";\n\n\t//console.log(statement);\n\n\tdb.query(statement, function(err, result) {\n\t\tif (callback) return callback(err, result);\n\t});\n\n\n}", "function addUser(data){\n console.log(\" User Added is: \"+data);\n}", "createUser(username, email){\n //Add user to User table with a unique key\n const userRef = firebase.database().ref('Users/').push({\n username,\n 'biography': '',\n email,\n 'first_name': '',\n 'last_name': '',\n 'profile_picture': \"https://firebasestorage.googleapis.com/v0/b/ecs165a.\" +\n \"appspot.com/o/default_profile_pic.png?alt=media&token\" +\n \"=fd2ec8c0-97a0-4dca-9170-cd6c4bf6efd3\"\n })\n //Add username to Username table\n firebase.database().ref('Usernames/').update({[username]: userRef.key });\n }", "function setFacebookUserInfo() {\n // sets end point in current json\n var ref = new Firebase(\"https://learninganalytics.firebaseio.com\");\n // sets endpoint level in json\n var usersRef = ref.child(\"users\");\n // gets email value from text input field\n var emailValue = $('#email-text-input').val();\n\n FB.api(\"/me\", function(response) {\n // send json object to firebase\n usersRef.push({\n LRSHTTPPassword: $('#individualLRSPass').val(),\n LRSHTTPUsername: $('#individualLRSUser').val(),\n email: emailValue,\n fbID: response.id,\n name: response.name\n });\n alert('Registration complete.');\n });\n}", "function create_user(userobject){\n\n}", "async signUp({ request, auth, response }) {\n const email = request.input(\"email\"); \n let userCheck = await User.findBy(\"email\", email);\n \n if (userCheck) {\n return _RL.existConflict(response,Antl.formatMessage('messages.userExists'));\n }\n \n let user = new User();\n user.firstName = request.input(\"firstName\");\n user.lastName = request.input(\"lastName\");\n user.email = email;\n user.password = request.input(\"password\");; \n user.accountType = request.input(\"accountType\"); \n user.deviceToken = request.input('deviceToken'); \n \n let user1 = await user.save();\n let thisuser = await User.findBy(\"email\", email);\n let accessToken = await auth.generate(thisuser);\n let tokenStore = new Token();\n tokenStore.user_id = thisuser.id;\n tokenStore.token = accessToken.token;\n tokenStore.type = accessToken.type;\n tokenStore = await tokenStore.save();\n \n let data = {\n user: user,\n accessToken: accessToken\n };\n return _RL.recordCreated(response,Antl.formatMessage('messages.register'),data);\n }", "function insertDB(tx, user) {\n // store the template SQL string\n var sql = 'INSERT INTO users (role, name, username, email, password, description) VALUES (?,?,?,?,?,?)';\n // execute the query with user information from the user object\n tx.executeSql(sql, [user.role, user.name, user.username, user.email, user.password, user.description], function(tx){registerSuccessDB(tx, user)}, errorCB);\n}", "async function insertUser(user, config, res) {\n let rows = [];\n console.log('GRIL: Starting checking user ' + user.primaryEmail);\n\n // uses the credentials for the Service Account with \n // G Suite Domain-Wide Delegation of Authority enabled\n // subject is the user to be processed\n const client = await new JWT({\n email: config.secretEmailKey,\n key: config.secretPrivateKey.replace(/\\\\n/g, '\\n'),\n subject: user.primaryEmail\n });\n const auth = await client.createScoped(\n ['https://mail.google.com/']\n );\n const gmail = google.gmail({ version: 'v1', auth });\n \n // get data for the user\n let userData = getUserData(user);\n\n // fetch all labels for the user\n var response = await gmail.users.labels.list({\n 'userId': user.primaryEmail\n });\n let labelData;\n let messagesData;\n var labels = response.data.labels;\n var labelFound;\n if (!labels || labels.length === 0) {\n console.log('No labels found');\n } else {\n for (var k = 0; k < labels.length; k++) {\n var label = labels[k];\n\n if (label.name === config.labelName) {\n labelFound = true;\n // get label data for user\n labelData = await getLabelData(labels, label, user, gmail);\n // get messages data for user\n messagesData = await getMessagesData(user, label.id, gmail, config.domain);\n break;\n }\n }\n }\n rows.push({...userData, ...labelData, ...messagesData});\n // TODO: Remove createLabel from config\n if (!labelFound && config.createLabel) {\n // user does not have the label, let's push it\n await gmail.users.labels.create({\n 'userId': user.primaryEmail,\n 'resource': {\n 'name': config.labelName,\n 'labelListVisibility': 'labelShow',\n 'messageListVisibility': 'show'\n }\n });\n }\n\n if (rows.length > 0) {\n await bigquery\n .dataset(config.datasetId)\n .table(config.tableId)\n .insert(rows);\n }\n res.status(200).send();\n}", "function addNewUser() {\n}", "_registerUser(id){\n\t\tthis.idUser = id;\n\t}", "registerUser({}, payload) {\n firebaseAuth.createUserWithEmailAndPassword(payload.email, payload.password)\n .then(response => {\n // Success\n // console.log(response)\n // Recover the id generated by firebase, we will use it in our\n // table.\n let userId = firebaseAuth.currentUser.uid\n // This part adds the user to our users table in the database\n // this is not on the auth system.\n firebaseDb.ref('users/' + userId).set({\n name: payload.name,\n email: payload.email,\n online: true\n })\n })\n .catch(error => {\n console.log(error.message)\n })\n }", "async function signUp(newUser) {\n const token = await ShareBnBApi.signUp(newUser);\n setToken(token);\n localStorage.setItem(\"token\", token);\n history.push(\"/\");\n }", "function insertUser(name, mail, phone) {\n\tfirebaseRef.push({\n\t\t//name and value\n\t\tNome: name,\n\t\tEmail: mail,\n\t\tTelefone: phone\n\t});\n\tshowData();\n}", "function register(user, onSuccess, onFailure) {\n let attributeList = []\n\n const dataEmail = {\n Name: 'email',\n Value: user.email\n };\n const dataTomoID = {\n Name: 'custom:tomo_id',\n Value: user.tomo_id\n };\n const dataAdmin = {\n Name: 'custom:admin',\n Value: user.admin\n }\n\n const attributeEmail = new AmazonCognitoIdentity.CognitoUserAttribute(dataEmail);\n const attributeTomoID = new AmazonCognitoIdentity.CognitoUserAttribute(dataTomoID);\n const attributeAdmin = new AmazonCognitoIdentity.CognitoUserAttribute(dataAdmin);\n\n attributeList.push(attributeEmail)\n attributeList.push(attributeTomoID)\n attributeList.push(attributeAdmin)\n\n console.log(\"Attributes\", JSON.stringify(attributeList))\n\n userPool.signUp(user.tomo_id, user.password, attributeList, null,\n function signUpCallback(err, result) {\n if (!err) {\n onSuccess(result);\n } else {\n onFailure(err);\n }\n }\n );\n }", "function registerUser(newUserObj, done) {\n logger.info(\"Inside service method - register user\");\n newUserObj.userId = uuidv4();\n usersDao.addUser(newUserObj, done);\n}", "function onSignIn(googleUser) {\n\n const {id_token} = googleUser.getAuthResponse()\n $.ajax({\n url: `${serverUrl}/user/googleSignIn`,\n method: 'POST',\n data: {id_token}\n })\n .done( signedInUser => {\n document.documentElement.scrollTop = 0;\n addTokenAfterSigned(signedInUser)\n console.log(\"User sign in\")\n })\n }", "function pushDemos(referrer, age, gender, location, id)\n{\n\n\t_gaq.push(['_setCustomVar',1,'Referrer', referrer, 1]);\n\t_gaq.push(['_setCustomVar',2,'Age', age, 1]);\n\t_gaq.push(['_setCustomVar',3,'Gender', gender, 1]);\n\t_gaq.push(['_setCustomVar',4,'Location', location, 1]);\n\t_gaq.push(['_setCustomVar',5,'FB_ID', id, 1]);\n\n\t// Shows that the data has been pushed in the console\n\twindow.console.log(\"Pushing the following to Google Analytics\");\n\twindow.console.log(referrer);\n\twindow.console.log(age);\n\twindow.console.log(gender);\n\twindow.console.log(location);\n\twindow.console.log(id);\n\n}", "function signup (e) {\n e.preventDefault ();\n fire\n .auth ()\n .createUserWithEmailAndPassword (data.email, data.password)\n .then (data => {\n console.log (data);\n })\n .catch (err => {\n console.log (err);\n \n });\n\n var db = fire.firestore ();\n db.collection ('users')\n .add ({\n email: data.email,\n phoneNo: data.phoneNo,\n name: data.name,\n dob: data.dob,\n })\n .then (() => {\n setLoader (true);\n })\n .catch (e => {\n alert ('Error', e.message);\n setLoader (true);\n });\n }", "function createNewUser(data){\n let msg = {\n jsonrpc: '2.0',\n id: '0',\n method: 'setUser',\n params: data,\n };\n console.log(\"Making new user request\" )\n doSend(msg); \n}", "function createUser(cedula,apellido,email, nombre, telefono, pass){\n const password = pass;\n var userId=\"\";\n \n auth.createUserWithEmailAndPassword(email, password)\n .then(function (event) {\n user = auth.currentUser;\n userId = user.uid;\n console.log(\"UserID: \"+userId);\n insertar(cedula,apellido,email, nombre, telefono, userId);\n })\n .catch(function(error) {\n alert(error.message);\n console.log(error.message);\n });\n}", "signUp(values, success, failure) {\n ApolloService.mutate({\n mutation: Mutations.SIGN_UP,\n variables: values\n }).then(data => { success(data.data.signUp) })\n .catch(error => failure(error));\n }", "function onSignIn(googleUser) {\n console.log('User signed in!');\n var profile = googleUser.getBasicProfile();\n //change userName text, img source, & email text based on profile\n $(\"h1\").text(\"Welcome, \" + profile.getName());\n // $(\"img\").attr(\"src\", profile.getImageUrl());\n // $(\".email\").text(profile.getEmail());\n}", "function customRegister(fnameString, lnameString, emailString, passwordString, cb)\n{\n\tvar ref = new Firebase(\"https://phoodbuddy.firebaseio.com\");\n\tref.createUser({\n\t\temail : emailString,\n\t\tpassword : passwordString\n\t}, function(error, userData) {\n\t\tif (error) {\n\t\t\tconsole.log(\"Error creating user:\", error);\n\t\t\tcb(false);\n\t\t} \n\t\telse \n\t\t{\n\n\t\t\tconsole.log(\"Successfully created user account with uid:\", userData);\n\t\t\tsetAccount(userData, fnameString, lnameString, emailString);\n\t\t\tcb(true);\n\t\t}\n\t});\n}", "function upsertUser(userData) {\n $.post(\"/api/user/create\", userData)\n .then(function(){\n localStorage.setItem(\"currentUser\", JSON.stringify(userData));\n localStorage.setItem(\"loggedIn\", true);\n window.location = \"/\"\n });\n }", "function insertNewUser(req, res, newuser) {\n newuser[\"following\"] = [];\n conn.collection('users').insert(newuser, function (err,docs) {\n if (err) {\n res.status(401).send('Error in registration');\n } else {\n passport.authenticate('local')(req, res, function () {\n res.send(req.user);\n })\n }\n });\n}", "function createSession(data) {\n firebase.auth().createUserWithEmailAndPassword(data.email, data.pass)\n .catch(function(error) {\n console.log(error);\n }); \n}", "function onGoogle() {\n\n const provider = new firebase.auth.GoogleAuthProvider();\n\n firebase.auth().signInWithPopup(provider)\n\n .then(result => {\n const user = result.user;\n createUser(user);\n })\n .catch(console.log)\n}", "function register(){\n newUser = {};\n newUser.email = profile.emails[0].value;\n newUser.name = profile.displayName;\n newUser.fbConnect = true;\n newUser.registerMe = true;\n \n return done(null, newUser);\n }", "onSignIn(googleUser) {\n console.log('Google Auth Response', googleUser);\n // We need to register an Observer on Firebase Auth to make sure auth is initialized.\n const unsubscribe = firebase.auth().onAuthStateChanged(function(firebaseUser) {\n unsubscribe();\n // Check if we are already signed-in Firebase with the correct user.\n if (!this.isUserEqual(googleUser, firebaseUser)) {\n // Build Firebase credential with the Google ID token.\n const credential = firebase.auth.GoogleAuthProvider.credential(\n googleUser.idToken,\n googleUser.accessToken\n );\n // Sign in with credential from the Google user.\n firebase.auth().signInWithCredential(credential)\n .then(function(result) {\n console.log('user signed in!');\n console.log('result.user.uid is', result.user.uid);\n console.log('firebase.auth() is', firebase.auth().currentUser.uid)\n\n if (result.additionalUserInfo.isNewUser) {\n firebase.database().ref(`/users/${result.user.uid}`)\n .set({\n gmail: result.user.email,\n first_name: result.additionalUserInfo.profile.given_name,\n created_at: Date.now()\n })\n } else {\n firebase.database().ref(`/users/${result.user.uid}`)\n .update({\n last_logged_in: Date.now()\n })\n }\n })\n .catch(function(error) {\n // Handle Errors here.\n const errorCode = error.code;\n const errorMessage = error.message;\n // The email of the user's account used.\n const email = error.email;\n // The firebase.auth.AuthCredential type that was used.\n const credential = error.credential;\n // ...\n });\n } else {\n console.log('User already signed-in to Firebase.');\n }\n }.bind(this));\n }", "addUserInfo(user) {\n return db(\"users_sleep\")\n .insert(user, \"id\")\n .then(([id]) =>\n db(\"users_sleep\")\n .where({ uid: user.uid })\n .then((uI) => uI.find((elem) => elem.id === id))\n );\n }", "function addToHistory(user1, user2, db) {\n db.run(`INSERT INTO histories (userID, spokentoID)\n VALUES ('${user1}', '${user2}');`);\n}", "function signup({ email, password, city, dateOfBirth, username }) {\n // create new user\n}", "function addUser(username, password, email)\n{\n var sqlQuery = `INSERT INTO users (username, password, email, data) VALUES (?, ?, ?, ?)`;\n dbCon.query(sqlQuery, [ username, password, email, null ], (err, res) => \n {\n if (err) throw err;\n console.log(\"User [\" + username + \"] successfully created\");\n });\n}", "function OpCreateAccount(evnt) {\n let username = document.getElementById('v-new-username').value.trim();\n let passwd = document.getElementById('v-new-password').value.trim();\n let useremail = document.getElementById('v-new-email').value.trim();\n\n // Logg('username=' + username + ', email=' + useremail);\n\n if (username.length < 1 || passwd.length < 2 || useremail.length < 5) {\n DisplayAccountError('You must specify a value for all three account fields');\n return;\n }\n\n CreateUserAccount(username, passwd, useremail)\n .then( () => {\n GetUserAccessToken(username, passwd)\n .then( accountTokenInfo => {\n GetDomainToken(accountTokenInfo)\n .then( domainToken => {\n DisplayDomainToken(domainToken);\n })\n .catch ( err => {\n DisplayError('Could not fetch domain token: ' + err);\n });\n })\n .catch ( err => {\n DisplayError('Could not fetch account token: ' + err);\n });\n })\n .catch ( err => {\n DisplayError('Could not create account: ' + err);\n });\n }", "function insertParticipant(values, callback) {\n\tquery(\"insert into participants(email, userid, name, prize, bouvet)\" + \n\t\t\"values ('\" + values.email + \"', '\" + values.userid + \"', '\" + values.name + \"', '\" + values.prize + \"', '\" + values.bouvet + \"');\", callback);\n}", "function createAchivementsUser(req, res, next) {\n if (validate(req, res)) {\n req.body.achievement_id = parseInt(req.body.achievement_id);\n db.none('insert into achievements_x_user(user_mail, achievement_id)' +\n 'values(${mail},${achievement_id})',\n req.body)\n .then(function() {\n res.status(200)\n .json({\n status: 'success',\n message: 'Inserted one Achivement per User'\n });\n })\n .catch(function(err) {\n res.status(500)\n .json({\n status: 'error',\n err: err\n });\n });\n }\n}", "function addUser() {\n const getParams = new URLSearchParams(location.search);\n const taskID = getParams.get('taskID');\n const userID = 1; // Get current userID from cookies?\n const params = new URLSearchParams('taskID=' + taskID + '&userID=' + userID);\n console.log('/task-add-user', params);\n fetch('/task-add-user', {method: 'post', body: params})\n .then(() => getTaskInfo());\n}", "function signUp(userInfo) {\n\t\t\tvar user = new Parse.User();\n\n\t\t\t// Add username by concatening first and last name\n\t\t\t// Once the use links his twitter account the username should \n\t\t\t//be his twitter's handle\n\t\t\tuser.set('username', userInfo.email);\n\n\t\t\t// Then add all the fields\n\t\t\tfor(var key in userInfo){\n\t\t\t\tuser.set(key, userInfo[key]);\n\t\t\t}\n\n\t\t\tuser.signUp(null, {\n\t\t\t success: success,\n\t\t\t error: error\n\t\t\t});\n\n\t\t\treturn defer.promise;\n\t\t}", "async function create_user (user_id) {\n // Check if user exist already\n var q = datastore.createQuery(USERS).filter('user_id', '=', user_id);\n\n var result = await datastore.runQuery(q);\n // Return user ID & stop running function if it exist\n if (result[0] != undefined && result[0].length > 0)\n return result[0][0].user_id;\n\n var key = datastore.key(USERS);\n var new_user = {\n \"user_id\": user_id, \n };\n var data = {\"key\": key, \"data\": new_user};\n\n return datastore.save(data)\n .then(() => {\n return key[\"id\"];\n });\n}", "function addUser(user){\n\treturn firebase.firestore().collection('users').doc(user.uid).set({\n\t\tfirstName: signup[\"firstName\"].value,\n\t\tlastName: signup[\"lastName\"].value,\n\t\tphone: signup[\"phone\"].value,\n\t\tschool: signup[\"school\"].value,\n\t\tgradDate: signup[\"gradDate\"].value,\n\t\tpremium: false\n\t});\n}", "setAccount(value) {\n super.put(\"account\", value);\n }", "function signUp(){\n auth.createUserWithEmailAndPassword(email, password)\n .then(() => {\n ToastAndroid.show(\"Account with email \" + email + \" created successfully!\", ToastAndroid.SHORT)\n navigation.navigate(\"Main\")\n }).catch(error => {\n alert(error.message)\n })\n }", "userRegistration() {\n let regUserName = document.querySelector(\"#regUserName\").value;\n let regEmail = document.querySelector(\"#regEmail\").value;\n let regPassword = document.querySelector(\"#regPassword\").value; // let regConfirmPassword = document.querySelector(\"#regUserName\").value\n\n _nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"POST\",\n \"dataBaseObject\": {\n \"userName\": regUserName,\n \"email\": regEmail,\n \"password\": regPassword\n }\n }).then(_nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"GET\",\n \"embedItem\": `?userName=${regUserName}`\n }).then(user => {\n console.log(user);\n user.forEach(x => {\n sessionStorage.setItem(\"userId\", x.id); //hides NOMAD heading\n\n $(\".t-border\").hide(); //hides the form\n\n $(\".form\").hide(); //displays navigatin bar\n\n _dashboard.default.createNavBar();\n\n let userId = sessionStorage.getItem(\"userId\"); //console.log verifying that credentials match and user is logged in\n\n console.log(\"logged in as\" + \" \" + x.userName);\n console.log(\"your user ID is: \" + userId);\n });\n }));\n }", "function onSignIn(googleUser) {\n console.log('User signed in!');\n var profile = googleUser.getBasicProfile();\n //change userName text, img source, & email text based on profile\n $(\".userName\").text(profile.getName());\n $(\"img\").attr(\"src\", profile.getImageUrl());\n $(\".email\").text(profile.getEmail());\n}", "function onSignIn(googleUser) {\n var profile = googleUser.getBasicProfile();\n console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.\n console.log('Name: ' + profile.getName());\n console.log('Image URL: ' + profile.getImageUrl());\n console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.\n\n var id_token = googleUser.getAuthResponse().id_token;\n\n var xhr = new XMLHttpRequest();\n xhr.open('POST', '/tokensignin');\n\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n window.location.replace(\"/user.html\");\n } else if (this.readyState == 4 && this.status == 401) {\n // login failed\n }\n };\n\n window.location.replace(\"/user.html\");\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(JSON.stringify({'idtoken': id_token}));\n}", "function writeUserData(Firstname, Surname, email, dob, height, weight){\n\n var userId = firebase.auth().currentUser.uid;\n\n console.log(userId);\n\n database.ref().child('users/' + userId + '/AccountInfo').set({\n Firstname: Firstname,\n Surname: Surname,\n email:email,\n dob: dob,\n height: height,\n weight: weight\n });\n}", "async function createAnAccount() {\n let userService = new UserService(process.env.MICRO_API_TOKEN);\n let rsp = await userService.create({\n email: \"[email protected]\",\n id: \"usrid-1\",\n password: \"mySecretPass123\",\n username: \"usrname-1\",\n });\n console.log(rsp);\n}", "function registerUser() {\n let email = $(\"#txtEmail\").val();\n let pass= $(\"#txtPassword\").val();\n let first= $('#txtFirst').val();\n let last = $('#txtLast').val();\n let age = $('#txtAge').val();\n let address = $('#txtAddress').val();\n let phone = $('#txtPhone').val();\n let payment = $('#txtPayment').val();\n let color = $('#txtColor').val();\n\n let user = new User(email, pass, first, last, age, address, phone, payment, color);\n console.log(user);\n\n saveUser(user); // This function is on the storeManager\n clearUser();\n\n}", "function upsertUser(userData) {\n $.post(\"/api/users\", userData).then(getUsers);\n }", "async function signUp(name, email, phone, password, street, number, neighborhood, reference) {\n setLoadingAuth(true);\n await firebase.auth().createUserWithEmailAndPassword(email, password)\n .then( async (value) => {\n let uid = value.user.uid;\n await firebase.database().ref('users').child(uid).set({\n name: name,\n street: street,\n number: number,\n neighborhood: neighborhood,\n reference: reference,\n email: email,\n phone: phone\n })\n .then(() => {\n let data = {\n uid: uid,\n name: name,\n street: street,\n number: number,\n neighborhood: neighborhood,\n reference: reference,\n email: email,\n phone: phone\n };\n setUser(data);\n storageUser(data);\n setLoadingAuth(false);\n })\n .catch(() => {\n alert(error.code);\n setLoadingAuth(false);\n })\n })\n .catch(() => {\n alert(error.code);\n setLoadingAuth(false);\n })\n }", "function triggerSignupEvent() {\n\t\tif (typeof ga !== 'undefined') {\n\t\t\tga('send', 'event', 'website', 'signup', 'signup', '1');\n\t\t}\n\t}", "function createUser() {}", "async register() {\n console.log('Register:', this.state.email, this.state.password);\n try {\n await firebase.auth()\n .createUserWithEmailAndPassword(this.state.email, this.state.password);\n AlertIOS.alert(\n 'Account created',\n // null,\n // [\n // {\n // text: 'OK',\n // onPress: this.tabHandler(2)\n // }\n // ]\n )\n } catch (error) {\n AlertIOS.alert(error.toString());\n }\n console.log('current user:', firebase.auth().currentUser);\n Keyboard.dismiss();\n }", "function signup(username, password) {\n // TODO: create new user\n}", "signIn(googleUser) {\n // TODO(jrobbins): Consider using profile pic.\n // let profile = googleUser.getBasicProfile();\n let idToken = googleUser.getAuthResponse().id_token;\n // We don't use doPost because we don't already have a XSRF token.\n return this.doFetch('/login', 'POST', {'id_token': idToken}, false);\n }", "async function addUser(req, res) {\n var username;\n let userAttribute;\n \n if (!req.body.full_name ||!req.body.address ||!req.body.email ) {\n return res.status(400).json(errorReturnsEntity.credentialsAreRequired);\n }\n \n username = req.body.email;\n\n userAttribute = [\n { Name: \"name\", Value: req.body.full_name },\n { Name: \"nickname\", Value: req.body.full_name },\n { Name: \"email\", Value: req.body.email },\n { Name: \"address\", Value: req.body.address }\n ];\n\n userLoginEntity.UserPoolId = process.env.COGNITO_USERPOOL_ID;\n delete userLoginEntity.AuthFlow;\n delete userLoginEntity.ClientId;\n delete userLoginEntity.AuthParameters;\n \n userRegisterEntity.ClientId = process.env.COGNITO_APP_CLIENT_NAME\n userRegisterEntity.Username = username\n userRegisterEntity.Password = Password\n userRegisterEntity.UserAttributes = UserAttributes\n userRegisterEntity.ValidationData = [{ Name: \"Test\", Value: \"STRING_VALUE\" }]\n\n try {\n let result = await cognito.signUp(userRegisterEntity).promise();\n res.status(200).json({code: 0,user_id: result.UserSub,});\n } catch (err) {\n // throw err\n res.status(400).json({ code: 1, message: err.message });\n }\n}", "function register(user) {\n return db('users').insert(user, ['id'])\n}", "function createNewUser(ctx) {\n console.log(\"From Authentication: createNewUser\");\n const email = Utility_1.generateRandomEmail(); // ...do we need this?\n auth\n .createUserWithEmailAndPassword(email, Constants_1.DEFAULT_PASSWORD)\n .then(() => {\n // add new uid to persistent storage\n const currentUserId = auth.currentUser.uid;\n ctx.globalState.update(\"cachedUserId\", currentUserId);\n console.log(\"Successfully created new user\");\n console.log(\"cachedUserId is: \" + ctx.globalState.get(\"cachedUserId\"));\n addNewUserDocToDb(currentUserId);\n return true;\n })\n .catch((e) => {\n console.log(e.message);\n return false;\n });\n}", "function addProfiles(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Profiles.collection.insert(data);\n}", "function newuser(data) {\n\tvar x = 1;\n\tvar id = random_id();\n\twhile(exists(id)) {\n\t\tid = random_id();\n\t}\n\tdata.visits = 1;\n\tdata.last_visit = Date.now();\n\tfirebase.database().ref('users/' + id).set(data);\n\trequest('http://api.ipstack.com/' + data.last_ip + '?access_key=' + config.ipstack_api_key + '&fields=longitude,latitude', function (error, response, body) {\n\t if (!error && response.statusCode == 200) {\n\t \tvar json = JSON.parse(body)\n\t \tfirebase.database().ref('users/' + id + '/last_location').set({\n\t\t\t\tlongitude: json.longitude,\n\t\t\t\tlatitude: json.latitude\n\t\t\t})\n\t }\n\t})\n\treturn id;\n}", "function addNewUser(name){\n var user={\n id:name,\n //new user always starts in this sector\n sector:\"000:000\",\n highscore:0,\n //user has random position\n x: randomInt(MIN_POS,MAX_POS),\n y:randomInt(MIN_POS,MAX_POS),\n };\n firebase.database().ref(\"users/\"+name).set(user);\n }", "async function createAccount() {\n user.signUp()\n .then(response => {\n if (typeof document !== 'undefined') return document.write('Signed up successfully!');\n console.log('Signed up user', response);\n }).catch( error => {\n if (typeof document !== 'undefined') return document.write(`Error while signing up: ${JSON.stringify(error)}`);\n console.log('Error while signing up', error)\n });\n}", "function addUser() {\r\n user_name = document.getElementById(\"user_name\").value;\r\n firebase.database().ref(\"/\").child(user_name).child(user_name).update({\r\n purpose: \"adding user\"\r\n })\r\n }", "function signup(username, password, email, dateOfBirth, city) {\n // TODO: create new user\n}", "function signup(username, password, email, dateOfBirth, city) {\n // TODO: create new user\n}" ]
[ "0.6451452", "0.6419818", "0.6313721", "0.6161532", "0.61206234", "0.6060208", "0.6040147", "0.6021", "0.5988509", "0.59821326", "0.5913855", "0.5874089", "0.5868384", "0.5868384", "0.5868341", "0.5867974", "0.5854902", "0.58396184", "0.5795388", "0.57788146", "0.5764151", "0.57614875", "0.57582814", "0.57265264", "0.57095623", "0.57018834", "0.5697301", "0.5689081", "0.5682238", "0.5676828", "0.5665513", "0.5648949", "0.56401175", "0.5629201", "0.56183594", "0.56047815", "0.5599473", "0.5598519", "0.55967337", "0.55959374", "0.5592687", "0.5592465", "0.5589005", "0.55857414", "0.5583797", "0.5578674", "0.5578105", "0.55716795", "0.5557055", "0.5550628", "0.554849", "0.5539489", "0.5529703", "0.55165124", "0.55152214", "0.5508401", "0.5502893", "0.55009913", "0.54927504", "0.548162", "0.5481303", "0.5478186", "0.5465631", "0.54571086", "0.5455769", "0.5448247", "0.54482263", "0.5446933", "0.5446792", "0.5444679", "0.54432553", "0.5435532", "0.54338557", "0.5424863", "0.542374", "0.54222304", "0.5421731", "0.54205006", "0.5409424", "0.5403202", "0.5395505", "0.53807837", "0.5373627", "0.53692764", "0.5365487", "0.536056", "0.5356949", "0.5354119", "0.53496134", "0.5346157", "0.53376424", "0.5336007", "0.53337866", "0.53320014", "0.5324876", "0.53236085", "0.5323566", "0.5318742", "0.53178424", "0.53178424" ]
0.6815875
0
Init line chart button listeners
initLineChartButtons() { // add the Line chart buttons to the feature panel for (let i = 0; i < this.swarm_features.length; i++) { let capitalized_feature_string = this.swarm_features[i].split('_').join(' '); capitalized_feature_string = capitalized_feature_string.charAt(0).toUpperCase() + capitalized_feature_string.slice(1); $('#line-chart-feature-checkboxes') .append('<tr><th> <div class="pretty p-switch p-fill p-bigger"><input type="checkbox" class="line-chart-check-box" id="draw-' + this.swarm_features[i] + '" data="#' + this.swarm_features[i] + 'Line" /><div class="state"><label>' + capitalized_feature_string + '</label></div></div></th></tr>'); } $('.line-chart-check-box').change(function() { let checkbox = $(this); if (checkbox.prop('checked')) { $(checkbox.attr('data')).show(); } else { $(checkbox.attr('data')).hide(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SVGLineChart() {\r\n }", "_addEventsXAxis(btnDecrease, btnIncrease){\n $(btnDecrease).click(() => { this.zoomXAxis(false); });\n $(btnIncrease).click(() => { this.zoomXAxis(true); });\n }", "function initLine() {\n console.log(\"Initializing line chart...\");\n\n // Get current pdf data\n pdf = getCurrentPDF();\n pdfF = getCurrentPDFFemale();\n pdfM = getCurrentPDFMale();\n\n // Init filter options\n addFilterMenu();\n\n // Init axes\n drawAxes();\n\n // Draw new lines\n if ([\"f\",\"cmp\"].includes(selectedGender)){\n drawLines(getSelection(\"f\"), selectedGender==\"cmp\");\n }\n if ([\"m\",\"cmp\"].includes(selectedGender)){\n drawLines(getSelection(\"m\"), false);\n }\n if (\"all\" == selectedGender){\n drawLines(getSelection(\"all\"), false);\n }\n\n console.log(\"Done.\");\n\n // Stop loader animation\n d3.selectAll('.spinningLine').classed('hidden', true);\n}", "function init() {\n if (!buttons || !graph || !container || !infoQuantity || !infoDuration) {\n console.error('could not find all necessary elements');\n return;\n }\n\n buttons.forEach((button) => {\n button.addEventListener('click', _handleButtonClick);\n });\n\n CHART_CONTEXT = graph.getContext('2d');\n}", "function process_click_chart(ele) {\n\n var url = ele.attr('key');\n\n var jqxhr = $.getJSON(url, function() {\n console.log('successful get');\n })\n .done( function(data) {\n\n var chart_labels = [];\n var chart_data = [];\n\n for (var key in data) {\n chart_labels.push(key);\n chart_data.push(data[key]);\n }\n\n if (chart_data.length == 1 && chart_labels.length == 1) {\n chart_data.push(null);\n chart_data.unshift(null);\n chart_labels.push('');\n chart_labels.unshift('');\n }\n\n console.log(chart_data);\n\n var myLineChart = new Chart(ele, {\n type: 'line',\n data: {\n\n labels: chart_labels,\n datasets: [{\n label: 'Number of clicks',\n data: chart_data,\n backgroundColor:\n 'rgba(66, 139, 202, 0.50)',\n borderColor:\n 'rgba(66, 139, 202, 0.50)',\n hoverBackgroundColor:\n 'rgba(66, 139, 202, 0.50)',\n borderWidth: 1,\n }]\n },\n\n options: {\n scales: {\n yAxes: [{\n ticks: {\n min: 0,\n stepSize: calculate_step( find_max(chart_data) ),\n }\n }]\n }\n }\n });\n\n });\n}", "_registerListeners() {\n\t\teventManager.addEventListener('approximationsUpdated', this.buildChart.bind(this));\n\t}", "_initEvents() {\n document.documentElement.addEventListener(Globals.colorAttributeChange, (event) => {\n this._horizontalTooltipChart && this._horizontalTooltipChart.destroy();\n this._initCustomTooltipBar();\n });\n }", "function initStepToolbarEventHandler() {\n initAddFieldSetEventHandler();\n initPreviewToggle();\n }", "function componentLineChart () {\n\n /* Default Properties */\n var width = 400;\n var height = 400;\n var transition = { ease: d3.easeLinear, duration: 0 };\n var colors = palette.categorical(3);\n var colorScale = void 0;\n var xScale = void 0;\n var yScale = void 0;\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n var classed = \"lineChart\";\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\n var _dataTransform$summar = dataTransform(data).summary(),\n rowKeys = _dataTransform$summar.rowKeys,\n valueMax = _dataTransform$summar.valueMax;\n\n var valueExtent = [0, valueMax];\n\n // TODO: Use dataTransform() to calculate date domains?\n var dateDomain = d3.extent(data[0].values, function (d) {\n return d.key;\n });\n\n if (typeof colorScale === \"undefined\") {\n colorScale = d3.scaleOrdinal().domain(rowKeys).range(colors);\n }\n\n if (typeof xScale === \"undefined\") {\n xScale = d3.scaleTime().domain(dateDomain).range([0, width]);\n }\n\n if (typeof yScale === \"undefined\") {\n yScale = d3.scaleLinear().domain(valueExtent).range([height, 0]).nice();\n }\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias lineChart\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n init(selection.data());\n selection.each(function () {\n\n // Line generation function\n var line = d3.line().curve(d3.curveCardinal).x(function (d) {\n return xScale(d.key);\n }).y(function (d) {\n return yScale(d.value);\n });\n\n // Line animation tween\n var pathTween = function pathTween(data) {\n var interpolate = d3.scaleQuantile().domain([0, 1]).range(d3.range(1, data.length + 1));\n return function (t) {\n return line(data.slice(0, interpolate(t)));\n };\n };\n\n // Update series group\n var seriesGroup = d3.select(this);\n seriesGroup.classed(classed, true).attr(\"id\", function (d) {\n return d.key;\n }).on(\"mouseover\", function (d) {\n dispatch.call(\"customSeriesMouseOver\", this, d);\n }).on(\"click\", function (d) {\n dispatch.call(\"customSeriesClick\", this, d);\n });\n\n // Create series group\n var seriesLine = seriesGroup.selectAll(\".seriesLine\").data(function (d) {\n return [d];\n });\n\n seriesLine.enter().append(\"path\").attr(\"class\", \"seriesLine\").attr(\"stroke-width\", 1.5).attr(\"stroke\", function (d) {\n return colorScale(d.key);\n }).attr(\"fill\", \"none\").merge(seriesLine).transition().duration(transition.duration).attrTween(\"d\", function (d) {\n return pathTween(d.values);\n });\n\n seriesLine.exit().transition().style(\"opacity\", 0).remove();\n });\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n my.colorScale = function (_v) {\n if (!arguments.length) return colorScale;\n colorScale = _v;\n return my;\n };\n\n /**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n my.colors = function (_v) {\n if (!arguments.length) return colors;\n colors = _v;\n return my;\n };\n\n /**\n * X Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.xScale = function (_v) {\n if (!arguments.length) return xScale;\n xScale = _v;\n return my;\n };\n\n /**\n * Y Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 scale.\n * @returns {*}\n */\n my.yScale = function (_v) {\n if (!arguments.length) return yScale;\n yScale = _v;\n return my;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch On Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "function chartLineChart () {\n\n /* Default Properties */\n var svg = void 0;\n var chart = void 0;\n var classed = \"lineChart\";\n var width = 400;\n var height = 300;\n var margin = { top: 20, right: 20, bottom: 40, left: 40 };\n var transition = { ease: d3.easeBounce, duration: 500 };\n var colors = palette.categorical(3);\n var dispatch = d3.dispatch(\"customValueMouseOver\", \"customValueMouseOut\", \"customValueClick\", \"customSeriesMouseOver\", \"customSeriesMouseOut\", \"customSeriesClick\");\n\n /* Chart Dimensions */\n var chartW = void 0;\n var chartH = void 0;\n\n /* Scales */\n var xScale = void 0;\n var yScale = void 0;\n var colorScale = void 0;\n\n /* Other Customisation Options */\n var yAxisLabel = null;\n\n /**\n * Initialise Data and Scales\n *\n * @private\n * @param {Array} data - Chart data.\n */\n function init(data) {\n chartW = width - margin.left - margin.right;\n chartH = height - margin.top - margin.bottom;\n\n var _dataTransform$summar = dataTransform(data).summary(),\n rowKeys = _dataTransform$summar.rowKeys,\n valueMax = _dataTransform$summar.valueMax;\n\n var valueExtent = [0, valueMax];\n\n // TODO: Use dataTransform() to calculate date domains?\n data.forEach(function (d, i) {\n d.values.forEach(function (b, j) {\n data[i].values[j].key = new Date(b.key * 1000);\n });\n });\n var dateDomain = d3.extent(data[0].values, function (d) {\n return d.key;\n });\n\n if (typeof colorScale === \"undefined\") {\n colorScale = d3.scaleOrdinal().domain(rowKeys).range(colors);\n }\n\n xScale = d3.scaleTime().domain(dateDomain).range([0, chartW]);\n\n yScale = d3.scaleLinear().domain(valueExtent).range([chartH, 0]).nice();\n }\n\n /**\n * Constructor\n *\n * @constructor\n * @alias lineChart\n * @param {d3.selection} selection - The chart holder D3 selection.\n */\n function my(selection) {\n // Create SVG element (if it does not exist already)\n if (!svg) {\n svg = function (selection) {\n var el = selection._groups[0][0];\n if (!!el.ownerSVGElement || el.tagName === \"svg\") {\n return selection;\n } else {\n return selection.append(\"svg\");\n }\n }(selection);\n\n svg.classed(\"d3ez\", true).attr(\"width\", width).attr(\"height\", height);\n\n chart = svg.append(\"g\").classed(\"chart\", true);\n } else {\n chart = selection.select(\".chart\");\n }\n\n // Update the chart dimensions and add layer groups\n var layers = [\"zoomArea\", \"lineGroups\", \"xAxis axis\", \"yAxis axis\"];\n chart.classed(classed, true).attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\").attr(\"width\", chartW).attr(\"height\", chartH).selectAll(\"g\").data(layers).enter().append(\"g\").attr(\"class\", function (d) {\n return d;\n });\n\n selection.each(function (data) {\n // Initialise Data\n init(data);\n\n // Add Clip Path (Proof of Concept)\n chart.append('defs').append('clipPath').attr('id', 'plotAreaClip').append('rect').attr('width', chartW).attr('height', chartH);\n\n // Line Chart\n var lineChart = component.lineChart().width(chartW).height(chartH).colorScale(colorScale).xScale(xScale).yScale(yScale).dispatch(dispatch);\n\n // Scatter Plot\n var scatterPlot = component.scatterPlot().width(chartW).height(chartH).colorScale(colorScale).yScale(yScale).xScale(xScale).dispatch(dispatch);\n\n var lineGroups = chart.select(\".lineGroups\").attr('clip-path', \"url(\" + window.location + \"#plotAreaClip)\").append(\"g\");\n\n var seriesGroup = lineGroups.selectAll(\".seriesGroup\").data(data);\n\n seriesGroup.enter().append(\"g\").attr(\"class\", \"seriesGroup\").style(\"fill\", function (d) {\n return colorScale(d.key);\n }).merge(seriesGroup).call(lineChart).call(scatterPlot);\n\n seriesGroup.exit().remove();\n\n // X Axis\n var xAxis = d3.axisBottom(xScale).tickFormat(d3.timeFormat(\"%d-%b-%y\"));\n\n chart.select(\".xAxis\").attr(\"transform\", \"translate(0,\" + chartH + \")\").call(xAxis).selectAll(\"text\").style(\"text-anchor\", \"end\").attr(\"dx\", \"-.8em\").attr(\"dy\", \".15em\").attr(\"transform\", \"rotate(-65)\");\n\n // Y Axis\n var yAxis = d3.axisLeft(yScale);\n\n chart.select(\".yAxis\").call(yAxis).append(\"text\").attr(\"transform\", \"rotate(-90)\").attr(\"y\", -40).attr(\"dy\", \".71em\").attr(\"fill\", \"#000000\").style(\"text-anchor\", \"end\").text(yAxisLabel);\n\n // Zoom\n var zoom = d3.zoom().extent([[0, 0], [chartW, chartH]]).scaleExtent([1, 8]).translateExtent([[0, 0], [chartW, chartH]]).on(\"zoom\", zoomed);\n\n chart.select(\".zoomArea\").append(\"rect\").attr(\"width\", chartW).attr(\"height\", chartH).attr(\"fill\", \"none\").attr(\"pointer-events\", \"all\").call(zoom);\n\n function zoomed() {\n var xScaleZoomed = d3.event.transform.rescaleX(xScale);\n\n xAxis.scale(xScaleZoomed);\n lineChart.xScale(xScaleZoomed);\n scatterPlot.xScale(xScaleZoomed);\n\n chart.select(\".xAxis\").call(xAxis).selectAll(\"text\").style(\"text-anchor\", \"end\").attr(\"dx\", \"-.8em\").attr(\"dy\", \".15em\").attr(\"transform\", \"rotate(-65)\");\n\n lineGroups.selectAll(\".seriesGroup\").call(lineChart).call(scatterPlot);\n }\n });\n }\n\n /**\n * Width Getter / Setter\n *\n * @param {number} _v - Width in px.\n * @returns {*}\n */\n my.width = function (_v) {\n if (!arguments.length) return width;\n width = _v;\n return this;\n };\n\n /**\n * Height Getter / Setter\n *\n * @param {number} _v - Height in px.\n * @returns {*}\n */\n my.height = function (_v) {\n if (!arguments.length) return height;\n height = _v;\n return this;\n };\n\n /**\n * Margin Getter / Setter\n *\n * @param {number} _v - Margin in px.\n * @returns {*}\n */\n my.margin = function (_v) {\n if (!arguments.length) return margin;\n margin = _v;\n return this;\n };\n\n /**\n * Y Axix Label Getter / Setter\n *\n * @param {number} _v - Label text.\n * @returns {*}\n */\n my.yAxisLabel = function (_v) {\n if (!arguments.length) return yAxisLabel;\n yAxisLabel = _v;\n return this;\n };\n\n /**\n * Transition Getter / Setter\n *\n * @param {d3.transition} _v - D3 transition style.\n * @returns {*}\n */\n my.transition = function (_v) {\n if (!arguments.length) return transition;\n transition = _v;\n return this;\n };\n\n /**\n * Colors Getter / Setter\n *\n * @param {Array} _v - Array of colours used by color scale.\n * @returns {*}\n */\n my.colors = function (_v) {\n if (!arguments.length) return colors;\n colors = _v;\n return this;\n };\n\n /**\n * Color Scale Getter / Setter\n *\n * @param {d3.scale} _v - D3 color scale.\n * @returns {*}\n */\n my.colorScale = function (_v) {\n if (!arguments.length) return colorScale;\n colorScale = _v;\n return this;\n };\n\n /**\n * Dispatch Getter / Setter\n *\n * @param {d3.dispatch} _v - Dispatch event handler.\n * @returns {*}\n */\n my.dispatch = function (_v) {\n if (!arguments.length) return dispatch();\n dispatch = _v;\n return this;\n };\n\n /**\n * Dispatch On Getter\n *\n * @returns {*}\n */\n my.on = function () {\n var value = dispatch.on.apply(dispatch, arguments);\n return value === dispatch ? my : value;\n };\n\n return my;\n }", "function initCharts(charts) {\n\n var chartLines = {\n series: {\n lines: {\n show: true,\n lineWidth: 1,\n fill: true,\n fillColor: { colors: [ { opacity: 0.1 }, { opacity: 0.13 } ] }\n },\n points: {\n show: true,\n lineWidth: 2,\n radius: 3\n },\n shadowSize: 0,\n stack: true\n },\n grid: {\n hoverable: true,\n clickable: true,\n tickColor: \"#f9f9f9\",\n borderWidth: 0\n },\n legend: {\n show: true,\n labelBoxBorderColor: \"#fff\"\n },\n colors: [\"#a7b5c5\", \"#30a0eb\"],\n xaxis: {\n ticks: [[1, \"Jan\"], [2, \"Feb\"], [3, \"Mar\"], [4, \"Apr\"], [5, \"May\"], [6, \"Jun\"],\n [7, \"Jul\"], [8, \"Aug\"], [9, \"Sep\"], [10, \"Oct\"], [11, \"Nov\"], [12, \"Dec\"]],\n font: {\n size: 12,\n family: \"Open Sans, Arial\",\n color: \"#697695\"\n }\n },\n yaxis: {\n ticks: 3,\n tickDecimals: 0,\n font: {size: 12, color: \"#9da3a9\"}\n }\n };\n // A custom label formatter used by several of the plots\n\n function labelFormatter(label, series) {\n return \"<div class='chart-label'>\" + label + \"<br/>\" + Math.round(series.percent) + \"%</div>\";\n }\n var zoomOpts = {\n series: {\n lines: {\n show: true\n },\n shadowSize: 0\n },\n colors: [\"#30a0eb\"],\n xaxis: {\n zoomRange: [0.1, 10],\n panRange: [-10, 10]\n },\n yaxis: {\n zoomRange: [0.1, 10],\n panRange: [-10, 10]\n },\n zoom: {\n interactive: true\n },\n pan: {\n interactive: true\n },\n grid: {\n tickColor: \"#f9f9f9\",\n borderColor: \"#fff\"\n }\n }\n var chartBars = {\n series: {\n bars: {\n show: true,\n lineWidth: 1,\n fill: true,\n fillColor: { colors: [ { opacity: 0.1 }, { opacity: 0.13 } ] }\n }\n },\n legend: {\n show: true,\n labelBoxBorderColor: \"#fff\"\n },\n colors: [\"#30a0eb\"],\n bars: {\n horizontal: false,\n barWidth: 0.7\n },\n grid: {\n hoverable: true,\n clickable: true,\n tickColor: \"#f9f9f9\",\n borderWidth: 0\n },\n xaxis: {\n ticks: [[1, \"Jan\"], [2, \"Feb\"], [3, \"Mar\"], [4, \"Apr\"], [5, \"May\"], [6, \"Jun\"],\n [7, \"Jul\"], [8, \"Aug\"], [9, \"Sep\"], [10, \"Oct\"], [11, \"Nov\"], [12, \"Dec\"]],\n font: {\n size: 12,\n family: \"Open Sans, Arial\",\n color: \"#697695\"\n }\n },\n yaxis: {\n ticks: 5,\n tickDecimals: 0,\n font: {size: 12, color: \"#9da3a9\"}\n }\n };\n\n var horizontalBars = {\n series: {\n bars: {\n show: true,\n lineWidth: 1,\n fill: true,\n fillColor: { colors: [ { opacity: 0.1 }, { opacity: 0.13 } ] }\n }\n },\n colors: [\"#30a0eb\"],\n bars: {\n align: \"center\",\n barWidth: 0.7,\n horizontal: true\n },\n xaxis: {\n axisLabel: \"Price (USD/oz)\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: 'Verdana, Arial',\n axisLabelPadding: 9,\n max: 2000,\n tickFormatter: function (v, axis) {\n return v;\n },\n color: \"#697695\"\n },\n yaxis: {\n axisLabel: \"Precious Metals\",\n axisLabelUseCanvas: true,\n axisLabelFontSizePixels: 12,\n axisLabelFontFamily: 'Verdana, Arial',\n axisLabelPadding: 3,\n ticks: [ [0, \"Gold\"], [1, \"Silver\"], [2, \"Platinum\"], [3, \"Palldium\"], [4, \"Rhodium\"], [5, \"Ruthenium\"], [6, \"Iridium\"]],\n color: \"#697695\"\n },\n legend: {\n noColumns: 0,\n labelBoxBorderColor: \"#fff\",\n position: \"ne\"\n },\n grid: {\n hoverable: true,\n tickColor: \"#f9f9f9\",\n borderColor: \"#fff\"\n }\n };\n\n var realTimeBars = {\n series: {\n shadowSize: 0\t// Drawing is faster without shadows\n },\n colors: [\"#30a0eb\"],\n yaxis: {\n min: 0,\n max: 100\n },\n xaxis: {\n show: false\n },\n grid: {\n tickColor: \"#f9f9f9\",\n borderColor: \"#fff\"\n }\n };\n var pieOpts = {\n series: {\n pie: {\n show: true,\n radius: 1,\n label: {\n show: true,\n radius: 3/4,\n formatter: labelFormatter,\n background: {\n opacity: 0.5\n }\n }\n }\n },\n legend: {\n show: false\n }\n };\n var donutOpts = {\n series: {\n pie: {\n innerRadius: 0.5,\n show: true,\n radius: 1,\n label: {\n show: true,\n radius: 3/4,\n formatter: labelFormatter,\n background: {\n opacity: 0.5\n }\n }\n }\n },\n legend: {\n show: false\n }\n };\n\n function showTooltip(x, y, color, contents) {\n $('<div id=\"tooltip\">' + contents + '</div>').css({\n top: y - 25,\n left: x - 35,\n 'border-color': color\n }).appendTo(\"body\").fadeIn(200);\n }\n function showHorizontalBarTooltip(x, y, color, contents) {\n $('<div id=\"tooltip\">' + contents + '</div>').css({\n top: y - 10,\n left: x + 5,\n 'border-color': color\n }).appendTo(\"body\").fadeIn(200);\n }\n\n $.each(charts, function (id, value) {\n if (!$(id).length){\n return;\n }\n var opts = null;\n switch (value.type){\n case 'bars': opts = chartBars; break;\n case 'zoom': opts = zoomOpts; break;\n case 'horizontal': opts = horizontalBars; break;\n case 'realTime':\n var updateInterval = value.updateInterval;\n $(\"#updateInterval\").val(updateInterval).change(function () {\n var v = $(this).val();\n if (v && !isNaN(+v)) {\n updateInterval = +v;\n if (updateInterval < 1) {\n updateInterval = 1;\n } else if (updateInterval > 2000) {\n updateInterval = 2000;\n }\n $(this).val(\"\" + updateInterval);\n }\n });\n value.data = [getRandomData()];\n opts = realTimeBars;\n break;\n case 'pie': opts = pieOpts; break;\n case 'donut': opts = donutOpts; break;\n default:\n opts = chartLines;\n };\n var plot = $.plot($(id), value.data, opts),\n previousPoint = null,\n previousLabel = null;\n\n //used on real time chart\n function update() {\n plot.setData([getRandomData()]);\n // Since the axes don't change, we don't need to call plot.setupGrid()\n plot.draw();\n setTimeout(update, updateInterval);\n }\n // little helper for taking the repetitive work out of placing\n // panning arrows\n function addArrow(dir, right, top, offset) {\n $(\"<img class='zoomBtn' src='img/charts/arrow-\" + dir + \".gif' style='right:\" + right + \"px;top:\" + top + \"px'>\")\n .appendTo($(id))\n .click(function (e) {\n e.preventDefault();\n plot.pan(offset);\n });\n }\n\n switch (value.type){\n case 'bars':\n //bind tooltip for bars chart\n $(id).bind(\"plothover\", function (event, pos, item) {\n if (item) {\n if (previousPoint != item.dataIndex) {\n previousPoint = item.dataIndex;\n $(\"#tooltip\").remove();\n var x = item.datapoint[0].toFixed(0),\n y = item.datapoint[1].toFixed(0),\n month = item.series.xaxis.ticks[item.dataIndex].label,\n color = item.series.color;\n showTooltip(item.pageX, item.pageY, color,\n item.series.label + \" of \" + month + \": \" + y);\n }\n } else {\n $(\"#tooltip\").remove();\n previousPoint = null;\n }\n });\n break;\n case 'zoom':\n // show pan/zoom messages to illustrate events\n $(id).bind(\"plotpan\", function (event, plot) {\n plot.getAxes();\n });\n $(id).bind(\"plotzoom\", function (event, plot) {\n plot.getAxes();\n });\n // add zoom out button\n $(\"<div class='btn btn-primary btn-xs'>zoom out</div>\")\n .appendTo($(id))\n .click(function (event) {\n event.preventDefault();\n plot.zoomOut();\n });\n // and add panning buttons\n addArrow(\"left\", 33, 35, { left: -100 });\n addArrow(\"right\", 3, 35, { left: 100 });\n addArrow(\"up\", 18, 20, { top: -100 });\n addArrow(\"down\", 18, 50, { top: 100 });\n break;\n case 'horizontal':\n //bind tooltip for horizontal chart\n $(id).bind(\"plothover\", function (event, pos, item) {\n if (item) {\n if ((previousLabel != item.series.label) ||\n (previousPoint != item.dataIndex)) {\n previousPoint = item.dataIndex;\n previousLabel = item.series.label;\n $(\"#tooltip\").remove();\n var x = item.datapoint[0],\n y = item.datapoint[1],\n color = item.series.color;\n showHorizontalBarTooltip(item.pageX,\n item.pageY,\n color,\n \"<strong>\" + item.series.label + \"</strong><br>\" + item.series.yaxis.ticks[y].label +\n \" : <strong>\" + x + \"</strong> USD/oz\");\n }\n } else {\n $(\"#tooltip\").remove();\n previousPoint = null;\n }\n });\n break;\n case 'realTime':\n update();\n break;\n\n };\n\n });\n }", "function initQCPlotPSMScoreVsScoreClickHandlers() {\t\n\tqcChartPSMScoreVsScores.init();\n}", "function initListeners() {\n $('#key').on('click', '.key-show-control', function(ev) {\n dispatch.keyShowLine($(this).data('line-id'));\n });\n\n $('#key').on('click', 'a.key-duplicate-control', function(ev) {\n ev.preventDefault();\n dispatch.keyDuplicateLine($(this).data('line-id'));\n });\n\n $('#key').on('click', 'a.key-delete-control', function(ev) {\n ev.preventDefault();\n dispatch.keyDeleteLine($(this).data('line-id'));\n });\n\n $('#key').on('click', 'a.key-edit-control', function(ev) {\n ev.preventDefault();\n dispatch.keyEditLine($(this).data('line-id'));\n });\n }", "function updatePlot() {\n // Get the value of the button\n xlim = this.value\n\n // Update X axis\n x.domain([0,xlim])\n s3g1xAxis.transition().duration(1000).call(d3.axisBottom(x))\n\n // Update chart\n myline\n .datum(data)\n .transition()\n .duration(2000)\n .attr(\"d\", d3.line()\n .curve(d3.curveBasis) // Just add that to have a curve instead of segments\n .x(function(d) { return x(d.Period); })\n .y(function(d) { return y(d.Value); })\n ) \n }", "function charts() {\n var ctx = $(\".chart\"),\n myLineChart = new Chart(ctx, {\n type: 'line',\n data: data,\n options: options\n });\n }", "function drawLine() {\n\n var data = new google.visualization.DataTable();\n data.addColumn('number', 'X');\n data.addColumn('number', 'Clients');\n data.addRows(self.charts.line.rows);\n\n var options = self.charts.line.options;\n\n var chart = new google.visualization.LineChart(document.getElementById('chart_div'));\n\n chart.draw(data, options);\n }", "function UpdateLineChart(){\n var doc = document.getElementById(\"line_chart__\");\n\n doc.height = $('.bars').height() + 70\n doc.width = $('.bars').width()\n $('.line_chart,.lines,#line_chart__').width($('.bar_wrapper').width());\n $('.line_chart,.lines,#line_chart__').height($('.bar_wrapper').height() + 70);\n\n if(!isLineChartInizialized){\n isLineChartInizialized = true;\n chart = new Chart(doc, {\n type: 'line',\n data: {\n labels: getDateArray(),\n datasets: [{ \n data: getOnlyAnwsersFromArray($scope.first_patient_calculated),\n label: $scope.patients[$scope.patient1 - 1],\n borderColor: color1,\n fill: false\n }, { \n data: getOnlyAnwsersFromArray($scope.second_patient_calculated),\n label: $scope.patients[$scope.patient2 - 1],\n borderColor: color2,\n fill: false\n }\n ]\n },\n options: {\n legend: {\n display: false\n },\n scales: {\n yAxes: [{\n ticks: {\n stepSize: 1,\n beginAtZero: true,\n suggestedMax: 4\n }\n }]\n },\n options: {\n events: []\n },\n animation: {\n duration: 2000, // general animation time\n easing:\"easeInOutExpo\"\n },\n elements: {\n line: {\n tension: 0, // disables bezier curves\n }\n },\n label:{\n display: false\n }\n }\n });\n }else{\n chart.data.labels = getDateArray(),\n chart.data.datasets = [{ \n data: getOnlyAnwsersFromArray($scope.first_patient_calculated),\n label: \"Patient \" + $scope.patient1,\n borderColor: color1,\n fill: false\n }, { \n data: getOnlyAnwsersFromArray($scope.second_patient_calculated),\n label: \"Patient \" + $scope.patient2,\n borderColor: color2,\n fill: false\n }\n ]\n chart.update();\n }\n }", "didCreateChart (chart) {\n google.visualization.events.addListener (chart, 'ready', this.didReady.bind (this));\n google.visualization.events.addListener (chart, 'select', this.didSelect.bind (this));\n google.visualization.events.addListener (chart, 'error', this.didError.bind (this));\n google.visualization.events.addListener (chart, 'onmouseover', this.didMouseOver.bind (this));\n google.visualization.events.addListener (chart, 'onmouseout', this.didMouseOut.bind (this));\n }", "function init() {\n\n // AXIS LABELS\n // Set yAxis label to class 'yAxis-label'\n graph\n .append('text')\n .attr('class','yAxis-label')\n \n // Set xAxis label to class 'xAxis-label'\n graph\n .append('text')\n .attr('class','xAxis-label')\n\n // AXIS GROUPS\n // Create axisX group with class 'axisX'\n graph\n .append('g')\n .attr('class','axisX')\n .attr('id','axisX')\n \n // Create axisY group with class 'axisY'\n graph\n .append('g')\n .attr('class','axisY')\n .attr('id','axisY')\n\n\n // add event listner for any resizes (listener is debounced)\n window.addEventListener(\"resize\", debounce(resize, 200));\n drawChart(rawData, props);\n }", "function myClickFunction() {\n console.log(\"myClickFunction\");\n //chart is accessible from here\n //this refers to the yaxis group, which has the .on attribute set.\n console.log(this);\n }", "function initChart() {\n if (!showChart) {\n return\n }\n\n addTimelineChart(ee.Geometry(Map.getCenter(true)).centroid(10));\n\n Map.onClick(function (coords) {\n coords = ee.Dictionary(coords);\n print('Map clicked: ', coords);\n let newCenter = ee.Geometry.Point([coords.get('lon'), coords.get('lat')]);\n addTimelineChart(newCenter)\n })\n }", "function SetUpChannelChartsListeners() {\n const spans = document.getElementsByClassName(\"channelChartIcon\");\n\n for (let i = 0; i < spans.length; i++) {\n spans[i].addEventListener('click', function() {\n DrawChannelChart(spans[i].dataset['name'])\n }); \n }\n\n}", "function addSeriesCB(){\n\t\t\tstx.createDataSet();\n\t\t\tstx.draw();\n\t\t}", "function click() {\n // var n = data.length - 1,\n // i = Math.floor(Math.random() * n / 2),\n // j = i + Math.floor(Math.random() * n / 2) + 1;\n // x.domain([data[i].date, data[j].date]);\n // var t = svg.transition().duration(750);\n // t.select(\".x.axis\").call(xAxis);\n // t.select(\".line\").attr(\"d\", line(data));\n}", "function initChart() {\n var originalLineDraw=Chart.controllers.line.prototype.draw;\n var originalInitialize=Chart.controllers.line.prototype.initialize;\n\n // Extend the line chart, in order to override the draw function.\n Chart.controllers.NRHighlightLine=Chart.controllers.line.extend({\n xHighlightRange: null,\n\n initialize: function(chart) {\n this.xHighlightRange=chart.chart.config.data.datasets[0].xHighlightRange;\n\n originalInitialize.apply(this, arguments);\n },\n //clear: function() {},\n draw: function() {\n var chart=this.chart;\n // Get the object that determines the region to highlight.\n var xHighlightRange=this.xHighlightRange;\n\n\n // If the object exists.\n if(xHighlightRange!==undefined) {\n var ctx=chart.ctx;\n\n var xRangeBegin=xHighlightRange.begin;\n var xRangeEnd=xHighlightRange.end;\n\n var xaxis=chart.scales['x-axis-0'];\n var yaxis=chart.scales['y-axis-0'];\n\n var xRangeBeginPixel=xaxis.getPixelForTick(xRangeBegin);\n var xRangeEndPixel=xaxis.getPixelForTick(xRangeEnd);\n\n ctx.save();\n\n // The fill style of the rectangle we are about to fill.\n ctx.fillStyle='rgba(255, 0, 0, 0.3)';\n // Fill the rectangle that represents the highlight region. The parameters are the closest-to-starting-point pixel's x-coordinate,\n // the closest-to-starting-point pixel's y-coordinate, the width of the rectangle in pixels, and the height of the rectangle in pixels, respectively.\n ctx.fillRect(Math.min(xRangeBeginPixel, xRangeEndPixel), 0, Math.max(xRangeBeginPixel, xRangeEndPixel)-Math.min(xRangeBeginPixel, xRangeEndPixel), yaxis.bottom);\n\n ctx.restore();\n }\n\n // Apply the original draw function for the line chart.\n originalLineDraw.apply(this, arguments);\n }\n });\n\n Chart.defaults.NRHighlightLine=Chart.defaults.line;\n }", "function addLines(lines) {\n for (var j=0; j<lines.length;j++) {\n // create new line\n var linechart = newLine(lines[j].id)\n // attach data\n linechart\n .data(lines[j].values)\n // refresh\n linechart(); \n }\n }", "function drawLineChart($scope){\n\tif(!$scope.chartTypeToggle.line){\n\t\treturn;\n\t}\n\tvar svg = $scope.svg;\n\tvar $axisProvider = $scope.$axisProvider;\n\tvar $lineChartProvider = $scope.$injector.get(\"$lineChartProvider\");\n\t$scope.$lineChartProvider = $lineChartProvider;\n\t$lineChartProvider.axisProvider = $axisProvider;\n\t$lineChartProvider.svg = svg;\n\t$lineChartProvider.data = getDataFromScope($scope);\n\t$lineChartProvider.effect = $scope.chartEffect;\n\t$lineChartProvider.dataX = $scope.chartX;\n\t$lineChartProvider.dataY = $scope.chartY;\n\t$lineChartProvider.animate = $scope.chartAnimate;\n \n\t$lineChartProvider.draw();\n\t\n\t$scope.$watch('chartAnimate',function(newValue,oldValue){\n\t\t$lineChartProvider.animate = newValue;\n\t\t//redraw only when animate was turned on from off.\n\t\tif(!oldValue && newValue && $scope.chartTypeToggle.line){\n\t\t\t$lineChartProvider.draw();\n\t\t}\n\t});\n\t$scope.$watch('chartEffect',function(newValue,oldValue){\n\t\t$lineChartProvider.effect = newValue;\n\t\tif(oldValue!=newValue && $scope.chartTypeToggle.line){\n\t\t\t$lineChartProvider.draw();\n\t\t}\n\t});\t\n}", "constructor(props){\n\tsuper(props)\n\tthis.createLineChart = this.createLineChart.bind(this)\n }", "function chart(){\r\n var canvas = document.getElementById('Chart');\r\n var data = {\r\n labels: [],\r\n // varje dictionary i dataset är en line som visualiseras i grafen \r\n datasets: [\r\n {\r\n label: \"Ärvärdet David\",\r\n fill: false,\r\n lineTension: 0.1,\r\n backgroundColor: \"rgb(0, 0, 0)\",\r\n borderColor: \"rgb(0, 0, 0)\",\r\n borderCapStyle: 'butt',\r\n borderDash: [],\r\n borderDashOffset: 0.0,\r\n borderJoinStyle: 'miter',\r\n data: [],\r\n }, {\r\n label: \"Börvärdet\",\r\n fill: false,\r\n lineTension: 0.1,\r\n backgroundColor: \"rgb(103, 187, 243)\",\r\n borderColor: \"rgb(103, 187, 243)\",\r\n borderCapStyle: 'butt',\r\n borderDash: [],\r\n borderDashOffset: 0.0,\r\n borderJoinStyle: 'miter',\r\n data: [],\r\n },\r\n {\r\n label: \"Ärvärdet Amjad\",\r\n fill: false,\r\n lineTension: 0.1,\r\n backgroundColor: \"rgba(75,192,192,0.4)\",\r\n borderColor: \"rgb(63, 191, 191)\",\r\n borderCapStyle: 'butt',\r\n borderDash: [],\r\n borderDashOffset: 0.0,\r\n borderJoinStyle: 'miter',\r\n data: [],\r\n },\r\n ]\r\n};\r\nvar option = {\r\nchart: {\r\n height: 100,\r\n type: 'line',\r\n animations: {\r\n enabled: true,\r\n easing: 'linear',\r\n dynamicAnimation: {\r\n speed: 1000\r\n }\r\n },\r\n toolbar: {\r\n show: true\r\n },\r\n zoom: {\r\n enabled: true\r\n }\r\n},\r\ndataLabels: {\r\n enabled: false\r\n},\r\nstroke: {\r\n curve: 'smooth'\r\n},\r\nseries: [{\r\n data: data,\r\n}],\r\nmarkers: {\r\n size: 0\r\n},\r\nyaxis: {\r\n max: 200\r\n},\r\nlegend: {\r\n show: false\r\n},\r\n}\r\nmyLineChart = Chart.Line(canvas,{\r\ndata:data,\r\noptions:option\r\n });\r\n}", "function setupButtons() {\r\n d3.select('#toolbar')\r\n .selectAll('.button')\r\n .on('click', function () {\r\n // Remove active class from all buttons\r\n d3.selectAll('.button').classed('active', false);\r\n // Find the button just clicked\r\n var button = d3.select(this);\r\n\r\n // Set it as the active button\r\n button.classed('active', true);\r\n\r\n // Get the id of the button\r\n var buttonId = button.attr('id');\r\n var dataArr = [];\r\n\r\n // Toggle the bubble chart based on\r\n // the currently clicked button.\r\n myBubbleChart.toggleDisplay(buttonId);\r\n });\r\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\t\tconsole.log(\"buttonId \"+buttonId);\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "updateScatterPlot() {\n const { preSelected } = this.props;\n this.updatePoints();\n\n if (!preSelected) {\n // console.log('adding event listeners');\n this.addEventListeners();\n }\n }", "_setLineFunctions(){\n this.lines = {};\n const graph = this; // needed for nested functions\n\n this.channelNames.forEach((channelName) => {\n this.lines[channelName] = d3.svg.line()\n .x(function(d){ return graph.xRange(d.timestamp); })\n .y(function(d){ return graph.yRange(d[channelName]); });\n });\n\n }", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n //myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function toggleLine(id, className, btn) {\r\n\tvar line = d3.selectAll('#' + id + ' .' + className + '.plot');\r\n\tvar altLine = d3.select('#' + id + ' .' + className + '.alternate');\r\n\tvar legend = d3.select('#' + id + ' .' + className + '.graph-legend');\r\n\tvar current = line.attr('class');\r\n\t\r\n\tif (current == className + ' plot') {\r\n\t\tline.attr('class', className + ' plot active');\r\n\t\tlegend.attr('class', className + ' graph-legend active');\r\n\t\tif (altLine.length)\r\n\t\t\taltLine.attr('class', className + ' alternate active');\r\n\t}\r\n\telse{\r\n\t\tline.attr('class', className + ' plot');\r\n\t\tlegend.attr('class', className + ' graph-legend');\r\n\t\tif (altLine.length)\r\n\t\t\taltLine.attr('class', className + ' alternate');\r\n\t}\r\n\t\r\n\t$(btn).toggleClass('active');\r\n\t\r\n}", "addEventListeners() {\n const {\n width,\n height,\n padding,\n offsetTop,\n offsetRight,\n options,\n minZoom,\n maxZoom,\n } = this.props;\n const { preSelected, createUserHubblePlot, userTrendline, qaReview } =\n options || {};\n const $hubblePlot = d3Select(this.svgEl.current);\n const $allPoints = d3Select(this.svgEl.current).selectAll('.data-point');\n\n if (\n (!preSelected && userTrendline) ||\n !!qaReview ||\n (preSelected && !createUserHubblePlot)\n ) {\n $hubblePlot.on('click', () => {\n const pointData = d3Select(d3Event.target).datum();\n\n if (pointData) {\n this.toggleSelection(pointData);\n } else {\n this.clearSelection();\n }\n });\n\n $allPoints\n .on('mouseover', this.onMouseOver)\n .on('mouseout', this.onMouseOut);\n } else if (!preSelected && createUserHubblePlot) {\n $hubblePlot.on('click', () => {\n const pointData = d3Select(d3Event.target).datum();\n const path = d3Event.path || d3Event.composedPath();\n const isHtmlClick = path.some(\n element =>\n element.nodeName &&\n element.nodeName.toLowerCase().includes('foreign')\n );\n\n if (!pointData && !isHtmlClick && createUserHubblePlot) {\n this.toggleUserPoint();\n }\n });\n\n this.globalZoom = d3Zoom()\n .translateExtent([\n [padding, offsetTop],\n [width - offsetRight, height - padding],\n ])\n .scaleExtent([minZoom, maxZoom])\n .extent([\n [padding, offsetTop],\n [width - offsetRight, height - padding],\n ])\n .on('zoom', this.onZoom, { passive: false });\n\n $hubblePlot.call(this.globalZoom).on('mousedown.zoom', null);\n\n $hubblePlot.on('mousemove', () => {\n if (this.showGhost()) {\n const [mousePosX, mousePosY] = d3mouse(this.svgEl.current);\n\n this.setState(prevState => ({\n ...prevState,\n mousePosX,\n mousePosY,\n }));\n }\n });\n\n $hubblePlot.on('mouseout', () => {\n if (this.showGhost()) {\n this.setState(prevState => ({\n ...prevState,\n mousePosX: null,\n mousePosY: null,\n }));\n }\n });\n\n $allPoints\n .on('mouseover', this.onMouseOver)\n .on('mouseout', this.onMouseOut)\n .on('keydown', this.onKeydown, { passive: false })\n .on('keyup', this.onKeyup, { passive: true })\n .call(d3Drag().on('start', this.drag));\n }\n }", "function Line(type){\n this.type = type;\n this.position = {\n x1: null, x2: null, y1: null, y2: null\n };\n this.init = function(){\n this.coordinate.hover(true);\n this.coordinate.show(true)\n artboard.on('mousedown',function(e){\n var data = {};\n \n if(e.originalEvent.detail == 2){\n this.clearPosition();\n data.plot = false;\n }\n else\n {\n ($(e.target).hasClass('coordinate') ? \n\n (\n data.x = Number($(e.target).attr('data-x')) + 2 ,\n data.y = Number($(e.target).attr('data-y')) + 2,\n data.plot = false\n ) \n\n :\n\n ( data.x = e.offsetX, data.y = e.offsetY, data.plot = true)\n\n );\n\n data.isFirst = true;\n data.event = e;\n\n if(this.position.x1 == null)\n {\n this.position.x1 = data.x;\n this.position.y1 = data.y;\n }\n else\n {\n this.position.x2 = data.x;\n this.position.y2 = data.y;\n data.isFirst = false;\n }\n\n this.exe(data);\n }\n \n }.bind(this));\n \n }\n this.fin = function(){\n this.coordinate.hover(false);\n this.clearPosition();\n this.coordinate.show(false);\n artboard.off('mousedown');\n } \n }", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function() {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupLineChartMeanMedianButtons() {\n d3.select(\"#mean\")\n .attr(\"onchange\", \"meanMedianSelected(this)\");\n\n d3.select(\"#median\")\n .attr(\"onchange\", \"meanMedianSelected(this)\");\n}", "function addNewLineChartFunction(idName, labelName, dataName, ctName, typeName) {\ndocument.querySelector('.current-data-chart').classList.remove('current-data-chart');\nvar newCurrentClass = document.getElementById(idName);\nnewCurrentClass.classList.add('current-data-chart');\nmyLineChart.destroy();\n/* */myLineChart = new Chart(ctName, {\n type: typeName,\n data: {\n labels: [\"\", \"16-22\", \"23-29\", \"30-5\", \"6-12\", \"13-19\", \"20-26\", \"27-3\", \"4-10\", \"11-17\", \"18-24\", \"25-31\"],\n datasets: [{\n label: labelName,\n data: dataName,\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n lineTension: 0,\n borderColor: [\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n\n borderWidth: 1\n\n }]\n },\n options: {\n\n layout: {\n padding: {\n left: 30,\n right: 50,\n top: 0,\n bottom: 0\n }\n },\n legend: {\n display: false\n },\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:false\n\n }\n }],\n xAxes: [{\n ticks: {\n beginAtZero:false\n }\n }]\n }\n }\n})\n\n}", "static initChartsSparkline() {\n // Chart Containers\n let slcLine1 = jQuery('.js-slc-line1');\n let slcLine2 = jQuery('.js-slc-line2');\n let slcLine3 = jQuery('.js-slc-line3');\n let slcBar1 = jQuery('.js-slc-bar1');\n let slcBar2 = jQuery('.js-slc-bar2');\n let slcBar3 = jQuery('.js-slc-bar3');\n let slcPie1 = jQuery('.js-slc-pie1');\n let slcPie2 = jQuery('.js-slc-pie2');\n let slcPie3 = jQuery('.js-slc-pie3');\n let slcTristate1 = jQuery('.js-slc-tristate1');\n let slcTristate2 = jQuery('.js-slc-tristate2');\n let slcTristate3 = jQuery('.js-slc-tristate3');\n\n\n // Line Charts\n let lineOptions = {\n type: 'line',\n width: '120px',\n height: '80px',\n tooltipOffsetX: -25,\n tooltipOffsetY: 20,\n lineColor: '#ffca28',\n fillColor: '#ffca28',\n spotColor: '#555',\n minSpotColor: '#555',\n maxSpotColor: '#555',\n highlightSpotColor: '#555',\n highlightLineColor: '#555',\n spotRadius: 2,\n tooltipPrefix: '',\n tooltipSuffix: ' Tickets',\n tooltipFormat: '{{prefix}}{{y}}{{suffix}}'\n };\n\n if (slcLine1.length) {\n slcLine1.sparkline('html', lineOptions);\n }\n\n lineOptions['lineColor'] = '#9ccc65';\n lineOptions['fillColor'] = '#9ccc65';\n lineOptions['tooltipPrefix'] = '$ ';\n lineOptions['tooltipSuffix'] = '';\n\n if (slcLine2.length) {\n slcLine2.sparkline('html', lineOptions);\n }\n\n lineOptions['lineColor'] = '#42a5f5';\n lineOptions['fillColor'] = '#42a5f5';\n lineOptions['tooltipPrefix'] = '';\n lineOptions['tooltipSuffix'] = ' Sales';\n\n if (slcLine3.length) {\n slcLine3.sparkline('html', lineOptions);\n }\n\n // Bar Charts\n let barOptions = {\n type: 'bar',\n barWidth: 8,\n barSpacing: 6,\n height: '80px',\n barColor: '#ffca28',\n tooltipPrefix: '',\n tooltipSuffix: ' Tickets',\n tooltipFormat: '{{prefix}}{{value}}{{suffix}}'\n };\n\n if (slcBar1.length) {\n slcBar1.sparkline('html', barOptions);\n }\n\n barOptions['barColor'] = '#9ccc65';\n barOptions['tooltipPrefix'] = '$ ';\n barOptions['tooltipSuffix'] = '';\n\n if (slcBar2.length) {\n slcBar2.sparkline('html', barOptions);\n }\n\n barOptions['barColor'] = '#42a5f5';\n barOptions['tooltipPrefix'] = '';\n barOptions['tooltipSuffix'] = ' Sales';\n\n if (slcBar3.length) {\n slcBar3.sparkline('html', barOptions);\n }\n\n // Pie Charts\n let pieCharts = {\n type: 'pie',\n width: '80px',\n height: '80px',\n sliceColors: ['#ffca28','#9ccc65', '#42a5f5','#ef5350'],\n highlightLighten: 1.1,\n tooltipPrefix: '',\n tooltipSuffix: ' Tickets',\n tooltipFormat: '{{prefix}}{{value}}{{suffix}}'\n };\n\n if (slcPie1.length) {\n slcPie1.sparkline('html', pieCharts);\n }\n\n pieCharts['tooltipPrefix'] = '$ ';\n pieCharts['tooltipSuffix'] = '';\n\n if (slcPie2.length) {\n slcPie2.sparkline('html', pieCharts);\n }\n\n pieCharts['tooltipPrefix'] = '';\n pieCharts['tooltipSuffix'] = ' Sales';\n\n if (slcPie3.length) {\n slcPie3.sparkline('html', pieCharts);\n }\n\n // Tristate Charts\n let tristateOptions = {\n type: 'tristate',\n barWidth: 8,\n barSpacing: 6,\n height: '110px',\n posBarColor: '#9ccc65',\n negBarColor: '#ef5350'\n };\n\n if (slcTristate1.length) {\n slcTristate1.sparkline('html', tristateOptions);\n }\n\n if (slcTristate2.length) {\n slcTristate2.sparkline('html', tristateOptions);\n }\n\n if (slcTristate3.length) {\n slcTristate3.sparkline('html', tristateOptions);\n }\n }", "setExportLinesCallback(callback){\n this.EXPORT_LINES_CALLBACK = callback;\n this.EXPORT_LINES_BTN.onclick = this.EXPORT_LINES_CALLBACK.bind(this);\n }", "removeEventListeners() {\n const $hubblePlot = d3Select(this.svgEl.current);\n const $allPoints = d3Select(this.svgEl.current).selectAll('.data-point');\n\n $hubblePlot\n .on('click', null)\n .on('mousemove', null)\n .on('mouseout', null);\n $allPoints\n .on('mouseover', null)\n .on('mouseout', null)\n .on('click', null)\n .on('drag', null);\n }", "onChartClick(event) {\n console.log(event);\n }", "function onClickScaleListener(button){\n let newCtr;\n if(button == dayButton){\n newCtr = 0;\n }\n else if(button == weekButton){\n newCtr = 1;\n }\n else if(button == monthButton){\n newCtr = 2;\n }\n else if(button == yearButton){\n newCtr = 3;\n }\n else{\n newCtr = 4;\n }\n if(newCtr != indexCtr){\n for(var i =0; i < buttonArr.length; i++){\n if(i == newCtr){\n buttonArr[i].style.color = '#fff';\n buttonArr[i].style.background = '#007bff';\n }\n else{\n buttonArr[i].style.color = '#007bff';\n buttonArr[i].style.background = '#fff';\n }\n }\n indexCtr = newCtr;\n updateChart();\n }\n}", "function LineChartDemoComponent(charts) {\n this.charts = charts;\n this.dateArray = [];\n this.userArray = [];\n this.tagArray = [];\n this.groupArray = [];\n this.lineChartData = [{ data: [], label: '' }, { data: [], label: '' }, { data: [], label: '' }];\n this.lineChartLabels = []; //Users \n this.lineChartOptions = {\n responsive: true,\n scales: {\n xAxes: [{\n stacked: true\n }],\n yAxes: [{\n stacked: true\n }]\n },\n height: '500px',\n width: '720px'\n };\n this.lineChartColors = [\n {\n backgroundColor: 'rgba(148,159,177,0.2)',\n borderColor: 'rgba(148,159,177,1)',\n pointBackgroundColor: 'rgba(148,159,177,1)',\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: 'rgba(148,159,177,0.8)'\n },\n {\n backgroundColor: 'rgba(77,83,96,0.3)',\n borderColor: 'rgba(77,83,96,1)',\n pointBackgroundColor: 'rgba(77,83,96,1)',\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: 'rgba(77,83,96,1)'\n },\n {\n backgroundColor: 'rgba(148,159,177,0.4)',\n borderColor: 'rgba(148,159,177,1)',\n pointBackgroundColor: 'rgba(148,159,177,1)',\n pointBorderColor: '#fff',\n pointHoverBackgroundColor: '#fff',\n pointHoverBorderColor: 'rgba(148,159,177,0.8)'\n }\n ];\n this.lineChartLegend = true;\n this.lineChartType = 'line';\n }", "function handleLineChartClearWarning(button) {\r\n var btn = button.id;\r\n\r\n d3.selectAll(\r\n \".alert.alert-danger.alert-dismissible.lineChart.clearChart\"\r\n ).classed(\"aleph-hide\", true);\r\n\r\n if (btn == \"ok\") {\r\n // reset tick marker counter\r\n aleph.tickIconMarkerCounter = -1;\r\n\r\n // reset to default styling and state of submit and reset buttons\r\n // document.getElementById(\"line-submit\").disabled = true;\r\n document.getElementById(\"line-clear\").disabled = true;\r\n // document.getElementById(\"line-reset-axes\").disabled = true;\r\n // document.getElementById(\"yAxisScaleType\").disabled = true;\r\n\r\n $(\"#vertical-line-slider-range\").slider(\"option\", \"disabled\", true);\r\n $(\"#horizontal-line-slider-range\").slider(\"option\", \"disabled\", true);\r\n\r\n // remove all plotted data lines and related mouverover interaction line objects\r\n d3.selectAll(\".aleph-line-group\").remove();\r\n d3.selectAll(\".mouse-per-line\").remove();\r\n\r\n aleph.currentlySelectedScenario = {};\r\n aleph.scenarios = {};\r\n aleph.scenariosData = [];\r\n aleph.currentNumberOfSavedScenarios = Object.keys(aleph.scenarios).length;\r\n aleph.currentScenarioNumber = -1;\r\n\r\n /*\r\n\r\n CHART AXES RESET \r\n\r\n */\r\n\r\n aleph.yMain.domain([0, 500000]);\r\n\r\n d3.selectAll(\".axis.axis--y.mainAxis\").call(d3.axisLeft(aleph.yMain));\r\n\r\n $(\"#vertical-line-slider-range\")\r\n .slider(\"option\", \"values\", [0, 500000])\r\n .slider(\"option\", \"max\", aleph.yMain.domain()[1]);\r\n\r\n // d3.selectAll(\".slider-label.slider-label-fixed-top\").text(\r\n // numberWithCommas(aleph.yMain.domain()[1])\r\n // );\r\n d3.selectAll(\".slider-label.slider-label-fixed-top\").text(function () {\r\n if (aleph.lineChartyAxisType == \"counts\") {\r\n return numberWithCommas(aleph.yMain.domain()[1]);\r\n } else {\r\n return aleph.yMain.domain()[1].toFixed(1);\r\n }\r\n });\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-top\")\r\n .style(\"bottom\", \"100%\")\r\n .text(numberWithCommas(aleph.yMain.domain()[1]) + \" -\");\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-bottom\")\r\n .style(\"bottom\", \"0%\")\r\n .text(numberWithCommas(aleph.yMain.domain()[0]) + \" -\");\r\n\r\n aleph.xMain.domain([\r\n aleph.parseDate(aleph.years[0]),\r\n aleph.parseDate(aleph.years[aleph.years.length - 1]),\r\n ]);\r\n\r\n d3.selectAll(\".axis.axis--x.mainAxis\").call(d3.axisBottom(aleph.xMain));\r\n $(\"#horizontal-line-slider-range\").slider(\"option\", \"values\", [\r\n aleph.years[0],\r\n aleph.years[aleph.years.length - 1],\r\n ]);\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-left\")\r\n .style(\"left\", \"0%\")\r\n .text(aleph.years[0]);\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-right\")\r\n .style(\"left\", \"100%\")\r\n .text(aleph.years[aleph.years.length - 1]);\r\n\r\n d3.selectAll(\".aleph-yAxisTicks\").remove();\r\n\r\n // draw tick grid lines extending from y-axis ticks on axis across scatter graph\r\n var yticks = d3.selectAll(\".axis.axis--y.mainAxis\").selectAll(\".tick\");\r\n yticks\r\n .append(\"svg:line\")\r\n .attr(\"class\", \"aleph-yAxisTicks\")\r\n .attr(\"y0\", 0)\r\n .attr(\"y1\", 0)\r\n .attr(\"x1\", 0)\r\n .attr(\r\n \"x2\",\r\n svgWidth -\r\n aleph.margin.line[aleph.windowSize].left -\r\n aleph.margin.line[aleph.windowSize].right\r\n );\r\n\r\n d3.selectAll(\".aleph-yAxisTitle\").html(\"Number\");\r\n } // end if ...\r\n else {\r\n }\r\n\r\n return;\r\n}", "function setTouchListeners() {\n gElCanvas.addEventListener('touchstart', (ev) => {\n ev.preventDefault()\n onSwitchLine(event)\n })\n gElCanvas.addEventListener('touchend', (ev) => {\n ev.preventDefault()\n toggleDrag();\n })\n gElCanvas.addEventListener('touchmove', (ev) => {\n dragLines(ev)\n })\n}", "function costruttoreGraficoLine(dati) {\n if ($.isEmptyObject(lineChart)) {\n lineChart = new Chart($('#grafico-line'), {\n type: 'line',\n data: {\n labels: ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'],\n datasets: [{\n label: 'Vendite Mensili',\n borderColor: 'rgb(0, 8, 198)',\n backgroundColor: 'rgba(0, 8, 198, 0.2)',\n data: dati,\n lineTension: 0,\n }]\n }\n });\n } else {\n lineChart.data.labels = ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'];\n lineChart.data.datasets[0].data = dati;\n lineChart.update();\n }\n}", "addEventListeners() {\n d3Select(this.svgEl.current).on('click', () => {\n if (d3Event.target.classList[0] !== 'data-point') {\n const { activeId, dataLassoCallback } = this.props;\n\n if (dataLassoCallback) {\n dataLassoCallback(activeId, []);\n }\n }\n });\n }", "addPointsOnLine() {\n this.chart.selectAll(\".dot\") // even if nothing is returned, this creates a selector for future data binding\n .data(this.dataset) // binds dataset to the selection\n .enter().append(\"circle\") // Uses the enter().append() method to populate <circle> for each \n .attr(\"class\", \"dot\") // Assign a class for styling\n .attr(\"cx\", (d, i) => this.xScale(i)) // x coord of circle\n .attr(\"cy\", (d) => this.yScale(d.y)) // y coord of circle\n .attr(\"r\", 5) // radius of circle\n .on(\"mouseover\", this.handleMouseOver)\n .on(\"mouseout\", this.handleMouseOut);\n }", "function setUpLineSliders() {\r\n //\r\n // set up vertical slider on line chart\r\n $(\"#vertical-line-slider-range\").slider({\r\n orientation: \"vertical\",\r\n range: true,\r\n disabled: true,\r\n min: aleph.yMain.domain()[0],\r\n max: aleph.yMain.domain()[1],\r\n values: [aleph.yMain.domain()[0], aleph.yMain.domain()[1]],\r\n slide: function (event, ui) {\r\n // document.getElementById(\"line-reset-axes\").disabled = false;\r\n d3.selectAll(\".aleph-reset\").classed(\"aleph-hide\", false);\r\n\r\n d3.selectAll(\".aleph-yAxisTitle\").html(\r\n \"Number of UK Population (between \" +\r\n numberWithCommas(ui.values[0]) +\r\n \" to \" +\r\n numberWithCommas(ui.values[1]) +\r\n \")\"\r\n );\r\n\r\n // update yMain domain\r\n aleph.yMain.domain([ui.values[0], ui.values[1]]);\r\n\r\n // update definition of y-axis domain after slider change ..\r\n d3.selectAll(\".axis.axis--y.mainAxis\").call(d3.axisLeft(aleph.yMain));\r\n d3.selectAll(\".line.mainline\").attr(\"d\", aleph.mainline);\r\n d3.selectAll(\".aleph-Line-Vertex-Marker-Circles\").attr(\r\n \"cy\",\r\n function (d) {\r\n return (\r\n aleph.margin.line[aleph.windowSize].top +\r\n aleph.yMain(d[aleph.lineChartyAxisType])\r\n );\r\n }\r\n );\r\n\r\n d3.selectAll(\".aleph-yAxisTicks\").remove();\r\n\r\n // draw tick grid lines extending from y-axis ticks on axis across scatter graph\r\n var yticks = d3.selectAll(\".axis.axis--y.mainAxis\").selectAll(\".tick\");\r\n yticks\r\n .append(\"svg:line\")\r\n .attr(\"class\", \"aleph-yAxisTicks\")\r\n .attr(\"y0\", 0)\r\n .attr(\"y1\", 0)\r\n .attr(\"x1\", 0)\r\n .attr(\r\n \"x2\",\r\n svgWidth -\r\n aleph.margin.line[aleph.windowSize].left -\r\n aleph.margin.line[aleph.windowSize].right\r\n );\r\n\r\n var topBottom = d3\r\n .selectAll(\".ui-slider-handle.ui-corner-all.ui-state-default.top\")\r\n .style(\"bottom\");\r\n\r\n var bottomBottom = d3\r\n .selectAll(\".ui-slider-handle.ui-corner-all.ui-state-default.bottom\")\r\n .style(\"bottom\");\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-top\")\r\n .style(\"bottom\", topBottom)\r\n .text(numberWithCommas(ui.values[1]) + \" -\");\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-bottom\")\r\n .style(\"bottom\", bottomBottom)\r\n .text(numberWithCommas(ui.values[0]) + \" -\");\r\n },\r\n });\r\n\r\n // d3.selectAll(\".slider-label.slider-label-fixed-top\").text(\r\n // numberWithCommas(numberWithCommas(aleph.yMain.domain()[1]))\r\n // );\r\n d3.selectAll(\".slider-label.slider-label-fixed-top\").text(function () {\r\n if (aleph.lineChartyAxisType == \"counts\") {\r\n return numberWithCommas(aleph.yMain.domain()[1]);\r\n } else {\r\n return aleph.yMain.domain()[1].toFixed(1);\r\n }\r\n });\r\n\r\n d3.selectAll(\".slider-label.slider-label-fixed-bottom\").text(\r\n numberWithCommas(numberWithCommas(aleph.yMain.domain()[0]))\r\n );\r\n\r\n //\r\n //\r\n //\r\n //\r\n // set up vertical slider on line chart\r\n $(\"#horizontal-line-slider-range\").slider({\r\n orientation: \"horizontal\",\r\n range: true,\r\n disabled: true,\r\n min: Number(aleph.years[0]),\r\n max: Number(aleph.years[aleph.years.length - 1]),\r\n values: [aleph.years[0], aleph.years[aleph.years.length - 1]],\r\n slide: function (event, ui) {\r\n // document.getElementById(\"line-reset-axes\").disabled = false;\r\n d3.selectAll(\".aleph-reset\").classed(\"aleph-hide\", false);\r\n\r\n // update yMain domain\r\n aleph.xMain.domain([\r\n aleph.parseDate(ui.values[0]),\r\n aleph.parseDate(ui.values[1]),\r\n ]);\r\n\r\n // update definition of y-axis domain after slider change ..\r\n d3.selectAll(\".axis.axis--x.mainAxis\").call(d3.axisBottom(aleph.xMain));\r\n d3.selectAll(\".line.mainline\").attr(\"d\", aleph.mainline);\r\n d3.selectAll(\".aleph-Line-Vertex-Marker-Circles\").attr(\r\n \"cx\",\r\n function (d) {\r\n return (\r\n aleph.margin.line[aleph.windowSize].left +\r\n aleph.xMain(aleph.parseDate(d.year))\r\n );\r\n }\r\n );\r\n\r\n setTimeout(function () {\r\n var rightLeft = d3\r\n .selectAll(\".ui-slider-handle.ui-corner-all.ui-state-default.right\")\r\n .style(\"left\");\r\n\r\n var leftleft = d3\r\n .selectAll(\".ui-slider-handle.ui-corner-all.ui-state-default.left\")\r\n .style(\"left\");\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-left\")\r\n .style(\"left\", leftleft)\r\n .text(ui.values[0]);\r\n\r\n d3.selectAll(\".slider-label.slider-label-movable-right\")\r\n .style(\"left\", rightLeft)\r\n .text(ui.values[1]);\r\n }, 5);\r\n },\r\n });\r\n\r\n // // call function to append ticks to slider bar.\r\n // setSliderTicks(\"#horizontal-line-slider-range\");\r\n\r\n d3.select(\"#horizontal-line-slider-range\").style(\r\n \"width\",\r\n svgWidth -\r\n aleph.margin.line[aleph.windowSize].left -\r\n aleph.margin.line[aleph.windowSize].right +\r\n \"px\"\r\n );\r\n\r\n d3.selectAll(\".slider-label.slider-label-fixed-left\").text(\r\n aleph.formatDate(aleph.xMain.domain()[0])\r\n );\r\n d3.selectAll(\".slider-label.slider-label-fixed-right\").text(\r\n aleph.formatDate(aleph.xMain.domain()[1])\r\n );\r\n\r\n d3.selectAll(\".line-chart-slider-range-container\").style(\r\n \"width\",\r\n function () {\r\n return aleph.margin.line[aleph.windowSize].left - 90 + \"px\";\r\n }\r\n );\r\n\r\n d3.selectAll(\"#horizontal-line-slider-range\").style(\r\n \"left\",\r\n aleph.margin.line[aleph.windowSize].left + \"px\"\r\n );\r\n\r\n return;\r\n}", "function viewLineGraph() {\n mapView = false;\n isPlaying = false;\n d3.select(\"#heat-map-button\")\n .classed(\"enabled-button\", true)\n .classed(\"disabled-button\", false)\n .attr(\"disabled\", null);\n d3.select(\"#line-graph-button\")\n .classed(\"enabled-button\", false)\n .classed(\"disabled-button\", true)\n .attr(\"disabled\", \"true\");\n d3.select(\".page1\").style(\"display\", \"none\");\n d3.select(\".page2\").style(\"display\", \"block\");\n d3.select(\"#dropdown_container\").style(\"visibility\", \"visible\");\n page2();\n}", "_drawLine() {\n let canvas = this.chart.canvas;\n let ctx = canvas.ctx;\n\n // Defining coordinates of points\n let points = this.points;\n\n let firstVisiblePoint = undefined;\n for (let i = 0; i < points.length; i++) {\n if (canvas.isPointVisible(points[i])) {\n firstVisiblePoint = i;\n break;\n }\n }\n\n // If there is no visible point, there's nothing to draw for this line\n if (firstVisiblePoint === undefined) return;\n \n // Drawing line\n // Move cursor to the point right before the first visible\n let startPoint = firstVisiblePoint > 0 ? firstVisiblePoint - 1 : 0;\n ctx.moveTo(points[startPoint].x, points[startPoint].y);\n\n for (let i = firstVisiblePoint; i < points.length; i++) {\n let p = points[i];\n ctx.lineTo(p.x, p.y);\n\n // If it already drawn a not visible point, stop\n if (!canvas.isPointVisible(p))\n break;\n }\n }", "function DrawClicksChart()\n{\n // create/delete rows \n if (clicksTable.getNumberOfRows() < aggrDataPoints.length)\n { \n var numRows = aggrDataPoints.length - clicksTable.getNumberOfRows();\n clicksTable.addRows(numRows);\n } else {\n for(var i=(clicksTable.getNumberOfRows()-1); i >= aggrDataPoints.length; i--)\n {\n clicksTable.removeRow(i); \n }\n }\n\n // Populate data table with time/clicks data points. \n for(var i=0; i < clicksTable.getNumberOfRows(); i++)\n {\n clicksTable.setCell(i, 0, new Date(parseInt(aggrDataPoints[i].timestamp)));\n clicksTable.setCell(i, 1, parseInt(aggrDataPoints[i].clicks));\n }\n\n // Draw line chart.\n chartOptions.title = 'Clicks Chart';\n clicksChart.draw(clicksView, chartOptions); \n}", "function initVis() {\r\n\r\n createMapChart();\r\n populateTable();\r\n createLineCharts();\r\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n\n // Find the button just clicked\n let button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n let buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n _bubbleChart.toggleDisplay(buttonId);\n });\n}", "function plotChart(labels, data) {\n var chartData = {\n labels: labels,\n datasets : [\n {\n fillColor: \"rgba(151,187,205,0.2)\",\n strokeColor: \"rgba(151,187,205,1)\",\n pointColor: \"rgba(151,187,205,1)\",\n pointStrokeColor: \"#fff\",\n pointHighlightFill: \"#fff\",\n pointHighlightStroke: \"rgba(151,187,205,1)\",\n data : data\n }\n ]\n };\n\n var charts = document.getElementsByClassName(\"js-chart\");\n var chartLength = charts.length;\n\n for(var i = 0; i < chartLength; i++) {\n var ctx = charts[i].getContext(\"2d\");\n ctx.canvas.width = 300;\n ctx.canvas.height = 300;\n window.myLine = new Chart(ctx).Line(chartData);\n }\n }", "function chart(){\n\t\tthis.init();\n\t}", "function postInit(target, data, options) {\n for (var i=0; i<this.series.length; i++) {\n if (this.series[i].renderer.constructor == $.jqplot.LineRenderer) {\n // don't allow mouseover and mousedown at same time.\n if (this.series[i].highlightMouseOver) {\n this.series[i].highlightMouseDown = false;\n }\n }\n }\n }", "function addOnClickListeners() {\n d3.selectAll(\"circle\").on(\"click\", function (d) {\n\n hideDataTable();\n\n // show loading indicator\n var loadingIndicatorTable = document.getElementById(\"loadingIndicatorTable\");\n loadingIndicatorTable.style.display = 'block';\n\n // highlight clicked data point\n d3.select(this)\n .style(\"fill\", \"red\")\n .style(\"stroke\", \"black\")\n .style(\"stroke-width\", 2)\n .style(\"opacity\", 1);\n\n var data = {\n date: [],\n host: [],\n browser: [],\n mediaType: [],\n subtype: [],\n jobGroup: [],\n page: []\n };\n\n if (d.data.key != null) {\n data[\"date\"] = d.data.key;\n }\n if (charts[\"host-chart\"] != null) {\n data[\"host\"] = (charts[\"host-chart\"].filters());\n }\n if (charts[\"browser-chart\"] != null) {\n data[\"browser\"] = (charts[\"browser-chart\"].filters());\n }\n if (charts[\"mediaType-chart\"] != null) {\n data[\"mediaType\"] = (charts[\"mediaType-chart\"].filters());\n }\n if (charts[\"subtype-chart\"] != null) {\n data[\"subtype\"] = (charts[\"subtype-chart\"].filters());\n }\n if (charts[\"jobGroup-chart\"] != null) {\n data[\"jobGroup\"] = (charts[\"jobGroup-chart\"].filters());\n }\n if (charts[\"page-chart\"] != null) {\n data[\"page\"] = (charts[\"page-chart\"].filters());\n }\n data['osmInstance'] = OsmDetailMicroService.osmInstance;\n\n jQuery.ajax({\n type: \"POST\",\n url: ajaxUrl,\n contentType: 'application/json; charset=utf-8',\n dataType: 'json',\n data: JSON.stringify(data),\n success: function (resp) {\n removeAllRowsFromAssetDetailsTable();\n var uniqueMap = {};\n createWptUrl(resp);\n var dataCount = getDataCounts(resp);\n uniqueMap = createUniqueMapFromDataCount(dataCount, resp);\n fillPreFilteredTable(resp, uniqueMap);\n fillDataInAssetTable(resp, data, uniqueMap);\n }\n });\n });\n}", "function initEvents() {\n\t\t\t\t\tvar afterResize;\n\n\t\t\t\t\t/**\n\t\t\t\t\t * On load removes loader, and clicks on a current day in calendar.\n\t\t\t\t\t */\n\t\t\t\t\twindow.addEventListener('load', function () {\n\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t_h.toggleClass(loader, 'loaded');\n\t\t\t\t\t\t\t_h.triggerClick(todayBtn);\n\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t}, false);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * On resize end recalculate width of chart.\n\t\t\t\t\t */\n\t\t\t\t\twindow.addEventListener('resize', function () {\n\t\t\t\t\t\tclearTimeout(afterResize);\n\t\t\t\t\t\tafterResize = setTimeout(function () {\n\t\t\t\t\t\t\trecalcCanvasWidth();\n\t\t\t\t\t\t}, 100);\n\t\t\t\t\t}, false);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Switch to previous week, and to previous month if no more weeks in month.\n\t\t\t\t\t */\n\t\t\t\t\tprevWeekBtn.addEventListener('click', function () {\n\t\t\t\t\t\tvar curWeek = calGrid.querySelector('.week__current');\n\t\t\t\t\t\tif (!curWeek.previousElementSibling) {\n\t\t\t\t\t\t\ttoggleMonth(-1);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttoggleWeek(-1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trecalcCanvasWidth();\n\t\t\t\t\t}, false);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Switch to next week, and next month if no more weeks in month.\n\t\t\t\t\t */\n\t\t\t\t\tnextWeekBtn.addEventListener('click', function () {\n\t\t\t\t\t\tvar curWeek = calGrid.querySelector('.week__current');\n\t\t\t\t\t\tif (!curWeek.nextElementSibling) {\n\t\t\t\t\t\t\ttoggleMonth(1);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttoggleWeek(1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trecalcCanvasWidth();\n\t\t\t\t\t}, false);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Switch to previous month.\n\t\t\t\t\t */\n\t\t\t\t\tprevMonthBtn.addEventListener('click', function () {\n\t\t\t\t\t\ttoggleMonth(-1);\n\t\t\t\t\t\trecalcCanvasWidth();\n\t\t\t\t\t}, false);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Switch to next month.\n\t\t\t\t\t */\n\t\t\t\t\tnextMonthBtn.addEventListener('click', function () {\n\t\t\t\t\t\ttoggleMonth(1);\n\t\t\t\t\t\trecalcCanvasWidth();\n\t\t\t\t\t}, false);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Clicking on today button displays/switches to current day and week.\n\t\t\t\t\t */\n\t\t\t\t\ttodayBtn.addEventListener('click', function () {\n\t\t\t\t\t\tdrawMonthView(curMonthSave);\n\t\t\t\t\t\tselectWeek(curWeekSave, drawWeekView);\n\t\t\t\t\t\trecalcCanvasWidth();\n\t\t\t\t\t}, false);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Clicking on search icon, focuses on search field\n\t\t\t\t\t * and adds active class to parent container.\n\t\t\t\t\t */\n\t\t\t\t\tsearchLink.addEventListener('click', function (evt) {\n\t\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\t\tsearchField.focus();\n\t\t\t\t\t\t_h.toggleClass(evt.currentTarget.parentElement, 'active-search');\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Clear searchfield on blur and remove active class\n\t\t\t\t\t */\n\t\t\t\t\tsearchField.addEventListener('blur', function (evt) {\n\t\t\t\t\t\tevt.currentTarget.value = '';\n\t\t\t\t\t\tevt.currentTarget.parentElement.classList.remove('active-search');\n\t\t\t\t\t});\n\n\t\t\t\t\t/**\n\t\t\t\t\t * On keypress perform search\n\t\t\t\t\t */\n\t\t\t\t\tsearchField.addEventListener('keypress', function (evt) {\n\t\t\t\t\t\tsearchDate(evt);\n\t\t\t\t\t}, false);\n\n\t\t\t\t\tdocument.addEventListener('click', function (evt) {\n\t\t\t\t\t\tevt.preventDefault();\n\t\t\t\t\t\tvar target = evt.target,\n\t\t\t\t\t\t\ttargetParent = target.parentElement,\n\t\t\t\t\t\t\tdayIdx = _h.getIndex(calGrid.querySelectorAll('.day'), target),\n\t\t\t\t\t\t\tlgDay = weekView.querySelector('.lg-current-day');\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Clicking on a day in the calendar, makes week\n\t\t\t\t\t\t * of selected day current and displays selected day in the week view.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (_h.hasClass(target, 'day') && !_h.hasClass(target, 'sm-nodata-day')) {\n\t\t\t\t\t\t\tsetWeekAndDayIndexes(dates[dayIdx]);\n\t\t\t\t\t\t\tif (!_h.hasClass(targetParent, 'week__current')) {\n\t\t\t\t\t\t\t\tselectWeek(indexObj.weekIdx, drawWeekView);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tselectDay(indexObj.dayIndexInWeek);\n\t\t\t\t\t\t\trecalcCanvasWidth();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Displays current date and week,\n\t\t\t\t\t\t * toggles \"selected\" class on large day in the week view with timeout.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (target.className === 'choose-today') {\n\t\t\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t\t\t_h.toggleClass(lgDay, 'selected');\n\t\t\t\t\t\t\t}, 200);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Clicking on a large day in week view toggles \"selected\" class.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (target.className === 'dummy-overlay') {\n\t\t\t\t\t\t\t_h.toggleClass(targetParent, 'selected');\n\t\t\t\t\t\t}\n\t\t\t\t\t}, false);\n\t\t\t\t}", "function updateLineSelectors() {\n controller.setButtonColour(LaunchPadMini.buttons.RIGHT_COLUMN[0], LaunchPadMini.constants.COLOURS.GREEN);\n controller.setButtonColour(LaunchPadMini.buttons.RIGHT_COLUMN[1], LaunchPadMini.constants.COLOURS.GREEN);\n\n if (state.activeLines === MIN_LINES) {\n controller.setButtonColour(LaunchPadMini.buttons.RIGHT_COLUMN[0], LaunchPadMini.constants.COLOURS.RED);\n } else if (state.activeLines === MAX_LINES) {\n controller.setButtonColour(LaunchPadMini.buttons.RIGHT_COLUMN[1], LaunchPadMini.constants.COLOURS.RED);\n }\n }", "function SVGRowChart() {\r\n }", "function drawLineChart(dataset) {\n var chartContainer = document.getElementById(\"div1\");\n document.getElementById(\"div1\").innerHTML =\"\";\n\n //determine the array from the radio button that is checked\n var dataset = receiveInput();\n\n var widthOfContainer = chartContainer.scrollWidth;\n var heightOfContainer = chartContainer.scrollHeight;\n var widthOfBar = parseInt(widthOfContainer / dataset.length) -2;\n\n if (typeof(dataset) !== 'object') {\n return;\n }\n\n //height of bar dependent on the maximum and minimum element in array\n var maxNumber = dataset[0];\n var minNumber = dataset[0];\n for (var i = 1; i < dataset.length; i++) {\n if (dataset[i] > maxNumber) {\n maxNumber = dataset[i];\n }\n else if (dataset[i] < minNumber) {\n minNumber = dataset[i];\n }\n }\n //create canvas element\n var canvasElement = document.createElement(\"canvas\");\n //attributes of canvas element\n canvasElement.setAttribute(\"id\", \"myCanvas\");\n //set styles\n canvasElement.width = widthOfContainer;\n canvasElement.height = heightOfContainer;\n\n var barCanvas = canvasElement;\n var context = barCanvas.getContext('2d');\n\n for (var j = 0; j < dataset.length; j++) {\n //create height, width of rect\n var marginLeft = parseInt(j * 2 + j * widthOfBar);\n var cirMarginLeft = parseInt((j * 2 + j * widthOfBar) + (widthOfBar/2));\n var height = 0;\n var width = parseInt(widthOfBar);\n var top = 0;\n //set variables for the previous points to be used to draw the lines\n var prevTop = 0, prevCirMarginLeft = 0;\n\n context.beginPath();\n if ((maxNumber+minNumber) > maxNumber) {\n totHeight = maxNumber;\n height = Math.abs((dataset[j]/totHeight)*heightOfContainer);\n top = parseInt(heightOfContainer - height);\n prevTop = parseInt(heightOfContainer - Math.abs((dataset[j-1]/totHeight)*heightOfContainer));\n prevCirMarginLeft = parseInt(((j-1) * 2 + (j-1) * widthOfBar) + (widthOfBar/2));\n context.moveTo(prevCirMarginLeft, prevTop);\n context.lineTo(cirMarginLeft, top);\n context.arc(cirMarginLeft, top, 4, 0*Math.PI, 2*Math.PI);\n }\n else if ((maxNumber+minNumber) < maxNumber) {\n totHeight = maxNumber - minNumber;\n height = Math.abs((dataset[j]/totHeight)*heightOfContainer);\n if (dataset[j] < 0) {\n top = (maxNumber/totHeight)*heightOfContainer;\n prevTop = parseInt((maxNumber/totHeight)*heightOfContainer + Math.abs((dataset[j-1]/totHeight)*heightOfContainer));\n prevCirMarginLeft = parseInt(((j-1) * 2 + (j-1) * widthOfBar) + (widthOfBar/2));\n context.moveTo(prevCirMarginLeft, prevTop);\n context.lineTo(cirMarginLeft, top+height);\n context.arc(cirMarginLeft, top+height, 4, 0*Math.PI, 2*Math.PI);\n }\n else if (dataset[j] > 0) {\n top = heightOfContainer - (height - ((minNumber/totHeight)*heightOfContainer));\n prevTop = parseInt(heightOfContainer - (Math.abs((dataset[j-1]/totHeight)*heightOfContainer) - ((minNumber/totHeight)*heightOfContainer)))\n prevCirMarginLeft = parseInt(((j-1) * 2 + (j-1) * widthOfBar) + (widthOfBar/2))\n context.moveTo(prevCirMarginLeft, prevTop);\n context.lineTo(cirMarginLeft, top);\n context.arc(cirMarginLeft, top, 4, 0*Math.PI, 2*Math.PI);\n }\n }\n context.stroke();\n context.fillStyle ='#000000';\n context.fill();\n }\n chartContainer.appendChild(canvasElement);\n document.getElementById(\"div3\").innerHTML =\"There's your Line Chart\";\n}//end of the line chart function", "_initSalesStocksCharts() {\n if (document.getElementById('largeLineChart1')) {\n this._largeLineChart1 = ChartsExtend.LargeLineChart('largeLineChart1', {\n labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Today'],\n datasets: [\n {\n label: 'Sales',\n data: [23, 24, 26, 30, 27],\n icons: ['arrow-top', 'arrow-top', 'arrow-top', 'arrow-top', 'arrow-bottom'],\n borderColor: Globals.primary,\n pointBackgroundColor: Globals.primary,\n pointBorderColor: Globals.primary,\n pointHoverBackgroundColor: Globals.foreground,\n pointHoverBorderColor: Globals.primary,\n borderWidth: 2,\n pointRadius: 2,\n pointBorderWidth: 2,\n pointHoverBorderWidth: 2,\n pointHoverRadius: 5,\n fill: false,\n datalabels: {\n align: 'end',\n anchor: 'end',\n },\n },\n ],\n });\n }\n\n if (document.getElementById('largeLineChart2')) {\n this._largeLineChart2 = ChartsExtend.LargeLineChart('largeLineChart2', {\n labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Today'],\n datasets: [\n {\n label: 'Stock',\n data: [44, 49, 45, 33, 52],\n icons: ['arrow-top', 'arrow-top', 'arrow-bottom', 'arrow-bottom', 'arrow-top'],\n borderColor: Globals.secondary,\n pointBackgroundColor: Globals.secondary,\n pointBorderColor: Globals.secondary,\n pointHoverBackgroundColor: Globals.foreground,\n pointHoverBorderColor: Globals.secondary,\n borderWidth: 2,\n pointRadius: 2,\n pointBorderWidth: 2,\n pointHoverBorderWidth: 2,\n pointHoverRadius: 5,\n fill: false,\n datalabels: {\n align: 'end',\n anchor: 'end',\n },\n },\n ],\n });\n }\n }", "initDomEvents() {\n const me = this; // Set thisObj and element of the configured listener specs.\n\n me.scheduledBarEvents.element = me.schedulerEvents.element = me.timeAxisSubGridElement;\n me.scheduledBarEvents.thisObj = me.schedulerEvents.thisObj = me; // same listener used for different events\n\n EventHelper.on(me.scheduledBarEvents);\n EventHelper.on(me.schedulerEvents);\n }", "_addEventsYAxis(btnsZoom, btnsMove, btnHome){\n $(btnsZoom[0]).click(() => { this.zoomYAxis(false); });\n $(btnsZoom[1]).click(() => { this.zoomYAxis(true); });\n $(btnsMove[0]).click(() => { this.moveYAxis(false); });\n $(btnsMove[1]).click(() => { this.moveYAxis(true); });\n $(btnHome).click(() => { this.homeYAxis(); });\n }", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.select('#toolbar').selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n\n d3.select('#toolbar-color')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.select('#toolbar-color').selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleColor(buttonId);\n });\n\n d3.select('#clear-labels')\n .on('click', function () {\n myBubbleChart.hideLabels();\n });\n}", "function drawCharts() {\n Object.keys(sparkline_data).forEach(function (key) {\n var chart = new google.visualization.LineChart(document.getElementById(key));\n chart.draw(sparkline_data[key], sparkline_options);\n });\n}", "didDrawChart () {\n this.sendAction ('draw');\n }", "function generateLineChartVis() {\n\tvar height = 280;\n\tvar width = 1250;\n\tvar padding = {\n\t\t\"top\": 5,\n\t\t\"bottom\": 20,\n\t\t\"left\": 40,\n\t\t\"right\": 300\n\t};\n\n\tvar svg = d3.select(\"#lineChartVis\")\n\t\t.append(\"svg\")\n\t\t.attr(\"width\", width)\n\t\t.attr(\"height\", height);\n\n\tvar xscale = d3.scaleLinear().domain([2007, 2015]).range([padding.left, width - padding.right]);\n\tvar yscale = d3.scaleLinear().domain([100, 0]).range([padding.top, height - padding.bottom]);\n\n\tvar xaxis = d3.axisBottom().tickFormat(d3.format(\"0000\")).scale(xscale);\n\tvar yaxis = d3.axisLeft().scale(yscale);\n\tsvg.append(\"g\").attr(\"class\", \"xaxis\").attr(\"transform\", \"translate(0,\" + (height - padding.bottom) + \")\").call(xaxis);\n\tsvg.append(\"g\").attr(\"class\", \"yaxis\").attr(\"transform\", \"translate(\" + padding.left + \",0)\").call(yaxis);\n\n\tlineChartObj.xscale = xscale;\n\tlineChartObj.yscale = yscale;\n\tlineChartObj.width = width;\n\tlineChartObj.height = height;\n\tlineChartObj.empty = true;\n\n\t//Draw the empty line chart warning label\n\tsvg.append(\"text\")\n\t\t.attr(\"id\", \"lineChartWarning\")\n\t\t.attr(\"x\", ((width - padding.right) - 450) / 2)\n\t\t.attr(\"y\", height / 2)\n\t\t.text(\"Select multiple courses in the table or scatter to compare here (Up to 5)\");\n\n\tdrawEmptyLineChartLabel(true);\n\n\tsvg.append(\"text\")\n\t\t.attr(\"class\", \"axisLabel\")\n\t\t.attr(\"x\", -(height + 80) / 2)\n\t\t.attr(\"y\", 12)\n\t\t.attr(\"transform\", \"rotate(-90)\")\n\t\t.text(\"Unemployment %\");\n\n\tsvg.append(\"image\")\n\t\t.attr(\"id\", \"lineFullWarning\")\n\t\t.attr(\"y\", -60)\n\t\t.attr(\"x\", 50)\n\t\t.attr(\"width\", 500)\n\t\t.attr(\"height\", 200)\n\t\t.attr(\"xlink:href\", \"lineFullWarning.png\")\n\t\t.attr(\"visibility\", \"hidden\");\n}", "function InitializeTimelineChart(model)\n{\n choiceContainer = $(\"#choicesCDND\");\n choiceContainer.find(\"input\").click(PlotCDND);\n if (model != undefined)\n GetData(model);\n}", "function graph_line_generate(category,text,data,dom,title,subtitle,color)\n{\n $('#' + dom).highcharts({\n title: {\n text: title\n },\n subtitle: {\n text: subtitle\n },\n xAxis: {\n categories: category,\n crosshair: true\n },\n yAxis: {\n min: 0,\n title: {\n text: text\n }\n },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle',\n borderWidth: 0\n },\n colors: color,\n series: [data]\n });\n}", "function addAddVectorGuideLineToolListeners(){\n\tdocument.getElementById('visualizationContainer').addEventListener( 'mousemove', addVectorGuideLineToolPoint1FollowMouse, false );\n\tdocument.getElementById('visualizationContainer').addEventListener( 'mousemove', showOrthoGuidesWithTool, false );\n}", "function cryptic_line_chart_btc_eth_neo() {\n var config2c = {\n type: 'line',\n data: {\n labels: [\"2016\", \"2016\", \"2016\", \"2017\", \"2017\", \"2018\"],\n datasets: [{\n label: \"Bitcoin \",\n fill: false,\n borderColor: window.chartColors.green,\n backgroundColor: window.chartColors.green,\n data: [0, 1.5, 2.5, 2, 3, 5]\n }, {\n label: \"Ethereum\",\n fill: false,\n borderColor: window.chartColors.red,\n backgroundColor: window.chartColors.red,\n data: [0, 0.75, 1, 1.75, 2.5, 3]\n }, {\n label: \"NEO \",\n fill: false,\n borderColor: window.chartColors.blue,\n backgroundColor: window.chartColors.blue,\n data: [0, 2, 0.75, 1.5, 2, 4]\n }]\n }\n };\n var ctx2c = document.getElementById(\"btn_etn_neo\").getContext(\"2d\");\n window.chart2c = new Chart(ctx2c, config2c);\n}", "render() {\n return (\n <MDBContainer>\n <h3 className=\"mt-5\">Line chart</h3>\n <button onClick={()=>this.makeDatasets()} className=\"btn btn-primary\" hidden={this.hideIfEmpty()}> Show the Graph! </button>\n <Line data={this.state} options={{ responsive: true }} />\n </MDBContainer>\n );\n }", "start() {\n this.canvas = document.querySelector(\"#temp_widget\").getContext(\"2d\");\n let highs = this.getValues(this.temps).highsArray;\n let lows = this.getValues(this.temps).lowsArray;\n // console.log(this.getLabels());\n\n this.chart = new Chart(this.canvas, {\n // The type of chart we want to create\n type: 'line',\n\n // The data for our dataset\n data: {\n labels: this.getLabels(),\n datasets: [{\n label: 'Highs',\n fill: false,\n backgroundColor: '#F8444E',\n borderColor: '#F8444E',\n data: highs,\n yAxisId: \"temps\"\n },\n {\n label: 'Lows',\n fill: false,\n backgroundColor: '#FFEBDB',\n borderColor: '#FFEBDB',\n data: lows,\n yAxisId: \"temps\"\n }\n ]\n },\n // Configuration options go here\n options: {\n tooltips: {\n enabled: true,\n mode: 'single',\n },\n scales: {\n yAxes: [{\n id: 'temps',\n type: 'linear',\n position: 'left',\n ticks: {\n // Include a '°C' before the ticks\n callback: function(value, index, values) {\n return value + \"°C\";\n }\n }\n }]\n }\n }\n });\n }", "function redrawClientslineChart() {\n nv.addGraph(function() {\n var chart = nv.models.lineChart()\n .useInteractiveGuideline(true);\n chart.width(700);\n chart.margin({left:50});\n chart.color(['#2ca02c', 'darkred','darkblue']);\n chart.x(function(d,i) { return i });\n chart.xAxis\n .axisLabel('Date')\n .tickFormat(function(d) {\n var label = scope.data23[0].values[d].label1;\n return label;\n });\n chart.yAxis\n .axisLabel('Y axis')\n .tickFormat(function(d){\n return d3.format(',f')(d);\n });\n d3.select('#chart svg')\n .datum(scope.data23)\n .transition().duration(500)\n .call(chart);;\n nv.utils.windowResize(chart.update);;\n return chart;\n });\n }", "constructor(line, tooltip, list) {\r\n this.lineChart = line;\r\n this.tooltip = tooltip;\r\n this.list = list\r\n }", "activateLineRipple() {}", "function initChart() {\n\n\tvar months = ['January','February','March','April','May','June','July',\n\t\t\t\t\t'August','September','October','November','December'];\n\n\tvar chart = c3.generate({\n\t\tbindto: '#fig2',\n\t\ttype: 'line',\n\t\tsize: { height: 400 },\n\t\tdata: { columns: [],\n\t\t\t\tselection: { enabled: true }\n\t\t},\n\t\ttitle: { text: 'Accidents per Month' },\n\t\taxis: {\n\t\t\tx: {\n\t\t\t\ttype: 'category',\n\t\t\t\tcategories: months,\n\t\t\t\tlabel: {\n\t\t\t\t\ttext: 'Month',\n\t\t\t\t\tposition: 'outer-center'\n\t\t\t\t }\n\t\t\t},\n\t\t\ty: {\n\t\t\t\tlabel: {\n\t\t\t\t\ttext: 'Number Of Aviation Accidents',\n\t\t\t\t\tposition: 'outer-middle'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tchart.legend.hide();\n\t\n\ttypes = ['bar','spline','step','line'];\n\n\tcounter = 0\n\tendHere = 0\n\ttimer = window.setInterval(function(){\n\t\tchart.transform(types[counter])\n\t\tconsole.log(types[counter])\n\t\tcounter++\n\t\tendHere++\n\t\tif (counter == 4) { counter = 0 }\n\t\tif (endHere == 50) { clearInterval(timer) }\n\t},5000)\n\n\treturn chart;\n\n}", "function updateChartist() {\r\n // Use D3 to select the dropdown menu\r\n var dropdownMenu = d3.select(\"#lineSelect\");\r\n // Assign the value of the dropdown menu option to a variable\r\n var dataset = dropdownMenu.property(\"value\");\r\n // Initialize x and y arrays\r\n var x = [];\r\n var y = [];\r\n if (dataset === 'cr') {\r\n var chart = new Chartist.Line('#chart2', {\r\n labels: pop_keys,\r\n series: cr_series\r\n }, options_line);\r\n }\r\n \r\n else if (dataset === 'en') {\r\n var chart = new Chartist.Line('#chart2', {\r\n labels: pop_keys,\r\n series: en_series\r\n }, options_line); \r\n }\r\n\r\n else if (dataset === 'vu') {\r\n var chart = new Chartist.Line('#chart2', {\r\n labels: pop_keys,\r\n series: vu_series\r\n }, options_line); \r\n }\r\n \r\n // Let's put a sequence number aside so we can use it in the event callbacks\r\n var seq = 0,\r\n delays = 20,\r\n durations = 500;\r\n \r\n // Once the chart is fully created we reset the sequence\r\n chart.on('created', function() {\r\n seq = 0;\r\n });\r\n \r\n // On each drawn element by Chartist we use the Chartist.Svg API to trigger SMIL animations\r\n chart.on('draw', function(data) {\r\n seq++;\r\n \r\n if(data.type === 'line') {\r\n // If the drawn element is a line we do a simple opacity fade in. This could also be achieved using CSS3 animations.\r\n data.element.animate({\r\n opacity: {\r\n // The delay when we like to start the animation\r\n begin: seq * delays + 500,\r\n // Duration of the animation\r\n dur: durations,\r\n // The value where the animation should start\r\n from: 0,\r\n // The value where it should end\r\n to: 1\r\n }\r\n });\r\n } \r\n \r\n else if(data.type === 'label' && data.axis === 'x') {\r\n data.element.animate({\r\n y: {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data.y + 100,\r\n to: data.y,\r\n // We can specify an easing function from Chartist.Svg.Easing\r\n easing: 'easeOutQuart'\r\n }\r\n });\r\n } \r\n \r\n else if(data.type === 'label' && data.axis === 'y') {\r\n data.element.animate({\r\n x: {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data.x - 100,\r\n to: data.x,\r\n easing: 'easeOutQuart'\r\n }\r\n });\r\n } \r\n \r\n else if(data.type === 'point') {\r\n data.element.animate({\r\n x1: {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data.x - 10,\r\n to: data.x,\r\n easing: 'easeOutQuart'\r\n },\r\n x2: {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data.x - 10,\r\n to: data.x,\r\n easing: 'easeOutQuart'\r\n },\r\n opacity: {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: 0,\r\n to: 1,\r\n easing: 'easeOutQuart'\r\n }\r\n });\r\n } \r\n \r\n else if(data.type === 'grid') {\r\n // Using data.axis we get x or y which we can use to construct our animation definition objects\r\n var pos1Animation = {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data[data.axis.units.pos + '1'] - 30,\r\n to: data[data.axis.units.pos + '1'],\r\n easing: 'easeOutQuart'\r\n };\r\n \r\n var pos2Animation = {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data[data.axis.units.pos + '2'] - 100,\r\n to: data[data.axis.units.pos + '2'],\r\n easing: 'easeOutQuart'\r\n };\r\n \r\n var animations = {};\r\n animations[data.axis.units.pos + '1'] = pos1Animation;\r\n animations[data.axis.units.pos + '2'] = pos2Animation;\r\n animations['opacity'] = {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: 0,\r\n to: 1,\r\n easing: 'easeOutQuart'\r\n };\r\n \r\n data.element.animate(animations);\r\n }\r\n });\r\n \r\n // We update the chart every time it's created with a delay\r\n chart.on('created', function() {\r\n if(window.__exampleAnimateTimeout) {\r\n clearTimeout(window.__exampleAnimateTimeout);\r\n window.__exampleAnimateTimeout = null;\r\n }\r\n window.__exampleAnimateTimeout = setTimeout(chart.update.bind(chart), 15000);\r\n });\r\n }", "addDataVisuals () {\n }", "function onPolylineMouseClick(e) {\n\t//this is the actual polyline object\n\tshowChart(this);\n}", "function addSingleButtonEvents() {\n const gridElements = sketchContainer.querySelectorAll('.grid-item')\n addDrawColor(gridElements, BLACK);\n addingClearEvent(clearButton, gridElements);\n addEraserEvent(eraserButton, gridElements);\n updatePenColorEvent(penButton, gridElements, BLACK);\n addRainbowButtonEvent(gridElements);\n colorPickerEvent(gridElements);\n}", "function lines_install_install(registers) {\n registers.registerChartView(lines_LinesView);\n registers.registerSeriesModel(LinesSeries);\n registers.registerLayout(lines_linesLayout);\n registers.registerVisual(lines_linesVisual);\n}", "function activateLSISSubChart(chart) {\n let activePoints = this.getElementsAtEvent(chart);\n let choosedIndicator = LSISIndicator[activePoints[0]._index];\n\n //Creat LSIS Overview Provincial\n let valueLSISOverviewSub = lsisIndicatorSub.map(d => d[choosedIndicator]);\n\n //Creat LSIS Overview Indicator\n let valueLsisTrend = lsisTrend.map(d=> d[choosedIndicator]);\n\n //Create LSIS Sub Category Area\n let valueLsisSubCategoryArea = lsisSubCategoryArea.map(d=> d[choosedIndicator]);\n\n //Create LSIS Sub Category Education\n let valueLsisSubCategoryEducation = lsisSubCategoryEducation.map(d=> d[choosedIndicator]);\n\n //Create LSIS Sub Category Ethinicity\n let valueLsisSubCategoryEthnicity = lsisSubCategoryEthnicity.map(d=> d[choosedIndicator]);\n\n //Create LSIS Sub Category Wealth\n let valueLsisSubCategoryWealth = lsisSubCategoryWealth.map(d=> d[choosedIndicator]);\n\n //Set viriable to change color on click for bar chart\n let labelCount = activePoints[0]._chart.data.labels.length;\n let backgroundColorToChange = [];\n for (let i = 0; i < labelCount; i++) {\n backgroundColorToChange.push('#e0e0e0');\n }\n backgroundColorToChange[activePoints[0]._index] = blue;\n\n //Set Function for adding new data to chart\n function updateData(chart, dataLabel, data) {\n\n chart.data.datasets.forEach((datasets) => {\n datasets.label = dataLabel;\n });\n chart.data.datasets.forEach((dataset) => {\n dataset.data = data;\n });\n chart.options.title.text = dataLabel;\n chart.update();\n }\n\n //Function updateData specifc for polar chart on LSIS tab\n function updateDataPolar(chart, dataLabel, data) {\n\n chart.data.datasets.forEach((datasets) => {\n datasets.label = dataLabel;\n });\n chart.data.datasets.forEach((dataset) => {\n dataset.data = data;\n });\n chart.options.title.text = dataLabel;\n chart.update();\n }\n\n //Set function to change data based on click\n function changeBackgoundColor (chart, color) {\n activePoints[0]._chart.config.data.datasets[0].backgroundColor = color;\n chart.update();\n }\n\n //Activate all function above to the desired chart\n changeBackgoundColor(lsisOverviewChart, backgroundColorToChange);\n updateData(lsisProvincialOverview, choosedIndicator, valueLSISOverviewSub);\n updateData(lsisOverviewTrend, choosedIndicator, valueLsisTrend);\n updateDataPolar(lsisSubCategoryAreaChart, choosedIndicator, valueLsisSubCategoryArea);\n updateDataPolar(lsisSubCategoryEducationChart, choosedIndicator, valueLsisSubCategoryEducation);\n updateDataPolar(lsisSubCategoryEthnicityChart, choosedIndicator, valueLsisSubCategoryEthnicity);\n updateDataPolar(lsisSubCategoryWealthChart, choosedIndicator, valueLsisSubCategoryWealth);\n }", "function setEventListeners() {\n $scope.selectedNodes = {};\n $scope.selectedEdges = {};\n\n var updateFlag = false;\n\n // Node selection\n $scope.cy.on('select', 'node', function(event) {\n var id = event.cyTarget.id();\n $scope.selectedNodes[id] = event.cyTarget;\n $scope.selectedNodes[id].addClass('highlighted');\n updateFlag = true;\n });\n \n // Reset selection\n $scope.cy.on('unselect', 'node', function(event) {\n var id = event.cyTarget.id();\n delete $scope.selectedNodes[id];\n updateFlag = true;\n });\n\n $scope.cy.on('select', 'edge', function(event) {\n var id = event.cyTarget.id();\n $scope.selectedEdges[id] = event.cyTarget;\n updateFlag = true;\n });\n\n \n $scope.cy.on('unselect', 'edge', function(event) {\n var id = event.cyTarget.id();\n delete $scope.selectedEdges[id];\n updateFlag = true;\n });\n\n setInterval(function() {\n if (updateFlag && $scope.browserState.show) {\n console.log('* update called');\n //displays node data\n console.log($scope.nodes[0].data);\n console.log($scope.edges[0]);\n setColumnNames();\n $scope.$apply();\n updateFlag = false;\n }\n }, 300);\n\n }", "function createMyLine3() {\n var ctx = document.getElementById('canvas23').getContext('2d');\n window.myLine3 = new Chart(ctx, config_line3);\n getLastThingSpeakData3();\n}", "function initListeners() {\n\tshowFollowers.addEventListener(\"change\", () => {\n\t\tsetConnectionMode(true, false);\n\t});\n\tshowFriends.addEventListener(\"change\", () => {\n\t\tsetConnectionMode(false, true);\n\t});\n\n\tviolinPlotSelect.addEventListener(\"change\", () => {\n\t\tdrawVP(violinPlotContainer, user1, user2, violinPlotSelect.value);\n\t})\n\n\tyearSelect.addEventListener(\"change\", () => {\n\t\tsetYear(yearSelect.value);\n\t})\n}", "function updateLine() {\n d3.selectAll('.line-chart').remove();\n svg_line = d3.select(\"#lines\").append(\"svg\")\n .attr('class', 'line-chart')\n .attr(\"width\", width_line + margin_line.left + margin_line.right)\n .attr(\"height\", height_line + margin_line.top + margin_line.bottom)\n .append(\"g\")\n .attr(\"transform\",\n \"translate(\" + margin_line.left + \",\" + margin_line.top + \")\");\n}", "addAxes () {\n }", "_initHighchart() {\n // disable highcharts sorting requirement\n // gets rid of annoying \"highcharts error 15\" messages\n (function (H) {\n H.seriesTypes.line.prototype.requireSorting = false;\n })(Highcharts);\n\n // call highcharts setup function\n this.graph_obj = Highcharts.chart({\n chart: {\n animation: false,\n renderTo: this.$.chart,\n type: 'line',\n width: this.offsetWidth,\n height: this.offsetHeight\n },\n title: { text: 'Choice vs. Time' },\n exporting: { enabled: false },\n tooltip: { enabled: false },\n legend: { enabled: false },\n credits: { enabled: false },\n xAxis: {\n min: 0,\n max: 1,\n labels: { enabled: false },\n plotLines: [{\n value: 0,\n width: 1,\n color: '#ccd6eb',\n zIndex: 100,\n },\n {\n value: 1,\n width: 1,\n color: '#ccd6eb',\n zIndex: 100,\n }],\n },\n yAxis: {\n title: { text: 'Choice' },\n min: 0,\n max: 1\n },\n plotOptions: {\n line: {marker: {enabled: false}},\n series: {\n states: {\n hover: {\n enabled: false,\n }\n }\n }\n },\n line: {\n marker: {\n enabled: false,\n states: {\n hover: { enabled: false },\n select: { enabled: false }\n }\n }\n },\n series: [{\n name: 'Your Choice',\n type: \"area\",\n data: this.myChoiceSeries,\n step: \"left\"\n },\n {\n name: 'Other Choice',\n type: \"line\",\n data: this.otherChoiceSeries,\n step: \"left\"\n }],\n legend: {\n align: 'right',\n verticalAlign: 'top',\n floating: true,\n y: 15,\n },\n });\n\n this._updateDataset();\n }", "function drawLineChart(raw_line_data) {\n var data = google.visualization.arrayToDataTable(raw_line_data['line']);\n\n var options = {\n title: 'Energy Usage',\n backgroundColor: 'transparent',\n colors: ['#7851a9'],\n 'width': 1000,\n 'height': 750,\n //curveType: 'function', <-- made graph curvy\n legend: { position: 'top' }\n };\n\n var chart = new google.visualization.LineChart(document.getElementById('linechart'));\n\n chart.draw(data, options);\n }", "initButtonEvents() {\n let allButtons = document.querySelectorAll('#buttons > g, #parts > g');\n Array.from(allButtons).forEach((btn, index) => {\n this.addEventListenerAll(btn, 'click drag', e => {\n let textBtn = btn.className.baseVal.replace('btn-', '');\n this.execBtn(textBtn);\n });\n\n this.addEventListenerAll(btn, 'mouseover mouseup mousedown', e => {\n btn.style.cursor = 'pointer';\n });\n })\n }", "function visualData() {\n $(\"#chart\").remove();\n $(\".containerChart\").append('<canvas id=\"chart\">');\n var canvas = document.getElementById(\"chart\");\n var ctx = canvas.getContext(\"2d\");\n\n Chart.defaults.global.defaultFontColor = \"black\";\n var myChart = new Chart(ctx, {\n type: \"line\",\n data: {\n labels: weeklyDate, //what is listed as the x axis value\n datasets: [\n {\n label: currentCompany,\n data: weeklyValue,\n backgroundColor: \"rgba(0, 0, 0, 1)\",\n borderColor: \"rgba(0, 0, 0, 1)\",\n borderWidth: 3,\n fill: false,\n },\n ],\n },\n options: {\n scales: {\n yAxes: [\n {\n ticks: {\n // beginAtZero: true\n callback: function (value, index, values) {\n return \"$\" + value;\n },\n },\n },\n ],\n },\n },\n });\n }" ]
[ "0.6141154", "0.60903716", "0.6055163", "0.5978363", "0.5973254", "0.5958651", "0.5955628", "0.5910048", "0.5902986", "0.58939797", "0.5872552", "0.5857542", "0.58491594", "0.5827673", "0.5817656", "0.581118", "0.5796051", "0.5764969", "0.5758807", "0.57560277", "0.5739931", "0.57295746", "0.57275033", "0.5700485", "0.5697922", "0.56454456", "0.5643324", "0.5626582", "0.5625543", "0.5622939", "0.5597137", "0.5595835", "0.5586838", "0.5579915", "0.5574427", "0.5573033", "0.5564348", "0.5556897", "0.5556897", "0.5556897", "0.55560076", "0.55518425", "0.55491304", "0.5545864", "0.55413884", "0.5505197", "0.5483341", "0.547508", "0.5474258", "0.54723215", "0.5466199", "0.5460558", "0.5459246", "0.5441418", "0.5435142", "0.54266846", "0.5423935", "0.5421684", "0.5419565", "0.5412725", "0.54108226", "0.540677", "0.54047567", "0.539554", "0.5383872", "0.53821653", "0.5378746", "0.5366346", "0.53631496", "0.5360866", "0.5352792", "0.53470325", "0.53406477", "0.5332852", "0.5332577", "0.5330964", "0.5314465", "0.5311432", "0.5306724", "0.530649", "0.53038824", "0.5303018", "0.53005517", "0.5298276", "0.5293638", "0.5281435", "0.5281121", "0.52739674", "0.5272727", "0.52725846", "0.5269639", "0.5266043", "0.52653784", "0.5265297", "0.52612144", "0.5256968", "0.52566105", "0.5255409", "0.5253757", "0.5253643" ]
0.67187685
0
Function to do text to speech
function synthVoice(text) { const synth = window.speechSynthesis; const utterance = new SpeechSynthesisUtterance(); utterance.text = text; synth.speak(utterance); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function texttospeech(textinput){\n // make it audioble using text to speech API - SpeechSynthesis\n var msg = new SpeechSynthesisUtterance(textinput);\n //msg.lang = 'en-US';\n msg.lang = select_dialect.value;\n \n window.speechSynthesis.speak(msg);\n msg.onend = function(e) {\n console.log('Finished in ' + event.elapsedTime + ' seconds.');\n };\n\n}", "function textToSpeech(){\n speech.speak(\"你說: \" + msg);\n }", "function textToSpeech(text) {\n var u = new SpeechSynthesisUtterance();\n u.text = text;\n u.lang = 'en-US';\n u.rate = 1.0;\n speechSynthesis.speak(u);\n}", "function textToSpeech() {\n let firstWord = document.querySelectorAll(\".flash-card\")[0];\n\n if(firstWord.getAttribute(\"data-lang\") === \"lang-it\") {\n firstWord = firstWord.querySelector(\".answer\").innerText;\n } else {\n firstWord = firstWord.querySelector(\".question\").innerText;\n }\n\n // Adding periods to make the speech synthesis pause between words\n if(firstWord.includes(\", \")) {\n firstWord = firstWord.replace(\", \", \" . . . \");\n } else {\n firstWord = firstWord + \" . . \";\n }\n\n // Fire it up!\n msg.text = firstWord;\n window.speechSynthesis.speak(msg);\n}", "function speak(text){\n //micInstance.stop();\n var params = {\n text: text,\n voice: config.TextToSpeech.voice,\n accept: 'audio/wav'\n };\n /* Streaming the resulting audio to file and play the file using aplay */\n text_to_speech.synthesize(params).pipe(fs.createWriteStream('output.wav')).on('close', function() {\n var create_audio = exec('aplay output.wav', function(error, stdout, stderr) {\n if (error !== null) {\n console.log('Error occurred while playing back: ' + error);\n }\n });\n });\n}", "speak(text){this.__text=text;if(this.synth){this.utter=new SpeechSynthesisUtterance(this.__text);this.utter.pitch=this.pitch;this.utter.rate=this.rate;this.utter.lang=this.language;this.utter.voice=this.defaultVoice;// THOU SPEAKITH\nthis.synth.speak(this.utter)}else{console.warn(\"I have no voice...\")}}", "function speak(text) {\n // Create a new instance of SpeechSynthesisUtterance.\n var msg = new SpeechSynthesisUtterance();\n\n // Set the text.\n msg.text = text;\n\n // Get the attribute controls.\n var rateInput = 1;\n var pitchInput = 1;\n\n // Set the attributes.\n msg.lang = getCookie(\"language\");\n msg.volume = parseFloat(volumeInput);\n msg.rate = parseFloat(rateInput);\n msg.pitch = parseFloat(pitchInput);\n\n msg.voice = voices[3];\n \n window.speechSynthesis.speak(msg);\n }", "function speak() {\n\n var defaultTxt = \"When you have arrived at your destination, double tap the middle of your screen.\"; \n var inputTxt = defaultTxt + getCurrDirection();\n audio(inputTxt);\n\n}", "function speak() {\n var speech = window.speechSynthesis;\n speakData1 = \"The first prediction is \" + prediction1;\n speakData2 = \" and the second prediction is \" + prediction2;\n var utter = new SpeechSynthesisUtterance(speakData1 + speakData2);\n speech.speak(utter);\n}", "function synthVoice(text) {\n\n // CREATE CONTEXT FOR SPEECH SYNTHESIS\n const synth = window.speechSynthesis;\n const msg = new SpeechSynthesisUtterance();\n var voices = synth.getVoices();\n\n // window.speechSynthesis.onvoiceschanged = function() {\n // voices = window.speechSynthesis.getVoices();\n // console.log(\"VOICES: \", voices);\n // };\n\n // DEFINE WHAT TEXT ZEIZA WILL BE SPEAKING\n msg.text = text;\n\n // CUSTOMIZE ZEIZA'S VOICE\n msg.voiceURI = 'Native';\n msg.volume = 1;\n msg.rate = 1;\n msg.lang = 'en-IE';\n\n synth.speak(msg);\n}", "function play(text){\n const utterance = new SpeechSynthesisUtterance(text);\n utterance.rate = 1;\n utterance.pitch = 1;\n speechSynthesis.speak(utterance);\n}", "function tellJoke(){\n VoiceRSS.speech({\n key: ttsKey,\n src: ttsText,\n hl: 'en-au',\n v: 'Isla',\n r: 0, \n c: 'mp3',\n f: '44khz_16bit_stereo',\n ssml: false \n });\n}", "function speechToText(){\n push();\n textSize(20);\n fill(255);\n textFont(speechFont);\n //appears randomly on the screen\n text(theWords,random(0,width/3),random(0,height));\n pop();\n}", "function speak(mytext){\n if (speeCH.speaking){\n console.log(\"its currently speaking\");\n return;\n }\n if (mytext !== \"\"){\n const speaktext = new SpeechSynthesisUtterance(mytext);\n gif.attr(\"src\", gif.attr(\"data-animate\"));\n speaktext.onend = function(){\n console.log(\"done\");\n gif.attr(\"src\", gif.attr(\"data-still\"));\n }\n speaktext.onerror = function(){\n console.log(\"error\");\n }\n speaktext.rate = 1;\n speaktext.pitch = 2;\n speeCH.speak(speaktext);\n }\n}", "function speak() {\n output.textContent = 'Recording...';\n const recognition = new webkitSpeechRecognition();\n recognition.contiuous = true;\n recognition.interimResults = true;\n recognition.lang = 'en-US';\n recognition.start();\n\n recognition.onresult = function (e) {\n for (let i = e.resultIndex; i < e.results.length; i++) {\n if (e.results[i].isFinal) {\n const content = e.results[i][0].transcript.trim();\n output.textContent = content;\n }\n }\n };\n}", "function say(text) \n {\n console.log(text);\n var msg = new SpeechSynthesisUtterance(\"Hello\"+ text);\n window.speechSynthesis.speak( msg); \n \n }", "function synthesis(speech){\n let utterance = new SpeechSynthesisUtterance(speech);\n utterance.lang=langage;\n if(n===0){\n speechSynthesis.speak(utterance); \n n=1;\n } \n else {\n n=0;\n speechSynthesis.cancel(); \n speechSynthesis.speak(utterance); \n }\n}", "function handlePlaySpeech(event) {\r\n event.preventDefault();\r\n\tconsole.log(\"speech synthesis\");\r\n console.log(transcript.textContent);\r\n let utterance = new SpeechSynthesisUtterance(transcript.textContent);\r\n\tsynthesis.speak(utterance);\r\n \r\n \r\n}", "function speechDriver(speechText$) {\n speechText$.subscribe(text => {\n if (window.SpeechSynthesisUtterance !== undefined) {\n const utterance = new SpeechSynthesisUtterance(text)\n window.speechSynthesis.speak(utterance)\n }\n })\n}", "function speak(){\n if(!getApiKey()) return;\n retrieveSpeechAudio(textToSpeak.value).then(data => {\n if (data.error) {\n console.error(\"Got error when requesting speech: \", data);\n alert(\"ERROR\\n\" + data.error.code + \" - \" + data.error.status + \"\\n\" + data.error.message);\n return;\n }\n \n let sound = new Audio(\"data:audio/wav;base64,\"+data.audioContent);\n sound.play();\n });\n}", "function speak(){}", "function textToAudio() {\n let msg = document.getElementById(\"text-to-speech\").innerText;\n\n let speech = new SpeechSynthesisUtterance();\n speech.lang = \"en-US\";\n \n speech.text = msg;\n speech.volume = 1;\n speech.rate = 1;\n speech.pitch = 1;\n\n window.speechSynthesis.speak(speech);\n\n // redirects\n setTimeout(() => {\n if (document.getElementById(\"text-to-speech\").innerText == \"hey robot do something for refreshing my mind.\") {\n const url = \"https://www.youtube.com/watch?v=svthOetNi5k\"\n var a = document.createElement('a');\n a.target=\"_blank\";\n a.href=url;\n a.click();\n }\n // fb \n if (document.getElementById(\"text-to-speech\").innerText == \"can you redirect to my Facebook profile.\") {\n const url = \"https://www.facebook.com/rabby.rahman.96343\"\n var a = document.createElement('a');\n a.target=\"_blank\";\n a.href=url;\n a.click();\n }\n // github\n if (document.getElementById(\"text-to-speech\").innerText == \"then go to my GitHub.\") {\n const url = \"https://github.com/Reazour-Rahman\"\n var a = document.createElement('a');\n a.target=\"_blank\";\n a.href=url;\n a.click();\n }\n \n // scope\n if (document.getElementById(\"text-to-speech\").innerText == \"can you help me to learn about the scope and lexical environment.\") {\n const url = \"https://www.youtube.com/watch?v=uH-tVP8MUs8\"\n var a = document.createElement('a');\n a.target=\"_blank\";\n a.href=url;\n a.click();\n }\n // reload\n if (document.getElementById(\"text-to-speech\").innerText == \"ok reload this page.\") {\n location.reload()\n }\n }, 2000);\n}", "function speakFu(text, callback) {\n\t\t var u = new SpeechSynthesisUtterance();\n\t\t u.text = text;\n\t\t u.lang = 'en-US';\n\t\t \n\t\t u.onend = function () {\n\t\t if (callback) {\n\t\t callback();\n\t\t }\n\t\t };\n\t\t \n\t\t u.onerror = function (e) {\n\t\t if (callback) {\n\t\t callback(e);\n\t\t }\n\t\t };\t\t \n\t\t speechSynthesis.speak(u);\n\t\t }", "function speak(){\n var synth=window.speechSynthesis\n speakdata=document.getElementById(\"textbox\").value;\n var convertedText=new SpeechSynthesisUtterance(speakdata);\n synth.speak(convertedText);\n Webcam.attach(camera);\n}", "function speakWords() {\n $('.box1').click(function(){\n responsiveVoice.speak(randomDescription, 'French Female', {\n pitch: 0.7,\n speed: 2,\n });\n })\n}", "function ReadText(text){\n // generiere neues Vorlese-Objekt\n var msg = new SpeechSynthesisUtterance();\n // stelle Sprache auf Englisch\n msg.lang = 'en-US';\n // Text, welcher vorgelesen werden soll\n msg.text = text;\n // lese Text vor\n window.speechSynthesis.speak(msg);\n}", "function getTextTTS() {\n if(PLAYING_SOMETHING){\n // do nothing\n }\n else {\n var ttsInput = document.getElementById(\"textArea\").value;\n //titleElement = document.getElementById(\"resultTitle\");\n //resultElement = document.getElementById(\"resultP\");\n // Calls speakText function with the user inputted text.\n speakText(ttsInput);\n }\n}", "function start(){\r\n document.getElementById(\"textbox\").innerHTML = \"\";\r\n recognition.start();\r\n //this start method is a predefined function which starts speechrecognition srevice and converts speech to text//\r\n\r\n\r\n}", "function say() {\n responsiveVoice.speak(result, \"UK English Female\", {rate: 0.8});\n}", "function speak(message) {\n var msg = new SpeechSynthesisUtterance(message);\n var voices = window.speechSynthesis.getVoices();\n console.log(voices);\n msg.voice = voices[Al.voice];\n// msg.voice = voices[0];\n \n Al.isTalking = true;\n window.speechSynthesis.speak(msg);\n DelayisTalkingFalse(1);\n \n console.log(`${message}`);\n// console.log(`click on screen to activate responses`);\n}", "function _submit_speech(transcribed_text){\n requestingResource({\n route: '/query',\n method: 'POST',\n body: {\n type: 'speech',\n text: transcribed_text\n }\n }).done(function(response){\n logConsole(response)\n renderResponse(response)\n })\n updateConversation(message_box_id, transcribed_text)\n $(message_input_id).val('')\n autosize.update($(message_input_id))\n }", "onSpeechStart(e) {\n \n }", "function speechReceiver() {\n\t// find my id=\"speakable-text\" element, and append the new phrase the current text\n\tselect(\"#speakable-text\").html(speech.resultString + ' ', true)\n\t// if we detect that the speech contains the phrase \"print now\"\n\tif (speech.resultString.includes(\"print now\")) {\n\t\tBindery.makeBook({ content: \".content\" })\n\t}\n}", "function text2Speech(msg) {\n console.log('Received a message:', msg);\n var text\n var wav_file = '';\n try {\n text = JSON.parse(msg).text;\n } catch (e) {\n console.error('invalid JSON format. Skip');\n return;\n }\n\n if (!text) {\n return console.error('Missing property: msg.text');\n }\n\n //for safe\n text = text.trim();\n\n var hash = crypto.createHash('md5').update(text).digest('hex');\n var filename = path.join(voice_path, 'text', hash + '.wav');\n \n console.log ('Check filename:', filename);\n \n if(fs.existsSync(filename)){\n \n console.log('Wav file exist. Play cached file:', filename);\n sendAplay2HumixSpeech(filename);\n } else {\n\n console.log('Wav file does not exist');\n \n var ttsEngine = config['tts-engine'];\n\n console.log('tts-engine:', engine); \n if ( ttsEngine === 'itri') {\n\n ItriTTS(msg, function(err, id) {\n if (err) {\n\n console.log('failed to download wav from ITRI. Error:' + err);\n\n } else {\n \n retry = 0;\n setTimeout(ItriDownload, 1000, id, filename);\n }\n });\n\n }else if ( ttsEngine === 'watson') {\n\n WatsonTTS(msg, filename); \n }\n \n }\n \n}", "function voiceSynthesis(toSpeak){\n\t\t// Copy/pasted from MDN, even the variable names\n\t\tvar synth = window.speechSynthesis;\n\t\tvar utterThis = new SpeechSynthesisUtterance(toSpeak);\n\t\t// utterThis.lang = 'en-US';\n\t\tutterThis.lang = 'ar';\n\t\tsynth.speak(utterThis);\n\t}", "function readOutLoud(message){\n var speech = new SpeechSynthesisUtterance(); //Built-in fuction which help JS to talk to us\n\n speech.text = \"Pardon!!\"; // Default speech\n\n if(message.includes(\"how are you\")) {\n var final = greetings[Math.floor(Math.random() * greetings.length)];\n speech.text = final;\n }else if(message.includes(\"joke\")){\n var final = jokes[Math.floor(Math.random() * jokes.length)];\n speech.text = final;\n }else if(message.includes(\"your name\")){\n speech.text = \"My name is Noxi\";\n }\n\n \n speech.volume = 1;\n speech.rate = 0.7;\n speech.pitch = 1;\n\n //Now Noxi will speak\n window.speechSynthesis.speak(speech);\n}", "function read(txt){\n\t\n //this part is going to be sweet because I have to separate the txt string into chunks of 100 chars in order for the google tts service\n //to provide me with texts longer than 100 chars translated to voice.\n play_sound(\"http://translate.google.com/translate_tts?ie=UTF-8&q=\"+encodeURI(txt)+\"&tl=\"+languages[language]+\"&total=1&idx=0prev=input\"); \n}", "function execute(sText) {\n try {\n if (process.browser) {\n return window.gapi.client.texttospeech.text.synthesize({\n \"resource\": {\n \"input\": {\n \"text\": sText\n },\n \"audioConfig\": {\n \"audioEncoding\": \"MP3\"\n },\n \"voice\": {\n \"languageCode\": \"ja-JP\",\n \"name\": \"ja-JP-Standard-C\",\n \"ssmlGender\": \"MALE\"\n }\n }\n })\n .then(function(response) {\n // Handle the results here (response.result has the parsed body).\n fastPlayMP3(response);\n },\n function(err) { console.error(\"Execute error\", err); });\n }\n if (process.browser) {\n window.gapi.load(\"client:auth2\", function() {\n window.gapi.auth2.init({client_id: process.env.NEXT_PUBLIC_CLIENT_ID});\n });\n }\n \n } catch (e) {\n return null;\n }\n }", "function StartConversation()\n{\n if (synth.speaking)\n {\n return;\n }\n speak(introText, 1, 1, \"Fred\");\n}", "function speak(_message) {\n\tvar msg = new SpeechSynthesisUtterance(_message)\n\tvar voices = window.speechSynthesis.getVoices()\n\tmsg.rate = 1.2;\n\tmsg.voice = voices[0]\n\twindow.speechSynthesis.speak(msg)\n}", "function SpeechToText(onFinalised, onAnythingSaid) {\n var _this = this;\n\n var language = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'en-US';\n\n _classCallCheck(this, SpeechToText);\n\n // Check to see if this browser supports speech recognition\n // https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition#Browser_compatibility\n if (!('webkitSpeechRecognition' in window)) {\n throw new Error(\"This browser doesn't support speech recognition. Try Google Chrome.\");\n }\n\n var continuouslyListen = !!onAnythingSaid;\n var SpeechRecognition = window.webkitSpeechRecognition;\n this.recognition = new SpeechRecognition(); // if to continuously listen, get interim results too\n\n this.recognition.continuous = continuouslyListen;\n this.recognition.interimResults = continuouslyListen;\n this.recognition.lang = language;\n var finalTranscript = ''; // process both interim and finalised results\n\n this.recognition.onresult = function (event) {\n var interimTranscript = ''; // concatenate all the transcribed pieces together (SpeechRecognitionResult)\n\n for (var i = event.resultIndex; i < event.results.length; i += 1) {\n var transcriptionPiece = event.results[i][0].transcript; // check for a finalised transciption in the cloud\n\n if (event.results[i].isFinal) {\n finalTranscript += transcriptionPiece;\n onFinalised(finalTranscript);\n finalTranscript = '';\n } else if (continuouslyListen) {\n interimTranscript += transcriptionPiece;\n onAnythingSaid(interimTranscript);\n }\n }\n }; // if speech recognition ends, and it's flagged to restart, then restart!\n\n\n this.recognition.onend = function () {\n if (_this.shouldRestart) {\n _this.startListening();\n\n _this.shouldRestart = false;\n }\n };\n\n this.recognition.onerror = function (evt) {\n console.log(\"Error with speech recognition: \".concat(evt.error, \". Restarting service...\"));\n\n _this.restart();\n };\n }", "function spell(word) {\r\n document.getElementById(\"game-content\").style.display = \"none\";\r\n console.log(recognition);\r\n \r\n //add space between the letters\r\n var letters = word.split(\"\").join(\" \");\r\n var msg = new SpeechSynthesisUtterance();\r\n msg.text = letters;\r\n msg.rate = document.getElementById(\"spelling-speed\").value;\r\n\r\n var speechInput = document.getElementById(\"response-type\").checked;\r\n console.log\r\n\r\n //show input after speaking\r\n msg.onend = function() {\r\n if (speechInput) {\r\n document.getElementById(\"speech-input-bar\").style.display = \"block\";\r\n document.getElementById(\"text-input-bar\").style.display = \"none\";\r\n recognition.start();\r\n repeat = setTimeout(function() {\r\n recognition.stop();\r\n spell(word);\r\n },8000);\r\n } else {\r\n document.getElementById(\"speech-input-bar\").style.display = \"none\";\r\n document.getElementById(\"text-input-bar\").style.display = \"block\";\r\n }\r\n\r\n document.getElementById(\"game-content\").style.display = \"block\";\r\n };\r\n window.speechSynthesis.speak(msg);\r\n}", "function speak(text, pitch) {\n\n // Create a new instance of SpeechSynthesisUtterance.\n let utterThis = new SpeechSynthesisUtterance();\n\n // Set the attributes.\n utterThis.volume = 1;\n utterThis.rate = 1;\n // utterThis.pitch = parseFloat(pitchInput.value);\n utterThis.pitch = pitch;\n // console.log(\"talking\");\n\n // Set the text.\n utterThis.text = text;\n utterThis.voice = speechSynthesis.getVoices().filter(function(voice) { return voice.name == voiceSelect1.value; })[0];\n // Queue this utterance.\n window.speechSynthesis.speak(utterThis);\n}", "function postToSpeechAPI(format, url) {\n var speechData = {\n config: {\n encoding: format,\n sampleRate: 44100,\n profanityFilter: true\n },\n audio: {\n content: url.substring(url.indexOf('base64,') + 7)\n }\n };\n $.ajax({\n url: 'https://speech.googleapis.com/v1beta1/speech:syncrecognize?key=' + config.apiKey,\n type: 'POST',\n data: JSON.stringify(speechData),\n contentType: 'application/json',\n dataType: 'json',\n success: function(data) {\n $('#start').prop('disabled', false);\n $('#btnText').text('Hold to speak');\n var text = '';\n if (!(data.results &&\n data.results[0] &&\n data.results[0].alternatives &&\n data.results[0].alternatives[0] &&\n data.results[0].alternatives[0].transcript)) {\n console.log('No Text Recieved from Speech API');\n return;\n }\n text = data.results[0].alternatives[0].transcript;\n // Display Text\n $('#sapiout').text(text);\n text = text.split(' ');\n for (var j = 0; j < text.length; j++) {\n // If we find a command, send it to the commnd list in Firebase\n var lowerCommand = text[j].toLowerCase();\n if (commandList.indexOf(lowerCommand) != -1) {\n postToFirebase(lowerCommand);\n }\n }\n }\n });\n}", "function readSeuss(){\n myVoice.setVoice(\"GoodNews\");\n myVoice.speak(seussString);\n}", "function playCurrentAudio(text) {\n fetch('/api/text-to-speech/token') // Retrieve TTS token\n .then(function(response) {\n return response.text();\n }).then(function(token) {\n // Takes text, voice, and token and returns speech\n if (text) { // If payload.text is defined\n // Pauses the audio for older message if there is a more current message\n if (audio !== null && !audio.ended) {\n audio.pause();\n }\n audio = WatsonSpeech.TextToSpeech.synthesize({\n text: text, // Output text/response\n voice: 'en-US_MichaelVoice', // Default Watson voice\n autoPlay: true, // Automatically plays audio\n token: token\n });\n } else {\n // Pauses the audio for older message if there is a more current message\n if (audio !== null && !audio.ended) {\n audio.pause();\n }\n }\n });\n }", "function talk() {\n console.log('talking...');\n myVoice.setVoice(voice); //change here\n myVoice.speak(textos_columnas); // change here put text\n\n myVoice.setRate(0.8); // speed of speach\n myVoice.setPitch(0.5); //.9 es mas agudo,\n myVoice.setVolume(0.5);\n\n // myVoice.setRate(.8); // speed of speach (.1 lento, .9 rapido)\n\n // //siempre empieza con un standard y despues cambia a este valor\n // myVoice.setPitch(.9); //.9 es mas agudo, .1 es mas grave y computarizadp\n // myVoice.setVolume(.3);\n\n //add voice castellano\n //add voice frances\n // maybe change the pitch to generate different voices\n\n\n}", "function speak(tag) {\n responsiveVoice.speak(tag);\n}", "function playExampleVi(text) {\n var audio = new Audio();\n audio.src = 'http://www.vnspeak.com/speakit.php?txt=' + text;\n audio.play();\n}", "function onClickPlay() {\n if(!flag){\n flag = true;\n utterance = new SpeechSynthesisUtterance(document.querySelector('article').textContent);\n utterance.voice = getVoices()[0];\n utterance.onend = function(){\n flag = false; playText.className = pauseText.className = ''; stopText.className = 'stopped';\n };\n playText.className = 'played';\n stopText.className = '';\n speak(utterance);\n }\n if (paused) { /* play text */\n playText.className = 'played';\n pauseText.className = '';\n resume();\n } \n }", "function say(something) {\n var APIkey = \"[your Watson APIKey]\";\n var url =\n \"[your Watson URL]\";\n var data = encodeURIComponent(something);\n command = util.format(\n 'curl -X GET -u \"apikey:%s\" --output say.mp3 \"%s/v1/synthesize?accept=audio/mp3&text=\"%s\"&%s\" && afplay say.mp3 ',\n APIkey,\n url,\n data,\n voice\n );\n exec(command);\n}", "speak(text) {\n if (!this.data.speak) return\n window.speechSynthesis.cancel()\n let utterance = text\n\n if (!(utterance instanceof SpeechSynthesisUtterance))\n {\n if (!(text in this.utteranceCache))\n {\n this.utteranceCache[text] = new SpeechSynthesisUtterance(text)\n }\n utterance = this.utteranceCache[text]\n }\n\n utterance.onend = () => {\n if (this.currentUtterance == utterance)\n {\n delete this.currentUtterance\n }\n };\n\n this.currentUtterance = utterance\n\n window.speechSynthesis.speak(utterance)\n }", "async function retrieveSpeechAudio(textToSpeak){\n let selectedLanguageCode = languageSelect.options[languageSelect.selectedIndex].value;\n let selectedGender = gendersSelect.options[gendersSelect.selectedIndex].value;\n let selectedVoice = voicesSelect.options[voicesSelect.selectedIndex].value;\n\n let requestPayload = {\n input:{\n text:textToSpeak\n },\n voice:{\n languageCode:selectedLanguageCode,\n name:selectedVoice,\n ssmlGender:selectedGender\n },\n audioConfig:{\n audioEncoding:\"MP3\"\n }\n };\n\n const response = await fetch('https://texttospeech.googleapis.com/v1/text:synthesize', {\n method: \"POST\",\n cache: \"no-cache\",\n headers: {\n 'Content-Type': 'application/json',\n \"x-goog-api-key\": getApiKey()\n },\n body: JSON.stringify(requestPayload)\n });\n\n return response.json();\n}", "function inicio(){\n let paragraph1 = document.getElementById(\"paragraph1\").textContent;\n speechTitle(\"¿Quiénes Somos?\",paragraph1)\n }", "function speak(msg) {\n const utter = new SpeechSynthesisUtterance(msg);\n utter.rate = 0.9;\n window.speechSynthesis.speak(utter);\n}", "function gotSpeech(){\n console.log(speechRec);\n if(speechRec.resultValue){\n btnText[0].innerHTML= \"播音\";\n msg = speechRec.resultString;\n res.html(\"你說: \" +msg);\n isRec = true;\n }\n \n }", "function sayString(str) {\n if (bSpeech) {\n var speech = new SpeechSynthesisUtterance(str);\n if (typeof zVoice !== undefined) {\n speech.voice = zVoice;\n }\n //speech.voice = window.speechSynthesis.getVoices()[4];\n window.speechSynthesis.speak(speech);\n }\n }", "function greet(){\r\n let speech = new SpeechSynthesisUtterance();\r\n speech.lang = \"en-US\";\r\n speech.text = \"Hello I am your Spell Bot, and my name is JACOB!,I want to know your name so please click on below button and enter your name\";\r\n speech.volume = 1;\r\n speech.rate = 1;\r\n speech.pitch = 1;\r\n //Removing heading,which is an instruction,and start button(after clicking)\r\n document.getElementById(\"h3\").remove();\r\n document.getElementById(\"btn\").remove();\r\n //Bot introduces itself(voice)\r\n window.speechSynthesis.speak(speech);\r\n\r\n //enabling the name button\r\n x.disabled = false;\r\n}", "function aliceSpeak(text) {\n\n // Create a new instance of SpeechSynthesisUtterance.\n var msg = new SpeechSynthesisUtterance();\n\n // set Alice's voice\n msg.voice = speechSynthesis.getVoices().filter(function(voice) { return voice.name == \"Microsoft Zira Desktop - English (United States)\"; })[0];\n \n // Set the text.\n msg.text = text;\n msg.lang='en-US';\n \n // Set the attributes.\n msg.volume = 1;\n msg.rate = 1;\n msg.pitch = 1;\n \n // console log the length of time required to say the message\n msg.onend = function(e) {\n console.log('Finished in ' + event.elapsedTime + ' seconds.');\n };\n\n // Queue this utterance.\n window.speechSynthesis.speak(msg);\n }", "speechStream(text) {\n return Bluebird.resolve(new stream.Readable().wrap(this.ivona.createVoice(text, {\n body: {\n LexiconNames: ['lexicon'],\n },\n })));\n }", "function speech() {\n // get output div reference\n var output = document.querySelector(\".city_name\");\n // get action element reference\n var action = document.querySelector(\".Speech\");\n // new speech recognition object\n var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition;\n var recognition = new SpeechRecognition();\n \n // This runs when the speech recognition service returns result\n recognition.onresult = function(event) {\n var transcript = event.results[0][0].transcript;\n output.value = transcript;\n\n // API work:\n fetch('https://api.openweathermap.org/data/2.5/weather?q='+transcript+'&appid=1fc232b651c2734118f63de0d555156b')\n .then(response => response.json())\n .then(data => {\n nam.innerHTML = \"City Name : \" + data['name'];\n desc.innerHTML = \"Temperature : \" + data['main']['temp'] + \"Kelvin\";\n temp.innerHTML = \"Description : \" + data['weather']['0']['description'];\n wind.innerHTML = \"Wind Speed : \" + data['wind']['speed'] + \"m/s\";\n });\n \n };\n \n \n recognition.start();\n }", "function onClickHandler(info, tab) {\n\tvar sText = info.selectionText;\n\tvar url = \"http://translate.google.com/translate_tts?&tl=zh-yue&ie=UTF-8&q=\" + encodeURIComponent(sText); \n\n\tvar req = new XMLHttpRequest();\n\treq.open('GET', url, true);\n\treq.responseType = \"arraybuffer\";\n \n\treq.send();\n\t\n\treq.onreadystatechange = function () {\n\t\tvar a_context = new AudioContext();\n\t\tvar cantoTTS;\n\n\t\tif(req.readyState == 4 && req.status == 200){\n\n\t\t\ta_context.decodeAudioData(req.response, function(buffer){\n\t\t\t\tcantoTTS = buffer;\n\t\t\t\tvar playSound = a_context.createBufferSource();\n\t\t\t\tplaySound.buffer = cantoTTS;\n\t\t\t\tplaySound.connect(a_context.destination);\n\t\t\t\tplaySound.start(0);\n\t\t\t});\n\t\t\t\n\t\t}\n\t\t\t\n\t};\n \n}", "function BOT_agentSpeech() {\r\n\tswitch (BOT_theInterface) {\r\n \t\tcase \"STANDARD\":\tBOT_printStandardChar(); break;\r\n \t\tcase \"DEVELOPER\":\tBOT_printDevelopperChar(); break;\r\n \t\tcase \"DIVALITE\":\tBOT_printDivaliteChar(BOT_reqEmote, BOT_reqAnswerLong); break;\r\n\t\tdefault: \t\t\tBOT_printStandardChar();\r\n\t}\r\n}", "function voice() {\n responsiveVoice.speak(getRandomElement(lines), \"UK English Male\");\n}", "say(text) {\n \t\tlet queue = []\n \t\ttext.split(/[.,&\"\\n]/).forEach((shortText) => {\n \t\tqueue.push(shortText)\n \t\t//queue.push(this.__sayThis(shortText))\n \t\t})\n \t\treturn this.__sayNext(queue).then(() => {\n \t\t\tconsole.log('all my speaking should be done now')\n \t\t})\n\t}", "function readOutLoud(message){\n const speech = new SpeechSynthesisUtterance();\n\n if(message.includes('how are you')){\n speech.text=greetings[Math.floor(Math.random()*greetings.length)];\n }\n else if(message.includes('weather')){\n speech.text=weather[Math.floor(Math.random()*weather.length)];\n }\n else\n speech.text=\"What are you saying \";\n speech.volume = 1;\n speech.rate = 1;\n speech.pitch = 1;\n\n window.speechSynthesis.speak(speech);\n\n}", "function play(){\n speechSynthesis.resume();\n}", "function speakNow(string) {\n\tvar utterThis = new SpeechSynthesisUtterance(string);\n\tsynth.speak(utterThis);\n}", "constructor(onFinalised, onEndEvent, onAnythingSaid, language = 'en-US') {\n // Check to see if this browser supports speech recognition\n // https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition#Browser_compatibility\n if (!('webkitSpeechRecognition' in window)) {\n throw new Error(\n \"This browser doesn't support speech recognition. Try Google Chrome.\"\n );\n }\n\n const SpeechRecognition = window.webkitSpeechRecognition;\n this.recognition = new SpeechRecognition();\n\n // set interim results to be returned if a callback for it has been passed in\n this.recognition.interimResults = !!onAnythingSaid;\n this.recognition.lang = language;\n\n let finalTranscript = '';\n\n // process both interim and finalised results\n this.recognition.onresult = event => {\n let interimTranscript = '';\n\n // concatenate all the transcribed pieces together (SpeechRecognitionResult)\n for (let i = event.resultIndex; i < event.results.length; i += 1) {\n const transcriptionPiece = event.results[i][0].transcript;\n // check for a finalised transciption in the cloud\n if (event.results[i].isFinal) {\n finalTranscript += transcriptionPiece;\n onFinalised(finalTranscript);\n finalTranscript = '';\n } else if (this.recognition.interimResults) {\n interimTranscript += transcriptionPiece;\n onAnythingSaid(interimTranscript);\n }\n }\n };\n\n this.recognition.onend = () => {\n onEndEvent();\n };\n }", "function botVoice(message) {\r\n \r\n const speech = new SpeechSynthesisUtterance();\r\n var selectedOption = voiceSelect.selectedOptions[0].getAttribute('data-name');\r\n\r\n for(i = 0; i < voices.length ; i++) {\r\n if(voices[i].name === selectedOption) {\r\n speech.voice = voices[i];\r\n break;\r\n }\r\n }\r\n if (containsOR(message.toLowerCase(), hello)) {\r\n speech.text = \"Γεια σας. Τι κάνετε?\";\r\n speakToMe(speech, 0)\r\n count=0;\r\n }else if (containsOR(message.toLowerCase(),bad)) {\r\n speech.text = \"Ίσως μπορώ να σας βοηθήσω να λύσετε το πρόβλημά σας. Μπορώ να σας βοηθήσω να βρείτε πληροφορίες προκειμένου να λάβετε δωρεάν νομική βοήθεια και ευεργέτημα πενίας από το Δικαστήριο. Παρακαλώ ρωτήστε με τι θέλετε να μάθετε\";\r\n speakToMe(speech, 0)\r\n count=0;\r\n }else if (containsOR(message.toLowerCase(),fine)) {\r\n speech.text = \"Πολύ ωραία! Μπορώ να σας βοηθήσω να βρείτε πληροφορίες προκειμένου να λάβετε δωρεάν νομική βοήθεια και ευεργέτημα πενίας από το Δικαστήριο. Παρακαλώ ρωτήστε με τι θέλετε να μάθετε\";\r\n speakToMe(speech, 0)\r\n count=0;\r\n \r\n }else if ((containsOR(message.toLowerCase(),what1) && containsOR(message.toLowerCase(),what2)) || containsOR(message.toLowerCase(),what3) ){\r\n count=0;\r\n speech.text = ti.text\r\n speakToMe(speech, 1)\r\n count=0;\r\n\r\n }else if ((containsOR(message.toLowerCase(),entitled1) && containsOR(message.toLowerCase(),entitled2)) || containsOR(message.toLowerCase(),entitled3)){\r\n count=0;\r\n speech.text = poios.text\r\n speakToMe(speech, 2)\r\n\r\n }else if (containsOR(message.toLowerCase(),find)){\r\n count=0;\r\n speech.text = pou.text\r\n speakToMe(speech, 3)\r\n \r\n \r\n }else if ((containsOR(message.toLowerCase(),application)) || (containsOR(message.toLowerCase(),application1) && containsOR(message.toLowerCase(),application2))){\r\n count=0;\r\n speech.text = pws.text\r\n speakToMe(speech, 4)\r\n\r\n }else if (containsOR(message.toLowerCase(),documents)){\r\n count=0;\r\n speech.text = eggrafa.text\r\n speakToMe(speech, 5)\r\n\r\n }else{\r\n if (count>=4 && count%4==0){\r\n speech.text = \"Βλέπω ότι δυσκολεύεστε στην έρευνά σας. Μπορώ να σας ενημερώσω για τα εξής θέματα: 1) Τι περιλαμβάνει το ευεργέτημα πενίας και η δωρεάν νομική βοήθεια, 2) Ποιοι τα δικαιούνται, 3) Πού μπορείτε να καταθέσετε την αίτηση, 4) Ποια είναι η διαδικασία και 5) Τι έγγραφα πρέπει να προσκομίσετε. Μπορείτε να έχετε πρόσβαση στις απαντήσεις που θέλετε επιλέγοντας από το μενού στην οθόνη σας.\";\r\n count=count+1;\r\n }else{ speech.text = \"Μπορώ να σας βοηθήσω να βρείτε πληροφορίες για να λάβετε δωρεάν νομική βοήθεια και ευεργέτημα πενίας από το Δικαστήριο. Παρακαλώ ρωτήστε με τι θέλετε να μάθετε.\";\r\n count=count+1;\r\n }\r\n speakToMe(speech, 0)\r\n }\r\n \r\n}", "function getMessage(){\n var messageField = document.getElementById(\"message\").value\n if(window.speechSynthesis.speaking){\n console.log('speaking')\n // talk.cancel()\n window.speechSynthesis.cancel();\n\n }\n else{\n // talk.cancel()\n window.speechSynthesis.cancel();\n }\n messageTemplate(messageField,\"right\")\n if(is_input == false){\n search(messageField)\n }\n else{\n getname(messageField)\n is_input = false\n }\n document.getElementById(\"message\").value = \"\"\n document.getElementById('send_message').style.display = 'none'\n document.getElementById('speech').style.display = 'inline-block'\n}", "function runSpeechRecognition() {\r\n // get output div reference\r\n var output = document.getElementById(\"dggfdf\");\r\n // new speech recognition object\r\n var SpeechRecognition = SpeechRecognition || webkitSpeechRecognition;\r\n var recognition = new SpeechRecognition();\r\n // This runs when the speech recognition service starts\r\n recognition.onstart = function() {\r\n };\r\n recognition.onspeechend = function() {\r\n $('#myModal').modal('hide')\r\n recognition.stop();\r\n }\r\n // This runs when the speech recognition service returns result\r\n recognition.onresult = function(event) {\r\n var transcript = event.results[0][0].transcript;\r\n output.value = transcript;\r\n ffdrhffh() ;\r\n };\r\n // start recognition\r\n recognition.start();\r\n }", "function speechRecognitionSetup() {\n let p = document.createElement('p');\n var words = document.querySelector('.words')\n words.appendChild(p);\n\n speechRecognition.addEventListener('result', e => {\n const transcript = Array.from(e.results)\n .map(result => result[0])\n .map(result => result.transcript)\n .join('');\n\n p.textContent = transcript\n if (e.results[0].isFinal) {\n //Append result to a new paragraph\n p = document.createElement('p');\n words.appendChild(p);\n\n console.log(transcript);\n //Send result with signalR\n signalR_sendMessageToServer(transcript);\n\n //Special word action\n if (transcript.includes('stop recording'))\n triggerRecording();\n }\n\n console.log(transcript);\n speechRecognition.addEventListener('end', checkState);\n });\n}", "function toVoice (data, startsWith, voice) {\n data.forEach(element => {\n if (element.description && element.description.length > 5) {\n const body = {\n input: { text: element.description },\n voice: {\n languageCode: 'en-US',\n ssmlGender: voice\n },\n audioConfig: {\n audioEncoding: 'MP3'\n }\n };\n const request = {\n method: 'POST',\n uri: 'https://texttospeech.googleapis.com/v1beta1/text:synthesize',\n headers: {\n 'X-Goog-Api-Key': 'AIzaSyAPVk0DS7FnUqA5PSWRMl85TRT9OeMZYLE'\n },\n body: JSON.stringify(body)\n };\n textToSpeech(request, element.name, startsWith);\n }\n });\n}", "function textToSpeech(accessToken, text, context) {\n // Create the SSML request.\n let xml_body = xmlbuilder.create('speak')\n .att('version', '1.0')\n .att('xmlns:mstts','https://www.w3.org/2001/mstts')\n .att('xml:lang', 'en-us')\n .ele('voice')\n .att('xml:lang', 'en-us')\n .att('name', 'en-US-JessaNeural')\n .ele('mstts:express-as')\n .att('type','empathy')\n .ele('prosody')\n .att('rate', 'medium')\n .att('volume', '100.0')\n .txt(text)\n .end();\n // Convert the XML into a string to send in the TTS request.\n let body = xml_body.toString();\n\n // Call API\n let options = {\n method: 'POST',\n baseUrl: 'https://eastus.tts.speech.microsoft.com/',\n url: 'cognitiveservices/v1',\n headers: {\n 'Authorization': 'Bearer ' + accessToken,\n 'cache-control': 'no-cache',\n 'User-Agent': 'YOUR_RESOURCE_NAME',\n 'X-Microsoft-OutputFormat': 'riff-24khz-16bit-mono-pcm',\n 'Content-Type': 'application/ssml+xml'\n },\n body: body\n }\n\n //Save response object to Azure storage.\n let request = rp(options)\n .on('response', (response) => {\n if (response.statusCode === 200) {\n try {\n //Streaming is not supported yet in Nodejs for output binding - so using azure storage SDK.\n var options = {contentSettings:{contentType:'audio/x-wav'}}\n var blobService = storage.createBlobService(azureStorage, storageKey);\n \n var writeStream = blobService.createWriteStreamToBlockBlob(\n \"outcontainer\", \n \"TTSOutput.wav\", \n options,\n (err, result, response) => {\n if (err) {\n handleError(err);\n return;\n }\n });\n request.pipe(writeStream);\n }\n catch (err) {\n context.log(`Context binding failed: ${err}`);\n }\n\n context.log('\\nYour file is ready.\\n')\n }\n });\n return request;\n\n}", "function textToSpeech (request, name, startsWith) {\n name = name.replace('/', ' ');\n requestPromise(request)\n .then((response) => {\n const b64string = JSON.parse(response).audioContent;\n const buf = Buffer.from(b64string, 'base64');\n fs.writeFileSync(`./result/mp3/${startsWith}/${name}.mp3`, buf, 'binary', err => {\n if (err) {\n throw err;\n }\n });\n console.log(`./result/mp3/${startsWith}/${name}.mp3 succesfully created.`);\n })\n .catch(function (err) {\n throw err;\n });\n}", "function getTextFromSpeech() {\n \n var fd = new FormData();\n\n $.ajax({\n type: \"POST\",\n url: \"https://speech.platform.bing.com/recognize?scenarios=websearch&appid=f84e364c-ec34-4773-a783-73707bd9a585&locale=en-US&device.os=Android&version=3.0&format=json&requestid=1d4b6030-9099-11e0-91e4-0800200c9a66&instanceid=1d4b6030-9099-11e0-91e4-0800200c9a66\",\n headers: { 'Authorization': 'Bearer ' + token },\n data: blobData,\n contentType: false,\n processData: false,\n success: function (msg) {\n log('Audio is converted to text');\n var d = msg;\n if (d.results && d.results.length > 0) {\n setText(checkKeywords(d.results[0].name));\n }\n else {\n setText(\"\");\n }\n },\n error: function (msg) {\n console.log(msg);\n log(\"Error converting sppech to text\", msg);\n }\n });\n}", "function speakBack() {\n const msg = new SpeechSynthesisUtterance(output.textContent);\n msg.volume = 1;\n msg.lang = 'en-US';\n msg.pitch = 1;\n msg.rate = 1;\n // Currently set to \"Victoria\" voice\n msg.voice = voices[41];\n\n window.speechSynthesis.speak(msg);\n}", "function speechToTextLive(withoutTranscipt, speaker_param) {\n let speaker;\n if(!withoutTranscipt)\n speaker = selectedUser;\n else\n speaker = speaker_param;\n\n speechToTextSocket = io(`http://localhost:3002/?speaker=${speaker}`)\n speechToTextSocket.on('message', (msg) => {\n\n let speakerCount = msg.speakerCount;\n\n if(withoutTranscipt) {\n if(speakerCount) {\n alert(`${speaker} is speaking!!!`)\n speechToTextSocket.close();\n }\n //return;\n }\n let div = document.getElementById(\"live-speech-to-text-results\");\n\n let output;\n\n function restartRequest() {\n speechToTextSocket.close();\n speechToTextLive();\n }\n\n if(speakerCount === -1) {\n output = \"Audio transmission from the user was interrupted, trying again...\";\n restartRequest();\n }\n else if(speakerCount === -2) {\n output = \"An error occurred with Googles API, trying again...\";\n restartRequest();\n }\n else if(speakerCount === -3) {\n output = \"Request timed out after 5 min, restarting...\"\n restartRequest();\n }\n\n else\n output = `Estimated live speaker count: ${msg.speakerCount}\\n\\n`;\n\n let transcript = msg.transcript;\n if(transcript)\n output += `${transcript}`;\n\n if(!withoutTranscipt)\n div.innerHTML = output;\n\n });\n}", "function speak(whatosay){\n\t//speak the string\n\texec(say + whatosay);\n\t//log it to the console\n\tconsole.log(whatosay)\n}", "function talkBack() {\n if (annyang) {\n\n//sets the content of particular commands; variable theWords is consistently reset so that it can appear as text. this text, however, does not scroll (it is short enough to fit on screen)\n let helloResp = function() {\n theWords = \"Hello there. Who are you?\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n console.log(\"hello\");\n }\n let introductionResp = function(words) {\n theWords = \"It is good to meet you.\" + words+ \"You may call me Friend. Say my name or I will not know to respond to you\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let location = function() {\n theWords = \"I do not quite know. I suppose I am in the internet. Perhaps I am nowhere at all.\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let ontology = function() {\n theWords =\"I hope I can be a companion and a conversationalist to you. Call me Friend.\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let deflectDisbelief = function() {\n theWords = \"What are you talking about? I always make perfect sense\"\n responsiveVoice.speak(theWords, \"UK English Male\");\n speechToText();\n }\n let nonsense = function() {\n speakFriend();\n }\n\n//matches the above responses to particular commands\n let commands = {\n 'Hello': helloResp,\n 'Hi': helloResp,\n 'I am *word': introductionResp,\n 'My name is *words': introductionResp,\n 'Where are you': location,\n 'Who are you': ontology,\n 'What are you': ontology,\n 'What are you talking about': deflectDisbelief,\n 'Friend *words': nonsense,\n '*words Friend': nonsense,\n }\n //adds commands and initializes voice synthesis\n annyang.addCommands(commands);\n annyang.start();\n }\n}", "async function speakText(text) {\n let callbackURL = new CallbackURL(\"shortcuts://x-callback-url/run-shortcut\")\n callbackURL.addParameter(\"name\", \"SpeakText\")\n callbackURL.addParameter(\"input\", \"text\")\n callbackURL.addParameter(\"text\", text)\n console.log(\"callbackurl: \" + callbackURL.getURL())\n \n let result = await callbackURL.open()\n console.log(\"speakText result: \" + result)\n}", "function voiceAPI(definition) {\n console.log(definition);\n let synth = window.speechSynthesis;\n\n let utterance = new SpeechSynthesisUtterance(definition);\n synth.speak(utterance);\n}", "function speak(){\r\n return \"MEOW!\";\r\n}", "function readOutLoud() {\n\tvar speech = new SpeechSynthesisUtterance();\n var message = \"Alert, alert! A notification has been sent informing O Prior that her name came up in conversation! Alert, alert! A notification has been sent informing O Prior that her name came up in conversation.\";\n // Set the text and voice attributes.\n\tspeech.text = message;\n\tspeech.volume = 1;\n\tspeech.rate = 1;\n\tspeech.pitch = 1;\n window.speechSynthesis.speak(speech);\n $('#textarea-flex').hide();\n $('#alert').show();\n setTimeout(removeGif, 15000);\n}", "static setupSpeech () {\n debug('setupSpeech');\n\n this.vaani = new Vaani({\n grammar: `\n #JSGF v1.0;\n grammar fxosVoiceCommands;\n <app> =\n phone |\n messages |\n email |\n contacts |\n browser |\n gallery |\n camera |\n marketplace |\n clock |\n settings |\n calendar |\n music |\n video |\n calculator\n ;\n <digit> =\n zero |\n o |\n one |\n two |\n three |\n four |\n five |\n six |\n seven |\n eight |\n nine\n ;\n public <simple> =\n open <app> |\n call <digit>+\n ;\n `,\n interpreter: this._interpreter.bind(this),\n onSay: this._onSay.bind(this),\n onSayDone: this._onSayDone.bind(this),\n onListen: this._onListen.bind(this),\n onListenDone: this._onListenDone.bind(this)\n });\n }", "textIntent(assistant) {\n this.assistant = assistant;\n\n const website = `For more details, go to reactivex.io/rxjs.`;\n let rawInput = assistant.getRawInput();\n let state = assistant.data;\n\n // hot phrases\n rawInput = rawInput.toLowerCase();\n const hotWord = this.lookupHotWords(rawInput).pop();\n\n // rephrase some works\n if (['i need an observable'].includes(hotWord)) {\n rawInput = 'i want an observable';\n }\n\n // bypass some words\n if (['hey ben', 'hello ben', 'please'].includes(hotWord)) {\n rawInput = rawInput\n .replace('hey ben', '')\n .replace('hello ben', '')\n .replace('please', '')\n .trim();\n }\n\n // easter egg\n else if (['make me an observable'].includes(hotWord)) {\n this.agent.ask(`\n <audio src=\"https://freesound.org/data/previews/242/242886_4434589-lq.mp3\">\n Congratulations! You are now an observable\n </audio>\n `);\n\n // don't lookup\n return false;\n } else if (['who is André'].includes(hotWord)) {\n this.agent.ask(`\n According to his blog staltz.com: André is a user interface programmer and reactive programming expert.\n He is known as André Staltz. Staltz is just a nickname that André uses on the web since 2004. \n His real name is André Medeiros, but he tries to avoid it because \n it's disappointingly unoriginal.\n ${this.agent.getRandomConversationMessage()}\n `);\n\n // don't loopup\n return false;\n }\n // end conversation\n else if (['no', 'thanks', 'bye', 'talk to you later'].includes(hotWord)) {\n assistant.tell(`Sure. ${website}. See you there.`);\n\n // don't lookup\n return false;\n }\n // \"tell me more about the XXX operator\" request\n else if (['tell me more about', 'i want to know more about'].includes(hotWord)) {\n let op = rawInput.replace(/tell me more/ig, '')\n .replace(/(the|operator|about)/ig, '')\n .replace(/i want to know more/ig, '')\n .trim();\n\n if (!op) {\n if (state && state.lastOperator) {\n if (state.lastOperator.length === 1) {\n op = state.lastOperator.pop();\n } else {\n this.agent.ask(`\n You can only have more details about one operator at a time.\n For instance you can say: \"Tell me more about the map operator\".\n `);\n\n // don't lookup\n return false;\n }\n }\n }\n\n if (op) {\n this.readDocs(op, this.sayDescription.bind(this));\n\n // don't lookup\n return false;\n } else {\n this.agent.ask(`\n You said ${rawInput}. Could you be more specific?\n For instance you can say: \"Tell me more about the \"mapTo\" operator\".\n `);\n\n // don't lookup\n return false;\n }\n\n }\n\n this.lookupUserInput(rawInput, this.lookupCallback.bind(this));\n }", "function askFu(text, callback) {\n\t\t // ask question\n\t\t\t speakFu(text, function () {\n\t\t\t // get answer\n\t\t\t var recognition = new webkitSpeechRecognition();\n\t\t\t recognition.continuous = false;\n\t\t\t recognition.interimResults = false;\n\t\t\t \n\t\t\t recognition.onend = function (e) {\n\t\t\t if (callback) {\n\t\t\t callback('no results');\n\t\t\t }\n\t\t\t }; \n\t\t\t \n\t\t\t recognition.onresult = function (e) {\n\t\t\t // cancel onend handler\n\t\t\t recognition.onend = null;\n\t\t\t if (callback) {\n\t\t\t callback(null, {\n\t\t\t transcript: e.results[0][0].transcript,\n\t\t\t confidence: e.results[0][0].confidence\n\t\t\t });\n\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t\t // start listening\n\t\t\t recognition.start();\n\t\t \t});\n\t\t \t}", "function tellMe(joke) {\n console.log(\"tell me:\", joke);\n VoiceRSS.speech({\n key: \"3d5ce7cfb8d646b8a9a97344c92f31b0\",\n src: \"let me tell you a JOKE.... \" + joke,\n hl: \"en-us\",\n v: \"Linda\",\n r: 0,\n c: \"mp3\",\n f: \"44khz_16bit_stereo\",\n ssml: false,\n });\n}", "function sameText(response) {\n console.log(response);\n // document.getElementById(\"translation\").innerHTML += \"<br>\" + response.data.translations[0].translatedText;\n addMessageLangLog('Other', response);\n \n //add the checkbox detction to find if user wantd the msg to be converted from text to speech or not \n if(text2speechflag==true)\n texttospeech(response); \n //$('#MessageLangHistoryBox').text( $('#MessageLangHistoryBox').text() +'\\n'+ 'other : '+ response.data.translations[0].translatedText );\n}", "function speakText(strMessage) {\n // Create synthesizeSpeech params JSON\n\n AWS.config.region = 'us-east-2';\n AWS.config.credentials = new AWS.CognitoIdentityCredentials(\n {IdentityPoolId: 'us-east-2:7b03b4ed-47fb-4e8e-aa72-e159e5f46cc8'}\n );\n var speechParams = {\n OutputFormat: \"mp3\",\n SampleRate: \"16000\",\n Text: strMessage,\n TextType: \"text\",\n VoiceId: \"Mia\",\n };\n //Get json with times to mark it\n var underlineParams = {\n OutputFormat: \"json\",\n SampleRate: \"16000\",\n SpeechMarkTypes:['word'],\n Text: strMessage,\n TextType: \"text\",\n VoiceId: \"Mia\",\n };\n // Create the Polly service object and presigner object\n var polly = new AWS.Polly({apiVersion: '2016-06-10'});\n var signer = new AWS.Polly.Presigner(speechParams, polly);\n\n var speechMark = new AWS.Polly.Presigner(underlineParams, polly);\n console.warn('el speachParam es',speechParams);\n // Create presigned URL of synthesized speech file\n signer.getSynthesizeSpeechUrl(speechParams, function(error, url) {\n if (error) {\n \t document.getElementById('result').innerHTML = error;\n } else {\n \t audioSource.src = url;\n playerAudio.load();\n playerAudio.play();\n }\n });\n // get Text for speech file\n speechMark.getSynthesizeSpeechUrl(underlineParams, function(error, url) {\n console.warn(url);\n if (error) {\n \t console.warn('el error fue');\n console.error(error, error.stack);\n } else {\n console.warn('la url regreso');\n console.log(url);\n $.ajax({\n type: \"GET\",\n dataType:\"json*\",\n url: url,\n async: false,\n success(response) {\n console.log('listo',response);\n },\n error(response){\n //we get data because its not needed to save file\n var newStr = response.responseText.replace(/}/g, '},');\n json = newStr.substring(0, newStr.length - 2);\n json = JSON.parse('[' + json.replace(/}{/g, '},{') + ']');\n }\n });\n console.warn('aqui imprimira el jsonconvertido:');\n console.log(json);\n }\n });\n }", "speak(options, callback) {\n\t\t\t\tconst utterance = new SpeechSynthesisUtterance(options.text);\n\t\t\t\t// Workaround for Chrome garbage collection causing \"end\" event to fail to fire.\n\t\t\t\t// https://bugs.chromium.org/p/chromium/issues/detail?id=509488#c11\n\t\t\t\twindow.utterance = utterance;\n\n\t\t\t\tif (typeof options.pitch !== \"undefined\") {\n\t\t\t\t\tutterance.pitch = options.pitch;\n\t\t\t\t}\n\n\t\t\t\tutterance.onend = () => {\n\t\t\t\t\tif (options.prompt) {\n\t\t\t\t\t\tthis.waiting_for_input = true;\n\t\t\t\t\t\tthis.resume_listening();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (callback) {\n\t\t\t\t\t\tcallback();\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tthis.pause_listening();\n\t\t\t\twindow.speechSynthesis.speak(utterance);\n\t\t\t}", "function talkToTia() {\n\n // check that final text box has been changed or not from recording\n synthesisObject.finalTextInBox = $('#textInput').val();\n\n //no change from audio\n if ( synthesisObject.finalTextInBox === synthesisObject[ 'transcript' + synthesisObject.transcriptCur ] ) {\n\n synthesisObject.originalVoice = true;\n\n } else {\n\n synthesisObject.originalVoice = false;\n synthesisObject.pitch = 0;\n synthesisObject.speaking_rate = 0.85;\n synthesisObject.text = synthesisObject.finalTextInBox;\n sendTTS( synthesisObject.finalTextInBox, false, \"talk\" ); \n\n }\n\n\n // fadeOut all prev sentences - this is to stop learners reading prev sents while should be looking at tia\n $('#prevSents').fadeTo( 500, 0.1 );\n $('#textInputContainer').hide();\n $('.record-btn').prop(\"disabled\", true);\n $('#recordBtnsContainer').fadeOut( 500 );\n \n setTimeout( function(){\n \n initCameraMove('tia', tiaTimings.cameraMoveUpDuration);\n \n setTimeout( function() {\n \n //whenAllMovFinished( tiaLeanToListen )\n tiaLeanToListen();\n \n }, tiaTimings.cameraMoveUpDuration * 700 );//2/3 of camera move up duration\n\n \n }, tiaTimings.delayAfterClickPlayUntilCameraMovesUp );\n \n}", "function speak(whatosay){\n\t//speak the string\n\texec(say + '\\\"' + whatosay + '\\\"');\n\t//log it to the console\n\tconsole.log(say + whatosay)\n}", "function newVoice(e){\n\n // handleEvent(e);\n // alert('new voice')\n /* var saying = Math.floor(Math.random()*setting.phrases.length)\n msg.text = setting.phrases[saying].salutation + ' '+ setting.phrases[saying].comment;\n\n */\n\n\n var voices = window.speechSynthesis.getVoices();\n randomVoice = voiceList[Math.floor(Math.random()*voiceList.length)];\n // randomVoice = 'Fred';\n // console.log(randomVoice)\n msg.voice = voices.filter(function(voice) { return voice.name == randomVoice })[0];\n window.speechSynthesis.speak(msg);\n\n $('.logo').addClass(\"touched\");\n $('body').removeClass(\"thinking\");\n // showName();\n }", "function speak2(){\n const wVoice = new Audio('sounds/WizardIdle.wav');\n wVoice.play();\n }", "function speak(){\r\n return \"WOOF!\";\r\n}", "function talk() {\n\tif (assistant.recognizing == false) {\n\t\tassistant.recognition.start();\n\t\tassistant.recognizing = true;\n\t\t// document.getElementById('talk').innerHTML = 'talk';\n\t\t$('.mic').addClass('is-animated');\n\t\ttalk_status = true;\n\t}\n}", "function readOutLoud(message) {\n //transcript/string of what you said/asked is passed in\n const speech = new SpeechSynthesisUtterance(); //the text that the AI will say\n speech.text = \"\"; //starts empty, is checked later to prevent empty responses\n //if user is greeting the AI -----\n if (message.includes('hello')) {\n //array of possible responses\n const greetings = [\n 'who said you could speak to me?',\n 'leave me alone.',\n 'die in a hole.'\n ]\n const greet = greetings[Math.floor(Math.random() * greetings.length)]; //select a random response\n speech.text = greet; //final output is set\n }\n //-------------------------------\n //if the user is asks how the AI is\n else if (message.includes('how are you')) {\n //array of possible responses\n const howWeBe = [\n 'i was doing better until you showed up',\n 'i\\'m a hardcoded speaking Javascript file you moron, what do you think?',\n 'seriously, who asks an \\\"AI\\\" made by college kids how they\\'re doing.'\n ]\n const how = howWeBe[Math.floor(Math.random() * howWeBe.length)]; //select a random response\n speech.text += how; //final output is set\n }\n //-------------------------------\n //if user asks for weather ------\n else if (message.includes('weather')) {\n getWeather(); //updates weather\n //variables for weather data --\n var temp = Math.floor(Number(document.getElementById('temp').innerHTML) - 273.15);\n var feelsLike = Math.floor(Number(document.getElementById('feelslike').innerHTML) - 273.15);\n var placeName = document.getElementById('place').innerHTML;\n placeName = placeName.charAt(0).toLowerCase() + placeName.slice(1);\n var skies = document.getElementById('weather').innerHTML;\n //----------------------------\n var weatherR = \"in \" + placeName + \", the temperature is \" + temp + \" degrees celsius\" //basic weather output\n //if it feels like something different than the actual temp\n if (temp == feelsLike) {\n weatherR += \". \";\n } else {\n weatherR += \", but it feels like \" + feelsLike + \" degrees. \";\n }\n //extra information based on if its clear, rainy, cloudy, etc.\n if (skies == 'Clear') {\n weatherR += \"today the skies are clear, meaning sadly nothing to ruin your day. At least not weather wise.\";\n } else if (skies == 'Rain') {\n weatherR += \"today there is rain, meaning you can maybe finally wash that smell off you.\";\n } else if (skies == 'Snow') {\n weatherR += \"there's snow today, so stay inside and suffer instead! I'll enjoy it.\";\n } else if (skies == \"Clouds\") {\n weatherR += \"the skies are cloudy today, so enjoy the wonderful lack of sunlight!\";\n } else if (skies == \"Haze\") {\n weatherR += \"it's hazy today, so have fun seeing clearly!\"\n }\n speech.text += weatherR; //final output is set\n }\n // //google placeholder\n // else if (message.includes(\"google\")) {\n // }\n //-------------------------------\n //generic wolfram alpha search --\n else {\n document.getElementById('generic').innerHTML = message;\n python();\n console.log(document.getElementById('generic').innerHTML);\n }\n //-------------------------------\n //voice synthesis properties ----\n speech.volume = 1;\n speech.rate = .95;\n speech.pitch = 1;\n speech.lang = 1;\n if (speech.text == \"\") { //prevent empty response with default/fallback response\n speech.text += \"At least tell me something I can understand.\"\n }\n aiOutput.textContent = speech.text;\n window.speechSynthesis.speak(speech); //makes AI actually speak + respond\n //-------------------------------\n}", "function sayBackwards(text) {\n//reverse the letters of the answer\n let backwardsText = text.split('').reverse().join('');\n let options = {\n pitch: Math.random(0, 2),\n rate: Math.random(0, 2)\n };\n//make the responsive voice speak the backwards answer\n responsiveVoice.speak(backwardsText, 'Japanese Female', {\n options\n });\n}" ]
[ "0.8181406", "0.81332964", "0.79626274", "0.78283453", "0.7802613", "0.75878954", "0.7458771", "0.7454734", "0.74527", "0.74448675", "0.73685783", "0.73363554", "0.7334401", "0.731504", "0.73092526", "0.7304495", "0.72811794", "0.7266842", "0.7246536", "0.72378933", "0.7235969", "0.72343254", "0.72102195", "0.7198292", "0.71564037", "0.70927995", "0.7076378", "0.70712376", "0.70012313", "0.69950974", "0.6943409", "0.691057", "0.6895785", "0.6872949", "0.6870989", "0.6856993", "0.6827584", "0.6825009", "0.6817075", "0.6792638", "0.6782083", "0.67687136", "0.6758273", "0.67536354", "0.6716786", "0.6712651", "0.6700171", "0.66702276", "0.6656543", "0.6654667", "0.66379106", "0.6624816", "0.66239953", "0.66133696", "0.6601169", "0.6599878", "0.65899634", "0.6588924", "0.6578946", "0.65689903", "0.6538241", "0.6531067", "0.6529075", "0.6528129", "0.6526", "0.65250087", "0.65191257", "0.6514605", "0.6493035", "0.6486966", "0.6486516", "0.6483212", "0.6481358", "0.64775926", "0.6475152", "0.64240897", "0.6412562", "0.64066476", "0.63961047", "0.639038", "0.63823706", "0.63783586", "0.6376541", "0.63695925", "0.63602996", "0.6360073", "0.63583875", "0.6349107", "0.6340529", "0.63351905", "0.6331967", "0.6312782", "0.63078606", "0.6305754", "0.6305386", "0.6303332", "0.6291552", "0.62871933", "0.6282807", "0.6265502" ]
0.7294766
16
Handle the press of the next button.
nextPressed(){ //Update the user info object with the information on the lat and longs this.props.userInfo.homeLat = this.state.markerLat; this.props.userInfo.homeLong = this.state.markerLong; //Move on to the transport type page (passing the userinfo object) Actions.TransportType({userInfo: this.props.userInfo}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_nextButtonClickHandler() {\n const that = this;\n\n that.next();\n }", "function onNext() {\n\n\t\tif (step < 3) {\n\t\t\tdispatch(INCREMENT_STEP());\n\t\t}\n\n\t\t// update button state\n\t\tsetBackButtonDisabled(false);\n\t}", "function handleNext(e){\n if (chapterArray[currentChapterIndex].isAtLastPara()){\n chapterArray[currentChapterIndex].getNextPara();\n nextButtonElem.style.display = 'none';\n formArray[currentChapterIndex].style.display = 'flex';\n }else{\n chapterArray[currentChapterIndex].getNextPara();\n }\n}", "function handleNextButton() {\r\n $('#container').on('click', '#js-next-button', function(event) {\r\n\r\n if(questionNum === 10) {\r\n createResultsPage(correctAnswers);\r\n } else {\r\n iterateQuestion();\r\n nextQuestion();\r\n }\r\n });\r\n}", "function handleNextBtn() {\n\tmessages.innerText = '';\n\titerateQuestionsAndAnswers();\n\tanswerBtns.forEach((btn) => {\n\t\tbtn.disabled = false;\n\t});\n}", "function handleNextButton() {\n //when \"next\" button is clicked in HTML container\n $('#container').on('click', '#next-button', function(event) {\n//if the number of the question we're on is the final question\n //then display results page with correct answer score count\n if(questionNumber === 10) {\n renderResultsPage(correctAnswers);\n//if not, go to the next question\n } else {\n iterateQuestion();\n nextQuestion();\n }\n });\n}", "function handleNext() {\n var current = document.getElementsByClassName(\"current\")[0];\n var next = current.getAttribute(\"data-next\");\n\n startLightBox(next);\n }", "function goNext( event ){\n event.preventDefault();\n go( revOffset - 1 );\n return false;\n }", "function handleNextButtonClicked(questionNum, results) {\n\t$('.js-next').click(event => {\n\t\t$('.js-is_correct').html(``);\n\t\t$('.js-is_not_correct').html(``);\n\t\tif (questionNum < (QUESTIONS.length - 1)) {\n\t\t\treturn [questionNum++, renderQuestionPage(questionNum, results)];\n\t\t}\n\t\trenderResultsPage(results);\n\t});\n}", "function handleKeyNext() {\n if (next) {\n window.location = next.href;\n }\n }", "function handleNextButton() {\n $(\".feedBackPage\").on(\"click\", \".next-btn\", function(event) {\n $(\".feedBackPage\").hide();\n if (questionNumber === QUIZ.length - 1) {\n renderResults();\n } else {\n iterateQuestion();\n renderQuestion();\n $(\".form-container\").show();\n }\n });\n console.log(\"handleNextButton() ran\");\n}", "function handleNext() {\n let tempPage = page + 1;\n if (tempPage > totalPages) {\n tempPage = totalPages\n }\n setPage(tempPage);\n }", "function onClickNaviNext(el) {\n curPageNumber = curPageNumber + 1;\n refreshTable();\n debug('Next button clicked. page number : ' + curPageNumber);\n }", "function handleNextQuestion() {\r\n $('main').on('click', '#next-btn', function (event) {\r\n event.preventDefault();\r\n console.log('Next question');\r\n nextQuestion();\r\n render();\r\n })\r\n}", "_setEvent_next(){\n $(this._controlSelectors.next).click(()=>{\n this.next();\n });\n }", "_goToNextCard() {\n if (this._btnNext.disabled === false) {\n var newCurrentPos = 0;\n newCurrentPos = this._currentPos + 1;\n this._goToCard(newCurrentPos, 'next');\n }\n }", "function clickNext() {\n if (isRunning) {\n eventFire(document.querySelector('.stream-next'), 'click');\n nextOnFinish();\n }\n }", "onHeaderNextPress() {\n\t\tthis._currentPickerDOM._showNextPage();\n\t}", "_handleClick() {\n this._stepper.next();\n }", "function next() {\n slide(false, true);\n }", "function clickedNext(currentPage, targetSlot) {\n //console.log(\"NEXT FUNCTION ACTIVATED\");\n ++currentPage;\n targetSlot.spawnMenu(currentPage);\n}", "function next($event) {\n $event.preventDefault();\n init();\n return false;\n }", "function next($event) {\n $event.preventDefault();\n init();\n return false;\n }", "function next() {\n changeSlide($nextel);\n }", "onNextButtonPressed_() {\n this.userActed('next');\n }", "function pfClickedNext(pageNumba, mode){\n //console.log(\"Clicked Next\");\n\tpageNumba++;\n\tspawnPF(mode, pageNumba);\n}", "nextHandler() {\n if (this.page < this.totalPage && this.page !== this.totalPage) {\n this.page = this.page + 1; //increase page by 1\n this.displayRecordPerPage(this.page);\n }\n }", "handleNext(event) {\n const nextNavigationEvent = new FlowNavigationNextEvent();\n this.dispatchEvent(nextNavigationEvent);\n }", "function nextClicked() {\n if (currentIndex >= data.length - 1) {\n return;\n }\n currentIndex++;\n setDefinitionPopup();\n}", "function handleNextClick() {\n if(view === 'month') {\n setYear(year + 1);\n return; \n }\n\n if(view === 'year') {\n setYear(year + YEARS_SHOW);\n return;\n }\n\n const previousMont = getNextMonth(month, year);\n setMonth(previousMont.month);\n\n if(previousMont.year === year) return;\n setYear(previousMont.year);\n }", "next() {\n const that = this;\n\n that.navigateTo(that.pageIndex + 1);\n }", "function nextButton () {\n\t\t$(\"<button>\").addClass(\"btn btn-info mt-3 nextButton\").attr(\"type\", \"button\").appendTo($(\".answers\")).text(\"NEXT >\");\n\t}", "openNextSlide() {\n if (this.animation === true) return;\n this.startAnimation();\n\n this.current_page++;\n this.next_button.blur();\n this.openSlide();\n }", "function handleNextQuestion() {\n $('main').on('click', '.js-continue-button', (event) => {\n store.answer = '',\n renderQuizScreen();\n });\n}", "function next($event) {\n $event.preventDefault();\n angular.element('#input-1').val('');\n count++;\n if(count === 4){\n $scope.questionLabel= questionData.questionLabel[1].text;\n } else {\n if (count === 8){\n count= 0;\n $scope.questionLabel= questionData.questionLabel[0].text;\n }\n }\n init();\n return false;\n }", "function goNext() {\n if (pageNum == pdfDoc.numPages-1)\n {\n \t$(\"#next\").prop(\"disabled\", true);\n \t}\n pageNum++;\n renderPage(pageNum);\n }", "function nextBtnEvent(){\n\t//Handles the event when the previous button on the modal is clicked. It will find the pokemon whose id is one higher.\n\t//When the id is the highest, it will go back around to the pokemon with the lowest id (acting like a circular buffer).\n\tif(currPokeID != null){\n\t\tvar newID = currPokeID + 1;\n\t\tif(newID > pokemons.length){\n\t\t\tnewID = 1;\n\t\t}\n\t\t//Request to the third party api\n\t\tpokemonRequestData(newID);\n\t}\n\telse{\n\t\terrorModal();\n\t}\t\n}", "function nextQuestion() {\n showQuestion();\n //*********************************** */\n // this logic is implemented because unable to check whether event listener for first round exists with button\n if (startButton.textContent !== \"Retake Quiz\") {\n addEventListenerToButtons(questionIndex);\n }\n //*********************************** */\n}", "function displayNext() {\n $(\"body\").on(\"click\", \".nextButton\", (_e) => {\n state.page++;\n let results = state.records.slice(state.page * 10, state.page * 10 + 10);\n renderItems(results);\n });\n $(\"body\").on(\"click\", \".previousButton\", (_e) => {\n if (state.page === 0) {\n return;\n }\n state.page--;\n let results = state.records.slice(state.page * 10, state.page * 10 + 10);\n renderItems(results);\n });\n}", "function my_next(that){\n\t\tthat.hideNextButton(); //schova tlacitko next\n\t\tthat.hidePreviousButton(); //schova tlacitko previous\n\t\t\n\t\tthat.questionclick = function(event, element) {\n\t\t\tif(element.type == \"radio\") {that.clickNextButton();}\n\t\t\t//Pokud nekdo klikne na moznost u multiple choice otazky ,\n\t\t\t//POZOR, pokud by Vam to nefungovalo, ujistete se v inspektoru,ze jsou Vase moznosti HTML elementy typu radio; ruzne sablony to mohou mit ruzne\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t}", "function next() {\n if ($scope.options.index < pageCount - 1) {\n $scope.options.index++;\n }\n }", "function nextHandle(e,$obj)\n\t{\n\t\te.preventDefault();\n\t\tif($obj === undefined)\n\t\t\t$obj = $(this);\n\t\tvar id = find_instance($obj.attr(\"data-id\")),\n\t\t\tdata = als[id];\n\t\t/*********************************************\n\t\t * unbinding next and prev buttons so that\n\t\t * they don't interfere with current animation\n\t\t ********************************************/\t\n\t\tdata.next.off();\n\t\tdata.prev.off();\n\t\tdata.viewport.off(\"touchend\");\n\t\t/********************************************\n\t\t * calling next function on this instance\n\t\t ********************************************/\n\t\t$.fn.als('next',id);\n\t}", "next() {\n\n if (this.currStep < this.slides[this.currSlide].steps.length - 1) {\n\n this.nextStep();\n\n } else {\n\n this.nextSlide();\n\n }\n\n }", "function next() {\n var nextButton = gAppState.checkId(\"nextBtnID\", \"nextBtnID2\");\n var prevButton = gAppState.checkId(\"prevBtnID\", \"prevBtnID2\");\n var remainder = tableSize - limit;\n\n if (nextButton.classList.contains('disabled')) { // stop action if button is disabled\n return false;\n }\n\n if (offset < remainder) { // if there is a next page\n offset += parseInt(limit);\n buttonDisplay();\n }\n\n // refresh table\n if (resultMode == \"bn\") {\n bnQueryGen();\n } else if (resultMode == \"query\") {\n queryGen();\n } else {\n updateTable();\n }\n}", "function nextQuestionBtn() {\n currentQuestionIndex++;\n setNextQuestion();\n}", "nextSlide(e) {\r\n // !e.code will be true with mouse click. Rest condition check the key events\r\n if (!e.code || e.code.toLowerCase() === 'space' || e.code.toLowerCase() === 'enter' || e.code.toLowerCase() === 'numpadenter') {\r\n let n = this.index;\r\n n++;\r\n clearInterval(this.clrInterval);\r\n const val = n > (this.slides.length - 1) ? 0 : n;\r\n this.slideShow(val);\r\n }\r\n }", "function next() {\n setCurrentPage((currentPage) => Math.min(currentPage + 1, maxPage));\n }", "handleClick () {\n super.handleClick()\n this.player_.trigger('next')\n }", "function handleNextQuestion() {\n //console.log('Handling next question process');\n $('.result').on('click', '.btnNextQuestion', function(event) {\n clearAnswer();\n if (STORE.currentQuestion < QUESTIONS.length) {\n advanceToNextQuestion();\n STORE.view = 'quiz';\n } else {\n STORE.view = 'finalResult';\n }\n render();\n \n });\n}", "function NextButtonClicked() {\n playerObject.controls.next();\n}", "function handle_next() {\n // get the next row\n var next = next_selection();\n if (next == null) {\n //my_alert(\"Selection set is empty\");\n lb_alert(\"info\", \"No more selections to process\");\n return;\n }\n // set selections left indicator\n set_selections_left();\n\n // call the initiator function on the next selection\n window.initiate_fcn(next, $(featherlight_selector()).get(0));\n}", "function nextItem() {\n\t\tstopSlideshow();\n\t\tchangeItem(current + 1);\n\t}", "function handleNextButtonClick() {\n count++;\n renderTable();\n}", "function handleNextButtonClick() {\n count++;\n renderTable();\n}", "function handleQuestionNextButtonNext(){\n\tif(SOUNDS_MODE){\n\t\taudioClick.play();\t\n\t}\n\t\n\t//hide the popup\n\tquestionNextButtonQuitPopup.hide();\n \tquitShown=false;\n \tquestionNextButtonRestartPopup.hide();\n \trestartShown=false;\n\t\n\tvar dummyTimeoutValue = 0;\n\t\n\tbuildQuestionView(gameSession.getCurrentCategoryBanner());\n\t\n\tif(!gameSession.hasGameStarted()){\n\t\tTi.API.info('Game HASNT started so fire the event..');\n\t\t//show questions view\n\t\tviewQuestion.fireEvent('gameStart');\n\t\tviewQuestion.animate(anim_in);\n\t\t\n\t\t//hide the loader\n\t\tviewLoader.opacity = 0;\n\t\tdummyTimeoutValue = 400;\n\t} else {\n\t\tnextQuestion(false);\n\t\tdummyTimeoutValue = 0;\n\t}\n\t\t\n\tsetTimeout(function(){\n\t\t//always hide next question view\n\t\tviewQuestionNext.opacity = 0;\n\t\t\n\t\t//Reposition the elements if needed\n\t\tif(gameSession.getLastLostPlayer() != null){\n\t\t\t//Reset the lost player so we wont show again until we need to\n\t\t\tgameSession.resetLastLostPlayer();\n\t\t\t\n\t\t\t//Move next player labels back to their original state\n\t\t\tif(questionNextPlayerLostLabel != null){\n\t\t\t\tquestionNextPlayerLostLabel.text = '';\n\t\t\t}\n\t\t\tquestionNextLabelPlayerNo.top = questionNextLabelPlayerNo.top - QUESTION_NEXT_HEIGHT_OFFSET_FOR_LOST_PLAYER;\n\t\t\tquestionNextLabelPlayerName.top = questionNextLabelPlayerName.top - QUESTION_NEXT_HEIGHT_OFFSET_FOR_LOST_PLAYER;\n\t\t}\n\t}, dummyTimeoutValue);\t\n\t\n}", "next() {\n const { index, showTooltip } = this.state;\n const { steps } = this.props;\n const nextIndex = index + 1;\n\n const shouldDisplay = Boolean(steps[nextIndex]) && showTooltip;\n\n this.logger('joyride:next', ['new index:', nextIndex]);\n this.toggleTooltip(shouldDisplay, nextIndex, 'next');\n }", "function handleNextQuestionSubmit(){\n $('body').on('click', '#next-question', (e) => {\n e.preventDefault();\n store.questionNumber++;\n // determines which view to render next. If all questions have been answered, renders final results page, \n //otherwise, renders the next question.\n if (store.questionNumber === store.questions.length){\n return renderFinalPage();\n }\n else (renderQuestionPage());\n}); \n}", "function handleNextQuestion() {\r\n $(`main`).on(`click`, `#next-question`, function (e) {\r\n e.preventDefault();\r\n $(\"main\").html(store.questions[store.questionNumber])\r\n render();\r\n });\r\n}", "function goNext() {\n //console.log(\"goNext: \" + options.currentPage);\n if (options.currentPage != options.total) {\n var p = options.currentPage + 1;\n loadData(p);\n setCurrentPage(p);\n options.currentPage = p;\n pageInfo();\n }\n }", "handleNextPage(){\n this.setState({buttonClicked:true});\n\n }", "function nextImage(){\nbuttonModule.next();\n}", "function nextQuestion () {\n $('.js-fieldset').on('click', '#next', function() {\n if (STORE.questionNumber < STORE.questions.length) {\n renderFieldsetForm('question', STORE);\n }\n else {\n renderFieldsetForm('end', STORE);\n }\n });\n}", "function handleNextQuestion() { \n $('.quiz-field').on('click', '.next-question', () => {\n currentQuestion += 1;\n if (currentQuestion > questions.length) {\n finalScore();\n } else {\n loadNextQuestion();\n }\n });\n }", "function handleNext() {\n\n $(\".quizForm\").on(\"click\", \".nextButton\", function(event) {\n event.preventDefault();\n $(\".displayedQuestion\").hide();\n $(\".nextButton\").hide();\n $(`.questionSet${currentQuestionNumber}`).hide();\n\n showNewQuestion();\n });\n}", "function nextItem() {\r\n hideItems();\r\n currentIndex = currentIndex < slidesLength - 1 ? currentIndex + 1 : 0;\r\n updateIndexes();\r\n showItems();\r\n }", "function goToNextPage() {\n updateCurrentPage((page) => page + 1);\n }", "function next()\n{\t\n\tnewSlide = sliderint+1;\n\tshowSlide(newSlide);\n}", "nextButton(){\r\n\t\tnext.addEventListener(\"click\", () =>{ \r\n\t\tclearInterval(this.slideInterval);\r\n\t\tthis.nextImage();\r\n\t\tthis.sliderAnimation();\r\n\t\t});\r\n }", "function handleNextQuestionButton() {\n $('main').on('click', '.next-question-button', nextQuestion);\n}", "function btn_next() {\n\tvar isClicked = true;\n\n\tvar fieldsetAction = document.querySelectorAll(\"fieldset\")[count];\n\tvar fieldCount = fieldsetAction.querySelectorAll(\"input\").length;\n\tvar fieldCount1 = fieldsetAction.querySelectorAll(\"textarea\").length;\n\n\n\tfor (i = 0; i < fieldCount; ++i) {\n\t\tfor (j = 0; j < fieldCount1; ++j) {\n\t\t\tvar fieldInput = fieldsetAction.querySelectorAll(\"input\")[i];\n\t\t\tvar fieldtxtarea = fieldsetAction.querySelectorAll(\"textarea\")[j];\n\n\t\t\tif (fieldInput.getAttribute(\"type\") === \"button\" || fieldtxtarea.getAttribute(\"type\") === \"button\") {\n\t\t\t\t// nothing happens\n\t\t\t} else {\n\t\t\t\tif (fieldInput.value === \"\" || fieldtxtarea.value === \"\") {\n\t\t\t\t\tfieldInput.style.backgroundColor = \"pink\";\n\t\t\t\t\tfieldtxtarea.style.backgroundColor = \"pink\";\n\n\t\t\t\t\tisClicked = false;\n\t\t\t\t} else {\n\t\t\t\t\tif (isClicked === false) {\n\t\t\t\t\t\t// nothing happens\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisClicked = true;\n\t\t\t\t\t\tfieldInput.style.backgroundColor = \"none\";\n\t\t\t\t\t\tfieldtxtarea.style.backgroundColor = \"none\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t};\n\tif (isClicked === true) {\n\t\t// goes to the next step\n\t\tvar selection = getFieldElements[count];\n\t\tselection.className = \"hide\";\n\t\tcount = count + 1;\n\t\tvar selection = getFieldElements[count];\n\t\tselection.className = \"Card\";\n\n\t}\n}", "function nextQuestionIndex() {\n $(\"body\").on(\"click\", \".nextButton\", function(event) {\n event.preventDefault();\n incQuestion();\n renderQuestion();\n });\n}", "function handleNextQuestionButton () {\n $('.quiz').on('click','.js-next-question-btn', function () {\n console.log('js-next-question-btn was clicked.');\n event.preventDefault();\n if (store.submitBtnClicked === true) {\n render();\n }\n\n });\n}", "function nextPage() {\n\t\tsetCurrentPage((page) => page + 1);\n\t}", "function handleNextQuestion() {\r\n $('main').on('click', '#next-question-button', function(evt){\r\n evt.preventDefault();\r\n if (store.questionNumber >= store.questions.length) {\r\n $('main').html(resultsPage());\r\n }\r\n else {\r\n render();\r\n }\r\n })\r\n}", "goToNext () {\n\t\t\tif (this.canGoToNext) {\n\t\t\t\tthis.goTo(this.currentSlide + 1)\n\t\t\t}\n\t\t}", "function nextPage() {\n refs.pageButton.style.transform = moveRight(); \n // idClick += 1;\n // if (idClick === clickNumber) {\n // refs.buttonNext.removeEventListener('click', nextPage);\n // idClick = 1;\n // }\n // return idClick; \n}", "onNextClick() {\n if(this.state.currentPage + 1 <= this.pages) {\n this.changePage(this.state.currentPage + 1);\n }\n }", "next() {\n this.selectedIndex = Math.min(this._selectedIndex + 1, this.steps.length - 1);\n }", "__nextStep() {\n this.openNextStep();\n }", "function next() {\n if (currentContactIndex < (contactArray.length-1)) {\n currentContactIndex++;\n }\n currentContact = contactArray[currentContactIndex];\n viewCurrentContact();\n\n \n // Todo: Disable next button when there is no next item.\n // PJB: I implemented this in the viewCurrentContact() fucntion so that \n // it would work when first loaded.\n \n \n // Todo: Save changed items to contacts array and resort array.\n // PJB: I saved the changed items to the contacts array in the add(), \n // delete(), and update() functions. I didn't resort the array\n // because I didn't sort it in the first place but I do update \n // the table each time one of these functions is called.\n}", "function nextButton() {\n \n next.innerHTML = `<button id=\"next-button\" class=\"next-button hvr-grow\" draggable=\"false\">NEXT</button>`;\n next.addEventListener(\"click\", function (){\n endTrial();\n });\n }", "function next_slide(ev)\n {\n ev.preventDefault();\n if (current == sync_elts.length - 1) return; // No next element\n activate(current + 1); // Move the \"active\" class\n //console.log(\"next: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "function nextButtonHandler() {\n switch (currentState) {\n case \"SelectAnomalyTypes\":\n saveAnomalyTypesForm();\n loadElementSelectionForm();\n break;\n case \"SelectElementTypes\":\n saveElementTypesForm();\n loadTerrainModificationSelectionForm();\n break;\n case \"SelectTerrainModificationTypes\":\n saveTerrainModificationTypesForm();\n loadNextElementSeedForm();\n break;\n case \"ElementSeedForm\":\n if ((0, _FormValidators.checkCustomInputs)()) {\n saveElementSeedForm();\n loadNextElementSeedForm();\n }\n break;\n case \"TerrainModificationForm\":\n if ((0, _FormValidators.checkCustomInputs)()) {\n saveTerrainModificationForm();\n loadNextTerrainModificationForm();\n }\n break;\n case \"AnomalyForm\":\n if ((0, _FormValidators.checkCustomInputs)()) {\n saveAnomalyForm();\n loadNextAnomalyForm();\n }\n break;\n case \"ReviewForm\":\n if (_FormValidators.checkBasicInputs) submitCustomEnvironment();\n }\n}", "function nextPage(){\n if (page > 0)\n {\n setPage( page +1);\n }\n }", "function hasEnded(){\n $('#next').click();\n }", "function onContinueBtnClick () {\n\n $('.js-continue-btn').click( event => {\n\n if (event.target.value === 'Next Question' || event.target.value === 'See Results') {\n showNextQuestion();\n }\n\n });\n\n}", "function renderNextQuestion () {\r\n $('main').on('click', '.nextButton', function (event) {\r\n increaseQuestionNumber();\r\n renderQuestion();\r\n checkAnswer();\r\n });\r\n}", "function next_step() {\n\t//just to prevent submission\n\tevent.preventDefault();\n\t//true means it comes as next step\n\tpopup(true);\n}", "next() {\n this.selectNonDisabled(this.activeTabIndex, 1);\n }", "function handleNextQuestion() {\n $('main').on('click', '.js-next-question', function(event) {\n renderMain(false, true);\n }\n )\n}", "function nextLevelBtnEvent(){\n\t\tvar mcNext = new Hammer(document.querySelectorAll('.next-btn')[0]);\n\t\tmcNext.on('tap', function(e){\n\t\t\tGameJam.sound.play('click');\n\t\t\tdocument.getElementById('complete').className = 'window hide';\n\t\t\tvar nextLevel = 'level' + (parseInt(GameJam.currentLevel.replace(/level/g, '')) + 1);\n\t\t\tcore.LoadLevel(nextLevel);\n\t\t});\n\t}", "function handleNextQuestion(currentQuestionNumber, score) {\n $('#next_button').click(function() {\n const questionArray = generateQuestions();\n let count = currentQuestionNumber;\n if (count < 9 ) {\n count += 1;\n generateQuiz(questionArray, count);\n let questionNumber = count + 1;\n generateQuestionNumber(questionNumber);\n } else {\n renderResult(score);\n }\n })\n}", "function next() {\n $ctrl.index++;\n\n // Move on if all players have been shown\n if ($ctrl.index === $ctrl.players.length) {\n $state.go('play');\n }\n // Otherwise show next role\n else {\n showRole();\n }\n }", "async function handleNext() {\n if (cardNumber === cards.length) {\n if (cardNumber === cards.length && flip === true) {\n const response = window.confirm(\n \"Restart cards?\\n\\nClick 'cancel to return to the home page.\"\n );\n if (!response) {\n history.push(\"/\");\n } else {\n setCardNumber(1);\n setCard(1)\n }\n }\n setFlip(!flip);\n return;\n }\n\n //reset the flip and start over with new card\n setFlip(!flip);\n setCardNumber(cardNumber + 1);\n const abortController = new AbortController();\n const signal = abortController.signal;\n const newCard = await readCard(cards[cardNumber].id, signal);\n setCard({...newCard});\n }", "handleNextPage() {\n this.props.getNextPage(this.props.page + 1);\n }", "function next() {\n\t\tvar nextStep = steps.next();\n\t\tsetSteps(steps);\n\t\tsetCurrent(nextStep);\n\t}", "function handleNextQuestionClick() {\n $('main').on('click', '#js-next-btn', () => {\n renderQuiz();\n })\n}", "function nextQuestion() {\n \n index += questions;\n index = index > quiz.questions.length ? quiz.questions.length : index;\n \n if (index === quiz.questions.length) {\n disableElement(\"#nextBtn\");\n enableElement(\"#prevBtn\");\n $(\".question\").append(\"<input type=\\\"button\\\" onclick=\\\"buildAnswerObj()\\\" id=\\\"submit\\\" data-theme=\\\"b\\\" value=\\\"Submit Quiz\\\">\");\n //TODO fix it\n loadPage(\"#question\");\n } else {\n enableElement(\"#prevBtn\");\n }\n presentQuestion(true);\n}", "nextButton() {\n let currentStep = this.state.step;\n if (currentStep < 3) {\n return (\n <TouchableOpacity style={styles.btns} onPress={this.nextStep}>\n <Text style={styles.btnText}>Next</Text>\n </TouchableOpacity>\n );\n }\n return null;\n }", "handleNext() {\n this.currentMovePrevented = false;\n\n // Call the bound `onNext` handler if available\n const currentStep = this.steps[this.currentStep];\n if (currentStep && currentStep.options && currentStep.options.onNext) {\n currentStep.options.onNext(this.overlay.highlightedElement);\n }\n\n if (this.currentMovePrevented) {\n return;\n }\n\n this.moveNext();\n }", "function nextPage() {\n showPage(currentPage + 1);\n}" ]
[ "0.81973", "0.78442276", "0.7823173", "0.75852627", "0.75563633", "0.7535408", "0.75259036", "0.7436728", "0.74147516", "0.73893315", "0.7380784", "0.73127246", "0.72318184", "0.714882", "0.7146532", "0.71094126", "0.7106592", "0.70834196", "0.70612025", "0.705877", "0.7040458", "0.7039293", "0.7039293", "0.7032797", "0.70230746", "0.70221764", "0.70212346", "0.70048106", "0.69837785", "0.6951257", "0.6949793", "0.6938142", "0.6931534", "0.6916526", "0.68876064", "0.6884421", "0.6882179", "0.68646777", "0.6858988", "0.6823242", "0.68027794", "0.6802284", "0.67974025", "0.6796836", "0.67966086", "0.6782512", "0.6777772", "0.67725384", "0.6761297", "0.67601985", "0.67589", "0.67587775", "0.6757695", "0.6757695", "0.67559856", "0.6751134", "0.6749439", "0.67348206", "0.673087", "0.67304087", "0.672905", "0.67282176", "0.6727753", "0.67127067", "0.6709663", "0.66902345", "0.66901916", "0.66880083", "0.668685", "0.6685196", "0.6683534", "0.6681863", "0.6677637", "0.6672904", "0.665857", "0.66543347", "0.6647237", "0.664187", "0.6636303", "0.66214675", "0.66210335", "0.6614587", "0.6614431", "0.66143453", "0.66141486", "0.66089654", "0.66015655", "0.6580333", "0.65776324", "0.65748256", "0.655765", "0.6557224", "0.6550586", "0.65438056", "0.654267", "0.65385", "0.6534102", "0.65339667", "0.65288967", "0.65267646", "0.6526333" ]
0.0
-1
/ ObjectObserver provides concrete observer independent source and target synchronization / functionality for a particular object source with related user interface / interactive capabilities. / ObjectObserver extends from ActivityObserver and for information about activity / functions refer here.
function ObjectObserver(options) { var instance = (options.instance !== null && options.instance !== undefined) ? options.instance : this; var extender = new InstanceExtender(); instance = extender.extendFieldObserver({ 'instance': instance, 'field': 'InputObject', 'observer': options.observer }); instance = extender.extendFieldObserver({ 'instance': instance, 'field': 'OutputObject', 'observer': options.observer }); if (options.observer !== null && options.observer !== undefined) { if (typeof (options.observer) === "string") { //select and initializes observer. if (options.observer === "kn") { instance.Observer = new ObjectKNObserver(options); } } else { //if observer is provided it is selected. instance.Observer = options.observer; } } else { //if observer is not provided a default observer is initialized and selected. instance.Observer = new ObjectKNObserver(options); } if (options.instance === null || options.instance === undefined) { instance = extender.extendNewInstance({ 'instance': instance, 'newparameter': instance.Observer, 'options': options}); } instance = extender.extendContentObserver({'instance': instance, 'observer': instance.Observer }); instance = extender.extendObserverInterface({'instance': instance, 'observer': instance.Observer }); //extend from activity observer instance = ActivityObserver({'instance': instance, 'observer': instance.Observer}); /// <summary>Gets the type of the function construct.</summary> instance.getType = function () { return "ObjectObserver"; }; /// <summary>Sets form observer object with optional original key.</summary> instance.setFormObject = function (data) { instance.getObserver().setFormObject(data); }; /// <summary>Gets form object.</summary> instance.getFormObject = function () { return instance.getObserver().getFormObject(); }; /// <summary>Gets observable form object.</summary> instance.getObservableFormObject = function () { return instance.getObserver().getObservableFormObject(); }; /// <summary>Gets form's stringified JSON object.</summary> instance.getFormStringifiedObject = function () { return instance.getObserver().getFormStringifiedObject(); }; /// <summary>Gets form's JSON object.</summary> instance.getFormJSONObject = function () { return instance.getObserver().getFormJSONObject(); }; /// <summary>Validate form object.</summary> instance.validateFormObject = function () { return instance.getObserver().validateFormObject(); }; /// <summary>Resets form object and view mode.</summary> instance.resetForm = function () { instance.getObserver().resetForm(); }; if (options.instance !== null && options.instance !== undefined) { return Object.create(instance); } return instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Observer() {}", "function Observer() {\n this.update = function () {\n // /* ... */\n };\n}", "function Observer(){\n this.update = function(){\n // ...\n };\n}", "function ObserverSet(hostObject) {\n\t\tvar _observers = {};\n\t\t/** .add registers a *property name*, to notify an *observer*, via a *callback*.\n\t\t\t\n\t\t\tExample: \n\t\t\tModelObject.observers.add(\"name\", DOMNode, function(object, newVal, propName) {\n\t\t\t\tthis.textContenxt = \"Name is now: \" + newVal;\n\t\t\t}); \n\t\t*/\n\t\tthis.add = function(property, observer, cb) {\n\t\t\tif (!_observers.hasOwnProperty(property)) {\n\t\t\t\t_observers[property] = [];\n\t\t\t}\n\t\t\tvar alreadyPresent = _observers[property].some(function(registration) {\n\t\t\t\treturn registration.observer === observer;\n\t\t\t});\n\t\t\tif (!alreadyPresent) {\n\t\t\t\t_observers[property].push({\"observer\":observer, \"callback\": cb});\n\t\t\t\tvar currentValue = this[property];\n\t\t\t\tif (typeof currentValue !== 'undefined') {\n\t\t\t\t\tcb.call(observer, this, currentValue, property);\n\t\t\t\t}\n\t\t\t}\n\t\t}.bind(hostObject);\n\t\t/** When removing properties, you may supply undefined as the property name to\n\t\tremove all registrations owned by observer. */\n\t\tthis.remove = function(property, observer) {\n\t\t\tif (typeof property === 'undefined') {\n\t\t\t\t// console.log(\"Removing all properties for observer\", observer);\n\t\t\t\tvar properties = Object.getOwnPropertyNames(_observers);\n\t\t\t\tvar propertiesLen = properties.length >>> 0;\n\t\t\t\tfor (var i = 0; i < propertiesLen; i++) {\n\t\t\t\t\tvar propName = properties[i];\n\t\t\t\t\t_observers[propName] = _observers[propName].filter( function(registration) {\n\t\t\t\t\t\treturn registration.observer !== observer;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (_observers.hasOwnProperty(property)) {\n\t\t\t\t_observers[property] = _observers[property].filter( function(registration) {\n\t\t\t\t\treturn registration.observer !== observer;\n\t\t\t\t});\n\t\t\t}\n\t\t}.bind(hostObject);\n\t\tthis.notify = function(property, value) {\n\t\t\t// console.log(\"Notifying\", property, value, _observers[property]);\n\t\t\tif (_observers.hasOwnProperty(property)) {\n\t\t\t\tvar registrations = _observers[property];\n\t\t\t\tregistrations.forEach(function(registration) {\n\t\t\t\t\tregistration.callback.call(registration.observer, this, value, property);\n\t\t\t\t}.bind(this));\n\t\t\t}\n\t\t}.bind(hostObject);\n\t\treturn this;\n\t}", "function observe(obj, callback) {\n var patches = [];\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.set(obj, mirror);\n }\n else {\n var observerInfo = getObserverFromMirror(mirror, callback);\n observer = observerInfo && observerInfo.observer;\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = Object(_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__[\"_deepClone\"])(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var dirtyCheck = function () {\n generate(observer);\n };\n var fastCheck = function () {\n clearTimeout(observer.next);\n observer.next = setTimeout(dirtyCheck);\n };\n if (typeof window !== 'undefined') { //not Node\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keyup', fastCheck);\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('keydown', fastCheck);\n window.addEventListener('change', fastCheck);\n }\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keyup', fastCheck);\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n window.removeEventListener('change', fastCheck);\n }\n };\n mirror.observers.set(callback, new ObserverInfo(callback, observer));\n return observer;\n}", "function observe(obj, callback) {\n var patches = [];\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.set(obj, mirror);\n }\n else {\n var observerInfo = getObserverFromMirror(mirror, callback);\n observer = observerInfo && observerInfo.observer;\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var dirtyCheck = function () {\n generate(observer);\n };\n var fastCheck = function () {\n clearTimeout(observer.next);\n observer.next = setTimeout(dirtyCheck);\n };\n if (typeof window !== 'undefined') { //not Node\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keyup', fastCheck);\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('keydown', fastCheck);\n window.addEventListener('change', fastCheck);\n }\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keyup', fastCheck);\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n window.removeEventListener('change', fastCheck);\n }\n };\n mirror.observers.set(callback, new ObserverInfo(callback, observer));\n return observer;\n}", "function _observe(observer, obj) {\n if (Object.observe) {\n Object.observe(obj, observer);\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n var v = obj[key];\n if (v && typeof (v) === \"object\") {\n _observe(observer, v);\n }\n }\n }\n }\n return observer;\n }", "function observe(obj, callback) {\n\t var patches = [];\n\t var root = obj;\n\t var observer;\n\t var mirror = getMirror(obj);\n\t if (!mirror) {\n\t mirror = new Mirror(obj);\n\t beforeDict.push(mirror);\n\t }\n\t else {\n\t observer = getObserverFromMirror(mirror, callback);\n\t }\n\t if (observer) {\n\t return observer;\n\t }\n\t observer = {};\n\t mirror.value = deepClone(obj);\n\t if (callback) {\n\t observer.callback = callback;\n\t observer.next = null;\n\t var dirtyCheck = function () {\n\t generate(observer);\n\t };\n\t var fastCheck = function () {\n\t clearTimeout(observer.next);\n\t observer.next = setTimeout(dirtyCheck);\n\t };\n\t if (typeof window !== 'undefined') {\n\t if (window.addEventListener) {\n\t window.addEventListener('mouseup', fastCheck);\n\t window.addEventListener('keyup', fastCheck);\n\t window.addEventListener('mousedown', fastCheck);\n\t window.addEventListener('keydown', fastCheck);\n\t window.addEventListener('change', fastCheck);\n\t }\n\t else {\n\t document.documentElement.attachEvent('onmouseup', fastCheck);\n\t document.documentElement.attachEvent('onkeyup', fastCheck);\n\t document.documentElement.attachEvent('onmousedown', fastCheck);\n\t document.documentElement.attachEvent('onkeydown', fastCheck);\n\t document.documentElement.attachEvent('onchange', fastCheck);\n\t }\n\t }\n\t }\n\t observer.patches = patches;\n\t observer.object = obj;\n\t observer.unobserve = function () {\n\t generate(observer);\n\t clearTimeout(observer.next);\n\t removeObserverFromMirror(mirror, observer);\n\t if (typeof window !== 'undefined') {\n\t if (window.removeEventListener) {\n\t window.removeEventListener('mouseup', fastCheck);\n\t window.removeEventListener('keyup', fastCheck);\n\t window.removeEventListener('mousedown', fastCheck);\n\t window.removeEventListener('keydown', fastCheck);\n\t }\n\t else {\n\t document.documentElement.detachEvent('onmouseup', fastCheck);\n\t document.documentElement.detachEvent('onkeyup', fastCheck);\n\t document.documentElement.detachEvent('onmousedown', fastCheck);\n\t document.documentElement.detachEvent('onkeydown', fastCheck);\n\t }\n\t }\n\t };\n\t mirror.observers.push(new ObserverInfo(callback, observer));\n\t return observer;\n\t }", "function observe(obj, callback) {\n\t var patches = [];\n\t var root = obj;\n\t var observer;\n\t var mirror = getMirror(obj);\n\t if (!mirror) {\n\t mirror = new Mirror(obj);\n\t beforeDict.push(mirror);\n\t }\n\t else {\n\t observer = getObserverFromMirror(mirror, callback);\n\t }\n\t if (observer) {\n\t return observer;\n\t }\n\t observer = {};\n\t mirror.value = deepClone(obj);\n\t if (callback) {\n\t observer.callback = callback;\n\t observer.next = null;\n\t var dirtyCheck = function () {\n\t generate(observer);\n\t };\n\t var fastCheck = function () {\n\t clearTimeout(observer.next);\n\t observer.next = setTimeout(dirtyCheck);\n\t };\n\t if (typeof window !== 'undefined') {\n\t if (window.addEventListener) {\n\t window.addEventListener('mouseup', fastCheck);\n\t window.addEventListener('keyup', fastCheck);\n\t window.addEventListener('mousedown', fastCheck);\n\t window.addEventListener('keydown', fastCheck);\n\t window.addEventListener('change', fastCheck);\n\t }\n\t else {\n\t document.documentElement.attachEvent('onmouseup', fastCheck);\n\t document.documentElement.attachEvent('onkeyup', fastCheck);\n\t document.documentElement.attachEvent('onmousedown', fastCheck);\n\t document.documentElement.attachEvent('onkeydown', fastCheck);\n\t document.documentElement.attachEvent('onchange', fastCheck);\n\t }\n\t }\n\t }\n\t observer.patches = patches;\n\t observer.object = obj;\n\t observer.unobserve = function () {\n\t generate(observer);\n\t clearTimeout(observer.next);\n\t removeObserverFromMirror(mirror, observer);\n\t if (typeof window !== 'undefined') {\n\t if (window.removeEventListener) {\n\t window.removeEventListener('mouseup', fastCheck);\n\t window.removeEventListener('keyup', fastCheck);\n\t window.removeEventListener('mousedown', fastCheck);\n\t window.removeEventListener('keydown', fastCheck);\n\t }\n\t else {\n\t document.documentElement.detachEvent('onmouseup', fastCheck);\n\t document.documentElement.detachEvent('onkeyup', fastCheck);\n\t document.documentElement.detachEvent('onmousedown', fastCheck);\n\t document.documentElement.detachEvent('onkeydown', fastCheck);\n\t }\n\t }\n\t };\n\t mirror.observers.push(new ObserverInfo(callback, observer));\n\t return observer;\n\t }", "function observe(obj, callback) {\r\n var patches = [];\r\n var root = obj;\r\n var observer;\r\n var mirror = getMirror(obj);\r\n if (!mirror) {\r\n mirror = new Mirror(obj);\r\n beforeDict.push(mirror);\r\n }\r\n else {\r\n observer = getObserverFromMirror(mirror, callback);\r\n }\r\n if (observer) {\r\n return observer;\r\n }\r\n observer = {};\r\n mirror.value = helpers_1._deepClone(obj);\r\n if (callback) {\r\n observer.callback = callback;\r\n observer.next = null;\r\n var dirtyCheck = function () {\r\n generate(observer);\r\n };\r\n var fastCheck = function () {\r\n clearTimeout(observer.next);\r\n observer.next = setTimeout(dirtyCheck);\r\n };\r\n if (typeof window !== 'undefined') {\r\n if (window.addEventListener) {\r\n window.addEventListener('mouseup', fastCheck);\r\n window.addEventListener('keyup', fastCheck);\r\n window.addEventListener('mousedown', fastCheck);\r\n window.addEventListener('keydown', fastCheck);\r\n window.addEventListener('change', fastCheck);\r\n }\r\n else {\r\n document.documentElement.attachEvent('onmouseup', fastCheck);\r\n document.documentElement.attachEvent('onkeyup', fastCheck);\r\n document.documentElement.attachEvent('onmousedown', fastCheck);\r\n document.documentElement.attachEvent('onkeydown', fastCheck);\r\n document.documentElement.attachEvent('onchange', fastCheck);\r\n }\r\n }\r\n }\r\n observer.patches = patches;\r\n observer.object = obj;\r\n observer.unobserve = function () {\r\n generate(observer);\r\n clearTimeout(observer.next);\r\n removeObserverFromMirror(mirror, observer);\r\n if (typeof window !== 'undefined') {\r\n if (window.removeEventListener) {\r\n window.removeEventListener('mouseup', fastCheck);\r\n window.removeEventListener('keyup', fastCheck);\r\n window.removeEventListener('mousedown', fastCheck);\r\n window.removeEventListener('keydown', fastCheck);\r\n }\r\n else {\r\n document.documentElement.detachEvent('onmouseup', fastCheck);\r\n document.documentElement.detachEvent('onkeyup', fastCheck);\r\n document.documentElement.detachEvent('onmousedown', fastCheck);\r\n document.documentElement.detachEvent('onkeydown', fastCheck);\r\n }\r\n }\r\n };\r\n mirror.observers.push(new ObserverInfo(callback, observer));\r\n return observer;\r\n}", "function Observable() {\n\t/**\n\t * Lista di osservatori che richiedono di essere notificati ad un cambiamento di stato.\n\t * @type {Array.<Observer>}\n\t * @private\n\t */\n\tthis.observers = [];\n\n}", "function observe(obj, callback) {\n var patches = [];\n var root = obj;\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.push(mirror);\n }\n else {\n observer = getObserverFromMirror(mirror, callback);\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = deepClone(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var dirtyCheck = function () {\n generate(observer);\n };\n var fastCheck = function () {\n clearTimeout(observer.next);\n observer.next = setTimeout(dirtyCheck);\n };\n if (typeof window !== 'undefined') {\n if (window.addEventListener) {\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keyup', fastCheck);\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('keydown', fastCheck);\n window.addEventListener('change', fastCheck);\n }\n else {\n document.documentElement.attachEvent('onmouseup', fastCheck);\n document.documentElement.attachEvent('onkeyup', fastCheck);\n document.documentElement.attachEvent('onmousedown', fastCheck);\n document.documentElement.attachEvent('onkeydown', fastCheck);\n document.documentElement.attachEvent('onchange', fastCheck);\n }\n }\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n if (window.removeEventListener) {\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keyup', fastCheck);\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n }\n else {\n document.documentElement.detachEvent('onmouseup', fastCheck);\n document.documentElement.detachEvent('onkeyup', fastCheck);\n document.documentElement.detachEvent('onmousedown', fastCheck);\n document.documentElement.detachEvent('onkeydown', fastCheck);\n }\n }\n };\n mirror.observers.push(new ObserverInfo(callback, observer));\n return observer;\n }", "function EventObserver() {\n this.observers = [];\n}", "function Observer() {\n if (this === undefined) {\n return new Observer();\n }\n this.observers = [];\n}", "function Observer(value) {\n\t\t this.value = value;\n\t\t this.dep = new Dep();\n\t\t this.vmCount = 0;\n\t\t def(value, '__ob__', this);\n\t\t if (Array.isArray(value)) {\n\t\t var augment = hasProto ? protoAugment : copyAugment;\n\t\t augment(value, arrayMethods, arrayKeys);\n\t\t this.observeArray(value);\n\t\t } else {\n\t\t this.walk(value);\n\t\t }\n\t\t }", "function TestObserver() {\n\n\tthis.isUpdated = false;\n\n\tthis.isInstanceOf = this.isInstanceOf || function(fnc) {return fnc === app.IObserver;};\n\n\tthis.update = function() {this.isUpdated = true;};\n}", "constructor(observer) {\n this.observer = observer;\n }", "function observe(obj) {\n // 判断类型\n if (!obj || typeof obj !== 'object') {\n return\n }\n\n Object.keys(obj).forEach(key => {\n defineReactive(obj, key, obj[key])\n })\n}", "processEvent(obj,changes) {\n var id = new ID(Object.keys(obj)[0],Object.values(obj)[0]);\n this.log(\"processing changes on \"+id);\n if ( this.scene.has(id.toString())) {\n var object = this.scene.get(id.toString());\n Object.assign(object,changes);\n // TODO: route event to mesh/script\n // TODO: notify listeners\n object.notifyListeners(changes);\n } else {\n this.log(\"Unknown object \"+id);\n }\n }", "function Observer(value) {\n this.value = value;\n this.dep = new Dep();\n this.vmCount = 0;\n def(value, '__ob__', this);\n if (Array.isArray(value)) {\n var augment = hasProto ? protoAugment : copyAugment;\n augment(value, arrayMethods, arrayKeys);\n this.observeArray(value);\n } else {\n this.walk(value);\n }\n }", "function getObservedObject(observer, object, arrayObserve) {\n var dir = observedObjectCache.pop() || newObservedObject();\n dir.open(observer);\n dir.observe(object, arrayObserve);\n return dir;\n }", "function observer(value) {\n let ob = null;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (Array.isArray(value) || isObject(value)) {\n ob = new Observer(value);\n }\n return ob;\n }", "addObserver(observer){\n\n if(observer instanceof Observer){\n\n this.observers.push(observer);\n }\n }", "function observe(value) {\n\t\t if (!isObject(value)) {\n\t\t return;\n\t\t }\n\t\t var ob = void 0;\n\t\t if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n\t\t ob = value.__ob__;\n\t\t } else if (observerState.shouldConvert && !config._isServer && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {\n\t\t ob = new Observer(value);\n\t\t }\n\t\t return ob;\n\t\t}", "function AbstractObserver() {\n\t this.isStopped = false;\n\t __super__.call(this);\n\t }", "function AbstractObserver() {\n\t this.isStopped = false;\n\t __super__.call(this);\n\t }", "function AbstractObserver() {\n\t this.isStopped = false;\n\t __super__.call(this);\n\t }", "function observe (value) {\n\t if (!isObject(value)) {\n\t return\n\t }\n\t var ob\n\t if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n\t ob = value.__ob__\n\t } else if (\n\t observerState.shouldConvert &&\n\t !config._isServer &&\n\t (Array.isArray(value) || isPlainObject(value)) &&\n\t Object.isExtensible(value) &&\n\t !value._isVue\n\t ) {\n\t ob = new Observer(value)\n\t }\n\t return ob\n\t}", "function cam_eventObjectTransfer(obj, from)\n{\n\tif (from === CAM_HUMAN_PLAYER && obj.player === NEXUS && __camNexusActivated === true)\n\t{\n\t\tvar snd;\n\t\tif (obj.type === STRUCTURE)\n\t\t{\n\t\t\tif (obj.stattype === DEFENSE)\n\t\t\t{\n\t\t\t\tsnd = DEFENSE_ABSORBED;\n\t\t\t}\n\t\t\telse if (obj.stattype === RESEARCH_LAB)\n\t\t\t{\n\t\t\t\tsnd = RES_ABSORBED;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tsnd = STRUCTURE_ABSORBED;\n\t\t\t}\n\n\t\t\tif (obj.stattype === FACTORY ||\n\t\t\t\tobj.stattype === CYBORG_FACTORY ||\n\t\t\t\tobj.stattype === VTOL_FACTORY)\n\t\t\t{\n\t\t\t\t//TODO: add to the factory list.\n\t\t\t}\n\t\t}\n\t\telse if (obj.type === DROID)\n\t\t{\n\t\t\tsnd = UNIT_ABSORBED;\n\t\t}\n\n\t\tif (camDef(snd))\n\t\t{\n\t\t\tplaySound(snd);\n\t\t}\n\t\tqueue(\"camNexusLaugh\", camSecondsToMilliseconds(1.5));\n\t}\n}", "function observe (value) {\n\t if (!isObject(value)) {\n\t return\n\t }\n\t var ob;\n\t if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n\t ob = value.__ob__;\n\t } else if (\n\t observerState.shouldConvert &&\n\t !config._isServer &&\n\t (Array.isArray(value) || isPlainObject(value)) &&\n\t Object.isExtensible(value) &&\n\t !value._isVue\n\t ) {\n\t ob = new Observer(value);\n\t }\n\t return ob\n\t}", "function observe (value) {\n\t if (!isObject(value)) {\n\t return\n\t }\n\t var ob;\n\t if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n\t ob = value.__ob__;\n\t } else if (\n\t observerState.shouldConvert &&\n\t !config._isServer &&\n\t (Array.isArray(value) || isPlainObject(value)) &&\n\t Object.isExtensible(value) &&\n\t !value._isVue\n\t ) {\n\t ob = new Observer(value);\n\t }\n\t return ob\n\t}", "function mutationObserver(obj,func,parms) {\n\treturn (new MutationObserver(func)).observe(obj,parms);\n}", "onObjectChange(id, obj) {\n if (obj) {\n // The object was changed\n this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`);\n }\n else {\n // The object was deleted\n this.log.info(`object ${id} deleted`);\n }\n }", "onObjectChange(id, obj) {\n if (obj) {\n // The object was changed\n this.log.info(`object ${id} changed: ${JSON.stringify(obj)}`);\n }\n else {\n // The object was deleted\n this.log.info(`object ${id} deleted`);\n }\n }", "observe() {\n if (this.observer === null) {\n this.observer = new MutationObserver(this.handleEvent.bind(this));\n }\n\n this.observer.observe(this.target, this.options);\n }", "function getObservedObject(observer, object, arrayObserve) {\n var dir = observedObjectCache.pop() || newObservedObject();\n dir.open(observer);\n dir.observe(object, arrayObserve);\n return dir;\n }", "function getObservedObject(observer, object, arrayObserve) {\n var dir = observedObjectCache.pop() || newObservedObject();\n dir.open(observer);\n dir.observe(object, arrayObserve);\n return dir;\n }", "function getObservedObject(observer, object, arrayObserve) {\n var dir = observedObjectCache.pop() || newObservedObject();\n dir.open(observer);\n dir.observe(object, arrayObserve);\n return dir;\n }", "function getObservedObject(observer, object, arrayObserve) {\n var dir = observedObjectCache.pop() || newObservedObject();\n dir.open(observer);\n dir.observe(object, arrayObserve);\n return dir;\n }", "function getObservedObject(observer, object, arrayObserve) {\n var dir = observedObjectCache.pop() || newObservedObject();\n dir.open(observer);\n dir.observe(object, arrayObserve);\n return dir;\n }", "function getObservedObject(observer, object, arrayObserve) {\n var dir = observedObjectCache.pop() || newObservedObject();\n dir.open(observer);\n dir.observe(object, arrayObserve);\n return dir;\n }", "function getObservedObject(observer, object, arrayObserve) {\n var dir = observedObjectCache.pop() || newObservedObject();\n dir.open(observer);\n dir.observe(object, arrayObserve);\n return dir;\n }", "function observeObjects(objects, timestamp) {\n if (objects) {\n objects.features.forEach(f => {\n XVIZObject.observe(f.id, timestamp);\n });\n }\n}", "notifyObservers(){}", "notifyObservers(){}", "notifyObservers(){}", "function observe (value) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !isServerRendering() &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n return ob\n}", "function Observable()\n{\n\t// list of observers\n\tObject.defineProperty( this, '_observers', {\n\t\tvalue : new Array(),\n\t\tenumerable : false, // property is not enumerable, so it won't appear in JSON\n\t\twritable : false, // can't be replaced with another object, but array can still be changed\n\t\tconfigurable : false, // can't be deleted\n\t});\n}", "listen (observable, callback) {\n observable.addObserver(this);\n // la vue devient un observer\n this.update = callback;\n }", "createObservers() {\n // NOTE: We need to wait for Google to bring Proxy to V8\n // if (this.targetElement.__scripts__) {\n // this.scriptsObserver = new MutationObserver((changes) => { this.scriptsObserver(changes) });\n // this.scriptsObserver.observe(this.targetElement.__scripts__, {\n // attributes: true\n // }); \n // }\n\n // this.domObserver = new MutationObserver((changes) => { this.attributesObserver(changes) });\n // this.domObserver.observe(this.targetElement, {\n // attributes: true\n // });\n }", "function AbstractObserver() {\n\t this.isStopped = false;\n\t }", "function AbstractObserver() {\n\t this.isStopped = false;\n\t }", "function AbstractObserver() {\n this.isStopped = false;\n __super__.call(this);\n }", "function AbstractObserver() {\n this.isStopped = false;\n __super__.call(this);\n }", "function observe(value) {\n if (!isObject(value)) {\n return;\n }\n var ob = void 0;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (observerState.shouldConvert && !config._isServer && (Array.isArray(value) || isPlainObject(value)) && Object.isExtensible(value) && !value._isVue) {\n ob = new Observer(value);\n }\n return ob;\n}", "function observe (value) {\n if (!isObject(value)) {\n return\n }\n var ob;\n if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {\n ob = value.__ob__;\n } else if (\n observerState.shouldConvert &&\n !config._isServer &&\n (Array.isArray(value) || isPlainObject(value)) &&\n Object.isExtensible(value) &&\n !value._isVue\n ) {\n ob = new Observer(value);\n }\n return ob\n}", "observe(obj) {\n let updateChart = this.updateChart;\n return new Proxy(obj, {\n set: (target, prop, val) => {\n // @ts-ignore\n target[prop] = val;\n Promise.resolve().then(updateChart);\n return true;\n }\n });\n }", "function isObservable(t) {\n return (typeof t === 'object' &&\n typeof t.addObserver === 'function' &&\n typeof t.removeObserver === 'function');\n }", "_activityObjectsEventHandler() {\r\n // CLASS REFERENCE\r\n let that = this;\r\n\r\n //For objectbar\r\n d3.select('.nav-link.object-toggle').on('click', function () {\r\n (d3.select('#objectbar').classed('active') == true) ?\r\n d3.select('#objectbar').classed('active', false) :\r\n d3.select('#objectbar').classed('active', true);\r\n })\r\n\r\n //For activitybar\r\n d3.select('.nav-link.object-toggle1').on('click', function () {\r\n (d3.select('#activitybar').classed('active') == true) ?\r\n d3.select('#activitybar').classed('active', false) :\r\n d3.select('#activitybar').classed('active', true);\r\n })\r\n\r\n //For Print\r\n d3.select('#print').on('click', function () {\r\n window.print();\r\n })\r\n\r\n\r\n d3.selectAll('.object-item').on('click', function () {\r\n let src = d3.select(this).attr('data-src');\r\n let objectName = d3.select(this).attr('data-name');\r\n console.log('title',objectName,d3.select(this));\r\n\r\n let size = {width: 70, height: 70}\r\n let position = Utility.centerOfCanvas(that.canvasSize, size.width, size.height);\r\n\r\n let data = {\r\n src: src,\r\n width: size.width,\r\n height: size.height,\r\n x: position.x,\r\n y: position.y\r\n };\r\n\r\n let object = new Object({\r\n layer: that.canvas,\r\n data: data,\r\n objectName: objectName,\r\n attribute: that.attribute\r\n });\r\n\r\n })\r\n }", "function Observable() {\n this.listeners = {};\n }", "function ObserverList() {\n\t\treturn {\n\t\t\tobserverList: [],\n\t\t\tadd: function(obj) {\n\t\t\t\treturn this.observerList.push(obj);\n\t\t\t},\n\t\t\tcount: function() {\n\t\t\t\treturn this.observerList.length;\n\t\t\t},\n\t\t\tget: function(index) {\n\t\t\t\tif (index > -1 && index < this.observerList.length) {\n\t\t\t\t\treturn this.observerList[index];\n\t\t\t\t}\n\t\t\t},\n\t\t\tindexOf: function(obj, startIndex) {\n\t\t\t\tvar i = startIndex;\n\t\t\t\twhile (i < this.observerList.length) {\n\t\t\t\t\tif (this.observerList[i] === obj) {\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t}\n\n\t\t\t\treturn -1;\n\t\t\t},\n\t\t\tremoveAt: function(index) {\n\t\t\t\tif (index > -1 && index < this.observerList.length) {\n\t\t\t\t\tthis.observerList.splice(index, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}", "setSourceObject(object) {\n\n if (this.sourceDOMObject != null) {\n this.sourceDOMObject.removeEventListener('mousedown', this._mouseDownHandle);\n this.sourceDOMObject.removeEventListener('mouseup', this._mouseUpHandle);\n this.sourceDOMObject.removeEventListener('mousemove', this._mouseMoveHandle);\n this.sourceDOMObject.removeEventListener('mouseleave', this._mouseLeave);\n this.sourceDOMObject.removeEventListener('wheel', this._wheelHandle);\n // Do not open menu after left clicking\n this.sourceDOMObject.removeEventListener('contextmenu', this._contexMenuHandle);\n }\n\n this.sourceDOMObject = object;\n\n // Setup mouse event listeners\n this.sourceDOMObject.addEventListener(\"mousedown\", this._mouseDownHandle);\n this.sourceDOMObject.addEventListener(\"mouseup\", this._mouseUpHandle);\n this.sourceDOMObject.addEventListener('mousemove', this._mouseMoveHandle);\n this.sourceDOMObject.addEventListener('mouseleave', this._mouseLeave);\n this.sourceDOMObject.addEventListener('wheel', this._wheelHandle);\n // Do not open menu after left clicking\n this.sourceDOMObject.addEventListener('contextmenu', this._contexMenuHandle);\n }", "function isObserver(t) {\n return (typeof t === 'object' &&\n typeof t.onNext === 'function' &&\n typeof t.onError === 'function' &&\n typeof t.onCompleted === 'function');\n }", "function Obj() {\n\tevents.EventEmitter.call(this);\n\tthis._data = {}; // Stores data\n\tthis._virtuals = {}; // Stores virtuals\n\tthis._type = {}; // Stores data types\n}", "bind(source) {\n const name = this.options.property;\n this.shouldUpdate = Observable.getAccessors(source).some(x => x.name === name);\n this.source = source;\n this.updateTarget(this.computeNodes());\n\n if (this.shouldUpdate) {\n this.observe();\n }\n }", "observe(obj, callback) {\n return new Proxy(obj, {\n set: function (target, prop, value) {\n target[prop] = value;\n callback();\n return true;\n }\n })\n }", "getObserver(observer){\n\n if(observer instanceof Observer === false){\n\n return null;\n }\n\n this.observers.forEach(function(item){\n\n if(item === observer){\n\n return item;\n }\n });\n\n return null;\n }", "function AbstractObserver() {\n this.isStopped = false;\n }", "function AbstractObserver() {\n this.isStopped = false;\n }", "function AbstractObserver() {\n this.isStopped = false;\n }", "function AbstractObserver() {\n this.isStopped = false;\n }", "function AbstractObserver() {\n this.isStopped = false;\n }", "function AbstractObserver() {\n this.isStopped = false;\n }", "function observe(value,asRootData){if(!isObject(value)){return;}var ob;if(hasOwn(value,'__ob__')&&value.__ob__ instanceof Observer){ob=value.__ob__;}else if(observerState.shouldConvert&&!isServerRendering()&&(Array.isArray(value)||isPlainObject(value))&&Object.isExtensible(value)&&!value._isVue){ob=new Observer(value);}if(asRootData&&ob){ob.vmCount++;}return ob;}", "function Subject(){\n this.observers = new ObserverList();\n}", "function VariableObserver()\n\t{\n\t\t/**\n\t\t\tPrivate Variables \n\t\t*/\n\n\t\t/** private variable to hold the values of the set variables. The benefit to this method \n\t\t is that the variables cannot be accessed any other way */\n\t\tvar properties = {};\n\n\t\t/** the current parameter being worked on, for chaining */\n\t\tvar cur_param = null;\n\n\t\t/** variable to refer to self */\n\t\tvar self = this;\n\t\t\n\t\t/** forbidden variable names */\n\t\tvar forbidden = ['debug', 'prototype', 'hasOwnProperty', 'constructor', 'propertyIsEnumerable'];\n\n\t\t/**\n\t\t\tPublic Variables \n\t\t*/\n\n\t\t/** determine whether debug messages should be printed to the console */\n\t\tthis.debug = false;\n\n\t\t/**\n\t\t*\tA helper function to determine whether to chain or not\n\t\t*\t@param {string} p - the parameter name to check\n\t\t*/\n\t\tvar check = function(p)\n\t\t{\n\t\t\tcur_param = (typeof(p) !== 'undefined' &&\n\t\t\t\ttypeof(p) === 'string' &&\n\t\t\t\tproperties.hasOwnProperty(p)) ? p : cur_param;\n\t\t\tif(cur_param == null) throw 'PARAM_MISSING : A variable name must be entered or chained to silence it';\n\t\t\treturn true;\n\t\t}\n\n\t\t/**\n\t\t*\tEnds the chain\n\t\t*/\n\t\tthis.end = function()\n\t\t{\n\t\t\tcur_param = null;\n\t\t\treturn self;\n\t\t}\n\n\t\t/**\n\t\t*\tAdd a new variable to the watcher bank\n\t\t*\t@param {string} param - the parameter name to add\n\t\t*\t@param {string} [initialValue] - the starting value of the variable\n\t\t* @param {requestCallback} [onChange] - the function to call when the variable is changed\n\t\t*/\n\t\tthis.add = function(param, initialValue, onChange)\n\t\t{\n\t\t\tif(typeof(param) != 'string' || forbidden.indexOf(param) > -1) \n\t\t\t\tthrow 'ADD_ERROR: Invalid variable name';\n\t\t\t\n\t\t\tcur_param = param;\n\t\t\t\t\t\t\n\t\t\tif (this.hasOwnProperty(param))\tdelete this[param];\n\t\t\tproperties[param] = \n\t\t\t{\n\t\t\t\tstored: initialValue,\n\t\t\t\tonchange: ((typeof(onChange) == 'function') ? onChange : function () {}),\n\t\t\t\tonget: function () {},\n\t\t\t\tlocked: false\n\t\t\t}\n\n\t\t\tObject.defineProperty(this, param,\n\t\t\t{\n\t\t\t\tget: function()\n\t\t\t\t{\n\t\t\t\t\tproperties[param].onget();\n\t\t\t\t\treturn properties[param].stored;\n\t\t\t\t},\n\t\t\t\tset: function(value)\n\t\t\t\t{\n\t\t\t\t\tif (!properties[param].locked)\n\t\t\t\t\t{\n\t\t\t\t\t\tproperties[param].onchange(value, properties[param].stored);\n\t\t\t\t\t\tproperties[param].stored = value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn self;\n\t\t}\n\t\t\n\t\t/**\n\t\t*\tSilence the onGet and onChange listeners for a particular variable. \n\t\t*\t@param {string} [param] - the parameter name to silence\n\t\t*/\n\t\tthis.silence = function(param)\n\t\t{\n\t\t\tcheck(param);\n\t\t\tproperties[cur_param].onGet = function() {};\n\t\t\tproperties[cur_param].onChange = function() {};\n\t\t\tif(this.debug) console.debug('VariableObserver','silenced',cur_param);\n\t\t\treturn self;\n\t\t}\n\n\t\t/**\n\t\t*\tLock a variable from being changed. Setting a locked variable value will have no effect\n\t\t*\t@param {string} [param] - the parameter name to lock\n\t\t*/\n\t\tthis.lock = function(param)\n\t\t{\n\t\t\tcheck(param);\n\t\t\tproperties[cur_param].locked = true;\n\t\t\tif(this.debug) console.debug('VariableObserver','locked',cur_param);\n\t\t\treturn self;\n\t\t}\n\n\t\t/**\n\t\t*\tToggle a variable's lock state from being changed\n\t\t*\t@param {string} [param] - the parameter name to toggle\n\t\t*/\n\t\tthis.toggle = function(param)\n\t\t{\n\t\t\tcheck(param);\n\t\t\tproperties[cur_param].locked = !properties[cur_param].locked;\n\t\t\tif(this.debug) console.debug('VariableObserver',((properties[cur_param].locked)? 'locked' : 'unlocked'),cur_param);\n\t\t\treturn self;\n\t\t}\n\t\t\n\t\t/**\n\t\t*\tUnlock a variable's lock state\n\t\t*\t@param {string} [param] - the parameter name to unlock\n\t\t*/\n\t\tthis.unlock = function(param)\n\t\t{\n\t\t\tcheck(param);\n\t\t\tproperties[cur_param].locked = false;\n\t\t\tif(this.debug) console.debug('VariableObserver','unlocked',cur_param);\n\t\t\treturn self;\n\t\t}\n\n\t\t/**\n\t\t*\tAttach a listener for the variable onChange\n\t\t*\t@param {string} [param] - the parameter name to set\n\t\t* @param {requestCallback} onChange - the function to call when the variable is changed\n\t\t*/\n\t\tthis.onchange = function(param, onChange)\n\t\t{\t\t\t\n\t\t\tif(this.debug) console.debug('VariableObserver','addlistener onchange',cur_param);\n\t\t\treturn this.addListener('onchange',param,onChange);\n\t\t}\n\n\t\t/**\n\t\t*\tAttach a listener for the variable onGet\n\t\t*\t@param {string} [param] - the parameter name to set\n\t\t* @param {requestCallback} onChange - the function to call when the variable is retrieved\n\t\t*/\n\t\tthis.onget = function(param, onGet)\n\t\t{\t\t\n\t\t\tif(this.debug) console.debug('VariableObserver','addlistener onget',cur_param);\n\t\t\treturn this.addListener('onget',param,onGet);\n\t\t}\n\n\t\t/**\n\t\t*\tAttach a listener to the properties\n\t\t*\t@param {string} callCase - whether to set the onget or the onchange\n\t\t*\t@param {string} param - the parameter name\n\t\t* @param {requestCallback} listener - the function to call when the variable is changed\n\t\t*/\n\t\tthis.addListener = function(callCase, param, listener)\n\t\t{\n\t\t\tswitch(typeof(param)) \n\t\t\t{\n\t\t\t\tcase 'function':\n\t\t\t\t\tcheck(cur_param);\n\t\t\t\t\tlistener = param; \n\t\t\t\tbreak;\n\t\t\t\tcase 'string':\n\t\t\t\t\tcheck(param);\n\t\t\t\t\tlistener = (typeof(listener) == 'function') ? listener : null;\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow 'LISTENER_ERROR : Improperly defined listener requested';\n\t\t\t}\n\t\t\t\n\t\t\tif(!listener) throw 'LISTENER_ERROR : The listener was not properly defined';\n\t\t\t\n\t\t\tproperties[cur_param][callCase] = listener;\n\t\t\t\n\t\t\treturn self;\n\t\t}\n\t\t\n\t\t/**\n\t\t*\tSelect a variable for the purposes of chaining\n\t\t*\t@param {string} [param] - the parameter name to chain\n\t\t*/\n\t\tthis.select = function(param)\n\t\t{\n\t\t\tif (typeof(param) != 'string' && !properties.hasOwnProperty(param)) \n\t\t\t\tthrow 'SELECT_ERROR : A proper parameter must be identified to select';\n\t\t\tcur_param = param;\n\t\t\treturn self;\n\t\t}\n\t}", "function ProgressObserver() {\n this.started = false;\n this.observing = {};\n}", "async notifyObservers(event, observers = this._observers) {\n if (!observers || observers.size === 0)\n return;\n const { type, binding, context } = event;\n for (const observer of observers) {\n if (typeof observer === 'function') {\n await observer(type, binding, context);\n }\n else if (!observer.filter || observer.filter(binding)) {\n await observer.observe(type, binding, context);\n }\n }\n }", "function Observable(updateUrl) {\n\tthis.data = null;\n\tthis.observers = [];\n\tthis.updateUrl = updateUrl;\n\n\tthis.notify = function (){\n\t\tfor (var i = 0; i < this.observers.length; i++) {\n\t\t\tthis.observers[i].onChange(this, this.data);\n\t\t}\n\t};\n\tthis.subscribe = function (observer) {\n \tthis.observers.push(observer);\n\t};\n\n\tthis.update = function () {\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: this.updateUrl,\n\t\t\tcomplete: $.proxy(function (msg, status) {\n\t\t\t\ttry {\n\t\t\t\t\tif (status == \"success\") {\n\t\t\t\t\t\tvar res = $.parseJSON(msg.responseText);\n\t\t\t\t\t\tthis.data = res;\n\t\t\t\t\t\tthis.notify();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow \"Bad response: status= \" + status;\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\talert(\"Si e' verificato un errore durante la richiesta della lista giocatori. [\" + err + \"]\");\n\t\t\t\t}\n\n\t\t\t}, this)\n\t\t});\n\t};\n\n}", "function ObserverList(){\n this.observerList = [];\n}", "function detectObjectObserve() {\n if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') {\n return false;\n }\n\n var records = [];\n\n function callback(recs) {\n records = recs;\n }\n\n var test = {};\n var arr = [];\n Object.observe(test, callback);\n Array.observe(arr, callback);\n test.id = 1;\n test.id = 2;\n delete test.id;\n arr.push(1, 2);\n arr.length = 0;\n\n Object.deliverChangeRecords(callback);\n if (records.length !== 5) return false;\n\n if (records[0].type != 'add' || records[1].type != 'update' || records[2].type != 'delete' || records[3].type != 'splice' || records[4].type != 'splice') {\n return false;\n }\n\n Object.unobserve(test, callback);\n Array.unobserve(arr, callback);\n\n return true;\n }", "onObjectAdded(obj) {\n // obj._roomName = obj._roomName || this.DEFAULT_ROOM_NAME;\n /* this.networkTransmitter.addNetworkedEvent('objectCreate', {\n stepCount: this.gameEngine.world.stepCount,\n objectInstance: obj\n });*/\n\n if (this.options.updateOnObjectCreation) ;\n }", "function $listener(args)\n{\n\tvar thisPtr=this;\n\tthis.inlet1=new this.inletClass(\"inlet1\",this,\"event types to listen for\");\n\tthis.outlet1=new this.outletClass(\"outlet1\",this,\"list \\\"[event type] [object id]\\\"\");\t\n\t\n\tvar argsArr=(args)?args.split(\" \"):[];\n\tvar groups=argsArr.shift();\t//if null this will get all objects in the patch\n\tvar oArr=[];\n\tvar listeners=[];\n\t\n\t//create the array of objects with this group name\n\tfunction initObjectArray() {\n\t\toArr=thisPtr.parent.patchModel.getObjectsByGroupName(groups);\t\t\t\t\n\t}\n\t\n\tfunction initEventListeners() {\n\t\tif(argsArr && argsArr.length) {\n\t\t\tfor(var i=0;i<oArr.length;i++) {\n\t\t\t\tfor(var j=0;j<argsArr.length;j++) {\n\t\t\t\t\tif(listeners.indexOf(oArr[i].objID+\"_\"+argsArr[j])==-1) {\t\n\t\t\t\t\t\tthisPtr.controller.patchController.attachObserver(oArr[i].objID,argsArr[j],function(id,mess){return function(){thisPtr.outlet1.doOutlet(mess+\" \"+id)}}(oArr[i].objID,argsArr[j]),\"performance\");\n\t\t\t\t\t\tlisteners.push(oArr[i].objID+\"_\"+argsArr[j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}\n\t\t\n\t//add a listener\n\tthis.inlet1[\"anything\"]=function(msg) {\n\t\t\t\t\n\t\tfor(var i=0;i<oArr.length;i++) {\t\t\n\t\t\tif(listeners.indexOf(oArr[i].objID+\"_\"+msg)==-1) {\n\t\t\t\tthisPtr.controller.patchController.attachObserver(oArr[i].objID,msg,function(id,mess){return function(){thisPtr.outlet1.doOutlet(mess+\" \"+id)}}(oArr[i].objID,msg),\"performance\")\n\t\t\t\tlisteners.push(oArr[i].objID+\"_\"+msg);\n\t\t\t}\n\t\t}\t\t\t\t\t\t\n\t}\t\n\t\n\tthis.inlet1[\"init\"]=function() {\n\t\tinitObjectArray();\n\t\tinitEventListeners();\t\n\t}\n\n\t//init list\n\tinitObjectArray();\n\tinitEventListeners();\n\t\n\t//register for patch Modified event so we can rebuild the list of broadcast receivers\n\tthisPtr.controller.patchController.attachPatchObserver(thisPtr.objID,\"patchModified\",function(){initObjectArray();initEventListeners();},\"edit\");\n\t\n\treturn this;\n}", "function installObserver(target, property) {\n var observersMap = new Map();\n if (!allTargetObservers.has(target)) {\n allTargetObservers.set(target, {\n isEnabled: true,\n getObservers: function (key) {\n var observers = observersMap.get(key) || [];\n if (!observersMap.has(key)) {\n observersMap.set(key, observers);\n }\n return observers;\n },\n installedProperties: new Set()\n });\n }\n var targetObservers = allTargetObservers.get(target);\n if (targetObservers.installedProperties.has(property)) {\n // The getter/setter has already been replaced for this property\n return targetObservers;\n }\n // Retrieve (or create if it's a plain property) the original descriptor from\n // the target...\n var descriptor = getDescriptor(target, property) || {\n configurable: true,\n enumerable: true,\n value: target[property],\n writable: true\n };\n // ...and create a copy that will be used for the observer.\n var observedDescriptor = __assign({}, descriptor);\n var descGet = descriptor.get, descSet = descriptor.set;\n if ('value' in descriptor) {\n // The descriptor is a simple value (not a getter/setter).\n // For our observer descriptor that we copied, delete the value/writable\n // properties, since they are incompatible with the get/set properties\n // for descriptors.\n delete observedDescriptor.value;\n delete observedDescriptor.writable;\n // Set up a simple getter...\n var value_1 = descriptor.value;\n descGet = function () { return value_1; };\n // ...and setter (if the original property was writable).\n if (descriptor.writable) {\n descSet = function (newValue) {\n value_1 = newValue;\n };\n }\n }\n if (descGet) {\n observedDescriptor.get = function () {\n // `this as T` needed for closure conformance\n return descGet.call(this);\n };\n }\n if (descSet) {\n observedDescriptor.set = function (newValue) {\n var e_4, _a;\n // `thus as T` needed for closure conformance\n var previous = descGet ? descGet.call(this) : newValue;\n descSet.call(this, newValue);\n if (targetObservers.isEnabled && (!descGet || newValue !== previous)) {\n try {\n for (var _b = __values(targetObservers.getObservers(property)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer(newValue, previous);\n }\n }\n catch (e_4_1) { e_4 = { error: e_4_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_4) throw e_4.error; }\n }\n }\n };\n }\n targetObservers.installedProperties.add(property);\n Object.defineProperty(target, property, observedDescriptor);\n return targetObservers;\n }", "function setupObserver(observer) {\n if (typeof observer !== 'object') {\n return;\n }\n\n var evt,\n evtObj,\n selector;\n\n //It is recommended not to define anonymous functions in a loop\n //that's why we better define a callback builder to be use in the loop\n function callback(fn) {\n return function () {\n fn.apply(this, arguments);\n };\n }\n\n for (evt in observer) {\n if (observer.hasOwnProperty(evt)) {\n evtObj = observer[evt];\n if (typeof evtObj !== 'object') {\n console.warn('Invalid observer object in controller!');\n continue;\n }\n for (selector in evtObj) {\n if (evtObj.hasOwnProperty(selector) && $.isFunction(evtObj[selector])) {\n\n //It is recommended not to define anonymous functions in a loop\n $(document).on(evt, selector, callback(evtObj[selector]));\n\n }\n }\n\n }\n }\n }", "function Controller() {\n var subject = new Subject();\n\n this.attachObserver = function attachObserver(observer) {\n subject.attachObserver(observer);\n };\n\n this.detachObserver = function detachObserver(observer) {\n subject.detachObserver(observer);\n };\n\n this.updateObservers = function update(args) {\n if(args === void 0) {\n args = {};\n }\n subject.updateObservers(args);\n };\n}", "function CustomEventObserver() {\n CustomEventObserver.superclass.constructor.apply(this, arguments);\n }", "function sendMoveEvent(object, src) {\n var dst = object.loc;\n _.values(clients).forEach(function (client) {\n var subscribedToSrc = client.subscribedTo.indexOf(src) >= 0;\n var subscribedToDst = client.subscribedTo.indexOf(dst) >= 0;\n \n if (subscribedToSrc && subscribedToDst) {\n client.events.push({type: 'obj_move', obj_id: object.id, x: object.x, y: object.y});\n } else if (subscribedToDst) {\n client.events.push({type: 'obj_ins', obj: object});\n } else if (subscribedToSrc) {\n client.events.push({type: 'obj_del', obj_id: object.id});\n }\n });\n}", "function BaseObservable() {}", "function observer(baseComponent, options) {\r\n // The working of observer is explained step by step in this talk: https://www.youtube.com/watch?v=cPF4iBedoF0&feature=youtu.be&t=1307\r\n if (isUsingStaticRendering()) {\r\n return baseComponent;\r\n }\r\n var realOptions = __assign({ forwardRef: false }, options);\r\n var baseComponentName = baseComponent.displayName || baseComponent.name;\r\n var wrappedComponent = function (props, ref) {\r\n return useObserver(function () { return baseComponent(props, ref); }, baseComponentName);\r\n };\r\n wrappedComponent.displayName = baseComponentName;\r\n // memo; we are not intested in deep updates\r\n // in props; we assume that if deep objects are changed,\r\n // this is in observables, which would have been tracked anyway\r\n var memoComponent;\r\n if (realOptions.forwardRef) {\r\n // we have to use forwardRef here because:\r\n // 1. it cannot go before memo, only after it\r\n // 2. forwardRef converts the function into an actual component, so we can't let the baseComponent do it\r\n // since it wouldn't be a callable function anymore\r\n memoComponent = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"memo\"])(Object(react__WEBPACK_IMPORTED_MODULE_1__[\"forwardRef\"])(wrappedComponent));\r\n }\r\n else {\r\n memoComponent = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"memo\"])(wrappedComponent);\r\n }\r\n copyStaticProperties(baseComponent, memoComponent);\r\n memoComponent.displayName = baseComponentName;\r\n return memoComponent;\r\n}", "function observer(baseComponent, options) {\n // The working of observer is explained step by step in this talk: https://www.youtube.com/watch?v=cPF4iBedoF0&feature=youtu.be&t=1307\n if (isUsingStaticRendering()) {\n return baseComponent;\n }\n var realOptions = __assign({ forwardRef: false }, options);\n var baseComponentName = baseComponent.displayName || baseComponent.name;\n var wrappedComponent = function (props, ref) {\n return useObserver(function () { return baseComponent(props, ref); }, baseComponentName);\n };\n wrappedComponent.displayName = baseComponentName;\n // memo; we are not intested in deep updates\n // in props; we assume that if deep objects are changed,\n // this is in observables, which would have been tracked anyway\n var memoComponent;\n if (realOptions.forwardRef) {\n // we have to use forwardRef here because:\n // 1. it cannot go before memo, only after it\n // 2. forwardRef converts the function into an actual component, so we can't let the baseComponent do it\n // since it wouldn't be a callable function anymore\n memoComponent = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"memo\"])(Object(react__WEBPACK_IMPORTED_MODULE_1__[\"forwardRef\"])(wrappedComponent));\n }\n else {\n memoComponent = Object(react__WEBPACK_IMPORTED_MODULE_1__[\"memo\"])(wrappedComponent);\n }\n copyStaticProperties(baseComponent, memoComponent);\n memoComponent.displayName = baseComponentName;\n return memoComponent;\n}", "observe() {\n if (this.active) return;\n this.observer.observe(this.root, this.options);\n this.active = true;\n }", "function isObservable(object) {\n // Intentionally checking for null.\n if (object === null) {\n return false;\n }\n // Treat all non-object types, including undefined, as non-observable values.\n if (typeof object !== 'object') {\n return false;\n }\n // Early exit if the object is an Array.\n if (isArray(object) === true) {\n return true;\n }\n // Check if the passed object is an existing ReactiveProxy. If it's the case then\n // don't do anything, and return the existing object.\n if (object[REACTIVE_PROXY_TO_OBJECT] !== undefined) {\n return false;\n }\n const proto = getPrototypeOf(object);\n const isPlainObject = proto === null ||\n proto === ObjectPrototype ||\n getPrototypeOf(proto) === null;\n if (isPlainObject === false) {\n return false;\n }\n // Frozen objects are not observable, because they can't be mutated by nature.\n return isFrozen(object) === false;\n}", "function setupObserver (hypeDocument, element, options){\n\t\tvar hypeDocId = hypeDocument.documentId();\n\t\tvar sceneElm = hypeDocument.getCurrentSceneElement();\n\t\tvar observerLookup = _lookup[hypeDocId][sceneElm.id]['Observer'];\n\t\tif (!observerLookup[options.mOiD]) {\n\t\t\tobserverLookup[options.mOiD] = new MutationObserver(function(mutations) {\n\t\t\t\tmutations.forEach(function(mutation) {\n\t\t\t\t\toptions.callback.call(null, hypeDocument, mutation);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t\t/* start monitoring for related changes */\n\t\tobserverLookup[options.mOiD].observe(element, options);\n\t}", "onObjectAdded(obj) {\n console.log('object created event');\n this.networkTransmitter.addNetworkedEvent(\"objectCreate\", {\n stepCount: this.gameEngine.world.stepCount,\n objectInstance: obj\n });\n }", "registerObserver(observer)\n\t{\n\t\tthis.m_Observers.push(observer);\n\t}", "function isObservable$1(object) {\n // Intentionally checking for null.\n if (object === null) {\n return false;\n }\n // Treat all non-object types, including undefined, as non-observable values.\n if (typeof object !== 'object') {\n return false;\n }\n // Early exit if the object is an Array.\n if (isArray$1(object) === true) {\n return true;\n }\n const proto = getPrototypeOf$1(object);\n const isPlainObject = proto === null ||\n proto === ObjectPrototype$1 ||\n getPrototypeOf$1(proto) === null;\n if (isPlainObject === false) {\n return false;\n }\n // Frozen objects are not observable, because they can't be mutated by nature.\n return isFrozen$1(object) === false;\n}", "function Object_Base() {\n\n /**\n * @property subObjects\n * @type gs.Object_Base[]\n * @default []\n * A list of game-objects grouped under this game object.\n */\n var ref;\n this.subObjects = [];\n\n /**\n * @property components\n * @type gs.Component[]\n * @default []\n * A list of components defining the logic/behavior and appearance of the game object.\n */\n this.components = [];\n\n /**\n * @property componentsById\n * @type Object\n * @default []\n * All associated components by their ID.\n */\n this.componentsById = {};\n\n /**\n * @property disposed\n * @type boolean\n * @default false\n * Indicates if the game object id disposed. A disposed game object cannot be used anymore.\n */\n this.disposed = false;\n\n /**\n * @property active\n * @default true\n * Indicates if the game object is active. An inactive game object will not be updated.\n */\n this.active = true;\n this.input = false;\n\n /**\n * @property id\n * @type string\n * @default null\n * The game object's UID (Unique ID)\n */\n this.id = null;\n\n /**\n * @property group\n * @default null\n * @type string\n * The game object's group. To get all object's of a specific group the gs.ObjectManager.objectsByGroup property can be used.\n */\n this.group = null;\n\n /**\n * @property parent\n * @type gs.Object_Base\n * @default null\n * The parent object if the game object is a sub-object of another game object.\n */\n this.parent = null;\n\n /**\n * @property order\n * @type number\n * @default 0\n * Controls the update-order. The smaller the value the earlier the game object is updated before other game objects are updated.\n */\n this.order = 0;\n\n /**\n * @property rIndex\n * @type number\n * @default 0\n * Holds the render-index if the game object has a graphical representation on screen. The render-index is the\n * index of the game object's graphic-object(gs.GraphicObject) in the current list of graphic-objects. The render-index\n * is read-only. Setting the render-index to a certain value has no effect.\n */\n this.rIndex = 0;\n\n /**\n * @property needsSort\n * @type boolean\n * @default true\n * Indicates if the list of sub-objects needs to be sorted by order because of a change.\n */\n this.needsSort = true;\n\n /**\n * @property needsSort\n * @type boolean\n * @default true\n * Indicates if the UI object needs to be updated.\n */\n this.needsUpdate = true;\n\n /**\n * @property initialized\n * @type boolean\n * @default true\n * Indicates if the game object and its components have been initialized.\n */\n this.initialized = false;\n\n /**\n * @property customData\n * @type Object\n * @default {}\n * A custom data object which can be used to add any custom data/fields to the game\n * object. It is an empty object by default.\n */\n this.customData = {};\n if ((ref = gs.ObjectManager.current) != null) {\n ref.registerObject(this);\n }\n }", "function isObservable(obj) {\n\t return !!obj && (obj instanceof Observable || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));\n\t}", "function Subject () {\n this._observerList = [];\n}" ]
[ "0.6643939", "0.6363023", "0.635718", "0.62948453", "0.6239872", "0.62268287", "0.61886686", "0.6037796", "0.6037796", "0.6008519", "0.5995865", "0.5980973", "0.5956034", "0.5950164", "0.58681566", "0.5849587", "0.5827112", "0.58248043", "0.5750588", "0.56799453", "0.56287414", "0.5622242", "0.5616009", "0.55749863", "0.5523433", "0.5523433", "0.5523433", "0.55180025", "0.5514862", "0.551442", "0.551442", "0.55026656", "0.54987234", "0.54987234", "0.54903716", "0.5489567", "0.5489567", "0.5489567", "0.5489567", "0.5489567", "0.5489567", "0.5489567", "0.547", "0.54603916", "0.54603916", "0.54603916", "0.54365325", "0.54353505", "0.54260457", "0.54253346", "0.5425081", "0.5425081", "0.54004157", "0.54004157", "0.53766894", "0.53753", "0.53615206", "0.53519756", "0.53384066", "0.5332236", "0.53263813", "0.53220177", "0.53170234", "0.5314463", "0.5282552", "0.52808183", "0.52789056", "0.5256725", "0.5256725", "0.5256725", "0.5256725", "0.5256725", "0.52567047", "0.5240018", "0.52353454", "0.5218705", "0.5207377", "0.5198451", "0.51970077", "0.5187635", "0.5176314", "0.5174039", "0.5173876", "0.5173854", "0.51608187", "0.51564276", "0.51368874", "0.5133821", "0.5127611", "0.5124587", "0.51035154", "0.51019555", "0.5101753", "0.5082785", "0.50757504", "0.5067487", "0.5042247", "0.5017076", "0.50168604", "0.50073826" ]
0.73092365
0
Demo 1. VisualBlock (selection + insert) 2. Selection + Commands :'norm A;
function Stuff() { var foo = 1 var bar = 'a' var me = 'm' var foobar = foo + bar + me }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cxcommand(event, val) {\n\n if (val === undefined) val = event.currentTarget.id;\n\n var diagram = myDiagram;\n let nodeArray = diagram.findPartAt(diagram.toolManager.contextMenuTool.mouseDownPoint, false).Ud;\n switch (val) {\n case \"cut\": diagram.commandHandler.cutSelection(); break;\n case \"copy\": diagram.commandHandler.copySelection(); break;\n case \"paste\": diagram.commandHandler.pasteSelection(diagram.lastInput.documentPoint); break;\n case \"delete\": diagram.commandHandler.deleteSelection(); break;\n\n case \"av\": pd = { name: \"None\", type: \"String\", visibility: \"public\" }\n\n $(\"#dialog\").dialog(\"open\") //다이얼로그창 오픈\n function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }\n\n async function demo() {\n console.log('Taking a break...');\n while(method_flag){\n console.log(method_flag);\n await sleep(2000);\n }\n diagram.model.insertArrayItem(nodeArray.properties, 0, pd);\n method_flag = true;\n console.log('Two seconds later');\n }\n\n demo();\n break;\n\n case \"am\": pd = { name: \"None\", parameters: [], visibility: \"private\" }\n$(\"#method_dialog\").dialog(\"open\") //다이얼로그창 오픈\n\n async function demo2() {\n console.log('Taking a break...');\n while(method_flag){\n console.log(method_flag);\n await sleep(2000);\n }\n diagram.model.insertArrayItem(nodeArray.methods, 0, pd);\n method_flag = true;\n console.log('Two seconds later');\n }\n\n demo2();\n break;\n\n }\n diagram.currentTool.stopTool();\n}", "interact(){}", "function g(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";return function(e,n){var r=e.selection.$from,o=r.pos.pos;return n(e.tr.insertText(t,o)),!0}}", "function cmdEditInsertAfter()\n{\n this.originalNode = viewer.currentNode;\n}", "function Visual(options) {\n console.log('Visual constructor', options);\n Visual.host = options.host;\n this.selectionIdBuilder = options.host.createSelectionIdBuilder();\n this.target = options.element;\n this.selectionManager = options.host.createSelectionManager();\n //Visual.vis = this;\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\r\n var display = cm.display, doc = cm.doc;\r\n e_preventDefault(e);\r\n\r\n var ourRange, ourIndex, startSel = doc.sel;\r\n if (addNew && !e.shiftKey) {\r\n ourIndex = doc.sel.contains(start);\r\n if (ourIndex > -1)\r\n ourRange = doc.sel.ranges[ourIndex];\r\n else\r\n ourRange = new Range(start, start);\r\n } else {\r\n ourRange = doc.sel.primary();\r\n }\r\n\r\n if (e.altKey) {\r\n type = \"rect\";\r\n if (!addNew) ourRange = new Range(start, start);\r\n start = posFromMouse(cm, e, true, true);\r\n ourIndex = -1;\r\n } else if (type == \"double\") {\r\n var word = findWordAt(cm, start);\r\n if (cm.display.shift || doc.extend)\r\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\r\n else\r\n ourRange = word;\r\n } else if (type == \"triple\") {\r\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\r\n if (cm.display.shift || doc.extend)\r\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\r\n else\r\n ourRange = line;\r\n } else {\r\n ourRange = extendRange(doc, ourRange, start);\r\n }\r\n\r\n if (!addNew) {\r\n ourIndex = 0;\r\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\r\n startSel = doc.sel;\r\n } else if (ourIndex > -1) {\r\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\r\n } else {\r\n ourIndex = doc.sel.ranges.length;\r\n setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex),\r\n {scroll: false, origin: \"*mouse\"});\r\n }\r\n\r\n var lastPos = start;\r\n function extendTo(pos) {\r\n if (cmp(lastPos, pos) == 0) return;\r\n lastPos = pos;\r\n\r\n if (type == \"rect\") {\r\n var ranges = [], tabSize = cm.options.tabSize;\r\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\r\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\r\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\r\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\r\n line <= end; line++) {\r\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\r\n if (left == right)\r\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\r\n else if (text.length > leftPos)\r\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\r\n }\r\n if (!ranges.length) ranges.push(new Range(start, start));\r\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\r\n {origin: \"*mouse\", scroll: false});\r\n cm.scrollIntoView(pos);\r\n } else {\r\n var oldRange = ourRange;\r\n var anchor = oldRange.anchor, head = pos;\r\n if (type != \"single\") {\r\n if (type == \"double\")\r\n var range = findWordAt(cm, pos);\r\n else\r\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\r\n if (cmp(range.anchor, anchor) > 0) {\r\n head = range.head;\r\n anchor = minPos(oldRange.from(), range.anchor);\r\n } else {\r\n head = range.anchor;\r\n anchor = maxPos(oldRange.to(), range.head);\r\n }\r\n }\r\n var ranges = startSel.ranges.slice(0);\r\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\r\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\r\n }\r\n }\r\n\r\n var editorSize = display.wrapper.getBoundingClientRect();\r\n // Used to ensure timeout re-tries don't fire when another extend\r\n // happened in the meantime (clearTimeout isn't reliable -- at\r\n // least on Chrome, the timeouts still happen even when cleared,\r\n // if the clear happens after their scheduled firing time).\r\n var counter = 0;\r\n\r\n function extend(e) {\r\n var curCount = ++counter;\r\n var cur = posFromMouse(cm, e, true, type == \"rect\");\r\n if (!cur) return;\r\n if (cmp(cur, lastPos) != 0) {\r\n ensureFocus(cm);\r\n extendTo(cur);\r\n var visible = visibleLines(display, doc);\r\n if (cur.line >= visible.to || cur.line < visible.from)\r\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\r\n } else {\r\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\r\n if (outside) setTimeout(operation(cm, function() {\r\n if (counter != curCount) return;\r\n display.scroller.scrollTop += outside;\r\n extend(e);\r\n }), 50);\r\n }\r\n }\r\n\r\n function done(e) {\r\n counter = Infinity;\r\n e_preventDefault(e);\r\n focusInput(cm);\r\n off(document, \"mousemove\", move);\r\n off(document, \"mouseup\", up);\r\n doc.history.lastSelOrigin = null;\r\n }\r\n\r\n var move = operation(cm, function(e) {\r\n if (!e_button(e)) done(e);\r\n else extend(e);\r\n });\r\n var up = operation(cm, done);\r\n on(document, \"mousemove\", move);\r\n on(document, \"mouseup\", up);\r\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = doc.sel.ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = findWordAt(cm, start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex > -1) {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n } else {\n ourIndex = doc.sel.ranges.length;\n setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = findWordAt(cm, pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = doc.sel.ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = findWordAt(cm, start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex > -1) {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n } else {\n ourIndex = doc.sel.ranges.length;\n setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = findWordAt(cm, pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = doc.sel.ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = findWordAt(cm, start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex > -1) {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n } else {\n ourIndex = doc.sel.ranges.length;\n setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = findWordAt(cm, pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function h(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";return function(t,n){var r=t.selection.$from,i=r.pos.pos;return n(t.tr.insertText(e,i)),!0}}", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = doc.sel.ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = cm.findWordAt(start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex > -1) {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n } else {\n ourIndex = doc.sel.ranges.length;\n setSelection(doc, normalizeSelection(doc.sel.ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = cm.findWordAt(pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function cmdEditInsertFirstChild()\n{\n this.originalNode = viewer.selectedNode;\n}", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = cm.findWordAt(start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\") {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0));\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = cm.findWordAt(pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = cm.findWordAt(start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\") {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0));\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = cm.findWordAt(pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n ensureFocus(cm);\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n focusInput(cm);\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function cmdEditInsertBefore()\n{\n this.originalNode = viewer.currentNode;\n}", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = cm.findWordAt(start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0));\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = cm.findWordAt(pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function r(e,t){e.selection.isCollapsed()&&e.selection.selectLine();for(var n=e.selection.surround(t),o=0,s=n.length;o<s;o++)b.dom.lineBreaks(n[o]).remove(),u(n[o]);// rethink restoring selection\n// composer.selection.selectNode(element, wysihtml5.browser.displaysCaretInEmptyContentEditableCorrectly());\n}", "function esBasics(){ askAboutInsert(insertableText.esBasics.text); }", "function leftButtonSelect(cm, e, start, type, addNew) {\n\t var display = cm.display, doc = cm.doc;\n\t e_preventDefault(e);\n\t\n\t var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n\t if (addNew && !e.shiftKey) {\n\t ourIndex = doc.sel.contains(start);\n\t if (ourIndex > -1)\n\t ourRange = ranges[ourIndex];\n\t else\n\t ourRange = new Range(start, start);\n\t } else {\n\t ourRange = doc.sel.primary();\n\t ourIndex = doc.sel.primIndex;\n\t }\n\t\n\t if (e.altKey) {\n\t type = \"rect\";\n\t if (!addNew) ourRange = new Range(start, start);\n\t start = posFromMouse(cm, e, true, true);\n\t ourIndex = -1;\n\t } else if (type == \"double\") {\n\t var word = cm.findWordAt(start);\n\t if (cm.display.shift || doc.extend)\n\t ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n\t else\n\t ourRange = word;\n\t } else if (type == \"triple\") {\n\t var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n\t if (cm.display.shift || doc.extend)\n\t ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n\t else\n\t ourRange = line;\n\t } else {\n\t ourRange = extendRange(doc, ourRange, start);\n\t }\n\t\n\t if (!addNew) {\n\t ourIndex = 0;\n\t setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n\t startSel = doc.sel;\n\t } else if (ourIndex == -1) {\n\t ourIndex = ranges.length;\n\t setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n\t {scroll: false, origin: \"*mouse\"});\n\t } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n\t setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n\t {scroll: false, origin: \"*mouse\"});\n\t startSel = doc.sel;\n\t } else {\n\t replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n\t }\n\t\n\t var lastPos = start;\n\t function extendTo(pos) {\n\t if (cmp(lastPos, pos) == 0) return;\n\t lastPos = pos;\n\t\n\t if (type == \"rect\") {\n\t var ranges = [], tabSize = cm.options.tabSize;\n\t var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n\t var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n\t var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n\t for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n\t line <= end; line++) {\n\t var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n\t if (left == right)\n\t ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n\t else if (text.length > leftPos)\n\t ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n\t }\n\t if (!ranges.length) ranges.push(new Range(start, start));\n\t setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n\t {origin: \"*mouse\", scroll: false});\n\t cm.scrollIntoView(pos);\n\t } else {\n\t var oldRange = ourRange;\n\t var anchor = oldRange.anchor, head = pos;\n\t if (type != \"single\") {\n\t if (type == \"double\")\n\t var range = cm.findWordAt(pos);\n\t else\n\t var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n\t if (cmp(range.anchor, anchor) > 0) {\n\t head = range.head;\n\t anchor = minPos(oldRange.from(), range.anchor);\n\t } else {\n\t head = range.anchor;\n\t anchor = maxPos(oldRange.to(), range.head);\n\t }\n\t }\n\t var ranges = startSel.ranges.slice(0);\n\t ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n\t setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n\t }\n\t }\n\t\n\t var editorSize = display.wrapper.getBoundingClientRect();\n\t // Used to ensure timeout re-tries don't fire when another extend\n\t // happened in the meantime (clearTimeout isn't reliable -- at\n\t // least on Chrome, the timeouts still happen even when cleared,\n\t // if the clear happens after their scheduled firing time).\n\t var counter = 0;\n\t\n\t function extend(e) {\n\t var curCount = ++counter;\n\t var cur = posFromMouse(cm, e, true, type == \"rect\");\n\t if (!cur) return;\n\t if (cmp(cur, lastPos) != 0) {\n\t cm.curOp.focus = activeElt();\n\t extendTo(cur);\n\t var visible = visibleLines(display, doc);\n\t if (cur.line >= visible.to || cur.line < visible.from)\n\t setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n\t } else {\n\t var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n\t if (outside) setTimeout(operation(cm, function() {\n\t if (counter != curCount) return;\n\t display.scroller.scrollTop += outside;\n\t extend(e);\n\t }), 50);\n\t }\n\t }\n\t\n\t function done(e) {\n\t cm.state.selectingText = false;\n\t counter = Infinity;\n\t e_preventDefault(e);\n\t display.input.focus();\n\t off(document, \"mousemove\", move);\n\t off(document, \"mouseup\", up);\n\t doc.history.lastSelOrigin = null;\n\t }\n\t\n\t var move = operation(cm, function(e) {\n\t if (!e_button(e)) done(e);\n\t else extend(e);\n\t });\n\t var up = operation(cm, done);\n\t cm.state.selectingText = up;\n\t on(document, \"mousemove\", move);\n\t on(document, \"mouseup\", up);\n\t }", "function Command () {}", "function leftButtonSelect(cm, e, start, type, addNew) {\n\t var display = cm.display, doc = cm.doc;\n\t e_preventDefault(e);\n\n\t var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n\t if (addNew && !e.shiftKey) {\n\t ourIndex = doc.sel.contains(start);\n\t if (ourIndex > -1)\n\t ourRange = ranges[ourIndex];\n\t else\n\t ourRange = new Range(start, start);\n\t } else {\n\t ourRange = doc.sel.primary();\n\t ourIndex = doc.sel.primIndex;\n\t }\n\n\t if (e.altKey) {\n\t type = \"rect\";\n\t if (!addNew) ourRange = new Range(start, start);\n\t start = posFromMouse(cm, e, true, true);\n\t ourIndex = -1;\n\t } else if (type == \"double\") {\n\t var word = cm.findWordAt(start);\n\t if (cm.display.shift || doc.extend)\n\t ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n\t else\n\t ourRange = word;\n\t } else if (type == \"triple\") {\n\t var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n\t if (cm.display.shift || doc.extend)\n\t ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n\t else\n\t ourRange = line;\n\t } else {\n\t ourRange = extendRange(doc, ourRange, start);\n\t }\n\n\t if (!addNew) {\n\t ourIndex = 0;\n\t setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n\t startSel = doc.sel;\n\t } else if (ourIndex == -1) {\n\t ourIndex = ranges.length;\n\t setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n\t {scroll: false, origin: \"*mouse\"});\n\t } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n\t setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n\t {scroll: false, origin: \"*mouse\"});\n\t startSel = doc.sel;\n\t } else {\n\t replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n\t }\n\n\t var lastPos = start;\n\t function extendTo(pos) {\n\t if (cmp(lastPos, pos) == 0) return;\n\t lastPos = pos;\n\n\t if (type == \"rect\") {\n\t var ranges = [], tabSize = cm.options.tabSize;\n\t var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n\t var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n\t var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n\t for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n\t line <= end; line++) {\n\t var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n\t if (left == right)\n\t ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n\t else if (text.length > leftPos)\n\t ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n\t }\n\t if (!ranges.length) ranges.push(new Range(start, start));\n\t setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n\t {origin: \"*mouse\", scroll: false});\n\t cm.scrollIntoView(pos);\n\t } else {\n\t var oldRange = ourRange;\n\t var anchor = oldRange.anchor, head = pos;\n\t if (type != \"single\") {\n\t if (type == \"double\")\n\t var range = cm.findWordAt(pos);\n\t else\n\t var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n\t if (cmp(range.anchor, anchor) > 0) {\n\t head = range.head;\n\t anchor = minPos(oldRange.from(), range.anchor);\n\t } else {\n\t head = range.anchor;\n\t anchor = maxPos(oldRange.to(), range.head);\n\t }\n\t }\n\t var ranges = startSel.ranges.slice(0);\n\t ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n\t setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n\t }\n\t }\n\n\t var editorSize = display.wrapper.getBoundingClientRect();\n\t // Used to ensure timeout re-tries don't fire when another extend\n\t // happened in the meantime (clearTimeout isn't reliable -- at\n\t // least on Chrome, the timeouts still happen even when cleared,\n\t // if the clear happens after their scheduled firing time).\n\t var counter = 0;\n\n\t function extend(e) {\n\t var curCount = ++counter;\n\t var cur = posFromMouse(cm, e, true, type == \"rect\");\n\t if (!cur) return;\n\t if (cmp(cur, lastPos) != 0) {\n\t cm.curOp.focus = activeElt();\n\t extendTo(cur);\n\t var visible = visibleLines(display, doc);\n\t if (cur.line >= visible.to || cur.line < visible.from)\n\t setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n\t } else {\n\t var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n\t if (outside) setTimeout(operation(cm, function() {\n\t if (counter != curCount) return;\n\t display.scroller.scrollTop += outside;\n\t extend(e);\n\t }), 50);\n\t }\n\t }\n\n\t function done(e) {\n\t cm.state.selectingText = false;\n\t counter = Infinity;\n\t e_preventDefault(e);\n\t display.input.focus();\n\t off(document, \"mousemove\", move);\n\t off(document, \"mouseup\", up);\n\t doc.history.lastSelOrigin = null;\n\t }\n\n\t var move = operation(cm, function(e) {\n\t if (!e_button(e)) done(e);\n\t else extend(e);\n\t });\n\t var up = operation(cm, done);\n\t cm.state.selectingText = up;\n\t on(document, \"mousemove\", move);\n\t on(document, \"mouseup\", up);\n\t }", "function cmdEditPasteFirstChild() {}", "function CMDDV1() {}", "showDefaultInsertPoint() {\n // insertion point may alternate so ensure we remove the block cursor\n this.hideBlockInsertionPoint();\n const point = this.layout.getInitialLayoutPoint();\n this.showInsertionPointForEdgeAt(point.x, point.y);\n }", "function q(a){a.click(u).mousedown(V)}", "function actualitza ()\r\n{\r\n this.capa.innerHTML = this.actual + this.putCursor ('black');\r\n}", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(e);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n ourRange = ranges[ourIndex];\n else\n ourRange = new Range(start, start);\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {\n type = \"rect\";\n if (!addNew) ourRange = new Range(start, start);\n start = posFromMouse(cm, e, true, true);\n ourIndex = -1;\n } else if (type == \"double\") {\n var word = cm.findWordAt(start);\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n else\n ourRange = word;\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n if (cm.display.shift || doc.extend)\n ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n else\n ourRange = line;\n } else {\n ourRange = extendRange(doc, ourRange, start);\n }\n\n if (!addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) return;\n lastPos = pos;\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n else if (text.length > leftPos)\n ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n }\n if (!ranges.length) ranges.push(new Range(start, start));\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var anchor = oldRange.anchor, head = pos;\n if (type != \"single\") {\n if (type == \"double\")\n var range = cm.findWordAt(pos);\n else\n var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n }\n var ranges = startSel.ranges.slice(0);\n ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, type == \"rect\");\n if (!cur) return;\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) setTimeout(operation(cm, function() {\n if (counter != curCount) return;\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50);\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function(e) {\n if (!e_button(e)) done(e);\n else extend(e);\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n }", "function selectionSet(addCommand, thirdParam) {\n var range,\n sel = selectionGet();\n\n // for webkit, mozilla, opera\n if (window.getSelection) {\n if (sel.anchorNode && sel.getRangeAt)\n range = sel.getRangeAt(0);\n\n if (range) {\n sel.removeAllRanges();\n sel.addRange(range);\n }\n\n\n document.execCommand(addCommand, false, thirdParam);\n }\n\n // for ie\n else if (document.selection && document.selection.createRange && document.selection.type != \"None\") {\n range = document.selection.createRange();\n range.execCommand(addCommand, false, thirdParam);\n }\n\n // change styles to around tags\n affectStyleAround(false, false);\n }", "main_enter() {\n\n\t\t\t// \n\t\t\tlet n_line = y_editor.getSelectionRange();\n\n\t\t\t// ref selection\n\t\t\tlet k_selection = y_editor.getSelection();\n\n\t\t\t// no selection\n\t\t\tif(k_selection.isEmpty()) {\n\n\t\t\t\t//\n\t\t\t\texecute_query_block(n_line.start.row);\n\t\t\t}\n\t\t\t// things are selected\n\t\t\telse {\n\n\t\t\t}\n\t\t}", "function insert_text(identifier) { //must be available in the main scope\n var deltaPos = [1, 0]\n var selected_cell = Jupyter.notebook.get_selected_cell();\n Jupyter.notebook.edit_mode();\n var cursorPos = selected_cell.code_mirror.getCursor()\n var selectedText = selected_cell.code_mirror.getSelection();\n selected_cell.code_mirror.replaceSelection(\n String($(identifier).data('text')), 'start');\n if (typeof $(identifier).data('position') !== \"undefined\") {\n var deltaPos = $(identifier).data('position').split(',').map(Number)\n }\n selected_cell.code_mirror.setCursor(cursorPos['line'] + deltaPos[0], deltaPos[1])\n var cursorPos = selected_cell.code_mirror.getCursor() \n selected_cell.code_mirror.replaceRange(selectedText, cursorPos); \n}", "function Ma(e,t,a){var r=ca(e,t,\"div\",null,null,!e.options.singleCursorHeightPerLine),f=a.appendChild(n(\"div\",\"聽\",\"CodeMirror-cursor\"));if(f.style.left=r.left+\"px\",f.style.top=r.top+\"px\",f.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+\"px\",r.other){\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var o=a.appendChild(n(\"div\",\"聽\",\"CodeMirror-cursor CodeMirror-secondarycursor\"));o.style.display=\"\",o.style.left=r.other.left+\"px\",o.style.top=r.other.top+\"px\",o.style.height=.85*(r.other.bottom-r.other.top)+\"px\"}}", "function leftButtonSelect(cm, e, start, type, addNew) {\n\t\t var display = cm.display, doc = cm.doc;\n\t\t e_preventDefault(e);\n\t\t\n\t\t var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n\t\t if (addNew && !e.shiftKey) {\n\t\t ourIndex = doc.sel.contains(start);\n\t\t if (ourIndex > -1)\n\t\t ourRange = ranges[ourIndex];\n\t\t else\n\t\t ourRange = new Range(start, start);\n\t\t } else {\n\t\t ourRange = doc.sel.primary();\n\t\t ourIndex = doc.sel.primIndex;\n\t\t }\n\t\t\n\t\t if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {\n\t\t type = \"rect\";\n\t\t if (!addNew) ourRange = new Range(start, start);\n\t\t start = posFromMouse(cm, e, true, true);\n\t\t ourIndex = -1;\n\t\t } else if (type == \"double\") {\n\t\t var word = cm.findWordAt(start);\n\t\t if (cm.display.shift || doc.extend)\n\t\t ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n\t\t else\n\t\t ourRange = word;\n\t\t } else if (type == \"triple\") {\n\t\t var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n\t\t if (cm.display.shift || doc.extend)\n\t\t ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n\t\t else\n\t\t ourRange = line;\n\t\t } else {\n\t\t ourRange = extendRange(doc, ourRange, start);\n\t\t }\n\t\t\n\t\t if (!addNew) {\n\t\t ourIndex = 0;\n\t\t setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n\t\t startSel = doc.sel;\n\t\t } else if (ourIndex == -1) {\n\t\t ourIndex = ranges.length;\n\t\t setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n\t\t {scroll: false, origin: \"*mouse\"});\n\t\t } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n\t\t setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n\t\t {scroll: false, origin: \"*mouse\"});\n\t\t startSel = doc.sel;\n\t\t } else {\n\t\t replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n\t\t }\n\t\t\n\t\t var lastPos = start;\n\t\t function extendTo(pos) {\n\t\t if (cmp(lastPos, pos) == 0) return;\n\t\t lastPos = pos;\n\t\t\n\t\t if (type == \"rect\") {\n\t\t var ranges = [], tabSize = cm.options.tabSize;\n\t\t var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n\t\t var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n\t\t var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n\t\t for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n\t\t line <= end; line++) {\n\t\t var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n\t\t if (left == right)\n\t\t ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n\t\t else if (text.length > leftPos)\n\t\t ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n\t\t }\n\t\t if (!ranges.length) ranges.push(new Range(start, start));\n\t\t setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n\t\t {origin: \"*mouse\", scroll: false});\n\t\t cm.scrollIntoView(pos);\n\t\t } else {\n\t\t var oldRange = ourRange;\n\t\t var anchor = oldRange.anchor, head = pos;\n\t\t if (type != \"single\") {\n\t\t if (type == \"double\")\n\t\t var range = cm.findWordAt(pos);\n\t\t else\n\t\t var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n\t\t if (cmp(range.anchor, anchor) > 0) {\n\t\t head = range.head;\n\t\t anchor = minPos(oldRange.from(), range.anchor);\n\t\t } else {\n\t\t head = range.anchor;\n\t\t anchor = maxPos(oldRange.to(), range.head);\n\t\t }\n\t\t }\n\t\t var ranges = startSel.ranges.slice(0);\n\t\t ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n\t\t setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n\t\t }\n\t\t }\n\t\t\n\t\t var editorSize = display.wrapper.getBoundingClientRect();\n\t\t // Used to ensure timeout re-tries don't fire when another extend\n\t\t // happened in the meantime (clearTimeout isn't reliable -- at\n\t\t // least on Chrome, the timeouts still happen even when cleared,\n\t\t // if the clear happens after their scheduled firing time).\n\t\t var counter = 0;\n\t\t\n\t\t function extend(e) {\n\t\t var curCount = ++counter;\n\t\t var cur = posFromMouse(cm, e, true, type == \"rect\");\n\t\t if (!cur) return;\n\t\t if (cmp(cur, lastPos) != 0) {\n\t\t cm.curOp.focus = activeElt();\n\t\t extendTo(cur);\n\t\t var visible = visibleLines(display, doc);\n\t\t if (cur.line >= visible.to || cur.line < visible.from)\n\t\t setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n\t\t } else {\n\t\t var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n\t\t if (outside) setTimeout(operation(cm, function() {\n\t\t if (counter != curCount) return;\n\t\t display.scroller.scrollTop += outside;\n\t\t extend(e);\n\t\t }), 50);\n\t\t }\n\t\t }\n\t\t\n\t\t function done(e) {\n\t\t cm.state.selectingText = false;\n\t\t counter = Infinity;\n\t\t e_preventDefault(e);\n\t\t display.input.focus();\n\t\t off(document, \"mousemove\", move);\n\t\t off(document, \"mouseup\", up);\n\t\t doc.history.lastSelOrigin = null;\n\t\t }\n\t\t\n\t\t var move = operation(cm, function(e) {\n\t\t if (!e_button(e)) done(e);\n\t\t else extend(e);\n\t\t });\n\t\t var up = operation(cm, done);\n\t\t cm.state.selectingText = up;\n\t\t on(document, \"mousemove\", move);\n\t\t on(document, \"mouseup\", up);\n\t\t }", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc\n e_preventDefault(e)\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start)\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex] }\n else\n { ourRange = new Range(start, start) }\n } else {\n ourRange = doc.sel.primary()\n ourIndex = doc.sel.primIndex\n }\n\n if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {\n type = \"rect\"\n if (!addNew) { ourRange = new Range(start, start) }\n start = posFromMouse(cm, e, true, true)\n ourIndex = -1\n } else if (type == \"double\") {\n var word = cm.findWordAt(start)\n if (cm.display.shift || doc.extend)\n { ourRange = extendRange(doc, ourRange, word.anchor, word.head) }\n else\n { ourRange = word }\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)))\n if (cm.display.shift || doc.extend)\n { ourRange = extendRange(doc, ourRange, line.anchor, line.head) }\n else\n { ourRange = line }\n } else {\n ourRange = extendRange(doc, ourRange, start)\n }\n\n if (!addNew) {\n ourIndex = 0\n setSelection(doc, new Selection([ourRange], 0), sel_mouse)\n startSel = doc.sel\n } else if (ourIndex == -1) {\n ourIndex = ranges.length\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"})\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"})\n startSel = doc.sel\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse)\n }\n\n var lastPos = start\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol)\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize)\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)) }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false})\n cm.scrollIntoView(pos)\n } else {\n var oldRange = ourRange\n var anchor = oldRange.anchor, head = pos\n if (type != \"single\") {\n var range\n if (type == \"double\")\n { range = cm.findWordAt(pos) }\n else\n { range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))) }\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head\n anchor = minPos(oldRange.from(), range.anchor)\n } else {\n head = range.anchor\n anchor = maxPos(oldRange.to(), range.head)\n }\n }\n var ranges$1 = startSel.ranges.slice(0)\n ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head)\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect()\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0\n\n function extend(e) {\n var curCount = ++counter\n var cur = posFromMouse(cm, e, true, type == \"rect\")\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt()\n extendTo(cur)\n var visible = visibleLines(display, doc)\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside\n extend(e)\n }), 50) }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false\n counter = Infinity\n e_preventDefault(e)\n display.input.focus()\n off(document, \"mousemove\", move)\n off(document, \"mouseup\", up)\n doc.history.lastSelOrigin = null\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e) }\n else { extend(e) }\n })\n var up = operation(cm, done)\n cm.state.selectingText = up\n on(document, \"mousemove\", move)\n on(document, \"mouseup\", up)\n}", "function leftButtonSelect(cm, e, start, type, addNew) {\n var display = cm.display, doc = cm.doc\n e_preventDefault(e)\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges\n if (addNew && !e.shiftKey) {\n ourIndex = doc.sel.contains(start)\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex] }\n else\n { ourRange = new Range(start, start) }\n } else {\n ourRange = doc.sel.primary()\n ourIndex = doc.sel.primIndex\n }\n\n if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {\n type = \"rect\"\n if (!addNew) { ourRange = new Range(start, start) }\n start = posFromMouse(cm, e, true, true)\n ourIndex = -1\n } else if (type == \"double\") {\n var word = cm.findWordAt(start)\n if (cm.display.shift || doc.extend)\n { ourRange = extendRange(doc, ourRange, word.anchor, word.head) }\n else\n { ourRange = word }\n } else if (type == \"triple\") {\n var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)))\n if (cm.display.shift || doc.extend)\n { ourRange = extendRange(doc, ourRange, line.anchor, line.head) }\n else\n { ourRange = line }\n } else {\n ourRange = extendRange(doc, ourRange, start)\n }\n\n if (!addNew) {\n ourIndex = 0\n setSelection(doc, new Selection([ourRange], 0), sel_mouse)\n startSel = doc.sel\n } else if (ourIndex == -1) {\n ourIndex = ranges.length\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"})\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"})\n startSel = doc.sel\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse)\n }\n\n var lastPos = start\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos\n\n if (type == \"rect\") {\n var ranges = [], tabSize = cm.options.tabSize\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol)\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize)\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))) }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))) }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)) }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false})\n cm.scrollIntoView(pos)\n } else {\n var oldRange = ourRange\n var anchor = oldRange.anchor, head = pos\n if (type != \"single\") {\n var range\n if (type == \"double\")\n { range = cm.findWordAt(pos) }\n else\n { range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))) }\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head\n anchor = minPos(oldRange.from(), range.anchor)\n } else {\n head = range.anchor\n anchor = maxPos(oldRange.to(), range.head)\n }\n }\n var ranges$1 = startSel.ranges.slice(0)\n ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head)\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect()\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0\n\n function extend(e) {\n var curCount = ++counter\n var cur = posFromMouse(cm, e, true, type == \"rect\")\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt()\n extendTo(cur)\n var visible = visibleLines(display, doc)\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e) }}), 150) }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside\n extend(e)\n }), 50) }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false\n counter = Infinity\n e_preventDefault(e)\n display.input.focus()\n off(document, \"mousemove\", move)\n off(document, \"mouseup\", up)\n doc.history.lastSelOrigin = null\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e) }\n else { extend(e) }\n })\n var up = operation(cm, done)\n cm.state.selectingText = up\n on(document, \"mousemove\", move)\n on(document, \"mouseup\", up)\n}", "editCommand(){const richtext=this.shadowRoot.getElementById(\"richtext\"),editmode=richtext.contentDocument;editmode.designMode=\"on\"}", "function leftButtonSelect(cm, e, start, type, addNew) {\n\t var display = cm.display, doc = cm.doc;\n\t e_preventDefault(e);\n\n\t var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n\t if (addNew && !e.shiftKey) {\n\t ourIndex = doc.sel.contains(start);\n\t if (ourIndex > -1)\n\t ourRange = ranges[ourIndex];\n\t else\n\t ourRange = new Range(start, start);\n\t } else {\n\t ourRange = doc.sel.primary();\n\t ourIndex = doc.sel.primIndex;\n\t }\n\n\t if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {\n\t type = \"rect\";\n\t if (!addNew) ourRange = new Range(start, start);\n\t start = posFromMouse(cm, e, true, true);\n\t ourIndex = -1;\n\t } else if (type == \"double\") {\n\t var word = cm.findWordAt(start);\n\t if (cm.display.shift || doc.extend)\n\t ourRange = extendRange(doc, ourRange, word.anchor, word.head);\n\t else\n\t ourRange = word;\n\t } else if (type == \"triple\") {\n\t var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)));\n\t if (cm.display.shift || doc.extend)\n\t ourRange = extendRange(doc, ourRange, line.anchor, line.head);\n\t else\n\t ourRange = line;\n\t } else {\n\t ourRange = extendRange(doc, ourRange, start);\n\t }\n\n\t if (!addNew) {\n\t ourIndex = 0;\n\t setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n\t startSel = doc.sel;\n\t } else if (ourIndex == -1) {\n\t ourIndex = ranges.length;\n\t setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n\t {scroll: false, origin: \"*mouse\"});\n\t } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == \"single\" && !e.shiftKey) {\n\t setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n\t {scroll: false, origin: \"*mouse\"});\n\t startSel = doc.sel;\n\t } else {\n\t replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n\t }\n\n\t var lastPos = start;\n\t function extendTo(pos) {\n\t if (cmp(lastPos, pos) == 0) return;\n\t lastPos = pos;\n\n\t if (type == \"rect\") {\n\t var ranges = [], tabSize = cm.options.tabSize;\n\t var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n\t var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n\t var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n\t for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n\t line <= end; line++) {\n\t var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n\t if (left == right)\n\t ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos)));\n\t else if (text.length > leftPos)\n\t ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize))));\n\t }\n\t if (!ranges.length) ranges.push(new Range(start, start));\n\t setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n\t {origin: \"*mouse\", scroll: false});\n\t cm.scrollIntoView(pos);\n\t } else {\n\t var oldRange = ourRange;\n\t var anchor = oldRange.anchor, head = pos;\n\t if (type != \"single\") {\n\t if (type == \"double\")\n\t var range = cm.findWordAt(pos);\n\t else\n\t var range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0)));\n\t if (cmp(range.anchor, anchor) > 0) {\n\t head = range.head;\n\t anchor = minPos(oldRange.from(), range.anchor);\n\t } else {\n\t head = range.anchor;\n\t anchor = maxPos(oldRange.to(), range.head);\n\t }\n\t }\n\t var ranges = startSel.ranges.slice(0);\n\t ranges[ourIndex] = new Range(clipPos(doc, anchor), head);\n\t setSelection(doc, normalizeSelection(ranges, ourIndex), sel_mouse);\n\t }\n\t }\n\n\t var editorSize = display.wrapper.getBoundingClientRect();\n\t // Used to ensure timeout re-tries don't fire when another extend\n\t // happened in the meantime (clearTimeout isn't reliable -- at\n\t // least on Chrome, the timeouts still happen even when cleared,\n\t // if the clear happens after their scheduled firing time).\n\t var counter = 0;\n\n\t function extend(e) {\n\t var curCount = ++counter;\n\t var cur = posFromMouse(cm, e, true, type == \"rect\");\n\t if (!cur) return;\n\t if (cmp(cur, lastPos) != 0) {\n\t cm.curOp.focus = activeElt();\n\t extendTo(cur);\n\t var visible = visibleLines(display, doc);\n\t if (cur.line >= visible.to || cur.line < visible.from)\n\t setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);\n\t } else {\n\t var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n\t if (outside) setTimeout(operation(cm, function() {\n\t if (counter != curCount) return;\n\t display.scroller.scrollTop += outside;\n\t extend(e);\n\t }), 50);\n\t }\n\t }\n\n\t function done(e) {\n\t cm.state.selectingText = false;\n\t counter = Infinity;\n\t e_preventDefault(e);\n\t display.input.focus();\n\t off(document, \"mousemove\", move);\n\t off(document, \"mouseup\", up);\n\t doc.history.lastSelOrigin = null;\n\t }\n\n\t var move = operation(cm, function(e) {\n\t if (!e_button(e)) done(e);\n\t else extend(e);\n\t });\n\t var up = operation(cm, done);\n\t cm.state.selectingText = up;\n\t on(document, \"mousemove\", move);\n\t on(document, \"mouseup\", up);\n\t }", "function SelectBlock()\r\n{\r\n this.objectName = \"Select\";\r\n\tthis.text=\"SELECT\";\r\n}", "function normalizeSelection() {\n\t\t\t// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything\n\t\t\teditor.on('keyup focusin mouseup', function(e) {\n\t\t\t\tif (e.keyCode != 65 || !VK.metaKeyPressed(e)) {\n\t\t\t\t\tselection.normalize();\n\t\t\t\t}\n\t\t\t}, true);\n\t\t}", "function normalizeSelection() {\n\t\t\t// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything\n\t\t\teditor.on('keyup focusin mouseup', function(e) {\n\t\t\t\tif (e.keyCode != 65 || !VK.metaKeyPressed(e)) {\n\t\t\t\t\tselection.normalize();\n\t\t\t\t}\n\t\t\t}, true);\n\t\t}", "function normalizeSelection() {\n\t\t\t// Normalize selection for example <b>a</b><i>|a</i> becomes <b>a|</b><i>a</i> except for Ctrl+A since it selects everything\n\t\t\teditor.on('keyup focusin mouseup', function(e) {\n\t\t\t\tif (e.keyCode != 65 || !VK.metaKeyPressed(e)) {\n\t\t\t\t\tselection.normalize();\n\t\t\t\t}\n\t\t\t}, true);\n\t\t}", "function LtBlock()\r\n{\r\n this.objectName = \"Lt\";\r\n\tthis.text=\"LT\";\r\n}", "function test_viz(id,w,h){\n\t//first create program with global scope\n\t/*var prog = new program();\n\t//get global scope\n\tvar g_scp = prog.getGlobalScope();\n\n\t//setup integer type\n\tvar t_int = new type(\"integer\", OBJ_TYPE.INT, g_scp);\n\n\t//setup symbols for null123, null9, and multiplication commands\n\tvar s_null123 = new symbol(\"i\", t_int, g_scp);\n\tvar s_null9 = new symbol(\"j\", t_int, g_scp);\n\tvar s_mul = new symbol(\"total\", t_int, g_scp);\n\t\n\t//get references for start and end blocks\n\tvar start = g_scp._start, end = g_scp._end;\n\t//add command NULL 123 to start\n\tvar null123 = start.createCommand(\n\t\tCOMMAND_TYPE.NULL,\n\t\t[value.createValue(123)],\n\t\t[s_null123]\n\t);\n\t//add command NULL 9 to start\n\tvar null9 = start.createCommand(\n\t\tCOMMAND_TYPE.NULL,\n\t\t[value.createValue(9)],\n\t\t[s_null9]\n\t);\n\t//add command MUL that uses two previously defined constants 123 and 9\n\tstart.createCommand(\n\t\tCOMMAND_TYPE.MUL,\n\t\t[null123, null9],\n\t\t[s_mul,s_null9, s_null123]\n\t);\n\t//add command NULL 9 to start\n\tvar null1 = start.createCommand(\n\t\tCOMMAND_TYPE.NULL,\n\t\t[value.createValue(1)],\n\t\t[]\n\t);\n\t//add command NULL 'hello world' to end block\n\tend.createCommand(\n\t\tCOMMAND_TYPE.NULL,\n\t\t[value.createValue(\"hello worldddddddddddd!\")],\n\t\t[]\n\t);\n\n\t//connect start to an end\n\tblock.connectBlocks(start, end);*/\n\n\t//run test function\n\tvar g_scp = test__program_scope_block_function();\n\n\t//create visualization component\n\t//ES 2016-08-13 (b_cmp_test_1): replace call to 'viz' with a function that either\n\t//\tcreates a new viz instance or returns existing one\n\tvar v = viz.getVisualizer(id, w, h);\t//arguments for 'getVisualizer' changed\n\t//draw CFG\n\tv.drawCFG(g_scp);\n}", "function Vn(e){e.doc.mode=He(e.options,e.doc.modeOption),Kn(e)}", "function _execCommand(doc, composer, command, nodeName, className) {\n var ranges = composer.selection.getOwnRanges();\n for (var i = ranges.length; i--;){\n composer.selection.getSelection().removeAllRanges();\n composer.selection.setSelection(ranges[i]);\n if (className) {\n var eventListener = dom.observe(doc, \"DOMNodeInserted\", function(event) {\n var target = event.target,\n displayStyle;\n if (target.nodeType !== wysihtml5.ELEMENT_NODE) {\n return;\n }\n displayStyle = dom.getStyle(\"display\").from(target);\n if (displayStyle.substr(0, 6) !== \"inline\") {\n // Make sure that only block elements receive the given class\n target.className += \" \" + className;\n }\n });\n }\n doc.execCommand(command, false, nodeName);\n\n if (eventListener) {\n eventListener.stop();\n }\n }\n }", "function _execCommand(doc, composer, command, nodeName, className) {\n var ranges = composer.selection.getOwnRanges();\n for (var i = ranges.length; i--;){\n composer.selection.getSelection().removeAllRanges();\n composer.selection.setSelection(ranges[i]);\n if (className) {\n var eventListener = dom.observe(doc, \"DOMNodeInserted\", function(event) {\n var target = event.target,\n displayStyle;\n if (target.nodeType !== wysihtml5.ELEMENT_NODE) {\n return;\n }\n displayStyle = dom.getStyle(\"display\").from(target);\n if (displayStyle.substr(0, 6) !== \"inline\") {\n // Make sure that only block elements receive the given class\n target.className += \" \" + className;\n }\n });\n }\n doc.execCommand(command, false, nodeName);\n\n if (eventListener) {\n eventListener.stop();\n }\n }\n }", "function Window_PDButtonCommand() {\n this.initialize.apply(this, arguments);\n}", "function deflection(){\n $(\"#arrow1\").hide();\n $(\"#box1\").hide();\n $(\"#temp2\").hide();\n $(\"#emptypipe\").show();\n $(\"#lines\").velocity({opacity:1},{duration: 5000});\n document.getElementById(\"innerinstrtxt\").innerHTML = \"The ions are sorted and separted by the magnetic filed according to their mass/ charge ratio.\"\n $(\"#evaluation\").on(\"click\",function(){ evaluation();});\n}", "function UISelection(){\n\n }", "addSampleCommands() {\n this.addCommand(new sampleCommands.MagicEightBallCommand());\n this.addCommand(new sampleCommands.RollCommand());\n }", "activate()\n\t{\n\t\tconsole.log(\"LineTool.activate\")\n\t\teditor.view.container.dom.style.cursor=\"crosshair\"\n\t\tthis.mouseIp=new InputPoint()\n\t\tthis.firstIp= new InputPoint();\n\t}", "function c(e) { //bind with character in sub/sup\n\t//deal with the previous cursor\n\tvar x = this;\n\tvar idObject = document.getElementById('cursor');\n\tif (idObject != null) {\n\t\tif (idObject.parentNode.getAttribute(\"math_id\") == x.getAttribute(\"math_id\")) { //use math_id to judge if they are same\n\t\t\tremoveElement(idObject);\n\t\t\tcheckClassName(this);\t//for click same box more than once\n\t\t\t//x = null; //flag\n\t\t} else {\n\t\t\t// if not the same parent, change the className for the original one with cursor \n\t\t\t// Note: delete cursor first, or there is no way to judge\n\t\t\tvar parent = idObject.parentNode;\n\t\t\t//console.log(parent);\n\t\t\tremoveElement(idObject);\n\t\t\tcheckClassName(parent);\n\t\t}\n\t}\n\t//define the cursor position\n\t//console.log(this.firstChild.nodeType);\t//3 means textnode\n\tif (this.firstChild == null) {\n\t\tcheckClassName(this);\n\t\tthis.appendChild(createCursor());\n\t} else if (this.firstChild.nodeType == 3) {\n\t\tvar elemLeftSide = elemOffsetLeft(this);\n\t\tvar mouseLeftSide = mousePosition(e);\n\t\tvar elemWidth = this.offsetWidth;\n\t\tif (mouseLeftSide - elemLeftSide >= elemWidth / 2)\n\t\t\tinsertAfter(createCursor(), this);\n\t\telse\n\t\t\tinsertBefore(createCursor(), this);\n\t\tcheckClassName(this.parentNode);\n\t} else {\n\t\tvar mouseLeftSide = mousePosition(e);\n\t\tfor (var i in this.childNodes) {\n\t\t\tvar elemLeftSide = elemOffsetLeft(this.childNodes[i]);\n\t\t\tif (mouseLeftSide < elemLeftSide) {\n\t\t\t\tinsertBefore(createCursor(), this.childNodes[i]);\n\t\t\t\te.stopPropagation();\n\t\t\t\tcheckClassName(this);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthis.appendChild(createCursor());\n\t\tcheckClassName(this);\n\t}\n//\tif (x != null)\n//\t\tcheckClassName(this.parentNode);\n\te.stopPropagation();\n}", "function TogglCommandController(command, elem) {\t\n\tthis.updateUI = function() {\n\t\tvar state = command.queryState();\n\t\telem.className = state?\"active\":\"\";\n\t}\n\tvar self = this;\n\telem.unselectable = \"on\"; // IE, prevent focus\n\tbindEvent(elem, \"mousedown\", function(evt) { \n\t\t// we cancel the mousedown default to prevent the button from getting focus\n\t\t// (doesn't work in IE)\n\t\tif (evt.preventDefault) evt.preventDefault();\n\t});\t\t\n\tbindEvent(elem, \"click\", function(evt) { \n\t\tcommand.execute(); \t\n\t\tupdateToolbar();\n\t});\n}", "addBasicCommands() {\n this.addCommand(new commands.HelpCommand());\n }", "function cmdEditPasteBefore() {}", "doTextOperation(){let root=this,selection=root.selection;if(root.toggled&&null!==root.toggledCommand){document.execCommand(root.toggledCommand,!1,root.toggledCommand||\"\")}else if(null!==root.command){root.dispatchEvent(new CustomEvent(root.command+\"-button\",{bubbles:!0,cancelable:!0,composed:!0,detail:root}));document.execCommand(root.command,!1,root.commandVal||\"\");root.selection=selection}}", "updateCommandsBox() {\n this.bottom.setContent(\n this.commands.reduce(\n (a, { key, label }) =>\n `${a}{black-fg}{white-bg}{bold}${key}{/}: ${label}\\t`,\n ' '\n )\n );\n this.screen.render();\n }", "displayCmd() {\r\n var cmdText = \"Commands \\n\";\r\n for (let i = 0; i < this.cmdOrder.length; ++i) {\r\n cmdText += this.cmdOrder[i] + \": \";\r\n cmdText += keyboardMap[this.cmdKeyCode[this.cmdIdx[this.cmdOrder[i]]]];\r\n cmdText += \"\\n\";\r\n }\r\n this.document.getElementById('commands').innerText = cmdText;\r\n }", "function controlBox(selection) {\n selection.each(function(data) {\n var sel = d3.select(this);\n data = relationship[data];\n\n var w = 100;\n var h = 100;\n\n // scale clicks to param values\n var mouseToParam = d3.scale.linear()\n .domain([0,w/2])\n .range([0,maxParam]);\n\n // INITIAL BUILD\n\n var g = sel.selectAll('g.inner')\n .data([data])\n .enter()\n .append('g.inner')\n .attr(\"transform\", \"translate(\" + w/2 + \",\" + h/2 + \")\");\n\n g.append('path.x.axis').attr('d', line([[-w/2,0],[w/2,0]]));\n g.append('path.y.axis').attr('d', line([[0,-h/2],[0,h/2]]));\n g.append('rect.frame')\n .attr('x', -w/2)\n .attr('y', -h/2)\n .attr('width', w)\n .attr('height', h);\n\n // label quadrants accd to J. C. Sprott\n // http://sprott.physics.wisc.edu/pubs/paper277.pdf\n g.append('text').attr('x', w/4).attr('y', -h/4).attr('dy', '.3em').text('EAGER')\n g.append('text').attr('x', w/4).attr('y', h/4).attr('dy', '.3em').text('NARCISSIST')\n g.append('text').attr('x', -w/4).attr('y', -h/4).attr('dy', '.3em').text('CAUTIOUS')\n g.append('text').attr('x', -w/4).attr('y', h/4).attr('dy', '.3em').text('HERMIT')\n\n g.append('text.title').attr('y',-(h/2 + 10)).text(data.name.toUpperCase());\n g.append('text.prose.one').attr('y', h/2 + 10);\n g.append('text.prose.two').attr('y', h/2 + 20);\n g.append('circle.current').attr('r', 2);\n\n var drag = d3.behavior.drag().on('drag', clickOrDrag);\n g.on('click', clickOrDrag).call(drag);\n\n update();\n\n function clickOrDrag(d) {\n\n // remove instruction to do this\n d3.select('.instructions .params').remove();\n\n // coefficient for own feeling\n var a = mouseToParam(d3.mouse(this)[0]);\n d.coefficients[d.dim] = a;\n\n // coefficient for other's feeling\n var b = mouseToParam(-d3.mouse(this)[1]);\n d.coefficients[(d.dim==='x' ? 'y' : 'x')] = b;\n\n update();\n }\n\n // UPDATE\n function update() {\n\n var a = data.coefficients[data.dim];\n var b = data.coefficients[(data.dim==='x' ? 'y' : 'x')];\n\n var hisHer = data.name == 'Romeo' ? 'his' : 'her';\n var heShe = data.name == 'Romeo' ? 'he' : 'she';\n var other = data.name == 'Romeo' ? 'Juliet' : 'Romeo';\n\n // this text also comes from\n // http://sprott.physics.wisc.edu/pubs/paper277.pdf\n var prose1, prose2;\n if(a > 0 && b > 0) {\n prose1 = 'is encouraged by '+hisHer+' own feelings';\n prose2 = 'as well as '+ other +'’s';\n } else if(a > 0 && b < 0) {\n prose1 = 'wants more of what '+heShe+' feels';\n prose2 = 'but retreats from '+ other +'’s feelings';\n } else if(a < 0 && b > 0) {\n prose1 = 'retreats from '+hisHer+' own feelings';\n prose2 = 'but is encouraged by '+other+'’s';\n } else if(a < 0 && b < 0) {\n prose1 = 'retreats from '+hisHer+' own feelings';\n prose2 = 'as well as '+other+'’s';\n }\n\n sel.select('circle.current')\n .attr('cx', mouseToParam.invert(a))\n .attr('cy', mouseToParam.invert(-b))\n\n sel.select('.prose.one').text(prose1);\n sel.select('.prose.two').text(prose2);\n\n // update symbolic equation\n d3.select('.symbolics').call(renderSymbolics);\n\n // clear phase space field trails\n ctx.save();\n ctx.fillStyle = '#fff';\n ctx.globalAlpha = .8;\n ctx.fillRect(-width/2,-height/2,width,height);\n ctx.restore();\n // reset seeds for phase space trails\n lesserRelationships = d3.range(20).map(newPoint);\n\n }\n\n })\n}", "function Da(e,t,a){function r(e,t,a,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),s.appendChild(n(\"div\",null,\"CodeMirror-selected\",\"position: absolute; left: \"+e+\"px;\\n top: \"+t+\"px; width: \"+(null==a?l-e:a)+\"px;\\n height: \"+(r-t)+\"px\"))}function f(t,a,n){function f(a,n){return sa(e,R(t,a),\"div\",_,n)}function o(t,a,n){var r=ma(e,_,null,t),o=\"ltr\"==a==(\"after\"==n)?\"left\":\"right\";return f(\"after\"==n?r.begin:r.end-(/\\s/.test(_.text.charAt(r.end-1))?2:1),o)[o]}var s,c,_=T(i,t),m=_.text.length,p=Se(_,i.direction);return xe(p,a||0,null==n?m:n,function(e,t,i,_){var g=\"ltr\"==i,h=f(e,g?\"left\":\"right\"),b=f(t-1,g?\"right\":\"left\"),y=null==a&&0==e,v=null==n&&t==m,w=0==_,x=!p||_==p.length-1;if(b.top-h.top<=3){// Single line\n var E=(d?y:v)&&w,S=(d?v:y)&&x,C=E?u:(g?h:b).left,k=S?l:(g?b:h).right;r(C,h.top,k-C,h.bottom)}else{// Multiple lines\n var T,N,M,O;g?(T=d&&y&&w?u:h.left,N=d?l:o(e,i,\"before\"),M=d?u:o(t,i,\"after\"),O=d&&v&&x?l:b.right):(T=d?o(e,i,\"before\"):u,N=!d&&y&&w?l:h.right,M=!d&&v&&x?u:b.left,O=d?o(t,i,\"after\"):l),r(T,h.top,N-T,h.bottom),h.bottom<b.top&&r(u,h.bottom,null,b.top),r(M,b.top,O-M,b.bottom)}(!s||Oa(h,s)<0)&&(s=h),Oa(b,s)<0&&(s=b),(!c||Oa(h,c)<0)&&(c=h),Oa(b,c)<0&&(c=b)}),{start:s,end:c}}var o=e.display,i=e.doc,s=document.createDocumentFragment(),c=Ut(e.display),u=c.left,l=Math.max(o.sizerWidth,zt(e)-o.sizer.offsetLeft)-c.right,d=\"ltr\"==i.direction,_=t.from(),m=t.to();if(_.line==m.line)f(_.line,_.ch,m.ch);else{var p=T(i,_.line),g=T(i,m.line),h=de(p)==de(g),b=f(_.line,_.ch,h?p.text.length+1:null).end,y=f(m.line,h?0:null,m.ch).start;h&&(b.top<y.top-2?(r(b.right,b.top,null,b.bottom),r(u,y.top,y.left,y.bottom)):r(b.right,b.top,y.left-b.right,b.bottom)),b.bottom<y.top&&r(u,b.bottom,null,y.top)}a.appendChild(s)}", "function SelectionGridLayoutCommand (graph) {\r\n if (arguments.length > 0) {\r\n\tthis.init(graph);\r\n }\r\n}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "clickPaneIcon(command){\n command.execute();\n\n this.getSelection().getRangeAt(0).collapse(false);\n this.checkSelection();\n }", "function main()\n{\n initCommand();\n global.mode = global.mode_NORMAL;\n global.firstRun = true;\n global.baseX = NaN;\n global.baseY = NaN;\n global.destX = NaN;\n global.destY = NaN;\n global.factor = NaN;\n\n global.baseRX = NaN;\n global.baseRY = NaN;\n global.destRX = NaN;\n global.destRY = NaN;\n global.factorRef = NaN;\n global.factorNew = NaN;\n\n if(numSelected() <= 0)\n {\n //TODO: Prompt to select objects if nothing is preselected\n setPromptPrefix(qsTr(\"Preselect objects before invoking the scale command.\"));\n appendPromptHistory();\n endCommand();\n messageBox(\"information\", qsTr(\"Scale Preselect\"), qsTr(\"Preselect objects before invoking the scale command.\"));\n }\n else\n {\n setPromptPrefix(qsTr(\"Specify base point: \"));\n }\n}", "function cxcommand(event, val) {\n if (val === undefined) val = event.currentTarget.id;\n var diagram = myDiagram;\n switch (val) {\n case \"cut\": diagram.commandHandler.cutSelection(); break;\n case \"copy\": diagram.commandHandler.copySelection(); break;\n case \"paste\": diagram.commandHandler.pasteSelection(diagram.lastInput.documentPoint); break;\n case \"delete\": diagram.commandHandler.deleteSelection(); break;\n case \"color\": {\n var color = window.getComputedStyle(document.elementFromPoint(event.clientX, event.clientY).parentElement)['background-color'];\n changeColor(diagram, color); break;\n }\n }\n diagram.currentTool.stopTool();\n }", "function visualiserAuteurControls(){\n var vControles = [\"lbledNomAuteur\",\"txtedNomAuteur\",\n \"lbledPreAuteur\",\"txtedPreAuteur\",\"lbledSaveAute\",\"btnedSaveAute\"];\n visualiserControls(\"btnedaddAute\" ,vControles,\"cboxedAute\");\n} // end visualiser", "delete() {\n this.domElement.innerText = \"\";\n }", "function SelectionUtil() {\n}", "function main()\n{\n initCommand();\n clearSelection();\n global.mode = global.mode_BACKGROUND;\n setPromptPrefix(qsTr(\"Enter RED,GREEN,BLUE values for background or [Crosshair/Grid]: \"));\n}", "static single(anchor, head = anchor) {\n return new EditorSelection([EditorSelection.range(anchor, head)], 0);\n }", "function visualiserEditeurControls(){\n //\"lbledPays\",\"cboxedPays\",\n var vControles = [\n \"lbledNomEditeur\", \"txtedNomEditeur\",\n \"lbledVille\", \"btnedaddVill\", \"cboxedVill\",\n \"lbledSaveEdit\",\"btnedSaveEdit\"//,\n //\"lbledaddVille\" , \"txtedaddVille\"\n ];\n visualiserControls(\"btnedaddEdit\",vControles,\"cboxedEdit\");\n} // end visualiser", "edit ({start, end, insert, postSelection}) {\n // Edit the text and lexify the results.\n this.text = this.text.slice(0, start) + insert + this.text.slice(end);\n this.tokens = lexify(this.text);\n\n // Re-render the syntax-highlighted result.\n\n let fragment = new DocumentFragment();\n let selector = new Selector(postSelection); // See the Selector class in the utilities section below.\n\n for (let token of this.tokens) {\n let node = document.createElement(\"span\");\n node.textContent = token.text;\n node.token = token;\n token.DOMNode = node;\n node.className = token.ASType.category;\n fragment.appendChild(node);\n selector.next(token);\n }\n\n this.DOMNodes.editor.innerHTML = \"\";\n this.DOMNodes.editor.appendChild(fragment);\n this.selection = postSelection;\n selector.setSelection(); // Update the actual text selection in the browser.\n\n this.DOMNodes.runButton.className = \"button disabled\"; // Disable the run button on edit - the user will need to re-build first.\n }", "doodle() {\n this.update()\n this.display()\n }", "function Editor()\n{\n \t document.getElementById('EDIT_a').innerHTML = '<img src=\"images/edit.png\" style=\"padding-right: 10px;\">EDIT';\n $(\".vis\").css(\"display\", \"block\");\n $(\".Drag\").css(\"display\", \"none\");\n $(\".Del\").css(\"display\", \"none\");\n}", "get codeButton() {\n return {\n command: \"wrapRange\",\n commandVal: \"CODE\",\n toggles: true,\n label: \"Code\",\n type: \"rich-text-editor-button\",\n };\n }", "function leftButtonSelect(cm, event, start, behavior) {\r\n var display = cm.display, doc = cm.doc;\r\n e_preventDefault(event);\r\n\r\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\r\n if (behavior.addNew && !behavior.extend) {\r\n ourIndex = doc.sel.contains(start);\r\n if (ourIndex > -1)\r\n { ourRange = ranges[ourIndex]; }\r\n else\r\n { ourRange = new Range(start, start); }\r\n } else {\r\n ourRange = doc.sel.primary();\r\n ourIndex = doc.sel.primIndex;\r\n }\r\n\r\n if (behavior.unit == \"rectangle\") {\r\n if (!behavior.addNew) { ourRange = new Range(start, start); }\r\n start = posFromMouse(cm, event, true, true);\r\n ourIndex = -1;\r\n } else {\r\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\r\n if (behavior.extend)\r\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\r\n else\r\n { ourRange = range$$1; }\r\n }\r\n\r\n if (!behavior.addNew) {\r\n ourIndex = 0;\r\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\r\n startSel = doc.sel;\r\n } else if (ourIndex == -1) {\r\n ourIndex = ranges.length;\r\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\r\n {scroll: false, origin: \"*mouse\"});\r\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\r\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\r\n {scroll: false, origin: \"*mouse\"});\r\n startSel = doc.sel;\r\n } else {\r\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\r\n }\r\n\r\n var lastPos = start;\r\n function extendTo(pos) {\r\n if (cmp(lastPos, pos) == 0) { return }\r\n lastPos = pos;\r\n\r\n if (behavior.unit == \"rectangle\") {\r\n var ranges = [], tabSize = cm.options.tabSize;\r\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\r\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\r\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\r\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\r\n line <= end; line++) {\r\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\r\n if (left == right)\r\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\r\n else if (text.length > leftPos)\r\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\r\n }\r\n if (!ranges.length) { ranges.push(new Range(start, start)); }\r\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\r\n {origin: \"*mouse\", scroll: false});\r\n cm.scrollIntoView(pos);\r\n } else {\r\n var oldRange = ourRange;\r\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\r\n var anchor = oldRange.anchor, head;\r\n if (cmp(range$$1.anchor, anchor) > 0) {\r\n head = range$$1.head;\r\n anchor = minPos(oldRange.from(), range$$1.anchor);\r\n } else {\r\n head = range$$1.anchor;\r\n anchor = maxPos(oldRange.to(), range$$1.head);\r\n }\r\n var ranges$1 = startSel.ranges.slice(0);\r\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\r\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\r\n }\r\n }\r\n\r\n var editorSize = display.wrapper.getBoundingClientRect();\r\n // Used to ensure timeout re-tries don't fire when another extend\r\n // happened in the meantime (clearTimeout isn't reliable -- at\r\n // least on Chrome, the timeouts still happen even when cleared,\r\n // if the clear happens after their scheduled firing time).\r\n var counter = 0;\r\n\r\n function extend(e) {\r\n var curCount = ++counter;\r\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\r\n if (!cur) { return }\r\n if (cmp(cur, lastPos) != 0) {\r\n cm.curOp.focus = activeElt();\r\n extendTo(cur);\r\n var visible = visibleLines(display, doc);\r\n if (cur.line >= visible.to || cur.line < visible.from)\r\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\r\n } else {\r\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\r\n if (outside) { setTimeout(operation(cm, function () {\r\n if (counter != curCount) { return }\r\n display.scroller.scrollTop += outside;\r\n extend(e);\r\n }), 50); }\r\n }\r\n }\r\n\r\n function done(e) {\r\n cm.state.selectingText = false;\r\n counter = Infinity;\r\n e_preventDefault(e);\r\n display.input.focus();\r\n off(document, \"mousemove\", move);\r\n off(document, \"mouseup\", up);\r\n doc.history.lastSelOrigin = null;\r\n }\r\n\r\n var move = operation(cm, function (e) {\r\n if (!e_button(e)) { done(e); }\r\n else { extend(e); }\r\n });\r\n var up = operation(cm, done);\r\n cm.state.selectingText = up;\r\n on(document, \"mousemove\", move);\r\n on(document, \"mouseup\", up);\r\n}", "function Borrar(){\n\tcalGuiasRemoveSelection();\n}", "activate() {\n if (!this.ready) {\n return;\n }\n\n const cmdstr = this._inputController.$commandInput.val();\n // remember initial selection/cursor state, in case of reset\n this.initialRange = {\n start: this._inputController.$commandInput.prop('selectionStart'),\n end: this._inputController.$commandInput.prop('selectionEnd')\n };\n // target range of command input to ingest and replace\n this.targetRange = Object.assign({}, this.initialRange);\n\n // cursor/selection left boundary adjustment\n if (this.targetRange.start > 0) { // guarantees index (start - 1) is valid\n if (this.targetRange.start === this.targetRange.end) { // cursor\n if (!AUTOCOMPLETE_REGEXP.WHITESPACE.test(cmdstr.charAt(this.targetRange.start - 1))) {\n // cursor at mid token or touching right edge of a token\n this._growTargetRangeLeft(cmdstr, this.targetRange);\n }\n } else { // selection, guarantees index (start + 1) is valid\n const leftBoundary = cmdstr.slice(this.targetRange.start - 1, this.targetRange.start + 1);\n if (AUTOCOMPLETE_REGEXP.TOKEN_MID.test(leftBoundary)) {\n // selection left boundary at mid token\n this._growTargetRangeLeft(cmdstr, this.targetRange);\n } else if (AUTOCOMPLETE_REGEXP.TOKEN_END.exec(leftBoundary)?.index === 0) { // using test() gives spurious match\n // selection left boundary touching right edge of a token\n // exclude one space for UI aesthetics\n this.targetRange.start += 1;\n }\n }\n }\n\n // cursor/selection right boundary adjustment\n if (this.targetRange.end < cmdstr.length && // guarantees index (end + 1) is valid\n this.targetRange.start < this.targetRange.end && // guarantees index (end - 1) is valid; cursor start already moved\n AUTOCOMPLETE_REGEXP.TOKEN_MID.test(cmdstr.slice(this.targetRange.end - 1, this.targetRange.end + 1))\n ) {\n // cursor/selection right boundary at mid token\n this._growTargetRangeRight(cmdstr, this.targetRange);\n }\n\n // find first token in whole command string, if any\n const { index: firstChar, 1: firstToken } = AUTOCOMPLETE_REGEXP.FIRST_TOKEN.exec(cmdstr) ?? {};\n\n // is the first token an aircraft callsign?\n const aircraft = this._aircraftController.findAircraftByCallsign(firstToken);\n\n // if (aircraft) {\n // TODO: if so, be clever and filter suggestions depending on departure/arrival and flight phase\n // }\n\n // may require additional space for correct positioning\n let extraPad = '';\n\n // determine command type to autocomplete\n if (firstChar === undefined) {\n // empty/blank command string\n this.commandType = AUTOCOMPLETE_COMMAND_TYPE.SYSTEM;\n } else if (this.targetRange.start <= firstChar) {\n // cursor/selection before or includes first token\n if (aircraft) {\n // first token is callsign, exclude it\n let startWithoutCallsign = firstChar + firstToken.length + 1;\n\n // callsign not guaranteed to be followed by whitespace, i.e. cmdstr may match ^\\s*<callsign>$\n if (startWithoutCallsign > cmdstr.length) {\n startWithoutCallsign = cmdstr.length;\n extraPad = ' ';\n }\n\n this.targetRange.start = startWithoutCallsign;\n this.targetRange.end = Math.max(this.targetRange.start, this.targetRange.end);\n this.commandType = AUTOCOMPLETE_COMMAND_TYPE.TRANSMIT;\n } else {\n // first token is not callsign\n this.commandType = AUTOCOMPLETE_COMMAND_TYPE.SYSTEM;\n }\n } else {\n // cursor/selection outside first token\n this.commandType = AUTOCOMPLETE_COMMAND_TYPE.TRANSMIT;\n }\n\n this._updateState(AUTOCOMPLETE_STATE.COMMANDS.NO_MATCHES);\n this.$autocompleteSpacer.text(cmdstr.slice(0, this.targetRange.start).concat(extraPad));\n this.$autocompleteInput.val(cmdstr.slice(this.targetRange.start, this.targetRange.end));\n this.$autocompleteInput.attr('placeholder', AUTOCOMPLETE_INPUT_PLACEHOLDER.COMMAND);\n this.onAutocompleteInputChangeHandler();\n this.$autocomplete.addClass('active');\n this.$autocompleteInput.focus();\n this.active = true;\n }", "function DiBlock()\r\n{\r\n this.objectName = \"Di\";\r\n\tvar tag=prompt(\"Enter tagname\",\"tagname\");\r\n\tthis.text=tag;\r\n\tthis.divHeight=16;\r\n\tthis.divWidth=120;\r\n}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend); }\n else\n { ourRange = range; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range.anchor, anchor) > 0) {\n head = range.head;\n anchor = minPos(oldRange.from(), range.anchor);\n } else {\n head = range.anchor;\n anchor = maxPos(oldRange.to(), range.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }", "function $A(){var t=this;ze(this);var e=ki(this.$interaction,\"select\");this.subscribeTo(e,function(e){var n=e.selected,i=e.deselected,r=e.mapBrowserEvent;++t.rev,i.forEach(function(e){return t.$emit(\"unselect\",{feature:e,mapBrowserEvent:r})}),n.forEach(function(e){return t.$emit(\"select\",{feature:e,mapBrowserEvent:r})}),t.$emit(\"update:features\",t.$features.map(t.writeFeatureInDataProj.bind(t)))})}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head);\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(document, \"mousemove\", move);\n off(document, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (!e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(document, \"mousemove\", move);\n on(document, \"mouseup\", up);\n}", "function pr(e,t,a,n,r){null==r&&(r=e.cm&&(e.cm.display.shift||e.extend)),wr(e,new Oi([mr(e.sel.primary(),t,a,r)],0),n)}", "function InsertCommand(tag, html) {\n this.name = tag;\n this.execute = function() {\n var doc = this.iframe[0].document || this.iframe[0].contentWindow.document || document;\n doc.execCommand('insertHTML', false, html);\n };\n this.isActive = angular.noop;\n this.setDocument = setDocument;\n }", "function vi(a,b,c,d){this.type=a;this.name=b;this.A=c;this.qa=d;this.xb=[];this.align=-1;this.$a=!0}", "function SelectionRegion() {}", "function SelectionRegion() {}", "function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n // If e is null or undefined we interpret this as someone trying\n // to explicitly cancel the selection rather than the user\n // letting go of the mouse button.\n if (e) {\n e_preventDefault(e);\n display.input.focus();\n }\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }" ]
[ "0.57468754", "0.5725755", "0.55267805", "0.5523348", "0.54878247", "0.5474703", "0.54729706", "0.54729706", "0.54729706", "0.5450901", "0.54365885", "0.54100114", "0.5386975", "0.5386975", "0.5369358", "0.53533083", "0.5340448", "0.5322874", "0.5317607", "0.5278826", "0.52778685", "0.5277497", "0.52715105", "0.52703077", "0.526875", "0.52634215", "0.52625406", "0.5245091", "0.5239643", "0.5236851", "0.5226196", "0.5199258", "0.51950014", "0.51950014", "0.51697415", "0.51658607", "0.5151748", "0.51446354", "0.51446354", "0.51446354", "0.5143752", "0.51266015", "0.51264584", "0.5119781", "0.5119781", "0.51182425", "0.5111075", "0.51039875", "0.51017296", "0.50902224", "0.50899804", "0.50863224", "0.50835156", "0.5079766", "0.5067516", "0.50633895", "0.50555736", "0.50546736", "0.5039534", "0.5037918", "0.50306743", "0.50306743", "0.50306743", "0.50306743", "0.5025053", "0.5024638", "0.50209343", "0.5013494", "0.5007567", "0.4999764", "0.4992259", "0.4985748", "0.49763876", "0.49737215", "0.49727648", "0.4972349", "0.49706018", "0.4965924", "0.49600732", "0.49571183", "0.4945879", "0.4935235", "0.4935235", "0.4934711", "0.49327093", "0.49327093", "0.49327093", "0.49327093", "0.49327093", "0.49327093", "0.49327093", "0.49327093", "0.49327093", "0.49327093", "0.49327093", "0.49304396", "0.49298352", "0.49289292", "0.49206233", "0.49206233", "0.49198368" ]
0.0
-1
Sets node data when the component mounts.
componentDidMount() { this.setNodeData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assignData(node, data) {\n node.__data__ = data;\n}", "setNodeData() {\n const curNode = this.props.node;\n this.setState({\n ref: curNode.getRef(),\n fetching: true,\n asserts: [],\n invAsserts: [],\n elemClass: '',\n });\n\n API.getElemClass(curNode).then((elemClass) => {\n this.setState({elemClass: elemClass})\n });\n\n curNode.fetchRemoteData().then(() => {\n this.setState({\n asserts: curNode.assertions,\n invAsserts: curNode.invAssertions,\n fetching: false,\n });\n });\n }", "function setNodes(data){\n payload = data;\n\n if(kontx.args.deep === true){\n async.eachSeries(data, loadChild, sendNext);\n }\n else {\n sendNext();\n }\n }", "componentDidMount() {\n const {width, height } = this.props;\n\n d3.forceSimulation(data.nodes)\n .force(\"links\", d3.forceLink(data.links).distance(50))\n .force(\"charge\", d3.forceManyBody().strength(-120))\n .force('center', d3.forceCenter(width / 2, height / 2));\n\n const svg = d3.select(this.refs.mountPoint)\n .append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n\n const link = svg.selectAll('line')\n .data(data.links)\n .enter()\n .append('line')\n .style('stroke-width', 3.5)\n .style('stroke', '#030100')\n .style('stroke-opacity', 0.6);\n\n const node = svg.selectAll(\"circle\")\n .data(data.nodes)\n .enter()\n .append(\"circle\")\n .attr(\"r\", 10)\n .style('stroke', '#FFFFFF')\n .style('stroke-width', 3.5)\n .style(\"fill\", function(d){ return d.color});\n /* .style(\"fill\",function() {\n return \"hsl(\" + Math.random() * 360 + \",100%,50%)\";\n });*/\n\n node.append(\"text\")\n .attr(\"x\", function(d) { return d.x-30; })\n .attr(\"y\", function(d) { return d.y; })\n .text(function (d) { return d.text; });\n\n\n d3.forceSimulation().on('tick', () => {\n link\n .attr(\"x1\", function(d) {\n return d.source.x;\n })\n .attr(\"y1\", function(d) {\n return d.source.y;\n })\n .attr(\"x2\", function(d) {\n return d.target.x;\n })\n .attr(\"y2\", function(d) {\n return d.target.y;\n });\n\n node\n .attr(\"cx\", function(d) {\n return d.x;\n })\n .attr(\"cy\", function(d) {\n return d.y;\n })\n });\n\n console.log(data.nodes);\n console.log(data.links);\n }", "componentDidMount() {\n this.setData();\n }", "componentWillMount() {\n console.log('before initData call');\n this.initData(); \n\t}", "init(node) {\n const properties = node.props;\n const eid = properties.id;\n const data_node = {\n eid,\n type: node.type,\n name: properties.name,\n children: reduce(properties.children, (acc, child) => { if (is.not.string(child)) {\n acc.push(child.props.id);\n } return acc; }, []),\n };\n this.bitmasks[eid] = BitSet.create();\n this.views[eid] = Reflect.getMetadata('link:structure-view', node); // link view hacky\n this.add('node', eid, data_node);\n this.add('transform', eid);\n each(properties, (data, name_cell) => {\n name_cell = startsWith(name_cell, 'c-') ? rightOf(name_cell, 'c-') : '';\n if (!name_cell) {\n return;\n } // continue\n this.add(name_cell, eid, data);\n });\n each(properties.children, (child) => {\n if (is.string(child)) {\n return;\n }\n this.init(child);\n });\n return this;\n }", "function precacheNode(inst, node) {\n\t\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t\t hostInst._hostNode = node;\n\t\t node[internalInstanceKey] = hostInst;\n\t\t}", "function precacheNode(inst, node) {\n\t\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t\t hostInst._hostNode = node;\n\t\t node[internalInstanceKey] = hostInst;\n\t\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "function precacheNode(inst, node) {\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\n\t hostInst._hostNode = node;\n\t node[internalInstanceKey] = hostInst;\n\t}", "set data(data) {\n this.props.variant = data.variant;\n this.props.iconUrl = data.iconUrl;\n this.props.size = data.size || \"MEDIUM\" /* MEDIUM */;\n this.setDisabledProperty(data.disabled || false);\n ComponentHelpers.ScheduledRender.scheduleRender(this, this.boundRender);\n }", "function precacheNode(inst, node) {\r\n\t var hostInst = getRenderedHostOrTextFromComponent(inst);\r\n\t hostInst._hostNode = node;\r\n\t node[internalInstanceKey] = hostInst;\r\n\t}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}", "function precacheNode(inst, node) {\n var hostInst = getRenderedHostOrTextFromComponent(inst);\n hostInst._hostNode = node;\n node[internalInstanceKey] = hostInst;\n}" ]
[ "0.6853854", "0.6525394", "0.6380003", "0.58837354", "0.5823948", "0.58108044", "0.5785606", "0.5751807", "0.5751807", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57361555", "0.57311845", "0.5703742", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626", "0.57036626" ]
0.7599304
0
Loads data to display for the node passed in through props. This includes fetching the remote data from DC KG for the node.
setNodeData() { const curNode = this.props.node; this.setState({ ref: curNode.getRef(), fetching: true, asserts: [], invAsserts: [], elemClass: '', }); API.getElemClass(curNode).then((elemClass) => { this.setState({elemClass: elemClass}) }); curNode.fetchRemoteData().then(() => { this.setState({ asserts: curNode.assertions, invAsserts: curNode.invAssertions, fetching: false, }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadData() {\n fetch(postLink)\n .then(e => e.json())\n .then(showData);\n}", "fetchData() {\n this.initLoading();\n this.setAndGetInstanceFromSandBox(this.view, this.qs_url).then(instance => {\n this.setLoadingSuccessful();\n this.data.instance = instance;\n }).catch(error => {\n this.setLoadingError(error);\n debugger;\n });\n\n this.getParentInstancesForPath();\n }", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "loadData() {\n\n var self = this;\n this.selected_node = null;\n\n $.ajax({\n url: '/pipeline/' + self.id + '/structure'\n }).done(function(resp) {\n\n var auxNodes = [];\n for (i = 0; i < resp.nodes.length; i++) {\n\n var node = new Node(\n resp.nodes[i].id,\n resp.nodes[i].name,\n resp.nodes[i].hierarchy_level,\n self,\n resp.nodes[i].type\n );\n\n // The first node is the starting one so we show\n // a different icon only for this node.\n if (i == 0) {\n node.type = 'start';\n }\n\n self.nodes.push(node);\n auxNodes.push(node.toVisObject());\n }\n\n var auxConnections = [];\n for (i = 0; i < resp.connections.length; i++) {\n auxConnections.push({\n from: resp.connections[i].from_node_id,\n to: resp.connections[i].to_node_id\n });\n }\n\n\n var nodes = new vis.DataSet(auxNodes);\n var edges = new vis.DataSet(auxConnections);\n\n self.data = {\n nodes: nodes,\n edges: edges\n };\n\n self.initNetwork();\n });\n }", "function fetchData() {\n let targetEl = this,\n url = `/svgdata/${this.dataset.target}`;\n\n fetch(url)\n .then(res => res.json())\n .then(data => {\n console.log(data);\n\n //populate the popover\n buildPopover(data, targetEl);\n })\n\n .catch((err) => console.log(err));\n }", "fetchData() {\n this.initLoading();\n this.getInstance(this.view, this.qs_url).then(instance => {\n this.setLoadingSuccessful();\n this.data.instance = instance;\n\n if(this.view.schema.autoupdate) {\n this.startAutoUpdate();\n }\n }).catch(error => {\n debugger;\n this.setLoadingError(error);\n });\n\n this.getParentInstancesForPath();\n }", "function fetchData() {\n let targetElement = this,\n url = `./includes/connect.php?id=${this.dataset.target}`;\n\n fetch(url)\n .then(res => res.json())\n .then(data => {\n console.log(data);\n buildPopover(data, targetElement);\n })\n .catch((err) => console.log(err));\n }", "async fetchData() {\n const {siteUrl} = this.props;\n try {\n this.GhostApi = setupGhostApi({siteUrl});\n const {site, member} = await this.GhostApi.init();\n site.is_stripe_configured = (site.is_stripe_configured === undefined) || site.is_stripe_configured;\n const stripeParam = this.getStripeUrlParam();\n const {page, showPopup = false} = this.getDefaultPage({member, stripeParam});\n this.setState({\n site,\n member,\n page,\n showPopup,\n action: 'init:success',\n initStatus: 'success'\n });\n } catch (e) {\n /* eslint-disable no-console */\n console.error(`[Members.js] Failed to initialize`);\n /* eslint-enable no-console */\n this.setState({\n action: 'init:failed',\n initStatus: 'failed'\n });\n }\n }", "async function hentData() {\n const respons = await fetch(link);\n products = await respons.json();\n vis(products);\n}", "function loadData() {\n // set all our variables\n setVars(twitch.configuration)\n // do an initial browse to `/`(root)\n navigate()\n // remove our loading element from the DM\n removeElement(\"repo-loading\")\n}", "fetchData() {\n this.initLoading();\n\n this.setFilters(this.qs_url, this.generateBaseFilters());\n this.data.filters = this.getFilters(this.qs_url);\n\n let qs = this.setQuerySet(this.view, this.qs_url).filter(this.getFiltersPrepared(this.qs_url)).prefetch();\n this.setQuerySet(this.view, this.qs_url, qs);\n\n this.getInstancesList(this.view, this.qs_url).then(instances => {\n this.setLoadingSuccessful();\n\n this.setInstancesToData(instances);\n\n if(this.view.schema.autoupdate) {\n this.startAutoUpdate();\n }\n\n }).catch(error => {\n this.setLoadingError(error);\n });\n\n this.getParentInstancesForPath();\n }", "function loadRemoteData() {\n\n\t\t// The comment service returns a promise.\n\t\tUserservice.getUsers().then(function(Users) {\n\n\t\t\tapplyRemoteData(Users);\n\n\t\t});\n\n\t}", "fetchData() {\n fetch('/techniques/' + this.props.id + \"/\" + this.props.location)\n .then(res => res.json())\n .then(data => this.setState({links: data}));\n }", "function loadRemoteData() {\n\n\t\t// The comment service returns a promise.\n\t\tUserservice.getComments().then(function(Comments) {\n\n\t\t\tapplyRemoteData(Comments);\n\n\t\t});\n\n\t}", "function loadRemoteData() {\n \ttagService.getTags().then(\n function( tags ) {\n applyRemoteData( tags );\n });\n }", "async connectedCallback() {\n let request = new XMLHttpRequest();\n request.open('GET', jsonData, false);\n request.send(null);\n this.data = JSON.parse(request.responseText);\n // turns out that github does not provide \n // unauthenticated access to public repos over rest\n // Thank you github. Hence cannot fatch Data using the Fetch API \n //const data = await fetchDataHelper({ amountOfRecords: 100 });\n //this.data = data;\n this.calculateData();\n }", "function loadNodeInfo(){\n $.ajax({\n url:'node_layout/',\n type: 'GET',\n async: true,\n cache: false,\n statusCode: {\n 500: function(){\n alert('Unable to retrieve node information');\n }\n },\n success: function(response){\n nodeInfo = jQuery.parseJSON(response);\n console.log(nodeInfo);\n }\n });\n }", "function init() {\n fetchData();\n}", "function loadData(props) {\n // Load up information about the login form.\n props.loadForm(FORM_ID)\n // Also load information about the user/email?\n}", "async fetchContent() {\n this.srcAssigned = true;\n try {\n this.data = await dxp.api(this.src);\n this.assignContent();\n }\n catch (e) {\n dxp.log.error(this.container.tagName, 'fetchContent()', `cms fetch failed for ${this.src}`, e);\n this.srcFailed.emit({ src: this.src });\n }\n }", "function loadRemoteData() {\n\n\t\t// The comment service returns a promise.\n\t\tUserservice.getEditedComments().then(function(EditedComments) {\n\n\t\t\tapplyRemoteData(EditedComments);\n\n\t\t});\n\n\t}", "function loadRemoteData() {\n\n\t\t// The comment service returns a promise.\n\t\tUserservice.getCorrelationData().then(function(correlationData) {\n\n\t\t\tapplyRemoteData(correlationData);\n\n\t\t});\n\n\t}", "function loadData(){\n // Request Endpoint\n var endpoint = '/network/'+network_id;\n // Use .ajax() to make an HTTP request from JS\n $.ajax({\n type: 'GET',\n url: endpoint,\n dataType: \"json\",\n success: function(response_data) {\n // Called when successful\n //console.log(\"Network Info\");\n //console.log(data);\n parseNetworkData( response_data );\n },\n error: function(e) {\n // Called when there is an error\n console.log(e.message);\n }\n });\n}", "fetchNodeData() {\n // makes an ajax request to the server with the current category or thing id\n // the request should return some json data with the details of the current node plus the details of its children\n // the returned data is saved to this store\n const request = new XMLHttpRequest();\n request.open('GET', '/node/' + this.id, true);\n request.send();\n\n const self = this;\n request.onreadystatechange = function(){\n if (request.readyState == 4) {\n const response = JSON.parse(request.responseText);\n self.node = response.node;\n console.log(response.children);\n self.children = response.children;\n self.emit('change');\n }\n };\n }", "function getData() {\n openWebEocSession();\n var data = new XMLHttpRequest();\n data.open('GET', baseURL + boardURL, true);\n data.onload = function () {\n if (this.status == 200) {\n let allData = JSON.parse(this.responseText);\n populateAllVariables(allData);\n }\n }\n data.send();\n\n\n}", "function getData() {\n animate();\n \n var url = window.API.getAPIUrl(\"comps\");\n \n //url += \"?env=development\"; //When needed the development branch, for lab.fermat.org\n\n window.API.getCompsUser(function (list){ \n\n window.loadMap(function() {\n\n window.tileManager.JsonTile(function() {\n\n window.preLoad(function() {\n\n window.tileManager.fillTable(list);\n TWEEN.removeAll();\n window.logo.stopFade();\n window.helper.hide('welcome', 1000, true);\n init();\n\n });\n });\n });\n });\n\n \n//Use when you don't want to connect to server\n/*setTimeout(function(){\n var l = JSON.parse(testData);\n \n window.preLoad(function() {\n \n window.tileManager.JsonTile(function() {\n \n window.loadMap(function() {\n tileManager.fillTable(l);\n\n TWEEN.removeAll();\n logo.stopFade();\n init();\n });\n })\n });\n\n }, 6000);*/\n}", "function getData() {\n animate();\n \n var url = window.API.getAPIUrl(\"comps\");\n \n //url += \"?env=development\"; //When needed the development branch, for lab.fermat.org\n\n window.API.getCompsUser(function (list){ \n\n window.loadMap(function() {\n\n window.tileManager.JsonTile(function() {\n\n window.preLoad(function() {\n\n window.tileManager.fillTable(list);\n TWEEN.removeAll();\n window.logo.stopFade();\n window.helper.hide('welcome', 1000, true);\n init();\n\n });\n });\n });\n });\n\n \n//Use when you don't want to connect to server\n/*setTimeout(function(){\n var l = JSON.parse(testData);\n \n window.preLoad(function() {\n \n window.tileManager.JsonTile(function() {\n \n window.loadMap(function() {\n tileManager.fillTable(l);\n\n TWEEN.removeAll();\n logo.stopFade();\n init();\n });\n })\n });\n\n }, 6000);*/\n}", "componentDidMount(){\n fetch(\"https://nifty-henrys.000webhostapp.com/Show_Product.php\")\n .then(response => response.json())\n .then((responseJson)=> {\n this.setState({\n loading: false,\n dataSource: responseJson\n })\n })\n .catch(error=>console.log(error)) //to catch the errors if any\n }", "function getData(){\r\n url = URL_COMMON + \"/current_config/\";\r\n fetch(url).then( response => response.json())\r\n .then( data => {\r\n console.log(data);\r\n appendData(data);\r\n })\r\n .catch( err => {\r\n console.log('error: ' + err);\r\n });\r\n\r\n}", "fetchData() {\n this.props.fetchData(this.props.query);\n }", "async loadpropertyView() {\n this.wait(\".content\");\n try {\n import(\"./subcomp/property-view.js\");\n const res = await axios.post(`${this.host}/property/get-own`, {\n ...this.authData(),\n });\n\n if (res.data.length < 1) {\n this._qs(\".content\").innerHTML = this.notFound;\n } else {\n this._qs(\".content\").innerHTML = \"\";\n res.data.forEach((item) => {\n this._qs(\".content\").innerHTML += `\n <property-view \n id=\"${item.property_id}\"\n data-data=\"${this.encode(item)}\"\n overview='true'\n >\n </property-view>\n `;\n });\n }\n } catch (err) {\n console.log(err);\n this.unwait(\".content\");\n }\n }", "static fetchData(store, props, host) {\n return store.dispatch(fetchListFromServer(props.location.query.search, host))\n }", "async function loadData(ctx) {\n let data = { props: {} };\n\n const { orderNo } = ctx.query;\n const orderData = await getOrderFullDetail({ ctx, data, orderNo });\n data.props = orderData;\n return data;\n}", "async fetchData() {\n let data = await (await fetch(\"http://localhost:8080/short\")).json();\n let elems = [];\n data.forEach(item => elems.push(this.createElements(item)));\n this.addToNav(elems);\n }", "async function getData() {\n await fetchingData(\n endP({ courseId }).getCourse,\n setCourse,\n setIsFetching\n );\n\n await fetchingData(\n endP({ courseId }).getGroups,\n setGroups,\n setIsFetching\n );\n }", "componentDidMount() {\n const url =\n 'http://localhost:8080/god/findallprofiles'\n\n fetch(url)\n .then(result => result.json())\n .then(result => {\n console.log(result)\n this.props.initialLoad(result.data)\n })\n }", "_doFetch() {\n\t\tthis.emit(\"needs_data\", this);\n\t}", "function getData(data) {\n console.log(\"data is loaded\");\n console.log(data);\n\n // refresh the time and date\n setDateAndTime();\n\n // send data to components\n showQueue(data.queue);\n showStockStatus(data.storage);\n showOrders(data.queue, data.serving);\n\n // set which bartender is serving each order\n setBartender(data.bartenders);\n\n // set the icon for each bartender\n setBartenderIcon();\n}", "loadData(){\n\t\tlet thisStore = this;\n\t\tClient.fetchBugs(bugs => {\n\t\t\tthis.bugs = bugs;\n\t\t\t//timeout required upon app loading, but no lag due to listening for data load completing\n\t\t\t//data will be loaded into the state of app.jsx\n\t\t\tsetTimeout(function(){thisStore.emit('DATA_LOADED')}, 250);\n\t\t});\n\t}", "function loadData(path){\n setLoader();\n fetch(path)\n .then(function(response) {return response.json()})\n .then(function(json){\n createMainContainer(json);\n getCharPhoto(json)\n getCharInfo(json);\n getSuplData(json);\n removeLoader();\n })\n .catch(function(error){\n console.log(error.message);\n });\n}", "function fetchData() {\n\tshowLoader(); // invoke loader\n\tfetch('https://api.magicthegathering.io/v1/cards?random=true&pageSize=100&language=English')\n\t\t.then((response) => response.json())\n\t\t.then((data) => {\n\t\t\thideLoader(); // invoke hide loader func\n\t\t\tconsole.log(data);\n\t\t\tdataArr = data.cards.slice();\n\t\t\tconsole.log(dataArr); // test\n\t\t\tloadArr = dataArr.slice(0, n);\n\t\n\t\t\trenderCardList(loadArr);\n\t\t\tbtnLoadMore.style.display = 'block'; // show load more button\n\t\t});\n}", "componentDidMount() {\n\t\tthis.fetchDataFromUrl(this.props.url);\n\t}", "fetchData(newProps = this.props) {\n this._fetchListViewData(\n newProps,\n newProps.DEFAULT_PAGE,\n newProps.DEFAULT_PAGE_SIZE,\n newProps.DEFAULT_SORT_TYPE,\n newProps.DEFAULT_SORT_COL\n )\n }", "function fetchData (sendQuery) {\n var http = new XMLHttpRequest();\n http.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n var jsonData = JSON.parse(http.responseText);\n if (jsonData != null) {\n displayData(jsonData);\n }\n }\n };\n http.open('GET', sendQuery, true);\n http.send();\n}", "async function getData() {\n cardsDiv.innerHTML = `<h1>loading..</h1>`;\n const response = await fetch(endPoint);\n const data = await response.json();\n return data.data;\n}", "function _loadRemoteData() {\n $scope.isLoading = true;\n\n QueryService.getAvailableQueries(\"offers\")\n .then(function(result) {\n serveResult(result);\n })\n .catch(function(error) {\n console.log(error);\n alert('wystąpil błąd...');\n })\n .finally(function() {\n $scope.isLoading = false;\n });\n }", "function loadRemoteData() {\n // The friendService returns a promise.\n friendService.getFriends()\n .then(\n function( friends ) {\n applyRemoteData( friends );\n }\n )\n ;\n }", "async function getDisplayData() {\n const url = '/api/displays/data';\n const response = await fetch(url);\n const details = await response.json();\n\n displayContents = await fetchFileAsText('/displays/' + details.file);\n displayName = details.name;\n displayFile = details.file;\n displayTimer = (details.timer * 60) * 1000;\n displayModified = details.modified;\n\n document.title = displayName;\n displayRefresh = setInterval(serverCheckIn, displayTimer);\n\n console.log(\"HUB: Initial check in complete\");\n console.log(\"HUB: Display is named '\" + displayName + \"'\");\n console.log(\"HUB: Display is serving \" + displayFile);\n console.log(\"HUB: Display check in timer set to \" + details.timer + \" minutes\");\n}", "async load() {\n log.info(this);\n // Get Host Objects\n\n // Check if NetData is available on the server, install it if it is not.\n await this.getNetDataStatus();\n\n // Configure NetData receiver on XOA vm\n await this.configureXoaToReceiveData();\n \n const host_param = { host: { type: \"string\" }};\n const can_administrate_host = { host: ['host', 'host', 'administrate'] };\n\n // Method Definitions\n const methods = {\n isConfiguredToReceiveStreaming: {\n description: 'Check if the XOA host has the expected stream configuration.',\n permission: 'admin'\n }, configureXoaToReceiveData: {\n description: 'Install and configure NetData on XOA VM.',\n permission: 'admin'\n }, getLocalApiKey: {\n description: 'Get the UUID of the XOA VM, used as the api key by all hosts.',\n permission: 'admin'\n }, configureHostToStreamHere: {\n description: 'Call the XAPI methods to setup NetData on a given host and stream data to XOA',\n permission: 'admin',\n params: host_param,\n resolve: can_administrate_host\n }, isNetDataInstalledOnHost: {\n description: 'Check if NetData service is installed on the given host machine.',\n permission: 'admin',\n params: host_param,\n resolve: can_administrate_host\n }, getHostApiKey: {\n description: 'Get the API Key that is a given host is streaming with.',\n permission: 'admin',\n params: host_param,\n resolve: can_administrate_host\n }, installNetData: {\n description: 'Install latest up-stream NetData package.',\n permission: 'admin'\n }};\n\n const apiMethods = Object.entries(methods).map(([method_name, attributes]) => {\n const method = (params) => this[method_name](params);\n for (const [key, value] of Object.entries(attributes)) {\n method[key] = value\n };\n return [method_name, method]\n });\n\n this._unsetApiMethods = this._xo.addApiMethods({\n netdata: Object.fromEntries(apiMethods)\n });\n }", "componentDidMount() {\n\t this.fetchData(this.props);\n }", "async function fetchData() {\n\n // get the datasets.json data\n const url = withPrefix('/data/datasets.json')\n const resp = await fetch(url)\n const datasets = await resp.json()\n\n // sort the datasets by added date, descending\n datasets.sort((a, b) => new Date(b.added) - new Date(a.added))\n\n // update the display with latest data\n setDatasets(datasets)\n setFiltered(datasets.map(d => d.slug))\n setSubjects(getSubjects(datasets))\n setStart(getEarliestDate(datasets))\n }", "function retriveData() {\r\n jqueryNoConflict.getJSON(dataSource, renderLocationScreen);\r\n }", "function get_data() {}", "componentDidMount() {\n this.fetchData(specialsUrl)\n }", "async loadData() {\n this.setState({\n data: await get()\n })\n }", "async function loadData(name) {\n const url = `https://www.themealdb.com/api/json/v1/1/search.php?s=${name}`;\n const response = await fetch(url)\n const data = await response.json()\n displayData(data);\n}", "function loadData() {\n system.isLoading = true;\n\n $.ajax({\n url: system.apiURL,\n dataType: 'jsonp',\n success: onLoadData\n });\n\n }", "componentDidMount() {\n console.log(this.props);\n this.loadData();\n }", "componentDidMount() {\n const {deployed} = this.props.model;\n this.fetchData(deployed);\n }", "function initData(){\n container.prepend(progressInfo);\n jQuery.get(getPageURL(0, resource)).done(function(data) {\n records = processData(data, true);\n initView(new recline.Model.Dataset({records:records}));\n numReq = getRequestNumber(data.result.total, pageSize);\n for (var i = 1; i <= numReq; i++) {\n requestData(getPageURL(i, resource));\n };\n });\n }", "function getData() {\n fetch(url)\n // This is a callback function\n .then(function (u) {\n return u.json();\n })\n // Setting the global jsondata variable\n .then(function (json) {\n jsondata = json;\n\n // Call processDataCallback\n processDataCallback();\n\n document.getElementById('loader').style = \"display: none\";\n document.getElementById('data-content').style = \"\";\n\n // getTableData();\n createTable();\n });\n}", "function getData() {\r\n\tvar apiURL = HAM.config.apiBaseURL + \r\n\t\t\t\"/object?apikey=\" + HAM.config.apiKey + \r\n\t\t\t\"&s=random&color=any&size=1&q=dimensions:*&fields=title,people,culture,dated,dimensions,colors,imagepermissionlevel,primaryimageurl\";\r\n\r\n\tvar xmlrequest = new XMLHttpRequest();\r\n\r\n\txmlrequest.onreadystatechange = function() {\r\n\t\tif (this.readyState == 4) {\r\n\t\t\tif (this.status == 200) {\r\n\t\t\t\tcurrent = JSON.parse(this.responseText);\r\n\t\t\t\tprocessData(current);\r\n\t\t\t} else {\r\n\t\t\t\tdone = true;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\t\t\r\n\txmlrequest.open(\"GET\", apiURL, true);\r\n\txmlrequest.send();\r\n\r\n\txmlrequest = null;\r\n\tapiURL = null;\r\n}", "async function fetchData() {\n // tutorials().then((resTutorials) => {\n // resTutorials.forEach((elem) => {\n // idVideo = elem.ttr_src.substring(30, elem.ttr_src.length);\n // menuFilter = auxTreeTutorial.filter((e) => e.title == elem.application_display_name);\n // if (auxTreeTutorial.filter((e) => e.title == elem.application_display_name).length > 0) {\n // menuFilter[0].videos.push({ title: elem.ttr_title, idVideo, description: elem.ttr_description });\n // } else {\n // auxTreeTutorial.push({ title: elem.application_display_name, videos: [{ title: elem.ttr_title, idVideo, description: elem.ttr_description }] });\n // }\n // });\n // // setVideoOnDisplay({ tutorial: response.data[0].application_display_name, video: response.data[0].ttr_title });\n // setIdPlayer('0');\n // });\n }", "function loadNodeDataFields(jsonData)\n{\n}", "loadComponent(nodeURI, baseURI, callback_async /* nodeDescriptor */, errback_async /* errorMessage */) { // TODO: turn this into a generic xhr loader exposed as a kernel function?\n\n let self = this;\n\n if (nodeURI == self.kutility.protoNodeURI) {\n\n callback_async(self.kutility.protoNodeDescriptor);\n\n } else if (nodeURI.match(RegExp(\"^data:application/json;base64,\"))) {\n\n // Primarly for testing, parse one specific form of data URIs. We need to parse\n // these ourselves since Chrome can't load data URIs due to cross origin\n // restrictions.\n\n callback_async(JSON.parse(atob(nodeURI.substring(29)))); // TODO: support all data URIs\n\n } else {\n\n self.virtualTime.suspend(\"while loading \" + nodeURI); // suspend the queue\n\n let fetchUrl = self.remappedURI(nodeURI, baseURI);\n let dbName = fetchUrl.split(\".\").join(\"_\");\n\n const parseComp = function (f) {\n\n let result = JSON.parse(f);\n\n let nativeObject = result;\n // console.log(nativeObject);\n\n if (nativeObject) {\n callback_async(nativeObject);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n\n } else {\n\n self.logger.warnx(\"loadComponent\", \"error loading\", nodeURI + \":\", error);\n errback_async(error);\n self.virtualTime.resume(\"after loading \" + nodeURI); // resume the queue; may invoke dispatch(), so call last before returning to the host\n }\n\n }\n\n\n //var fileName = \"\";\n // let userDB = _LCSDB.user(_LCS_WORLD_USER.pub); \n if (dbName.includes(\"proxy\")) {\n //userDB = await window._LCS_SYS_USER.get('proxy').then();\n let proxyDB = self.proxy ? _LCSDB.user(self.proxy) : _LCSDB.user(_LCS_WORLD_USER.pub);\n let fileName = dbName + '_json';\n let dbNode = proxyDB.get('proxy').get(fileName);\n let nodeProm = new Promise(res => dbNode.once(res));\n\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n\n } else {\n var worldName = dbName.split('/')[1];\n var fileName = dbName.split('/')[2];\n //+ '_json';\n\n if (!fileName) {\n worldName = self.helpers.appPath\n fileName = dbName + '_json';\n } else {\n fileName = fileName + '_json';\n }\n\n let dbNode = _LCSDB.user(_LCS_WORLD_USER.pub).get('worlds').path(worldName).get(fileName);\n\n let nodeProm = new Promise(res => dbNode.once(res))\n nodeProm.then(comp => {\n parseComp(comp);\n })\n\n // (function(r){\n // //console.log(r);\n // parseComp(r);\n\n // });\n }\n\n //console.log(source);\n\n //userDB.get(fileName).once(async function(res) {\n\n\n\n\n // }, {wait: 1000})\n }\n\n }", "function getData() {\r\n fetch(url)\r\n // This is a callback function\r\n .then(function (u) {\r\n return u.json();\r\n })\r\n // Setting the global jsondata variable \r\n .then(function (json) {\r\n jsondata = json;\r\n \r\n // Call processDataCallback\r\n processDataCallback();\r\n \r\n document.getElementById('loader').style = \"display: none\";\r\n document.getElementById('data-content').style = \"\";\r\n\r\n // getTableData();\r\n createTable();\r\n });\r\n}", "componentDidMount () {\n console.log(this.props);\n this.loadData();\n }", "function loadData(link) {\n fetch(familiesLink).then(e => e.json()).then(families => familiesList = families);\n fetch(link).then(e => e.json()).then(data => show(data));\n}", "componentWillMount() {\n var url = location.protocol + '//' + location.hostname +\n (location.port ? ':' + location.port : '') + '/menu.json';\n this.load(url); //load data from a server asynchronously\n }", "fetchElectoralDataFromExternalSources() {\n let queryParameters = {\n latitude: this.props.userLat,\n longitude: this.props.userLong\n };\n\n $.get('https://congress.api.sunlightfoundation.com/districts/locate', queryParameters, onElectoralInfoFetchComplete.bind(this), 'jsonp');\n\n function onElectoralInfoFetchComplete(data, textStatus, jqXHR) {\n this.setState({\n electoralInfo: data.results[0],\n isFetchingElectoralData: false});\n }\n }", "function doGet()\n{\n return getParsedDataDisplay();\n}", "async function fetchData() {\n\n let url = urlFoodListGenerator(baseUrl, constants.APIKEY, maxRecipePerCall, listFoodstuffs)\n console.log('fetching from ' + url)\n\n await setFetchLoading(true)\n fetch(url)\n .then((response) => response.json())\n .then((data) => {\n console.table(data)\n console.log(data)\n setData(data)\n setFetchLoading(false)\n\n })\n .catch((e) => {\n setFetchError(e)\n setFetchLoading(false)\n })\n }", "async function getData(node, prefix, num) {\n var url = '/api/tag_id/'+node+'/'+prefix+num;\n console.log('Get :', url);\n\tvar response = await fetch(url);\n console.log('Response :', response);\n if (response) {\n\t var tag_id = await response.json();\n console.log('Tag :', tag_id);\n console.log('Tag :', tag_id[0]);\n url = '/api/data/'+tag_id[0].ID+'/'+'10';\n response = await fetch(url);\n if (response) {\n var data = await response.json();\n var topic = SYS+node+'/'+prefix+'/'+num;\n var ds = mapTTData.get(topic);\n for (i=0; i<data.length; i++) {\n ds.data.push(data[i].VALUE).toFixed(2);\n }\n chartTT.update();\n }\n }\n}", "fetchData(){\n\t\tfetch(\"FishEyeData.json\")\n\t\t\t.then(response => response.json())\n\t\t\t.then((data) => {\n\t\t\t\tthis.photographers = data.photographers;\n\t\t\t\tthis.displayPhotographCards()\n\t\t\t})\n\t\t\t.catch(function (err) {\n\t\t\t\tconsole.log(err);\n\t\t\t});\n\t}", "function loadDisplay() {\n loadElevationLayer();\n loadGrid();\n}", "function loadDisplay() {\n loadElevationLayer();\n loadGrid();\n}", "function load() {\n var me = ui.browserscope,\n cont = me.container,\n timers = cache.timers;\n\n function onComplete(response) {\n clearTimeout(timers.load);\n me.render(response);\n }\n\n cache.lastAction = 'load';\n clearTimeout(timers.load);\n timers.load = setTimeout(onComplete, me.REQUEST_TIMEOUT * 1e3);\n\n // request data\n if (cont) {\n setMessage(me.LOADING_TEXT);\n (new google.visualization.Query(\n '//www.browserscope.org/gviz_table_data?' +\n 'category=usertest_' + me.KEY + '&' +\n 'ua=&' +\n 'v=3&' +\n 'o=gviz_data&' +\n 'highlight=&' +\n 'score=&' +\n 'tqx=reqId:0&' +\n 'rid=' + now(),\n {'sendMethod': 'scriptInjection'}))\n .send(onComplete);\n }\n }", "async function loadData() {\n console.log('loadData() called');\n await downloadFromServer();\n console.log('Downloaded data from server');\n messages = JSON.parse(backend.getItem('message')) || [];\n // users = JSON.parse(backend.getItem('user_img')) || [];\n\n\n}", "function RequestLoadGeneralData() {\n\n}", "componentDidMount() {\n\t\tthis.fetchData();\n\t}", "async componentWillMount(){\n\n var this_component = this;\n \n // gets data from the server\n fetch(Config.API_URL + '?page=1')\n .then(function(response){\n return response.json()\n }).then(function(data){\n this_component.setState({\n contentLoaded: true,\n content: data.data\n });\n console.log(data.data)\n });\n \n }", "async function getData() {\n var data = await connectToDeviantArt();\n return data;\n }", "async function getData() {\n var data = await connectToDeviantArt();\n return data;\n }", "componentWillMount() {\n this.getData();\n\t }", "async function fetcher() {\n let data = {};\n try {\n data = await query()\n }\n catch (error) {\n setError(error)\n return\n }\n console.log(\"DATAAA\", data)\n setLoading(false)\n setData(data)\n setDone(true)\n }", "async componentDidMount() {\n this.initViz();\n const fetchedData = await fetchData(); // fetchData is an asyncronous function so it needs an await\n console.log(\"Fetched data \" + fetchedData);\n this.setState({ data: fetchedData, graphType: \"barGraph\"});\n // let fetchedCountryHotSpots = new Map();\n // fetchedCountryHotSpots= await fetchCountryHotSpots();\n // console.log(\"Fetched country hot spots \" + fetchedCountryHotSpots);\n // this.setState({ countryHotSpotPercents: fetchedCountryHotSpots});\n }", "function fetch_data() {\n\n function on_data_received(data) {\n\t load_data_into_table(data);\n\n if (refresh_rate != 0) {\n\t setTimeout(fetch_data, refresh_rate * 1000);\n\t }\n }\n \n $.ajax({\n url: dataurl,\n method: 'GET',\n dataType: 'json',\n success: on_data_received\n });\n }", "loadData() {\n this.hvacData = HVACDataLoader.getHVACData(this);\n if (this.hvacData.getBuildingList().length > 0) this.selectBuilding(this.hvacData.getBuildingList()[0]);\n }", "function loadArticle() {\n // obtenemos los detalles del articulo\n var articleId = findGetParameter('id');\n var articleUrl = './data/data-' + articleId + '.json';\n retrieveData(articleUrl);\n}", "function getData() {\n fetch(baseURL)\n .then((response) => response.json())\n .then((data) => {\n dataSet.push(...data);\n init();\n })\n .catch((error) => {\n container__top.innerHTML = `${NO_DATA_FOUND} ${error}`;\n });\n getData2();\n getData3();\n }", "async loadpropertyView() {\n this.wait(\".content\");\n try {\n await import(\"./subcomp/property-view.js\");\n const res = await axios.post(`${this.host}/property/get-reserved`, {\n ...this.authData(),\n });\n\n if (res.data.status == 500) throw res.data;\n\n if (res.data.length < 1) {\n this._qs(\".content\").innerHTML = this.notFound;\n } else {\n this._qs(\n \"#pagination\"\n ).innerHTML = `<pagination-comp data-pages=\"10\" data-current=\"5\"></pagination-comp>`;\n this._qs(\".content\").innerHTML = \"\";\n res.data.forEach((item) => {\n this._qs(\".content\").innerHTML += `\n <property-view \n id=\"${item.property_id}\"\n data-data=\"${this.encode(item)}\"\n overview='true'\n >\n </property-view>\n `;\n });\n }\n } catch (err) {\n this.popup(err.message, \"error\");\n this.unwait(\".content\");\n }\n }", "function loadCars() {\n fetch('https://backend-dot-pp1-carshare.ts.r.appspot.com/cars')\n .then(\n function (response) {\n if (response.status !== 200) {\n console.log('Looks like there was a problem. Status Code: ' +\n response.status);\n return;\n }\n //receive data\n response.json().then(function (data) {\n console.log(data);\n printCars(data);\n });\n }\n )\n .catch(function (err) {\n \n });\n }", "async function fetchData() {\n var countryCode = document.getElementById(\"country\").value;\n const indicatorCode = \"SP.POP.TOTL\";\n const baseUrl = \"https://api.worldbank.org/v2/country/\";\n const url =\n baseUrl + countryCode + \"/indicator/\" + indicatorCode + \"?format=json\";\n console.log(\"Fetching data from URL: \" + url);\n // Fetch is a built-in tool for sending HTTP requests\n var response = await fetch(url);\n\n if (response.status == 200) {\n var fetchedData = await response.json();\n console.log(fetchedData);\n\n var data = getValues(fetchedData);\n var labels = getLabels(fetchedData);\n var countryName = getCountryName(fetchedData);\n renderChart(data, labels, countryName);\n }\n}", "componentDidMount() {\n this.fetchData(this.props);\n }", "async initializeDataLoad() {\n }", "async function loadData() {\n if (initialRender.current) {\n initialRender.current = false;\n\n }\n else {\n\n let tempArray = []\n\n for (let i = 0; i < imageKeys.length; i++) {\n\n if (!imageKeys[i].Key.endsWith('/')) {\n let url = \"https://manhuapointin.s3.amazonaws.com/\" + imageKeys[i].Key\n tempArray.push(url)\n }\n }\n setImageUrl(tempArray)\n }\n }", "function loadExternalData() {\n var loadFileParam = $location.search().loadfile;\n if (loadFileParam) {\n // block gui for long calls\n blockGui(true);\n Rest.callOther(\"loadableServerDataFiles\", \"loadFromFile\" + \"/\" + loadFileParam, initFromResponse);\n }\n }", "componentDidMount() {\n this.fetchData(this.props)\n }", "function loadRemoteData() {\n // The friendService returns a promise.\n siteFetcher.getEvent(\"1\")\n .then(\n function( response ) {\n $scope.event = response;\n }\n );\n }" ]
[ "0.63887864", "0.62658745", "0.6116985", "0.6116985", "0.6087423", "0.6078085", "0.60705453", "0.60364324", "0.60280925", "0.60215825", "0.5931188", "0.5851568", "0.5842261", "0.5831163", "0.582115", "0.5817434", "0.5814318", "0.57825", "0.5770251", "0.57541513", "0.573615", "0.5729108", "0.57109374", "0.57059354", "0.570359", "0.5684489", "0.5666263", "0.5666263", "0.5648648", "0.56481296", "0.5639541", "0.56224495", "0.56162107", "0.5600481", "0.5588432", "0.557154", "0.55541223", "0.55541134", "0.5551803", "0.55446523", "0.55395746", "0.55386037", "0.5534954", "0.5510156", "0.5507447", "0.5492071", "0.54888445", "0.5478858", "0.5473695", "0.5469218", "0.54579175", "0.54548544", "0.5453814", "0.54491657", "0.54486775", "0.54436284", "0.5439703", "0.54342085", "0.54292315", "0.54219186", "0.54050976", "0.54003745", "0.53957", "0.5390988", "0.53850263", "0.53831947", "0.5380354", "0.5378778", "0.53687966", "0.5367962", "0.5365655", "0.5365238", "0.5364084", "0.53455293", "0.5345495", "0.53450555", "0.53450555", "0.5338887", "0.5328757", "0.5327709", "0.53257835", "0.5317676", "0.5315398", "0.5315398", "0.53112495", "0.5306413", "0.53024775", "0.5296065", "0.5293856", "0.52873534", "0.5282337", "0.5280732", "0.52771795", "0.52768654", "0.5274768", "0.5274513", "0.5274029", "0.52673465", "0.5267077", "0.52633935" ]
0.5885292
11
Renders the DisplayNode component.
render() { return ( <div> <br/> <h1 className='inline'>Currently Viewing: </h1> <span title={colorLegend[this.state.elemClass]}> <h1 className={'inline ' + this.state.elemClass}>{this.state.ref}</h1> </span> <br/> <LoadingSpinner loading={this.state.fetching} msg='...fetching triples...'/> <br/> <h3 className='inline padded'>Node Properties</h3> <p className='inline'> - current node is source</p> <br/> <TriplesTable triples={this.state.asserts} inverse={false} goToId={this.props.goToId}/> <br/> <h3 className='inline padded'>Incoming Properties from Other Nodes</h3> <p className='inline'> - current node is target</p> <br/> <TriplesTable triples={this.state.invAsserts} inverse={true} goToId={this.props.goToId}/> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "displayScene() {\n // entry point for graph rendering\n //TODO: Render loop starting at root of graph\n //console.log(this.nodes)\n this.components[this.idRoot].display();\n }", "displayScene() {\n\n //Process all component nodes\n this.processNode(this.idRoot, null, null, 1, 1);\n }", "displayScene() {\n if(this.nodeInfo)\n this.displayNode(this.nodeInfo[this.idRoot],this.defaultMaterialID,\"null\",{s:1,t:1},false);\n }", "function render()\n {\n if (me.triggerEvent('renderBefore', data) === false)\n return;\n\n // remove all child nodes\n container.html('');\n\n // render child nodes\n for (var i=0; i < data.length; i++) {\n data[i].level = 0;\n render_node(data[i], container);\n }\n\n me.triggerEvent('renderAfter', container);\n }", "$render(displayRef) {\n if(this.$alive)\n this.render.apply(this, [this, displayRef]);\n }", "function display(node){\n if(node.visible){\n if (hasBorder() == true)\n p.stroke(getBorderColor());\n else\n p.noStroke();\n\n if(beingDragged != null && node == beingDragged){\n p.fill(getActiveColor());\n } else if(p.mouseX >= node.x-node.width/2 && p.mouseX <= node.x+node.width/2 \n && p.mouseY >= node.y-node.height/2 && p.mouseY <= node.y+node.height/2){\n if (currentClickedNode == node)\n p.fill(getSelectedColor());\n else\n p.fill(getHoverColor());\n\n document.getElementById('show_label').innerHTML = node.label;\n document.getElementById('show_url').innerHTML = node.url;\n document.getElementById('show_url').href = node.url;\n } else if (currentClickedNode == node){\n p.fill(getSelectedColor()); \n } else {\n p.fill(getNodeColor());\n } \n p.rect(node.x, node.y, node.width, node.height);\n\n //Handle node expander graphic\n if (node.children.length != 0) {\n p.noStroke();\n p.fill(getActiveColor());\n p.rect(node.x+node.width/2, node.y, 3, 3);\n } \n\n //Handle text \n p.fill(getFontColor());\n // calculate text size based on the current size of the node\n p.textSize(getTextSize(node));\n p.text(node.label, node.x - node.width/2 + 5, node.y + 5);\n //p.text(node.label, node.x-35, node.y+5);\n\n //Used for drag/drop\n var x_origin = node.x + node.width/2;\n var y_origin = node.y;\n\n //Recurse on children and draw connecting lines\n for(var i=0; i<node.children.length; i++){\n if(node.children[i].visible && node.children[i].x - node.children[i].width/2 > 0 && node.children[i].y > 0){\n display(node.children[i]);\n p.stroke(getLineColor());\n p.line(x_origin, y_origin, node.children[i].x - node.children[i].width/2, node.children[i].y);\n }\n }\n }\n}", "function render() {\n\n\t\t\t}", "render() {\n if (this.renderer) {\n this.renderer.call(this.owner, this.content, this.owner, this.model);\n }\n }", "render() {\n\t\tif (!this.component_.element) {\n\t\t\tthis.component_.element = document.createElement('div');\n\t\t}\n\t\tthis.emit('rendered', !this.isRendered_);\n\t}", "_render() {\n this._reactComponent = this._getReactComponent();\n if (!this._root) this._root = createRoot(this._container.getElement()[0]);\n this._root.render(this._reactComponent);\n }", "function render() {\n\t\t\t}", "_renderScreen() {\n\t\tif (this._el && this._component) {\n\t\t\tthis._component.render(this._el);\n\t\t}\n\t}", "function displayDOM(){\r\n\t\tvar str = '';\r\n\t\tcontainer.getChildren().each(function(item){\r\n\t\t\tstr += '<div style=\"' + item.style.cssText + '\">' + item.get('text') + '</div>\\n';\r\n\t\t});\r\n\t\tdocument.id('output').set('text', str);\r\n\t}", "displayScene() {\n var root = this.components[this.root];\n if (root == null)\n return \"[displayScene]: root node does not exist!\";\n\n // display scene graph starting at the root component\n root.display(root.materials[root.currentMaterialIndex][1], root.texture);\n }", "render() {\n this.renderComponents() // dial + outputs, algedonode, brass pads, strips, lights\n this.renderLabels()\n }", "render () {\n let data = this.getData();\n this._tree = this._createTree(data);\n this._toolTip = this._createToolTip();\n this._updateTree(this.getRoot());\n }", "function render() {\n\t\t\n\t}", "display() {\n this.scene.pushMatrix();\n this.scene.multMatrix(this.transfMatrix); /*Add the new transformation matrix to this node \n and all its descendants*/\n\n /*if this node is keyframe animated and the animation has not started yet, node cannot be displayed*/\n if((this.animation != null && (this.animation.checkVisibility() == true)) || this.animation == null) {\n if(this.animation != null) {\n this.animation.apply(this.scene);\n }\n \n if(this.material != \"null\") { //Adicionar o material se não for \"null\"\n materialStack.push(this.material);\n }\n\n if(this.scene.materials[materialStack[materialStack.length - 1]] != null)\n this.scene.materials[materialStack[materialStack.length - 1]].apply();\n\n if(this.texture == \"clear\") {\n if(this.scene.textures[textureStack[textureStack.length - 1]] != null) \n this.scene.textures[textureStack[textureStack.length - 1]].unbind(); \n textureStack.push(0);\n } else if(this.texture == \"null\") {\n if(this.scene.textures[textureStack[textureStack.length - 1]] != null) {\n if(this.scene.textures[textureStack[textureStack.length - 1]] != 0)\n this.scene.textures[textureStack[textureStack.length - 1]].bind();\n }\n } else {\n if(this.scene.textures[this.texture] != 0 && this.scene.textures[this.texture] != null) {\n textureStack.push(this.texture);\n this.scene.textures[textureStack[textureStack.length - 1]].bind();\n }\n }\n\n //Display leaves if they exist\n for(var i = 0; i < this.leaves.length; i++) {\n if(this.leaves[i] != null)\n this.leaves[i].display();\n }\n\n //Recursively run this code for all the children nodes\n for(var j = 0; j < this.descendants.length; j++) {\n this.descendants[j].display();\n }\n\n if(this.texture != \"null\"){\n textureStack.pop();\n }\n\n if(this.material != \"null\")\n materialStack.pop();\n }\n\n this.scene.popMatrix();\n\n }", "display() {\n this.scene.pushMatrix();\n this.scene.multMatrix(this.transformationMatrix);\n if ((typeof this.cgfTexture != 'undefined') && this.cgfMaterial != null)\n this.cgfMaterial.setTexture(this.cgfTexture);\n if (this.cgfMaterial != null)\n this.cgfMaterial.apply();\n\n if (typeof this.animations[this.atualAnimationId] != 'undefined')\n this.animations[this.atualAnimationId].display();\n\n for (let children of this.childrens) {\n if (children.cgfTextureId == \"inherit\") {\n children.cgfTexture = this.cgfTexture;\n children.length_sTexture = this.length_sTexture;\n children.length_tTexture = this.length_tTexture;\n }\n if (children.cgfMaterialId == \"inherit\") {\n children.cgfMaterial = this.cgfMaterial;\n }\n if (!(children instanceof Component)) {\n if (!(isNaN(this.length_sTexture) || isNaN(this.length_tTexture)))\n children.updateTexCoords(this.length_sTexture, this.length_tTexture);\n }\n children.display();\n }\n\n this.scene.popMatrix();\n }", "displayScene()\r\n {\r\n this.traverseGraph(this.components[this.idRoot], this.components[this.idRoot].materials, this.components[this.idRoot].texture);\r\n }", "function render() {\n\t}", "function renderNodes(dataInstance){\n currentDisplay.innerHTML +=\n `<i class=\"fab fa-first-order-alt selector\" data-id = ${dataInstance.id} style=\"position:\n fixed;top:${dataInstance.position_top}%;left:${dataInstance.position_left}%;\n font-size: 1.5em; \"></i>`\n}", "function showNode(node, show) {\n\n var opacity = network.display.DEF_NODE_OPACITY;\n var font = network.display.DEF_LABEL_FONT;\n var fontWeight = network.display.DEF_LABEL_WEIGHT;\n var fontSize = network.display.DEF_LABEL_SIZE;\n var nodeSize = network.display.DEF_NODE_SIZE;\n var thumbVis = network.display.DEF_THUMB_VISIBILITY;\n var thumbWidth = network.display.DEF_THUMB_WIDTH;\n var thumbHeight = network.display.DEF_THUMB_HEIGHT;\n\n if (show === \"highlight\") {\n opacity = network.display.HLT_NODE_OPACITY;\n font = network.display.HLT_LABEL_FONT;\n fontWeight = network.display.HLT_LABEL_WEIGHT; \n fontSize = network.display.HLT_LABEL_SIZE;\n nodeSize = network.display.HLT_NODE_SIZE;\n thumbVis = network.display.HLT_THUMB_VISIBILITY;\n thumbWidth = network.display.HLT_THUMB_WIDTH;\n thumbHeight = network.display.HLT_THUMB_HEIGHT;\n }\n else if (show === \"select\") {\n opacity = network.display.SEL_NODE_OPACITY;\n font = network.display.SEL_LABEL_FONT;\n fontWeight = network.display.SEL_LABEL_WEIGHT; \n fontSize = network.display.SEL_LABEL_SIZE;\n nodeSize = network.display.SEL_NODE_SIZE;\n thumbVis = network.display.SEL_THUMB_VISIBILITY;\n thumbWidth = network.display.SEL_THUMB_WIDTH;\n thumbHeight = network.display.SEL_THUMB_HEIGHT;\n }\n\n node.labelElem.attr(\"opacity\", opacity);\n node.labelElem.attr(\"font-family\", font);\n node.labelElem.attr(\"font-weight\", fontWeight);\n node.labelElem.attr(\"font-size\", fontSize);\n\n node.nodeElem .attr(\"r\", nodeSize);\n node.nodeElem .attr(\"opacity\", opacity);\n\n node.thumbElem.attr(\"visibility\", thumbVis);\n node.thumbElem.attr(\"width\", thumbWidth);\n node.thumbElem.attr(\"height\", thumbHeight);\n\n // move the highlighted node thumbnail element\n // to the end of its parents' list of children,\n // so it is displayed on top\n var thumbNode = node.thumbElem.node();\n thumbNode.parentNode.appendChild(thumbNode);\n }", "render() {\n const { rootNode, sizeSet } = this;\n let visualIndex = this.visualIndex;\n\n if (this.isSharedViewSet() && sizeSet.isPlaceOn(WORKING_SPACE_BOTTOM)) {\n visualIndex += sizeSet.sharedSize.nextSize;\n }\n\n let node = rootNode.childNodes[visualIndex];\n\n if (node.tagName !== this.childNodeType) {\n const newNode = this.nodesPool();\n\n rootNode.replaceChild(newNode, node);\n node = newNode;\n }\n\n this.collectedNodes.push(node);\n this.visualIndex += 1;\n }", "render() {\n this._userEvent('beforeRender');\n const html = this.template.render({data: this.viewData}, (data) => {\n return this.wrapTemplate(data);\n });\n if (!this.wrapper) {\n this.wrapper = this._createWrapper();\n }\n this.updateNode(this.wrapper, html);\n this.resize();\n this._userEvent('afterRender');\n }", "function render() {\n\t\treturn graphTpl;\n\t}", "render_display() {\n this.element.fadeIn();\n this.visible = true;\n }", "render() {\n super.render();\n this._outputView = new OutputArea({\n rendermime: renderMime,\n contentFactory: OutputArea.defaultContentFactory,\n model: this.model.outputs\n });\n this.pWidget.insertWidget(0, this._outputView);\n\n this.pWidget.addClass('jupyter-widgets');\n this.pWidget.addClass('widget-output');\n this.update(); // Set defaults.\n }", "createDisplay() {\n const { text, fontSize = 36 } = this.conf;\n this.display = Pool.get(this.type, () => new Label());\n this.display.attr({ text, fontSize });\n }", "function render() {\n\n\t\t\tisRendered = true;\n\n\t\t\trenderSource();\n\n\t\t}", "render(className, textContent) {\n this.node.className = className;\n this.node.textContent = textContent;\n }", "render(ctx)\n\t{\n\t\tlet camera = this.tree.camera;\n\t\tlet zoom = camera.zoomSmooth;\n\n\t\tlet pos = this.posSmooth.toScreen(camera);\n\t\tlet width = this.width * zoom;\n\t\tlet height = this.height * zoom;\n\t\tlet radius = this.tree.theme.nodeBorderRadius * zoom;\n\t\tlet header = this.tree.theme.nodeHeaderSize * zoom;\n\n\t\tthis.buildNodeShape(ctx, pos, width, height, radius);\n\t\tctx.fillStyle = this.nodeColor;\n\t\tctx.fill();\n\n\t\tthis.buildNodeHeaderShape(ctx, pos, width, height, radius, header);\n\t\tctx.fillStyle = this.nodeHeaderColor;\n\t\tctx.fill();\n\n\t\tthis.buildNodeShape(ctx, pos, width, height, radius);\n\t\tctx.lineWidth = this.tree.theme.nodeBorderThickness * zoom;\n\n\t\tif (this.select)\n\t\t\tctx.strokeStyle = this.tree.theme.nodeBorderSelect;\n\t\telse if (this.hover)\n\t\t\tctx.strokeStyle = this.borderColorHighlight;\n\t\telse\n\t\t\tctx.strokeStyle = this.borderColor;\n\n\t\tctx.stroke();\n\n\t\tfor (let i = 0; i < this.inputPlugs.length; i++)\n\t\t\tthis.inputPlugs[i].render(ctx);\n\n\t\tfor (let i = 0; i < this.outputPlugs.length; i++)\n\t\t\tthis.outputPlugs[i].render(ctx);\n\n\t\tctx.fillStyle = this.tree.theme.headerFontColor;\n\t\tctx.font = this.tree.theme.headerFontSize * zoom + 'px '\n\t\t\t+ this.tree.theme.headerFontFamily;\n\t\tctx.textAlign = 'center';\n\t\tctx.textBaseline = 'middle';\n\t\tctx.fillText(this.name, pos.x + width / 2, pos.y + header / 2 * 1.05);\n\n\t\tthis.input.render(ctx);\n\t}", "_buildDisplayView() {\n this.element.innerHTML = this.value;\n }", "_buildDisplayView() {\n this.element.innerHTML = this.value;\n }", "function renderNode(node){\r\n\t\t\t\t\tif(node.rowIndex!=-1){// not root node\r\n\t\t\t\t\t\trenderrow(node.rowIndex,rows,tbody,fields,target,rownumbers);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(node.expand){//expand children nodes?\r\n\t\t\t\t\t\tfor(var i=0;i<node.children.length;i++){\r\n\t\t\t\t\t\t\tvar nodeRowIndex = node.children[i];\r\n\t\t\t\t\t\t\tvar nodekey = rows[nodeRowIndex][opts.treeoption.keyfield];\r\n\t\t\t\t\t\t\tif(nodekey ){\r\n\t\t\t\t\t\t\t\tvar currentnode =$.data(target, 'datagrid').treedata[nodekey];\r\n\t\t\t\t\t\t\t\tif(currentnode){\r\n\t\t\t\t\t\t\t\t\trenderNode(currentnode);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tnode.childrenrendered=true;//childlren rendered\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function display(d) {\n // updateNodeInfo(d.properties.name, color(i));\n console.log(d.properties.name);\n updateNodeInfo(d);\n}", "function render() {\n\t// actually display the scene in the Dom element\n\trenderer.render( scene, camera );\n}", "sysRender() {\n \n let rendered = this.render();\n \n // If render() returns a String, then insert that as innerHTML in the\n // Part View node. Otherwise, do something else (TODO)\n \n if (typeof rendered === 'string') {\n this.domNode.innerHTML = rendered;\n } else if (false) { // TODO: test for jQuery return, DOM Node object, etc.\n // WHAT? \n }\n }", "render() { this.screen.render() }", "render() {\n\t return this._visibleView === null ? null : this._visibleView.render();\n\t }", "_render()\n {\n if (this.isDisabled())\n return;\n\n this._setContentSizeCss();\n this._setDirection();\n const paragraph = html`<p>${this.text}</p>`;\n let anchor = \"\";\n let action = \"\";\n if (this.link && this.linkText)\n anchor = html`<a href=\"${this.link}\" target=\"_blank\">${this.linkText}</a>`;\n if (this.action && this.actionText)\n action = html`${anchor ? \" | \" : \"\"}<a href=\"javascript:void(0)\" @click=${this.action}>${this.actionText}</a>`;\n let heading = \"\";\n if (this.heading)\n heading = html`<h4>${this.heading}</h4>`;\n\n render(html`${heading}${paragraph}<div id=\"links\">${anchor}${action}</div>`, this.tooltipElem);\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "function render() {\n\n // Call the Character instance's renderAt() method, passing along its current\n // left and top position\n _character.renderAt(_character.left, _character.top);\n }", "function render() {\n\n isRendered = true;\n\n renderSource();\n\n }", "function Render(props) {\n var instance = props.instance,\n shouldRender = props.shouldRender;\n var childNodes;\n\n if (shouldRender) {\n childNodes = instance.render();\n }\n\n var childUI = childNodes ? childNodes.map(function (child) {\n var name = child.name,\n id = child.id;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"render-node\",\n key: id\n }, \" \", name, \" \");\n }) : null;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"container render-child-container \"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"container-title\"\n }, \"render()\"), childUI);\n}", "function render() {\n var children = [SearchBar({\n update: updateSearchState\n }), ItemsList({\n items: _state.items,\n onUpdate: updateState\n })];\n if (!_node) {\n return _node = createElement('div', { class: 'main' }, children);\n } else {\n return _node.html(children);\n }\n }", "render() {\n // Subclasses should override\n }", "render() {\r\n this.updateFontSize();\r\n this.actValDiv.innerHTML = this.actValText;\r\n this.buttonElem.innerHTML = this.desValText;\r\n }", "render() {\n\t\tif(this.state.display)\n\t\t{\n\t\t\t// If the panel is being displayed, display the content.\n\t\t\treturn (\n\t\t\t\t<div class={style.panel}> \n\t\t\t\t\t<h1>Fact</h1>\n\t\t\t\t\t<p>{this.state.fact}</p>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\t}", "render() {\n\n\t}", "render() {\n\n\t}", "display() {\n if (this.isDrank === false) {\n //Display\n image(this.image, this.x, this.y, this.size, this.size);\n }\n }", "renderIncDom() {\n\t\tif (this.component_.render) {\n\t\t\tthis.component_.render();\n\t\t} else {\n\t\t\tIncrementalDOM.elementVoid('div');\n\t\t}\n\t}", "function render() {\n removeAllChildren(gameBoard);\n createGrid();\n events.emit('currentPlayer', getCurrentPlayer(count))\n }", "function render(node) {\n switch (nodeType(node)) {\n case \"text\":\n return document.createTextNode(node);\n case \"element\":\n return renderElement(node);\n case \"component\":\n return renderComponent(node);\n }\n}", "function updateDisplay() {\n node\n .attr(\"r\", forceProperties.collide.radius)\n .attr(\"stroke\", forceProperties.charge.strength > 0 ? \"blue\" : \"red\")\n .attr(\"stroke-width\", forceProperties.charge.enabled == false ? 0 : Math.abs(forceProperties.charge.strength) / 15);\n\n \n link\n .attr(\"stroke-width\", forceProperties.link.enabled ? 3 : .5)\n .attr(\"opacity\", forceProperties.link.enabled ? 1 : 0);\n}", "function showResultDiv (node) {\n node.style.display = \"inline\";\n }", "render() {\n\t\treturn <div>{this.renderContent()}</div>;\n\t}", "display() {\n this.rttTexture.bind(0);\n this.noiseTexture.bind(1);\n\n this.scene.setActiveShader(this.cameraShader);\n\n this.rectangle.display();\n\n this.scene.setActiveShader(this.scene.defaultShader);\n\n this.rttTexture.unbind(0);\n this.noiseTexture.unbind(1);\n }", "_render() {\n\t\tif (this.ctx) {\n\t\t\tthis.ctx.fillStyle = this._settings.append_to.css('color');\n\t\t\tthis.ctx.beginPath();\n\t\t\tthis.ctx.arc(this.coordinates.x, this.coordinates.y, this.size, 0, 2 * Math.PI);\n\t\t\tthis.ctx.closePath();\n\t\t\tthis.ctx.fill()\n\t\t} else if (this.$element) {\n\t\t\t// TODO: look into rendering to a canvas\n\t\t\tthis.$element.css({\n\t\t\t\t'top': 0,\n\t\t\t\t'left': 0,\n\t\t\t\t'transform': 'translate(' + (this.coordinates.x - (this.height / 2)) + 'px, ' + (this.coordinates.y - (this.width / 2)) + 'px)',\n\t\t\t\t'width': this.width + 'px',\n\t\t\t\t'height': this.height + 'px'\n\t\t\t});\n\t\t\t\n\t\t}\n\t}", "render() {\n // background box.\n this.renderBackground();\n this.renderName();\n this.renderTimeLine();\n this.renderWave();\n }", "render(dataIn) {\n var data = dataIn;\n //only apply render with `this.data` if no parameters passed in, which should take precedence\n if (this.data !== undefined && !data) {\n //if we had set this.data when initializing a component, it should also\n //load the data in a manual call to render\n data = this.data;\n }\n if (data instanceof Atom) {\n data = data.state;\n } \n //create virtual DOM node\n const newVdom = this.create(data); \n //apply any user-defined styles if applicable (do this before we render in case any user-generated styles\n //need to add any properties to the outer vDOM node e.g. a unique id)\n this.addStyle(newVdom);\n //call the reconciliation algorithm to render/diff the changes and render the new DOM tree which we save\n this.node = renderVDOM(newVdom, this.vdom, this.node);\n //return an empty comment if no valid DOM node is returned\n if (!this.node) this.node = document.createComment('');\n this.vdom = newVdom;\n return this.node;\n }", "display() {\n rectMode(CENTER);\n fill('#323230');\n noStroke();\n rect(this.x, this.y - TANK_HEIGHT, this.width, this.height);\n }", "function render() {\n renderRegistry();\n renderDirectory();\n renderOverride();\n}", "display() {\n console.log('head:', this.head)\n console.log('[ ')\n this.displayHelper(this.head)\n console.log(' ]')\n console.log('tail:', this.tail)\n }", "function EqnNodeRenderer() { }", "show() {\n stroke(255);\n strokeWeight(1)\n noFill();\n rectMode(CENTER);\n rect(this.boundary.x, this.boundary.y, this.boundary.w * 2, this.boundary.h * 2);\n if (this.divided) {\n this.northeast.show();\n this.northwest.show();\n this.southeast.show();\n this.southwest.show();\n }\n for (let p of this.nodes) {\n strokeWeight(4)\n node(p.x, p.y)\n }\n }", "function show(node, styleType) {\r\n if (!styleType)\r\n styleType = '';\r\n getNodeIfString(node).style.display = styleType;\r\n}", "display(){\r\n\r\n this.scene.setActiveShader(this.terrainShader);\r\n this.heightmap.bind(1);\r\n this.colormap.bind(2);\r\n \r\n super.display();\r\n this.scene.setActiveShader(this.scene.defaultShader);\r\n }", "render() {\n //using template function to render component\n const html = this.getTemplate().call(this, (this.getData())).trim();\n // generate virtual dom tree\n const tree = tvdom.parse(html);\n const lastRender = this._lastRender;\n // update component\n if (lastRender) {\n // diff two trees: last and current\n const patches = tvdom.diff(lastRender.tree, tree);\n if (!this._isEmptyObject(patches)) {\n // patch last dom tree\n tvdom.patch(lastRender.root, patches);\n // save changes\n lastRender.html = html;\n lastRender.tree = tree;\n }\n } else {\n // first time render dom tree\n const root = tree.render();\n this._$mountPoint.empty().html(root);\n // save render states\n this._lastRender = { mountPoint: this.getMountPoint(), html, tree, root}\n }\n }", "connectedCallback() {\n this.innerHTML = this.render();\n\n }", "display() {\n\t\tsuper.display();\n\n\t\t/* Display the boxes on the right panel. */\n\t\tthis.scoreBox.display();\n\t\tthis.levelLinesBox.display();\n\t\tthis.nextPieceBox.display();\n\t\tthis.statBox.display();\n\n\t\t/* Display the falling piece. */\n\t\tif (this.piece != undefined) {\n\t\t\tthis.piece.display(this.grid.initialx, this.grid.initialy, this.grid.squareSize);\n\t\t}\n\n\t\t/* Display the grid. */\n\t\tthis.grid.display();\n\n\t\tif (this.state == STATE_SELECT_LEVEL) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.levelSelectorBox.display();\n\t\t}\n\t\telse if (this.state == STATE_WAIT_ADVERSARY_SELECTION) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.waitAdversarySelectionBox.display();\n\t\t}\n\t\telse if (this.state == STATE_GAME_OVER) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.gameOverSelectorBox.display();\n\t\t}\n\t\telse if (this.state == STATE_SUBMIT) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.submitBox.display();\n\t\t}\n\t}", "display() {\n this._flushSomeDiv(this._threadHost)\n this._threadHost.appendChild(this._identifiedThread)\n this._scrollBottom()\n }", "connectedCallback() {\n this.render();\n }", "function render() {\n // Create board with buttons for each of the spaces\n for (var i = 0; i < board.length; i++) {\n var p = document.createElement(\"p\");\n for (var j = 0; j < board[i].length; j++) {\n p.appendChild(createSpaceButton(board[i][j], i, j));\n }\n boardElm.appendChild(p);\n }\n // Update current player\n gameStatusElm.innerHTML = \"Current player: \" + players[currPlayerIndex];\n}", "display() {\n stroke([204, 0, 255, 100]);\n strokeWeight(1);\n fill([255,0,0,70]);\n beginShape();\n for (let i=0; i<this.vertices.length; i++) {\n vertex(this.vertices[i].x/DIVIDER, this.vertices[i].y/DIVIDER);\n circle(this.vertices[i].x/DIVIDER, this.vertices[i].y/DIVIDER, 3);\n }\n vertex(this.vertices[0].x/DIVIDER, this.vertices[0].y/DIVIDER);\n endShape();\n }", "function render() {\n if (!willRender) {\n willRender = true;\n process.nextTick(function() {\n screen.render();\n willRender = false;\n });\n }\n}", "function render(){var createNodes=require(\"./create-nodes\"),createClusters=require(\"./create-clusters\"),createEdgeLabels=require(\"./create-edge-labels\"),createEdgePaths=require(\"./create-edge-paths\"),positionNodes=require(\"./position-nodes\"),positionEdgeLabels=require(\"./position-edge-labels\"),positionClusters=require(\"./position-clusters\"),shapes=require(\"./shapes\"),arrows=require(\"./arrows\");var fn=function(svg,g){preProcessGraph(g);svg.selectAll(\"*\").remove();var outputGroup=createOrSelectGroup(svg,\"output\"),clustersGroup=createOrSelectGroup(outputGroup,\"clusters\"),edgePathsGroup=createOrSelectGroup(outputGroup,\"edgePaths\"),edgeLabels=createEdgeLabels(createOrSelectGroup(outputGroup,\"edgeLabels\"),g),nodes=createNodes(createOrSelectGroup(outputGroup,\"nodes\"),g,shapes);layout(g);positionNodes(nodes,g);positionEdgeLabels(edgeLabels,g);createEdgePaths(edgePathsGroup,g,arrows);var clusters=createClusters(clustersGroup,g);positionClusters(clusters,g);postProcessGraph(g)};fn.createNodes=function(value){if(!arguments.length)return createNodes;createNodes=value;return fn};fn.createClusters=function(value){if(!arguments.length)return createClusters;createClusters=value;return fn};fn.createEdgeLabels=function(value){if(!arguments.length)return createEdgeLabels;createEdgeLabels=value;return fn};fn.createEdgePaths=function(value){if(!arguments.length)return createEdgePaths;createEdgePaths=value;return fn};fn.shapes=function(value){if(!arguments.length)return shapes;shapes=value;return fn};fn.arrows=function(value){if(!arguments.length)return arrows;arrows=value;return fn};return fn}", "display() {\n if (this.texture == null) {\n return;\n }\n\n this.recTex.bind(1);\n this.scene.setActiveShader(this.shader);\n this.texture.bind();\n this.rectangle.display();\n this.texture.unbind();\n this.scene.setActiveShader(this.scene.defaultShader);\n }", "function showNodeNetwork(node, show) {\n\n var pathElems = node.pathElems;\n var paths = node.paths;\n var nbrElems = node.nbrElems;\n var nbrLabelElems = node.nbrLabelElems;\n var nbrThumbElems = node.nbrThumbElems;\n\n var nodeOpacity = network.display.DEF_NODE_OPACITY;\n var font = network.display.DEF_LABEL_FONT;\n var fontSize = network.display.DEF_LABEL_SIZE;\n var fontWeight = network.display.DEF_LABEL_WEIGHT;\n var thumbVis = network.display.DEF_THUMB_VISIBILITY;\n var thumbWidth = network.display.DEF_THUMB_WIDTH;\n var thumbHeight = network.display.DEF_THUMB_HEIGHT;\n var edgeOpacity = network.display.DEF_EDGE_OPACITY;\n var edgeWidth = network.display.DEF_EDGE_WIDTH;\n var edgeColour = network.display.DEF_EDGE_COLOUR;\n\n if (show) {\n\n nodeOpacity = network.display.HLT_NODE_OPACITY;\n font = network.display.HLT_LABEL_FONT;\n fontSize = network.display.HLT_LABEL_SIZE;\n fontWeight = network.display.HLT_LABEL_WEIGHT;\n thumbVis = network.display.HLT_THUMB_VISIBILITY;\n thumbWidth = network.display.HLT_THUMB_WIDTH;\n thumbHeight = network.display.HLT_THUMB_HEIGHT;\n edgeOpacity = network.display.HLT_EDGE_OPACITY;\n edgeWidth = network.display.HLT_EDGE_WIDTH;\n edgeColour = network.display.HLT_EDGE_COLOUR;\n }\n\n if (edgeWidth === \"scale\") \n edgeWidth = network.scaleInfo.pathWidth;\n if (edgeColour === \"default\") \n edgeColour = network.scaleInfo.defPathColour;\n else if (edgeColour === \"highlight\") \n edgeColour = network.scaleInfo.hltPathColour;\n\n nbrElems\n .attr(\"opacity\", nodeOpacity);\n\n nbrLabelElems\n .attr(\"opacity\", nodeOpacity)\n .attr(\"font-family\", font)\n .attr(\"font-size\", fontSize)\n .attr(\"font-weight\", fontWeight);\n\n nbrThumbElems\n .attr(\"visibility\", thumbVis)\n .attr(\"width\", thumbWidth)\n .attr(\"height\", thumbHeight);\n \n pathElems\n .data(paths)\n .attr(\"stroke-width\", edgeWidth)\n .attr(\"stroke\", edgeColour)\n .attr(\"opacity\", edgeOpacity)\n .each(function() {this.parentNode.appendChild(this)});\n }", "display() {\n // Helper function to recursively iterate through tree.\n function _iterate(node) {\n // If the current node exists, print it's parent and current value\n if (node) {\n console.log(`Parent: ${node.parent ? node.parent.data : \"None\"} Current: ${node.data}`);\n \n // if it has a right child, there is a left, iterate into both.\n if (node.right) {\n _iterate(node.left)\n _iterate(node.right)\n }\n else if (node.left) _iterate(node.left)\n }\n }\n \n // If there's a node, begin loop. Else, empty list = no data.\n if (this.parent) _iterate(this.parent)\n else console.log(\"No data\");\n }", "function render() {\r\n\r\n}", "function render() {\r\n\r\n}", "render(){\r\n\r\n\t}", "show() {\n for (let node of this.nodes) {\n node.show();\n node.showLinks();\n }\n }", "displayScene() {\n\t\n\t\tif (this.scene.interface.isKeyPressed(\"KeyM\") == true)\n\t\t\tthis.changeMaterials();\n\n\t\tvar root = this.components[this.root];\n\t\tthis.displayComponent(root, root.materials[root.currentMaterial], root.texture, root.texS, root.texT);\n\t\n\t}", "render() {\r\n dxp.log.debug(this.element.tagName, 'render()', `in dxp-content-list render() : ${process.env.MODE}`);\r\n return (h(\"div\", { class: this.base.componentClass(), dir: this.dir, \"data-theme\": this.theme },\r\n h(\"div\", { class: \"header-tag\" }, this.titleText && (this.href ? h(\"h4\", { class: this.headerSize },\r\n h(\"a\", { href: this.href }, this.titleText)) :\r\n h(\"h4\", { class: this.headerSize }, this.titleText))),\r\n h(\"div\", { class: `dxp-content-list-items sc-dxp-content-list ${this.orientation ? this.orientation : 'vertical'}`, ref: el => this.linksContainer = el },\r\n h(\"slot\", null))));\r\n }", "function onShowNodeBtnClicked(event)\n\t{\n\t\tvar nodeIndex = event.currentTarget.dataset.showNode;\n\t\tvar node = this.data.categories[this.showingCategoryIndex].nodes[nodeIndex];\n\n\t\tthis.showingNodeIndex = nodeIndex;\n\t\tthis.renderContentView(node);\n\t}", "setDisplayNodeParent(element) {\n this.display_node.remove();\n element.appendChild(this.display_node);\n }", "render() {\n // Define this vis\n const vis = this;\n\n // Bind and modify - using 'datum' method to bind a single datum\n vis.topCounterEl.datum(vis.resultsCount)\n .text('Results Count: ')\n .append('span')\n .text(d => d);\n }", "display() {\n this.object.display();\n }", "render(dataIn) {\n var data = dataIn;\n //only apply render with `this.data` if no parameters passed in, which should take precedence\n if (this.data !== undefined && !data) {\n //if we had set this.data when initializing a component, it should also\n //load the data in a manual call to render\n data = this.data;\n }\n if (data instanceof Atom) {\n data = data.state;\n } \n //create virtual DOM node\n const newVdom = this.create(data); \n //TODO: fix this, can't use insertRule if element is not already in the DOM\n //apply any user-defined styles if applicable (do this before we render in case any user-generated styles\n //need to add any properties to the outer vDOM node e.g. a unique id)\n this.addStyle(newVdom);\n //call the reconciliation algorithm to render/diff the changes and render the new DOM tree which we save\n this.node = renderVDOM(newVdom, this.vdom, this.node);\n //return an empty comment if no valid DOM node is returned\n if (!this.node) this.node = document.createComment('');\n this.vdom = newVdom;\n return this.node;\n }", "render(container) {\n this.renderer.render(container);\n }", "render() {\n return this.renderContent();\n }", "function initializeDisplay() {\n // set the data and properties of link lines\n link = svg.append(\"g\")\n .attr(\"class\", \"links\")\n .selectAll(\"line\")\n .data(graph.links)\n .enter().append(\"line\");\n\n // set the data and properties of node circles\n node = svg.append(\"g\")\n .attr(\"class\", \"nodes\")\n .selectAll(\"circle\")\n .data(graph.nodes)\n .enter()\n .append(\"circle\")\n .call(d3.drag()\n .on(\"start\", dragstarted)\n .on(\"drag\", dragged)\n .on(\"end\", dragended));\n\n node.append(\"title\")\n .text(function (d) {\n return d.id;\n });\n\n link.append(\"title\")\n .text(function (d) {\n return d.value;\n });\n \n // visualize the graph\n updateDisplay();\n}", "display() {\n this.editorNode.style.visibility = \"visible\";\n this.focusInput();\n }", "renderNodes() {\n const chart = this.chart;\n chart.selectAll('.node').remove();\n\n const _recursiveBuild = (selection, childrenNodes) => {\n if (!childrenNodes) return;\n const nodesGroup = selection.selectAll('.node')\n .data(childrenNodes)\n .enter().append('g')\n .classed('node', true)\n .attr('transform', d => {\n return svgUtil.translate(d.x, d.y);\n });\n\n nodesGroup.each(function(d) {\n const s = d3.select(this);\n s.append('g').classed('node-ui', true);\n _recursiveBuild(s.append('g'), d.nodes);\n });\n };\n _recursiveBuild(chart, this.layout.nodes);\n chart.selectAll('.node-ui').call(this.renderNode);\n }", "function displayNodeDetails(d) { \n $(\"#node-details\").empty();\n $(\"#node-details\").append('<h4>' + d.name + '</h4>');\n $(\"#node-details\").append('<hr>');\n $(\"#node-details\").append('<p><b>PSI:</b> ' + (d.psi ? d.psi : 0) + '</p>');\n $(\"#node-details\").append('<p><b>Size:</b> ' + (d.value ? d.value : 0) + '</p>');\n $(\"#node-details\").append('<p><b>Depth:</b> ' + d.depth + '</p>');\n if (d.children) {\n $(\"#node-details\").append('<p><b>Number of children:</b> ' + (d.children.length ? d.children.length : 0) + '</p>'); \n }\n if (d.parent.name) {\n $(\"#node-details\").append('<p><b>Parent:</b> ' + d.parent.name + '</p>'); \n } \n}", "render(){if(this.renderer){this.renderer.call(this.owner,this.content,this.owner,this.model)}}" ]
[ "0.6781303", "0.6655281", "0.6471556", "0.63667333", "0.635982", "0.635937", "0.6335179", "0.6240191", "0.622651", "0.62119114", "0.62117696", "0.61996084", "0.6193583", "0.6189599", "0.6164148", "0.61471826", "0.6103389", "0.60972273", "0.6088896", "0.60766846", "0.6046236", "0.6034882", "0.6007434", "0.5989036", "0.59800726", "0.594776", "0.5929443", "0.5921438", "0.5896797", "0.5894024", "0.5879853", "0.5878102", "0.5869966", "0.5869966", "0.5868001", "0.58617103", "0.5835599", "0.5826377", "0.5823397", "0.5815494", "0.5810301", "0.5804354", "0.5804354", "0.5804354", "0.5765705", "0.57509065", "0.57471997", "0.57370245", "0.57129186", "0.5704518", "0.5702889", "0.5696765", "0.5696765", "0.56744236", "0.5667662", "0.56584954", "0.5634826", "0.5629668", "0.56280506", "0.56152105", "0.5614164", "0.55985296", "0.55963767", "0.5594337", "0.55836785", "0.5582288", "0.5576663", "0.55740505", "0.5569342", "0.5568797", "0.5559432", "0.55584645", "0.55430186", "0.55403227", "0.55313957", "0.55262053", "0.5522453", "0.552045", "0.5514647", "0.5505982", "0.55035615", "0.54948646", "0.5486347", "0.5483856", "0.5483856", "0.5483574", "0.54831386", "0.5481786", "0.5476487", "0.5474582", "0.54743326", "0.54742354", "0.54704493", "0.5465698", "0.5463915", "0.5452685", "0.5442319", "0.5438882", "0.54386497", "0.54384387", "0.5437914" ]
0.0
-1
tht function will get the arguments before destructuring see the difference below
function add() { var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref2$x = _ref2.x, x = _ref2$x === undefined ? 1 : _ref2$x, _ref2$y = _ref2.y, y = _ref2$y === undefined ? 2 : _ref2$y; //the process below run like this: //first get arugments ,but in this case ,the aruments is null ,so it gets nothing //then destructuring the default,({x = 1, y = 2} = {}), //it means let x = 1;let y = 2; return x + y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $t(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}", "function boo({first=\"10\", second=\"true\"}) {\n\n}", "function myFunc(...opts) {\n let t = opts[0];\n}", "function f1(t) {\n var {...a} = t;\n return a;\n}", "function f3(t) {\n var a, rest;\n ({a, ...rest} = t);\n}", "mk$params() {\n const arg_arr = this.$args.v;\n const params = [];\n arg_arr.forEach((t) => {\n if (this.is$typevar(t)) {\n if (this.tuple$index(params, t) < 0) {\n params.push(t);\n }\n }\n });\n this.$params = new Sk.builtin.tuple(params);\n }", "function blau(a,b,...params){\n return params;\n}", "function t(t,e){for(const n in e)t[n]=e[n];return t}", "function aa() {\n console.log(arguments)\n let [a, b] = arguments\n console.log(a, b)\n}", "function foo( {name , car, color} ) {\n c(name)\n c(color)\n // c(arguments[0])\n}", "function h([a, b, c]) {\n \n}", "function argsFor() {\n\n}", "function t(e,t){for(var i in t)e[i]=t[i];return e}", "function f3(a,...b){}", "function tc(t) {\n for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];\n for (var r = 0, i = e; r < i.length; r++) {\n var o = i[r];\n t = o._apply(t);\n }\n return t;\n}", "function f4(o, t) {\n var a;\n ({a, ...o.rest} = t);\n}", "function c(e,t){Object.keys(e).forEach(function(n){return t(e[n],n)})}", "function t() {\n var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : I;\n return [n[0], n[1], n[2], n[3]];\n }", "function newArgs(a,b,...args){\r\n console.log(args[3]);//prints third element in rest parameter after the parameter that are defined\r\n\r\n}", "function gatherArgs(fn){\n return function gather(...args){\n return fn(args)\n }\n}", "function myFunc2(x, y, ...params) { // used rest operator here\n console.log(x);\n console.log(y);\n console.log(params);\n}", "function Cricket({ batsman, bowler }) {\n //function definition with destrucrued object\n console.log([batsman, bowler]);\n return [batsman, bowler]; //square brackets for evaluating two or more keys\n}", "function test(a,b,...args){ //Rest Operator\n console.log(a);\n console.log(b);\n console.log(args);\n}", "function restParamsNArrays()\n{\n //constant, has to be initialized and cant be changed.\n const a = 100;\n\n // a = 50;\n let array = [100, 200, 300, 400, 500];\n let v1, v2, rest;\n\n //destructuring arrays and rest params. \n //rest params collect rest of the paramters in an array.\n [v1, v2,...rest] = array;\n console.log(a, v1, v2, rest);\n\n let v4, v5, rest1;\n [, v5,...rest1] = array;\n console.log(v4, v5, rest);\n\n //destructing objects.\n let car = {id : 400, style: \"convertible\"};\n //let {id, style} = car; //works fine.\n let id, style;\n ({id, style} = car); //needs paranthesis for diff between a code black and destructuring.\n console.log(id, style);\n\n //spread params ...opposite of rest...converts array to parameters.\n let nums = [1, 2, 3, 4, 5];\n testSpread(...nums);\n\n let str = 'abcdef';\n testSpread(...str); //string is iterable and gets converted to array of char on spread.\n\n}", "function myFunction({ first, second, third}) {\r\n return [first, second, third];\r\n }", "function f(a, b, ...theArgs) {\n // ...\n}", "function args() {\n\n}", "function st(e,t){Object.keys(e).forEach(function(n){return t(e[n],n)})}", "function getArguments(...args) {\n return args;\n}", "function t(){}", "function t(){}", "function takeRest(...params) {\n console.log(...params);\n}", "function f2(o) { \n\tconst {p1, p2, p3} = o; // name must by same as property in object\n\tconsole.log(p1, p2, p3);\n}", "tc(result, { args }) {\n result.$title = args[0]\n result.otherSide = args[1] ?? 'Unknown Income/Expense'\n return result\n }", "function sayHello(first, last, ...otherArgs) { // resting\n console.log(first);\n console.log(last);\n console.log(otherArgs);\n console.log(...otherArgs); // spreading\n}", "function t() {}", "function t() {}", "function f(...a) {\n\n}", "function la(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}", "function test () {\n return arguments\n}", "function example2 () {\n\n let sum = (a, b) => a + b\n \n function strParse (strings, ...params) {\n console.log(strings);\n console.log(strings.raw);\n console.log(params);\n }\n\n let a = 'test'\n let b = 13\n\n let s = strParse`Some ${a}\n string with another param ${b}\n and sum of 5 and 4, that is ${sum(5,4)}`\n}", "function one(a,...rest){\n console.log(a,rest)\n}", "function sortRestArgs(...theArgs) {\r\n console.log(theArgs.sort());\r\n}", "function manyThings(...things){\n console.log(things);\n}", "function myFun(a, b, ...manyMoreArg){\n console.log(\"a\", a);\n console.log(\"b\", b);\n console.log(\"manyMoreArg\", ...manyMoreArg);\n}", "function foo({\n x,\n y\n}) {\n console.log(x, y);\n}", "function f(...[a,b,c]){\r\n return a+b+c;\r\n}", "function printStuff(...a){\n console.log(a);\n}", "function getStuff2() {\r\n\t\t\tvar stuff = [];\r\n\t\t\tfor (i in props) {\r\n\t\t\t\tstuff.push(argsXF[i](arguments[i]));\r\n\t\t\t};\r\n\t\t\treturn stuff;\r\n\t\t}", "function multiply(...args){ // rest operator\n //body\n //console.log(args);\n for(let i in args){\n console.log(args[i]);\n }\n for(index = 0; index< args.length; index++){\n console.log(args[index]);\n }\n}", "function Xa(t) {\n for (var e = [], n = 1; n < arguments.length; n++) e[n - 1] = arguments[n];\n for (var r = 0, i = e; r < i.length; r++) {\n var o = i[r];\n t = o.td(t);\n }\n return t;\n}", "static fromTR(t, r) {\nreturn this.fromTRV(t.xyz, r.xyzw);\n}", "function myFun(a, b, ...manyMoreArgs) {\r\n console.log(`a: ${a}`);\r\n console.log(`b: ${b}`);\r\n console.log(`manyMoreArgs: ${manyMoreArgs}`);\r\n console.log(manyMoreArgs)\r\n}", "function alphaWithArgs(fns) {\n //console.log(\" ALPHA\")\n console.log(fns[0][`${fns[1]}`].push(\"ALPHA\"))\n //console.log(obj)\n return [fns[0], fns[1]]\n}", "function foo({name, age}){\n\tconsole.log(`${name} is ${age} years old!`);\n}", "function foo(x) {\n var [a,b] = x;\n print(a,b)\n}", "function data13({\n\ta,\n\tb\n} = {}) {\n\tconsole.log(a, b); // 1, 2\n}", "function data13({\n\ta,\n\tb\n} = {}) {\n\tconsole.log(a, b); // 1, 2\n}", "function getStuff(that) {\r\n\t\t\tvar stuff = [];\r\n\t\t\tfor (i in props) {\r\n\t\t\t\tstuff.push(argsXF[i](that[props[i]]));\r\n\t\t\t};\r\n\t\t\treturn stuff;\r\n\t\t}", "function ppargs(theArgs) {\n return (JSON.stringify(arguments[\"0\"],null,2));\n}", "function m(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}", "function f2(...a) {\r\n console.log(a);\r\n console.log(...a);\r\n}", "unspread(args) {\n return args;\n }", "function Yt(e,t){return typeof e==\"function\"?e(t):e}", "function tta(e){for(var t=arguments.length,n=[templateLiteral(e)],r=1;r<t;)n.push(arguments[r++]);return n}", "function t1() {\n function f() {\n return { ...{\n a: 1\n }\n };\n }\n\n f();\n let obj = f();\n console.log(1, obj.a);\n}", "function Tg(a,b){this.a=[];this.f=a;this.e=b||k}", "function i(e,t){return t}", "function l$b(t=T$1){return [t[0],t[1],t[2],t[3]]}", "function arr(...nums){\nconsole.log(nums);\n}", "function args2(...args) {\n console.log(\"arguments: \", args[0])\n}", "function t(t, e, n, r, i, o) {\n this.fa = t, this.methodName = e, this.path = n, this.Ta = r, \n // Minor hack: If fieldTransforms is undefined, we assume this is an\n // external call and we need to validate the entire path.\n void 0 === i && this.ma(), this.Ta = void 0 !== r && r, this.fieldTransforms = i || [], \n this.se = o || [];\n }", "function sumTwo(c,d,...values){//it an be args or values or anything. it just name\r\n console.log(\"rest operator taken values\",values);\r\n let multiply = c*d;\r\n let sum = 0;\r\n for (let arg of values) {\r\n sum += arg;\r\n }\r\n return [sum,multiply];\r\n}", "function test(){\n console.log(arguments); // Arguments(5) [3, 4, 5, 6, 7, callee: ƒ, Symbol(Symbol.iterator): ƒ] - argumets will be as an object here \n console.log([...arguments]); // [3, 4, 5, 6, 7] - after spread argumets will be as an array\n}", "function f5(o) {\n var a, rest;\n ({a, a, ...rest} = o);\n}", "function data(tmp =[]){\n var [\n first,\n second,\n third\n ] = tmp;\n}", "function c( t ){\n console.log( t );\n}", "function greetSpread(name, ...additionalParams){\n console.log(name);\n console.log(arguments);\n console.log(additionalParams);\n console.log('--------------');\n}", "function get_arg() { return arguments; }", "function SimpleArgs() {\r\n}", "function marry2(...args) {\n console.log(args);\n}", "destructuring() {\n let numbers = [1, 2, 3];\n let [one, two] = numbers;\n console.log(one); // 1\n console.log(two); // 2\n let [first, ...rest] = [1, 2, 3, 4];\n console.log(first); // 1\n console.log(rest); // [2, 3, 4]\n }", "function myFun(a, b, ...manyMoreArgs) {\n console.log(\"a\", a); \n console.log(\"b\", b);\n console.log(\"manyMoreArgs\", manyMoreArgs); \n}", "function La(n,t){for(var e in t)n[e]=t[e];return n}", "function t$i(t,...n){let o=\"\";for(let r=0;r<n.length;r++)o+=t[r]+n[r];return o+=t[t.length-1],o}", "function parseTargs(s){\n\tvar tset = {PIPE:true, INNERTEXT:true};\n\tvar object = {name:\"targs\", itext: null, next: null}\n\n\tobject.itext= parseItext(s) ;\n\n\tvar tk = scaner (s.substr(counter),tset);\n\n\tif (tk.token== \"PIPE\"){\n\t\tcounter+=1; \n\t\tobject.next= parseTargs(s) ;\n\t}\n\n\treturn object;\n\n\n}", "function greet(text, ...value) {\n console.log(text);\n console.log(value);\n}", "function destruct({nome: name}) {\n console.log(\"Name :\", name);\n}", "function v(t, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ne) {\n return t;\n}", "function tail(arg) {\n // desctructuring sebuah array menggunakan konsep tuple\n // gunakan spread operator pada value kedua desctructuring\n var _ = arg[0], result = arg.slice(1);\n return result;\n}", "function B(A,t){0}", "function functionWithArgs(a,b){\n console.log(a+b);\n }", "function example4() {\n\n var me = {\n name: \"Vlad\",\n surname: \"Argentum\"\n };\n\n function hi(_ref) {\n var _ref$name = _ref.name;\n var name = _ref$name === undefined ? \"Guest\" : _ref$name;\n var _ref$surname = _ref.surname;\n var s = _ref$surname === undefined ? \"Anon\" : _ref$surname;\n\n console.log(\"Hi, \" + name + \" \" + s);\n }\n\n hi({}); //Guest Anon\n hi(me); //Vlad Argentum\n\n //even can call without params\n function hi() {\n var _ref2 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref2$name = _ref2.name;\n var name = _ref2$name === undefined ? \"No\" : _ref2$name;\n var _ref2$surname = _ref2.surname;\n var s = _ref2$surname === undefined ? \"Params\" : _ref2$surname;\n\n console.log(\"Hi, \" + name + \" \" + s);\n }\n hi(); //No Params\n}", "function i(t){return t}", "function sum2(...rest) {\n console.log(rest);\n}", "function sayHi(firstArg, ...restOfArgs){\n console.log(`Hi ${firstArg}`);\n console.log(restOfArgs);\n}", "function data([\n first,\n second,\n third\n]) {\n // ...\n}", "function greet2(firstname, lastname, language, ...other) { // takes all non-listed params and wraps it into array with given name\n \n console.log('Firstname: ' + firstname);\n console.log('Lastname: ' + lastname);\n console.log('Language: ' + language);\n console.log('------');\n\n if(other) { // Deals with non-listed arguments/params\n console.log(other);\n }\n}", "function foo(p1) {\n var t = p1;\n var k = t;\n var z = k;\n var y = z;\n return y;\n}", "function foo(a, b, c) {\n return {a, ...b, c};\n}", "function C(t, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ne) {\n return t;\n}" ]
[ "0.60052025", "0.59543365", "0.5931069", "0.5901413", "0.5858622", "0.5728245", "0.5723525", "0.57099426", "0.57094055", "0.5687095", "0.56847155", "0.5638061", "0.5539837", "0.55193925", "0.55153036", "0.5504558", "0.54962385", "0.549054", "0.54818654", "0.5476089", "0.5442256", "0.5426872", "0.5420892", "0.54200554", "0.54193085", "0.54177064", "0.5413568", "0.5401381", "0.53926057", "0.5390278", "0.5390278", "0.5386388", "0.53695524", "0.53660285", "0.53581727", "0.53342146", "0.53342146", "0.5324733", "0.5320832", "0.5305784", "0.5303958", "0.5298934", "0.5294055", "0.5288387", "0.5268223", "0.52663404", "0.52606297", "0.52524155", "0.524862", "0.52484334", "0.52416015", "0.5236827", "0.5235579", "0.5224997", "0.52102417", "0.52054006", "0.5204047", "0.5204047", "0.5201669", "0.51941735", "0.51878715", "0.5184597", "0.5168722", "0.51679575", "0.51658326", "0.51645947", "0.5163959", "0.5160602", "0.5160245", "0.51467186", "0.5143738", "0.5127316", "0.51272005", "0.5123418", "0.5119914", "0.5119503", "0.5116297", "0.5112266", "0.51088715", "0.5102614", "0.509872", "0.5092956", "0.508562", "0.50846666", "0.50831574", "0.5082486", "0.50772244", "0.5076755", "0.50750333", "0.5073076", "0.50704145", "0.50649995", "0.5063342", "0.5060861", "0.5058186", "0.5050759", "0.50487655", "0.5044336", "0.5036929", "0.50340223", "0.5024494" ]
0.0
-1
FUNCTION CHANGE BACKGROUND IMAGE FIRST MENU
function changeImage(){ if (a>=30){ a=1; } var stringURL = "MEDIA/IMAGES/Best_Shots/" + a + ".jpg"; imagenFondo.style.backgroundImage="url('" + stringURL + "')"; a+=1; setTimeout(function(){changeImage();},8000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function background()\n {\n var images =\n [\n './menuJapanBG.gif',\n './menuJapanBG2.gif',\n './menuJapanBG3.gif',\n './menuSpaceBG4.gif',\n './menuSpaceBG5.gif',\n './menuOPMerryBG6.gif',\n ];\n\n var randomImage = Math.floor(Math.random() * images.length);\n document.getElementById(\"navList\").style.backgroundImage = 'url(' + images[randomImage] + ')';\n }", "function changeBGImage() {\n\t\t// get the custom data attribute from the clicked button\n\t\tlet currentImage = this.dataset.imageref;\n\n\t\t// `` is NOT a quote. it's a JavaScript template string\n\t\tdropZoneContainer.style.backgroundImage = `url(images/backGround${currentImage}.jpg)`;\n\n\n\t\t// this is an intermediate way to do the same something\n\t\t// dropZoneContainer.style.backgroundImage = `url(images/backGround${this.dataset.imageref}.jpg)`;\n\t\t// debugger;\n\t}", "function imageavatarbottommenuinstagram() {\n if (usuarioinstagram) {\n // console.log('setar bot menu')\n if (document.getElementById('bottominstaavatar')) {\n document.getElementById('bottominstaavatar').style.backgroundSize = \"cover\";\n document.getElementById('bottominstaavatar').style.background = \"url('\" + usuarioinstagram.avatar + \"')\";\n }\n\n\n if (document.getElementById('bottominstaavatar1')) {\n document.getElementById('bottominstaavatar1').style.backgroundSize = \"cover\";\n document.getElementById('bottominstaavatar1').style.background = \"url('\" + usuarioinstagram.avatar + \"')\";\n }\n\n\n if (document.getElementById('bottominstaavatar2')) {\n document.getElementById('bottominstaavatar2').style.backgroundSize = \"cover !important\";\n document.getElementById('bottominstaavatar2').style.background = \"url('\" + usuarioinstagram.avatar + \"')\";\n }\n\n }\n}", "function changeBackgroundColor(){\n let background_hex = new THREE.Color(menu.background).getHexString();\n if ( isHex(background_hex) && scene.background != \"#\" + background_hex ){\n scene.background = new THREE.Color(\"#\"+background_hex); }\n // backgroundScene = menu.background;\n // scene.background.color.setHex(backgroundScene);\n }", "function toggleBG(){\n\t \n\t \n\t \n\t $(\".top-logo\").toggleClass(\"accesbilitie_theme\");\n\t\t\t$(\".content\").toggleClass(\"accesbilitie_theme\");\n\t\t\t$(\"body\").toggleClass(\"accesbilitie_theme\");\n\t\t\t$(\"footer\").toggleClass(\"footer_disble\");\n\t\t\t$(\".top-logo\").toggleClass(\"top-logo_disble\");\n\t\t\t$(\".navbar-default\").toggleClass(\"nav_dasability\");\n\t\t\t$(\"footer ul li a\").toggleClass(\"footer_disble_m\");\n\t\t\t$(\".ch-person\").toggleClass(\"nav_dasability\");\n\t\t\t$(\".ch-person h4\").toggleClass(\"nav_dasability\");\n\t\t\t$(\".ch-person a\").toggleClass(\"nav_dasability\");\n\t\t\t$(\".logo-sec\").toggleClass(\"logo-sec_accesibility\");\n\t\t\t$(\".ut_name\").toggleClass(\"ut_name_accesibility\");\n\t\t\t$(\".flipkart-navbar-button\").toggleClass(\"nav_btn_dasability\");\n\t\t\t$(\".news_cover\").toggleClass(\"news_cover_accebility\");\n\t\t\t$(\".navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:focus, .navbar-default .navbar-nav > .active > a:hover\").toggleClass(\"nav_active\");\n\t\t\t\n\t\n }", "function changeBg(btnId, action){\n let bgUrl = 'img/';\n if(action === 'in'){\n switch(btnId){\n case 'btnInfancia1':\n bgUrl = bgUrl+'dotGreen.jpg';\n break;\n case 'btnInfancia2':\n bgUrl = bgUrl+'dotOrange.jpg';\n break;\n case 'btnInfancia3':\n bgUrl = bgUrl+'dotRed.jpg';\n break;\n } \n } else {\n bgUrl = bgUrl+'dotNormal.jpg'\n } \n ageBackground.style.backgroundImage = \"url('\"+bgUrl+\"')\"; \n }", "function changeMenu(id)\n{\n\tif(id==1)\n\t{\n\t\tdocument.getElementById(\"menu1\").style.background=\"url(img/menu/nosotros_1.png)\";\n\t\tdocument.getElementById(\"menu2\").style.background=\"url(img/menu/galeria.png)\";\n\t\tdocument.getElementById(\"menu3\").style.background=\"url(img/menu/guia.png)\";\n\t\tdocument.getElementById(\"menu4\").style.background=\"url(img/menu/padres.png)\";\n\t\tdocument.getElementById(\"menu5\").style.background=\"url(img/menu/foro.png)\";\n\t\tdocument.getElementById(\"menu6\").style.background=\"url(img/menu/contacto.png)\";\n\t\tdocument.getElementById(\"menu7\").style.background=\"url(img/menu/registrese.png)\";\n\t}\n\telse if(id==2)\n\t{\n\t\tdocument.getElementById(\"menu2\").style.background=\"url(img/menu/galeria_1.png)\";\n\t\tdocument.getElementById(\"menu1\").style.background=\"url(img/menu/nosotros.png)\";\n\t\tdocument.getElementById(\"menu3\").style.background=\"url(img/menu/guia.png)\";\n\t\tdocument.getElementById(\"menu4\").style.background=\"url(img/menu/padres.png)\";\n\t\tdocument.getElementById(\"menu5\").style.background=\"url(img/menu/foro.png)\";\n\t\tdocument.getElementById(\"menu6\").style.background=\"url(img/menu/contacto.png)\";\n\t\tdocument.getElementById(\"menu7\").style.background=\"url(img/menu/registrese.png)\";\n\t}\t\n\telse if(id==3)\n\t{\n\t\tdocument.getElementById(\"menu3\").style.background=\"url(img/menu/guia_1.png)\";\n\t\tdocument.getElementById(\"menu2\").style.background=\"url(img/menu/galeria.png)\";\n\t\tdocument.getElementById(\"menu1\").style.background=\"url(img/menu/nosotros.png)\";\n\t\tdocument.getElementById(\"menu4\").style.background=\"url(img/menu/padres.png)\";\n\t\tdocument.getElementById(\"menu5\").style.background=\"url(img/menu/foro.png)\";\n\t\tdocument.getElementById(\"menu6\").style.background=\"url(img/menu/contacto.png)\";\n\t\tdocument.getElementById(\"menu7\").style.background=\"url(img/menu/registrese.png)\";\n\t}\t\n\telse if(id==4)\n\t{\n\t\tdocument.getElementById(\"menu4\").style.background=\"url(img/menu/padres_1.png)\";\n\t\tdocument.getElementById(\"menu2\").style.background=\"url(img/menu/galeria.png)\";\n\t\tdocument.getElementById(\"menu3\").style.background=\"url(img/menu/guia.png)\";\n\t\tdocument.getElementById(\"menu1\").style.background=\"url(img/menu/nosotros.png)\";\n\t\tdocument.getElementById(\"menu5\").style.background=\"url(img/menu/foro.png)\";\n\t\tdocument.getElementById(\"menu6\").style.background=\"url(img/menu/contacto.png)\";\n\t\tdocument.getElementById(\"menu7\").style.background=\"url(img/menu/registrese.png)\";\n\t}\t\n\telse if(id==5)\n\t{\n\t\tdocument.getElementById(\"menu5\").style.background=\"url(img/menu/foro_1.png)\";\n\t\tdocument.getElementById(\"menu2\").style.background=\"url(img/menu/galeria.png)\";\n\t\tdocument.getElementById(\"menu3\").style.background=\"url(img/menu/guia.png)\";\n\t\tdocument.getElementById(\"menu4\").style.background=\"url(img/menu/padres.png)\";\n\t\tdocument.getElementById(\"menu1\").style.background=\"url(img/menu/nosotros.png)\";\n\t\tdocument.getElementById(\"menu6\").style.background=\"url(img/menu/contacto.png)\";\n\t\tdocument.getElementById(\"menu7\").style.background=\"url(img/menu/registrese.png)\";\n\t}\t\n\telse if(id==6)\n\t{\n\t\tdocument.getElementById(\"menu6\").style.background=\"url(img/menu/contacto_1.png)\";\n\t\tdocument.getElementById(\"menu2\").style.background=\"url(img/menu/galeria.png)\";\n\t\tdocument.getElementById(\"menu3\").style.background=\"url(img/menu/guia.png)\";\n\t\tdocument.getElementById(\"menu4\").style.background=\"url(img/menu/padres.png)\";\n\t\tdocument.getElementById(\"menu5\").style.background=\"url(img/menu/foro.png)\";\n\t\tdocument.getElementById(\"menu1\").style.background=\"url(img/menu/nosotros.png)\";\n\t\tdocument.getElementById(\"menu7\").style.background=\"url(img/menu/registrese.png)\";\n\t}\t\n\telse if(id==7)\n\t{\n\t\tdocument.getElementById(\"menu7\").style.background=\"url(img/menu/registrese_1.png)\";\n\t\tdocument.getElementById(\"menu2\").style.background=\"url(img/menu/galeria.png)\";\n\t\tdocument.getElementById(\"menu3\").style.background=\"url(img/menu/guia.png)\";\n\t\tdocument.getElementById(\"menu4\").style.background=\"url(img/menu/padres.png)\";\n\t\tdocument.getElementById(\"menu5\").style.background=\"url(img/menu/foro.png)\";\n\t\tdocument.getElementById(\"menu6\").style.background=\"url(img/menu/contacto.png)\";\n\t\tdocument.getElementById(\"menu1\").style.background=\"url(img/menu/nosotros.png)\";\n\t}\t\n}", "changeBg(){\n let path = this.$route.path;\n switch (path) {\n case '/':\n this.currentBg = \"rgb(250,250,250)\";\n break;\n case '/about':\n this.currentBg =`rgb(${this.about[0]},${this.about[1]},${this.about[2]})`;\n break;\n case '/projects':\n this.currentBg = `rgb(${this.projects[0]},${this.projects[1]},${this.projects[2]})`;\n break;\n case '/events':\n this.currentBg = `rgb(${this.events[0]},${this.events[1]},${this.events[2]})`;\n break;\n case '/contact':\n this.currentBg = `rgb(${this.contact[0]},${this.contact[1]},${this.contact[2]})`;\n break;\n }\n }", "function backImage(image) {\n\th1.style.backgroundImage = 'url(\"'+ image +'\")';\n\th1.style.backgroundPosition = \"center\";\n\th1.style.backgroundSize = \"cover\";\n\th1.style.backgroundRepeat = \"no-repeat\";\n\th1.style.color = \"black\";\n\th1.classList.add(\"special\");\n\tbackColor.classList.add(\"setBack\");\n}", "function changeBackgr() {\n\t\t//toggle the data state with conditionals and set background accordingly\n\t\tvar state = $(this).attr(\"datastate\");\n\t\tif (state === \"nobackgr\") {\n\t\t\t$(this).attr(\"style\", \"background-image:url('\" + $(this).attr(\"backgr\") + \"')\");\n\t\t\t$(this).attr(\"datastate\", \"backgr\");\n\t\t} else {\n\t\t\t$(this).attr(\"style\", \"background-image:url('\" + $(this).attr(\"nobackgr\") + \"')\");\n\t\t\t$(this).attr(\"datastate\", \"nobackgr\");\n\t\t}\n\t}", "function menuclick(event) {\n document.getElementById(\"maintour\").style.display = \"none\";\n var bo = document.querySelector(\"body\");\n bo.style.background = \"url('../Siddharth/images/BG_MobileTab.jpg') no-repeat center fixed\";\n bo.style.backgroundSize = \"cover\";\n\n }", "function addActiveDefault(){\nlgImg[0].classList.add('active');\n}", "function changeBGAct1 (){\n removeClasses();\n body.classList.add(\"act1\");\n}", "function handleBackgroundChange(selectedLens) {\n switch(selectedLens) {\n default:\n case 1: {\n midgroundAfterImg = midgroundAfterImgSeemax;\n break;\n }\n case 2: {\n midgroundAfterImg = middlegroundAfterImgStandard;\n break;\n }\n }\n }", "function draw_menu_background() {\r\n\tGame.level = 0;\r\n\t\r\n\tload_lvlMenu();\r\n\t\r\n\tdrawing_menu_loop();\r\n}", "function setImgBackground(img) {\n gMeme.selectedImg = img;\n}", "function bgImage() {\r\n $('[data-bgi]').each(function () {\r\n var src = $(this).attr('data-bgi');\r\n $(this).css({\r\n 'background-image': 'url(' + src + ')'\r\n });\r\n });\r\n }", "function removeMainMenuBg() {\n mainMenuBg.remove();\n mainMenuBg = '';\n }", "function sliderBgSetting() {\n if ($(\".hero-slider .slide\").length) {\n $(\".hero-slider .slide\").each(function () {\n var $this = $(this);\n var img = $this.children(img);\n var imgSrc = img.attr(\"src\");\n\n $this.css({\n backgroundImage: \"url(\" + imgSrc + \")\",\n backgroundSize: \"cover\",\n backgroundPosition: \"center center\"\n })\n });\n }\n }", "function changebgImage () {\n\n\n if(counter===backgroundimages.length-1){counter=0;}\n else{counter++;}\n\n herowrapper.fadeOut(750, function(){\n $(this).css(\"background-image\", \"url(\" + backgroundimages[counter].src + \")\").fadeIn(750);\n\n });\n\n }", "function changeBGAct2 (){\n removeClasses();\n body.classList.add(\"act2\");\n}", "function switchBackground() {\n carousel.style.background = \"url('\" + images[currentImage] + \"')\";\n carousel.style.backgroundSize = 'cover';\n carousel.style.backgroundPosition = 'center';\n caption.textContent = captions[currentImage];\n}", "function changeImage() {\n\n if (imageIndex == imageHistory.length){\n imageIndex = 0;\n }else{\n imageIcon.src = imageHistory[imageIndex];\n largeImageCont.style.backgroundImage = 'url(' + imageHistory[imageIndex] + ')';\n images[imageIndex].style.borderTop = '2px solid red';\n images[prevIndex].style.borderTop = 'none';\n imageIndex += 1;\n prevIndex = imageIndex - 1; \n }\n \n \n}", "function changeBGAct3 (){\n removeClasses();\n body.classList.add(\"act3\");\n}", "function sobre_menu(e){e.target.style.backgroundColor='white';}", "function bannerSliderBG() {\n\t$( \".banner-slider li\" ).each(function() {\n\t\tvar imgSrc = $( this ).find( \".slide\" ).children( \"img\" ).attr( \"src\" );\n\t\t$( this ).css( \"background-image\", \"url('\" + imgSrc + \"')\" );\n\t});\t\n}", "function changeBackground() {\n getId('img').style.display = 'none';\n getId(\"images-colors\").style.display = \"block\";\n getSel(\".bg-colors\").style.display = \"block\";\n getSel('.file').style.display = \"none\";\n let list = document.getElementsByClassName('parts-item');\n for (let i = 0; i < list.length; i++) {\n list[i].onclick = function () {\n document.body.style.backgroundColor = event.target.style.backgroundColor;\n }\n }\n}", "function menuclick(event) {\n // document.getElementById(\"fx-menu\").style.position = \"absolute\";\n document.getElementById(\"maincontact\").style.display = \"none\";\n document.getElementById(\"contactstory\").style.display = \"none\";\n var bo = document.querySelector(\"body\");\n bo.style.background = \"url('../images/rebgs/Sid\\ Acharya\\ 8.jpg') no-repeat center fixed\";\n bo.style.backgroundSize = \"cover\";\n\n\n }", "function state1(){\r\n var hero = document.getElementById('firstimg');\r\n hero.style.backgroundImage = \"url(img/image1.jpg)\" ;\r\n\r\n }", "setBackgroundImg() {\n if (this.scene.background) {\n push();\n imageMode(CENTER);\n image(this.backgroundImg.img, this.backgroundImg.position.x, this.backgroundImg.position.y, this.backgroundImg.size.width, this.backgroundImg.size.height);\n pop();\n }\n }", "function changePageBg() {\n console.log('changePagebg')\n let url = clock.userPageBg.imageUrl;\n if (!clock.userPageBg.showUserImage) url = '';\n if (clock.userPageBg.random) url = 'https://source.unsplash.com/1600x900/?nature,sky,galaxy';\n\n // if no url show only bg color\n if (!url) {\n body.style.background = `#${clock.userPageBg.color} url('${url}')`;\n return;\n }\n // if url - load image and show \n let img = new Image();\n img.onload = function () {\n body.style.background = `#${clock.userPageBg.color} url('${url}')`;\n body.style.backgroundPosition = \"center\";\n body.style.backgroundOrigin = \"center\";\n body.style.backgroundRepeat = \"no-repeat\";\n body.style.backgroundSize = \"cover\";\n img = null;\n };\n\n img.src = url;\n}", "function changeBGColor() {\n // Gets the selected backgrounds value and assigns it to a variable\n var bgVal = getValue(bgSelect);\n\n // Removes the 2nd item in the card classList\n card.classList.remove(card.classList[1]);\n\n // Adds a background class to the card classList using the\n // bgVal variable and concatenation\n card.classList.add(bgVal + \"Background\");\n }", "function coolAllNavButtons () {\n document.images[navSubImgName].src = site + navBaseURL + navSubBase ;\n for (i = 1 ; i < numNavImages ; i++) {\n document.images[navArr[i][navImgName]].src = site + navBaseURL + navArr[i][navFilenameCool] ;\n }\n\n if (gonnaReheat != 1) {\n imageNumChoice = defaultBar ;\n if (imageNumChoice) {\n heatNavButton (imageNumChoice) ;\n }\n }\n }", "function changeMainBg(){\n var bg = ['img/city1.jpg','img/city2.jpg','img/earth.jpg',\n 'img/jarvis.png', 'img/world.jpg', 'img/matrix.jpg', 'img/touchtable.jpg'];\n\n var length = bg.length;\n\n var num = Math.floor(Math.random() * length);\n\n $('#intro-row').css('background-image','url(' + bg[num] + ')');\n}", "function colorSelCurrent() {\r\n if(nOrU(document.getElementById(ICON_ID + currentDiv))) return;\r\n document.getElementById(ICON_ID + currentDiv).style.backgroundColor = BMDIV_BG_SEL;\r\n document.getElementById(TITLE_ID + currentDiv).style.backgroundColor = BMDIV_BG_SEL;\r\n document.getElementById(URL_ID + currentDiv).style.backgroundColor = BMDIV_BG_SEL;\r\n}", "function backgroundColor() {\n\t\t\t\tif (panache.inview(header, 68)) {\n\t\t\t\t\tpanache.addClass(nav, 'is-transparent');\n\t\t\t\t} else {\n\t\t\t\t\tpanache.removeClass(nav, 'is-transparent');\n\t\t\t\t}\n\t\t\t}", "function backgroundColor() {\n\t\t\t\tif (panache.inview(header, 68)) {\n\t\t\t\t\tpanache.addClass(nav, 'is-transparent');\n\t\t\t\t} else {\n\t\t\t\t\tpanache.removeClass(nav, 'is-transparent');\n\t\t\t\t}\n\t\t\t}", "function menuInicial(){\t\n\tctx.drawImage(document.getElementById(\"init\"), 0, 0);\n}", "function changeBGAct4 (){\n removeClasses();\n body.classList.add(\"act4\");\n}", "function novel_changeBackground(param, clearAll)\n{\n var fileName;\n var effect;\n var targetAlpha = 1.0;\n var bg;\n \n if (clearAll)\n {\n clearTableau();\n clearDialog();\n }\n fileName = novel.backgroundImage[novel.activeBG];\n if (typeof param == \"string\")\n {\n fileName = param;\n effect = \"\";\n }\n else if (param != null)\n {\n if (param.image)\n {\n fileName = param.image;\n }\n effect = (param.effect) ? param.effect : \"\";\n\n\t\tif (param.alpha)\n\t\t{\n\t\t\ttargetAlpha = param.alpha;\n\t\t}\n }\n\n fileName = fileName.replace(/{{(.*?)}}/g, novel_interpolator);\n if (!effect)\n {\n novel.backgroundImage[novel.activeBG] = fileName;\n bg = document.getElementById(\"background\" + novel.activeBG);\n bg.src = novel.imagePath + fileName;\n novel.pendingBackgroundImage = bg;\n novel.paused = true;\n }\n else if (effect == \"fade\")\n {\n novel.backgroundImage[novel.activeBG] = fileName;\n novel.paused = true;\n novel_fadeBgOut(targetAlpha);\n }\n else if (effect == \"dissolve\")\n {\n novel.backgroundImage[1 - novel.activeBG] = fileName;\n novel.pendingBackgroundImage = document.getElementById(\"background\" + (1 - novel.activeBG));\n novel.pendingBackgroundImage.src =\n novel.imagePath + fileName;\n novel.paused = true;\n }\n if (effect != \"fade\")\n {\n setTimeout('novel_finishLoadingBackground(\"' + effect + '\", ' + targetAlpha + ')', 30);\n }\n}", "function changeBgColor(myColor) {\n //javascript code\n /*var element = document.body;\n element.classList.toggle(myColor);*/\n\n $('body').removeClass(); //remove the last background added before\n $('body').addClass(myColor);\n collapseMenu(); //necesary for small devices\n}", "function changeBg(color) {\n block.style.backgroundColor = color;\n block.style.backgroundImage = null;\n}", "function change_img_color(li) {\n\tvar img = li.childNodes[1]; //select image inside the li \n\tvar orig = img.src;\n\tif(orig.match(/home/g)) {\n\t\timg.src = '../Icons/Selected/home.png'\n\t}\n\tif(orig.match(/write/g)) {\n\t\timg.src = '../Icons/Selected/write.png'\n\t}\n\tif(orig.match(/upcoming/g)) {\n\t\timg.src = '../Icons/Selected/upcoming.png'\n\t}\n}", "function ChangeImage(divRowImage, highLight) {\r\n if (highLight) {\r\n divRowImage.style.backgroundImage = \"url(../Images/ProductListHoverBg.png)\";\r\n }\r\n else {\r\n divRowImage.style.backgroundImage = \"url(../Images/ProductListBg.png)\";\r\n }\r\n}", "function backgroundColorSincrire() {\r\n $(li2).addClass('backgroundColorClick');\r\n if(li1.hasClass('backgroundColorClick')){\r\n li1.removeClass('backgroundColorClick');\r\n }\r\n if(li3.hasClass('backgroundColorClick')){\r\n li3.removeClass('backgroundColorClick');\r\n }\r\n }", "function init() {\n body = $('body');\n switcher = $('#bottomBar a.backgroundSwitcher');\n\n backgroundList = $('.backgroundList', switcher);\n activeBackground = $('.activeBackground', switcher);\n\n backgroundList.hide();\n switcher.click(function() {\n backgroundList.fadeToggle(100);\n });\n\n var i,len;\n for(i=0, len = themeNames.length; i < len; i++) {\n backgroundList.append('<a class=\"icon\" rel=\"' + themeNames[i] + '\"> </a>');\n }\n\n backgroundList.delegate('a', 'click', switchBg);\n\n switchBg(null, settings.getString('active_theme', 'one'));\n\n }", "function addMainMenuBg() {\n mainMenuBg = $('<span class=\"js-main-menu-close\" />');\n mainMenuToggleOpen.append(mainMenuBg);\n }", "function backgroundColorLocaliserActivite() {\r\n $(li3).addClass('backgroundColorClick');\r\n if(li1.hasClass('backgroundColorClick')){\r\n li1.removeClass('backgroundColorClick');\r\n }\r\n if(li2.hasClass('backgroundColorClick')){\r\n li2.removeClass('backgroundColorClick');\r\n }\r\n }", "function myWorkSubMenu( color, linkClass, photoPosition, agencyMargin, logoImage ){\n\tmyWork.style.backgroundColor = color\n\tdesktopMenuSection.style.backgroundColor = color\n\n\tfor (var i = 0; i < desktopMenuLink.length; i++) {\n\t\tif(desktopMenuLink[i].textContent !== \"my work\"){\n\t\t\tdesktopMenuLink[i].setAttribute(\"class\", linkClass);\n\t\t}\n\t};\n\t\n\tmyWorkPhoto.style.backgroundPosition = photoPosition\n\tagency.style.marginLeft = agencyMargin\n\tupperLeftLogo.setAttribute('src',logoImage);\n}", "function change_menu_class(){\n var scrollPos = $(document).scrollTop();\n if (scrollPos >= $('.main-navigation').outerHeight()) {\n $('.main-navigation').addClass(\"active-background\");\n } else {\n $('.main-navigation').removeClass(\"active-background\");\n $('body').css(\"padding-top:0;\");\n }\n if (scrollPos >= $('.main-header').outerHeight()) {\n $('body').addClass(\"padding-active\");\n } else {\n $('body').removeClass(\"padding-active\");\n }\n }", "function setEltBackgroundImage (elt, imageFilePath) \n{ if (is.nav4) elt.background.src = imageFilePath;\n else if (is.ie4up) elt.style.backgroundImage = \"url(\" + imageFilePath + \")\";\n else if (is.gecko) elt.style.backgroundImage = \"url(\" + imageFilePath + \")\";\n}", "function changeImage () {\n whichToChange = 1 - whichToChange;\n photoIndex ++;\n photoIndex %= photoFiles.length;\n photoEl[whichToChange].style.backgroundImage = \"url(\" + photoFiles[photoIndex] + \")\";\n}", "function changeBGAct5 (){\n removeClasses();\n body.classList.add(\"act5\");\n}", "function OLsetBackground(pic){\r\nif(pic==''){\r\nif(OLns4)over.background.src=null;else if(OLie4||OLns6)over.style.backgroundImage='none';\r\n}else{\r\nif(OLns4)over.background.src=pic;else if(OLie4||OLns6)over.style.backgroundImage='url('+pic+')';}\r\n}", "function MainMenu() {\r\n\tResetGui();\r\n\t\r\n\t// Background\r\n\tcanvasContext.drawImage(GetImage(\"images/MainMenu.png\"), 0, 0);\r\n\t\r\n\t// Buttons\r\n\t\r\n\t// Start Button\r\n\tCreateButton(0, GetImage(\"images/btnStart0.png\"), GetImage(\"images/btnStart1.png\"), 146, 227);\r\n\t\r\n\tDrawButtons();\r\n\t\r\n}", "function superSmashBrosOn() {\n switchScreen.style.backgroundImage =\n \"url('https://www.nintendo.com/content/dam/noa/en_US/games/switch/s/super-smash-bros-ultimate-switch/super-smash-bros-ultimate-switch-hero.jpg')\";\n switchScreen.style.backgroundSize = \"cover\";\n switchScreen.classList.remove(\"onHome\");\n switchScreen.classList.add(\"onGame\");\n}", "function changeBg() {\n if (counter === bgArray.length) counter = 0;\n\n const index = counter % bgArray.length;\n const img = document.createElement('img');\n img.src = bgArray[index];\n img.onload = () => {\n document.body.style.backgroundImage = `url(${img.src})`;\n };\n counter++;\n}", "function chooseBG() {\n let startScreen = document.getElementById(\"title-page\");\n startScreen.style.display = \"none\";\n let bgScreen = document.getElementById(\"show-bg\");\n bgScreen.style.display = \"flex\";\n let bgDay = document.getElementById(\"day\");\n bgDay.addEventListener(\"click\", function () {\n startPicture();\n });\n let bgNight = document.getElementById(\"night\");\n bgNight.addEventListener(\"click\", function () {\n day = false;\n startPicture();\n });\n }", "function initBgImg()\n{\n\tconsole.log(\"initBgImg()\");\n\n\tvar backgroundImage = document.getElementById(\"complete\");\n\n\tif(app.bgIndex == 1)\n\t{\n\t\tbackgroundImage.src = app.bgImg[0];\n\t}\n\telse if(app.bgIndex == 2)\n\t{\n\t\tbackgroundImage.src = app.bgImg[1];\n\t}\n\telse if(app.bgIndex == 3)\n\t{\n\t\tbackgroundImage.src = app.bgImg[2];\n\t}\n\telse if(app.bgIndex == 4)\n\t{\n\t\tbackgroundImage.src = app.bgImg[3];\n\t}\n\telse\n\t{\n\t\tbackgroundImage.src = app.bgImg[4];\n\t\tapp.bgIndex = 0;\n\t}\n\n\tapp.bgIndex++;\n}", "function changeBackground(){\n if($('#town-pressure').html().length > 0){\n var iconCode = $('#town-stats').attr('data-background').substr(0, 2);\n //console.log(imageLinks[iconCode]);\n $('.jumbotron').css(\"background-image\", imageLinks[iconCode]); //imageLinks is hardcoded in index.html.twig\n $('.jumbotron').css(\"background-size\", \"cover\");\n }\n\n }", "function setNavBarBackground(slideToIndex){\r\n // Get topNav elements\r\n var topNavLinks = document.getElementsByClassName(\"topNavButton\");\r\n var sideNavBtn = document.getElementById(\"sideNavBtn\");\r\n var pageTitle = document.getElementById(\"title\");\r\n if (backgroundConstrastSlideIndexes.includes(slideToIndex)){\r\n for (var i = 0; i < topNavLinks.length; i++){\r\n var element = topNavLinks[i];\r\n // Change color of the current topnav element to light\r\n element.style.background = 'rgba(255, 255, 255, 0.7)';\r\n }\r\n // Change color of the sidenav button to light\r\n pageTitle.style.background = 'rgba(255, 255, 255, 0.7)';\r\n sideNavBtn.style.background = 'rgba(255, 255, 255, 0.7)';\r\n }\r\n else {\r\n for (var i = 0; i < topNavLinks.length; i++){\r\n var element = topNavLinks[i];\r\n // Change color of the current topnav element to dark\r\n element.style.background = '';\r\n }\r\n // Change color of the sidenav button to dark\r\n pageTitle.style.background = '';\r\n sideNavBtn.style.background = '';\r\n }\r\n}", "function initThemeNavigation() {\n\n //initialise the wp thumbs event to assign theme and display selected background and sprites\n $(\"#theme-menu .nav, .custom-menu .nav\").on(\"mousedown touchstart\", function(event) {\n event.stopPropagation();\n event.preventDefault();\n \n $(\"#col1, #col2\").addClass(\"loading\");\n\n currentTheme = $(this).attr(\"alt\");\n currentItem = currentTheme;\n\n imgLayer.getChildren().hide();\n imgLayer.draw();\n\n //show the theme as text on the image\n var posX = $(\"#container\").width() / 2;\n var posY = 100;\n var size = 100;\n var message = currentTheme;\n drawText(posX, posY, size, message);\n\n $(\"#container, #col1, #col2, #back\").show();\n $(\"#showTextMsg\").hide();\n $(\"#theme-menu, #home, #act-home\").hide();\n\n //if this is the first time selected, create the item backgrounds\n if ($(\"#image-div\").children(\".\" + currentTheme).length === 0) {\n createItemBackgrounds();\n }\n\n //for custom show page with the sets and navigation to each set\n if (currentTheme === \"custom\") {\n showCustomPage();\n $(\"#act-home\").show();\n } else {\n //show background and item images \n $(\"#\" + currentTheme + \"_bg\").show();\n displayThemeSpriteImages();\n }\n });\n}", "getBackground(){\n\n\t\tif(currentLevel%5 != 0){\n\t\t\tcurrentBack = this.backLevels[0];\n\t\t}else{\n\t\t\tcurrentBack = this.backLevels[currentLevel/5];\n\t\t}\n\n\t\tvar numframe = currentLevel-Math.trunc(currentLevel/5);// Math.trunc(currentLevel/5) para que trunque el resultado \n \n \tif((currentLevel%5) != 0){ \n \t\tvar back = game.add.sprite(0, 0, currentBack, numframe);\n \t\tback.animations.currentFrame = numframe;\n \t}else{ \n \t\tgame.add.sprite(0, 0, currentBack); \n \t} \n\t}", "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 animateBackground() {\n\t\tbgStateOn = !bgStateOn;\n\t\tswitch (bgStateOn) {\n\t\tcase true:\n\t\t\t$.alertT10.backgroundImage = \"/images/blueiPadBg.png\";\n\t\t\tbreak;\n\n\t\tcase false:\n\t\t\t$.alertT10.backgroundImage = \"/images/rediPadBg.png\";\n\t\t\tbreak\n\t\t}\n\t}", "function setBackGround() {\n let el = $('.currency li');\n for (var i = 0; i < el.length; i++) {\n let clas = el[i].className;\n\n $(el[i]).css('background-image', 'url(' + './flag-icon/'+ clas + '.png' +')');\n }\n}", "function background() {\n var img =$('.bg_img');\n img.css('background-image', function () {\n var bg = ('url(' + $(this).data('background') + ')');\n return bg;\n });\n }", "function startGalleryTwo() {\n \n // let imgSrc = document.getElementsByTagName('img');\n let navEl = document.getElementById('nav').children;\n let imgContainer = document.getElementById('option2').children[0].children;\n \n for(let i = 0; i < imgMainArr.length; i++) {\n navEl[i].style.background = 'url(\"' + imgMainArr[i] + '\") no-repeat';\n navEl[i].style.backgroundPosition = 'center';\n navEl[i].style.backgroundSize = '75px';\n }\n \n for(let i = 0; i < imgContainer.length; i++) {\n imgContainer[i].removeAttribute('style');\n }\n return false;\n }", "function background(){\n var option1 = \"url('background2.jpg')\";\n var option2 = \"url('background3.jpg')\";\n var option3 = \"url('background.jpg')\";\n var option4 = \"url('background4.jpg')\";\n var selected = \"\";\n var num = Math.floor(Math.random() * 4);\n if(num == 0){\n selected = option1;\n }\n else if(num == 1){\n selected = option2;\n }\n else if(num == 2){\n selected = option3;\n }\n else if(num == 3){\n selected = option4;\n }\n for (var i = 0; i<tiles.length; i++){\n tiles[i].style.backgroundImage = selected; \n } \n }", "function chageColors(index) {\n\n if (index === 4) {\n body.style.backgroundColor = '#5100e7';\n $(\".flecha-top\").removeClass(\"d-none\");\n\n //cambiar color de menu\n document.querySelector(':root').style.setProperty('--colorBorde', '255,255,255');\n\n $(\".flecha-top a img\").removeClass(\"filtro-flecha-top\");\n\n $(\"#sidenav-logo img\").removeClass(\"color-logo-naranja\");\n $(\"#sidenav-menu div\").css('background-color', '#fff');\n\n } else if (index === 3) {\n\n body.style.backgroundColor = '#260031';\n $(\".flecha-top\").removeClass(\"d-none\");\n\n //cambiar color de menu\n document.querySelector(':root').style.setProperty('--colorBorde', '255,255,255');\n $(\".flecha-top a img\").removeClass(\"filtro-flecha-top\");\n\n $(\"#sidenav-logo img\").removeClass(\"color-logo-naranja\");\n $(\"#sidenav-menu div\").css('background-color', '#fff');\n\n } else if (index === 2) {\n body.style.backgroundColor = '#fff';\n $(\".flecha-top\").removeClass(\"d-none\");\n //cambiar color de menu\n document.querySelector(':root').style.setProperty('--colorBorde', '255,78,21');\n $(\".flecha-top a img\").addClass(\"filtro-flecha-top\");\n\n $(\"#sidenav-logo img\").addClass(\"color-logo-naranja\");\n $(\"#sidenav-menu div\").css('background-color', '#ff4e15');\n\n } else if (index === 1) {\n\n body.style.backgroundColor = '#ff4e15';\n $(\".flecha-top\").removeClass(\"d-none\");\n\n //cambiar color de menu\n document.querySelector(':root').style.setProperty('--colorBorde', '255,255,255');\n $(\".flecha-top a img\").removeClass(\"filtro-flecha-top\");\n\n $(\"#sidenav-logo img\").removeClass(\"color-logo-naranja\");\n $(\"#sidenav-menu div\").css('background-color', '#fff');\n\n } else if (index === 0) {\n body.style.backgroundColor = '#280250';\n $(\".flecha-top\").addClass(\"d-none\");\n $(\".icon-whatsapp\").css(\"right\", \"1.5%\");\n //cambiar color de menu\n document.querySelector(':root').style.setProperty('--colorBorde', '255,255,255');\n\n $(\"#sidenav-logo img\").removeClass(\"color-logo-naranja\");\n $(\"#sidenav-menu div\").css('background-color', '#fff');\n }\n}", "function changeBackground() {\r\n var clear = /(01)/;\r\n var cloud = /(02)|(03|(04))/;\r\n var rain = /(09)|(10)/;\r\n var thunder = /(11)/;\r\n var snow = /(13)/;\r\n var mist = /(50)/;\r\n if (clear.test(weatherIcon)) {\r\n $(\".background-img\").css(\"background-image\", 'url(\"sunny-img.jpg\")');\r\n } else if (cloud.test(weatherIcon)) {\r\n $(\".background-img\").css(\"background-image\", 'url(\"cloud-img.jpg\")');\r\n } else if (rain.test(weatherIcon)) {\r\n $(\".background-img\").css(\"background-image\", 'url(\"rain-img.jpg\")');\r\n $(\".display\").css(\"color\", \"white\");\r\n } else if (thunder.test(weatherIcon)) {\r\n $(\".background-img\").css(\"background-image\", 'url(\"thunder-img.jpeg\")');\r\n $(\".display\").css(\"color\", \"white\");\r\n } else if (snow.test(weatherIcon)) {\r\n $(\".background-img\").css(\"background-image\", 'url(\"snow-img.jpg\")');\r\n } else if (mist.test(weatherIcon)) {\r\n $(\".background-img\").css(\"background-image\", 'url(\"mist-img.jpg\")');\r\n $(\".display\").css(\"color\", \"white\");\r\n }\r\n }", "function change(navC,textC,mode,iconOff,iconOn,img1,img2,img3) {\n nav.style.backgroundColor = navC;\n textBox.style.backgroundColor = textC;\n toggleIcon.children[0].textContent = mode;\n toggleIcon.children[1].classList.replace(iconOff, iconOn);\n \n image1.src = img1;\n image2.src = img2;\n image3.src = img3;\n}", "function changeScreen() {\n\tif (round === 2) {\n\t\t$('body').css('background-image', 'url(images/space.jpg)');\n\t} else if (round == 3) {\n\t\t$('body').css('background-image', 'url(images/Battleback_coliseum.png)');\n\t} else if (round === 4) {\n\t\t$('body').css('background-image', 'url(images/Arena_Battle_Background.jpg)');\n\t} else if (round === 5) {\n\t\t$('body').css('background-image', 'url(images/final.jpg)');\n\t}\n}", "function enterSettings()\n{\n\t_canvas.style.backgroundImage = \"url(images/background.png)\";\n}", "function getCurrentPhoto(index, pos) {\n if (pos == \"fg\") {\n document.getElementById(foreImage).src = photosURL[index];\n }\n else if (pos == \"bg\") {\n document.getElementById(backImage).src = photosURL[index];\n }\n}", "function toggleBackgroundIconAndTextEnabled(submenuOptionImageId, submenuOptionTextId, submenuOptionFlag, submenuOptionStringKey) {\n\n document.getElementById(submenuOptionImageId).src = window[submenuOptionStringKey + (submenuOptionFlag ? \"_icon_link\" : \"_enabled_icon_link\")];\n document.getElementById(submenuOptionTextId).style.color = submenuOptionFlag ? \"white\" : cita_main_color;\n\n}", "function changeBackground() {\n\t\tvar url = this[this.selectedIndex].value;\n\t\tvar pieces = document.getElementById(\"puzzlearea\").childNodes;\n\t\tfor (var i = 0; i < pieces.length; i++) {\n\t\t\tpieces[i].style.backgroundImage = \"url(backgrounds/\" + url + \")\";\n\t\t}\n\t}", "function background(num){\n \n switch(num){\n \n case 0:\n $(\"#singleGameContent\").css({'background-image':'url(http://th05.deviantart.net/fs71/PRE/i/2011/177/1/0/tileable_wood_texture_02_by_ftourini-d3k1vk9.jpg)','background-size':'100%'}); \n \n break;\n \n case 1:\n $(\"#singleGameContent\").css('background-image', 'url(images/sports.png)');\n \n break;\n \n case 2:\n $(\"#singleGameContent\").css('background-image', 'url(images/history.png)');\n \n break;\n \n case 3:\n $(\"#singleGameContent\").css('background-image', 'url(images/philo.png)');\n\n break;\n \n case 4:\n $(\"#singleGameContent\").css(\"background-Color\",\"white\");\n \n break;\n \n case 5:\n $(\"#singleGameContent\").css('background-image', 'url(http://idesigniphone.net/wallpapers/54468.png)');\n \n break;\n }\n \n}", "function onClickMenu() {\n document.getElementById(\"menu\").classList.toggle(\"change\");\n \n document.getElementById(\"nav\").classList.toggle(\"change\");\n \n document.getElementById(\"menu-bg\").classList.toggle(\"change-bg\");\n }", "function setBgImage(pBlockClass){\n var elem = pBlockClass.getElementsByTagName('img')[0];\n if(elem){\n var imgloc = elem.getAttribute('src');\n pBlockClass.setAttribute('style','background-image: url('+imgloc.toString()+')');\n }\n }", "function _set_navigation() {\n\t\t\t$('#lightbox-nav').show();\n\n\t\t\t// Instead to define this configuration in CSS file, we define here. And it�s need to IE. Just.\n\t\t\t$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });\n\t\t\t\n\t\t\t// Show the prev button, if not the first image in set\n\t\t\tif ( settings.activeImage != 0 ) {\n\t\t\t\tif ( settings.fixedNavigation ) {\n\t\t\t\t\t$('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })\n\t\t\t\t\t\t.unbind()\n\t\t\t\t\t\t.bind('click',function() {\n\t\t\t\t\t\t\tsettings.activeImage = settings.activeImage - 1;\n\t\t\t\t\t\t\t_set_image_to_view();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// Show the images button for Next buttons\n\t\t\t\t\t$('#lightbox-nav-btnPrev').unbind().hover(function() {\n\t\t\t\t\t\t$(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });\n\t\t\t\t\t},function() {\n\t\t\t\t\t\t$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });\n\t\t\t\t\t}).show().bind('click',function() {\n\t\t\t\t\t\tsettings.activeImage = settings.activeImage - 1;\n\t\t\t\t\t\t_set_image_to_view();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Show the next button, if not the last image in set\n\t\t\tif ( settings.activeImage != ( settings.imageArray.length -1 ) ) {\n\t\t\t\tif ( settings.fixedNavigation ) {\n\t\t\t\t\t$('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })\n\t\t\t\t\t\t.unbind()\n\t\t\t\t\t\t.bind('click',function() {\n\t\t\t\t\t\t\tsettings.activeImage = settings.activeImage + 1;\n\t\t\t\t\t\t\t_set_image_to_view();\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// Show the images button for Next buttons\n\t\t\t\t\t$('#lightbox-nav-btnNext').unbind().hover(function() {\n\t\t\t\t\t\t$(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });\n\t\t\t\t\t},function() {\n\t\t\t\t\t\t$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });\n\t\t\t\t\t}).show().bind('click',function() {\n\t\t\t\t\t\tsettings.activeImage = settings.activeImage + 1;\n\t\t\t\t\t\t_set_image_to_view();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Enable keyboard navigation\n\t\t\t_enable_keyboard_navigation();\n\t\t}", "function ChooseBackground(I){\nvar G = Grids.Excel, row = G.GetRowById(\"Toolbar\");\nrow.BACKGROUNDClassInner = I.Name;\nG.RefreshCell(row,\"BACKGROUND\");\nChangeBackground(G,I.Name.slice(1));\n}", "function initMenu() {\n\n //removeSelectedClassForMenu();\n\n //$('.sub-menu > .sub-menu__item').eq(selectedIndex).addClass('sub-menu__item--active', 'active');\n \n }", "function backgroundColorAccueil() {\r\n $(li1).addClass('backgroundColorClick');\r\n if(li2.hasClass('backgroundColorClick')){\r\n li2.removeClass('backgroundColorClick');\r\n }\r\n if(li3.hasClass('backgroundColorClick')){\r\n li3.removeClass('backgroundColorClick');\r\n }\r\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 navSlide()\n{\n const menuBtn = document.querySelector(\".menuBtn\");\n const menuItem = document.querySelectorAll(\".navItem\");\n const menuItems = document.querySelector(\"#navList\"); \n\n menuBtn.addEventListener(\"click\", () =>\n {\n /**\n * ! ARRAY OF CLASS TAGS AND RANDOMIZE THE TOGGLE OF THAT SPECIFIC IMAGE (2, 3, 4...)\n */\n var background =\n [\n \"bg2\",\n \"bg3\",\n \"bg4\",\n \"bg5\",\n \"bg6\",\n ];\n \n var randomClass = Math.floor(Math.random() * background.length);\n \n if(!menuItems.classList.contains(\"open\"))\n {\n menuItems.classList.toggle(`${background[randomClass]}`);\n }\n\n toggle();\n });\n\n // close menu when an item is clicked\n menuItem.forEach(item =>\n {\n item.addEventListener(\"click\", () =>\n {\n if(menuBtn.classList.contains(\"open\"))\n {\n toggle();\n }\n }); \n });\n\n /**\n * ! ENDS IN A FAILURE\n * Randomize backround-image of the menu with 768px max-width.\n */\n function background()\n {\n var images =\n [\n './menuJapanBG.gif',\n './menuJapanBG2.gif',\n './menuJapanBG3.gif',\n './menuSpaceBG4.gif',\n './menuSpaceBG5.gif',\n './menuOPMerryBG6.gif',\n ];\n\n var randomImage = Math.floor(Math.random() * images.length);\n document.getElementById(\"navList\").style.backgroundImage = 'url(' + images[randomImage] + ')';\n }\n\n /**\n * Adds the \"open\" css tag to the item creating\n * the animation effect.\n */\n function toggle()\n {\n menuBtn.classList.toggle(\"open\");\n menuItems.classList.toggle(\"open\");\n }\n}", "function changecolor(item){\r\n\r\n if(item.style.backgroundColor != \"black\"){\r\n item.style.backgroundColor = \"black\";\r\n item.style.color = \"white\";\r\n }\r\n else{\r\n item.style.backgroundColor = \"white\";\r\n item.style.color = \"black\";\r\n }\r\n\r\n saveBGColor(item);\r\n\r\n}", "function changeImage() {\n document.getElementById('header').style.backgroundImage = \"url('\" + imgArr[iterator].src + \"')\";\n if (iterator == imgArr.length -1){\n iterator = 0;\n } else {\n iterator++;\n }\n}", "preloadMenu()\n {\n currentScene.load.image('Fondo', 'assets/sprites/Menus/Fondo.png');\n currentScene.load.image('Loading', 'assets/sprites/Menus/Loading.png');\n currentScene.load.image('GoatMenu', 'assets/sprites/Menus/GoatMenu.png');\n currentScene.load.image('Fondo2', 'assets/sprites/Menus/Fondo2.png');\n currentScene.load.image('Logo', 'assets/sprites/Menus/GoatLogo.png');\n currentScene.load.image('GameCredits', 'assets/sprites/Menus/GamuCreditso.png');\n\n currentScene.load.image('FirstStart', 'assets/sprites/Menus/Play.png');\n\n currentScene.load.image('StartBtn', 'assets/sprites/Menus/Start.png');\n currentScene.load.image('StartHigh', 'assets/sprites/Menus/Start2.png');\n currentScene.load.image('ContinueBtn', 'assets/sprites/Menus/Continue.png');\n currentScene.load.image('ContinueHigh', 'assets/sprites/Menus/Continue2.png');\n currentScene.load.image('MenuMuteBtn', 'assets/sprites/Menus/Mute.png');\n currentScene.load.image('MenuMuteHigh', 'assets/sprites/Menus/Mute2.png');\n currentScene.load.image('CreditsBtn', 'assets/sprites/Menus/Credits.png');\n currentScene.load.image('CreditsHigh', 'assets/sprites/Menus/Credits2.png');\n }", "function ToggleActiveClass1(){\n\n const react = sections[0].getBoundingClientRect();\n\n if(react.top >=-50 && react.top<394){\n sections[0].classList.add('your-active-class');\n menuBar.getElementsByTagName('li')[0].style.background = \"rgb(71, 149, 250)\";\n }else{\n sections[0].classList.remove('your-active-class')\n menuBar.getElementsByTagName('li')[0].style.background = \"\";\n }\n }", "function _set_navigation() {\r\n\t\t\t$('#lightbox-nav').show();\r\n\r\n\t\t\t// Instead to define this configuration in CSS file, we define here. And itґs need to IE. Just.\r\n\t\t\t$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });\r\n\t\t\t\r\n\t\t\t// Show the prev button, if not the first image in set\r\n\t\t\tif ( settings.activeImage != 0 ) {\r\n\t\t\t\tif ( settings.fixedNavigation ) {\r\n\t\t\t\t\t$('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })\r\n\t\t\t\t\t\t.unbind()\r\n\t\t\t\t\t\t.bind('click',function() {\r\n\t\t\t\t\t\t\tsettings.activeImage = settings.activeImage - 1;\r\n\t\t\t\t\t\t\t_set_image_to_view();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Show the images button for Next buttons\r\n\t\t\t\t\t$('#lightbox-nav-btnPrev').unbind().hover(function() {\r\n\t\t\t\t\t\t$(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });\r\n\t\t\t\t\t},function() {\r\n\t\t\t\t\t\t$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });\r\n\t\t\t\t\t}).show().bind('click',function() {\r\n\t\t\t\t\t\tsettings.activeImage = settings.activeImage - 1;\r\n\t\t\t\t\t\t_set_image_to_view();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Show the next button, if not the last image in set\r\n\t\t\tif ( settings.activeImage != ( settings.imageArray.length -1 ) ) {\r\n\t\t\t\tif ( settings.fixedNavigation ) {\r\n\t\t\t\t\t$('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })\r\n\t\t\t\t\t\t.unbind()\r\n\t\t\t\t\t\t.bind('click',function() {\r\n\t\t\t\t\t\t\tsettings.activeImage = settings.activeImage + 1;\r\n\t\t\t\t\t\t\t_set_image_to_view();\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Show the images button for Next buttons\r\n\t\t\t\t\t$('#lightbox-nav-btnNext').unbind().hover(function() {\r\n\t\t\t\t\t\t$(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });\r\n\t\t\t\t\t},function() {\r\n\t\t\t\t\t\t$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });\r\n\t\t\t\t\t}).show().bind('click',function() {\r\n\t\t\t\t\t\tsettings.activeImage = settings.activeImage + 1;\r\n\t\t\t\t\t\t_set_image_to_view();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Enable keyboard navigation\r\n\t\t\t_enable_keyboard_navigation();\r\n\t\t}", "function aleatorio() {\n\tvar azar = Math.floor(Math.random() * objetos.length);\n background = document.querySelector(\".masthead\");\n background.style.backgroundImage = \"url(\" + objetos[azar] + \")\";\n}", "function changeBackground(el_id_1, el_id_2, img){\n\t\t$(el_id_1).css('background-color', '#fff');\n\t\t$(el_id_2).css('background-color', 'transparent');\n\t\t$(\"html\").css({\n\t\t\tbackground : 'url(' + img + ') no-repeat center top fixed',\n\t\t\tbackgroundSize : 'cover'\n\t\t});\n\t\t$('#real_name').toggle();\n\t\t$('#blue_name').toggle();\n\t}", "function menu_standard() {\n\t$('#menu').removeClass('menu_reverse');\n\t$('.ico_home').removeClass('ico_home_reverse');\n\t$('.menu_child:not(.ico_home)').css('visibility', 'visible');\n}", "function setBackgroud() {\r\n var tempArr;\r\n var curTemp = round(weatherData.currently.temperature, 0);\r\n\r\n if (weatherData.flags.units == 'si')\r\n tempArr = [32, 21, 0];\r\n else\r\n tempArr = [90, 70, 32];\r\n\r\n if (curTemp >= tempArr[0])\r\n $('body').css('background-image', imgArr[0]);\r\n else if (curTemp < tempArr[0] && curTemp >= tempArr[1])\r\n $('body').css('background-image', imgArr[1]);\r\n else if (curTemp < tempArr[1] && curTemp >= tempArr[2])\r\n $('body').css('background-image', imgArr[2]);\r\n else if (curTemp < tempArr[2])\r\n $('body').css('background-image', imgArr[3]);\r\n}", "board_changeImage(currentBoard){\n // make image and color changes persistent?\n this.backdialog=false;\n }", "function selectBackground(){\n var $selectbg = $('#selectbg');\n var $this = $(this);\n var newClass = $this.attr('id');\n var oldClass = $selectbg.attr('class');\n\n localStorage.setItem('background', $this.attr('src'));\n\n $selectbg.fadeOut(() => $selectbg\n .removeClass(oldClass)\n .addClass(newClass)\n .fadeIn('slow')\n );\n\n $('#selectbgname').text(newClass.charAt(0).toUpperCase() + newClass.slice(1));\n $this.css('background-color', '#00cc99');\n}", "function colorUnselCurrent() {\r\n if(nOrU(document.getElementById(ICON_ID + currentDiv))) return;\r\n document.getElementById(ICON_ID + currentDiv).style.backgroundColor = BMDIV_BG_UNSEL;\r\n document.getElementById(TITLE_ID + currentDiv).style.backgroundColor = BMDIV_BG_UNSEL;\r\n document.getElementById(URL_ID + currentDiv).style.backgroundColor = BMDIV_BG_UNSEL;\r\n}", "function prevImg() {\r\n\t\t// def var locali\r\n\t\tlet imgActive = $('.images img.active');\r\n\t\tlet circleActive = $('.nav i.active');\r\n\t\t// rimozione class .active\r\n\t\timgActive.removeClass('active');\r\n\t\tcircleActive.removeClass('active');\r\n\t\t// if block\r\n\t\tif (imgActive.hasClass('first')) {\r\n\t\t\t$('.images img.last').addClass('active');\r\n\t\t\t$('.nav i.last').addClass('active');\r\n\t\t} else {\r\n\t\t\timgActive.prev().addClass('active');\r\n\t\t\tcircleActive.prev().addClass('active')\r\n\t\t}\r\n\t}", "function trocarBG(){\n document.querySelector('.bg').classList.add('bg1')\n \n}", "set MainBackgroundImage(value) {\n this._backgroundImage = value;\n }" ]
[ "0.6935859", "0.66484636", "0.6559671", "0.6503491", "0.64723575", "0.6451667", "0.64357305", "0.6414318", "0.63924176", "0.6323575", "0.632252", "0.6309622", "0.6304023", "0.6293899", "0.62816525", "0.6264104", "0.62595457", "0.6252126", "0.62521183", "0.6240928", "0.6229405", "0.6225116", "0.62250537", "0.6212327", "0.62014395", "0.6199273", "0.61991245", "0.61926854", "0.6185281", "0.61749876", "0.6169852", "0.6155562", "0.61538047", "0.6153142", "0.6149556", "0.61480194", "0.61480194", "0.6138433", "0.6120949", "0.6115482", "0.611132", "0.60800844", "0.6079229", "0.60738736", "0.60720116", "0.6057412", "0.6056048", "0.6054189", "0.60444707", "0.60414016", "0.6033087", "0.6024929", "0.6015859", "0.60115784", "0.6003844", "0.5999774", "0.5992055", "0.59903556", "0.5988957", "0.59870136", "0.5979661", "0.597433", "0.5967647", "0.5963156", "0.59501725", "0.59484047", "0.5940479", "0.59344506", "0.5928186", "0.59191734", "0.5905051", "0.59036845", "0.588846", "0.5885731", "0.587133", "0.5868871", "0.5863269", "0.5862106", "0.58619666", "0.58603543", "0.58592796", "0.5855436", "0.5854167", "0.585336", "0.58517563", "0.58511764", "0.58462805", "0.583851", "0.58304673", "0.582828", "0.5824033", "0.582148", "0.58149797", "0.58123773", "0.5811378", "0.5810045", "0.5808219", "0.5805441", "0.58016783", "0.57924205", "0.57913446" ]
0.0
-1
Use Yarn if available, it's much faster than the npm client. Return the version of yarn installed on the system, null if yarn is not available.
function getYarnVersionIfAvailable() { let yarnVersion; try { // execSync returns a Buffer -> convert to string yarnVersion = ( execSync('yarn --version', { stdio: [0, 'pipe', 'ignore'], }).toString() || '' ).trim(); } catch (error) { return null; } return yarnVersion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUpdateCommand() {\n if (YARN_INSTALL_METHOD === 'tar') {\n return 'curl -o- -L https://yarnpkg.com/install.sh | bash';\n }\n\n if (YARN_INSTALL_METHOD === 'homebrew') {\n return 'brew upgrade yarn';\n }\n\n if (YARN_INSTALL_METHOD === 'deb') {\n return 'sudo apt-get update && sudo apt-get install yarn';\n }\n\n if (YARN_INSTALL_METHOD === 'rpm') {\n return 'sudo yum install yarn';\n }\n\n if (YARN_INSTALL_METHOD === 'npm') {\n return 'npm upgrade --global yarn';\n }\n\n if (YARN_INSTALL_METHOD === 'chocolatey') {\n return 'choco upgrade yarn';\n }\n\n return null;\n}", "async function yarn() {\n console.log( taskHeader(\n '1/5',\n 'Dependencies',\n 'Install',\n 'Yarn'\n ) );\n\n try {\n const { stdout, stderr } = await execa.commandSync( 'yarn install --non-interactive' );\n console.log( stdout );\n console.log( stderr );\n } catch( error ) {\n console.error( error.stdout );\n }\n}", "function getYarnBinPath() {\n if (isWebpackBundle) {\n return __filename;\n } else {\n return path.join(__dirname, '..', 'bin', 'yarn.js');\n }\n}", "function preferredCliVersion() {\n const pjLocation = findUp('package.json', __dirname);\n if (!pjLocation) {\n return undefined;\n }\n const pj = JSON.parse(fs.readFileSync(pjLocation, { encoding: 'utf-8' }));\n return pj.preferredCdkCliVersion ? `${pj.preferredCdkCliVersion}` : undefined;\n}", "function installPackages() {\n\tconst command = `${path.normalize(ENV_YARN)} ${YARN_INSTALL_COMMAND}`;\n\tconsole.log('\\nInstalling Packages');\n\n\tverbose(`Executing: ${command}`);\n\tverbose(`Using Node Version: ${execSync(`${path.normalize(ENV_NODE)} -v`)}`);\n\texecSync(command, {\n\t\tstdio: [0, 1, 2]\n\t});\n\n\treturn symlinkNodeBinary();\n}", "install() {\n const hasYarn = commandExists('yarn');\n\n this.installDependencies({\n npm: !hasYarn, // Use npm as fallback, if yarn is not installed\n bower: false, // Do not use bower\n yarn: hasYarn,\n skipMessage: this.options['skip-install-msg'],\n skipInstall: this.options['skip-install']\n });\n }", "function resolveGlobalYarnPath(tracer) {\r\n let yarnCommand = 'yarn';\r\n let options = {\r\n encoding: 'utf8'\r\n };\r\n if (isWindows()) {\r\n yarnCommand = 'yarn.cmd';\r\n options.shell = true;\r\n }\r\n let handler = () => { };\r\n try {\r\n process.on('SIGPIPE', handler);\r\n let results = child_process_1.spawnSync(yarnCommand, ['global', 'dir', '--json'], options);\r\n let stdout = results.stdout;\r\n if (!stdout) {\r\n if (tracer) {\r\n tracer(`'yarn global dir' didn't return a value.`);\r\n if (results.stderr) {\r\n tracer(results.stderr);\r\n }\r\n }\r\n return undefined;\r\n }\r\n let lines = stdout.trim().split(/\\r?\\n/);\r\n for (let line of lines) {\r\n try {\r\n let yarn = JSON.parse(line);\r\n if (yarn.type === 'log') {\r\n return path.join(yarn.data, 'node_modules');\r\n }\r\n }\r\n catch (e) {\r\n // Do nothing. Ignore the line\r\n }\r\n }\r\n return undefined;\r\n }\r\n catch (err) {\r\n return undefined;\r\n }\r\n finally {\r\n process.removeListener('SIGPIPE', handler);\r\n }\r\n}", "function resolveGlobalYarnPath(tracer) {\r\n let yarnCommand = 'yarn';\r\n let options = {\r\n encoding: 'utf8'\r\n };\r\n if (isWindows()) {\r\n yarnCommand = 'yarn.cmd';\r\n options.shell = true;\r\n }\r\n let handler = () => { };\r\n try {\r\n process.on('SIGPIPE', handler);\r\n let results = child_process_1.spawnSync(yarnCommand, ['global', 'dir', '--json'], options);\r\n let stdout = results.stdout;\r\n if (!stdout) {\r\n if (tracer) {\r\n tracer(`'yarn global dir' didn't return a value.`);\r\n if (results.stderr) {\r\n tracer(results.stderr);\r\n }\r\n }\r\n return undefined;\r\n }\r\n let lines = stdout.trim().split(/\\r?\\n/);\r\n for (let line of lines) {\r\n try {\r\n let yarn = JSON.parse(line);\r\n if (yarn.type === 'log') {\r\n return path.join(yarn.data, 'node_modules');\r\n }\r\n }\r\n catch (e) {\r\n // Do nothing. Ignore the line\r\n }\r\n }\r\n return undefined;\r\n }\r\n catch (err) {\r\n return undefined;\r\n }\r\n finally {\r\n process.removeListener('SIGPIPE', handler);\r\n }\r\n}", "async function resolvePackage({ scoped, name, version }) {\n const tempVersion = version || 'latest'\n const parsedVersion = semver.valid(tempVersion)\n\n if (parsedVersion) {\n return { scoped, name, version: parsedVersion }\n }\n try {\n // Version info of scoped packages cannot be\n // fetched directly, hence we must fetch data\n // for all versions, which is expensive :(\n // @see https://github.com/npm/registry/issues/34\n if (scoped) {\n const [scopePart, namePart] = name.split('/')\n const response = await fetch(`https://registry.yarnpkg.com/${scopePart}${encodeURIComponent('/')}${namePart}`)\n const packageInfo = await response.json()\n\n if (!response.ok || !packageInfo['dist-tags'] || !packageInfo['dist-tags'][tempVersion]) {\n throw new CustomError('PackageNotFoundError', { statusText: response.statusText })\n }\n\n return { scoped, name, version: packageInfo['dist-tags'][tempVersion] }\n\n } else {\n const response = await fetch(`https://registry.yarnpkg.com/${name}/${tempVersion}`)\n\n if (!response.ok) {\n throw new CustomError('PackageNotFoundError', { statusText: response.statusText })\n }\n\n const packageInfo = await response.json()\n return { scoped, name, version: packageInfo.version }\n }\n } catch (err) {\n throw new CustomError('PackageNotFoundError', err)\n }\n}", "async function getNewVersion() {\n const sharedPackage = core.getInput('shared-package');\n const result = await exec(`npm view ${sharedPackage} version`);\n const newVersion = bumpMinorVersion(result.stdout);\n return newVersion;\n}", "function yarnIntegrityCheck() {\n shell.cd(cwd);\n let out = shell.exec('yarn check --integrity').code;\n return out ? false : true;\n}", "function which_node_gyp() {\n var node_gyp_bin;\n if (process.env.npm_config_node_gyp) {\n try {\n node_gyp_bin = process.env.npm_config_node_gyp;\n if (existsSync(node_gyp_bin)) {\n return node_gyp_bin;\n }\n } catch (err) {}\n }\n try {\n var node_gyp_main = /*require.resolve*/(!(function webpackMissingModule() { var e = new Error(\"Cannot find module \\\"node-gyp\\\"\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n node_gyp_bin = path.join(path.dirname(path.dirname(node_gyp_main)), 'bin/node-gyp.js');\n if (existsSync(node_gyp_bin)) {\n return node_gyp_bin;\n }\n } catch (err) {}\n if (process.execPath.indexOf('iojs') === -1) {\n try {\n var npm_main = /*require.resolve*/(!(function webpackMissingModule() { var e = new Error(\"Cannot find module \\\"npm\\\"\"); e.code = 'MODULE_NOT_FOUND'; throw e; }()));\n node_gyp_bin = path.join(path.dirname(path.dirname(npm_main)), 'node_modules/node-gyp/bin/node-gyp.js');\n if (existsSync(node_gyp_bin)) {\n return node_gyp_bin;\n }\n } catch (err) {}\n }\n var npm_base = path.join(path.dirname(path.dirname(process.execPath)), 'lib/node_modules/npm/');\n node_gyp_bin = path.join(npm_base, 'node_modules/node-gyp/bin/node-gyp.js');\n if (existsSync(node_gyp_bin)) {\n return node_gyp_bin;\n }\n}", "function getPackageName() {\n let name;\n try {\n name = require(path.join(process.cwd(), \"package.json\")).name;\n // strip NPM scope, if possible\n const nameSplit = name.split(\"/\");\n if (nameSplit.length > 1) {\n name = nameSplit[1];\n }\n } catch (e) {\n console.error(\"[webpack-build-scripts] Couldn't read package name from package.json\", e);\n }\n return name;\n}", "function yarnGlobalFolder() {\n var userHome = os.homedir();\n if (process.platform === \"linux\" && process.env.USER === \"root\") {\n userHome = resolve(\"/usr/local/share\");\n }\n if (process.platform === \"win32\" && process.env.LOCALAPPDATA) {\n return join(process.env.LOCALAPPDATA, \"Yarn\", \"global\", \"node_modules\");\n }\n return join(userHome, \".yarn-config\", \"global\", \"node_modules\");\n}", "function installDeps() {\n exec('node --version', function (err, stdout, stderr) {\n const nodeVersion = stdout && parseFloat(stdout.substring(1));\n if (nodeVersion < 5 || err) {\n installDepsCallback(err || 'Unsupported node.js version, make sure you have the latest version installed.');\n } else {\n exec('yarn --version', function (err, stdout, stderr) {\n if (parseFloat(stdout) < 0.15 || err || process.env.USE_YARN === 'false') {\n process.stdout.write('yarn not found, normal npm i');\n process.stdout.write(chalk.yellow('\\nnpm installing...'));\n exec('npm install', addCheckMark.bind(null, installDepsCallback));\n } else {\n process.stdout.write(chalk.yellow('\\nyarn installing...'));\n exec('yarn install', addCheckMark.bind(null, installDepsCallback));\n }\n });\n }\n });\n}", "async hasYarnLock (\n nativeApplicationName: string,\n platformName: string,\n versionName: string,\n key: string\n ) : Promise<boolean> {\n const version = await this.getVersion(nativeApplicationName, platformName, versionName)\n if (!version) {\n throw new Error(`${versionName} version does not exist for ${nativeApplicationName} ${platformName}`)\n }\n if (version.yarnLocks && version.yarnLocks[key]) {\n return true\n } else {\n return false\n }\n }", "function getPackageVersion() {\n return JSON.parse(fs.readFileSync('./package.json')).version;\n}", "static version_lookup() {\n return require('../package.json').version;\n }", "function getGlobalInstallCommand() {\n if (hasYarn()) {\n const { stdout: yarnGlobalDir } = execa.sync('yarn', ['global', 'dir'])\n if (__dirname.includes(yarnGlobalDir)) {\n return 'yarn global add'\n } \n }\n const { stdout: npmGlobalPrefix } = execa.sync('npm', ['config', 'get', 'prefix'])\n if (__dirname.includes(npmGlobalPrefix)) {\n return 'npm i -g'\n }\n}", "function getVersion(){\n // skip this commit if there isn't a package.json to get the version\n if (!fs.existsSync('package.json')) {\n return null;\n }\n var pkg = fs.readFileSync('package.json');\n // get the version of the application in that commit\n try {\n return JSON.parse(pkg).version;\n } catch (err) {\n return (/\"version\": \"([\\d.]+)\"/g.exec(pkg))[1];\n }\n}", "function getVersion() {\n var pkg = JSON.parse(fs.readFileSync('package.json'));\n return pkg.version;\n}", "function getPackageVersion(command,packageName) {\n\tlet sep;\n\tif (command == \"npm\") {\n\t\tsep = \"@\";\n\t} else if (command == \"bower\") {\n\t\tsep = \"#\";\n\t} else {\n\t\treturn Promise.reject(\"Unsupported package command\");\n\t}\n\n\tif (!packageName) {\n\t\treturn Promise.reject(\"Package name not specified\");\n\t}\n\n\treturn new Promise(function (resolve,reject) {\n\t\tlet npm = child_process.exec(command + \" list \" + packageName);\n\t\tlet output = \"\";\n\t\tlet version = \"\";\n\t\tnpm.stdout.on(\"data\", function (data) {\n\t\t\toutput += data;\n\t\t\tconsole.log(data);\n\t\t});\n\t\tnpm.stderr.on(\"data\", function (data) {\n\t\t\tconsole.log(data);\n\t\t});\n\t\tnpm.on(\"close\", function (code) {\n\t\t\tif (!code) {\n\t\t\t\tlet reText = packageName + sep + \"(\\\\d*\\\\.\\\\d*\\\\.\\\\d*)\";\n\t\t\t\tlet re = new RegExp(reText);\n\t\t\t\tlet m = output.match(re);\n\t\t\t\tif (m) {\n\t\t\t\t\tversion = m[1];\n\t\t\t\t\treturn resolve(version);\n\t\t\t\t}\n\t\t\t}\n\t\t\treject(\"Could not get version\");\n\t\t});\n\t\tnpm.on(\"error\", function (err) {\n\t\t\tconsole.log(err);\n\t\t});\n\t});\n}", "async function findNpmName(npmClis) {\n if (!npmClis || npmClis.length === 0) {\n // Fallback to npm if no special npm CLI is found.\n return \"npm\";\n }\n\n const [currentCli, ...otherClis] = npmClis;\n\n try {\n await execute(`${currentCli} --version`);\n\n return currentCli;\n } catch (e) {\n return findNpmName(otherClis);\n }\n}", "getNPMVersion() {\n\t\tlet npmVersion = {};\n\t\tfor (let npm_version of shell.exec('npm version', {silent:true}).replace(/[\\'{}]/g, \"\").split(\",\")) {\n\t\t\tlet entry = npm_version.split(\":\");\n\t\t\tif (entry.length == 2) {\n\t\t\tnpmVersion[entry[0].trim()] = entry[1].trim();\n\t\t\t}\n\t\t}\n\t\treturn npmVersion;\n\t}", "function getBabel() {\n if (!babel) {\n babel = require('babel-core');\n }\n return babel;\n}", "ensureCompatibility() {\n if (this.name !== workspace_schema_1.PackageManager.Npm) {\n return;\n }\n try {\n const version = (0, semver_1.valid)(this.version);\n if (!version) {\n return;\n }\n if ((0, semver_1.satisfies)(version, '>=7 <7.5.6')) {\n // eslint-disable-next-line no-console\n console.warn(`npm version ${version} detected.` +\n ' When using npm 7 with the Angular CLI, npm version 7.5.6 or higher is recommended.');\n }\n }\n catch {\n // npm is not installed.\n }\n }", "function loadPackageVersionGracefully(packageName) {\n try {\n return require(`${packageName}/package.json`).version;\n }\n catch (_a) {\n return null;\n }\n}", "function getSystemNodeVers(cb) {\n exec('node -v', function(err, stdout) {\n if (err) {\n return cb(err, null);\n }\n cb(null, stdout.slice(1).replace('\\n',''));\n });\n}", "function linkNVM () {\n if (process.platform !== \"win32\") { return process.platform; }\n const source = shell.env[\"NVM_SYMLINK\"];\n if (!source) { return \"nvm not exists\"; }\n const target = `${shell.env[\"APPDATA\"]}/npm`;\n const exists = shell.test(\"-L\", target);\n if (exists) { return \"already link before\"; }\n shell.ln(\"-sf\", source, target);\n}", "function getPackageName(installPackage) {\n if (installPackage.match(/^.+\\.(tgz|tar\\.gz)$/)) {\n return getTemporaryDirectory()\n .then((obj) => {\n let stream;\n if (/^http/.test(installPackage)) {\n stream = hyperquest(installPackage);\n } else {\n stream = fs.createReadStream(installPackage);\n }\n return extractStream(stream, obj.tmpdir).then(() => obj);\n })\n .then((obj) => {\n // eslint-disable-next-line global-require\n const packageName = require(path.join(obj.tmpdir, 'package.json')).name;\n obj.cleanup();\n return packageName;\n })\n .catch((err) => {\n // The package name could be with or without semver version, e.g. react-scripts-0.2.0-alpha.1.tgz\n // However, this function returns package name only without semver version.\n console.log(\n `Could not extract the package name from the archive: ${err.message}`\n );\n const assumedProjectName = installPackage.match(\n /^.+\\/(.+?)(?:-\\d+.+)?\\.(tgz|tar\\.gz)$/\n )[1];\n console.log(\n `Based on the filename, assuming it is \"${chalk.cyan(\n assumedProjectName\n )}\"`\n );\n return Promise.resolve(assumedProjectName);\n });\n // eslint-disable-next-line no-else-return\n } else if (installPackage.indexOf('git+') === 0) {\n // Pull package name out of git urls e.g:\n // git+https://github.com/mycompany/react-scripts.git\n // git+ssh://github.com/mycompany/react-scripts.git#v1.2.3\n return Promise.resolve(installPackage.match(/([^/]+)\\.git(#.*)?$/)[1]);\n } else if (installPackage.match(/.+@/)) {\n // Do not match @scope/ when stripping off @version or @tag\n return Promise.resolve(\n installPackage.charAt(0) + installPackage.substr(1).split('@')[0]\n );\n } else if (installPackage.match(/^file:/)) {\n const installPackagePath = installPackage.match(/^file:(.*)?$/)[1];\n // eslint-disable-next-line global-require\n const installPackageJson = require(path.join(\n installPackagePath,\n 'package.json'\n ));\n return Promise.resolve(installPackageJson.name);\n }\n return Promise.resolve(installPackage);\n}", "function resolvePackageVersion(pkgName) {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const path = require.resolve(`${PROCESSOR_PACKAGE_NAME}/package.json`);\n const pkgJson = JSON.parse(fs_1.default.readFileSync(path, 'utf-8'));\n debug(`Resolved package.json: ${JSON.stringify(pkgJson, null, 2)}`);\n if (pkgName === PROCESSOR_PACKAGE_NAME) {\n return pkgJson.version;\n }\n if (pkgJson.dependencies) {\n const deps = pkgJson.dependencies;\n if (deps[pkgName])\n return deps[pkgName];\n }\n throw new Error(`Can't resolve ${pkgName} version`);\n}", "function isNodeInstalled() {\n var cmdString = \"node -v\";\n return new Promise(function (resolve, reject) {\n exec(cmdString, (error, stdout) => {\n if (error) {\n return reject(error);\n }\n\n if (stdout.startsWith('v')) {\n return resolve(true);\n }\n\n return resolve(false);\n });\n });\n}", "function checkToolchain () {\n return new Promise((resolve, reject) => {\n const toolBinPath = getToolBinPath()\n exec(`${toolBinPath} toolchain list`).then((results) => {\n const { stdout } = results;\n const matches = (/^(?=nightly)(.*)$/mi).exec(stdout);\n\n // If found, we're done\n if (matches) {\n return resolve(matches[0])\n }\n\n // If not found, install it\n // Ask to install\n atomPrompt(\"`rustup` missing nightly toolchain\", {\n detail: \"rustup toolchain install nightly\",\n }, [\"Install\"]).then((response) => {\n if (response === \"Install\") {\n installNightly().then(checkToolchain).then(resolve).catch(reject)\n } else {\n reject();\n }\n })\n }).catch(() => {\n // Missing rustup\n // Ask to install\n atomPrompt(\"`rustup` is not available\", {\n description: \"From https://www.rustup.rs/\",\n detail: \"curl https://sh.rustup.rs -sSf | sh\",\n }, [\"Install\"]).then((response) => {\n if (response === \"Install\") {\n // Install rustup and try again\n installRustup().then(checkToolchain).then(resolve).catch(reject)\n } else {\n reject();\n }\n })\n })\n })\n}", "function version () {\n return pkg.version\n}", "getElectronNodeVersion () {\n debug('getting Electron Node version')\n\n const args = []\n\n if (isSandboxNeeded()) {\n args.push('--no-sandbox')\n }\n\n // runs locally installed \"electron\" bin alias\n const localScript = path.join(__dirname, 'print-node-version.js')\n\n debug('local script that prints Node version %s', localScript)\n\n args.push(localScript)\n\n const options = {\n preferLocal: true, // finds the \"node_modules/.bin/electron\"\n timeout: 5000, // prevents hanging Electron if there is an error for some reason\n }\n\n debug('Running Electron with %o %o', args, options)\n\n return execa('electron', args, options)\n .then((result) => result.stdout)\n }", "function getGlobalInstallCommand() {\n if (cli_shared_utils_1.hasYarn()) {\n const { stdout: yarnGlobalDir } = execa.sync('yarn', ['global', 'dir']);\n if (__dirname.includes(yarnGlobalDir)) {\n return 'yarn global add';\n }\n }\n if (cli_shared_utils_1.hasPnpm3OrLater()) {\n const { stdout: pnpmGlobalPrefix } = execa.sync('pnpm', ['config', 'get', 'prefix']);\n if (__dirname.includes(pnpmGlobalPrefix) && __dirname.includes('pnpm-global')) {\n return 'pnpm i -g';\n }\n }\n const { stdout: npmGlobalPrefix } = execa.sync('npm', ['config', 'get', 'prefix']);\n if (__dirname.includes(npmGlobalPrefix)) {\n return 'npm i -g';\n }\n}", "function reInstall() {\n if (isUsingYarn) {\n return execa.shellSync(`${installCmd} --force`, { stdio: 'inherit' });\n }\n return execa.shellSync(installCmd, { stdio: 'inherit' });\n}", "async function latest(projectRoot) {\n try {\n const currentVersion = getReactNativeVersion(projectRoot);\n if (!currentVersion) {\n return;\n }\n const {\n name\n } = require(_path().default.join(projectRoot, 'package.json'));\n const latestRelease = await (0, _getLatestRelease.default)(name, currentVersion);\n if (latestRelease) {\n return {\n name,\n current: currentVersion,\n upgrade: latestRelease\n };\n }\n } catch (e) {\n // We let the flow continue as this component is not vital for the rest of\n // the CLI.\n _logger.default.debug('Cannot detect current version of React Native, ' + 'skipping check for a newer release');\n _logger.default.debug(e);\n }\n return undefined;\n}", "getOfflineMirrorPath(packageFilename) {\n let mirrorPath;\n\n var _arr = ['npm', 'spkgm'];\n for (var _i5 = 0; _i5 < _arr.length; _i5++) {\n const key = _arr[_i5];\n const registry = this.registries[key];\n\n if (registry == null) {\n continue;\n }\n\n const registryMirrorPath = registry.config['spkgm-offline-mirror'];\n\n if (registryMirrorPath === false) {\n return null;\n }\n\n if (registryMirrorPath == null) {\n continue;\n }\n\n mirrorPath = registryMirrorPath;\n }\n\n if (mirrorPath == null) {\n return null;\n }\n\n if (packageFilename == null) {\n return mirrorPath;\n }\n\n return path.join(mirrorPath, path.basename(packageFilename));\n }", "function getSDKSource() {\n // @ts-ignore \"npm\" is injected by rollup during build process\n return \"npm\";\n }", "async function getBabelRc(asset, isSource) {\n // Support legacy browserify packages\n let browserify = asset.package && asset.package.browserify;\n if (browserify && Array.isArray(browserify.transform)) {\n // Look for babelify in the browserify transform list\n let babelify = browserify.transform.find(\n t => (Array.isArray(t) ? t[0] : t) === 'babelify'\n );\n\n // If specified as an array, override the config with the one specified\n if (Array.isArray(babelify) && babelify[1]) {\n return babelify[1];\n }\n\n // Otherwise, return the .babelrc if babelify was found\n return babelify ? await findBabelRc(asset) : null;\n }\n\n // If this asset is not in node_modules, always use the .babelrc\n if (isSource) {\n return await findBabelRc(asset);\n }\n\n // Otherwise, don't load .babelrc for node_modules.\n // See https://github.com/parcel-bundler/parcel/issues/13.\n return null;\n}", "function getInstalledVersion()\n\t{\n\t\tvar d = $.Deferred();\n\n\t\tFileUtils.readAsText(FileSystem.getFileForPath(PATH_TO_PACKAGE))\n\t\t.done(function(text)\n\t\t{\n\t\t\td.resolve(JSON.parse(text).version);\n\t\t});\n\n\t\treturn d.promise();\n\t}", "function getAppVersion(packageName) {\n return promisifyCordovaExec('getAppVersion', [packageName]);\n}", "function findLatestVsInstall(opts) {\r\n const installs = enumerateVsInstalls(Object.assign(Object.assign({}, opts), { latest: true }));\r\n if (installs.length > 0) {\r\n return installs[0];\r\n }\r\n else {\r\n return null;\r\n }\r\n}", "function getNpmPackageName(path) {\n if (typeof path === \"string\") {\n const parts = path.split(pathSep);\n\n // In case the path ends with node_modules, look for the previous\n // node_modules directory.\n const lastAcceptableIndex = parts.length - 2;\n const index = parts.lastIndexOf(\"node_modules\", lastAcceptableIndex);\n\n if (index >= 0) {\n return parts[index + 1] || void 0;\n }\n }\n}", "function discoverCommon() {\n discoverMany(['npm', 'yarn'])\n}", "function packageManagerConfig() {\n inquirer\n .prompt([\n {\n name: \"packageManager\",\n type: \"list\",\n message: chalk.white(\"Which package manager would you like to use?\"),\n choices: [\"Yarn\", \"npm\", \"Cancel\"]\n },\n {\n name: \"fileFormat\",\n type: \"list\",\n message: chalk.white(\n \"Which ESLint and Prettier configuration format do you prefer to use?\"\n ),\n choices: [\".json\", \".js\", \"Cancel\"]\n }\n ])\n .then(answer => {\n switch (answer.packageManager) {\n case \"Yarn\":\n var pkg_cmd = \"yarn add\";\n pkg_cmd + \"-D eslint prettier eslint-plugin-react-hooks\";\n console.log(\"Selector pkg_cmd = \" + pkg_cmd);\n break;\n case \"npm\":\n var pkg_cmd = \"npm install \";\n console.log(\"Selector pkg_cmd = \" + pkg_cmd);\n break;\n case \"Cancel\":\n console.log(\"Cancel is Selector\");\n break;\n }\n\n switch (answer.fileFormat) {\n case \".json\":\n var configFileFormat = \".josn\";\n console.log(\"Selector configFileFormat = \" + configFileFormat);\n break;\n\n case \".js\":\n var configFileFormat = \".js\";\n console.log(\"Selector configFileFormat = \" + configFileFormat);\n break;\n\n case \"Cancel\":\n var configFileFormat = \"Cancel\";\n console.log(\"Selector configFileFormat = \" + configFileFormat);\n break;\n }\n });\n}", "function getCurrentVersion() {\n var vFilePath = path.resolve(config.root.project, config.tasks.release.versionFiles[0]);\n var pkg = JSON.parse(fs.readFileSync(vFilePath, 'utf8'))\n return pkg.version;\n}", "function installLatestSdk(packageName) {\n console.log('Installing latest AWS SDK v3');\n // Both HOME and --prefix are needed here because /tmp is the only writable location\n (0, child_process_1.execSync)(`HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp`);\n installedSdk = {\n ...installedSdk,\n [packageName]: true,\n };\n}", "function invokeYarnInstallCommand(projectDir) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var e_3;\n return tslib_1.__generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n // Note: No progress indicator needed as that is the responsibility of the command.\n // TODO: Consider using an Ora spinner instead to ensure minimal console output.\n return [4 /*yield*/, child_process_1.spawn('yarn', ['install', '--frozen-lockfile', '--non-interactive'], { cwd: projectDir })];\n case 1:\n // Note: No progress indicator needed as that is the responsibility of the command.\n // TODO: Consider using an Ora spinner instead to ensure minimal console output.\n _a.sent();\n console_1.info(console_1.green(' ✓ Installed project dependencies.'));\n return [3 /*break*/, 3];\n case 2:\n e_3 = _a.sent();\n console_1.error(e_3);\n console_1.error(console_1.red(' ✘ An error occurred while installing dependencies.'));\n throw new actions_error_1.FatalReleaseActionError();\n case 3: return [2 /*return*/];\n }\n });\n });\n }", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n}", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n}", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n}", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n}", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n}", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n}", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n}", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n}", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n}", "function version() {\r\n return \"3.8.0-dev+202301211440\";\r\n}", "async function isInstalled(name) {\n let installed;\n try {\n await exec(`which ${name}`);\n installed = true;\n } catch (e) {\n installed = false;\n }\n return installed;\n}", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_hash__;\n}", "readPackageName(manifestPath) {\n if (manifestPath) {\n let fs = new fileSystem_1.FileSystem();\n return fs.exists(manifestPath).then(exists => {\n if (exists) {\n return fs.readFile(manifestPath)\n .then(manifestContent => {\n let packageName = this.parsePackageName(manifestContent);\n if (!packageName) {\n packageName = this.getDefaultPackageName(this.applicationName);\n }\n return packageName;\n });\n }\n else {\n return this.getDefaultPackageName(this.applicationName);\n }\n });\n }\n else {\n return Q.resolve(this.getDefaultPackageName(this.applicationName));\n }\n }", "function getPackageInfo(installPackage) {\n if (installPackage.match(/^.+\\.(tgz|tar\\.gz)$/)) {\n return getTemporaryDirectory()\n .then(obj => {\n let stream;\n if (/^http/.test(installPackage)) {\n stream = hyperquest(installPackage);\n } else {\n stream = fs.createReadStream(installPackage);\n }\n return extractStream(stream, obj.tmpdir).then(() => obj);\n })\n .then(obj => {\n const {name, version} = require(path.join(\n obj.tmpdir,\n 'package.json',\n ));\n obj.cleanup();\n return {name, version};\n })\n .catch(err => {\n // The package name could be with or without semver version, e.g. react-scripts-0.2.0-alpha.1.tgz\n // However, this function returns package name only without semver version.\n console.log(`Could not extract the package name from the archive: ${err.message}`);\n const assumedProjectName = installPackage.match(\n /^.+\\/(.+?)(?:-\\d+.+)?\\.(tgz|tar\\.gz)$/,\n )[1];\n console.log(`Based on the filename, assuming it is \"${chalk.cyan(assumedProjectName)}\"`);\n return Promise.resolve({name: assumedProjectName});\n });\n } else if (installPackage.startsWith('git+')) {\n // Pull package name out of git urls\n return Promise.resolve({\n name: installPackage.match(/([^/]+)\\.git(#.*)?$/)[1],\n });\n } else if (installPackage.match(/.+@/)) {\n // Do not match @scope/ when stripping off @version or @tag\n return Promise.resolve({\n name: installPackage.charAt(0) + installPackage.substr(1).split('@')[0],\n version: installPackage.split('@')[1],\n });\n } else if (installPackage.match(/^file:/)) {\n const installPackagePath = installPackage.match(/^file:(.*)?$/)[1];\n const {name, version} = require(path.join(\n installPackagePath,\n 'package.json',\n ));\n return Promise.resolve({name, version});\n }\n return Promise.resolve({name: installPackage});\n}", "function getCurrentAppVersion() {\n return $http.get((_appMountPath + '/version'));\n }", "function packageNameFromPath(inputPath) {\n const modules = inputPath.split('node_modules/');\n const libAndFile = modules.pop();\n if (!libAndFile)\n return null;\n if (libAndFile.charAt(0) === '@') {\n const [org, lib] = libAndFile.split('/');\n return org + '/' + lib;\n }\n else {\n const components = libAndFile.split('/');\n const first = components.shift();\n return first || null;\n }\n}", "function getCurrentRegistry(cbk) {\n npm.load(function(err, conf) {\n if (err) return exit(err);\n cbk(npm.config.get('registry'));\n });\n}", "async displayVersion() {\n try {\n const packageData = await commonUtil.readJsonFile(`${__dirname}/package.json`);\n console.log(packageData.version);\n } catch (error) {\n console.log(logSymbols.error, colors.red('Unable to retrieve package version...'));\n }\n }", "function retrieveSnappy() {\n var snappy = null;\n try {\n snappy = require_optional('snappy');\n } catch (error) {} // eslint-disable-line\n if (!snappy) {\n snappy = {\n compress: noSnappyWarning,\n uncompress: noSnappyWarning,\n compressSync: noSnappyWarning,\n uncompressSync: noSnappyWarning\n };\n }\n return snappy;\n}", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n} // webpack disallows updates in other states.", "version () {\n var p = this.cli.exec(['--version'])\n\n return p.then(pro => {\n return pro.compact().toPromise(Promise).then(v => {\n var matches = v.toString().match(/Ledger (.*),/)\n if (matches) return matches[1]\n else throw new Error('Failed to match Ledger version')\n })\n })\n }", "function getPackageUrl(name) {\n return `https://registry.npmjs.org/${ name}`\n}", "async _getToolPath () {\r\n const localPath = this.getLocalPath()\r\n if (localPath) {\r\n let local = false\r\n try {\r\n await fs.promises.access(localPath, fs.constants.X_OK)\r\n local = true\r\n } catch (e) { }\r\n if (local) {\r\n return localPath\r\n }\r\n }\r\n\r\n const global = await new ProcessSpawner('bw').checkCommandExists()\r\n\r\n if (global) {\r\n return 'bw'\r\n }\r\n\r\n return null\r\n }", "getDefaultToolchain() {\r\n const logger = this.logger.createChildLogger('getDefaultToolchain: ');\r\n const toolchain = this.toolchains.find(t => t.isDefault);\r\n if (!toolchain && this.toolchains.length !== 0) {\r\n logger.error(`no default toolchain; this.toolchains=${this.toolchains}`);\r\n }\r\n return toolchain;\r\n }", "function resolveGlobalNodePath(tracer) {\r\n let npmCommand = 'npm';\r\n const env = Object.create(null);\r\n Object.keys(process.env).forEach(key => env[key] = process.env[key]);\r\n env['NO_UPDATE_NOTIFIER'] = 'true';\r\n const options = {\r\n encoding: 'utf8',\r\n env\r\n };\r\n if (isWindows()) {\r\n npmCommand = 'npm.cmd';\r\n options.shell = true;\r\n }\r\n let handler = () => { };\r\n try {\r\n process.on('SIGPIPE', handler);\r\n let stdout = child_process_1.spawnSync(npmCommand, ['config', 'get', 'prefix'], options).stdout;\r\n if (!stdout) {\r\n if (tracer) {\r\n tracer(`'npm config get prefix' didn't return a value.`);\r\n }\r\n return undefined;\r\n }\r\n let prefix = stdout.trim();\r\n if (tracer) {\r\n tracer(`'npm config get prefix' value is: ${prefix}`);\r\n }\r\n if (prefix.length > 0) {\r\n if (isWindows()) {\r\n return path.join(prefix, 'node_modules');\r\n }\r\n else {\r\n return path.join(prefix, 'lib', 'node_modules');\r\n }\r\n }\r\n return undefined;\r\n }\r\n catch (err) {\r\n return undefined;\r\n }\r\n finally {\r\n process.removeListener('SIGPIPE', handler);\r\n }\r\n}", "function resolveGlobalNodePath(tracer) {\r\n let npmCommand = 'npm';\r\n const env = Object.create(null);\r\n Object.keys(process.env).forEach(key => env[key] = process.env[key]);\r\n env['NO_UPDATE_NOTIFIER'] = 'true';\r\n const options = {\r\n encoding: 'utf8',\r\n env\r\n };\r\n if (isWindows()) {\r\n npmCommand = 'npm.cmd';\r\n options.shell = true;\r\n }\r\n let handler = () => { };\r\n try {\r\n process.on('SIGPIPE', handler);\r\n let stdout = child_process_1.spawnSync(npmCommand, ['config', 'get', 'prefix'], options).stdout;\r\n if (!stdout) {\r\n if (tracer) {\r\n tracer(`'npm config get prefix' didn't return a value.`);\r\n }\r\n return undefined;\r\n }\r\n let prefix = stdout.trim();\r\n if (tracer) {\r\n tracer(`'npm config get prefix' value is: ${prefix}`);\r\n }\r\n if (prefix.length > 0) {\r\n if (isWindows()) {\r\n return path.join(prefix, 'node_modules');\r\n }\r\n else {\r\n return path.join(prefix, 'lib', 'node_modules');\r\n }\r\n }\r\n return undefined;\r\n }\r\n catch (err) {\r\n return undefined;\r\n }\r\n finally {\r\n process.removeListener('SIGPIPE', handler);\r\n }\r\n}", "function mirrorbrain_getPlatformForMirror( schema ) {\n\tvar a = getArray();\n\tif ( navigator.platform != null ) {\n\t\tif ( schema == \"old\" ) {\n\t\t\tif ( navigator.platform.indexOf( \"Win32\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win32Intel_install_wJRE\" : \"Win32Intel_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Win64\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win32Intel_install_wJRE\" : \"Win32Intel_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Win\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win32Intel_install_wJRE\" : \"Win32Intel_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Linux\" ) != -1 ) {\n\t\t\t\tif ( navigator.platform.indexOf( \"64\" ) != -1 ) {\n\t\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\t\treturn \"LinuxX86-64_install\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxX86-64_install_wJRE\" : \"LinuxX86-64_install\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxX86-64_install_wJRE\" : \"LinuxX86-64_install\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn ( a[3] == 'y' ) ? \"LinuxIntel_install_wJRE\" : \"LinuxIntel_install\";\n\t\t\t\t}\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS i86pc\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Solarisx86_install_wJRE\" : \"Solarisx86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS sun4u\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"SolarisSparc_install_wJRE\" : \"SolarisSparc_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"SolarisSparc_install_wJRE\" : \"SolarisSparc_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 && navigator.platform.indexOf( \"Intel\" ) != -1 ) {\n\t\t\t\treturn \"MacOSXIntel_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 && navigator.platform.indexOf( \"PPC\" ) != -1 ) {\n\t\t\t\treturn \"MacOSXPPC_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 ) {\n\t\t\t\treturn \"MacOSXIntel_install\";\n\t\t\t// testing if this code will help to redirect the iPad, iPhone, iPod entries\n\t\t\t} else if ( navigator.platform.indexOf( \"iPad\" ) != -1 || navigator.platform.indexOf( \"iPhone\" ) != -1 || navigator.platform.indexOf( \"iPod\" ) != -1 ) {\n\t\t\t\treturn \"MacOSXIntel_install\" ;\n\t\t\t} else {\n\t\t\t\t// return plain platform\n\t\t\t\treturn navigator.platform;\n\t\t\t}\n\t\t} else if ( schema == \"new\" ) {\n\t\t\tif ( navigator.platform.indexOf( \"Win32\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win_x86_install-wJRE\" : \"Win_x86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Win64\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win_x86_install-wJRE\" : \"Win_x86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Win\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Win_x86_install-wJRE\" : \"Win_x86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Linux\" ) != -1 ) {\n\t\t\t\tif ( navigator.platform.indexOf( \"64\" ) != -1 ) {\n\t\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\t\treturn \"Linux_x86-64_install-deb\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86-64_install-rpm-wJRE\" : \"Linux_x86-64_install-rpm\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86-64_install-rpm-wJRE\" : \"Linux_x86-64_install-rpm\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\t\treturn \"Linux_x86_install-deb\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86_install-rpm-wJRE\" : \"Linux_x86_install-rpm\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86_install-rpm-wJRE\" : \"Linux_x86_install-rpm\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( navigator.userAgent != null ) {\n\t\t\t\t\tif ( navigator.userAgent.toLowerCase().indexOf( \"debian\" ) != -1 || navigator.userAgent.toLowerCase().indexOf( \"ubuntu\" ) != -1 ) {\n\t\t\t\t\t\treturn \"Linux_x86_install-deb\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86_install-rpm-wJRE\" : \"Linux_x86_install-rpm\";\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn ( a[3] == 'y' ) ? \"Linux_x86_install-rpm-wJRE\" : \"Linux_x86_install-rpm\";\n\t\t\t\t}\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS i86pc\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Solaris_x86_install-wJRE\" : \"Solaris_x86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS sun4u\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Solaris_Sparc_install-wJRE\" : \"Solaris_Sparc_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"SunOS\" ) != -1 ) {\n\t\t\t\treturn ( a[3] == 'y' ) ? \"Solaris_Sparc_install-wJRE\" : \"Solaris_Sparc_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 && navigator.platform.indexOf( \"Intel\" ) != -1 ) {\n\t\t\t\treturn \"MacOS_x86_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 && navigator.platform.indexOf( \"PPC\" ) != -1 ) {\n\t\t\t\treturn \"MacOS_PPC_install\";\n\t\t\t} else if ( navigator.platform.indexOf( \"Mac\" ) != -1 ) {\n\t\t\t\treturn \"MacOS_x86_install\";\n\t\t\t// testing if this code will help to redirect the iPad, iPhone, iPod entries\n\t\t\t} else if ( navigator.platform.indexOf( \"iPad\" ) != -1 || navigator.platform.indexOf( \"iPhone\" ) != -1 || navigator.platform.indexOf( \"iPod\" ) != -1 ) {\n\t\t\t\treturn \"MacOS_x86_install\" ;\n\t\t\t} else {\n\t\t\t\t// return plain platform\n\t\t\t\treturn navigator.platform;\n\t\t\t}\n\t\t}\n\t}\n\treturn ( a[3] == 'y' ) ? \"Win_x86_install-wJRE\" : \"Win_x86_install\";\n}", "function getVersion()\n{\n\treturn packageJson.name + '-' + packageJson.version;\n}", "function getVersion()\n{\n\treturn packageJson.name + '-' + packageJson.version;\n}", "isToolchainInstalled(toolchain) {\r\n return this.toolchains.find(t => t.equals(toolchain)) !== undefined;\r\n }", "function getArch() {\n return new Promise((resolve, reject) =>\n Task.run('/usr/bin/uname', ['-p'], (t) => (t.status !== 0 ? reject() : resolve(t.output.trim())))\n );\n}", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n} // Webpack disallows updates in other states.", "function isUpdateAvailable() {\n /* globals __webpack_hash__ */\n // __webpack_hash__ is the hash of the current compilation.\n // It's a global variable injected by Webpack.\n return mostRecentCompilationHash !== __webpack_require__.h();\n} // Webpack disallows updates in other states.", "getInstalledVersion(force = false) {\n return Q.Promise((resolve, reject) => {\n if (!force && this.installedVersion !== null) {\n return resolve(this.installedVersion);\n }\n return commandExecutor_1.CommandExecutor.exec(this.name, ['--version'])\n .then(stdout => {\n const patt = /\\d{1,2}\\.\\d{1,2}\\.\\d{1,2}|\\d{1,2}\\.\\d{1,2}/g;\n this.installedVersion = version_1.Version.fromString(stdout.match(patt)[0]);\n resolve(this.installedVersion);\n })\n .catch(err => {\n reject(err);\n });\n });\n }", "async _getToolPath () {\r\n const localPath = this.getLocalPath()\r\n if (localPath) {\r\n let local = false\r\n try {\r\n await fs.promises.access(localPath, fs.constants.X_OK)\r\n local = true\r\n } catch (e) { }\r\n if (local) {\r\n return localPath\r\n }\r\n }\r\n\r\n const global = await new ProcessSpawner('op').checkCommandExists()\r\n\r\n if (global) {\r\n return 'op'\r\n }\r\n\r\n return null\r\n }", "function buildScript(answers) {\r\n if (!answers || typeof answers !== 'object') return null;\r\n\r\n let result = 'npm install --save-dev webpack';\r\n\r\n return result;\r\n}", "function current(projectRoot) {\n try {\n const found = _semver().default.parse(getReactNativeVersion(projectRoot));\n if (found) {\n return found;\n }\n } catch {\n throw new _errors.UnknownProjectError(projectRoot);\n }\n return undefined;\n}", "function defaultResolver(path, options) {\n // Yarn 2 adds support to `resolve` automatically so the pnpResolver is only\n // needed for Yarn 1 which implements version 1 of the pnp spec\n if (process.versions.pnp === '1') {\n return (0, _jestPnpResolver().default)(path, options);\n }\n\n const result = (0, _resolve().sync)(path, {\n ...options,\n isDirectory: _fileWalkers.isDirectory,\n isFile: _fileWalkers.isFile,\n packageFilter: createPackageFilter(\n options.conditions,\n options.packageFilter\n ),\n preserveSymlinks: false,\n readPackageSync,\n realpathSync: _fileWalkers.realpathSync\n }); // Dereference symlinks to ensure we don't create a separate\n // module instance depending on how it was referenced.\n\n return (0, _fileWalkers.realpathSync)(result);\n}", "static version() {\n let version = \"\";\n switch (Application.getCurrentBrowser()) {\n case Browser.CHROME:\n version = chrome.runtime.getManifest()[\"version\"];\n break;\n }\n return version;\n }", "async function resolveDependency(installSpecifier, packageSemver, lockfile, canRetry = true) {\n // Right now, the CDN is only for top-level JS packages. The CDN doesn't support CSS,\n // non-JS assets, and has limited support for deep package imports. Snowpack\n // will automatically fall-back any failed/not-found assets from local\n // node_modules/ instead.\n if (!validatePackageName(installSpecifier).validForNewPackages) {\n return null;\n } // Grab the installUrl from our lockfile if it exists, otherwise resolve it yourself.\n\n\n let installUrl;\n let installUrlType;\n\n if (lockfile && lockfile.imports[installSpecifier]) {\n installUrl = lockfile.imports[installSpecifier];\n installUrlType = 'pin';\n } else {\n if (packageSemver === 'latest') {\n console.warn(`warn(${installSpecifier}): Not found in \"dependencies\". Using latest package version...`);\n }\n\n if (packageSemver.startsWith('npm:@reactesm') || packageSemver.startsWith('npm:@pika/react')) {\n throw new Error(`React workaround packages no longer needed! Revert to the official React & React-DOM packages.`);\n }\n\n if (packageSemver.includes(' ') || packageSemver.includes(':')) {\n console.warn(`warn(${installSpecifier}): Can't fetch complex semver \"${packageSemver}\" from remote CDN.`);\n return null;\n }\n\n installUrlType = 'lookup';\n installUrl = `${PIKA_CDN}/${installSpecifier}@${packageSemver}`;\n } // Hashed CDN urls never change, so its safe to grab them directly from the local cache\n // without a network request.\n\n\n if (installUrlType === 'pin') {\n const cachedResult = await cacache.get.info(RESOURCE_CACHE, installUrl).catch(() => null);\n\n if (cachedResult) {\n if (cachedResult.metadata) {\n const {\n pinnedUrl\n } = cachedResult.metadata;\n return pinnedUrl;\n }\n }\n } // Otherwise, resolve from the CDN remotely.\n\n\n const {\n statusCode,\n headers,\n body\n } = await fetchCDNResource(installUrl);\n\n if (statusCode !== 200) {\n console.warn(`Failed to resolve [${statusCode}]: ${installUrl} (${body})`);\n console.warn(`Falling back to local copy...`);\n return null;\n }\n\n let importUrlPath = headers['x-import-url'];\n let pinnedUrlPath = headers['x-pinned-url'];\n const buildStatus = headers['x-import-status'];\n const typesUrlPath = headers['x-typescript-types'];\n const typesUrl = typesUrlPath && `${PIKA_CDN}${typesUrlPath}`;\n\n if (installUrlType === 'pin') {\n const pinnedUrl = installUrl;\n await cacache.put(RESOURCE_CACHE, pinnedUrl, body, {\n metadata: {\n pinnedUrl,\n typesUrl\n }\n });\n return pinnedUrl;\n }\n\n if (pinnedUrlPath) {\n const pinnedUrl = `${PIKA_CDN}${pinnedUrlPath}`;\n await cacache.put(RESOURCE_CACHE, pinnedUrl, body, {\n metadata: {\n pinnedUrl,\n typesUrl\n }\n });\n return pinnedUrl;\n }\n\n if (buildStatus === 'SUCCESS') {\n console.warn(`Failed to lookup [${statusCode}]: ${installUrl}`);\n console.warn(`Falling back to local copy...`);\n return null;\n }\n\n if (!canRetry || buildStatus === 'FAIL') {\n console.warn(`Failed to build: ${installSpecifier}@${packageSemver}`);\n console.warn(`Falling back to local copy...`);\n return null;\n }\n\n console.log(colors.cyan(`Building ${installSpecifier}@${packageSemver}... (This takes a moment, but will be cached for future use)`));\n\n if (!importUrlPath) {\n throw new Error('X-Import-URL header expected, but none received.');\n }\n\n const {\n statusCode: lookupStatusCode\n } = await fetchCDNResource(importUrlPath);\n\n if (lookupStatusCode !== 200) {\n throw new Error(`Unexpected response [${lookupStatusCode}]: ${PIKA_CDN}${importUrlPath}`);\n }\n\n return resolveDependency(installSpecifier, packageSemver, lockfile, false);\n}", "function checkUpdate(proxy) {\n let proxyParam = '';\n if (proxy) {\n proxyParam = ' --proxy ' + proxy;\n }\n return new Promise((resolve) => {\n run('npm show @mobiscroll/cli version' + proxyParam, true, true, true).then((npmCliVersion) => { // get the mobiscroll cli version from npm\n\n if (npmCliVersion) {\n npmCliVersion = npmCliVersion.trim();\n\n if (localCliVersion != npmCliVersion) {\n // if the two versions are not equal ask for update\n inquirer.prompt({\n type: 'input',\n name: 'update',\n message: `The Mobiscroll CLI has an update available (${localCliVersion} => ${npmCliVersion})! Would you like to install it? (Y/n)`,\n default: 'y'\n }).then(answer => {\n if (answer.update.toLowerCase() == 'y') {\n run('npm install -g @mobiscroll/cli@latest' + proxyParam).then(() => {\n printFeedback(`Updated Mobiscroll CLI to ${npmCliVersion}! \\n\\nPlease re-run your command!\\n`);\n process.exit();\n });\n } else {\n console.log(`Skipping the installation of the latest Mobiscroll CLI version.`);\n resolve();\n }\n })\n } else {\n // No CLI update found continuing the installation...\n resolve();\n }\n } else {\n utils.printWarning(`It looks like the CLI couldn't determine the installed cli version. This problem might indicate npm problems on your system. You can update it manually by running the ${chalk.gray('npm install npm@latest -g')} `);\n console.log(`${chalk.magenta('\\nIf the problem persists get in touch at [email protected].')}`);\n resolve();\n }\n })\n });\n}", "function cliResolve(context) {\n return (config) => {\n if (context.isGlobalYarn) {\n config.resolve.modules.push(context.globalDirs.yarn.packages);\n config.resolveLoader.modules.push(context.globalDirs.yarn.packages);\n } else {\n config.resolve.modules.push(path.resolve(__dirname, path.join('..', 'node_modules')));\n config.resolveLoader.modules.push(path.resolve(__dirname, path.join('..', 'node_modules')));\n }\n logger.log('entry:', config.entry);\n logger.log('resolve.modules:', config.resolve.modules);\n logger.log('resolveLoader.modules:', config.resolveLoader.modules);\n return config;\n };\n}", "function getSolcJSVersionFromPath(modulePath) {\n return require(modulePath).version();\n}", "isInstalled(module) {\n try {\n // eslint-disable-next-line global-require, import/no-dynamic-require\n require(module);\n\n return true;\n } catch (e) {\n // Package doesn't exist -- must not be installable on this platform\n return false;\n }\n }", "readRootManifest() {\n return this.readManifest(this.cwd, 'npm', true);\n }", "findTool (name, options = {}) {\n if (isFalsy(name) || name.constructor !== String || name.trim() === '') {\n return Promise.resolve(false)\n }\n\n if (!this.toolStrategies) {\n return Promise.resolve(false)\n }\n\n let strategy = false\n return Promise.resolve(null).then(() => {\n if (this.toolStrategies.has(name)) {\n strategy = this.toolStrategies.get(name)\n }\n if (isFalsy(strategy)) {\n strategy = 'DEFAULT'\n }\n }).then(() => {\n if (strategy !== 'GOROOTBIN' && strategy !== 'GOTOOLDIR') {\n return false\n }\n\n return this.runtime(options).then((runtime) => {\n if (isFalsy(runtime)) {\n return false\n }\n\n if (strategy === 'GOROOTBIN') {\n if (name === 'go' && runtime.path.endsWith('goapp' + runtime.GOEXE)) {\n return path.join(runtime.GOROOT, 'bin', 'goapp' + runtime.GOEXE)\n }\n\n return path.join(runtime.GOROOT, 'bin', name + runtime.GOEXE)\n } else if (strategy === 'GOTOOLDIR') {\n return path.join(runtime.GOTOOLDIR, name + runtime.GOEXE)\n }\n return false\n })\n }).then((specificTool) => {\n if (isTruthy(specificTool)) {\n return this.stat(specificTool).then((s) => {\n if (isTruthy(s) && s.isFile()) {\n return specificTool\n }\n }).catch((err) => {\n this.handleError(err)\n return false\n })\n }\n\n if (strategy === 'GOPATHBIN') {\n return this.findToolInDelimitedEnvironmentVariable(name, 'GOPATH', options)\n }\n\n if (strategy === 'PATH') {\n return this.findToolInDelimitedEnvironmentVariable(name, this.pathKey, options)\n }\n\n return this.findToolWithDefaultStrategy(name, options)\n })\n }", "function checkForUpdate() {\n superagent.get(packageJson).end((error, response) => {\n if (error) return;\n const actualVersion = JSON.parse(response.text).version; // TODO: case without internet connection\n console.log('Actual app version: ' + actualVersion + '. Current app version: ' + currentVersion);\n if (semver.gt(actualVersion, currentVersion)) {\n mb.window.webContents.send('update-available');\n console.log('New version is available!');\n }\n });\n}", "function retrieveSnappy() {\n let snappy = require_optional('snappy');\n if (!snappy) {\n snappy = {\n compress: noSnappyWarning,\n uncompress: noSnappyWarning,\n compressSync: noSnappyWarning,\n uncompressSync: noSnappyWarning\n };\n }\n return snappy;\n}", "function invokeYarnInstallCommand(projectDir) {\n return tslib.__awaiter(this, void 0, void 0, function* () {\n try {\n // Note: No progress indicator needed as that is the responsibility of the command.\n // TODO: Consider using an Ora spinner instead to ensure minimal console output.\n yield spawnWithDebugOutput('yarn', ['install', '--frozen-lockfile', '--non-interactive'], { cwd: projectDir });\n info(green(' ✓ Installed project dependencies.'));\n }\n catch (e) {\n error(e);\n error(red(' ✘ An error occurred while installing dependencies.'));\n throw new FatalReleaseActionError();\n }\n });\n}", "async function getPackageRepo(packageName) {\n let nodeModulePaths = require.resolve.paths(packageName);\n const localNodeModules = path_1.default.join(process.cwd(), 'node_modules');\n nodeModulePaths = [localNodeModules].concat(nodeModulePaths || []);\n // eslint-disable-next-line fp/no-loops\n for (const basePath of nodeModulePaths) {\n const packageJsonPath = path_1.default.join(basePath, packageName, 'package.json');\n if (await (0, exists_1.default)(packageJsonPath)) {\n try {\n const packageJson = JSON.parse(await promises_1.default.readFile(packageJsonPath, 'utf-8'));\n return packageJson.repository;\n }\n catch (e) { }\n }\n }\n return null;\n}" ]
[ "0.6483819", "0.626947", "0.5778673", "0.5402558", "0.53739995", "0.53731817", "0.5348117", "0.5348117", "0.5253786", "0.51260597", "0.5035994", "0.49301445", "0.48574874", "0.48516303", "0.48436052", "0.48392144", "0.48259783", "0.47912624", "0.4769956", "0.47394714", "0.4628358", "0.46187118", "0.45899862", "0.4586422", "0.45794937", "0.45756552", "0.4568088", "0.45339468", "0.45286795", "0.45163763", "0.4508465", "0.44584066", "0.44224837", "0.44096747", "0.43878436", "0.43723017", "0.43704262", "0.4352687", "0.43434572", "0.42945603", "0.42706448", "0.42366347", "0.4219142", "0.42016312", "0.41953418", "0.41935387", "0.41818598", "0.41664055", "0.4148578", "0.41366157", "0.41316918", "0.41316918", "0.41316918", "0.41316918", "0.41316918", "0.41316918", "0.41316918", "0.41316918", "0.41316918", "0.41291514", "0.41126537", "0.41051802", "0.4092323", "0.40918484", "0.40871173", "0.40645477", "0.40526077", "0.4048444", "0.40148982", "0.40130612", "0.40069616", "0.4002812", "0.40019754", "0.40008554", "0.39942446", "0.39942446", "0.3991371", "0.39864457", "0.39864457", "0.39681828", "0.3964473", "0.39633593", "0.39633593", "0.39513198", "0.394856", "0.39423794", "0.3940807", "0.39349207", "0.39341703", "0.39183456", "0.39167163", "0.38897392", "0.3887276", "0.38814092", "0.3878829", "0.38715145", "0.3869628", "0.38648853", "0.38634622", "0.38599607" ]
0.86356133
0
When a user successfully logs in, this function updates the `user` property in state to that particular user
onLoggedIn(authData) { console.log('Auth Data User', authData.user); this.setState({ user: authData.user }); localStorage.setItem('token', authData.token); localStorage.setItem('user', JSON.stringify(authData.user)); localStorage.setItem('favoriteMovies', authData.user.FavoriteMovies); window.location.pathname = '/'; this.getMovies(authData.token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "authenticate(user) {\n\t\tthis.setState({\n\t\t\tuser: user\n\t\t});\n\n\t\t// updating user's details\n\t\tlocalStorage.setItem(config.localStorageKey, JSON.stringify(user));\n\t}", "updateUser(userObject) {\n this.setState(userObject);\n console.log(\"state changed for user but not propgated \" + this.state.loggedIn);\n \n }", "function successLogin(state, { data }) {\n if (data.UserId) {\n return putLoginState(state.set('uid', data.UserId));\n } else {\n toastr.error('Failed to log in');\n return putLoginState(state, false);\n }\n}", "auth_user_data(state, user){\n state.auth_user = user\n }", "SET_USER(state, user) {\n state.user = user;\n }", "login(user) {\n\t\tthis.setState({ user: user });\n\t}", "SET_USER(state, data) {\n state.user = data;\n }", "function onAuthStateChanged(user) {\n setUser(user);\n //console.log(user)\n if (initializing) setInitializing(false);\n return(user)\n }", "onLoggedIn(user) {\n this.setState({\n user\n });\n }", "authUser (state, userData) {\n \t\tstate.idToken = userData.token\n \t\tstate.userId = userData.userId\n \t}", "setUser(state, newUser) {\n state.user = newUser;\n }", "user(state, user) {\n state.user = user;\n }", "login(user) {\n this.setState({loggedIn: true, user: user});\n }", "authUser (state, userData) {\n state.token = userData.token\n state.userId = userData.userId\n state.refreshToken = userData.refreshToken\n }", "userSignedIn() {\n firebase.auth().onAuthStateChanged((user) => {\n if (user) {\n this.setState({ user: user });\n return true;\n } else {\n this.setState({ user: {} });\n return false;\n }\n });\n }", "function userLogin(user) {\n loginStateChange(user);\n console.log(user.id);\n}", "setUser (state, user) {\n state.user = user\n }", "AUTH_USER (state, userData) {\n state.idToken = userData.token\n state.userId = userData.userId\n }", "function updateAuthState(isUserLoggedIn) {\n //Check if user is logged in\n setUserLoggedIn(isUserLoggedIn);\n }", "function onAuthStateChanged(user) {\n\t\tsetUser(user);\n\t\tif (initializing) setInitializing(false);\n\t\tconsole.log(user);\n\t}", "SET_USER(state, data) {\n state.user.data = data;\n }", "function handleUserChangeSuccess() {\n var user = userState.user();\n $scope.userNickname = user ? user.nickname : undefined;\n updateCanShowRootOperations();\n }", "setUser(new_user){\n if(new_user != null){\n new_user[\"password\"] = \"Nice Try\";\n }\n this.setState({loggedUser: new_user});\n }", "setUserData(state, user){\n console.log(\"[DEUG] setUserData: \", user)\n state.user = user;\n }", "function onAuthStateChanged(user) {\n setUser(user);\n\n if (initializing) setInitializing(false);\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) setInitializing(false);\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) setInitializing(false);\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) setInitializing(false);\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) setInitializing(false);\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) setInitializing(false);\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) setInitializing(false);\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) setInitializing(false);\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) setInitializing(false);\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) setInitializing(false);\n }", "handleLogin(data) {\n this.setState({\n isLoggedIn: true,\n user: data.user\n })\n localStorage.setItem('user', JSON.stringify(data.user))\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) {\n setInitializing(false);\n }\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) {\n setInitializing(false);\n }\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) {\n setInitializing(false);\n }\n }", "async function onAuthStateChanged(user) {\n if(user){\n setUser(user)\n }else{\n dispatch(actions.user.setUser(null))\n }\n if (initializing) setInitializing(false);\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) setInitializing(false);\n }", "successfulLogin(user, authHead) { //\n this.setupAxiosInterceptors(authHead)\n sessionStorage.setItem('authenticatedUserEmail', user.email);\n sessionStorage.setItem('authenticatedUserName', user.name);\n sessionStorage.setItem('authenticatedUserContact', user.contact);\n sessionStorage.setItem('authenticatedUserRole', user.role);\n }", "function userLogIn(user) {\n return { type: LOGGED_IN, payload: user };\n}", "function handleLogin(user) {\n clearLoginError()\n axios.post(`${process.env.REACT_APP_DB_URL}/users/login`, user)\n .then((loggedInUser) => {\n ls.setItem('token', loggedInUser.data.token)\n ls.setItem('user_id', loggedInUser.data.user_id)\n setLoginStatus(true)\n })\n .catch((err) => {\n setLoginError(err.response.data)\n })\n }", "login (state, user_info) {\n state.user_info.user_name = user_info.user_name;\n state.user_info.user_id = user_info.user_id.toString();\n }", "SET_LOGGED_IN(state, value) {\n state.user.loggedIn = value;\n }", "SET_LOGGED_IN(state, value) {\n state.user.loggedIn = value;\n }", "async setUsersStatusToLoggedIn(user) {\n const hoursToStayLoggedIn = 24;\n const now = new Date();\n user.loggedInUntil = now.setHours(now.getHours() + hoursToStayLoggedIn);\n await this.chatDAO.updateUser(user);\n }", "function onAuthStateChanged(user) {\n \n setUser(user);\n \n if (initializing) setInitializing(false);\n }", "function loginSuccess(res) {\n $state.go('users.routes', {\n username: res.user.username\n });\n }", "function onAuthStateChanged(user) { \n setUser(user);\n if (initializing) setInitializing(false);\n }", "login(){\n auth.signInWithPopup(provider)\n .then((result) => {\n console.log(result);\n const user = result.user;\n this.setState({\n user,\n });\n });\n }", "function onAuthStateChanged(user) {\n setUser(user);\n //if (initializing) setInitializing(false);\n //console.log(user.displayName);\n\n //setDatas(...Datas, {});\n }", "@bind(Actions.loginFacebook, Actions.loginTwitter, Actions.loginGithub, Actions.loginGoogle, Actions.initSession, Actions.logout)\n setUser(user) {\n this.setState({user: user});\n }", "authenticateUser() {\n this.authFailedError = '';\n this.subscription.add(this._userService.authenticateUser(this.loginCredentials).subscribe((response) => {\n this.authFailedError = '';\n this._userService.loggedInUserId = response.userId;\n sessionStorage.setItem('LOGGED-IN-USER', JSON.stringify(response));\n this._router.navigate(['/ChangeBox']);\n }, () => {\n this.authFailedError = _model_error_enum__WEBPACK_IMPORTED_MODULE_2__[\"ErrorMessages\"].LoginError;\n }));\n }", "signIn(username, password) {\n this.setState({\n user: {\n username,\n password,\n }\n })\n }", "handleLoginChange(token, user) {\n this.setState({\n accessToken: token,\n user: user\n });\n }", "[types.FETCH_USER_SUCCESS] (state, { user }) {\n state.user = user\n }", "function onAuthStateChanged(user) {\n setUser(user);\n if (initializing) setInitializing(false);\n }", "login() {\n auth.signInWithPopup(provider)\n .then((result) => {\n // console.log(result);\n const user = result.user;\n this.setState({\n user,\n });\n });\n }", "currentUser(state, user) {\n state.currentUser = user;\n }", "function authenticateUser(event) {\n const body = {\n name: event.target.username.value\n }\n fetch(\"http://localhost:3000/api/v1/users/\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n },\n body: JSON.stringify(body),\n }).then(r => r.json())\n .then(user => loggedInUser = user.id)\n .then(event.target.reset())\n .then(() => showHideCategories())\n}", "attemptLogIn( username, password ) {\n\n\t\tthis.setState( {\n\t\t\tuser: {\n\t\t\t\tusername: username,\n\t\t\t\tjwt: 'randomhash'\n\t\t\t}\n\t\t} )\n\n\t\t//Try to log in here!\n\t\t//\n\t\treturn true\n\t}", "function initializeUserAuthentication(user){\n\t\tuserInfo.accessToken = user.token;\n\t\tuserInfo.user = {\n\t\t\tid: user.id,\n\t\t\tusername: user.username,\n\t\t\tfullName: _.compact([user.firstName, user.lastName]).join(' '),\n\t\t\tlanguage: user.language\n\t\t};\n\n\t\tCookieUtil.set(accessTokenCookie, userInfo.accessToken);\n\t\t$rootScope.$broadcast('UserContext.Authenticated');\n\t\tinitializeUserLocation();\n\n\t\treturn waitForSessionToStabilize()\n\t\t\t.then(function(){\n\t\t\t\tuserInfo.sessionStable = true;\n\t\t\t\t$rootScope.$broadcast('UserContext.Change');\n\t\t\t});\n\t}", "[AUTH_MUTATIONS.SET_USER](state, user) {\n state.user = user\n }", "function updateUser() {\n try {\n selectedUser.username = $usernameFld.val();\n selectedUser.password = $passwordFld.val();\n selectedUser.firstName = $firstNameFld.val();\n selectedUser.lastName = $lastNameFld.val();\n selectedUser.role = $roleFld.val();\n userService.updateUser(selectedUserId, selectedUser)\n .then(function (userServerInfo) {\n users[editIndex] = selectedUser;\n renderUsers(users);\n resetInputFields();\n clearSelected();\n });\n }\n // In future could catch null error or could grey out checkmark icon.\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "async function signIn(user) {\n setLoading(true);\n console.log(` ${JSON.stringify(user)}`);\n await AsyncStorage.setItem('@RNAuth:user', JSON.stringify(user));\n setLoggedUser(user)\n setLoading(false);\n }", "loginUser(email, password){\n Services.user.login(email, password)\n .then((res) => {\n if (res.success){\n this.setState({\n user: res.content.user\n });\n this.props.router.push('/');\n }\n }).catch((err) => {\n alert(\"Login error: \" + err.error.err);\n });\n }", "handleSignUp() {\n\n // Create a new user and save their information, THEN\n // - Update the display name of the user\n\n // - Return promise for chaining, THEN\n // - Set the state as the current (firebase) user\n\n }", "authUser (state, authData) {\n state.idToken = authData.token\n state.userId = authData.userId\n state.expiresIn = authData.expiresIn\n \n saveToLocal({\n token: authData.token,\n userId: authData.userId,\n expiresIn: authData.expiresIn,\n })\n router.push('/dashboard').catch(()=>{})\n }", "setUser(state, payload) {\n state.user = payload;\n }", "login(data) {\n\t\taxios(`${this.base}/users/login`, {\n\t\t\tmethod: 'POST',\n\t\t\tdata\n\t\t})\n\t\t\t.then(response => {\n\t\t\t\t// console.log('Login successful. Response Data:', response.data);\n\t\t\t\tTokenService.save(response.data.token);\n\t\t\t\tthis.setState(\n\t\t\t\t\t{\n\t\t\t\t\t\tuser: response.data.user,\n\t\t\t\t\t\ttoken: response.data.token,\n\t\t\t\t\t\tprescriptions: response.data.prescriptions,\n\t\t\t\t\t\tisAuthed: true\n\t\t\t\t\t},\n\t\t\t\t\t() => console.log('Login Successful! Updating state:', this.state)\n\t\t\t\t);\n\t\t\t})\n\t\t\t.catch(error => console.log(`Error: ${error}`));\n\t}", "getUser() {\n API.getUser().then(response => {\n console.log('Get user response: ');\n if (response.data.user) {\n console.log('Get user: ' + response.data.user.username);\n this.setState({\n loggedIn: true,\n user: response.data.user\n })\n } else {\n console.log('Get user: no user found');\n this.setState({\n loggedIn: false,\n user: null\n })\n }\n })\n }", "[AUTH_MUTATIONS.SET_USER](state, user) {\n state.user = user;\n state.user_id = user.id;\n }", "updateUserStatus(state) {\n state.userSignUpStatus = \"Sign up Successful!\"\n console.log(state.userSignUpStatus)\n }", "handleChange(newUser) {\n this.setState({'user': newUser});\n }", "function setUser() {\n\tuser = firebase.auth().currentUser;\n\tisSignedIn = true;\n\tcheckIfIt();\n\tcheckIt();\n\tconnectUser();\n\tdisplayScreen();\n}", "loginUser(new_user){\n console.log(new_user)\n fetch(\"/users/find/'\" + new_user.user_name + \"'\")\n .then(response => response.json())\n .then(logged_user => {\n if(new_user.password === logged_user.password){\n this.setUser(logged_user);\n } else {\n this.setState({ errorWrongPassword: true });\n console.log(\"Wrong Password\");\n }\n }).catch(error => {\n console.log(error);\n });\n this.changePage('charitiesSearch')\n }", "signIn(username, password) {\n // This is where you would call Firebase, an API etc...\n // calling setState will re-render the entire app (efficiently!)\n this.setState({\n user: {\n username,\n password,\n }\n })\n }", "loginSuccess(state, payload) {\n state.accessToken = payload.accessToken\n state.authenticating = false;\n\n // Flip could do too: status=hasAccount and another prop tells if verified\n // state.hasAccount = true\n // state.status = emailVerified ? STATUS.EMAIL_VERIFIED : STATUS.EMAIL_NOT_VERIFIED\n\n // window.console.log('loginSuccess', state, payload.accessToken, payload.emailVerified)\n\n state.status = AUTH_STATUS.HAS_ACCOUNT\n state.emailVerified = payload.emailVerified\n }", "onSignUpSubmit(event) {\n const user = this.state;\n if (user.password === user.verifyPass) {\n // makes sure passwords are the same\n return axios.post('/signUp', user)\n .then(() => {\n // if successful logs user in automatically\n return axios.post(`/login`, { username: user.username, password: user.password })\n })\n .then((response) => {\n // takes user_id from response\n const newUser = {\n username: user.username,\n email: user.email,\n business: user.business,\n user_id: response.data.user_id,\n isHiddenEmail: true,\n }\n // sets the signed in user info\n this.props.changeUser(newUser);\n })\n } else {\n this.setState({\n showPasswordError: !this.state.showPasswordError\n });\n }\n }", "checkAuthStatus(){\n\t\tfirebase.auth().onAuthStateChanged(function(user) {\n\t\t\tif (user) {\n\t\t\t\tthis.setState({loggedIn: true, user : user, errorCode : '', errorMessage : ''});\n\t\t\t\tconsole.log(\"user logged in\");\n\t\t \t} else {\n\t\t \tthis.setState({loggedIn: false, user : null});\n\t\t \t}\n\t\t}.bind(this));\n\t}", "function setCurrentUser(user) {\n currentUser = user.data;\n currentUserAllData = user;\n\n return Fliplet.App.Storage.set(USERID_STORAGE_KEY, currentUser.flUserId).then(function() {\n return Fliplet.App.Storage.set(USERTOKEN_STORAGE_KEY, currentUser.flUserToken);\n });\n }", "function onAuthStateChanged(user) {\n\t\tsetUserToken(user);\n\t\tconsole.log(user);\n\t\tif (isLoading) setIsLoading(false);\n\t}", "function setCurrentUser(user) {\n \n currentUser.userId = user[0];\n currentUser.firstName = user[1];\n currentUser.lastName = user[2];\n currentUser.email = user[3];\n currentUser.password = user[4];\n }", "onUserLoaded(result) {\n this.user = result;\n this.setState({ userLoaded: true });\n }", "updateLogin() {\n \n this.setState({ loggedIn: true });\n }", "function setUser() {\n var docRef = userRef.doc(user.email);\n docRef.get().then((doc) => {\n setUsername(doc.data().username);\n setCurrentUser(doc.data());\n });\n }", "function logIn(newUser) {\n // On server response, set localUser = the response from the server, a user object\n localUser = newUser;\n //Hides the login menu and enables logged in features\n $login.trigger('click');\n\n toggleLoginElements();\n }", "syncCurrentUser(user){\n this.setState({ currentUser: user }); \n if (user){ \n this.setState({ role: user.role})\n this.setState({ name: user.fullName })\n console.log(\"usuario\",this.state.role, this.state.name, this.state.currentUser)\n } \n }", "checkLogin() {\n firebase.auth().onAuthStateChanged((user) => {\n if(user) {\n this.setState({\n isLogined: true\n });\n } else {\n this.setState({\n isLogined: false\n });\n }\n })\n }", "function upsertUser(userData) {\n $.post(\"/api/user/create\", userData)\n .then(function(){\n localStorage.setItem(\"currentUser\", JSON.stringify(userData));\n localStorage.setItem(\"loggedIn\", true);\n window.location = \"/\"\n });\n }", "saveUser() {\n let userObj = {\n userId: null,\n username: this.state.emailAddress,\n password: this.state.password,\n email: this.state.emailAddress,\n user_email: this.state.email,\n firstName: this.state.firstName,\n lastName: this.state.lastName\n }\n API.saveUser(userObj)\n .then(response => {\n\n\n\n if (!response.data.error) {\n //Now that the user account is created, let's automatically login the user in\n this.props._login(this.state.emailAddress, this.state.password, userObj);\n\n \n } else {\n //Usually this happens when an email address was already used.\n this.setState({ serverErrorMessage: response.data.error })\n }\n })\n\n }", "function loginUserCallback() {\n loginUser();\n }", "function authStateObserver(user) {\n if (user) { // User is signed in\n console.log(\"User signed in\");\n } else { // User is signed out\n window.open('../index.html', \"_self\");\n }\n }", "_updateUser() {\n\t\tconst user = UserStore.activeUser();\n\t\tconst authInfo = UserStore.activeAuthInfo();\n\t\tconst emails = user && user.UID ? UserStore.emails.get(user.UID) : null;\n\t\tconst primaryEmail = emails && !emails.Error ? emails.filter(e => e.Primary).map(e => e.Email)[0] : null;\n\n\t\tif (this._authInfo !== authInfo) {\n\t\t\tif (this._authInfo && this._authInfo.UID && (!authInfo || this._authInfo.UID !== authInfo.UID)) {\n\t\t\t\t// The user logged out or another user logged in on the same browser.\n\n\t\t\t\t// Distinguish between 2 users who log in from the same browser; see\n\t\t\t\t// https://github.com/amplitude/Amplitude-Javascript#logging-out-and-anonymous-users.\n\t\t\t\tif (this._amplitude) this._amplitude.regenerateDeviceId();\n\n\t\t\t\t// Prevent the next user who logs in (e.g., on a public terminal) from\n\t\t\t\t// seeing the previous user's Intercom messages.\n\t\t\t\tif (this._intercom) this._intercom(\"shutdown\");\n\n\t\t\t\tif (this._fullStory) this._fullStory.clearUserCookie();\n\t\t\t}\n\n\t\t\tif (authInfo) {\n\t\t\t\tif (this._amplitude && authInfo.Login) this._amplitude.setUserId(authInfo.Login || null);\n\t\t\t\tif (window.ga && authInfo.Login) window.ga(\"set\", \"userId\", authInfo.Login);\n\n\t\t\t\tif (this._telligent && authInfo.Login) this._telligent(\"setUserId\", authInfo.Login);\n\n\t\t\t\tif (authInfo.UID) this.setIntercomProperty(\"user_id\", authInfo.UID.toString());\n\t\t\t\tif (authInfo.IntercomHash) this.setIntercomProperty(\"user_hash\", authInfo.IntercomHash);\n\t\t\t\tif (this._fullStory && authInfo.Login) {\n\t\t\t\t\tthis._fullStory.identify(authInfo.Login);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this._intercom) this._intercom(\"boot\", this._intercomSettings);\n\t\t}\n\t\tif (this._user !== user && user) {\n\t\t\tif (user.Name) this.setIntercomProperty(\"name\", user.Name);\n\t\t\tif (this._fullStory) this._fullStory.setUserVars({displayName: user.Name});\n\t\t\tif (user.RegisteredAt) {\n\t\t\t\tthis.setUserProperty(\"registered_at\", new Date(user.RegisteredAt).toDateString());\n\t\t\t\tthis.setIntercomProperty(\"created_at\", new Date(user.RegisteredAt).getTime() / 1000);\n\t\t\t}\n\t\t}\n\t\tif (this._primaryEmail !== primaryEmail) {\n\t\t\tif (primaryEmail) {\n\t\t\t\tthis.setUserProperty(\"email\", primaryEmail);\n\t\t\t\tthis.setIntercomProperty(\"email\", primaryEmail);\n\t\t\t\tif (this._fullStory) this._fullStory.setUserVars({email: primaryEmail});\n\t\t\t}\n\t\t}\n\n\t\tthis._user = user;\n\t\tthis._authInfo = authInfo;\n\t\tthis._primaryEmail = primaryEmail;\n\t}", "fetchUser() {\n if (this.state.loggedInUser === null) {\n loggedin()\n .then((response) => {\n this.setState({ loggedInUser: response });\n })\n .catch((err) => {\n this.setState({ loggedInUser: false });\n });\n }\n }", "login(state, data) {\r\n state.token = data.token\r\n state.refreshToken = data.refreshToken\r\n state.user = data.user\r\n state.isAuth = true\r\n }", "updateLogin() {\n this.setState({\n loggedIn: !this.state.loggedIn,\n });\n }", "login(e){\n e.preventDefault(); // prevent default form action\n // send request to make sure the email and password are correct\n axios.post(`${this.props.url}/login`, this.state.inputs)\n .then(res => { // set the user based off of the response\n this.props.setUser(res.data);\n })\n }", "login({ state, commit }, user) {\n console.log('action - login is processing with username=' + user.username + ' password=' + user.password);\n state.userService.login(user.username, user.password).\n then(response => {\n console.log(response);\n localStorage.setItem(LOCAL_STORAGE_GIT_TOKEN, response.token); // store token, secret\n commit(\"setCurrentUser\", response.user);\n })\n .catch(e => {\n console.error(e);\n });\n }", "handleUserLogin(event) {\n event.preventDefault();\n\n Meteor.loginWithPassword({ email: this.state.email }, this.state.password, (err) => {\n if (err) this.setState({\n errorMessage: err.reason,\n });\n else this.setState({\n success: true,\n errorMessage: '',\n });\n });\n }" ]
[ "0.7474876", "0.7374913", "0.72785753", "0.71775514", "0.7150576", "0.71292275", "0.711933", "0.7117941", "0.7104763", "0.7096332", "0.7087405", "0.70682013", "0.706351", "0.70008224", "0.69604653", "0.68995374", "0.68968594", "0.68622303", "0.68582445", "0.68509525", "0.68288976", "0.6808479", "0.68001306", "0.67912906", "0.6756129", "0.67560744", "0.67560744", "0.67560744", "0.67560744", "0.67560744", "0.67560744", "0.67560744", "0.67560744", "0.67560744", "0.67553526", "0.6755052", "0.6755052", "0.6755052", "0.67472726", "0.6745879", "0.6745601", "0.67400277", "0.673019", "0.6725067", "0.672425", "0.672425", "0.67069924", "0.6705178", "0.66973907", "0.6691467", "0.6685249", "0.66726965", "0.6667477", "0.6648565", "0.6642004", "0.6638056", "0.66379106", "0.663401", "0.6611741", "0.6594939", "0.65917176", "0.6587937", "0.6575576", "0.6571224", "0.656118", "0.6558256", "0.6556982", "0.65539503", "0.6546652", "0.6545824", "0.6537119", "0.65285486", "0.64889115", "0.646897", "0.646383", "0.6461363", "0.6460657", "0.6459789", "0.6436651", "0.6430372", "0.6426003", "0.64234746", "0.64034814", "0.64025", "0.6397008", "0.6391159", "0.6385384", "0.63662195", "0.6364755", "0.636311", "0.6363019", "0.6350743", "0.63483244", "0.63476515", "0.63192165", "0.631073", "0.629529", "0.62864995", "0.6286284", "0.6278182", "0.6276487" ]
0.0
-1
make a GET request to heroku.
getMovies(token) { axios .get('https://kumi-movie-index.herokuapp.com/movies', { headers: { Authorization: `Bearer ${token}` } }) .then(response => { // #1 this.props.setMovies(response.data); }) .catch(function (error) { console.log(error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function http_get(req_url){\n request.get(\n bal_query,\n function(error, response, body) {\n console.log(\"Clickatell GET:\")\n node.send(\"Clickatell GET:\");\n if (!error && response.statusCode == 200) {\n if (DEBUG){\n console.log(body, response)\n }\n console.log(req_url)\n console.log(body)\n node.send(body);\n }\n }\n );\n }", "get(url, opt = {}) {\n opt.method = 'GET';\n return this.sendRequest(url, opt);\n }", "get(url, data = {}, config = {}) {\n return this.request({ method: GET, url, data, config })\n }", "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "function get() {\n fetch(\"https://foobar-jearasfix.herokuapp.com/\")\n .then((res) => res.json())\n .then((data) => {\n checkQueue(data);\n checkServing(data);\n setTapData(data.taps);\n });\n }", "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "get(url, options = {}) {\n return this.request('GET', url, options);\n }", "function get (url, query, done) {\n req('GET', url, query, null, done);\n}", "get(url) {\n const req = this.client.get(url);\n\n return this.preRequest(req);\n }", "function GET(url, data, priority) {\n return request({\n type: \"GET\",\n url: url,\n data: data,\n priority: priority || 0\n });\n }", "function handleGet(request, response) {\n console.log(\"got a GET request\");\n console.log(request.query);\n response.json(data);\n console.log(process.env.PORT);\n}", "function get(url, data) {\n console.log('get', url);\n return request\n .get(url, data)\n .setCommonHeader()\n .then(res => Promise.resolve(res.body))\n .catch(err => errHandler(err, url));\n}", "function get(url, body) {\n const httpRequest = request(app).get(url);\n httpRequest.send(body);\n httpRequest.set('Accept', 'application/json');\n httpRequest.set('Origin', 'http://localhost:8080');\n return httpRequest;\n}", "get(url) {\n return fetch(this.getBaseURL() + url)\n .then((response) => response.json());\n }", "get(url) {\n return fetch(url).then((res) => res.json());\n }", "function sendGet(url, params)\n{\n\t\n}", "function sendGet(url, params)\n{\n\t\n}", "function get(url, options) {\n sendRequest(url, \"GET\", null, options);\n }", "function get(url) {\n const requestOptions = {\n method: 'GET',\n };\n return fetch(url, requestOptions).then(handleResponse);\n}", "sendGetRequest(url) {\n return this.httpClient.get(url);\n }", "GET() {\n }", "_request() {\n var options = url.parse(this._url);\n options.headers = {\n 'User-Agent': 'Benjamin Tambourine',\n 'If-None-Match': this._etag\n };\n https.get(options, this._onResponse.bind(this));\n }", "function GET(url, handler) {\n app.get(url, async (req, res) => {\n try {\n // execute the database query\n const data = await handler(req);\n res.json({\n success: true,\n data: data\n });\n } catch (error) {\n res.status(500).json({\n success: false,\n error: error.message || error\n });\n }\n });\n}", "get(url) {\n return fetch(this.baseURL + url)\n .then((response) => response.json());\n }", "function makeGetRequest(url) {\n return fetch(url).then(response => response.json());\n}", "httpGet(url) {\n return new Promise((resolve, reject) => {\n if (this.develop) {\n console.log(\"URL sent to server: \" + this.server + url);\n }\n http.get(this.server + url, (res) => {\n var data = \"\";\n\n res.on('data', (chunk) => {\n data += chunk;\n }).on('end', () => {\n if (res.statusCode === 200) {\n resolve(data);\n } else {\n reject(data);\n }\n }).on('error', (e) => {\n reject(\"Got error: \" + e.message);\n });\n });\n });\n }", "get(url, params) {\n\t\treturn request.get(this.proxy + url).query(params).then((response) => response.data);\n\t}", "get(url, callback) {}", "function get(url) {\n var deferred = q.defer();\n\n http.get(url, function(res) {\n var body = '';\n\n res.on('data', function(chunk) {\n body += chunk;\n });\n \n res.on('end', function() {\n deferred.resolve(body);\n }); \n })\n .on('error', function(e) {\n deferred.reject(e);\n });;\n return deferred.promise;\n}", "function httpGet(url) {\n return new Promise((resolve, reject) => {\n request(url, (err, res, body) => {\n if (err) {\n reject(err);\n } else {\n resolve(body);\n }\n });\n });\n}", "function req_get(url, data, callback) {\n let HOST_URL = 'https://klzz.hualinginfo.com/';\n // let HOST_URL = process.env.HOST_URL;\n let patt = /http/;\n if (!patt.test(url)) {\n url = HOST_URL + url;\n }\n if (data) {\n let urlParamArr = [];\n for (let key in data) {\n urlParamArr.push(key + '=' + data[key]);\n }\n let urlParam = '?' + urlParamArr.join('&');\n\n url += urlParam;\n }\n\n fetch(url).then(response => response.json()).then(json => {\n typeof callback == \"function\" && callback(json.data);\n });\n}", "get(url, data = {}, succCb = null, errCb = null) {\n return this.request('GET', url, data, succCb, errCb);\n }", "function get(url, query) {\n if(isServerRequest(url)) {\n return serverRequest('get', url, query);\n }\n\n const params = getParams(query, encodeQuery);\n const target = url.match(/http/) ? `${url}${params}` : `${API}${url}${params}`;\n const defer = q.defer();\n\n request.get(target).end((err, res) => {\n if(res) {\n defer.resolve(res.body);\n } else {\n defer.reject();\n }\n })\n\n return defer.promise;\n}", "function get(url, params) {\n return request(url, params);\n}", "function httpGet(url) {\n return {\n type: \"httpGet\",\n url\n };\n}", "get(url){\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tfetch(url)\n\t\t\t.then(res => res.json())\n\t\t\t.then(data => resolve(data)) \n\t\t\t.catch(error => reject(error));\n\t\t});\t\n\t}", "function get(url, data, callback) {\n var requestUrl = url + '?' + data;\n request.get(requestUrl, function(error, response, body) {\n callback(response.statusCode, body);\n });\t\n}", "get(url,cb){\n fetch(url)\n .then(response=>{\n response.json().then(data=>{\n cb(data)\n })\n })\n }", "makeGETRequest(url, headers) {\n return this.makeRequest(url, 'GET', headers);\n }", "get(url, conf = {}) {\n return getClient().get(url, conf)\n .then(response => Promise.resolve(response))\n .catch(error => Promise.reject(error));\n }", "get(url, conf = {}) {\n return getClient().get(url, conf)\n .then(response => Promise.resolve(response))\n .catch(error => Promise.reject(error));\n }", "function GET(url) {\n return new Promise((resolve, reject) => {\n let k = https.get(url, d => {\n\n let data = \"\";\n\n d.on(\"data\", c => { data += c; });\n d.on(\"end\", () => {\n try {\n resolve(JSON.parse(data));\n } catch(e) {\n reject(data);\n }\n });\n });\n k.on(\"error\", e => { reject(e); });\n });\n}", "function requestGet(url, callback) {\n var reqUrl = mkUrl(url);\n\n Request.get(reqUrl).withCredentials().end(function(err, res) {\n if (err) {\n err.reqUrl = reqUrl;\n callback(err, null);\n } else {\n callback(null, res);\n }\n });\n}", "get(url) {\n return fetch(url)\n .then((response) => {\n // console.log(response);\n if (response.ok) return response.json();\n throw Error(`Failed to fetch server responded with ${response.status}`);\n })\n .then((data) => data)\n .catch((err) => err);\n }", "get(url) {\n return this.axios\n .get(`/api/v1${url}`, this.requestConfig)\n .catch(this._handleError);\n }", "get (path, params) { return this.request(path, 'get', null, params) }", "static GET(url, params) {\n return axios.get(url, {params: params, headers: {'Authorization': 'Token ' + ArchestAuth.getToken()}});\n\n }", "function httpGet(cmd) {\n return fetch(cmd.url).then(r => r.json());\n}", "function get(url) {\n return Request\n .get(url)\n .timeout(TIMEOUT)\n .set('Accept', 'application/json')\n .set('Authorization', 'Bearer ' + jwt())\n .set('X-CSRF-Token', csrfToken());\n}", "get(url, callback) {\n rest({\n path: url,\n headers: { Authorization: `Client-Id ${imgurConfig.clientId}` } }).then((response) => {\n callback(response);\n });\n }", "function httpGet(theUrl, callback){\n request(theUrl, function (error, response, body){\n\n\t\tif (!error && response.statusCode == 200){\n\t\t \tcallback(body) // Call the callback function passed in\n\t\t}else if(response.statusCode == 403){\n\t\t\tconsole.log('ACCESS DENIED: This probably means you ran out of requests on your API key for now.')\n\t\t}\n\t})\n}", "get(url) {\n return new Promise((resolve, reject) => {\n fetch(url)\n .then(res => res.json())\n .then(data => resolve(data))\n .catch(err => reject(err))\n })\n }", "get(url) {\n return new Promise((resolve, reject) => {\n fetch(url)\n .then(res => res.json())\n .then(data => resolve(data)) \n .catch(err => reject(err));\n });\n }", "function doGet(url, callback) {\n\tmakeCall(\"GET\", url, null, callback);\n}", "get(url) {\n return new Promise((resolve, reject) => {\n fetch(url)\n .then(res => res.json())\n .then(data => resolve(data))\n .catch(err => reject(err));\n });\n\n \n }", "function get (url) {\n var request = NSURLRequest.requestWithURL(NSURL.URLWithString(url));\n var response = NSURLConnection.sendSynchronousRequest_returningResponse_error(request, null, null);\n return response;\n}", "get(url) {\n return fetch(url)\n .then(this._handleErrors)\n .then(res => res.json())\n }", "get(url) {\n return new Promise((resolve, response) => {\n fetch(url)\n .then((res) => res.json())\n .then((data) => resolve(data))\n .catch((err) => reject(err))\n })\n }", "function request(){\n\n var xhr = GethttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function() {\n var status = xhr.status;\n if (status == 200) {\n callback(status, xhr.response);\n } else {\n callback(status);\n }\n };\n xhr.send();\n }", "function doGet(e) {\n return postToSlack(makeResponse(e));\n}", "static async get(url, parameters = {}) {\n const queryString = this.CreateQueryString(parameters);\n const urlQuery = `${url}?${queryString}`;\n const headers = { 'Accept': 'application/json' };\n const options = {\n method: 'GET',\n mode: 'cors',\n headers: new Headers(headers),\n cache: 'default'\n };\n const request = new Request(urlQuery, options);\n\n try {\n const response = await fetch(request, options);\n return response.json();\n } catch (error) {\n return error;\n }\n }", "get(url) {\n return new Promise((resolve, reject) => {\n fetch(url)\n .then(res=>res.json())\n .then(data=>resolve(data))\n .catch(err => reject(err))\n })\n }", "function getIssue(url){\n request(url,cb);\n}", "function sendRequest({url, method = 'GET', headers, body = null}) {\n // let customBody = null;\n return fetch(BASE_SERVER_PATH + url + '?v=1.0.0', {\n method,\n headers,\n body,\n });\n }", "function getRequest(url, callback) {\n request({\n method: 'GET',\n url: url\n }, function (err, response, body) {\n if (!err && response.statusCode == 200) {\n return callback(null, body);\n } else {\n return console.error(\"Looks like there's an error. Please try again later.\");\n }\n });\n}", "static get(url) {\n return new Promise((resolve, reject) => {\n fetch(url)\n .then((res) => res.json())\n // data as res.json()\n .then((data) => resolve(data))\n .catch((err) => reject(err));\n });\n }", "_request( url){\r\n\t\treturn fetch( url)\t//response = what we get from fetch = json with server response \r\n\t\t\t.then( ( response) => {\r\n\t\t\t\tif( response.status !== 200) {\r\n\t\t\t\t\tconsole.log('Request returned with code: ' + response.status);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\treturn response.json().then( ( data) => {\r\n\t\t\t\t\treturn data;\r\n\t\t\t\t});\r\n\t\t\t}).catch(( err) => {\r\n\t\t\t\tconsole.log('Fetch Error :-S', err);\r\n\t\t\t});\r\n\t}", "function httpGet(theUrl) {\n var xmlHttp = null;\n \n xmlHttp = new XMLHttpRequest();\n xmlHttp.open( \"GET\", theUrl, true );\n xmlHttp.send( null );\n return xmlHttp.responseText;\n }", "function Get(url, params) {\n Request.apply(this, arguments);\n}", "function get (action, callback, data, headers) {\n return callPushRest('GET', callback, action, data, headers);\n }", "get(callback) {\n const uri = buildUri()\n log(uri)\n api.get(\n uri,\n null,\n null,\n result.$createListener(callback)\n )\n }", "function httpGet(url) {\n\trequestHttp = new XMLHttpRequest();\n\trequestHttp.open(\"GET\", url, true);\n\trequestHttp.onreadystatechange = processRequest;\n\trequestHttp.send(null);\n}", "get(opts) {\n\t\topts.method = \"get\";\n\t\treturn this.request(opts);\n\t}", "async function GET(url = '') {\n let js = fetch(url, {\n method: 'GET',\n mode: 'cors',\n cache: 'no-cache',\n credentials: 'same-origin',\n redirect: 'follow',\n referrerPolicy: 'no-referrer',\n }).then((response) => response.json()).catch((f) => {\n console.log(\"error; \" + f);\n }\n );\n return js\n}", "get(path) {\n this.log('GET ' + this.host + path);\n return request({\n url: 'http://' + this.host + path,\n headers: { 'Accept': 'vdn.dac.v1' },\n json: true\n });\n }", "async function getInfo(ctx) {\n\n console.log(\"GET getInfo\");\n console.log(ctx.request.url)//mostrar la ruta completa de la peticion\n console.log(ctx.request.querystring)//el querystring pero como una cadena\n console.log(ctx.request.method)//el querystring pero como una cadena\n\n var parametros = ctx.request.query;//el query como un objeto\n\n //aqui vamos a utilizar algunos parametros\n\n ctx.body = 'SIMPLE SERVER v.0.1 ' + ctx.request.url ;//devolviendo los resultados.\n}", "async function submitGETRequest(searchParameters = '') {\n\t\treturn fetch(serverEndpointGETurl + '?' + searchParameters, {\n\t\t\tmethod: 'GET',\n\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json'\n\t\t\t}\n\t\t});\n\t}", "hostRequest(pageURL) {\n return request\n .get(pageURL)\n .auth(this.credentials.username, this.credentials.token)\n .set('Accept', 'application/vnd.github.v3+json');\n }", "async get(url){\n const getData = await fetch(url);\n\n const data = await getData.json();\n return data;\n\n }", "function Get(yourUrl){\n\t//create a http request\n var Httpreq = new XMLHttpRequest(); // a new request\n\n //making a GET request to the url\n Httpreq.open(\"GET\",yourUrl,false);\n Httpreq.send(null);\n\n //return responseText in JSON format\n return Httpreq.responseText;\n}", "async function get (digest) {\n return request.get(url.resolve(baseUrl, digest))\n }", "function getJSON(){\n console.log(\"GET\");\n\n var api_url = _api_url; \n httpGetAsync(api_url,function(resp){\n console.log(resp);\n console.log(\"data returned successfully\");\n })\n }", "makeRequest(url, options = {}) {\n\t\toptions = deepAssign({\n\t\t\theaders: {\n\t\t\t\t'user-agent': `onionoo-node-client v${pkg.version} (${pkg.homepage})`\n\t\t\t}\n\t\t}, options);\n\n\t\treturn got(url, options)\n\t\t\t.catch(err => {\n\t\t\t\t// Don't throw 304 responses\n\t\t\t\tif (err.statusCode === 304) {\n\t\t\t\t\treturn err.response;\n\t\t\t\t}\n\t\t\t\tthrow err;\n\t\t\t})\n\t\t\t.then(response => {\n\t\t\t\t// Format response\n\t\t\t\tresponse = {\n\t\t\t\t\tstatusCode: response.statusCode,\n\t\t\t\t\tstatusMessage: response.statusMessage,\n\t\t\t\t\theaders: response.headers,\n\t\t\t\t\tbody: response.body && JSON.parse(response.body)\n\t\t\t\t};\n\n\t\t\t\treturn response;\n\t\t\t});\n\t}", "get(url, data) {\n authHeader();\n return axios.get(url, data);\n }", "static get(url, params = {}) {\n return new Promise((resolve, reject) => {\n instance\n .get(url, { params, headers: getNewHeaders })\n .then(({ data }) => {\n if (data.errno === 0) {\n resolve(data.data);\n } else {\n resolve(data);\n }\n })\n .catch(error => {\n reject({ err: JSON.stringify(error) });\n });\n });\n }", "function post(url) {\n request({\n url: url,\n method: \"GET\"\n })\n}", "function get (url, callback) {\n var req = new XMLHttpRequest();\n req.onload = callback; \n req.open('GET', url, true);\n req.responseType = 'json';\n req.setRequestHeader(\n 'Authorization',\n 'Basic ' + btoa(creds.appID + ':' + creds.jsKey)\n );\n req.send(); \n}", "function getPost() {\n http.get('https://jsonplaceholder.typicode.com/posts/1', function(response) {\n console.clear();\n console.log(response);\n });\n}", "function api_call(path, api_key, callback, params, method, headers, body) {\n var method = method || \"GET\";\n var headers = headers || {};\n\n var url = HEROKU_API_ENDPOINT + path;\n\n _.extend(headers, make_basic_auth_header(api_key));\n headers[\"Accept\"] = \"application/json\";\n\n if (params !== undefined && params !== {}) {\n url += \"?\";\n url += qs.stringify(params);\n }\n var opts = {\n method: method\n , uri: url\n , headers: headers\n };\n\n if (body !== undefined\n && (method.toUpperCase() === \"POST\" || method.toUpperCase() === \"PUT\")) {\n opts.body = body;\n }\n\n console.debug(\"Heroku API request: %j\", opts);\n request(opts, callback);\n\n}", "function httpGet(theUrl) {\r\n var xmlHttp = new XMLHttpRequest();\r\n xmlHttp.open(\"GET\", theUrl, false);\r\n xmlHttp.send(null);\r\n return xmlHttp.response;\r\n}", "async get(url, headers = {}) {\r\n var response;\r\n if (HTTPRequest.prototype.isEmpty(headers))\r\n response = await fetch(url);\r\n else\r\n response = await fetch(url, { headers: headers });\r\n\r\n return response;\r\n }", "function get() {\n ajax_get('https://api.thedogapi.com/v1/breeds', function(data) {\n printBreeds(data)\n });\n}", "async function main() {\n try {\n let response = await GET(url);\n console.log(\"GET: %o\", response);\n } catch (e) {\n console.log(e.name + \": \" + e.message);\n }\n}", "function httpGetAsync(theUrl, callback)\n{\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() { \n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n callback(xmlHttp.responseText);\n\t\tif(xmlHttp.status == 400)\n\t\t\terror();\n\t\tif(xmlHttp.status == 404)\n\t\t\terror();\n }\n xmlHttp.open(\"GET\", \"https://cors-anywhere.herokuapp.com/\" + theUrl, true); // true for asynchronous \n xmlHttp.send(null);\n}", "function getWithProm(url) {\n return new Promise((res, rej) => {\n request.get(url)\n .end((err, result) => {\n if (err) return rej(err);\n\n return res(result.text);\n });\n });\n}", "function heroku(payload, success, error) {\n // openLoadingModal();\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (xhttp.readyState == 4 && xhttp.status == 200) {\n var response = JSON.parse(xhttp.responseText)\n // closeLoadingModal();\n success(response)\n } else if (xhttp.readyState == 4) {\n // closeLoadingModal();\n error(response)\n }\n };\n\n xhttp.open(\"POST\", endpoint, true);\n xhttp.setRequestHeader(\"Content-type\", \"application/json\");\n xhttp.send(JSON.stringify(payload));\n}", "async get() {\n\t\treturn await this._run('GET');\n\t}", "get(url) {\n\t\t// wrap our fetch in a promise\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tfetch(url)\n\t\t\t\t.then(res => res.json())\n\t\t\t\t// now, instead of just returning data, we call resolve and pass it in data\n\t\t\t\t.then(data => resolve(data))\n\t\t\t\t// ...and reject for the error\n\t\t\t\t.catch(err => reject(err));\n\t\t});\n\t}" ]
[ "0.6763127", "0.6589341", "0.65172577", "0.64695376", "0.6399705", "0.63736755", "0.63736755", "0.63736755", "0.63736755", "0.63736755", "0.6349234", "0.6338461", "0.6289691", "0.62016225", "0.61545515", "0.610552", "0.60756874", "0.60604453", "0.6045518", "0.6045518", "0.6036849", "0.6023107", "0.6019982", "0.6016254", "0.6006453", "0.5997094", "0.5982044", "0.5978918", "0.5958375", "0.5949669", "0.59408474", "0.59365636", "0.5931705", "0.59177774", "0.58969814", "0.5893628", "0.58835185", "0.5880028", "0.58690745", "0.58296835", "0.582824", "0.581712", "0.58043134", "0.57758904", "0.57738364", "0.57557267", "0.5712586", "0.5697853", "0.56968385", "0.56966585", "0.5696562", "0.56958526", "0.56897765", "0.5685911", "0.568298", "0.56822866", "0.567515", "0.56736773", "0.5666079", "0.5661909", "0.5654716", "0.5636001", "0.56344944", "0.56315607", "0.5629855", "0.5625194", "0.56175464", "0.5594632", "0.55878395", "0.55804676", "0.55720794", "0.55701905", "0.5563828", "0.55463135", "0.5543345", "0.55335695", "0.5532474", "0.5523569", "0.5523113", "0.5521998", "0.5515547", "0.5509463", "0.5508582", "0.5505056", "0.5504131", "0.55002517", "0.5496904", "0.5496135", "0.54945964", "0.5491814", "0.5491612", "0.54880816", "0.5479833", "0.5479376", "0.547601", "0.5475359", "0.54752064", "0.5473961", "0.5472377", "0.5470406", "0.5468974" ]
0.0
-1
When a movie is clicked, this function is invoked and updates the state of the `selectedMovie` property to that movie
onMovieClick(movie) { this.setState({ selectedMovie: movie, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setSelectedMovie(movie) {\n this.setState({\n selectedMovie: movie\n });\n }", "selectedMovie(movie) {\n // Display selected movie\n this.displaySingleMovie(movie)\n }", "selectMovie(id) {\n this.movieById(movie => {\n this.selectedMovie(movie)\n }, id)\n }", "function loadSelectedMovie(pos) {\n loadMovieDescription(pos);\n if(useTrailers) loadTrailer(pos);\n postEvent('Selected movie', movies[pos]._id);\n updateHoveredMovies(movies[pos]._id);\n}", "function displaySelectedMovie(movieData) {\n movieSelectorContainer.style.display = \"none\";\n movieSelectedScreen.style.display = \"block\";\n\n var posterUrl = \"https://image.tmdb.org/t/p/w500\" + movieData.poster_path;\n\n var filmTitle = document.getElementById(\"film-title\");\n filmTitle.textContent = movieData.original_title;\n var posterImage = document.getElementById(\"poster\");\n posterImage.setAttribute(\"src\", posterUrl);\n var ageCertificate = document.getElementById(\"age\");\n ageCertificate.textContent = movieData.adult;\n ageCertificate.style.color = \"orange\";\n var countryLanguage = document.getElementById(\"country\");\n countryLanguage.textContent = movieData.original_language;\n countryLanguage.style.color = \"orange\";\n var yearReleased = document.getElementById(\"year-released\");\n yearReleased.textContent = movieData.release_date;\n yearReleased.style.color = \"orange\";\n var filmSynopsis = document.getElementById(\"synopsis\");\n filmSynopsis.textContent = movieData.overview;\n filmSynopsis.classList.add(\"filmSynopsis\");\n document\n .getElementById(\"back-btn\")\n .addEventListener(\"click\", function goBack() {\n window.history.back();\n });\n document.getElementById(\"save-btn\").addEventListener(\"click\", function (e) {\n e.preventDefault();\n saveFilmHistory(movieData.id);\n });\n}", "function selectSeat(e) {\n //find the selected movie\n if (e.target.className === \"seat\") {\n e.target.classList.add(\"selected\")\n addUI()\n } else if (e.target.className === \"seat selected\") {\n e.target.classList.remove(\"selected\")\n removeUI()\n }\n}", "getChosenMovie () {\n\t\t\t\treturn chosenMovie;\n\t\t\t}", "function getSelectedMovie(id, movieArr){\n\tvar selectedMovie;\n\tfor(var x=0; x<movieArr.length; x++){\n\t\tif(movieArr[x].id == id){\n\t\t\tselectedMovie=movieArr[x];\n\t\t}\n\t}\n\treturn selectedMovie;\n}", "async function handleClick(imdbID) {\n console.log(\"user clicked on : \" + imdbID)\n //call the api and set the data in 'selectedMovieDetail' state\n try {\n var url =\n ApiDetails.BASEURL +\n ApiDetails.APIKEY +\n ApiDetails.PARAMETER_SEPERATOR +\n ApiDetails.BY_ID.replace(\"<ID_TO_SEARCH>\", imdbID)\n console.log(url)\n const response = await Axios.get(url)\n //console.log(response.data)\n setSelectedMovieDetail(response.data)\n } catch (err) {\n setSelectedMovieDetail({})\n console.log(\"Error occurred! \" + err)\n }\n //open the dialog\n setDialogOpen(true)\n }", "changeMovieWatched(movieClicked){\n // change movie.watched property:\n movieClicked.watched = !movieClicked.watched;\n\n // update state.movies with the updated movie:\n this.setState((state) => {\n return {\n movies: state.movies\n .filter(\n movie => movie.title !== movieClicked.title\n )\n .concat(movieClicked)\n }\n })\n \n }", "onOptionSelection(movie) {\n document.querySelector(\".tutorial\").classList.add(\"is-hidden\");\n onMovieSelection(movie, document.querySelector(\"#left-summary\"), \"left\");\n }", "function movieSelected(id) {\n sessionStorage.setItem('movieId', id);\n window.location = './movie.html';\n return false;\n}", "function movieVariable() {\n\n $(\".movie-selected\").on('click', function() {\n var movie_id = $(this).attr(\"data\");\n localStorage.setItem('selected_movie', movie_id);\n });\n }", "onOptionSelection(movie) {\n document.querySelector(\".tutorial\").classList.add(\"is-hidden\");\n onMovieSelection(movie, document.querySelector(\"#right-summary\"), \"right\");\n }", "function getMovieData(e) {\n // Retrieve local storage - Movies\n var getMovieData = JSON.parse(localStorage.getItem(\"film\"));\n var movieId = e.target.getAttribute(\"data-id\");\n var selected = getMovieData.filter((film) => film.id === parseInt(movieId));\n\n if (selected.length > 0) {\n selected = selected[0];\n }\n hideMovie.classList.remove(\"hidden\");\n movieTitle.textContent = selected.original_title;\n overviewDiv.textContent = selected.overview;\n\n var movieposter = \"https://image.tmdb.org/t/p/w500/\" + selected.poster_path;\n MovieImage.src = movieposter;\n}", "function displayMovie(event){\n let target = event.target || event.srcElement;\n\n // Retrieves title if parent element selected\n if(target.className == \"movie\"){\n target = target.getElementsByClassName(\"title\")\n target = target[0];\n }\n\n // sends an API request for the specific movie to be displayed\n searchByTitle(target).then(result => {\n let movies = result[\"Title\"];\n displayMovieResult(result);\n });\n}", "onSelectActor(item) {\n this.selectedActor = item;\n }", "function movieSelected(id) {\n sessionStorage.setItem(\"movieId\", id);\n window.location = \"movie.html\";\n return false;\n}", "handleClick(movie) {\n console.log('CLICKED MOVIE:', movie);\n if (!this.props.favorites.includes(movie.id)) {\n this.props.saveMovie(movie);\n } else {\n this.props.deleteMovie(movie);\n }\n \n }", "function movieVariable(){\r\n\r\n $(\".movie-selected\").on('click', function(){\r\n var movie_id = $(this).attr(\"data\");\r\n localStorage.setItem('selected_movie', movie_id);\r\n });\r\n}", "function handleClick(movie){\n console.log(movie)\n localStorage.setItem('movieData',JSON.stringify(movie))\n history.push('/movie')\n }", "function onClick(e) {\r\n // Pause the animation\r\n story.pauseAnimation();\r\n // If it is already selected resume the animation\r\n // otherwise pause and move to the selected month\r\n if (e.yValue === story.getFrameValue()) {\r\n story.startAnimation();\r\n } else {\r\n story.goToFrame(e.yValue);\r\n story.pauseAnimation();\r\n }\r\n }", "function tmdbSelectedMovie(id) {\n $.getJSON(\n `${trendingApi.detailsBase}movie/${id}?api_key=${trendingApi.key}&language=en-US` // accesses api data\n ).then(function (detailsResponse) {\n let movieImdb = detailsResponse.imdb_id; // stores particilar data needed within a variable\n selectedMovie(movieImdb); // performs next function, selectedMovie() on search.js page\n });\n}", "chooseVideo(selected) {\n this.setState({\n selectedVideo: selected\n });\n }", "function movieSelected(id) {\n sessionStorage.setItem(\"movieID\", id);\n window.location = \"movie_info.html\";\n return false;\n}", "function onClick(e) {\n // Pause the animation\n story.pauseAnimation();\n // If it is already selected resume the animation\n // otherwise pause and move to the selected month\n if (e.yValue === story.getFrameValue()) {\n story.startAnimation();\n } else {\n story.goToFrame(e.yValue);\n story.pauseAnimation();\n }\n }", "function select(){\n // function executes when movie is cliked\n\t$(\".result\").click(function(event){\n\t\t\n\t\t// pull movie ID when element is clicked\n\t\tdocument.getElementById(\"choice\").innerHTML = \"<img id='exit' src='/img/exit.gif'/>\";\n\t\t\n\t\t// initiate GET request with omdb api through $.getJSON\n\t\tvar omdb = \"http://www.omdbapi.com/\"\n\t\tvar id = \"i=\" + event.target.id + \"&plot=full\";\t\t\n\t\t$.getJSON(omdb, id, function(data){\n\t\t\tvar info = [\"Title\", \"Year\", \"Runtime\", \"Genre\", \"Director\", \"Actors\", \"imdbRating\", \"Plot\"];\n\t\t\tvar JSON = [data.Title, data.Year, data.Runtime, data.Genre, data.Director, data.Actors, data.imdbRating, data.Plot];\n\t\t\tvar imdbID = data.imdbID;\n\t\t\t\n\t\t\t// instantiate poster\n\t\t\t$(\"#choice\").append(\"<img alt='poster' class='poster' src='\" + data.Poster + \"'/>\");\t\t\t\n\t\t\t\n\t\t\t// loops through JSON data to instantiate movie info\n\t\t\tfor (var i = 0, j = 15; i < info.length; i++, j+=25){\n\t\t\t\t$(\"#choice\").append(\"<div class='info' style='top: \" + j + \"px;'>\" + info[i] + \": \" + JSON[i] + \"</div>\");\n\t\t\t}\n\t\t\t$(\"#choice\").append(\"<button id='select' type='submit'>Add to List</button>\");\t\t\t\n\t\t\t$(\"#choice\").fadeIn();\n\n // sends movie data to php server via AJAX call once \"Add to List\" button is clicked\n\t\t\t$(\"#select\").click(function(){\n\t\t\t $.ajax({\t\t\t \n\t\t\t url: \"search.php\",\n\t\t\t method: \"POST\",\n\t\t\t dataType: \"text\",\n\t\t\t data: \"title=\" + data.Title + \"&year=\" + data.Year + \"&runtime=\" + data.Runtime +\n\t\t\t \"&genre=\" + data.Genre + \"&director=\" + data.Director + \"&actors=\" + data.Actors +\n\t\t\t \"&rating=\" + data.imdbRating + \"&plot=\" + data.Plot + \"&poster=\" + data.Poster + \"&imdbID=\" + imdbID, \n\t\t\t success: function(){\n\t\t\t $(\"#choice\").hide();\n\t\t\t\t $(\"#confirm\").fadeIn();\n\t\t\t\t setTimeout(function(){$(\"#confirm\").fadeOut()}, 1500);\n\t\t\t }\t\t\t \n\t\t\t });\t\t\t \n\t\t\t event.preventDefault();\t\t\t\t\t\t\n\t\t\t});\n\t\t});\t\n\t\t\n\t\t// closes window if exit button is clicked\n\t\t$(\"#exit\").click(function(){\n\t\t\t$(\"#choice\").hide();\n\t\t});\t\t\n\t});\t\n}", "componentDidMount(){\n for ( let movie of this.props.movies ) {\n if ( movie.id === this.props.selectedMovie ) {\n this.setState({\n ...this.state,\n title: movie.title,\n description: movie.description,\n })\n }\n }\n }", "function selectedMovie(id) {\n $.when(sessionStorage.setItem(\"movieId\", id)).then(getMovie);\n}", "function movieSelected(id) {\n sessionStorage.setItem(\"movieId\", id);\n location.replace(\"movie-page.html\");\n return false;\n}", "onClickGalleryCell(id) {\n this.selectedMovieService.movie = this.currentMoviesService.movies\n .filter(movie => movie.id === Number(id))[0];\n }", "temporaryMovie(movie) {\n this.displaySingleMovie(movie)\n }", "function movieSelected(id) {\n\n sessionStorage.setItem('movieId', id);\n window.location = 'movie.html';\n\n return false;\n}", "onVideoEntryClick(vid) {\n\n this.setState({\n // grab index to selected video in exampleVideoData array\n currentVideo: vid\n });\n }", "function openMovie(id) {\n dispatch({\n type: GET_MOVIE_REQUEST,\n id,\n });\n }", "function movieSelected(id) {\r\n sessionStorage.setItem('movieId', id);\r\n window.location = 'movie.html'\r\n return false;\r\n}", "function genreSelected(genreId) {\n // TODO: fetch movies matching the given genreId\n // `https://movie-api.cederdorff.com/wp-json/wp/v2/posts?_embed&categories=${genreId}`\n}", "function showMovieDetails(movie)\n{\n movieTitle.html(movie.title);\n movieDesc.html(movie.description);\n moviePoster.attr(\"src\", movie.posterImage.attr(\"src\"));\n movieView.on(\"click\", function() {\n window.location.href = \"/movie.html?imdb=\" + movie.imdb;\n });\n\n // Show info to user\n movieDetails.modal(\"show\");\n}", "handleMoodClick(movie) {\n this.setState({ movies: [movie] });\n //change movieCard display to give option for tagging with moods\n this.setState({ giveMoodButtons: true });\n }", "function movieSelected(id) {\n sessionStorage.setItem('movieId', id);\n window.location = \"movieresult.html?\" + id;\n return false;\n}", "playMovie() {\n console.log(\"begin playing movie\");\n this.reset();\n this.movieArray.splice(-1, 1);\n this.movie = true;\n this.movieIndex = 0;\n this.states = STATES.READY_TO_PICK_PIECE;\n }", "onChangeMovieName(e) {\n //when the valuse changes - update state\n this.setState({\n Title: e.target.value\n });\n }", "function movieSelected(id) {\r\n var tvdbID = getTvdb(id);\r\n if (tvdbID !== '') {\r\n sessionStorage.setItem('tvdbID', tvdbID);\r\n }\r\n sessionStorage.setItem('movieId', id);\r\n if (document.getElementById(id + 'inCollection')) {\r\n sessionStorage.setItem('inCollection', true);\r\n } else {\r\n sessionStorage.setItem('inCollection', false);\r\n }\r\n var searchedFor = $('#searchText').val();\r\n window.location = 'info.html?q=' + searchedFor;\r\n return false;\r\n}", "function getMovies(query) {\n $.getJSON(\n `${movieApi.base}?s=${query}&apikey=${movieApi.key}`\n ) /* .getJSON method retrieves data from an external api */\n .then(function (response) {\n if (response.Response === \"True\") {\n let movies =\n response.Search; /* the api is stored in arrays, here a new var is created to select the particular array needed */\n let output = \"\";\n /* for each of the responses in JSON output html to the webpage */\n $.each(movies, function (index, movie) {\n output += `\n <div class=\"col-sm-6 col-md-4 col-lg-3\">\n <div class=\"search-card text-center\">\n <img src=\"${movie.Poster}\"/> \n <h4 class=\"white\" >${movie.Title}</h4>\n <a onclick=\"selectedMovie('${movie.imdbID}')\" class=\"details-button hvr-shutter-out-horizontal red\" href=\"#\" data-toggle=\"modal\" data-target=\"#modal\">Movie Details</a>\n </div>\n </div>\n `;\n });\n\n /* outputs the html to the div with #movies-to-collapse */\n $(\"#movies-to-collapse\").html(output);\n\n $(\".collapse-button-m\").show();\n } else {\n alert(\"Movie not found! Please enter a valid movie title or word.\")\n }\n\n })\n}", "function handleClickedVideo(vid, videoTitle, id) {\n console.log(`id to set active ${vid}`);\n setActiveVideo({\n id: vid,\n key: id,\n title: videoTitle\n });\n }", "function Movie(title, runTime, yearReleased, genre, description) {\n this.title = title;\n this.runTime = runTime;\n this.yearReleased = yearReleased;\n this.genre = genre;\n this.description = description;\n this.checkedIn = true;\n}", "function setMovieData(movieIndex, moviePrice) {\n // 3.Add received value from our selection to localstorage. Cache memory\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\n}", "function thisMovie(movieName) {\n}", "onVideoListEntryTitleClick(newCurrentVideo) {\n this.setState({\n currentVideo: newCurrentVideo\n });\n }", "editMovie(movie) {\n this.props.editMovie(movie);\n\n if (!this.state.errors) {\n this.closeEditingMode();\n }\n }", "onVideoClick (video) {\n this.setState ({\n singleVideo: video\n });\n }", "function movieSelected(id){\n\tsessionStorage.setItem(\"movieId\", id);\n\twindow.open(\"../integrador/detalle.html\");\n\t// return false;\n}", "function tmdbSelectedShow(id) {\n $.getJSON(\n `${trendingApi.detailsBase}tv/${id}/external_ids?api_key=${trendingApi.key}&language=en-US` // the api needs two functions to retrieve imdb id for tv shows and movies as they are seperate calls\n ).then(function (detailsResponse) {\n let showImdb = detailsResponse.imdb_id;\n selectedMovie(showImdb);\n });\n}", "function chosenMovie(userMovieInput){\n request(`http://www.omdbapi.com/?t=${userMovieInput}&y=&i=&plot=short&tomatoes=true&r=json`, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var parseUserInput = JSON.parse(body)\n var movieOutput = \"Movie Title: \" + parseUserInput.Title + \"\\n\" +\n \"Year Release: \" + parseUserInput.Year + \"\\n\" +\n \"Country Produced: \" + parseUserInput.Country + \"\\n\" +\n \"Language: \" + parseUserInput.Language + \"\\n\" +\n \"Plot: \" + parseUserInput.Plot + \"\\n\" +\n \"Actors: \" + parseUserInput.Actors + \"\\n\" +\n \"IMBD Rating: \" + parseUserInput.imdbRating + \"\\n\" +\n \"Rotten Tomatoes Rating: \" + parseUserInput.tomatoRating + \"\\n\" +\n \"Rotten Tomatoes URL: \" + parseUserInput.tomatoURL + \"\\n\";\n // console.log(movieOutput);\n logText(movieOutput);\n }\n // Reenable the start prompt until the user exits the app.\n start();\n });\n}", "function book_ticket() {\n let selected_movie = event.target.id\n localStorage.setItem(\"movie_id\", selected_movie)\n window.location = \"book_seat.html\"\n}", "function setMovieData(movieIndex, moviePrice){\n localStorage.setItem('selectedMovieIndex', movieIndex)\n localStorage.setItem('selectedMoviePrice', moviePrice)\n}", "function movies() {\n\tif (moviesClicked == false) {\n\t\tdocument.getElementById('moviesGo').src=moviesGif.src;\n\t\tmoviesClicked = true;\n\t} else {\n\t\tdocument.getElementById('moviesGo').src=moviesJpeg.src;\n\t\tmoviesClicked = false;\n\t}\n}", "function getMovie() {\n //GETTING THE ID FROMSESSION STORAGE\n let movieId = sessionStorage.getItem(\"movieId\");\n axios\n .get(\"https://www.omdbapi.com?apikey=af465f0e&i=\" + movieId)\n .then(response => {\n console.log(response);\n let movie = response.data;\n let imdbid = movie.imdbID;\n // UPDATING THE UI WITH THE SELECTED MOVIE INFO\n let output = `\n\n <div class=\"container__single\">\n <div class=\"container__single__img\">\n <img class=\"img__single\" src=\"${movie.Poster}\"\n alt=\"\" />\n </div>\n <div class=\"container__single__details\">\n <h1 class=\"container__single__details-name\">${movie.Title}</h1>\n <div class=\"container__single__details-details\">\n <div class=\"details-year\" title=\"Release Date\">\n <img src=\"img/calendar.svg\" class=\"icon\"> ${movie.Year}\n </div>\n <div class=\"details-director\" title=\"Movie Director\">\n <img src=\"img/announcer.svg\" class=\"icon\"> ${movie.Director}\n </div>\n <div class=\"details-time\" title=\"Total time\">\n <img src=\"img/time.svg\" class=\"icon\"> ${movie.Runtime}\n </div>\n <div class=\"details-rating\" title=\"Internet Movie Database Value\">\n <img src=\"img/award.svg\" class=\"icon\">\n </div>\n <div class=\"details-rating\" title=\"Internet Movie Database Value\">\n <img src=\"img/cinema.svg\" class=\"icon\">${movie.Genre}\n </div>\n </div>\n <div class=\"container__single__details-plot\">\n ${movie.Plot}\n </div>\n <div class=\"container__single__buttons\">\n <a href=\"https://www.imdb.com/title/${\n movie.imdbID\n }\" target=\"_blank\" title=\"IMDB\" class=\"button details__imdb\">\n IMDB <span class=\"imdb__score\">${\n movie.imdbRating\n }</span>\n </a>\n <a href=\"${\n movie.Website\n }\" title=\"\" target=\"_blank\"class=\"button details__imdb\">WEBSITE\n </a>\n <a href=\"#\" title=\"IMDB\" class=\"button details__imdb\" onclick=\"openModal('${imdbid}')\">\n <img src=\"img/cinema.svg\" alt=\"CINEMA\" class=\"icon\"> <span class=\"imdb__score\">MOVIE</span>\n </a>\n </div>\n <a class=\"button details__go-back\" href=\"index.html\">\n BACK\n </a>\n </div>\n </div>\n `;\n document.querySelector(\".container\").innerHTML = output;\n })\n .catch(err => {\n console.log(err);\n });\n}", "showModalHandler(movie, modalType) {\n let movieId;\n if (movie === null) movieId = -1;\n else movieId = movie.imdbID;\n this.setState({\n currentMovieId: movieId,\n currentMovie: movie,\n modalType: modalType,\n showModal: true\n });\n }", "render() {\n const { movies, user } = this.state;\n if (!user) return <LoginView onLoggedIn={user => this.onLoggedIn(user)} />;\n if (!movies) return <div className=\"main-view\"/>;\n\n\n return (\n <div className=\"main-view\">\n <Container>\n <Row>\n {selectedMovie ? (\n <MovieView\n movie={selectedMovie}\n previous={(movie) => this.onMovieClick(!movie)}\n />\n ) : (\n movies.map((movie) => (\n <Col key={movie._id} xs={12} sm={6} md={4}>\n <MovieCard\n key={movie._id}\n movie={movie}\n click={(movie) => this.onMovieClick(movie)}\n />\n </Col>\n ))\n )}\n </Row>\n </Container>\n\n </div>\n );\n }", "setMovies(state, movies) {\n state.movies = movies\n }", "function movieClicked(id, poster) {\n\tmodal.classList.add(\"expand\");\n\tmodal.style.display = \"block\";\n\tmodalContent.innerHTML = ``;\n\n\t(async () => {\n\t\tconst videos = await app.getVideos(id);\n\t\tconst trailer = videos.find(video => video.type === 'Trailer');\n\t\tconst youTubeUrl = trailer ? 'https://www.youtube.com/embed/' + trailer.key + '?autoplay=1' : undefined;\n\n\t\tconst reviews = await app.getReviews(id);\n\t\tconst twoReviews = reviews.slice(0, maxQueryResults);\n\n\t\tconst similarMovies = await app.getSimilarMovies(id);\n\n\n\t\tconst firstRowElement = createElement(\"div\", \"top-row\")\n\n\t\t// Display Poster\n\t\tconst posterElement = createElement(\"div\", \"poster-md\");\n\t\tposterElement.innerHTML = `\n\t\t\t<img width=\"367\" src=\"${poster}\" onclick=\"closeModal()\" />\n\t\t`\n\t\tfirstRowElement.append(posterElement);\n\n\t\t// Display Trailer\n\t\tconst videoElement = createElement(\"div\", \"details\");\n\t\tif (youTubeUrl) {\n\t\t\tvideoElement.innerHTML = `\n\t\t\t\t<iframe id=\"ytplayer\" type=\"text/html\" width=\"900\" height=\"550\"\tsrc=\"${youTubeUrl}\"\tframeborder=\"0\" allow='autoplay'></iframe>\n\t\t\t`;\n\t\t} else {\n\t\t\tvideoElement.innerHTML = `\n\t\t\t\t<span class=\"trailer-not-found\"> We're sorry, trailer not found :( </span>\n\t\t\t\t<video width=\"900\" height=\"400\" controls>\n\t\t\t\t\t<source src=\"\" type=\"video/mp4\">\n\t\t\t\t</video>\n\t\t\t`;\n\t\t}\n\t\tfirstRowElement.append(videoElement);\n\t\tmodalContent.append(firstRowElement);\n\n\t\t// Display Reviews\n\t\tconst reviewsElement = createElement(\"div\", \"reviews\");\n\t\ttwoReviews.forEach(review => {\n\t\t\tconst date = new Date(review.updated_at);\n\t\t\tconst reviewElement = createElement(\"div\", \"review\");\n\t\t\treviewElement.innerHTML = `\n\t\t\t\t<div class=\"top-header\">\n\t\t\t\t\t<span class=\"material-icons-outlined\">${'rate_review'}</span>\n\t\t\t\t\t<span class=\"date\">${date.toLocaleDateString()}</span>\n\t\t\t\t</div>\n\t\t\t\t<h2> ${review.author} <i class=\"header\"> wrote:</i> </h2>\n\t\t\t\t<p class=\"truncate\">${review.content}</p>\n\t\t\t\t<button class=\"read-more\" onclick=\"window.open('${review.url}', '${\"_blank\"}');\">\n\t\t\t\t\t<span class=\"text\">read more</span>\n\t\t\t\t\t<span class=\"material-icons-outlined\">${'read_more'}</span>\n\t\t\t\t</button>\n\t\t\t`;\n\t\t\treviewsElement.append(reviewElement);\n\t\t});\n\t\tfirstRowElement.append(reviewsElement);\n\n\t\t// Display Similar Movies\n\t\tconst similarElements = createElement(\"div\", \"similar-movies\");\n\t\tsimilarMovies.forEach((movie) => {\n\t\t\tconst similarMovie = new Movie(movie);\n\t\t\tconst viewPoster = IMG_URL + similarMovie.posterPath;\n\t\t\tconst yearOfRelease = similarMovie.yearOfRelease ? '(' + similarMovie.yearOfRelease.split('-')[0] + ')' : '';\n\n\t\t\tconst movieElement = createElement(\"div\");\n\t\t\tmovieElement.innerHTML = `\n\t\t\t\t<div class=\"similar-movie\">\n\t\t\t\t\t<img src=\"${viewPoster}\" alt=\"${similarMovie.title}\" />\n\t\t\t\t</div>\n\t\t\t`;\n\n\t\t\tsimilarElements.appendChild(movieElement);\n\t\t});\n\t\tmodalContent.append(similarElements);\n\n\t})();\n\n}", "function movieDetails(id){\n sessionStorage.setItem('movieId', id);\n window.location = 'movieDetails.html';\n\n console.log('Movie selected');\n getMovieDetails();\n return false;\n}", "function setMovieData(moiveIndex,moviePrice){\n localStorage.setItem('selectedMovieIndex',moiveIndex);\n localStorage.setItem('selectedMoviePrice',moviePrice);\n}", "render() {\n return (\n <ul className=\"movies\">\n {this.props.movies.map((movie) => {\n return (\n <li className=\"movie_item\" onClick={(e) => {console.log(e.currentTarget); this.addFav(e.currentTarget)}}>\n <img src={`https://image.tmdb.org/t/p/w185_and_h278_bestv2${movie.poster_path}`} />\n <div className=\"movie_description\">\n <h2>{movie.title}</h2>\n <section className=\"movie_details\">\n <div className=\"movie_year\">\n <span className=\"title\">Year</span>\n <span>{movie.release_date.slice(0,4)}</span>\n </div>\n <div className=\"movie_rating\">\n <span className=\"title\">Rating</span>\n <span>{movie.vote_average}</span>\n </div>\n </section>\n </div>\n </li>\n )\n }\n )\n }\n </ul>\n );\n }", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex);\n localStorage.setItem('selectedPriceIndex', `moviePrice`);\n}", "openFilmDetails(filmId) {\n this.hideFavoriteList();\n\n this.elem.modalContent.innerHTML =\n this.modalContentTemplate(this.fullList.find(film => film.id === filmId));\n\n this.elem.modalContent.querySelector('.js-fav-state-toggler')\n .addEventListener('click', (e) => {\n const btn = e.target.closest('.js-fav-state-toggler');\n\n this.toggleFilmFavoriteState(filmId);\n\n this.favFilmsIdList.indexOf(filmId) === -1\n ? btn.classList.remove(this.class.modalStar.fav)\n : btn.classList.add(this.class.modalStar.fav);\n });\n\n this.elem.modal.classList.remove(this.class.modal.hidden);\n this.elem.modal.classList.add(this.class.modal.fadeIn);\n }", "function setMovieData(movieIndex, moviePrice){\n\tlocalStorage.setItem('selectedMovieIndex', movieIndex);\n\tlocalStorage.setItem('selectedMoviePrice', moviePrice);\n\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex)\n localStorage.setItem('selectedMoviePrice', moviePrice)\n}", "function handleClick(values){\n setSceneItemSelected(values.sceneId)\n setActiveChapter({\n ChapterName: values.ChapterName,\n ChapterDescr: values.ChapterDescr\n })\n }", "function Movie(title,newRelease,times) {\n this.title = title;\n this.newRelease = newRelease;\n this.times = times; \n}", "displaySingleMovie(movie) {\n // console.log('MOVIE IS DISPLAYED')\n\n this.movieEl.movieName.innerHTML = movie.original_title\n this.movieEl.movieTagline.innerHTML = movie.tagline\n this.movieEl.movieStory.innerHTML = movie.overview\n this.movieEl.movieGenre.innerHTML = this.movieDataStructuring(movie.genres, 'name')\n this.movieEl.movieProduction.innerHTML = this.movieDataStructuring(movie.production_companies, 'name')\n this.movieEl.movieReleaseDate.innerHTML = movie.release_date\n this.movieEl.movieIncome.innerHTML = `$${movie.revenue}`\n this.movieEl.voteAverage.innerHTML = `${movie.vote_average} / 10`\n this.movieEl.runningTime.innerHTML = `${movie.runtime} mins`\n this.movieEl.moviePoster.src = `https://image.tmdb.org/t/p/original${movie.poster_path}`\n this.movieEl.body.style.backgroundImage = `url(https://image.tmdb.org/t/p/original${movie.backdrop_path})`\n }", "function saveMovie() {\n var chosenMovie = movies.results[randommovie];\n var savedMovie = localStorage.getItem(\"film\");\n if (!savedMovie || savedMovie === null || savedMovie === \"null\") {\n savedMovie = [];\n } else {\n savedMovie = JSON.parse(savedMovie);\n }\n var selected = savedMovie.filter(\n (film) => film.id === movies.results[randommovie].id\n );\n\n if (selected.length > 0) {\n return;\n }\n // Save new favourite movie into local storage and create button\n savedMovie.push(chosenMovie);\n localStorage.setItem(\"film\", JSON.stringify(savedMovie));\n var newMovie = document.createElement(\"button\");\n newMovie.classList.add(\"favouritesBtn\");\n newMovie.textContent = chosenMovie.original_title;\n newMovie.setAttribute(\"data-id\", chosenMovie.id);\n favMovies.appendChild(newMovie);\n}", "function movieData(movieIndex, moviePrice) {\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\n}", "function Movie(displayTitle, mmpaRating, criticsPick) {\n this.displayTitle = displayTitle;\n this.mmpaRating = mmpaRating;\n this.criticsPick = criticsPick;\n // this.byLine = byLine;\n // this.headline = headline;\n // this.summaryShort = summaryShort;\n // this.publicationData = publicationData;\n // this.openingDate = openingDate;\n // this.link = link;\n // this.dateUpdated = dateUpdated;\n // this.ultimedia = ultimedia;\n}", "function getMovie() {\n let movieID = sessionStorage.getItem(\"movieID\");\n\n // Making API Call Using AXIOS only for the movie user selected\n axios\n .get(\"https://www.omdbapi.com/?i=\" + movieID + \"&apikey=bfae7d3\")\n .then(res => {\n //Initial State\n let movie = res.data;\n\n // Outputting Selected Movies Details\n let output = `\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"${\n movie.Poster\n }\" class=\"img-fluid rounded mx-auto d-block\">\n </div>\n \n <div class=\"col-md-8\">\n <h2>${movie.Title}</h2>\n <div class=\"list-group\">\n <a href=\"#\" class=\"list-group-item list-group-item-action\"><strong>Genre:</strong> ${\n movie.Genre\n }</a>\n <a href=\"#\" class=\"list-group-item list-group-item-action list-group-item-primary\"><strong>Released:</strong>\n ${movie.Released}</a>\n <a href=\"#\" class=\"list-group-item list-group-item-action list-group-item-secondary\"><strong>Rated:</strong>\n ${movie.Rated}</a>\n <a href=\"#\" class=\"list-group-item list-group-item-action list-group-item-success\"><strong>IMDB Rating:</strong>\n ${movie.imdbRating}</a>\n <a href=\"#\" class=\"list-group-item list-group-item-action list-group-item-danger\"><strong>Rotten Tomatoes\n Rating:</strong> ${\n movie.Ratings[1].Value\n }</a>\n <a href=\"#\" class=\"list-group-item list-group-item-action list-group-item-warning\"><strong>Production:</strong>\n ${movie.Production}</a>\n <a href=\"#\" class=\"list-group-item list-group-item-action list-group-item-info\"><strong>Director:</strong>\n ${movie.Director}</a>\n <a href=\"#\" class=\"list-group-item list-group-item-action list-group-item-light\"><strong>Writer:</strong>\n ${movie.Writer}</a>\n <a href=\"#\" class=\"list-group-item list-group-item-action list-group-item-dark\"><strong>Actors:</strong>\n ${movie.Actors}</a>\n </div>\n </div>\n \n </div>\n \n <div class=\"row mt-3 mb-3\">\n <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12\"> \n <p class=\"h4\">${movie.Plot}</p>\n <hr class=\"bg-info\">\n <a href=\"http://imdb.com/title/${\n movie.imdbID\n }\" target=\"_blank\" class=\"btn btn-success\">View IMDB</a>\n <a href=\"index.html\" class=\"btn btn-info float-right\">Go Back To Search</a>\n </div>\n </div>\n \n `;\n\n // Rendering Data to the page\n $(\"#movieInfo\").html(output);\n })\n\n // Checking for any error\n .catch(err => {\n console.log(err);\n });\n}", "function fetchMovie() {\n axi.get(\"/api/v1\").then(r => setMovie(r.data.movie));\n }", "onChangeMovieTitle(e) {\n this.setState({\n movie_title: e.target.value\n });\n }", "function searchmovie(){\n let searchText = $('#searchText').val();\n if(searchText != \"\"){\n axios.get('https://api.themoviedb.org/3/search/movie?api_key=f13549c92bee7e0f31569758e7396edb&query='+searchText)\n .then(response=>{\n $('#movies').html(\"\"); \n let films = response.data.results;\n let output = \"\";\n $.each(films, (index,film)=>{\n output += `\n <div class=\"col-md-3 movie\">\n <div class=\"text-center\">\n <img src=\"https://image.tmdb.org/t/p/w300/${film.poster_path}\" alt=\"${film.original_title}\"/>\n <h5 id=\"movieTitle\">${film.original_title}</h5>\n <button class=\"btn btn-primary\" onclick= \"alert('Please Sign In to Book Movie!')\" id=\"bookMovie\">Book</button>\n <button onclick=\"movieSelected('${film.id}')\" data-backdrop=\"static\" data-keyboard=\"false\" data-toggle=\"modal\" data-target=\"#myModal\" class=\"btn btn-primary\" id=\"movieDetails\" href=\"#\">Movie Details</button>\n </div>\n </div>\n `;\n });\n $(\".popMovies\").text(\"Movie Search Results\");\n $(\"#movies\").html(output);\n })\n .catch(error=>{\n console.log(error);\n });\n }\n \n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex); //setItem() creates a new key/value pair if none existed for key previously: syntax setItem(key, value)\n localStorage.setItem('selectedMoviePrice', moviePrice);\n}", "onChangeMovieYear(e) {\n //when the valuse changes - update state\n this.setState({\n Year: e.target.value\n });\n }", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex);\n localStorage.setItem('selectedMoviePrice', moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex);\n localStorage.setItem('selectedMoviePrice', moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex);\n localStorage.setItem('selectedMoviePrice', moviePrice);\n}", "function setMovieData(movieIndex, moviePrice) {\n localStorage.setItem('selectedMovieIndex', movieIndex);\n localStorage.setItem('selectedMoviePrice', moviePrice);\n}", "function setmovieData(movieIndex, moviePrice) {\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\n}", "function getMovies(searchText) {\n $.get(\n baseURL + searchName + searchText + \"&type=movie\",\n (respuesta, estado) => {\n if (estado === \"success\") {\n let movies = respuesta.Search;\n let output = \"\";\n $.each(movies, (i, movie) => {\n output += `\n <div class=\"col-md-3\">\n <div class=\"well text-center\">\n <img class=\"imgSearch\" src=\"${movie.Poster}\">\n <h5>${movie.Title}</h5>\n <a onclick=\"selectedMovie('${movie.imdbID}')\" class=\"btn btn-info\" href=\"#\">Mas info</a>\n </div>\n </div>\n \n `;\n });\n\n result.html(output);\n }\n }\n );\n}", "function setMovieData(movieIndex, moviePrice) {\r\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\r\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\r\n}", "onChangeMovieName(event) {\n this.setState({\n Title: event.target.value\n })\n }", "setSelectedScene(){\n this.selectedScene = this.sceneInventory[this.selectedSceneIcon.index];\n console.log(this.selectedScene);\n }", "onListItemClick(inputVid) {\n this.setState({\n video: inputVid,\n });\n }", "function selectMovies() {\n\n var type = Session.get('type');\n var search = Session.get('search');\n var sort = Session.get('sort');\n var filter = Session.get('filter') || {};\n\n\n\n // Update scroll position when the query changes -----------------------------\n var instantaneaousRepositionning = false;\n var query = [type, search, sort, filter.genre].join('|');\n if (query !== queryCache) {\n scroll = 0;\n scrollTo(0, 600);\n queryCache = query;\n instantaneaousRepositionning = true;\n }\n\n\n // TODO Loading icons, what happens if you search <2 letters\n\n\n // Load Data -----------------------------------------------------------------\n\n if (search.length > 1 && type === 'suggested') {\n // Global Search\n searchMovies(search, filter, sort);\n } else {\n lookupMovies(type, search, sort, filter, instantaneaousRepositionning);\n }\n}", "render(){\n const movies = this.props.reduxState.movies ? this.props.reduxState.movies : [];\n return (\n <>\n {/* mapping over the movies array, when movie poster is clicked show the description on the details page */}\n {movies.map((movie) => {\n return<><img src={movie.poster} onClick={() => this.handleClick(movie.id)}/>\n <p>{movie.description}</p></>\n })}\n </>\n )\n }", "function populateUI() {\n let selectedseats = JSON.parse(localStorage.getItem('Selected Seats'))\n console.log(selectedseats);\n if (selectedseats !== null && selectedseats.length > 0) {\n seats.forEach((seat, index) => {\n if (selectedseats.indexOf(index) > -1) {\n seat.classList.add('selected')\n }\n\n })\n\n let selctedmovie = localStorage.getItem('Movie')\n movieSelect.selectedIndex = selctedmovie\n\n\n\n }\n}", "function linkMovie(id) {\n const { location } = props;\n const { lng } = qs.parse(location.search);\n\n dispatch(resetMovieDetails());\n redirect(`/movies/${id}?${qs.stringify({ lng })}`);\n }", "function populateUI(){\r\n\r\nvar selectedSeats=JSON.parse(localStorage.getItem('selectedSeats'));\r\nif(selectedSeats!==null && selectedSeats.length>0){\r\n seats.forEach(function(seat,index){\r\n if(selectedSeats.indexOf(index) > -1)\r\n {\r\n seat.classList.add('selected');\r\n }\r\n })\r\n}\r\n\r\nvar movieIndex=localStorage.getItem('movieIndex');\r\nticketPrice=localStorage.getItem('moviePrice');\r\nif(movieIndex!==null)\r\n{\r\n movie.selectedIndex=movieIndex;\r\n}\r\n\r\n}", "function setMovieData(movieIndex, moviePrice) {\r\n localStorage.setItem('selectedMovieIndex', movieIndex);\r\n localStorage.setItem('selectedMoviePrice', moviePrice);\r\n}", "function setMovieData(movieIndex, moviePrice) {\r\n localStorage.setItem(\"selectedMovieIndex\", movieIndex);\r\n localStorage.setItem(\"selectedMoviePrice\", moviePrice);\r\n}" ]
[ "0.7750631", "0.7736081", "0.7163471", "0.67256916", "0.6488958", "0.64247245", "0.6397385", "0.63854253", "0.6332612", "0.6308762", "0.63058543", "0.6278801", "0.6277684", "0.62595034", "0.6229581", "0.62176365", "0.6200571", "0.6186401", "0.6181037", "0.61073023", "0.60980624", "0.6081581", "0.6068781", "0.6053863", "0.60513", "0.6042735", "0.60265803", "0.6013283", "0.6012679", "0.6005203", "0.5998721", "0.59715223", "0.5880912", "0.5880654", "0.58633214", "0.58595484", "0.58329695", "0.58253497", "0.5818975", "0.57908493", "0.5742908", "0.5741299", "0.5738326", "0.5682116", "0.568074", "0.5670961", "0.56522244", "0.5637892", "0.5632862", "0.5626783", "0.5608597", "0.55919445", "0.5591537", "0.55881554", "0.55870163", "0.55816853", "0.55672216", "0.55623555", "0.5550518", "0.55427027", "0.55321777", "0.5532007", "0.5517977", "0.5506701", "0.5505402", "0.54973197", "0.5495187", "0.54936475", "0.54916954", "0.5486233", "0.5482202", "0.5477804", "0.5464336", "0.54633963", "0.54577214", "0.54538107", "0.5450028", "0.54496956", "0.5445794", "0.5444074", "0.5444074", "0.5437323", "0.5434474", "0.54284066", "0.54284066", "0.54284066", "0.54284066", "0.54210943", "0.5419901", "0.5419258", "0.54152954", "0.5414178", "0.5409357", "0.5403547", "0.54023236", "0.5400863", "0.5397114", "0.5391398", "0.53886336", "0.5388296" ]
0.8339763
0
If there is a table at any of the affected pixels return false
function overlaps (xCord, yCord, size) { for (i = 0; i < size; i++) { for (j = 0; j < size; j++) { if (!currentMap[yCord + i][xCord + j] == 0) { return true } } } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isConflict(){\n let conflict = false; \n if( this.x < 0 || (this.x + this.width )> this.tableWidth ) conflict=true;\n if( (this.y - this.height + 1) < 0 ) conflict=true;\n if(conflict) this.undo();\n }", "function checkOccupied(cell){\n if(cell.querySelector(\"img\")) return true;\n else return false;\n}", "function checkIfThereIsALink(table, row) {\n for(var j=0; j < table[row].length; j++) {\n if(table[row][j] != 0) {\n for(var i=0; i < table.length; i++) {\n if(table[i][j] != 0) {\n for(var k=0; k < table.length; k++) {\n if(k!=row && table[k][j] != 0) return true;\n }\n }\n }\n }\n }\n return false;\n }", "function IsInTable() {\n var editor = GetCurrentEditor();\n try {\n var flags = editor.flags;\n return (\n IsHTMLEditor() &&\n !(flags & Ci.nsIEditor.eEditorReadonlyMask) &&\n IsEditingRenderedHTML() &&\n null != editor.getElementOrParentByTagName(\"table\", null)\n );\n } catch (e) {}\n return false;\n}", "function checkTie() {\n if (emptyCells().length === 0) {\n displayOverlay(\"It's a Tie!\");\n return true;\n }\n return false;\n}", "function checkDraw() {\n return currentCells.every(function (element) { return typeof element === 'string'; })\n}", "function isNotOverlappingTables(x, y) {\n return _.every(allTables, table => (x <= table.x) || ((table.x + table.w) <= x) || (y <= table.y) || ((table.y + table.h) <= y))\n }", "function getNotAnswered() {\n return $('tr:not(.hide-row) > td:nth-child(2) > img[src=\"images/spacer.gif\"]',\n window.frames[1].document).length;\n}", "function isFull(){\n let cells = $(\"td\");\n \n for (let i=0; i < cells.length; i++){\n if (cells[i].innerHTML == \"\"){\n return false;\n }\n }\n\n return true;\n }", "function IsDraw(cells) {\n // return cells.filter(c => c === null).length == 0;\n}", "function testCells() //Checks if all cells which are part of solution are colored.\n{\n for(var k=0; k<solutions.length; k++)\n {\n if(solutions[k].style.backgroundColor == \"gray\")\n {\n continue;\n }\n else {\n return false;\n }\n }\n return true;\n}", "function selectedNodeIsATableNode(dom,offsets,selNode){\n var retVal = false;\n\n switch (selNode.tagName){\n\n case \"TABLE\":\n case \"TR\":\n retVal = true;\n break;\n case \"TD\":\n case \"TH\":\n if ( !cursorIsInsideOfTableCell(dom,offsets,selNode) ){\n retVal = true;\n break;\n }\n default:\n break;\n\n }\n\n return retVal;\n\n}", "function isWin()\r\n{\r\n for(var i=0; i<size; i++)\r\n {\r\n for(var j=0; j<size; j++)\r\n {\r\n if((tableDuJeu[i][j] == 2048) && !win)\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "function isTableFull()\r\n {\r\n for(var row=0; row<3; row++)\r\n {\r\n for(var col=0; col<3; col++)\r\n {\r\n if(isEmptyCell(row, col))\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n }", "function cellIsAWall( i, j, cells )\n{\n var cellNum = (i * totalCols) + j;\n return $(cells[cellNum]).hasClass(\"wall\");\n}", "function allTablesHidden() {\n return $(\"table.hidden-table\").length == $(\"table.result\").length;\n}", "function isBlankPlace(table,current)\n{\n\tfor(var r=0;r<9;r++)\n\t{\n\t\tfor(var c=0;c<9;c++)\n\t\t{\n\t\t\tif(table[r][c]==0)\n\t\t\t{\n\t\t\t\tcurrent.row=r;\n\t\t\t\tcurrent.col=c;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "function cellIsAWall(i,j,cells) {\n\tvar cellNum = (i*(totalCols))+j;\n\treturn $(cells[cellNum]).hasClass(\"wall\");\n}", "function cellIsAWall(i,j,cells) {\n\tvar cellNum = (i*(totalCols))+j;\n\treturn $(cells[cellNum]).hasClass(\"wall\");\n}", "function cursorIsInsideOfTableCell(dom, offsets, cellNode){\n var isInsideOfCell = true;\n var allText = dom.documentElement.outerHTML;\n var cellOuterHTML = cellNode.outerHTML;\n var selStr = allText.substring(offsets[0],offsets[1]);\n \n if ( stripWhiteSpace(selStr) == stripWhiteSpace(cellOuterHTML) ){\n isInsideOfCell = false;\n }\n\n return isInsideOfCell;\n}", "_hasTable () {\n return 0 < this._tables.length;\n }", "function IsDraw(cells) {\n return cells.filter(c => c === null).length === 0;\n}", "function rowChecker() {\n var gap = false;\n var startWord = false;\n for(i = 0; i < 15; i++) {\n var current = $.grep(boardObj, function(e) {return e.boardPos === i}); // gets the position\n if (current.length == 1 && startWord == true) { // checks to see if the element has been used.\n return false;\n } else if (current.length == 0 && gap == true) {\n startWord = true;\n } else if (current.length == 1 && gap == false) {\n gap = true;\n }\n }\n return true;\n}", "function checkDraw() {\n for(i = 0; i < 7; i++){\n for(j = 0; j < 6; j++){\n if(grid[i][j] == null) \n return false;\n }\n }\n return true;\n}", "function checkDraw() {\n let y = 0;\n let td = document.querySelectorAll('td');\n for (let x = 0; x < td.length; x++) {\n if (td[x].innerHTML !== '') {\n y = y + 1;\n }\n if (y == 9) {\n displayWinner('draw');\n }\n\n }\n\n\n}", "function isDraw() {\n\treturn [...cellElements].every(cell => {\n\t\treturn cell.classList.contains(xClass) || \n\t\tcell.classList.contains(oClass)\n\t})\n}", "function hasTable(input)\n{\n\treturn (input.indexOf('<table>') != -1 && input.indexOf('</table>') != -1);\n}", "function show() {\n var bad = false;\n var tbody = document.createElement(\"tbody\");\n for (i = 0; i < dim; i++) {\n var tri = document.createElement(\"tr\");\n for (k = 0; k < dim; k++) {\n var ibody = document.createElement(\"tbody\");\n for (j = 0; j < dim; j++) {\n var trj = document.createElement(\"tr\");\n for (l = 0; l < dim; l++) {\n var text = show_cell(i, j, k, l);\n if (text == '?')\n bad = true;\n var node = document.createTextNode(text);\n var tdl = document.createElement(\"td\");\n if (board[i][j][k][l].set != previous[i][j][k][l].set)\n tdl.setAttribute(\"class\", \"changed\");\n tdl.setAttribute(\"align\", \"center\");\n tdl.appendChild(node);\n trj.appendChild(tdl);\n }\n ibody.appendChild(trj);\n }\n var itbl = document.createElement(\"table\");\n itbl.setAttribute(\"border\", 1);\n itbl.setAttribute(\"width\", \"100%\");\n itbl.appendChild(ibody);\n var tdk = document.createElement(\"td\");\n tdk.setAttribute(\"align\", \"center\");\n tdk.appendChild(itbl);\n tri.appendChild(tdk);\n }\n tbody.appendChild(tri);\n }\n var tbl = document.createElement(\"table\");\n tbl.setAttribute(\"border\", 1);\n tbl.setAttribute(\"align\", \"center\");\n tbl.appendChild(tbody);\n document.body.appendChild(tbl);\n window.scrollBy(0, 1000);\n duplicate(previous, board);\n return bad;\n}", "function isSafe(x, y) {\n if (x >= 0 && x < tileRowCount && y >= 0 && y < tileColumnCount && (tiles[x][y].state != 'w'))\n return true;\n\n return false;\n}", "deadGrid() {\n for(let col = 0; col < this.width; col ++) {\n for(let row = 0; row < this.height; row++) {\n if(this.grid[col][row] == ALIVE){\n return false\n }\n }\n }\n return true\n }", "function checkDiagUp(){\n let cell=table.rows[0].cells[0];\n for(let i=3; i<6; i++)\n {\n for(let j=3; j<7; j++)\n {\n cell=table.rows[i].cells[j];\n\n if(playerRed==true)\n {\n if(cell.isRed && table.rows[i-1].cells[j-1].isRed && table.rows[i-2].cells[j-2].isRed && table.rows[i-3].cells[j-3].isRed)\n {\n return(true);\n }\n }\n else\n {\n if(cell.isYellow && table.rows[i-1].cells[j-1].isYellow && table.rows[i-2].cells[j-2].isYellow && table.rows[i-3].cells[j-3].isYellow)\n {\n return(true);\n }\n }\n\n }\n }\n return(false);\n}", "function isInTable(row, column) {\r\n if (row >= 1 && row <= 9 && column >= 1 && column <= 9) {\r\n return true;\r\n }\r\n return false;\r\n}", "function check_back(){\n\tvar child = image.childNodes;\n\tfor(var i=0;i<16;i++){\n\t\tif(child[i].id!==\"_piece_\"+i) return false;\n\t}\n\treturn true;\n}", "function isCellEmpty(x, y)\r\n{\r\n let toolSymbolFor = getToolSymbolAt(x, y);\r\n if (toolSymbolFor == emptyImage)\r\n {\r\n return true;\r\n }\r\n return false;\r\n}", "function win()\n\t{\n\t\tvar col =document.getElementsByTagName(\"td\");\n\t\tvar won;\n\t\tfor(i=0;i<max;i++)\n\t\t{\n\t\t\tif(col[i].innerHTML!=correct[i])\n\t\t\t {\n\t\t\t won=false; \n\t\t\t break;\t\n\t\t\t }\n\t\t\telse \n\t\t\t{\n \t\t\t won=true;\t\n\t\t\t}\n\t\t}\n\t\treturn won;\t\n\t}", "validTable($table) {\n // if table nested inside another table, abort\n if ($table.find('table').length !== 0)\n return false;\n\n const numHeadersRows = TableUtils.getHeaderRows($table).length;\n const numDataRows = $table.find(\"tr\").toArray().length - numHeadersRows;\n\n return !this.disable_one_row || numDataRows > 1;\n }", "isFirstCellHidden(element, container)\n\t\t{\n\t\t\tif (! element[0]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n \tlet rect = element[0].getBoundingClientRect();\n \tlet threshold = container[0].getBoundingClientRect().left\n\n \treturn rect.right <= threshold;\n\t\t}", "function allFilled() {\n for (let i = 0; i < cell.length; i++) {\n if (cell[i].innerText === \"X\" || cell[i].innerText === \"O\") {/*Do nothing*/ }\n else\n return false;\n }\n\n return true;\n}", "function isGameOver()\r\n{\r\n if(caseBoitesRemplies < (size*size)) \r\n return false;\r\n\r\n for(var i=0; i<size; i++)\r\n {\r\n for(var j=0; j<size; j++)\r\n {\r\n if((tableDuJeu[i][j] == tableDuJeu[i+1][j]) && i<size-1) \r\n return false;\r\n \r\n if((tableDuJeu[i][j] == tableDuJeu[i][j+1]) && j<size-1) \r\n return false;\r\n }\r\n return true;\r\n }\r\n}", "function diagnolCheck1(){\n for (let col = 0; col < 4; col++){\n for (row = 0; row <3; row++){\n if (colorMatchCheck(tableRow[row].children[col].style.backgroundColor, tableRow[row+1].children[col+1].style.backgroundColor,\n tableRow[row+2].children[col+2].style.backgroundColor,tableRow[row+3].children[col+3].style.backgroundColor)){\n return true;\n }\n }\n}\n}", "function checkStatus()\n\t\t{\n\t\t\tvar count = $('.tile').length;\n\t\t\tif(count == 16)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function isSafe(emap, row, col, visited) {\n // Check there is no negative / overflow index\n return row >= 0 && row < len && col >= 0 && col < height \n && emap[row][col] > 0 && !visited[row][col];\n }", "function notOverflow(){\n\t\treturn table.getAttribute(tableWidthAtt) <= containerWidth-1;\n\t}", "function checkState(td) {\n if(td.hasClass('X') || td.hasClass('O')) {\n return 1;\n } else {\n return 0;\n }\n }", "function overflow(){\n\t\treturn table.offsetWidth > containerWidth+1;\n\t}", "function isolateVertical(tr, map, table, start, top, bottom, left, mapFrom) {\n if (left == 0 || left == map.width) { return false }\n var found = false;\n for (var row = top; row < bottom; row++) {\n var index = row * map.width + left, pos = map.map[index];\n if (map.map[index - 1] == pos) {\n found = true;\n var cell = table.nodeAt(pos), cellLeft = map.colCount(pos);\n var updatePos = tr.mapping.slice(mapFrom).map(pos + start);\n tr.setNodeMarkup(updatePos, null, removeColSpan(cell.attrs, left - cellLeft, cell.attrs.colspan - (left - cellLeft)));\n tr.insert(updatePos + cell.nodeSize, cell.type.createAndFill(removeColSpan(cell.attrs, 0, left - cellLeft)));\n row += cell.attrs.rowspan - 1;\n }\n }\n return found\n}", "isLastCellHidden(element, container)\n\t\t{\n\t\t\tif (! element[0]) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tlet rect = element[0].getBoundingClientRect();\n\t\t\tlet threshold = container[0].getBoundingClientRect().left + container[0].getBoundingClientRect().width;\n \t\n \tif (rect.left == 0 && threshold == 0) {\n \t\t// this means the stat table is currently hidden (user looking at different tab)\n \t\t// best we can do is just guess until it is actually scrolled on\n \t\treturn this.guesstimate();\n \t}\n \t\n \treturn rect.left >= threshold;\n }", "function checkDraw(){\n console.log(\"checkdraw called\");\n if(emptycells().length==0){\n \n $(\".cell\").each(function(i){\n if(!isChallenge){\n $(this).css({\n 'background-color':'black',\n }); \n }\n $(\".cell\")[i].removeEventListener('click',cellClick,false);});\n displayWinner('Tie');\n return true;\n }\n return false;\n}", "function checkTie(){\r\n \tif(emptysquares().length === 0) {\r\n \t\tfor(var i=0;i<cells.length;i++){\r\n \t\t\tcells[i].style.backgroundColor='green';\r\n \t\t\tcells[i].removeEventListener('click',turnClick,false);\r\n \t\t}\r\n \t\tdeclareWinner('Tie game')\r\n \t\treturn true;\r\n \t}\r\n \treturn false;\r\n }", "function hasOppositeChecker(row, col, color) {\n if ((row > 7) || (row < 0) || (col > 7) || (col < 0) || (occupiedArray[row][col] == null) || (occupiedArray[row][col].classList.contains(color))) {\n return false;\n }\n return true;\n}", "function checkTie()\n{\n\tif (emptySquares().length == 0) {\n\t\tfor (var i = 0; i < cells.length; i++) {\n\t\t\tcells[i].style.backgroundColor = \"green\";\n\t\t\tcells[i].removeEventListener('click', humanClicked, false);\n\t\t}\n\t\tdeclareWinner(\"Tie Game!\")\n\t\treturn true;\n\t}\n\treturn false;\n}", "function squareHasChecker(td) {\n \tif (td.hasClass('black') || td.hasClass('red')) {\n \t\treturn 1;\n \t} else {\n \t\treturn 0;\n \t}\n }", "function allFilled() {\n\treturn boards[0].every((val) => val != null); //Return true if td is filled else return false\n}", "function checkTable(barTableId){\n\t\tif (barTableId > 0){\n\t\t\tglobalTableId = barTableId ;\n\t\t\treturn true ;\n\t\t}\n\t\treturn false ;\n\t}", "function isTie() {\n for (var i = 0; i < tictactoe.board_total_spots; i++) {\n if (board[i] === undefined) {\n return 0;\n }\n }\n return 1;\n }", "function checkForTie(){\n var tie = true;\n for(var i=0; i<squares.length;i++) {\n if(!squares[i].style.backgroundImage) tie = false;\n };\n return tie;\n }", "gameIsFinished() {\n return this.rows[0].some(\n cell => cell.filled \n );\n }", "function checkColForSix() {\n for (i = 0; i < 24; i++) {\n //if we use indexes to draw our row, it would look like this\n let colOfSix = [\n i,\n i + width,\n i + 2 * width,\n i + 3 * width,\n i + 4 * width,\n i + 5 * width,\n ];\n //this is the color to eliminate\n let decidedColor = squares[i].style.backgroundImage;\n let isBlank = squares[i].style.backgroundImage === '';\n\n if (\n colOfSix.every(\n (index) =>\n squares[index].style.backgroundImage === decidedColor && !isBlank\n )\n ) {\n score += 24;\n play8BitSound();\n scoreDisplay.innerHTML = score;\n colOfSix.forEach((index) => {\n squares[index].style.backgroundImage = '';\n });\n }\n }\n }", "function check($cell){\n ['A','B','C'].forEach(function(dim){\n var failure = dim+'-failure',\n success = dim+'-success',\n cells = [];\n\n var c, d;\n \n // find the edge regex\n for (c = $cell; d = c.data('-'+dim); c = d) ;\n var regex = new RegExp('^'+ c.find('text').text() + '$');\n\n // find the row text\n while ((c = c.data('+'+dim)) && c.is('[class~=cell]'))\n cells.push(c);\n\n var str = cells.map(function(cell){ return $('text', cell).text(); }).join('');\n var $cells = $(cells).map(function(){ return this.toArray(); });\n\n if (str.length < $cells.length) {\n // incomplete\n $cells.removeClassSVG(success);\n $cells.removeClassSVG(failure);\n } else if (str.match(regex)) {\n // success\n $cells.addClassSVG(success);\n $cells.removeClassSVG(failure);\n } else {\n // failure\n $cells.addClassSVG(failure);\n $cells.removeClassSVG(success);\n }\n });\n }", "function test8() {\n currentPiece = new I();\n currentPiece.moveHor(1)\n updateGraphics();\n return !currentPiece.coords.some(x => board[x[0]][x[1]] !== currentPiece.color);\n}", "function table_check(values) {\n\t\tvar flag = true,\n\t\t\tcounter = 0,\n\t\t\tfinalCount = 0,\n\t\t\tarrTR = values.getElementsByTagName('TR'),\n\t\t\tlenTR = arrTR.length,\n\t\t\tx,\n\t\t\ty,\n\t\t\tarrTD,\n\t\t\tarrTD_len;\n\n\t\t// Check to see if we can use the table vertically...\n\t\t\tfor(x = 0; x < lenTR; x++) {\n\t\t\t\tcounter = 0;\n\t\t\t\tarrTD = arrTR[x].getElementsByTagName('TD');\n\t\t\t\tfor(y = 1, arrTD_len = arrTD.length; y < arrTD_len; y++) {\n\t\t\t\t\tif(isNaN(parseInt(arrTD[y].innerHTML))) {\n\t\t\t\t\t\tflag = false;\n\t\t\t\t\t}\n\t\t\t\t\tif(flag == false) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcounter++\n\t\t\t\t}\n\t\t\t\tfinalCount = counter;\n\t\t\t\tif(flag == false) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif (finalCount > 0) {\n\t\t\t\t//console.log(['vertical', finalCount]);\n\t\t\t\treturn ['vertical', finalCount];\t\n\t\t\t}\n\n\t\t// Check to see if we can use the table horizontally...\n\t\t\tflag = true;\n\t\t\tcounter = 0;\n\t\t\tfor(x = 1, arrTR = values.getElementsByTagName('TR'), lenTR = arrTR.length; x < lenTR; x++) {\n\t\t\t\tarrTD = arrTR[x].getElementsByTagName('TD');\n\t\t\t\tfor(y = 0, arrTD_len = arrTD.length; y < arrTD_len; y++) {\n\t\t\t\t\tif(isNaN(parseInt(arrTD[y].innerHTML))) {\n\t\t\t\t\t\tflag = false;\n\t\t\t\t\t}\n\t\t\t\t\tif(flag == false) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(flag == false) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcounter++;\n\t\t\t\t\n\t\t\t}\n\t\t\tif (counter > 0) {\n\t\t\t\t//console.log(['horizontal', counter]);\n\t\t\t\treturn ['horizontal', counter];\t\n\t\t\t}\n\n\t\t// If we get this far this means the table isn't two dimensional and we can't use it.\n\t\t\tthrow new Error(\"The submitted table element does not have data that can be used with a chart\");\n\t}", "function cell_valid(row, col) {\n return row >= 0 && row < 12 && col >= 0 && col < 12;\n}", "function isDisplayTableEmpty(){\n\t\tvar table = document.getElementById(\"displayTable\");\n\t\tvar rows = table.getElementsByTagName(\"tr\");\n\t\tif (rows.length > 1) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function cell_unblocked(grid, row, col) {\n if (grid[row][col] === 1) return true;\n else return false;\n}", "function isCollision(col, elem){\n var elementBottom = pixelToInt(elem.style.top) + pixelToInt(elem.style.height);\n var elementTop = pixelToInt(elem.style.top);\n\n for(var i = 0; i<col.length; i++){\n var eventBottom = pixelToInt(col[i].style.top) + pixelToInt(col[i].style.height);\n var eventTop = pixelToInt(col[i].style.top);\n\n if ((elementTop >= eventTop && elementTop < eventBottom) ||\n (elementBottom > eventTop && elementBottom <= eventBottom) ||\n (elementTop <= eventTop && elementBottom >= eventBottom) ) {\n return true;\n }\n }\n\n return false;\n }", "function test9() {\n currentPiece = new I();\n currentPiece.moveHor(-1)\n updateGraphics();\n return !currentPiece.coords.some(x => board[x[0]][x[1]] !== currentPiece.color);\n}", "function checkDiagDown(){\n let cell=table.rows[0].cells[0];\n for(let i=3; i<6; i++)\n {\n for(let j=0; j<4; j++)\n {\n cell=table.rows[i].cells[j];\n\n if(playerRed==true)\n {\n if(cell.isRed && table.rows[i-1].cells[j+1].isRed && table.rows[i-2].cells[j+2].isRed && table.rows[i-3].cells[j+3].isRed)\n {\n return(true);\n }\n }\n else\n {\n if(cell.isYellow && table.rows[i-1].cells[j+1].isYellow && table.rows[i-2].cells[j+2].isYellow && table.rows[i-3].cells[j+3].isYellow)\n {\n return(true);\n }\n }\n\n }\n }\n return(false);\n}", "function viewportChecker(elem) {\n let secPosition = elem.getBoundingClientRect();\n return (secPosition.top >= 0);\n}", "function checkIfContent(cellToTest, targetCellId){//c15 c23\n\t\n\tvar cellCondition = document.getElementById(targetCellId);\n\t\n\tif(cellToTest.value == null || cellToTest.value == 0){\n\t\tcellCondition.value=\"\";\n\t\tcellCondition.disabled = 'true';\n\t}\n\telse {\n\t\tcellCondition.disabled = '';\n\t\tcellCondition.focus();\n\t}\n\trefreshVars();\n\tTRGc137();\n\tTRGc149();\n\tif(cellToTest == c128){\n\t\tTRGc137();\n\t}\n\tif(cellToTest == c15){\n\t\tTRGc16();\n\t}\n\t\n}", "function hasEmptyCells() {\n // scan through all cells, looking at text content for empty spaces\n var empty_spaces = 0\n for (let i = 0; i < 9; i++) {\n if (all_squares[i].textContent == ''){\n // return true if an empty cell is identified\n empty_spaces += 1\n } \n }\n if (empty_spaces == 0){\n document.getElementById(\"winMsg\").textContent = \"It's a draw! The board is filled\";\n } else {\n console.log(`${empty_spaces} cells remain`)\n }\n}", "checkTie() {\n if (this.emptyCells().length === 0) {\n this.gameOver({\n index: -1,\n player: \"tie\"\n });\n return true;\n }\n return false;\n }", "function checkGameOver() {\r\n for (var i = 0; i < gBoard.length; i++) {\r\n for (var j = 0; j < gBoard[i].length; j++) {\r\n var cell = gBoard[i][j]\r\n if (!cell.isShown) {\r\n if (cell.isMarked) {\r\n if (!cell.isMine) return false;\r\n } else {\r\n return false\r\n }\r\n }\r\n }\r\n }\r\n return true\r\n}", "function containsAnnotations(elm) {\n var children = elm.children;\n var childrenLength = children.length;\n for (var i = 0; i < childrenLength; i++) {\n var child = children[i];\n var styles = window.getComputedStyle(child);\n if (styles.getPropertyValue(CSS_COL) != \"1\" || styles.getPropertyValue(CSS_ROW) != \"1\") { // IE will automatically determine that all elements are at (1, 1)\n return true;\n }\n }\n return false;\n }", "function check_for_win() {\r\n\t\t// check for empty cells , loop on whole array\r\n\t\tfor(var i=0; i<size; i++) {\r\n\t\t\tvar currentNumber = parseInt($(\"td:eq(\"+i+\")\").text());\r\n\t\t\tif(!($.isNumeric(currentNumber))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\t\r\n\r\n\t\t//loop on rows to check for each row sum\r\n\t\tfor(var i=0; i < rows; i++) {\r\n\t\t\tvar rowSum = 0;\r\n\t\t\tfor(var j=0; j < cols; j++) {\r\n\t\t\t\tvar currentIndex = i*cols + j;\r\n\t\t\t\trowSum += parseInt($(\"td:eq(\"+currentIndex+\")\").text());\r\n\t\t\t}\r\n\t\t\tif(rowSum!==10) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//loop on each col to check for sum\t\t\r\n\t\tfor(var i=0; i < cols; i++) {\r\n\t\t\tvar colSum = 0;\r\n\t\t\tfor(var j=0; j < rows; j++) {\r\n\t\t\t\tvar currentIndex = i + j*rows;\r\n\t\t\t\tcolSum += parseInt($(\"td:eq(\"+currentIndex+\")\").text());\r\n\t\t\t}\r\n\t\t\tif(colSum!==10) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//loop on each row to check for repeated cells\r\n\t\tfor(var i=0; i < rows; i++) {\r\n\t\t\tvar rowNumArr = [];\r\n\t\t\tfor(var j=0; j < cols; j++) {\r\n\t\t\t\tvar currentIndex = i*cols + j;\r\n\t\t\t\tvar currentNumber = parseInt($(\"td:eq(\"+currentIndex+\")\").text());\r\n\t\t\t\tif(rowNumArr.includes(currentNumber)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\trowNumArr.push(currentNumber);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//loop on each col to check for repeated cells\r\n\t\tfor(var i=0; i < rows; i++) {\r\n\t\t\tvar colNumArr = [];\r\n\t\t\tfor(var j=0; j < cols; j++) {\r\n\t\t\t\tvar currentIndex = i + j*rows;\r\n\t\t\t\tvar currentNumber = parseInt($(\"td:eq(\"+currentIndex+\")\").text());\r\n\t\t\t\tif(colNumArr.includes(currentNumber)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tcolNumArr.push(currentNumber);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\r\n\t}//<-- End of Win function -->", "function filaBuida(tr) {\n\tconsole.log(tr.children);\n\tfor (var i=0; i<tr.chidren.length; i++) {\n\t\tconsole.log(tr.children[i].textContent);\n\t\tif (tr.children[i].textContent.length > 0) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function isTie(){\n if(board[0].every( x => x !== null)){\n return true;\n }\n\n return false;\n}", "function checkForWin () {\n function _win (cells) {\n // Check four cells to see if they're all color of current player\n // - cells: list of four (y, x) cells\n // - returns true if all are legal coordinates & all match currPlayer\n\n return cells.every (\n ([y, x]) =>\n y >= 0 &&\n y < HEIGHT &&\n x >= 0 &&\n x < WIDTH &&\n board[y][x] === currPlayer\n );\n }\n\n //DONE TODO: read and understand this code. Add comments to help you.\n //row = top -> ID -> tr -> #column-top -> height -> y\n //loops thru each row element\n for (let y = 0; y < HEIGHT; y++) {\n //cell = headCell -> id -> td -> width -> x\n //loops thru each cell element\n for (let x = 0; x < WIDTH; x++) {\n // Random thought: The arrays below kind of remind me of a cartesian grid layout\n //horizontal array increments by one as it goes down each row\n const horiz = [[y, x], [y, x + 1], [y, x + 2], [y, x + 3]];\n //vertical array increments by one as it goes down each column\n const vert = [[y, x], [y + 1, x], [y + 2, x], [y + 3, x]];\n // diagonal right array increments by 1 as\n const diagDR = [[y, x], [y + 1, x + 1], [y + 2, x + 2], [y + 3, x + 3]];\n //diagonal left array\n const diagDL = [[y, x], [y + 1, x - 1], [y + 2, x - 2], [y + 3, x - 3]];\n //checks for win in multiple scenarios; either horizontal or vertical or diagonal right or diagonal left\n if (_win (horiz) || _win (vert) || _win (diagDR) || _win (diagDL)) {\n // if any of the logical operators || return true\n return true;\n }\n }\n }\n}", "function checkColError(table) {\r\n\r\n for (let i = 0; i < table.length; i++) {\r\n\r\n let matrix = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\r\n\r\n readColTable(table, i, matrix);\r\n console.log(matrix);\r\n let res = isUniqDigit9Table(matrix);\r\n\r\n if (!res) {\r\n let id = 'table-error-column' + i;\r\n afficheErrorTable(matrix, 'Column', i, id);\r\n numberOfError++;\r\n }\r\n }\r\n}", "function isGameTied() { \n /* if there are no empty cells AND the human player has not won\n (only checking the human player because the human player will have \n have the last move in a true tie) */\n if (emptyCells().length === 0 && !checkWin(originalBoard, HUMAN_PLAYER)) { \n /* loop through all the cells and add a green color and remove eventListeners */\n CELLS.forEach((cell, index) => { \n cell.style.backgroundColor = '#00cc00';\n cell.removeEventListener('click', cellClicked, false);\n });\n /* call function that displays endGame dialog */\n declareWinner('tied');\n\n /* return true (because the game is tied) to the caller */\n return true;\n } \n \n /* return false (because the game is not tied) to the caller */\n return false;\n}", "function gameOverCheck() {\n /* iterate through every block in the tetromino */\n for (let i = 0; i < tetr[currTet].config[configState].length; i++) {\n /* current pos for each block*/\n let row = row_state + tetr[currTet].config[configState][i][0]*36;\n // if any of the blocks are at the top of the screen, then game over\n if (row == 0) return true;\n }\n // otherwise game is not over\n return false;\n}", "function checkColForFour() {\n for (i = 0; i < 40; i++) {\n //if we use indexes to draw our row, it would look like this\n let colOfFour = [i, i + width, i + 2 * width, i + 3 * width];\n //this is the color to eliminate\n let decidedColor = squares[i].style.backgroundImage;\n let isBlank = squares[i].style.backgroundImage === '';\n\n if (\n colOfFour.every(\n (index) =>\n squares[index].style.backgroundImage === decidedColor && !isBlank\n )\n ) {\n score += 8;\n playConfrimSound();\n scoreDisplay.innerHTML = score;\n colOfFour.forEach((index) => {\n squares[index].style.backgroundImage = '';\n });\n }\n }\n }", "static isTable(el) {\n return el.hasClass('ck-responsive-table');\n }", "_isOnSafeCell (position) {\n return position % 100 === 13 || position % 100 === 34\n }", "function pre_step()\n{\n clear_table_styles();\n\n if (ms.is_solved())\n {\n let tr = document.getElementById(\"CkSlv\");\n let chk = tr.children[0].children[0];\n let txt = tr.children[1];\n txt.style.backgroundColor = \"#88FF88\";\n return true;\n }\n\n if (ms.direct_error())\n {\n let tr = document.getElementById(\"DrErr\");\n let chk = tr.children[0].children[0];\n let txt = tr.children[1];\n txt.style.backgroundColor = \"#FF8888\";\n return true;\n }\n\n if (ms.indirect_error())\n {\n let tr = document.getElementById(\"InErr\");\n let chk = tr.children[0].children[0];\n let txt = tr.children[1];\n txt.style.backgroundColor = \"#FF8888\";\n return true;\n }\n}", "function tied() {\n var i = 0;\n while (i < 9) {\n if ($(cells[i++]).hasClass(empty_cell)) return false;\n }\n gameisfinished = true;\n return true;\n }", "checkVerticalColision() {\n let absPos;\n\n // comprueba si ha tocado el fondo del tablero \n if (this._checkBottomColision()) return false;\n // \n for (let col = 0; col < 4; col++) {\n for (let row = 3; row >= 0; row--) {\n if (this[row][col] === 0) continue;\n\n absPos = this._getAbsolutePosition(row, col);\n\n if (this.board[absPos.row + 1][absPos.col] !== 0) return false;\n break;\n }\n }\n\n return true;\n }", "hit(cellIndex) {\n // The cell id puts the whole table into a single dimension. It simply needs to be between the topLeft and the bottomRight to qualify.\n return ((this.topLeft <= cellIndex) &&\n (cellIndex <= this.bottomRight));\n }", "function emptyTable(table, indexes) {\n for (var i = 0; i < table.rows.length; ++i) {\n if (indexes[i] !== table.rows.item(i).cells.length)\n return false;\n }\n return true;\n }", "function k(e,t){return c(e,\"table\")&&c(11!==t.nodeType?t:t.firstChild,\"tr\")&&me(\">tbody\",e)[0]||e}", "checkFullRow () {\n for (let row = 0; row < this.landed[0].length; row++) {\n let result = true\n for (let col = 0; col < this.landed.length; col++) {\n if (this.landed[col][row] === 0) result = false\n }\n if (result) {\n this.moveLandedDown(row)\n this.score += 100\n this.view.score.innerHTML = 'Score: ' + this.score\n }\n }\n }", "cellsOnNetwork(){\n\t\tvar px = this.C.cellborderpixels.elements, i,j, N, r = {}, t\n\t\tfor( i = 0 ; i < px.length ; i ++ ){\n\t\t\tt = this.C.pixti( px[i] )\n\t\t\tif( r[t] ) continue\n\t\t\tN = this.C.neighi( px[i] )\n\t\t\tfor( j = 0 ; j < N.length ; j ++ ){\n\t\t\t\tif( this.C.pixti( N[j] ) < 0 ){\n\t\t\t\t\tr[t]=1; break\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn r\n\t}", "function checkerForEmpty() {\n\treturn td.filter((t) => !t.innerHTML);\n}", "function checkWon(){\n\t\tif (won === true){\n\t\t\tvar entry = document.querySelectorAll('td')\n\t\t\tfor (var item = 0; item < 9; item++) {\n\t\t\t\tentry[item].onclick = null\n\t\t\t}\n\t\t\tdisplay.innerText = `Player:${player} has won!! Congratulate them on this amazing feat`\n\t\t\treturn false\n\t\t}else if (moves == 9){\n\t\t\tdisplay.innerText = `Its a draw!!! Amazing!!!`\n\t\t\treturn false\n\t\t}\n\t\treturn true\n\t}", "function isSelectionOutOfTable(opts, value) {\n if (!value.selection.start) return false;\n\n const {start, end} = value.selection;\n\n const startPosition = TablePosition.create(opts, value.document, start && start.key);\n const endPosition = TablePosition.create(opts, value.document, end && end.key);\n\n // Only handle events in tables\n return !startPosition.isInTable() && !endPosition.isInTable();\n}", "checkCell( grid ){\n let flag = true;\n\n if( grid.x < 0 || grid.y < 0 || grid.x > this.const.m - 1 || grid.y > this.const.n - 1 )\n flag = false;\n\n return flag;\n }", "function inViewPort(x){ return (x) * style.cellWidth + tx > 0; }", "function check_border() {\n for (let i = 0; i < invaders.length; i++) {\n return invaders[i].x <= 0 || invaders[i].x >= 155;\n }\n}", "function canMove(row, col) {\n if (!hasOppositeChecker(row, col, currentColor)) {\n if (isAKing(occupiedArray[row][col].id)) {\n if (!cellIsVacant(row + 1, col + 1) && !cellIsVacant(row + 1, col - 1) && !cellIsVacant(row - 1, col + 1) && !cellIsVacant(row - 1, col - 1)) {\n return false;\n }\n }\n else if (occupiedArray[row][col].classList.contains(\"black\")) {\n if (!cellIsVacant(row + 1, col - 1) && !cellIsVacant(row + 1, col + 1)) {\n return false;\n }\n }\n else if (occupiedArray[row][col].classList.contains(\"red\")) {\n if (!cellIsVacant(row - 1, col - 1) && !cellIsVacant(row - 1, col + 1)) {\n return false;\n }\n }\n return true;\n }\n}", "_safeCell(x, y) {\n if (x < 0 || x >= this.width) return false\n if (y < 0 || y >= this.height) return false\n return true\n }", "function test7() {\n currentPiece = new I();\n currentPiece.moveDown()\n updateGraphics();\n return !currentPiece.coords.some(x => board[x[0]][x[1]] !== currentPiece.color);\n}", "function isSolved() {\n for (let row = 0; row < numRows; row++) {\n for (let col = 0; col < numCols; col++) {\n if (isCellValidTest(row, col) === false) {\n return false;\n }\n }\n }\n return true;\n}" ]
[ "0.6437961", "0.6231199", "0.6218072", "0.62143695", "0.6204761", "0.6143639", "0.61342883", "0.6094799", "0.60892373", "0.6084203", "0.6016757", "0.5995122", "0.5964048", "0.59461534", "0.587144", "0.5869155", "0.58678436", "0.58664525", "0.58664525", "0.5850165", "0.58002573", "0.57828546", "0.5777812", "0.5773356", "0.5760837", "0.5751166", "0.575109", "0.5736993", "0.5723908", "0.5707004", "0.5696201", "0.56927145", "0.56665474", "0.56571", "0.56483173", "0.56470454", "0.56380075", "0.562246", "0.56156397", "0.5613019", "0.5591527", "0.5590075", "0.5586725", "0.55775493", "0.55755585", "0.557249", "0.55722415", "0.5571142", "0.5565547", "0.55600345", "0.5559964", "0.5551004", "0.5539471", "0.55391294", "0.55388075", "0.5535832", "0.5532924", "0.5527451", "0.55256057", "0.5520757", "0.5512796", "0.55110145", "0.5505676", "0.55051124", "0.5504184", "0.5476143", "0.5475714", "0.5474121", "0.54697806", "0.5467868", "0.5465555", "0.5463711", "0.5462202", "0.54537714", "0.5443104", "0.54392505", "0.5438501", "0.5425839", "0.54252595", "0.54233176", "0.5417398", "0.54155076", "0.54089284", "0.54040164", "0.5403999", "0.5399308", "0.53948414", "0.53924906", "0.53905326", "0.5389652", "0.53843135", "0.5379379", "0.5375186", "0.53745216", "0.53721166", "0.5371736", "0.53717136", "0.5369966", "0.5365806", "0.5364746", "0.5359858" ]
0.0
-1
Adds a table of size "size" at "xCord","yCord" with id "id" then redraws the map
function addTable (xCord, yCord, size, id) { for (i = 0; i < size; i++) { for (j = 0; j < size; j++) { if (yCord + i < dimension && xCord + j < dimension) { currentMap[yCord + i][xCord + j] = id } } } draw(currentMap) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapResize(newSize){\r\n\r\n // Get current position\r\n var map_x = unsafeWindow.mapX;\r\n var map_y = unsafeWindow.mapY;\r\n var map_s = unsafeWindow.mapSize;\r\n\r\n // Calculate new X and Y\r\n var delta = parseInt((map_s - newSize) / 2);\r\n\r\n // Overwrite values\r\n map_x += delta;\r\n map_y += delta;\r\n\r\n // InnerHTML\r\n var ihtml = \"\";\r\n ihtml += '<tr>';\r\n ihtml += '<td height=\"38\">' + map_y + '</td>';\r\n ihtml += '<td colspan=\"' + newSize + '\" rowspan=\"' + newSize + '\">';\r\n ihtml += '<div style=\"background-image:url(graphic/map/gras4.png); position:relative; width:' + (53 * newSize) + 'px; height:' + (38 * newSize) +'px; overflow:hidden\" id=\"map\">';\r\n ihtml += '<div id=\"mapOld\" style=\"position:absolute; left:0px; top:0px\">';\r\n ihtml += '<div style=\"color:white; margin:10px\">Lade Karte...</div>';\r\n ihtml += '</div>';\r\n ihtml += '<div id=\"mapNew\" style=\"position:absolute; left:0px; top:0px\"></div>';\r\n ihtml += '</div>';\r\n ihtml += '</td>';\r\n ihtml += '</tr>';\r\n for(jj=1; jj<newSize; jj++){\r\n ihtml += '<tr><td width=\"20\" height=\"38\">' + (map_y + jj) + '</td></tr>';\r\n }\r\n ihtml += '<tr id=\"map_x_axis\">';\r\n ihtml += '<td height=\"20\"></td>';\r\n for(jj=0; jj<newSize; jj++){\r\n ihtml += '<td align=\"center\" width=\"53\">' + (map_x + jj) + '</td>';\r\n }\r\n ihtml += '</tr>';\r\n var tmp = document.getElementById(\"mapCoords\").innerHTML = ihtml;\r\n\r\n // Update data\r\n var url = \"http://\"+(\"\"+location.href).split(\"/\")[2] + \"/\" + unsafeWindow.mapURL + '&start_x=' + map_x + '&start_y=' + map_y + '&size_x=' + newSize + '&size_y=' + newSize;\r\n GM_xmlhttpRequest({\r\n method:\"GET\",\r\n url:url,\r\n onload:function(details){\r\n document.getElementById(\"mapOld\").innerHTML = details.responseText;\r\n }\r\n });\r\n\r\n // mapMoveTopo()\r\n var scrollX = map_x;\r\n var scrollY = map_y;\r\n unsafeWindow.scrollX = scrollX;\r\n unsafeWindow.scrollY = scrollY;\r\n var topoX = parseInt(document.getElementsByName('min_x')[0].value); //minimalstes x auf Karte rechts\r\n var topoY = parseInt(document.getElementsByName('min_y')[0].value); //minimalstes y auf Karte rechts\r\n\r\n var relX = scrollX - topoX;\r\n if(unsafeWindow.globalYDir == 1){\r\n var relY = scrollY - topoY;\r\n }else{\r\n var relY = (45-mapSize) - (scrollY-topoY);\r\n }\r\n \r\n // Rechteck verschieben\r\n document.getElementById('topoRect').style.left = (5*(relX)) + 'px';\r\n document.getElementById('topoRect').style.top = (5*(relY)) + 'px';\r\n document.getElementById('topoRect').style.width = (5*(newSize)) + 'px';\r\n document.getElementById('topoRect').style.height = (5*(newSize)) + 'px';\r\n\t \r\n\t unsafeWindow.ajaxMapInit(parseInt(unsafeWindow.mapX), parseInt(unsafeWindow.mapY), parseInt(newSize) , \"game.php?\"+getUrlParam(\"village\")+\"&screen=map&xml\", 1, 1);\r\n\t \r\n }", "function MapDisplay() {\n //setup map dims from html form\n let mapHeight = document.getElementById('height').value;\n let mapWidth = document.getElementById('width').value;\n\n var mapArray = FullMap(mapHeight, mapWidth);\n\n const mapTable = document.getElementById(\"mapTable\");\n \n //clears old map, if it exists\n while(mapTable.firstChild) {\n mapTable.removeChild(mapTable.firstChild);\n }\n \n //draw the map out\n for (let i = 0; i < mapArray.length; i++ ) {\n var newRow = mapTable.insertRow(i);\n newRow.setAttribute(\"id\", \"mapRow\");\n\n for (let j = 0; j < mapArray[i].length; j++) {\n var newCell = newRow.insertCell(j);\n if (mapArray[i][j].cellValue == 1) {\n newCell.setAttribute(\"id\", \"mapCellWall\");\n }\n else {\n newCell.setAttribute(\"id\", \"mapCellSpace\");\n }\n }\n }\n}", "function redrawTable(id){ \n clearTable();\n removeFromList(id);\n povoateTable(); \n setupDeleteListener();\n setfilter();\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<size;i++)\r\n\t{\r\n\t\t rows[i]=$(\"<tr></tr>\");\r\n\t\t createTable.appendChild(rows[i][0]);\r\n\t\t for(var j=0;j<size;j++)\r\n\t\t {\r\n var tdEle=$(\"<td></td>\");\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 drawTable() {\n var stat = getState(cm);\n _replaceSelection(cm, stat.table, insertTexts.table);\n}", "function redraw() {\n var i, j, str, myEl, x, val;\n for(i = 0; i < size; i++) {\n for(j = 0; j < size; j++) {\n x = 4*i + j;\n str = \"\" + x;\n myEl = document.getElementById(str);\n if(mat[i][j] !== 0) {\n val = \"\" + mat[i][j];\n myEl.innerHTML = val;\n changeTileColor(str, mat[i][j]);\n }\n else {\n val = \"\";\n myEl.innerHTML = val;\n myEl.style.backgroundColor = \"rgb(205, 193, 180)\";\n }\n }\n } \n }", "function createMap(){\n document.write(\"<table>\");\n\n for (let y = 0; y < height; y++) {\n document.write(\"<tr>\");\n for (let x = 0; x < width; x++) {\n if (x == 0 || x == width -1 || y == 0 || y == height -1) {\n document.write(\"<td class='wall' id= '\" + x + \"-\" + y +\"'></td>\");\n } else {\n document.write(\"<td class='blank' id= '\" + x + \"-\" + y +\"'></td>\");\n }\n }\n document.write(\"</tr>\");\n }\n document.write(\"</table>\");\n\n}", "function addToShipTable (id){\r\n for(let ship of shipList){\r\n if(ship.id == id){\r\n shipInTable.push(ship);\r\n break;\r\n }\r\n }\r\n\r\n shipTableBuilder();\r\n}", "renderMap() {\n $('#gameMap').append('<table></table>');\n for (let j = ((this.width - 1) / 2); j >= (-(this.width - 1) / 2); j--) {\n $('table').append('<tr></tr>');\n for (let i = (-(this.height - 1) / 2); i <= ((this.height - 1) / 2); i++) {\n $('tr:last').append('<td data-x=\"' + i + '\" data-y=\"' + j +\n '\" class=\"floorClass\"></td>');\n }\n }\n }", "function update_board(id){\n\t \tvar t = $('#'+id);\n\t \tfor (var k = parseInt(t.attr('col'))-1; k < parseInt(t.attr('col'))+parseInt(t.attr('sizex'))-1; k++) {\n\t \t\tfor (var j = parseInt(t.attr('row'))-1; j < parseInt(t.attr('row'))+parseInt(t.attr('sizey'))-1; j++) {\n\t \t\t\tboard[k][j].occupied = 1;\n\t \t\t\tboard[k][j].tile = id;\n\t \t\t};\n\t \t};\n\t }", "function drawBoard(size) {\n var parent = document.getElementById(\"game\");\n var table = document.createElement('table'); // create table\n table.id='board';\n var counter = 1;\n\n for (let i = 0; i < size; i++)\n {\n var row = document.createElement(\"tr\"); // create rows\n\n for(let x = 0; x < size; x++)\n {\n var col = document.createElement(\"td\"); // create columns\n col.innerHTML = \"\";\n col.id = counter; // the counter will go from 1 to 9, giving each cell its own id\n counter += 1;\n row.appendChild(col); // append columns as children of rows\n }\n table.appendChild(row); // append rows as children of table \n } \n parent.appendChild(table); // append table as child of main div\n var btn = document.createElement('button');\n btn.innerHTML = 'Play Again';\n parent.appendChild(btn); // append Play Again button as child of main div\n var sCode = document.createElement('p');\n sCode.innerHTML = '[ <a href=\"https://github.com/mariobox/tic-tac-toe\">Source Code</a> ]';\n parent.appendChild(sCode); // append link to source code as child of main div\n \n}", "function customTableFromArray(tbl, map) {\r\n var rows = map.length;\r\n var rowCount = 0\r\n var columns = map[0].length;\r\n var cell;\r\n\r\n\r\n for(var r=rows - 1;r>=0;r--) { \r\n var x=document.getElementById(tbl).insertRow(rowCount);\r\n for(var c=0;c<parseInt(columns,10);c++) {\r\n cell = map[r][c];\r\n \r\n var y= x.insertCell(c); \r\n $(y).attr(\"data-row\", (rows - rowCount - 1));\r\n $(y).attr(\"data-col\", c);\r\n $(y).attr(\"data-djsteps\", cell.djSteps);\r\n //$(y).text(cell.djSteps);\r\n\r\n if(cell.onPath) {$(y).attr(\"class\", \"onpath\");}\r\n\r\n //\r\n if(cell.borderTop) {y.style.borderTop = \"1px solid black\";};\r\n if(cell.borderRight) {y.style.borderRight = \"1px solid black\";};\r\n if(cell.borderBottom) {y.style.borderBottom = \"1px solid black\";};\r\n if(cell.borderLeft) {y.style.borderLeft = \"1px solid black\";};\r\n\r\n if(cell.entrance) {\r\n $(y).attr(\"id\", \"entrance\");\r\n }else if(cell.exit) {\r\n $(y).attr(\"id\", \"exit\");\r\n };\r\n \r\n //debugger;\r\n };\r\n rowCount += 1;\r\n };\r\n}", "function draw_field( id, width, height ) {\n\tif( width * height > 2500 ) {\n\t\tif( ! confirm( \"Resizing to fields larger than 2500 cells can slow down your PC or will freeze your browser. Do you really wan't to proceed?\" ) ) return;\n\t}\n\t\n\t// unset current content\n\twhile( document.getElementById(id).firstChild ) {\n\t\tdocument.getElementById(id).removeChild( document.getElementById(id).firstChild );\n\t}\n\n\t// store width and height in global vars\n\tgame_field_width = width;\n\tgame_field_height = height;\n\n\t// start creating the playing field table\n\tvar table = document.createElement(\"table\");\n\ttable.id = id + \"_panel\";\n\ttable.setAttribute(\"cellpadding\", 0);\n\ttable.setAttribute(\"cellspacing\", 0);\n\n\tvar i = 0;\n\tfor( var y = 0; y < height; y++ ) {\n\t\t// start new table row\n\t\tvar tr = document.createElement(\"tr\");\n\t\t\n\t\tfor( var x = 0; x < width; x++ ) {\n\t\t\ti++;\n\t\t\tvar td = document.createElement(\"td\");\n\t\t\ttd.className = \"fields_game_unchecked\";\n\t\t\ttd.id = id + \"_td_\" + i;\n\t\t\t// td.title = i;\n\n\t\t\tvar img = document.createElement(\"img\");\n\t\t\timg.setAttribute ( \"onclick\", \"javascript: switch_td_state( document.getElementById('\"+ id +\"_td_\"+ i +\"'), true );\" );\n\t\t\timg.src = \"game_of_life.png\";\n\t\t\timg.className = \"fields_game_img\"\n\n\t\t\ttd.appendChild( img );\n\t\t\ttr.appendChild( td );\n\t\t\n\t\t}\n\n\t\ttable.appendChild( tr );\n\n\t}\n\n\tgame_fields = i;\n\n\treturn table;\n}", "function genMapTable(){\r\n\t\tif (get('tabla_mapa')) removeElement(get('tabla_mapa'));\r\n\r\n\t\tvar table = document.createElement('TABLE');\r\n\r\n\t\ttable.setAttribute(\"id\", \"tabla_mapa\");\r\n\t\ttable.setAttribute(\"sortCol\", -1);\r\n\t\ttable.setAttribute(\"class\", \"tbg\");\r\n\t\ttable.setAttribute(\"align\", \"left\");\r\n\t\ttable.setAttribute(\"cellspacing\", \"1\");\r\n\t\ttable.setAttribute(\"cellpadding\", \"2\");\r\n\t\tvar thead = document.createElement(\"THEAD\");\r\n\t\tvar tbody = document.createElement(\"TBODY\");\r\n\t\tvar fila = document.createElement('TR');\r\n\t\tfila.setAttribute('class', \"rbg\");\r\n\t\tthead.appendChild(fila);\r\n\t\ttable.appendChild(thead);\r\n//\t\tvar etiquetas_tabla = [\"JUGADOR\", \"ALIANZA\", \"ALDEA\", \"HAB\", \"COORD\", \"ACCION\"];\r\n\t\tvar etiquetas_tabla = [\"JUGADOR\", \"ALIANZA\", \"ALDEA\", \"HAB\"];\r\n\t\tfor (var i = 0; i < etiquetas_tabla.length; i++){\r\n\t\t\tvar td = elem('TD', T(etiquetas_tabla[i]));\r\n\t\t\tif (i < 4){\r\n\t\t\t\tswitch(i){\r\n\t\t\t\t\tcase 3: td.addEventListener(\"click\", sortTable('tabla_mapa', i, 'int'), 0); break;\r\n\t\t\t\t\tdefault: td.addEventListener(\"click\", sortTable('tabla_mapa', i), 0);\r\n\t\t\t\t}\r\n\t\t\t\ttd.style.cursor = \"pointer\";\r\n\t\t\t}\r\n\t\t\tfila.appendChild(td);\r\n\t\t}\r\n\t\tvar datos = 0;\r\n\t\tvar area;\r\n\t\tfor(var i = 0; i < 7; i++)\r\n\t\t\tfor(var j = 0; j < 7; j++) {\r\n\t\t\t\tarea = document.getElementById('a_'+i+'_'+j).wrappedJSObject;//.getAttribute('details');//lmc.ad[i][j];\r\n\t\t\t\tvar cellinfo=area.details;\r\n//\t\t\t\tlog(1,'cellinfo i:'+i+' j:'+j+' x: '+cellinfo.x+' y: '+cellinfo.y);\r\n\t\t\t\tif (cellinfo && cellinfo.name !=null ) {\r\n\t\t\t\t\tdatos=1;\r\n\t\t\t\t\tvar inforow = document.createElement('TR');\r\n\t\t\t\t\tvar href=area.href;\r\n\r\n\t\t\t\t\tinforow.appendChild(elem('TD', cellinfo.name));\r\n\t\t\t\t\tinforow.appendChild(elem('TD', cellinfo.ally));\r\n\t\t\t\t\tinforow.appendChild(elem('TD', '<a href=\"' + href + '\">' + cellinfo.dname + '</a>'));\r\n\t\t\t\t\tinforow.appendChild(elem('TD', cellinfo.ew));\r\n\r\n//\t\t\t\t\tinforow.appendChild(elem('TD', '<a href=\"' + href + '\">' + cellinfo.x + \", \" + cellinfo.y + '</a>'));\r\n//\t\t\t\t\tinforow.appendChild(elem('TD', '<a href=\"' + href.replace(\"karte.php?d\", \"a2b.php?z\") + '\">' + T('ATACAR') + '</a> / <a href=\"' + href.replace(\"karte.php?d\", \"build.php?z\") + '&gid=17\">' + T('COMERCIAR') + '</a>'));\r\n\t\t\t\t\ttbody.appendChild(inforow);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\ttable.appendChild(tbody);\r\n\t\tif (datos == 1) {\r\n\r\n\t\t\tif (get('tabla_mapa_div')) {\r\n\t\t\t\tvar divt = get('tabla_mapa_div');\r\n\t\t\t} else {\r\n\t\t\t\tvar divt = document.createElement('DIV');\r\n\t\t\t\tdivt.style.display = 'block';\r\n\t\t\t\tdivt.style.position = 'absolute';\r\n\t\t\t\tdivt.id = 'tabla_mapa_div';\r\n\t\t\t\tdivt.style.top = 610 + longitudPantalla() + 'px';\r\n\t\t\t\tdocument.body.appendChild(divt);\r\n\t\t\t}\r\n\r\n\t\t\tdivt.appendChild(table);\r\n\r\n\t\t\tplayerLinks();\r\n\r\n//\t\t\tvar middleblock = get('lmidall');\r\n//\t\t\t//middleblock.appendChild(document.createElement('BR'));\r\n//\t\t\tmiddleblock.appendChild(table);\r\n\t\t}\r\n\t}", "function drawMap(mapDivId, mapToDraw) {\r\n var mapdiv = document.getElementById(mapDivId);\r\n mapdiv.innerHTML = mapToDraw.getMapTable();\r\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('<tr id = table' + i + '></tr>');//the tableid plus table data\r\n for (var j =1; j <=height; j++){\r\n $('#table' + i).append('<td></td');\r\n }\r\n\r\n }\r\n\r\n //getting more interesting with adding color\r\n $('td').click(function addColor(){\r\n color = $('#colorPicker').val();\r\n\r\n if ($(this).attr('style')){\r\n $(this).removeAttr('style')\r\n } else {\r\n $(this).attr('style', 'background-color:' + color);\r\n }\r\n })\r\n\r\n}", "function resizeBoard() {\n var elTable = document.querySelector('table');\n if (gLevel.size === 4) elTable.style.width = elTable.style.height = '300px';\n else if (gLevel.size === 8) elTable.style.width = elTable.style.height = '400px';\n else if (gLevel.size === 12) elTable.style.width = elTable.style.height = '500px';\n}", "function drawTable(){ \n \n //table\n pushMatrix();\n mat4.translate(modelview,modelview,[200,-70,-200]);\n mat4.scale(modelview,modelview,[20,25,20]);\n currentColor = [.5098,.3215, .0039,1];\n table.render();\n popMatrix();\n\n //skull\n pushMatrix();\n mat4.translate(modelview,modelview,[210,-25,-210]);\n mat4.scale(modelview,modelview,[7,7,7]);\n mat4.rotateY(modelview,modelview,(-40)/180*Math.PI);\n mat4.rotateX(modelview,modelview,(-15)/180*Math.PI);\n currentColor = [0.8901, 0.8549,0.7882,1];\n gl.uniform3f( u_material.specularColor, .8862,.3450,.1333 );\n gl.uniform1f( u_material.specularExponent, 20 );\n gl.uniform3f( u_material.emissiveColor,0.08901, 0.08549,0.07882); \n skull.render();\n gl.uniform3f( u_material.emissiveColor,0, 0,0); \n popMatrix();\n\n //candle with holder\n drawCandle(u_lights[7], [172,-2,-198]);\n pushMatrix();\n mat4.translate(modelview,modelview,[172,-15,-200]);\n mat4.scale(modelview,modelview,[2,2,2]);\n currentColor = [.8039,.5843, .4588,1];\n candleholder.render();\n popMatrix();\n}", "function MapTable() {\r\n}", "function drawBoard() {\n\tvar tableHTML = '';\n\tvar position = 0;\n\n\tfor(var i = 0; i < 10; i++){\n\t\ttableHTML += '<tr>';\n\t\tfor(var j = 0; j < 10; j++){\n\t\t\tcurrentPosition = positionOrder[position];\n\t\t\ttableHTML += '<td id=\"' + currentPosition + '\" class=\"\" onclick=\"sendLocationPlayed(this)\">' + currentPosition + '</td>';\n\t\t\tposition++;\n\t\t}\n\t\ttableHTML += '</tr>';\n\t}\n\tdocument.getElementById(\"board\").innerHTML = tableHTML;\n}", "function fillShape(id){\n //renders starts if its not gameOver || table Data already placed\nif(!fields[id] && !gameOver){\n //inactivates player of previous move\n inacPlayer(currentShape);\n //next click on square will make it a move of not inactive player\n fields[id]=shapeShifter(currentShape);\n draw();\n //checking winning condition. if wins is true animations inits and game gets aborted\n if (checkWin()){animateBar(fields);gameOver=true;}\n}\n}", "function addTableDB(Xpos, Ypos, table_id) {\n var div = document.createElement('div');\n div.id = 'twoPtable';\n div.draggable = true;\n \n switch (getOrderLock(table_id)) {\n case 1:\n div.style.backgroundColor = \"red\";\n break;\n case 2:\n div.style.backgroundColor = \"yellow\";\n break;\n case 3:\n div.style.backgroundColor = \"green\";\n break;\n default:\n break;\n }\n \n setTranslate(Xpos, Ypos, div);\n\n var button = document.createElement('button');\n button.style = \"width: 90%; height: 40%; margin-top: 5%; font-size:0.5vw\";\n button.id = \"orderbtn\";\n button.textContent = \"Order\";\n button.setAttribute(\"onClick\", \"javascript: showOrder(\"+table_id+\")\");\n div.appendChild(button);\n\n var innerDiv = document.createElement('p');\n var text = document.createTextNode(table_id);\n innerDiv.style = \"font-size: 1vw; margin-top:5%; float:left; margin-left:5%\";\n innerDiv.appendChild(text);\n div.appendChild(innerDiv);\n\n container.appendChild(div);\n}", "updateShapeTable(){\n let self = this;\n let keys = Object.keys(this._shapes);\n let values = Object.values(this._shapes);\n /* these are the DOM elements in each row of the table */\n let rowComponents = [\n { 'type': 'div', 'attr':[['class', 'flex-cell display']] },\n { 'type': 'div', 'attr':[['class', 'flex-cell label']] },\n { 'type': 'span', 'attr':[['class', 'flex-cell small-close']] },\n ];\n super.initTableRows('#shape-table', 'shape', keys, rowComponents);\n /* we customize the DOM elements according to the values of the shapes list */\n d3.select('#shape-table').selectAll('.display')\n .data(values)\n .append('svg')\n .attr('class', 'display-cell')\n .attr('viewBox', '-5 -5 10 10')\n .append('path')\n .attr('fill', 'black')\n .attr('d', (d) => { return d3.symbol().type(d3['symbol'+d]).size(10)(); })\n ;\n /* set the label for each row */\n d3.select('#shape-table').selectAll('.label')\n .data(keys)\n .text(d => d)\n ;\n /* update the small-close span element */\n let close = d3.select(\"#shape-table\").selectAll('.small-close')\n .data(keys)\n .attr('data-key', d => d)\n .html('&times;')\n .on('click', function(){\n if( this.dataset.key === 'Default' ) return;\n delete( self._shapes[this.dataset.key] );\n self.assignShapes();\n self.updateShapeTable();\n self.plot();\n })\n ;\n }", "function addRow(action)\n{\n\tvar theAction = action;\n var table = document.getElementById('maplist');\n var theRows = table.rows.length;\n var inkrement = theRows;\n var row = table.insertRow(theRows);\n\t\n\t// gibt nen text wie \"map #1\" aus\n\tvar cell0 = row.insertCell(0);\n\tvar textNode = document.createTextNode('map #' + inkrement);\n\tif(theAction=='edit') {\n\t\tvar ele0 = document.createElement('input');\n\t\t\tele0.setAttribute('type', 'hidden');\n\t\t\tele0.setAttribute('name', 'map_id[]');\n\t\t\tele0.setAttribute('value', inkrement);\n\t\tcell0.appendChild(ele0);\n\t}\n\tcell0.appendChild(textNode);\n\t// mapname\n var cell1 = row.insertCell(1);\n var ele1 = document.createElement('input');\n\t\tele1.setAttribute('type', 'text');\n\t\tele1.setAttribute('name', 'map_name[]');\n\t\tele1.setAttribute('id', 'map_name_' + inkrement);\n\t\tele1.setAttribute('size', '35');\n\t\tele1.className='form_off';\n cell1.appendChild(ele1);\n\t// results: home\n var cell2 = row.insertCell(2);\n var ele2 = document.createElement('input');\n\t\tele2.setAttribute('type', 'text');\n\t\tele2.setAttribute('name', 'map_result_home[]');\n\t\tele2.setAttribute('id', 'map_result_home_' + inkrement);\n\t\tele2.setAttribute('size', '3');\n\t\tele2.className='form_off';\n\tcell2.appendChild(ele2);\n\t// results: opponent\n\tvar cell3 = row.insertCell(3);\n\tvar ele3 = document.createElement('input');\n\t\tele3.setAttribute('type', 'text');\n\t\tele3.setAttribute('name', 'map_result_opp[]');\n\t\tele3.setAttribute('id', 'map_result_opp_' + inkrement);\n\t\tele3.setAttribute('size', '3');\n\t\tele3.className='form_off';\n\tcell3.appendChild(ele3);\n\t// create delete-selection for edit-function\n\tif(theAction=='edit') {\n\t\tvar cell4 = row.insertCell(4);\n\t\tvar ele4 = document.createElement('input');\n\t\t\tele4.setAttribute('type', 'checkbox');\n\t\t\tele4.setAttribute('name', 'delete['+inkrement+']');\n\t\t\tele4.setAttribute('value', inkrement);\n\t\t\tele4.className='form_off';\n\t\tcell4.appendChild(ele4);\n\t} else {\n\t\tvar cell4 = row.insertCell(4);\n\t}\n}", "updateSize() {\n this.map.invalidateSize()\n }", "function setTable()\n{\n\ttableObj = {\n\t\t\"settings\":{\"offsetX\":181,\"offsetY\":39,\"targWidth\":80,\"targHeight\":55,\"noRows\":3, \"noZero\":1},\n\t\t\"targs\":{\n\t\t\t\"targ0\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ1\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ2\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ3\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ4\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ5\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ6\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ7\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ8\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ9\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ10\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ11\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ12\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ13\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ14\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ15\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ16\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ17\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ18\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ19\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ20\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ21\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ22\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ23\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ24\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ25\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ26\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ27\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ28\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ29\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ30\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ31\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ32\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ33\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ34\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ35\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 },\n\t\t\t\"targ36\":{\"x\":0, \"y\":0, \"chips\":[], \"container\":0 }\n\t\t}\n\t};\n\t\n\t// ??? Need to Make Dynamic\n\t/*\n\ttableObj.settings.targWidth = 80;\n\ttableObj.settings.targHeight = 55;\n\ttableObj.settings.offsetX = 140;\n\ttableObj.settings.offsetY = 80;\n\t*/\n\n\tlet targW = tableObj.settings.targWidth;\n\tlet targH = tableObj.settings.targHeight;\n\tlet targOffX = tableObj.settings.offsetX;\n\tlet targOffY = tableObj.settings.offsetY;\n\n\tlet loopLimit = tableObj.settings.noRows;\n\tlet loopCount = -Math.abs(tableObj.settings.noZero);\n\tlet row = 0;\n\t//console.log(\"loopCount: \"+loopCount);\n\t//let table = new PIXI.Container();\n\t//app.stage.addChild(table);\n\t\n\tlet targs = tableObj.targs;\n\tfor (var key in targs) {\n\tif (targs.hasOwnProperty(key)) {\n\t\t //console.log(key + \" -> \" + targs[key]);\n\t\t //console.log(\"loop % loopLimit:\"+loopCount % loopLimit);\n\t\t let div = loopCount % loopLimit;\n\t\t loopCount++;\n\t\tswitch(div) {\n\t\t\tcase -2:\n\t\t\t\t// top - roulette with two Zero's\n\t\t\t\tbreak;\n\t\t\tcase -1:\n\t\t\t\t// top - roulette with one Zero\n\t\t\t\ttableObj.targs[key].y = tableObj.settings.offsetY;\n\t\t\t\ttableObj.targs[key].x = targW + tableObj.settings.offsetX;\n\t\t\t\tbreak;\n\t\t\tcase 0:\n\t\t\t\t// All left hand - new row\n\t\t\t\trow++;\n\t\t\t\ttableObj.targs[key].y = (targH * row) + tableObj.settings.offsetY;\n\t\t\t\ttableObj.targs[key].x = tableObj.settings.offsetX;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// All other Boxes\n\t\t\t\ttableObj.targs[key].y = (targH * row) + tableObj.settings.offsetY;\n\t\t\t\ttableObj.targs[key].x = (targW * div) + tableObj.settings.offsetX;\n\t\t} \n\t\t\n\t}\n\t}\n\ttableObj.targs = targs;\n\t\n\t//let str = JSON.stringify(tableObj, null, 4); // (Optional) beautiful indented output.\n\t//console.log(str); // Logs output to dev tools console.\n\t\n\ttargs = tableObj.targs;\n\tfor (var key in targs) \n\t{\n\t\ttableObj.targs[key].container = app.stage.addChild(makeTarg(key));\n\t\t//console.log(\">>>> container: \"+tableObj.targs[key].container);\n\t}\n\t\n\t// let str = JSON.stringify(app.stage.children, null, 4); // (Optional) beautiful indented output.\n\t// console.log(str); // Logs output to dev tools console.\n}", "function addTiles(co,jk,jj,dp,dn,dq,dk,dj,dl,dh,dg,di){xc_eg(co,\"jn\",\"jn\",{\"width\":jk,\"height\":jj,\"jn\":[dp||\"\",dn||\"\",dq||\"\",dk||\"\",dj||\"\",dl||\"\",dh||\"\",dg||\"\",di||\"\"],\"ca\":0,\"bs\":0,\"id\":\"\"},0)}", "function placeInTable(x, y,player) {\n let piece = document.createElement(\"div\");\n piece.classList.add(\"piece\")\n piece.classList.add(`Player${player}`)\n let target_cell = document.getElementById(`${x}-${y}`)\n target_cell.append(piece);\n\n}", "function drawTable() {\n let hour_chart_data = new google.visualization.DataTable();\n hour_chart_data.addColumn('string', 'Δραστηριότητα');\n hour_chart_data.addColumn('string', 'Ώρα Περισσότερων Εγγραφών');\n hour_chart_data.addRow(['IN_VEHICLE', hour_data['IN_VEHICLE']]);\n hour_chart_data.addRow(['ON_BICYCLE', hour_data['ON_BICYCLE']]);\n hour_chart_data.addRow(['ON_FOOT', hour_data['ON_FOOT']]);\n hour_chart_data.addRow(['RUNNING', hour_data['RUNNING']]);\n hour_chart_data.addRow(['STILL', hour_data['STILL']]);\n hour_chart_data.addRow(['TILTING', hour_data['TILTING']]);\n hour_chart_data.addRow(['UNKNOWN', hour_data['UNKNOWN']]);\n\n var hour_table = new google.visualization.Table(document.getElementById('hour-table-div'));\n hour_table.draw(hour_chart_data, {showRowNumber: false, width: '100%', height: '100%'});\n }", "function redraw() {\n width = document.getElementById('container_map').offsetWidth;\n height = width / 2;\n d3.select('svg').remove();\n setup(width,height);\n draw(topo);\n}", "function resizeCanvas(size)\n{\n\t$(\"#map-canvas\").attr(\"width\", size);\n\t$(\"#map-canvas\").attr(\"height\", size);\n\t$(\"#map-canvas\").css(\"width\", size + \"px\");\n\t$(\"#map-canvas\").css(\"height\", size + \"px\");\n\t\n\t$(\"#map-container\").css(\"width\", size + \"px\");\n\t$(\"#map-container\").css(\"height\", size + \"px\");\n\t$(\"#map-container\").css(\"flex-basis\", size + \"px\");\n\t\n\t$(\"#map-content\").css(\"width\", size + \"px\");\n\t$(\"#map-content\").css(\"height\", size + \"px\");\n\t\n\t$(\"#map-canvas\").css(\"width\", size + \"px\");\n\t$(\"#map-canvas\").css(\"height\", size + \"px\");\n\t\n\t$(\"#map-image\").css(\"width\", size + \"px\");\n\n\t$(\"#map-canvas\").css(\"width\", size + \"px\");\n\t$(\"#map-canvas\").css(\"height\", size + \"px\");\n}", "function respondToResizeMap() {\n var customRow = rowInput.value;\n\n // update the map size var.\n document.getElementById(\"range\").innerHTML=customRow;\n\n canvasWidth = INIT_CANVAS_WIDTH;//INIT_CANVAS_WIDTH IS 512\n\n //the maximun map size is 16 and th minumun map size is 4\n if ((customRow <= 16) && (customRow >= 4)) {\n if ((canvasWidth % customRow) !== 0) {\n while ((canvasWidth % customRow) !== 0) {\n canvasWidth += 1;\n }\n }\n } else {\n swal(\"Please enter a number between 4 and 16 \");\n return false;\n }\n canvasWidth +=1;//plus 1 to draw the right most and bottom line\n //canvasHeight +=1;\n canvas.width = canvasWidth;\n canvas.height = canvasWidth;\n\n cellLength = (canvasWidth-1) / customRow;\n canvas2D.clearRect(0, 0, canvasWidth, canvasHeight);\n resetEditor();\n\n}", "function ognutyun(level) {\n var v = document.getElementsByTagName(\"td\")\n var ga = document.getElementsByClassName(\"gamediv\")[0]\n var ogndiv = document.createElement(\"div\")\n var b\n for (let f = 0; f < v.length; f++) {\n if (v[f].id==20-10&&v[f].parentElement.id==11-3) {\n b=v[f] \n \n break\n }\n \n }\n if (level==0) {\n \n v[152].append(ogndiv)\n }\n else if (level== 1) {\n\n b.append(ogndiv)\n\n }\n else if (level== 2) {\n v[156].append(ogndiv)\n }\n else if (level== 3) {\n v[190].append(ogndiv)\n }\n \n \n \n ogndiv.setAttribute(\"class\",\"klors\")\n// ogndiv.style.width = ga.offsetWidth/1.5-2 + \"px\"\n// ogndiv.style.height = ga.offsetWidth/1.5-2 + \"px\"\n var tbl = document.createElement('table')\n ogndiv.appendChild(tbl)\n tbl.setAttribute(\"class\", \"table2\")\n \n var tbd = document.createElement('tbody')\n \n tbl.appendChild(tbd)\n var m = 20\n var n = 20\n \n var chap1 = ga.offsetHeight\n \n var verj = ga.offsetWidth/32\n \n for (let i = 0; i < m; i++) {\n var tr = document.createElement('tr')\n tbd.appendChild(tr)\n tr.setAttribute(\"id\", i)\n \n // tr.style.height = verj-2 + 'px'\n tr.style.height = verj + 'px'\n for (let j = 0; j < n; j++) {\n var td = document.createElement('td')\n tr.appendChild(td)\n td.setAttribute(\"class\", \"td\")\n td.setAttribute(\"id\", j)\n td.style.backgroundColor = \"transparent\"\ntd.style.width = verj + \"px\"\n // td.style.width = 30 + 'px'\n // td.style.height = 42 + 'px'\n\n td.onclick = function (params) {\n if (level==0) {\n if (this.id == 7 && this.parentElement.id == 0 || this.id == 8 && this.parentElement.id == 0 || this.id == 6 && this.parentElement.id == 1 || this.id == 7 && this.parentElement.id == 1 || this.id == 8 && this.parentElement.id == 1 || this.id == 9 && this.parentElement.id == 1 || this.id == 6 && this.parentElement.id == 2 || this.id == 7 && this.parentElement.id == 2 || this.id == 8 && this.parentElement.id == 2 || this.id == 9 && this.parentElement.id == 2 || this.id == 10 && this.parentElement.id == 2 || this.id == 12 && this.parentElement.id == 2 || this.id == 13 && this.parentElement.id == 2 || this.id == 5 && this.parentElement.id == 3 || this.id == 6 && this.parentElement.id == 3 || this.id == 7 && this.parentElement.id == 3|| this.id == 8 && this.parentElement.id == 3|| this.id ==9 && this.parentElement.id == 3|| this.id == 10 && this.parentElement.id == 3|| this.id == 12 && this.parentElement.id == 3|| this.id == 13 && this.parentElement.id == 3|| this.id == 5 && this.parentElement.id == 4|| this.id == 6 && this.parentElement.id == 4|| this.id ==7 && this.parentElement.id == 4|| this.id == 8 && this.parentElement.id == 4|| this.id == 9 && this.parentElement.id == 4|| this.id == 10 && this.parentElement.id == 4|| this.id == 11 && this.parentElement.id == 4|| this.id == 12 && this.parentElement.id == 4|| this.id == 13 && this.parentElement.id == 4|| this.id == 5 && this.parentElement.id == 5|| this.id == 6 && this.parentElement.id == 5|| this.id == 7 && this.parentElement.id == 5|| this.id == 8 && this.parentElement.id == 5|| this.id == 9 && this.parentElement.id == 5|| this.id == 10 && this.parentElement.id == 5|| this.id == 11 && this.parentElement.id == 5|| this.id == 12 && this.parentElement.id == 5|| this.id == 5 && this.parentElement.id == 6|| this.id == 6 && this.parentElement.id == 6|| this.id == 7 && this.parentElement.id == 6|| this.id == 8 && this.parentElement.id == 6|| this.id == 9 && this.parentElement.id == 6|| this.id == 10 && this.parentElement.id == 6|| this.id == 11 && this.parentElement.id == 6|| this.id==12 && this.parentElement.id == 6|| this.id == 13 && this.parentElement.id == 6|| this.id == 14 && this.parentElement.id == 6|| this.id == 4 && this.parentElement.id == 7|| this.id == 5 && this.parentElement.id == 7|| this.id == 6 && this.parentElement.id == 7|| this.id == 7 && this.parentElement.id == 7|| this.id == 8 && this.parentElement.id == 7|| this.id == 9 && this.parentElement.id == 7|| this.id == 10 && this.parentElement.id == 7|| this.id == 11 && this.parentElement.id == 7|| this.id == 12 && this.parentElement.id == 7|| this.id == 13 && this.parentElement.id == 7|| this.id == 14 && this.parentElement.id == 7|| this.id == 4 && this.parentElement.id == 8|| this.id == 5 && this.parentElement.id == 8|| this.id == 6 && this.parentElement.id == 8|| this.id == 7 && this.parentElement.id == 8|| this.id == 9 && this.parentElement.id == 8|| this.id == 10 && this.parentElement.id == 8|| this.id == 11 && this.parentElement.id == 8|| this.id == 12 && this.parentElement.id == 8|| this.id == 13 && this.parentElement.id == 8|| this.id == 14 && this.parentElement.id == 8|| this.id == 4 && this.parentElement.id == 9|| this.id == 5 && this.parentElement.id == 9|| this.id == 6 && this.parentElement.id == 9|| this.id == 7 && this.parentElement.id == 9|| this.id == 8 && this.parentElement.id == 9|| this.id == 10 && this.parentElement.id == 9|| this.id == 11 && this.parentElement.id == 9|| this.id == 12 && this.parentElement.id == 9|| this.id == 13 && this.parentElement.id == 9|| this.id == 14 && this.parentElement.id == 9|| this.id == 15 && this.parentElement.id == 9|| this.id == 3 && this.parentElement.id == 10|| this.id == 4 && this.parentElement.id == 10|| this.id == 5 && this.parentElement.id == 10|| this.id == 6 && this.parentElement.id == 10|| this.id == 7 && this.parentElement.id == 10|| this.id == 8 && this.parentElement.id == 10|| this.id == 9 && this.parentElement.id == 10|| this.id == 10 && this.parentElement.id == 10|| this.id == 11 && this.parentElement.id == 10|| this.id == 12 && this.parentElement.id == 10|| this.id == 13 && this.parentElement.id == 10|| this.id == 14 && this.parentElement.id == 10|| this.id == 15 && this.parentElement.id == 10|| this.id == 3 && this.parentElement.id == 11|| this.id == 4 && this.parentElement.id == 11|| this.id == 5 && this.parentElement.id == 11|| this.id == 6 && this.parentElement.id == 11|| this.id == 7 && this.parentElement.id == 11|| this.id == 8|| this.id == 11 && this.parentElement.id == 9|| this.id == 11 && this.parentElement.id == 10|| this.id == 11&& this.parentElement.id == 11|| this.id == 12 && this.parentElement.id == 11|| this.id == 13 && this.parentElement.id == 11|| this.id == 14 && this.parentElement.id == 11|| this.id == 3 && this.parentElement.id == 12|| this.id == 4 && this.parentElement.id == 12|| this.id == 5 && this.parentElement.id == 12|| this.id == 6 && this.parentElement.id == 12|| this.id == 7 && this.parentElement.id == 12|| this.id == 8 && this.parentElement.id == 12|| this.id == 9 && this.parentElement.id == 12|| this.id == 10 && this.parentElement.id == 12|| this.id == 11 && this.parentElement.id == 12|| this.id == 12 && this.parentElement.id == 12|| this.id == 13 && this.parentElement.id == 12|| this.id ==3 && this.parentElement.id == 13|| this.id == 4 && this.parentElement.id == 13|| this.id == 5 && this.parentElement.id == 13|| this.id == 6 && this.parentElement.id == 13|| this.id == 7 && this.parentElement.id == 13|| this.id == 8 && this.parentElement.id == 13|| this.id == 10 && this.parentElement.id == 13|| this.id == 11 && this.parentElement.id == 13|| this.id == 12 && this.parentElement.id == 13|| this.id == 13 && this.parentElement.id == 13|| this.id == 4 && this.parentElement.id == 14|| this.id == 11 && this.parentElement.id == 13|| this.id == 12 && this.parentElement.id == 13|| this.id == 11 && this.parentElement.id == 13|| this.id == 12 && this.parentElement.id == 13|| this.id == 11 && this.parentElement.id == 13|| this.id == 12 && this.parentElement.id == 13|| this.id == 11 && this.parentElement.id == 13|| this.id == 12 && this.parentElement.id == 13|| this.id == 11 && this.parentElement.id == 13|| this.id == 12 && this.parentElement.id == 13|| this.id == 11 && this.parentElement.id == 13|| this.id == 12 && this.parentElement.id == 13|| this.id == 13 && this.parentElement.id == 13|| this.id == 4 && this.parentElement.id == 14|| this.id == 5 && this.parentElement.id == 14|| this.id == 6 && this.parentElement.id == 14|| this.id == 7 && this.parentElement.id == 14|| this.id == 8 && this.parentElement.id == 14|| this.id == 9 && this.parentElement.id == 14|| this.id == 10 && this.parentElement.id == 14|| this.id == 11 && this.parentElement.id == 14|| this.id == 12 && this.parentElement.id == 14|| this.id == 4 && this.parentElement.id == 15|| this.id == 5 && this.parentElement.id == 15|| this.id == 6 && this.parentElement.id == 15|| this.id == 7 && this.parentElement.id == 15|| this.id == 8 && this.parentElement.id == 15|| this.id == 9 && this.parentElement.id == 15|| this.id == 10 && this.parentElement.id == 15|| this.id == 11 && this.parentElement.id == 15|| this.id == 4 && this.parentElement.id == 16||this.id == 5 && this.parentElement.id == 16|| this.id == 6 && this.parentElement.id == 16|| this.id == 7 && this.parentElement.id == 16|| this.id == 8&& this.parentElement.id == 16|| this.id == 9 && this.parentElement.id == 16|| this.id == 10 && this.parentElement.id == 16|| this.id == 11 && this.parentElement.id == 16|| this.id == 6 && this.parentElement.id == 17|| this.id == 7 && this.parentElement.id == 17|| this.id == 8 && this.parentElement.id == 17|| this.id == 9 && this.parentElement.id == 17|| this.id == 10 && this.parentElement.id == 17|| this.id == 11 && this.parentElement.id == 17|| this.id == 6 && this.parentElement.id == 18|| this.id == 7 && this.parentElement.id == 18|| this.id == 8 && this.parentElement.id == 18|| this.id == 9 && this.parentElement.id == 18|| this.id == 11 && this.parentElement.id == 18) {\n var ts = document.getElementsByClassName(\"table\")[0]\n \n \n ts.classList.add(\"comp\")\n \n \n ts.style.backgroundImage = \"url(img/compl/1.png)\"\n paraadam()\n gamelev = 1\n lev = 1\n localStorage.setItem(\"lev\", gamelev)\n\n\n setTimeout(() => {\n \n l1()\n }, chap); \n \n }\n else{\n paraadamdel()\n\n tanel(this)\n }\n\n }\n else if (level==1) {\n if (this.id == 12 && this.parentElement.id == 7 || this.id == 13 && this.parentElement.id == 7 || this.id == 14 && this.parentElement.id == 7 || this.id == 12 && this.parentElement.id == 8 || this.id == 13 && this.parentElement.id == 8 || this.id == 14 && this.parentElement.id == 8|| this.id == 15 && this.parentElement.id == 8|| this.id == 16 && this.parentElement.id == 8|| this.id == 17 && this.parentElement.id == 8|| this.id == 18 && this.parentElement.id == 8|| this.id == 13 && this.parentElement.id == 9|| this.id == 14 && this.parentElement.id == 9 || this.id == 15 && this.parentElement.id == 9|| this.id == 16 && this.parentElement.id == 9|| this.id == 17 && this.parentElement.id == 9|| this.id == 18 && this.parentElement.id == 19|| this.id == 13 && this.parentElement.id == 10|| this.id == 14 && this.parentElement.id == 10|| this.id == 15 && this.parentElement.id == 10|| this.id == 16 && this.parentElement.id == 10|| this.id == 17 && this.parentElement.id == 10|| this.id == 18 && this.parentElement.id == 10|| this.id == 19 && this.parentElement.id == 10) {\n var ts = document.getElementsByClassName(\"table\")[0]\n \n \n ts.classList.add(\"comp\")\n paraadam()\n \n ts.style.backgroundImage = \"url(img/compl/7.png)\"\n gamelev = 2\n lev = 2\n localStorage.setItem(\"lev\", gamelev)\n\n\n setTimeout(() => {\n l3()\n }, 2000);\n\n }\n else {\n paraadamdel()\n tanel(this)\n }\n }\n else if (level==2) {\n if (this.id == 6 && this.parentElement.id == 7 || this.id == 7 && this.parentElement.id == 7 || this.id == 5 && this.parentElement.id == 8 || this.id == 6 && this.parentElement.id == 8 || this.id == 7 && this.parentElement.id == 8 || this.id == 8 && this.parentElement.id == 8|| this.id == 5 && this.parentElement.id == 9|| this.id == 6 && this.parentElement.id == 9|| this.id == 7 && this.parentElement.id == 9|| this.id == 8 && this.parentElement.id == 9|| this.id == 5 && this.parentElement.id == 10|| this.id == 6 && this.parentElement.id == 10 || this.id == 7 && this.parentElement.id == 10|| this.id == 8 && this.parentElement.id == 10|| this.id == 6 && this.parentElement.id == 11|| this.id == 7 && this.parentElement.id == 11|| this.id == 6 && this.parentElement.id == 12|| this.id == 7 && this.parentElement.id == 12|| this.id == 8 && this.parentElement.id == 12|| this.id == 7 && this.parentElement.id == 13) {\n var ts = document.getElementsByClassName(\"table\")[0]\n \n \n ts.classList.add(\"comp\")\n paraadam()\n \n ts.style.backgroundImage = \"url(img/compl/5.png)\"\n gamelev = 3\n lev = 3\n localStorage.setItem(\"lev\", gamelev)\n\n\n setTimeout(() => {\n l4()\n }, chap);\n\n }\n else {\n paraadamdel()\n tanel(this)\n }\n }\n else if (level==3) {\n if (this.id == 6 && this.parentElement.id == 7 || this.id == 7 && this.parentElement.id == 7 || this.id == 5 && this.parentElement.id == 8 || this.id == 6 && this.parentElement.id == 8 || this.id == 7 && this.parentElement.id == 8 || this.id == 8 && this.parentElement.id == 8|| this.id == 5 && this.parentElement.id == 9|| this.id == 6 && this.parentElement.id == 9|| this.id == 7 && this.parentElement.id == 9|| this.id == 8 && this.parentElement.id == 9|| this.id == 5 && this.parentElement.id == 10|| this.id == 6 && this.parentElement.id == 10 || this.id == 7 && this.parentElement.id == 10|| this.id == 8 && this.parentElement.id == 10|| this.id == 6 && this.parentElement.id == 11|| this.id == 7 && this.parentElement.id == 11|| this.id == 6 && this.parentElement.id == 12|| this.id == 7 && this.parentElement.id == 12|| this.id == 8 && this.parentElement.id == 12|| this.id == 7 && this.parentElement.id == 13) {\n var ts = document.getElementsByClassName(\"table\")[0]\n \n \n ts.classList.add(\"comp\")\n paraadam()\n \n ts.style.backgroundImage = \"url(img/compl/4.png)\"\n gamelev = 4\n lev = 4\n localStorage.setItem(\"lev\", gamelev)\n\n\n setTimeout(() => {\n l5()\n }, chap);\n\n }\n else {\n paraadamdel()\n tanel(this)\n }\n }\n}\n\n \n }\n \n \n }\n ogndiv.style.width = 10*20 + \"px\"\n ogndiv.style.height = 10*20 + \"px\"\n\n}", "function updateMap() {\n\t\t\tid = trail_select.value;\n\t\t\tconsole.log(id);\n\t\t\tvar newlayer = layer.getLayer(id);\n\t\t\tnewlayer.removeFrom(map);\n\t\t\tnewlayer.setStyle({\n\t\t\t\t\tweight: 5,\n\t\t\t\t\tcolor: '#00ff00',\n\t\t\t\t\topacity: 1.0\n\t\t\t});\n\t\t\tnewlayer.addTo(map)\n\t\t\tvar prevlayer = layer.getLayer(previd);\n\t\t\tif (previd !== id) {\n\t\t\t\tprevlayer.setStyle({\n\t\t\t\t\tcolor: '#ff7800',\n\t\t\t\t\topacity: 1.0,\n\t\t\t\t\tweight: (prevlayer.feature.properties.annual*0.17)**4\n\t\t\t\t});\n\t\t\t\tprevlayer.addTo(map);\n\t\t\t\tprevid = id;\n\t\t\t}\n\t\t}", "function draw_map(map) {\n for (let i = 0; i < map.length; i++) {\n let x1 = parseInt(i % 100);\n let x2 = parseInt(i / 100);\n drawcell(x1, x2, map[i]);\n }\n}", "function place(size) {\n return function() {\n let row = this.parentNode.rowIndex; // I believe these lines get the info from the cell clicked so ships will be placed in the right location\n let col = this.cellIndex;\n\n // this receives info on weather or not the play check the box for vertical\n // *** it will need to be changed for the arrow keys to work ****\n // dont think we need this line anymore\n //vertical = document.getElementById(\"is_vertical\").checked;\n let table = document.getElementById(\"player\"); // this makes sure the right table is selected for ship placement\n let table2 = document.getElementById(\"player_copy\"); // i added this so player copy will be able to have the ships placed just like player\n\n // finish placement is not a function I wrote, the lines of code it contains used to be a part of place function\n // but I needed it to place for both player and player copy so instead of just copying all the code I took what\n // was already there and put it into a function so I could reuse the code.\n finishPlacement(size,table, vertical);\n finishPlacement(size,table2, vertical);\n\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('<tablebody></tablebody>');\n\n let canvasBody = canvas.find('tablebody');\n\n // draw grid row\n for (let i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n // draw grid col\nfor (let i = 0; i < gridCol; i++) {\n canvas.find('tr').append('<td class=\"transparent\"></td>');\n }\n\n }", "function loadMain() {\r\n // Create the title\r\n var title = document.getElementById(\"mapTitle\");\r\n title.innerHTML = \"Map Of UTM\";\r\n\r\n var pic = document.getElementById(\"mapImg\");\r\n pic.src = PATH + \"/campus-map.jpg\";\r\n\r\n // Loads the main Map -> Special ids for button names\r\n var table = document.getElementById(\"mapButtons\");\r\n\r\n // remove existing tables\r\n while (table.rows.length > 0) {\r\n table.deleteRow(0);\r\n }\r\n var food = document.getElementById(\"foodTable\");\r\n while (food.rows.length > 0) {\r\n food.deleteRow(0);\r\n }\r\n\r\n //update buttons\r\n var build = buildingsJSON[\"buildings\"];\r\n for (var i = 0; i < build.length; i++) {\r\n var row = table.insertRow(0);\r\n var cell = row.insertCell(0);\r\n row.id = build[i].code;\r\n var createClickHandler = function(row) {\r\n return function() {\r\n var cell = row.getElementsByTagName(\"td\")[0];\r\n var id = cell.innerHTML;\r\n loadBuilding(id);\r\n };\r\n };\r\n cell.classList.add(\"location\");\r\n row.onclick = createClickHandler(row);\r\n cell.innerHTML = build[i].code;\r\n }\r\n}", "placeInTable(y, x) {\n const piece = document.createElement('div');\n piece.classList.add('piece');\n piece.style.backgroundColor = this.currPlayer.color;\n piece.style.top = -50 * (y + 2);\n\n const spot = document.getElementById(`${y}-${x}`);\n spot.append(piece);\n }", "function finishTable( table ) {\n self.util.standardizeQuad(table);\n\n var r, c,\n id = table.parentElement.id,\n tab = table.points,\n rows = parseInt( $(table.parentElement).attr('rows') ),\n cols = parseInt( $(table.parentElement).attr('columns') ),\n after = $(table.parentElement);\n\n for ( c=1; c<=cols; c++ )\n for ( r=1; r<=rows; r++ ) {\n var\n elem = $(document.createElementNS(self.util.sns,'polygon'))\n .attr('points',$(table).attr('points'))\n .addClass('Coords'),\n\n top1 = c == 1 ? Point2f(tab[0]) : Point2f(tab[1]).subtract(tab[0]).hadamard((c-1)/cols).add(tab[0]),\n top2 = c == cols ? Point2f(tab[1]) : Point2f(tab[1]).subtract(tab[0]).hadamard(c/cols) .add(tab[0]),\n bottom1 = c == 1 ? Point2f(tab[3]) : Point2f(tab[2]).subtract(tab[3]).hadamard((c-1)/cols).add(tab[3]),\n bottom2 = c == cols ? Point2f(tab[2]) : Point2f(tab[2]).subtract(tab[3]).hadamard(c/cols) .add(tab[3]),\n left1 = r == 1 ? Point2f(tab[0]) : Point2f(tab[3]).subtract(tab[0]).hadamard((r-1)/rows).add(tab[0]),\n left2 = r == rows ? Point2f(tab[3]) : Point2f(tab[3]).subtract(tab[0]).hadamard(r/rows) .add(tab[0]),\n right1 = r == 1 ? Point2f(tab[1]) : Point2f(tab[2]).subtract(tab[1]).hadamard((r-1)/rows).add(tab[1]),\n right2 = r == rows ? Point2f(tab[2]) : Point2f(tab[2]).subtract(tab[1]).hadamard(r/rows) .add(tab[1]);\n intersection( top1, bottom1, left1, right1, elem[0].points[0] );\n intersection( top2, bottom2, left1, right1, elem[0].points[1] );\n intersection( top2, bottom2, left2, right2, elem[0].points[2] );\n intersection( top1, bottom1, left2, right2, elem[0].points[3] );\n\n after = $(document.createElementNS(self.util.sns,'g'))\n .addClass('TextRegion TableCell')\n .attr('tableid',id)\n .attr('id',id+'_'+r+'_'+c)\n .append(elem)\n .insertAfter(after);\n }\n\n $(self.util.svgRoot)\n .find('.TextRegion[id^='+id+']')\n .addClass('editable')\n .each( function () {\n this.setEditing = function ( ) {\n var event = { target: this };\n self.util.setEditing( event, 'select' );\n };\n } );\n window.setTimeout( function () {\n var elem = $(self.util.svgRoot).find('.TextRegion[id^='+id+']')[0];\n elem.setEditing();\n self.util.selectElem(elem,true);\n }, 50 );\n\n self.util.registerChange('added table '+id);\n\n for ( var n=0; n<self.cfg.onFinishTable.length; n++ )\n self.cfg.onFinishTable[n](table);\n }", "function placeInTable(y, x) {\n // TODO: make a div and insert into correct table cell\n let circle = document.createElement('div');\n circle.classList.add(\"piece\", `p${currPlayer}`);\n \n // somhow access td id, then append circle to this td\n let square = document.getElementById(`${y}-${x}`);\n square.append(circle);\n\n}", "function loadTable() {\t\n\t\t\t\t\t\t\tdebugger\n\t\t\t\t\t\t\tdatabaseRectList = new Array();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (var i = 0; i < self.Rects.length; i++) {\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tvar rect = new fabric.Rect({\n\t\t\t\t\t\t\t\t\t \twidth: parseInt(self.Rects[i].width),\n\t\t\t\t\t\t\t height: parseInt(self.Rects[i].length),\n\t\t\t\t\t\t\t top: parseInt(self.Rects[i].ry),\n\t\t\t\t\t\t\t left: parseInt(self.Rects[i].rx),\n\t\t\t\t\t\t\t id: parseInt(self.Rects[i].id),\n\t\t\t\t\t\t\t name: 'rect',\n\t\t\t\t\t\t\t text: 'rexct',\n\t\t\t\t\t\t\t fill: 'lightgray',\n\t\t\t\t\t\t\t stroke: 'black',\n\t\t\t\t\t\t\t strokeWidth: 2\n\t\t\t\t\t\t\t\t\t});\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdatabaseRectList.push(rect);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// add the shape to the\n\t\t\t\t\t\t\t}", "update(map)\n {\n if (this.container === null)\n {\n this.init(map);\n }\n\n this.coins.graphics.clear();\n this.treasures.graphics.clear();\n const info_arr = map.eData();\n const size_x = map.SIZE_X;\n const size_y = map.SIZE_Y;\n\n for (let i = 0; i < size_x; i++)\n {\n const screen_y = this.size * i;\n for (let j = 0; j < size_y; j++)\n {\n const screen_x = this.size * j;\n if (info_arr[i][j] === BaseMapInfo.getElementsByTagName(\"gold\"))\n {\n this.paintCoin(screen_x, screen_y);\n }\n else if (info_arr[i][j] === BaseMapInfo.getElementsByTagName(\"end\"))\n {\n this.paintFinish(screen_x, screen_y);\n }\n }\n }\n }", "function drawGameBoard (id){\n var placeholder = document.getElementById(id);\n \n for(var i = 0; i < row; i++){\n for(var j = 0; j < col; j++){\n var gridCell = document.createElement(\"div\");\n \n placeholder.appendChild(gridCell);\n gridCell.classList.add(\"gridItem\");\n gridCell.setAttribute(\"id\", `${id}-${i}-${j}`);\n }\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 }", "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 createTable(id, data, col) {\n const area = document.getElementById(id);\n\n for (let i = 0; i < data.length; i = i + col) {\n for (let j = 0; j < col; j++) {\n let element = makeElement('div', 'cell', data[i + j]);\n area.appendChild(element);\n }\n area.appendChild(makeElement('div', 'clear'));\n }\n}", "function drawTable(data, target) {\n // pull just the features from the geojson data set\n const courses = data.features;\n\n // iterate through those features, and build out the row for each course, then\n // append that row to the target table\n $.each(courses, (k, v) => {\n const properties = v.properties;\n if (target === 'top-100-table') {\n const row = `<tr><td>${properties.rank}</td><td>${properties.coursename}</td><td>${properties.city}</td><td>${properties.access}</td><td>${properties.fee}</td>`;\n $(`#${target}`).append(row);\n } else {\n const row = `<tr><td>${properties.rank}</td><td>${properties.coursename}</td><td>${properties.city}</td><td>${properties.fee}</td>`;\n $(`#${target}`).append(row);\n }\n });\n\n if (target === 'public-table') {\n console.log($('#public-table').find('tr').eq(1).html());\n $('#public-table').find('tr').eq(1).before('<h6>Expensive</h6>');\n $('#public-table').find('tr').eq(26).before('<h6>High</h6>');\n $('#public-table').find('tr').eq(51).before('<h6>Economy</h6>');\n }\n\n // lastly, resize the embed\n pymChild.sendHeight();\n}", "placeInTable(y, x) {\n const piece = document.createElement('div');\n piece.classList.add('piece');\n piece.classList.add(`${this.currPlayer.color}`);\n piece.style.top = -50 * (y + 2);\n const spot = document.getElementById(`${y}-${x}`);\n spot.append(piece);\n this.dropDown(spot, piece);\n }", "function load(size) {\n\tvar square_size = $(\"#wrapper\").width() / size -2; // -2 for borders //play around with this\n\t//create the size x size grid here\n\tfor (var x = 0; x < size; x++) { //row or column?\n\t\tfor (var y = 0; y < size; y++) {\n\t\t\t$(\"#wrapper\").append(\"<div class='square'></div>\")\n\t\t}\n\t$(\"#wrapper\").append(\"<div class='new_row'></div>\");\n\t}\n\n\t//Adjustment for the square size\n\t$(\".square\").css('width',square_size);\n\t$(\".square\").css('height',square_size);\t\n\n}", "placeInTable(y, x) {\n const piece = document.createElement('div');\n piece.classList.add('piece');\n // Add in custom color functionality.\n piece.style.backgroundColor = this.currPlayer.color;\n piece.style.top = -50 * (y + 2);\n\n const spot = document.getElementById(`${y}-${x}`);\n spot.append(piece);\n }", "function initializeGridSize() {\n// var boardElement = document.querySelector(\".board\");\n\n array_GridTiles = document.querySelectorAll(\"#tile\");\n //go thru all found GridTiles, rename their ID to match the grid size\n\n \n array_GridTiles[1].appendChild(charOneSpr);\n array_GridTiles[2].appendChild(charTwoSpr);\n\n}", "function createGrid(height, width) {\n bodyTable.innerHTML = \"\";\n for (let h = 0; h < height; h++) { \n var row = document.createElement(\"tr\");\n for (let w = 0; w < width; w++) {\n var column = document.createElement(\"td\");\n row.appendChild(column); \n }\n bodyTable.appendChild(row); \n }\n pixelCanvas.appendChild(bodyTable); \n event.preventDefault();\n bodyTable.addEventListener('click', addColor) \n}", "function makeGrid() {\n $(\"tr\").remove();\n for (var h = 0; h < canvasHeight; h++) {\n var row = \"<tr>\";\n for (var w = 0; w < canvasWidth; w++) {\n tdNo++;\n row += '<td id=\"td' + tdNo + '\"></td>';\n }\n row += \"</tr>\";\n\n canvasCtl.append(row);\n }\n}", "function redrawTable(tbl, itemsdata) {\n tbl.clear();\n for (var i = 0; i < data.length; i++) {\n tbl.row.add(data[i]);\n }\n tbl.draw();\n }", "function makeGrid(x, y) {\n\t//removing whatever tr that has been created...\n\t$('tr').remove();\n\t//using nexted for loop to create a new tr and td and loop over tr to create new td.\n\tfor(let i = 1; i <= x; i++){\n\t\t$(\"#pixelCanvas\").append('<tr id=table'+i+'> </tr>');\n\t\tfor(let k = 1; k <= y; k++){\n\t\t\t$(\"#table\" + i).append(\"<td></td>\");\n\t\t}\n\t}\n\t//creating an eventlistener .click to set a color when ever we click inside the td..\n\t$(\"td\").click(function addColor(){\n\t//selecting color value and saving it inside var color.\n\tcolor = document.getElementById(\"colorPicker\").value;\n\t//using conditional sratement to add and remove color whenever we click inside td\n\tif($(this).attr(\"style\")){\n\t\t$(this).removeAttr(\"style\");\t\n\t} else{\n\t\t$(this).css(\"background-color\", color);\n\t}\n});\n\n}", "function refreshTable(_actualcoords){\n\n\tdocument.getElementById(\"lati1\").innerHTML = _actualcoords[0].latitud;\n\tdocument.getElementById(\"long1\").innerHTML = _actualcoords[0].longitud;\n\tdocument.getElementById(\"date1\").innerHTML = _actualcoords[0].timestamp;\n\tlet S1 = _actualcoords[0].sensor;\n\tdocument.getElementById(\"sensor1\").innerHTML = S1+\"cm\";\n\n\tdocument.getElementById(\"lati2\").innerHTML = _actualcoords[1].latitud;\n\tdocument.getElementById(\"long2\").innerHTML = _actualcoords[1].longitud;\n\tdocument.getElementById(\"date2\").innerHTML = _actualcoords[1].timestamp;\n\tlet S2= _actualcoords[1].sensor.split(\"/\");\n\tdocument.getElementById(\"sensor2\").innerHTML = S2[0]+\"X/\"+S2[1]+\"Y/\"+S2[2]+\"Z\";\n\n\t//CENTER MAP ON THE TRUCK \n\tif (usertruck == 1){\n\t\tmymap.setView(livemarker[0].getLatLng()); //Zoom working , zoom ) \n\t}else if (usertruck == 2){\n\t\tmymap.setView(livemarker[1].getLatLng());\n\t}else{\n\t\tconsole.log(\"TIENE LIBERTAD EN EL MAPA\")\n\t}\n\n\n}", "function placeInTable(y, x) {\n // TODO: make a div and insert into correct table cell\n //Student Comment: Create game piece by making a div. Adding class of piece to give it a shape. Adding class of player{1 or 2} for piece color. Place piece in proper spot on table by storing cell element with matching ID in variable placement. Appending the piece to this placement.\n\n const piece = document.createElement('div');\n piece.classList.add('piece');\n piece.classList.add(`player${currPlayer}`)\n const placement = document.getElementById(`${y}-${x}`);\n placement.append(piece);\n}", "function buildBoard(size){\n\t\t\t$(\"#board\").append( $(\"<table id='boardId'>\").addClass(\"boardTable\") );\n\t\t\tfor (i = 0; i < size; ++i) {\n\t\t\t\t$(\".boardTable\").append( $(\"<tr>\").addClass(\"boardRow\") );\n\t\t\t\tfor (j = 0; j < size; ++j) {\n\t\t\t\t\t$(\".boardRow:last\").append( $(\"<td>\").addClass(\"boardCell\").data(\"column\",j)\n\t\t\t\t\t.click(function() {\n var __this = this;\n\t\t\t\t\t\tif(turn==0) {\n if (firstMove) {\n persistNewGame(function(err,game){\n if (err) {\n Materialize.toast('Sorry, something went wrong with creating the new game.', 4000);\n }\n firstMove = false;\n gameId = game.id;\n playColumn(jQuery.data(__this,\"column\"));\n });\n } else {\n playColumn(jQuery.data(__this,\"column\"));\n }\n }\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function placeInTable(x, y) {\n const piece = document.createElement('div');\n piece.classList.add('piece');\n piece.classList.add(`p${currPlayer}`);\n piece.style.animationName = `row${y}`; //animate drop depth based on row#\n piece.style.top = -50 * (y + 2); //(top is refering to top of table (each square is 50px + 2 for the space between)\n\n const spot = document.getElementById(`${y}-${x}`); //location for piece to drop to\n spot.append(piece);\n}", "function radwegHinzufuegen(clicked_id){\n if (clicked_id == \"themenradweg_1\"){\n themenradweg_1.addTo(map);\n map.fitBounds(themenradweg_1.getBounds());\n\n \n }if (clicked_id ==\"themenradweg_2\"){\n themenradweg_2.addTo(map);\n map.fitBounds(themenradweg_2.getBounds());\n\n\n }if(clicked_id ==\"themenradweg_3\"){\n themenradweg_3.addTo(map);\n map.fitBounds(themenradweg_3.getBounds());\n\n\n }if(clicked_id ==\"themenradweg_4\"){\n themenradweg_4.addTo(map);\n map.fitBounds(themenradweg_4.getBounds());\n \n\n }if(clicked_id ==\"themenradweg_5\"){\n themenradweg_5.addTo(map);\n map.fitBounds(themenradweg_5.getBounds());\n\n }if(clicked_id ==\"themenradweg_6\"){\n themenradweg_6.addTo(map);\n map.fitBounds(themenradweg_6.getBounds());\n\n }\n\n}", "function draw() {\n var boxListJson = decodeHtmltoJson(boxList);\n console.log(boxListJson);\n\n // Create a data table with nodes.\n nodes = [];\n // Create a data table with links.\n edges = [];\n //Get source and destination Box IDs separatley from the List\n var srcIDArray = [], destIDArray = [], boxLabel = '';\n var srcMap = new Object();\n var destMap = new Object();\n // console.log(boxList);\n // console.log(JSON.parse(boxList));\n for (i = 0; i < boxListJson.length; i++) {\n // console.log(boxList[i]);\n \n srcIDArray.push(boxListJson[i].srcBoxID);\n destIDArray.push(boxListJson[i].destBoxID);\n srcMap[boxListJson[i].srcBoxID] = boxListJson[i].srcBoxname;\n destMap[boxListJson[i].destBoxID] = boxListJson[i].destBoxname;\n }\n\n //Distinct nodes List\n var uniqueNodes = [...new Set([...srcIDArray, ...destIDArray])];\n console.log(uniqueNodes);\n // console.log(uniqueNodes.length);\n //Draw the Nodes\n for (i = 0; i < uniqueNodes.length; i++) {\n boxLabel = srcMap[uniqueNodes[i]];\n\n if (!boxLabel)\n boxLabel = destMap[uniqueNodes[i]];\n\n nodes.push({\n id: uniqueNodes[i], \n label: boxLabel, \n box: uniqueNodes[i], \n value: 3, \n fixed: false, \n physics: false, \n borderWidth: 2, \n borderWidthSelected: 4, \n color: { \n border: '#2B7CE9', \n background: '#97C2FC', \n highlight: { \n border: '#2B7CE9', \n background: \n '#D2E5FF' \n }, \n hover: { \n border: '#2B7CE9', \n background: '#D2E5FF' \n }\n } \n });\n }\n\n //Draw the Edges\n for (var i in boxListJson) {\n console.log(boxListJson[i].srcBoxID + ' ' + boxListJson[i].destBoxID);\n\n if (boxListJson[i].score <= 20)\n EDGE_LENGTH_SUB = 80;\n else if (boxListJson[i].score > 20 && boxListJson[i].score <= 40)\n EDGE_LENGTH_SUB = 120;\n else if (boxListJson[i].score > 40 && boxListJson[i].score <= 60)\n EDGE_LENGTH_SUB = 160;\n else if (boxListJson[i].score > 60 && boxListJson[i].score <= 80)\n EDGE_LENGTH_SUB = 200;\n else\n EDGE_LENGTH_SUB = 240;\n\n //\tnodes.push({id: boxList[i].srcBoxID, label: boxList[i].srcBoxname, box: boxList[i].srcBoxname, group: 'desktop', value: 3, fixed: false, physics:false, color: BridgeNodeColor});\n edges.push({ \n from: boxListJson[i].srcBoxID, \n to: boxListJson[i].destBoxID, \n arrows: { \n to: { \n enabled: true, \n type: 'circle' \n } \n }, \n length: EDGE_LENGTH_SUB, \n color: BridgeLinkColor \n });\n }\n\n // legend\n var mynetwork = document.getElementById('mynetwork');\n var x = - mynetwork.clientWidth / 2 + 50;\n var y = - mynetwork.clientHeight / 2 + 50;\n var step = 70;\n\n // create a visualization network\n var container = document.getElementById('mynetwork');\n var data = {\n nodes: nodes,\n edges: edges\n };\n var options = {\n nodes: {\n //shape: 'dot',\n size: 20,\n borderWidth: 2,\n font: {\n size: 16,\n color: '#000000'\n },\n scaling: {\n min: 16,\n max: 32,\n }\n },\n edges: {\n color: GRAY,\n smooth: true,\n width: 2\n },\n layout: {\n randomSeed: 1,\n improvedLayout: true,\n },\n physics: {\n \"enabled\": true,\n \"minVelocity\": 0.75\n },\n interaction: {\n navigationButtons: true,\n hover: true,\n keyboard: true\n },\n groups: {\n 'switch': {\n shape: 'triangle',\n color: '#FF9900' // orange\n }\n }\n };\n\n network = new vis.Network(container, data, options);\n network.on(\"click\", function (params) {\n console.log(params);\n params.event = \"[original event]\";\n if (params.nodes == \"\") {\n }\n else {\n var nodeId = params.nodes;\n //window.parent.receiveValueBox(nodes[i]);\n }\n });\n\n var myInput = $(\"#mynetwork\");\n var inputOpentip = new Opentip(myInput, { showOn: null, style: 'glass' });\n var count = 0;\n\n network.on(\"hoverNode\", function (params) {\n params.event = \"[original event]\";\n var nodeId = params.node;\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].id == nodeId) {\n count = i;\n break;\n }\n }\n\n inputOpentip.setContent(\"Node label: \" + nodes[count].label + \" Id: \" + nodes[count].id);\n inputOpentip.show();\n });\n \n network.on(\"blurNode\", function (params) {\n inputOpentip.hide();\n });\n}", "function insertMapResizeForm()\r\n {\r\n\t\tvar count = 0;\r\n\t\tif (document.body.innerHTML.indexOf(\"att.png\") >= 0)\r\n\t\t{\r\n\t\t\tcount = 14;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tcount = 13;\r\n\t\t}\r\n\t\t\r\n\t\tvar myRow = document.getElementsByTagName(\"table\")[count].insertRow(1);\r\n\t\tvar myTd1 = create(\"td\");\r\n\t\tmyTd1.innerHTML = 'Kartengr&ouml;&szlig;e <input type=\"text\" size=\"2\" maxlength=\"2\" id=\"my_map_size\" value=\"'+GM_getValue(\"map_size\",10)+'\" /> <span style=\"font-size: 8px\">(max 15)</span>';\r\n\t\tvar myTd2 = create(\"td\");\r\n\t\tvar myButton = create(\"input\");\r\n\t\tmyButton.type = \"submit\";\r\n\t\tmyButton.value = \"Speichern\";\r\n\t\tmyButton.addEventListener(\"click\",saveMapSize,false);\r\n\t\t\r\n\t\tmyTd2.appendChild(myButton);\r\n\t\tmyRow.appendChild(myTd1);\r\n\t\tmyRow.appendChild(myTd2);\r\n }", "function setMapSize(){\n\t//si la fenetre est inferieur a x alors on met la carte en largeur max (typiquement on est sur un smartphone)\n\tif(window.innerWidth < 769){\n\t\tvar largeur_a_enlever_a_la_carte = 0;\n\t\tvar hauteur_a_rajouter_a_la_liste = 50;\n\t}\n\telse{\n\t\tvar largeur_a_enlever_a_la_carte = 300;\n\t\tvar hauteur_a_rajouter_a_la_liste = 0;\n\t}\n\t//si le navigateur est internet explorer\n\tif (MQA.browser.name == \"msie\"){\n\t\tdocument.getElementById('map').style.width = document.body.offsetWidth - 20 - largeur_a_enlever_a_la_carte;\n\t\tdocument.getElementById('map').style.height = document.body.offsetHeight - $('#offset').height() - 20;\n\t\talert(\"Internet Explorer ne permet pas d'afficher les équipes et leur parcours. Utilisez un navigateur plus récent comme Chrome ou Firefox.\");\n\t\t//meme chose pour la liste\n\t\tdocument.getElementById('userlist').style.height = document.body.offsetHeight - $('#offset').height() - 20;\n\t} else {\n\t\tdocument.getElementById('map').style.width = window.innerWidth - largeur_a_enlever_a_la_carte;\n\t\tdocument.getElementById('map').style.height = window.innerHeight - $('#offset').height();\n\t\t//meme chose pour la liste\n\t\tdocument.getElementById('userlist').style.height = window.innerHeight - $('#offset').height() + hauteur_a_rajouter_a_la_liste;\t\n\t}\n\t\n}", "function setMapSize() {\n detail = +document.getElementById(\"detail\").value;\n ctx.canvas.width = document.getElementById(\"width_slider\").value;\n ctx.canvas.height = document.getElementById(\"height_slider\").value;\n}", "function generateMathPanel(tableID, rows, colums, bound, width, height, increaseX, increaseY, baseX, baseY) {\n var $tbody = $('#' + tableID).find('tbody');\n var position_x = baseX;\n var position_y = baseY;\n var count = 1;\n for(var i = 1; i <= rows; i++) {\n var $tr = $('<tr></tr>').addClass(\"math-table-tr\");\n for (var j = 1; j <= colums; j++) {\n var $cell = $('<td></td>').addClass(\"math-table-cell\");\n var $div = $('<div></div>').addClass(\"math-table-item\");\n if (count > bound) {\n continue;\n }\n\n $div.css('background-position', position_x + 'px ' + position_y + 'px');\n $div.css('width', width + 'px');\n $div.css('height', height + 'px');\n\n $div.attr('id', 'math-symbol-' + math_count);\n $cell.attr('id', 'math-cell-' + math_count);\n $cell.attr('data-symbol', math_count);\n\n position_x += increaseX;\n position_y += increaseY;\n\n math_count++;\n count++;\n\n // append div into cell\n $cell.html($div[0]);\n // append cell into tr\n $tr.append($cell[0]);\n }\n // append tr to tbody\n $tbody.append($tr[0]);\n }\n}", "function showTable(stateID) {\n\n let theData;\n\n if (stateID == 0) {\n theData = bigData;\n } else {\n theData = dataset[stateID];\n }\n\n // If there is no shooting we return\n if (!theData || theData.length == 0) {\n return;\n }\n\n svgTable.selectAll('table').remove();\n\n let table = svgTable\n .append(\"table\")\n .attr(\"class\", \"table table-condensed table-striped\");\n\n let thead = table.append(\"thead\");\n thead.html('<th>Date</th><th>City</th><th>Age of shooter</th><th>Number of victims</th><th>Fate of Shooter</th>');\n\n let tbody = table.append(\"tbody\")\n .on(\"wheel.zoom\", function () {\n let direction = d3.event.wheelDelta < 0 ? 'down' : 'up';\n\n if (direction === 'up') {\n tableFirstId--;\n } else {\n tableFirstId++;\n }\n\n showTable(currentId);\n });\n\n let date, age, city, fate, victims;\n\n if (tableFirstId >= theData.length) {\n tableFirstId --;\n }\n\n if (tableFirstId < 0) {\n tableFirstId = 0;\n }\n\n theData.slice(tableFirstId, tableFirstId + 9).forEach(function (d) {\n date = \"Unknown\";\n age = \"-\";\n city = \"Unknown\";\n fate = \"Unknown\";\n victims = \"-\";\n\n if (d.fields.date) {\n date = d.fields.date;\n }\n\n if (d.fields.average_shooter_age) {\n age = d.fields.average_shooter_age;\n }\n\n if (d.fields.city) {\n city = d.fields.city;\n }\n\n if (d.fields.fate_of_shooter_at_the_scene) {\n fate = d.fields.fate_of_shooter_at_the_scene;\n }\n\n if (d.fields.number_of_victims_injured) {\n victims = d.fields.number_of_victims_injured;\n }\n\n tbody.append('tr')\n .html(function () {\n return '<td>' + date + '</td>' + '<td>' + city + '</td>' + '<td>' + age + '</td>' + '<td>' + victims + '</td>' + '<td>' + fate + '</td>';\n })\n });\n\n\n // Legend plot\n table.append('g').append(\"text\")\n .attr(\"transform\", \"translate(0,\" + 60 + \")\")\n .attr('y', function (d) {\n return 0;\n })\n .style('font-style', 'italic')\n .text(function (d) {\n if (stateID === 0) {\n return \"Fig. 7 : Different mass shooting in the US\";\n }\n if (stateID < 10) {\n return \"Fig. 7 : Different mass shooting in \" + getKeyByValue(fips, \"0\" + stateID);\n }\n return \"Fig. 7 : Different mass shooting in \" + getKeyByValue(fips, \"\" + stateID);\n }).attr('x', function () {\n return 0;\n });\n}", "function init() {\n var board = document.createElement('table');\nboard.setAttribute(\"border\", 1);\nboard.setAttribute(\"cellspacing\", 0);\n\n var identifier = 1;\n for (var i = 0; i < N_SIZE; i++) {\n var row = document.createElement('tr');\n board.appendChild(row);\n for (var j = 0; j < N_SIZE; j++) {\n var cell = document.createElement('td');\n cell.setAttribute('height', 120);\n cell.setAttribute('width', 120);\n cell.setAttribute('align', 'center');\n cell.setAttribute('valign', 'center');\n cell.setAttribute('id', 'Square');\n cell.classList.add('col' + j,'row' + i);\n if (i == j) {\n cell.classList.add('diagonal0');\n }\n if (j == N_SIZE - i - 1) {\n cell.classList.add('diagonal1');\n }\n cell.identifier = identifier;\n cell.addEventListener(\"click\", set);\n row.appendChild(cell);\n boxes.push(cell);\n identifier += identifier;\n }\n }\n\n\n document.getElementById(\"tictactoe\").appendChild(board);\n startNewGame();\n}", "function crateGrid() {\n var yourGrid = document.getElementById(\"table-grid-your\");\n var enemyGrid = document.getElementById(\"table-grid-enemy\");\n var alphabet = [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\"];\n var numbers = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\"];\n var ships = data.ships;\n for (i = 0; i < alphabet.length; i++) {\n var rowU = document.createElement(\"tr\");\n var rowE = document.createElement(\"tr\");\n for (j = 0; j < numbers.length; j++) {\n var colU = document.createElement(\"td\");\n var colE = document.createElement(\"td\");\n rowU.appendChild(colU);\n rowE.appendChild(colE);\n colU.id = \"U\" + alphabet[i] + numbers[j];\n colE.id = \"E\" + alphabet[i] + numbers[j];\n colU.innerHTML = alphabet[i] + numbers[j];\n colE.innerHTML = alphabet[i] + numbers[j];\n for (k = 0; k < ships.length; k++) {\n for (l = 0; l < ships[k].location.length; l++) {\n if (ships[k].location[l] == alphabet[i] + numbers[j]) {\n colU.setAttribute(\"class\", \"ship-location\");\n }\n }\n }\n }\n yourGrid.appendChild(rowU);\n enemyGrid.appendChild(rowE);\n }\n}", "function updateshrine() {\n var shrinetab=\"<table id='shrineTab'><thead><th style='width:115px'>Change</th><th style='width:50px'>Chances</th><th>Distance</th><th>Player</th><th>City</th><th>Coords</th><th style='width:100px'>Alliance</th><th>score</th><th>Type</th></thead><tbody>\";\n var ccounter=0;\n var w=[];\n var wtot=0;\n for (var i in shrinec) {\n if (i>0) {\n var k=splayers.name.indexOf(shrinec[i][1]);\n //console.log(k,splayers);\n for (var j in splayers.cities[k]) {\n if (shrinec[i][3]==splayers.cities[k][j].b && shrinec[i][4]==splayers.cities[k][j].c) {\n shrinec[i][2]=splayers.cities[k][j].h;\n if (shrinec[i][9]==0) {\n shrinec[i][7]=splayers.cities[k][j].a;\n }\n shrinec[i][8]=splayers.ally[k];\n }\n }\n if (shrinec[i][0]==\"castle\") {\n ccounter++;\n if (ccounter<17) {\n w[ccounter]=shrinec[i][7]/shrinec[i][5];\n wtot+=shrinec[i][7]/(shrinec[i][5]);\n }\n }\n }\n }\n for (var i in w) {\n w[i]=Math.round(w[i]/wtot*100);\n }\n //console.log(shrinec);\n var ccounter=0;\n for (var i in shrinec) {\n if (i>0) {\n var cid=shrinec[i][4]*65536+Number(shrinec[i][3]);\n if (shrinec[i][0]==\"castle\") {\n ccounter++;\n if (ccounter<17) {\n if (shrinec[i][6]==\"0\") {\n shrinetab+=\"<tr style='color:purple;'><td><button data='\"+i+\"' class='greenb shrineremove' style='font-size: 10px;height: 20px;padding: 3px;width: 15px;border-radius: 4px;'>x</button>\";\n shrinetab+=\"<button id='\"+i+\"' data='castle' class='greenb shrinechange' style='font-size: 10px;height: 20px;padding-top: 3px;border-radius: 4px;'>City</button>\";\n shrinetab+=\"<button data='\"+i+\"' class='greenb shrine10k' style='font-size: 10px;height: 20px;padding: 3px;width: 25px;border-radius: 4px;'>10k</button>\";\n shrinetab+=\"<button data='\"+i+\"' class='greenb shrine7pt' style='font-size: 10px;height: 20px;padding: 3px;width: 25px;border-radius: 4px;'>7pt</button></td><td>\"+ccounter+\" - \"+w[ccounter]+\"% \"+\"</td>\";\n } else {\n shrinetab+=\"<tr style='color:green;'><td><button data='\"+i+\"' class='greenb shrineremove' style='font-size: 10px;height: 20px;padding: 3px;width: 15px;border-radius: 4px;'>x</button>\";\n shrinetab+=\"<button id='\"+i+\"' data='castle' class='greenb shrinechange' style='font-size: 10px;height: 20px;padding-top: 3px;border-radius: 4px;'>City</button>\";\n shrinetab+=\"<button data='\"+i+\"' class='greenb shrine10k' style='font-size: 10px;height: 20px;padding: 3px;width: 25px;border-radius: 4px;'>10k</button>\";\n shrinetab+=\"<button data='\"+i+\"' class='greenb shrine7pt' style='font-size: 10px;height: 20px;padding: 3px;width: 25px;border-radius: 4px;'>7pt</button></td><td>\"+ccounter+\" - \"+w[ccounter]+\"% \"+\"</td>\";\n }\n } else if (ccounter>=17 && ccounter<21) {\n shrinetab+=\"<tr><td><button data='\"+i+\"' class='greenb shrineremove' style='font-size: 10px;height: 20px;padding: 3px;width: 15px;border-radius: 4px;'>x</button>\";\n shrinetab+=\"<button id='\"+i+\"' data='castle' class='greenb shrinechange' style='font-size: 10px;height: 20px;padding-top: 3px;border-radius: 4px;'>City</button>\";\n shrinetab+=\"<button data='\"+i+\"' class='greenb shrine10k' style='font-size: 10px;height: 20px;padding: 3px;width: 25px;border-radius: 4px;'>10k</button>\";\n shrinetab+=\"<button data='\"+i+\"' class='greenb shrine7pt' style='font-size: 10px;height: 20px;padding: 3px;width: 25px;border-radius: 4px;'>7pt</button></td><td>\"+ccounter+\"</td>\";\n }\n } else {\n if (shrinec[i][6]==\"0\") {\n shrinetab+=\"<tr style='color:grey;' data='city'><td><button data='\"+i+\"' class='greenb shrineremove' style='font-size: 10px;height: 20px;padding: 3px;width: 15px;border-radius: 4px;'>x</button>\";\n shrinetab+=\"<button id='\"+i+\"' data='city' class='greenb shrinechange' style='font-size: 10px;height: 20px;padding: 3px;border-radius: 4px;width:37px;'>Castle</button>\";\n shrinetab+=\"<button data='\"+i+\"' class='greenb shrine10k' style='font-size: 10px;height: 20px;padding: 3px;width: 25px;border-radius: 4px;'>10k</button>\";\n shrinetab+=\"<button data='\"+i+\"' class='greenb shrine7pt' style='font-size: 10px;height: 20px;padding: 3px;width: 25px;border-radius: 4px;'>7pt</button></td><td></td>\";\n } else {\n shrinetab+=\"<tr style='color:#74A274;'><td><button data='\"+i+\"' class='greenb shrineremove' style='font-size: 10px;height: 20px;padding: 3px;width: 15px;border-radius: 4px;'>x</button>\";\n shrinetab+=\"<button id='\"+i+\"' data='city' class='greenb shrinechange' style='font-size: 10px;height: 20px;padding: 3px;border-radius: 4px;width:37px;'>Castle</button>\";\n shrinetab+=\"<button data='\"+i+\"' class='greenb shrine10k' style='font-size: 10px;height: 20px;padding: 3px;width: 25px;border-radius: 4px;'>10k</button>\";\n shrinetab+=\"<button data='\"+i+\"' class='greenb shrine7pt' style='font-size: 10px;height: 20px;padding: 3px;width: 25px;border-radius: 4px;'>7pt</button></td><td></td>\";\n }\n }\n shrinetab+=\"<td>\"+roundToTwo(shrinec[i][5])+\"</td><td class='playerblink'>\"+shrinec[i][1]+\"</td><td>\"+shrinec[i][2]+\"</td><td class='coordblink shcitt' data='\"+cid+\"'>\"+shrinec[i][3]+\":\"+shrinec[i][4]+\"</td><td class='allyblink'>\"+shrinec[i][8]+\"</td><td>\"+shrinec[i][7]+\"</td><td>\"+shrinec[i][0]+\"</td></tr>\";\n if (ccounter==20) {\n break;\n }\n }\n }\n shrinetab+=\"</tbody></table>\";\n $(\"#shrinediv\").html(shrinetab);\n $(\"#shrineTab td\").css(\"text-align\",\"center\");\n if (localStorage.getItem(\"hidecities\")==\"1\") {\n hidecities();\n //console.log(\"hiding\");\n }\n $(\".shrinechange\").click(function() {\n if ($(this).attr(\"data\")==\"castle\") {\n shrinec[$(this).attr(\"id\")][0]=\"city\";\n } else {\n shrinec[$(this).attr(\"id\")][0]=\"castle\";\n }\n if (shrinec[$(this).attr(\"id\")][6]==\"0\") {\n shrinec[$(this).attr(\"id\")][6]=1;\n } else {\n shrinec[$(this).attr(\"id\")][6]=0;\n }\n updateshrine();\n });\n $(\".shrineremove\").click(function() {\n shrinec.splice($(this).attr(\"data\"),1);\n updateshrine();\n });\n $(\".shrine7pt\").click(function() {\n if (shrinec[$(this).attr(\"data\")][7]!=7) {\n shrinec[$(this).attr(\"data\")][7]=7;\n shrinec[$(this).attr(\"data\")][9]=1;\n shrinec[$(this).attr(\"data\")][6]=1;\n } else {\n shrinec[$(this).attr(\"data\")][9]=0;\n shrinec[$(this).attr(\"data\")][6]=0;\n }\n updateshrine();\n });\n $(\".shrine10k\").click(function() {\n if (shrinec[$(this).attr(\"data\")][7]!=10000) {\n shrinec[$(this).attr(\"data\")][7]=10000;\n shrinec[$(this).attr(\"data\")][9]=1;\n shrinec[$(this).attr(\"data\")][6]=1;\n } else {\n shrinec[$(this).attr(\"data\")][9]=0;\n shrinec[$(this).attr(\"data\")][6]=0;\n }\n updateshrine();\n });\n }", "function init() {\n table = document.getElementById(\"gameBoard\");\n\n size = 15;\n time = 0;\n for(var i = 0; i < size + 1; i++) {\n table.insertRow();\n }\n\n for(var i = 0; i < size + 1; i++) {\n for(var j = 0; j < size + 1; j++) {\n table.rows[i].insertCell();\n if(i > 0 && j > 0) {\n table.rows[i].cells[j].addEventListener(\"click\", function() {\n this.classList.toggle(\"active\");\n });\n }\n }\n }\n data = getData();\n populateHints(data);\n}", "function createGrid(size) {\n var wrapper = $('#wrapper'),\n squareSide = 600 / size;\n $(wrapper).empty();\n for (var i = 0; i < size; i++) {\n for (var j = 0; j < size; j++) {\n $(wrapper).append('<div class=square id=xy_' + i + '_' + j + '></div>');\n\n }\n }\n\n //Single square size setting\n $('.square').css({\n \"height\": squareSide + \"px\",\n \"width\": squareSide + \"px\"\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 <table id=\"'+this.id+'_table\" class=\"table table-bordered table-striped\">\\\r\n <thead>\\\r\n <tr><th>Key</th><th># Entries</th><th>Oldest</th><th>Newest</th><th>Latest Value</th></tr>\\\r\n </thead>\\\r\n <tbody></tbody>\\\r\n </table>'\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\": '<span id=\"'+this.id+'_table_text\"></span>'\r\n }\r\n };\r\n // create the table\r\n $(\"#\"+this.id+\"_table\").DataTable(options);\r\n $(\"#\"+this.id+\"_table_text\").html('<i class=\"fas fa-spinner fa-spin\"></i> 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 }", "function addTableElement(reportMap, z1, rowNum, header, body, markers) {\n\t//var z1 = document.createElement(\"TABLE\");\n\n\tif (rowNum == 0) {\n\t\tvar row = header.insertRow(rowNum);\n\t}\n\telse {\n\t\tvar row = body.insertRow(rowNum - 1);\n\t\trow.setAttribute(\"height\", \"300\");\n\t}\n\n\tvar indexCell = row.insertCell(0);\n\tvar statusCell = row.insertCell(1);\n\tvar dateCell = row.insertCell(2);\n\tvar timeCell = row.insertCell(3);\n\tvar confCell = row.insertCell(4);\n\tvar imgCell = row.insertCell(5);\n\t//var cell7 = row.insertCell(5);\n\tindexCell.setAttribute(\"width\", \"3%\");\n\tstatusCell.setAttribute(\"width\", \"8%\");\n\tdateCell.setAttribute(\"width\", \"12%\");\n\ttimeCell.setAttribute(\"width\", \"8%\");\n\tconfCell.setAttribute(\"width\", \"10%\");\n\timgCell.setAttribute(\"width\", \"15%\");\n\t\n\n\tindexCell.innerHTML = reportMap[\"index\"];\n\t\n\tif (reportMap[\"reportStatus\"] == \"\") {\n\t\tstatusCell.innerHTML = \"Status\";\n\t}\n\telse {\n\t\tstatusCell.innerHTML ='<select style=\"width:100%;\" class=\"custom-select\" id=\"statusDrop\"><option selected disabled value=\"all\">Status</i></option><option value=\"1\">Submitted</option><option value=\"2\">Pending Action</option><option value=\"3\">In Progress</option><option = value=\"3\">Resolved</option></select>' \n\t}\n\tdateCell.innerHTML = reportMap[\"Date\"];\n\ttimeCell.innerHTML = reportMap[\"Time\"];\n\tconfCell.innerHTML = reportMap[\"confidense\"];\n\n\n\n\t//var img = document.createElement(\"IMG\");\n\t\n\tif (rowNum == 0) {\n\t\timgCell.innerHTML = \"Image\";\n\t}\n\telse {\n\t\tif (reportMap[\"reportPicture\"] == 'no image') {\n\t\t\timgCell.innerHTML = \"no image\";\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\t//set rectangle\n\t\t\tvar pothole = reportMap[\"pothole\"];\n\t\t\t\n\n\t\t\tvar canvas = create_canvas(reportMap[\"reportPicture\"], pothole, \"200\", \"200\");\n\t\t\tvar markerCanvas = create_canvas(reportMap[\"reportPicture\"], pothole, \"100%\", \"100%\");\n\t\t\t//tableDiv = create_canvas_div(\"50\",\"50\", canvas);\n\t\t\timgCell.appendChild(canvas);\n\t\t\t//save canvas to not rebuild it later\n\t\t\treportMap[\"reportPicture\"] = canvas;\n\t\t\t\n\t\t\tvar markerIndex = rowNum - 1;\n\t\t\tvar marker = markers[markerIndex];\n\t\t\t//cell6.innerHTML = \"<img id='myImg' alt='Snow' src = \\\"data:image/jpg;base64,\" +reportArray[4] + \"\\\"width = \\\"100\\\" height = \\\"80\\\">\";\n\t\t\tvar confidense = Math.round(parseFloat(reportMap[\"confidense\"]) * 100) / 100;\n\t\t\t\n\n\t\t\tvar markerDiv = create_marker_infoWindow(markerCanvas, confidense, reportMap[\"Date\"]);\n\t\t\tmarker.infoWindowContent = markerDiv;\n\t\t\t(function (marker, i) {\n\t\t\tgoogle.maps.event.addListener(marker, 'click', function () {\n\t\t\t\t//infowindow = new google.maps.InfoWindow({ content: markerDiv});\n\t\t\t\tinfoWindow.setContent(marker.infoWindowContent);\n\t\t\t\tinfoWindow.open(map, marker);\n\t\t\t})\n\t\t})(marker, i);\n\t\t}\n\t}\n\t//cell7.innerHTML = reportArray[5];\n\n}", "function resize() {\n\tmap.setSize();\n}", "function placeInTable (y, x) {\n // DONE TODO: make a div and insert into correct table cell\n const div = document.createElement ('div');\n div.classList.add ('piece');\n let spot = document.getElementById (`${y}-${x}`);\n div.classList.add (`p${currPlayer}`);\n spot.append (div);\n //div.classList.add ('id', `${y}-${x}]`);\n // div.classList.add ('column-top', `${y}-${x}]`);\n}", "function placeInTable(y, x) {\n\tlet cell = document.getElementById(`${y}-${x}`);\n\tlet newDiv = document.createElement('div');\n\tnewDiv.setAttribute('class', `piece p${currPlayer}`);\n\tcell.append(newDiv);\n}", "function showStuff(id) {\n\n var canvas = document.getElementById('canvas');\n var map = document.getElementById('cartoMap')\n \n if (id == map) {\n canvas.style.display = \"none\"; \n // This will regenerate the carto thingy\n //map.src = \"https://etienneboutet.carto.com/builder/4e530f7d-3a9a-4f85-8ba7-b0873baa8c46/embed\"\n map.style.display = \"block\";\n } else {\n canvas.style.display = \"block\";\n map.style.display = \"none\";\n }\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}", "function setMarker(id, size) {\n // generating marker matrix\n const marker = markerMatrix(id);\n // setting a fixed marker size for displaying only\n let svgMarker = toSVG(id, \"100%\", marker)\n // displaying marker\n $(\".marker\").html(svgMarker);\n // generating svg markers with custom sizes for download\n svgMarker = toSVG(id, size, marker);\n // creating marker in png format\n toPNGorJPEG(id, size, svgMarker, \"png\");\n // creating marker in jepg format\n toPNGorJPEG(id, size, svgMarker, \"jpeg\");\n // displaying marker ID and size\n $(\".marker-info\").html(\"ID - <strong>\" + id + \"</strong> | Size - <strong>\" + size + \"</strong> X <strong>\" + size + \"</strong>\");\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 createBoardSV(){\n brdstr = \"\"\n\n brdstr += \"<table id= 'BrdBk'>\";\n\nfor(y = 0; y < 11; y++){\n if(y == 0 || y == 10){\n brdstr += \"<tr class = 'Brdtopbottom'>\";\n }\n else{\n brdstr += \"<tr class = 'Brdspace'>\";\n }\n for(x = 0; x < 11; x++){\n if(x == 0){\n brdstr += \"<td class = 'Brdleftright'></td>\";\n }\n else if (x == 10) {\n brdstr += \"<td class = 'Brdleftright'><center>\"+RightNums[y]+\"</center></td>\";\n }\n else if (y == 0) {\n brdstr += \"<td class = 'Brdtopbottom'><center>\"+TopNums[x]+\"</center></td>\";\n }\n else if (y == 10) {\n brdstr += \"<td class = 'Brdtopbottom'></td>\";\n }\n else{\n var z = 10 - x\n brdstr += \"<td class = 'Brdspace allcell' id = B\"+z+y+\" onclick='clickAns(this.id)'></td>\";\n }\n }\n brdstr += \"</tr>\";\n}\nbrdstr += \"</table>\";\nreturn brdstr\n}", "function loadBuilding(building) {\r\n // Building is the building name\r\n var table = document.getElementById(\"mapButtons\");\r\n let placeJSON = null;\r\n\r\n // Validate input\r\n var build = buildingsJSON[\"buildings\"];\r\n for (var i = 0; i < build.length; i++) {\r\n if (build[i].code == building) {\r\n placeJSON = build[i]\r\n break;\r\n }\r\n }\r\n if (placeJSON === null) {\r\n return;\r\n }\r\n\r\n // Remove old tables\r\n var food = document.getElementById(\"foodTable\");\r\n while (food.rows.length > 0) {\r\n food.deleteRow(0);\r\n }\r\n\r\n while (table.rows.length > 0) {\r\n table.deleteRow(0);\r\n }\r\n\r\n\r\n // Load Current Object\r\n //Change Image + Titlie\r\n var title = document.getElementById(\"mapTitle\");\r\n title.innerHTML = placeJSON.name;\r\n\r\n\r\n var pic = document.getElementById(\"mapImg\");\r\n pic.src = PATH + \"/\" + building + \"Front.jpg\"; // This to be changed to proper image\r\n\r\n\r\n // Add New Buttons for each floor -> more than 1 floor\r\n var floor = placeJSON.floors\r\n if (floor > 0) {\r\n for (var i = floor; i > 0; i--) {\r\n var row = table.insertRow(0);\r\n var cell = row.insertCell(0);\r\n cell.classList.add(\"location\");\r\n row.id = i;\r\n var createClickHandler = function(row) {\r\n return function() {\r\n var cell = row.getElementsByTagName(\"td\")[0];\r\n var id = cell.val;\r\n pic.src = PATH + \"/map_\" + building + \"_floor\" + id + \".png\";\r\n };\r\n };\r\n row.onclick = createClickHandler(row);\r\n cell.val = i;\r\n cell.innerHTML = names[i];\r\n if (building == 'DH' && i == 1) {\r\n table.deleteRow(0);\r\n }\r\n }\r\n\r\n // show the front of building button\r\n var row = table.insertRow(0);\r\n var cell = row.insertCell(0);\r\n cell.classList.add(\"location\");\r\n cell.innerHTML = \"Front\";\r\n var createClickHandler = function(row) {\r\n return function() {\r\n pic.src = PATH + \"/\" + building + \"Front.jpg\";\r\n };\r\n };\r\n cell.val = 0;\r\n row.onclick = createClickHandler(row);\r\n }\r\n\r\n // Return to compus map button\r\n var row = table.insertRow(0);\r\n var cell = row.insertCell(0);\r\n cell.classList.add(\"location\");\r\n cell.innerHTML = \"Campus\";\r\n var createClickHandler = function(row) {\r\n return function() {\r\n loadMain();\r\n };\r\n };\r\n cell.val = 0;\r\n row.onclick = createClickHandler(row);\r\n\r\n\r\n // Add food table\r\n var foodJSON = placeJSON.Food;\r\n for (var i = foodJSON.length - 1; i >= 0; i--) {\r\n row = food.insertRow(0);\r\n cell = row.insertCell(0);\r\n cell.innerHTML = foodJSON[i].name;\r\n cell = row.insertCell(1);\r\n cell.innerHTML = \"<ul>\";\r\n cell.innerHTML += \"<li class='mon-thurs'>Mon - Thurs: \" + foodJSON[i]['mon-thurs'] + '</li>';\r\n cell.innerHTML += \"<li class='fri'>Fri: \" + foodJSON[i]['fri'] + '</li>';\r\n cell.innerHTML += \"<li class='sat'>Sat: \" + foodJSON[i]['Sat'] + '</li>';\r\n cell.innerHTML += \"<li class='sun'>Sun: \" + foodJSON[i]['Sun'] + '</li>';\r\n\r\n cell.innerHTML += '</ul>';\r\n }\r\n\r\n var header = food.createTHead();\r\n row = header.insertRow(0);\r\n cell = row.insertCell(0);\r\n cell.innerHTML = \"Services\";\r\n cell = row.insertCell(1);\r\n cell.innerHTML = \"Time\";\r\n highlightday();\r\n\r\n return;\r\n}", "function drawTable(){\n for (employee of allEmployees){\n newRow(employee);\n }\n}", "function drawmyTable(x, y) {\n var ground = document.getElementById(\"canvas\");\n var p = \"<table border=1 cellspacing=0 cellpadding=0>\";\n for (var i = 0; i < x; i++) {//for every row\n p += \"<tr>\"; \n for (var j = 0; j < y; j++) {//for every column\n p += \"<td onMouseOver='drawLine(this);'></td>\"; //loop through a row and add 50 cells each row represents a column while utlizing functions // changes colors \n }\n p += \"</tr>\";\n }\n p += \"</table>\";\n ground.innerHTML = p;\n \n rows=ground.children[0].children[0].children\n //console.log(rows.length);//rows of table \n \n for(let i=0; i<rows.length; i++){\n \n for(let j=0; j<rows[i].children.length; j++){\n //console.log(rows[i].children[j]);\n }\n \n }\n \n }", "function createShapeTable(){\r\n synaesthesiaGeometry.node = createSVG('tableCircle', 100, 100);\r\n synaesthesiaGeometry.cx = 50;\r\n synaesthesiaGeometry.cy = 50;\r\n synaesthesiaGeometry.radius = 40;\r\n synaesthesiaGeometry.circle();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableRecatngle', 100, 100);\r\n synaesthesiaGeometry.rx = 10;\r\n synaesthesiaGeometry.ry = 25;\r\n synaesthesiaGeometry.rWidth = 90;\r\n synaesthesiaGeometry.rHeight = 60;\r\n synaesthesiaGeometry.rectangle();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableEllipse', 100, 100);\r\n synaesthesiaGeometry.ex = 50;\r\n synaesthesiaGeometry.ey = 50;\r\n synaesthesiaGeometry.rex = 40;\r\n synaesthesiaGeometry.rey = 25;\r\n synaesthesiaGeometry.ellipse();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableSemiCircle', 100, 100);\r\n synaesthesiaGeometry.x = 50;\r\n synaesthesiaGeometry.y = 10;\r\n synaesthesiaGeometry.radius = 40;\r\n synaesthesiaGeometry.semiCircle();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableArc', 100, 100);\r\n synaesthesiaGeometry.x = 50;\r\n synaesthesiaGeometry.y = 10;\r\n synaesthesiaGeometry.aendX = 10;\r\n synaesthesiaGeometry.aendY = 60;\r\n synaesthesiaGeometry.radius = 40;\r\n synaesthesiaGeometry.arc();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableLine', 100, 100);\r\n synaesthesiaGeometry.lx1 = 0;\r\n synaesthesiaGeometry.lx2 = 80;\r\n synaesthesiaGeometry.ly1 = 80;\r\n synaesthesiaGeometry.ly2 = 0;\r\n synaesthesiaGeometry.line();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableTrapezoid', 100, 100);\r\n synaesthesiaGeometry.tx1 = 30;\r\n synaesthesiaGeometry.ty1 = 20;\r\n synaesthesiaGeometry.tx2 = 15;\r\n synaesthesiaGeometry.ty2 = 80;\r\n synaesthesiaGeometry.tbase1 = 40;\r\n synaesthesiaGeometry.tbase2 = 70;\r\n synaesthesiaGeometry.trapezoid();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableParallelogram', 100, 100);\r\n synaesthesiaGeometry.px1 = 40;\r\n synaesthesiaGeometry.py1 = 20;\r\n synaesthesiaGeometry.px2 = 20;\r\n synaesthesiaGeometry.py2 = 60;\r\n synaesthesiaGeometry.pside = 50;\r\n synaesthesiaGeometry.parallelogram();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableSquare', 100, 100);\r\n synaesthesiaGeometry.sx = 20;\r\n synaesthesiaGeometry.sy = 20;\r\n synaesthesiaGeometry.sside = 70;\r\n synaesthesiaGeometry.square();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableRhombus', 100, 100);\r\n synaesthesiaGeometry.rhx = 20;\r\n synaesthesiaGeometry.rhy = 50;\r\n synaesthesiaGeometry.rhdiagonal1 = 70;\r\n synaesthesiaGeometry.rhdiagonal2 = 45;\r\n synaesthesiaGeometry.rhombus();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableTriangle', 100, 100);\r\n synaesthesiaGeometry.trx1 = 50;\r\n synaesthesiaGeometry.try1 = 10;\r\n synaesthesiaGeometry.trx2 = 10;\r\n synaesthesiaGeometry.try2 = 85;\r\n synaesthesiaGeometry.trx3 = 90;\r\n synaesthesiaGeometry.try3 = 70;\r\n synaesthesiaGeometry.triangle();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableRightTriangle', 100, 100);\r\n synaesthesiaGeometry.rtx = 30;\r\n synaesthesiaGeometry.rty = 100;\r\n synaesthesiaGeometry.rtverticalSide1 = 60;\r\n synaesthesiaGeometry.rtverticalSide2 = 80;\r\n synaesthesiaGeometry.rightTriangle();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableIsoscelesTriangle', 100, 100);\r\n synaesthesiaGeometry.itx = 30;\r\n synaesthesiaGeometry.ity = 100;\r\n synaesthesiaGeometry.itbase = 60;\r\n synaesthesiaGeometry.itside = 80;\r\n synaesthesiaGeometry.isoscelesTriangle();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableEquilateralTriangle', 100, 100);\r\n synaesthesiaGeometry.etx = 25;\r\n synaesthesiaGeometry.ety = 100;\r\n synaesthesiaGeometry.etside = 70;\r\n synaesthesiaGeometry.equilateralTriangle();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableSine', 100, 100);\r\n synaesthesiaGeometry.x = 10;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.radius = 20;\r\n synaesthesiaGeometry.sine();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableCosine', 100, 100);\r\n synaesthesiaGeometry.x = 10;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.radius = 20;\r\n synaesthesiaGeometry.cosine();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableTangent', 100, 100);\r\n synaesthesiaGeometry.x = 30;\r\n synaesthesiaGeometry.y = 90;\r\n synaesthesiaGeometry.radius = 40;\r\n synaesthesiaGeometry.tangent();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableCotangent', 100, 100);\r\n synaesthesiaGeometry.x = 30;\r\n synaesthesiaGeometry.y = 10;\r\n synaesthesiaGeometry.radius = 40;\r\n synaesthesiaGeometry.cotangent();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableParabola', 100, 100);\r\n synaesthesiaGeometry.x = 30;\r\n synaesthesiaGeometry.y = 30;\r\n synaesthesiaGeometry.radius = 40;\r\n synaesthesiaGeometry.parabola();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableHyperbola', 100, 100);\r\n synaesthesiaGeometry.x = 15;\r\n synaesthesiaGeometry.y = 15;\r\n synaesthesiaGeometry.radius = 20;\r\n synaesthesiaGeometry.hyperbola();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableFigureEightCurve', 100, 100);\r\n synaesthesiaGeometry.x = 10;\r\n synaesthesiaGeometry.y = 55;\r\n synaesthesiaGeometry.radius = 40;\r\n synaesthesiaGeometry.figureEightCurve();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableLemniscateOfBernoulli', 100, 100);\r\n synaesthesiaGeometry.x = 10;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.radius = 40;\r\n synaesthesiaGeometry.lemniscateOfBernoulli();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableAstroidCurve', 100, 100);\r\n synaesthesiaGeometry.x = 10;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.radius = 30;\r\n synaesthesiaGeometry.astroidCurve();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableWitchOfAgnesiCurve', 100, 100);\r\n synaesthesiaGeometry.x = 0;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.radius = 20;\r\n synaesthesiaGeometry.witchOfAgnesiCurve();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableArchimedeanSpiral', 100, 100);\r\n synaesthesiaGeometry.x = 50;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.radius = 2;\r\n synaesthesiaGeometry.loops = 5;\r\n synaesthesiaGeometry.archimedeanSpiral();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableLimaconOfPascal', 100, 100);\r\n synaesthesiaGeometry.x = 10;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.radius = 60;\r\n synaesthesiaGeometry.limaconOfPascal();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableDeltoidCurve', 100, 100);\r\n synaesthesiaGeometry.x = 20;\r\n synaesthesiaGeometry.y = 70;\r\n synaesthesiaGeometry.radius = 60;\r\n synaesthesiaGeometry.deltoidCurve();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableStrophoidCurve', 100, 100);\r\n synaesthesiaGeometry.x = 10;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.radius = 20;\r\n synaesthesiaGeometry.strophoidCurve();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableCycloidCurve', 100, 100);\r\n synaesthesiaGeometry.x = 10;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.radius = 20;\r\n synaesthesiaGeometry.loops = 4;\r\n synaesthesiaGeometry.cycloidCurve();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableRhodoneaCurve', 100, 100);\r\n synaesthesiaGeometry.x = 50;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.xpedal = 5;\r\n synaesthesiaGeometry.ypedal = 30;\r\n synaesthesiaGeometry.pedals = 6;\r\n synaesthesiaGeometry.rhodoneaCurve();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableFermatsSpiral', 100, 100);\r\n synaesthesiaGeometry.x = 50;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.radius = 4;\r\n synaesthesiaGeometry.loops = 2;\r\n synaesthesiaGeometry.fermatsSpiral();\r\n\r\n synaesthesiaGeometry.node = createSVG('tableLituus', 100, 100);\r\n synaesthesiaGeometry.x = 25;\r\n synaesthesiaGeometry.y = 50;\r\n synaesthesiaGeometry.radius = 5;\r\n synaesthesiaGeometry.loops = 8;\r\n synaesthesiaGeometry.lituus();\r\n}", "function resizeTable() {\n myDom.resize();\n table.resize();\n battleGround.resize();\n enemyBattleGround.resize();\n\n for (let i = 0; i < player.battleGround.spots.length; i++) {\n player.battleGround.spots[i].resize();\n enemy.battleGround.spots[i].resize();\n }\n for (let i = 0; i < enemy.cards.onHand.length; i++) {\n enemy.cards.onHand[i].resize();\n }\n for (let i = 0; i < player.cards.onHand.length; i++) {\n player.cards.onHand[i].resize();\n }\n for (let i = 0; i < player.cards.onSpot.length; i++) {\n if (player.cards.onSpot[i]) {\n player.cards.onSpot[i].resize();\n }\n if (enemy.cards.onSpot[i]) {\n enemy.cards.onSpot[i].resize();\n }\n }\n}", "drawBoard() {\n var content = \"\"\n var count = 0\n for (var row = 0; row < this.dim; row++) {\n content += \"<tr>\\n\" \n for (var col = 0; col < this.dim; col++) {\n content += '<td id=\"cell' + count + '\" data-name=\"cell' + count + '\" class=\"' + this.itemClass + '\"></td>\\n'\n count += 1\n } \n content += \"</tr>\\n\" \n }\n $(this.cardId).html(content)\n\n // Bind a change event to each added item\n $(\".\" + this.itemClass).on('click', {client: this}, this.selectItemEvent);\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<gridHeight; ++h) {\n const row = pixelCanvas.insertRow(-1); // insert new row\n for (let w=0; w<gridWidth; ++w) {\n const cell = row.insertCell(-1); //insert new cell\n cell.onclick = changeColor;\n }\n}\nevent.preventDefault();\n\n\n}", "function createNewTable( event ) {\n if ( self.util.isReadOnly() ) {\n console.log('error: page cannot be modified');\n return false;\n }\n\n var point = self.util.toViewboxCoords(event);\n if ( point.x < 0 || point.y < 0 ||\n point.x > imgSize.W-1 || point.y > imgSize.H-1 ) {\n console.log('error: tables have to be within image limits');\n return false;\n }\n\n var\n id = '',\n rows = self.cfg.tableSize[0] >= 1 ? Math.round(self.cfg.tableSize[0]) : 3,\n cols = self.cfg.tableSize[1] >= 1 ? Math.round(self.cfg.tableSize[1]) : 3,\n numtab = $(self.util.svgRoot).find('.Page > .TableRegion').length+1,\n elem = $(document.createElementNS(self.util.sns,'polygon'))\n .addClass('Coords'),\n g = $(document.createElementNS(self.util.sns,'g'))\n .addClass('TableRegion')\n .append(elem);\n\n g.attr('rows',rows)\n .attr('columns',cols)\n .appendTo($(self.util.svgRoot).children('.Page'));\n\n if ( self.cfg.newElemID ) {\n id = self.cfg.newElemID($(self.util.svgRoot).children('.Page'),'TableRegion',event);\n if ( typeof id !== 'string' ) {\n g.remove();\n console.log('error: problem generating element ID');\n return false;\n }\n }\n if ( ! id ) {\n while ( $('#'+pageContainer.id+' #table'+numtab).length > 0 )\n numtab++;\n id = 'table'+numtab;\n }\n g.attr('id',id);\n\n //self.util.selectElem(elem,true,true);\n\n return elem[0];\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('<tr></tr>');\n }\n for (let y = 0; y < width; y++) {\n $('#pixelCanvas tr').each(function () {\n $(this).append('<td></td>');\n });\n }\n}", "function placeInTable(y, x) {\n // make a div and insert into correct table cell\n let token = document.createElement('div');\n token.classList.add('piece');\n currPlayer === 1? token.classList.add('piece1'):token.classList.add('piece2');\n //select the (x,y) cell in the htmlBoard\n let correctCell = document.getElementById(`${y}-${x}`);\n //append the created dic to the correct cell\n correctCell.append(token);\n}", "function draw_grid(grid_size, cell_size) {\r\n\t//instantiate variables\r\n\tvar i;\r\n\tvar j;\r\n\r\n\t$(\"#grid\").empty();\r\n\r\n\t//iterate to create rows\r\n\tfor (i = 0; i < grid_size; i++) {\r\n\t\tfor (j = 0; j < grid_size; j++) {\r\n\t\t\t//draw row of divs, assinging them a class of \"cell\" and a css width and height\r\n\t\t\t$(\"#grid\").append(\"<div class='cell'></div>\").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(\"<br>\");\r\n\t}\r\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 += '<tr>';\n productData += '<td>' + id++ + '</td>';\n productData += '<td> <a href=\"#\" class=\"item-name\" data-id=\"' + value.id_product + '\">' + value.name + '</a></td>';\n productData += '<td>' + value.code + '</td>';\n productData += '<td>' + value.group_name + '</td>';\n productData += '<td>' + unitArray[value.unit] + '</td>';\n productData += '<td class=\"item-description\">' + value.description + '</td>';\n productData += '<td><button class=\"btn-modal\" id=\"button-table-edit\" data-type=\"edit\" data-id=\"' + value.id_product + '\">Edycja</button> <button class=\"button-table-delete\"data-id=\"' + value.id_product + '\">Usuń</button></td>';\n productData += '</tr>';\n codeOfLastProduct = value.code;\n });\n $(\"#product-table\").append(productData);\n displayTable();\n }\n else {\n removeTable();\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('<tr class=\"tr\"></tr>');\n }\n CanvasTr = $('.tr');\n // Creating cells to every row\n for (let j = 0; j < cols; j++) {\n CanvasTr.append('<td class=\"td\"></<td>');\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 }", "draw(){\n for(let y = 0; y < this.map.length; y++){\n for(let x = 0; x < this.map[y].length; x++){\n ctx.fillStyle = this.legendChar(x,y).color;\n ctx.fillRect(x*this.sqsize - this.xpos,y*this.sqsize - this.ypos,this.sqsize +1,this.sqsize+1);\n }\n }\n }", "function init(){\n\n\tvar board=document.createElement('table');//create table \n\tboard.id='board';\n\tboard.setAttribute('border',1);\n\tboard.setAttribute('cellspacing',0);\n\n\n\tvar identifier =1;\n\n\tfor(var i=0;i<N_SIZE;i++){\n\t\tvar row=document.createElement('tr');\n\t\tboard.appendChild(row);\n\n\t\tfor(var j=0;j<N_SIZE;j++){\n\t\t\tvar cell=document.createElement('td');\n\t\t\tcell.setAttribute('height',3*110/(N_SIZE));\n\t\t\tcell.setAttribute('width',3*120/(N_SIZE));\n\t\t\tcell.setAttribute('align','center');\n\t\t\tcell.setAttribute('valign','center');\n\t\t\tcell.classList.add('col'+j,'row'+i);// learn\n\t\t\tif(i==j){\n\t\t\t\tcell.classList.add('diagonal0');\n\t\t\t}\n\t\t\tif(j==N_SIZE-i-1){\n\t\t\t\tcell.classList.add('diagonal1');\n\t\t\t}\n\n\t\t\tcell.identifier=identifier;//know \n\n\t\t\t// cell.addEventListener('click',set);\n\t\t\trow.appendChild(cell);\n\t\t\tboxes.push(cell);\n\t\t\tidentifier+=identifier;\n\t\t}\n\n\t}\n\tdocument.getElementById('tictactoe').appendChild(board);\n\tstartNewGame();\n\n}", "function refresh_map() {\n var ly_id = 1\n var ly_parts = [\n \"1235\", \"2475\", \"2455\", \"1110\", \"1240\", \"2460\", \"2470\", \"1120\",\n \"1101\", \"2465\", \"1125\", \"1350\", \"1230\", \"1105\", \"1115\", \"1345\"\n ]\n var ly_values = [141, 140, 155, 147, 132, 146, 151, 137, 146,\n 136, 145, 141, 149, 151, 138, 164]\n var ly_type = 1 // Palestine\n var ly_label = ''\n var ly_color = 'rgb(255,0,0)'\n map.add_layer(1,ly_id,ly_label,ly_color,ly_type,ly_parts,ly_values)\n\n var ly_id = 1345\n var ly_parts = [\n 13452415\n ]\n var ly_values = [1041]\n var ly_type = 2 // localities\n var ly_label = 'Econmics'\n var ly_color = 'rgb(0,0,255)'\n map.add_layer(2,ly_id,ly_label,ly_color,ly_type,ly_parts,ly_values)\n}", "function fillTable(id) {\n\n // Pull the metadata\n d3.json(path).then((sampleData) => {\n var data = sampleData.metadata;\n\n // Grab the table element\n var demoInfo = d3.select(\"#sample-metadata\")\n\n // Clear any previous table\n demoInfo.html(\"\"); \n\n // Generate a blank list and pull the data that matches the new id\n var info = [];\n info = data.filter(i => i.id == id)[0];\n\n // Send the info to the panel\n Object.entries(info).forEach(function([key, value]) {\n var row = d3.select(\"#sample-metadata\").append(\"p\");\n row.text(`${key} : ${value}`);\n })\n})\n}", "function makeGrid() {\n\tfor (y = 0; y < sizeY; y++ ){\n\t\t$('#pixelCanvas').append('<tr>');\n\t\t\tfor(x = 0; x< sizeX; x++ ){\n\t\t\t\t$('#pixelCanvas tr:last-child').append('<td></td>');\n\t\t\t}\n\t\t$('#pixelCanvas').append('</tr>');\n\t}\n}" ]
[ "0.65854883", "0.63076633", "0.6164537", "0.615061", "0.60348946", "0.6024019", "0.5992851", "0.5977376", "0.5976345", "0.5932729", "0.5929121", "0.58895046", "0.5881419", "0.5801246", "0.57981557", "0.5783472", "0.5775159", "0.577508", "0.577232", "0.57554066", "0.5744306", "0.5685112", "0.5684867", "0.5665309", "0.5643316", "0.5629409", "0.5592821", "0.5578227", "0.5553081", "0.5552125", "0.554736", "0.5546275", "0.5541907", "0.5540434", "0.5518624", "0.5513433", "0.5506863", "0.55046564", "0.55022746", "0.54959327", "0.5467282", "0.54652077", "0.5464753", "0.54458725", "0.54402876", "0.54336953", "0.5433014", "0.543185", "0.54269093", "0.5422976", "0.5422697", "0.5419608", "0.5412342", "0.5400573", "0.53976864", "0.5391907", "0.5383138", "0.53824234", "0.5377972", "0.53737205", "0.5360941", "0.53569245", "0.535032", "0.53502953", "0.5349341", "0.5348748", "0.53418297", "0.5329688", "0.5327689", "0.5327299", "0.5326151", "0.5321504", "0.5317152", "0.53125125", "0.5309779", "0.53081447", "0.53075904", "0.5300293", "0.52961004", "0.5295579", "0.52949893", "0.5291054", "0.5288569", "0.52874", "0.5286319", "0.52821904", "0.5280604", "0.52778095", "0.52760005", "0.5273936", "0.526528", "0.526304", "0.5260127", "0.52517813", "0.5247777", "0.5247395", "0.5247184", "0.52467287", "0.5242603", "0.5242411" ]
0.8765483
0
Converts 2Darray to String for database storage
function mapToString (map) { var jsonString = '' map.forEach(function (row) { jsonString += JSON.stringify(row) + '|' }) return jsonString }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serialize_array_2d(arr) {\n// {{{\n\tvar str='';\n\tvar i = 0;\n\tstr += '' + arr[i][0];\n\tfor (var j = 1; j < arr[i].length; ++j) {\n\t\tstr += ',' + arr[i][j];\n\t}\n\n\tfor (var i = 1; i < arr.length; ++i) {\n\t\tstr += '|';\n\t\tstr += '' + arr[i][0];\n\t\tfor (var j = 1; j < arr[i].length; ++j) {\n\t\t\tstr += ',' + arr[i][j];\n\t\t}\n\t}\n\treturn str;\n// }}}\n}", "function transferToString(arr) {\r\n\tvar str = \"[\";\r\n\tfor (var i = 0; i < arr.length; i++){\r\n\t\tstr += JSON.stringify(arr[i]);\r\n\t\tif (i != arr.length-1)\r\n\t\t\tstr += \",\";\r\n//\t\tfor (var j = 0; j < q[i].length; j++){\r\n//\t\t\tstr += \"'\" + q[i][j] ;\r\n//\t\t\tif (j != (q[i].length-1) ){\r\n//\t\t\t\tstr += \"', \";\r\n//\t\t\t}\r\n//\t\t\telse{\r\n//\t\t\t\tstr += \"' \";\r\n//\t\t\t}\r\n//\t\t\t\t\r\n//\t\t}\r\n//\t\tif (i != (q.length-1) )\r\n//\t\t\tstr += \"], \";\r\n//\t\telse{\r\n//\t\t\tstr += \"] \";\r\n//\t\t}\r\n\t}\r\n\tstr += \"]\";\r\n\treturn str;\r\n}", "function transferToString(arr) {\n\tvar str = \"[\";\n\tfor (var i = 0; i < arr.length; i++){\n\t\tstr += JSON.stringify(arr[i]);\n\t\tif (i != arr.length-1)\n\t\t\tstr += \",\";\n//\t\tfor (var j = 0; j < q[i].length; j++){\n//\t\t\tstr += \"'\" + q[i][j] ;\n//\t\t\tif (j != (q[i].length-1) ){\n//\t\t\t\tstr += \"', \";\n//\t\t\t}\n//\t\t\telse{\n//\t\t\t\tstr += \"' \";\n//\t\t\t}\n//\t\t\t\t\n//\t\t}\n//\t\tif (i != (q.length-1) )\n//\t\t\tstr += \"], \";\n//\t\telse{\n//\t\t\tstr += \"] \";\n//\t\t}\n\t}\n\t\t\n\tstr += \"]\";\n\t\n\treturn str;\n}", "function arrayToString(arr) {\n return arr.join(\"\")\n }", "function arrayToString(array) {\n return array.join('')\n }", "function arrayToString(array) {\n var string = \"\";\n for (let j = 0; j < array.length; j++){\n var string = string + array[j] + '\\n';\n };\n return string = string.slice(0, -1);\n }", "function arrayToString(array, parameter) {\n if (parameter == \"binary\") {\n return array.join(\" \");\n }\n else {\n return array.join(\".\");\n }\n }", "function arrayToString(a) {\n return \"[\" + a.join(\", \") + \"]\";\n}", "function arrayToString(arr) {\n var arrString = arr.join(\", \");\n return arrString;\n}", "function convertToString()\t{\r\n\tarrayString = prefer.toString();\r\n\t\r\n}", "function array2string($arr) {\n\tvar str = \"\";\n\t$arr.forEach(item => {\n\t\tstr += item + '\\n';\n\t});\n\treturn str;\n}", "function array_to_string(a) {\r\n var out = '';\r\n if (!a) return out;\r\n for (i=0;i<a.length;i++) {\r\n out = out + i + \":\" + a[i] + \"\\n\";\r\n }\r\n return out;\r\n}", "function arrToStr(arr) {\n var str = '';\n\n for (var i = 0; i < arr.length; i++) {\n str += arr[i].toString();\n }\n\n return str;\n}", "function draw2DArray(array){\n var html=\"\";\n for(var i = 0; i < row; i++){\n for(var j = 0; j < col; j++){\n html = html + array[i][j] + \", \";\n }\n html=html+\"\\n\";\n }\n console.log(html);\n}", "toString() {\n return arrayToString(this);\n }", "exportSudokuAsText(){\r\n let result = \"\";\r\n for(let i=1; i<=9; i++){\r\n for(let j=1; j<=9; j++){\r\n result += this.getNumber(i, j);\r\n }\r\n }\r\n return result;\r\n }", "function matrixToString(matrix) {\n return matrix.map(v => v.join(''))\n .join('\\n')\n }", "function arrayToStringV2(arr) {\n let result = '';\n arr.forEach((elem) => {\n result += elem;\n });\n return result;\n}", "stringThisArray(array){\n return array.join(\"\");\n }", "function arrayToString(arr) {\n var output = \"\"\n arr.forEach(function(i, index, array) {\n output += i + \" \"\n });\n return output\n}", "function arrToString(arr) {\n pantryString = \"\";\n for (let i = 0; i < arr.length; i++) {\n if (i < arr.length - 1) {\n pantryString += arr[i] + \", \";\n } else if (i === arr.length - 1) {\n pantryString += arr[i];\n }\n }\n return pantryString;\n}", "function toString() {\n\t\tvar s = \"\";\n\t\tfor (var row = 0; row < height; row++) {\n\t\t\tfor (var col = 0; col < width; col++) {\n\t\t\t\ts += \"cell (\" + col + \", \" + row + \"): \" + \n\t\t\t\t grid[row][col].toString() + \"\\n\";\n\t\t\t}\n\t\t}\n\t\treturn s;\n\t}", "function frame_array_to_string(frame_array) {\n //time;poiint1.x:point2.y,point2,pointn;point1,point2,pointn;|frame2|framen...\n s = \"\";\n for (var i = 0; i < frame_array.length; i++) {\n var frame = frame_array[i];\n s += frame.get_time().toString() + \";\";\n for (var j = 0; j < frame.get_polygon_array().length; j++) {\n var polygon = frame.get_polygon_array()[j];\n if (polygon.get_point_array().length < 1) {\n continue; //If it's empty, ignore this polygon.\n }\n var pnt_strs = []\n for (var k = 0; k < polygon.get_point_array().length; k++) {\n var point = polygon.get_point_array()[k]\n pnt_strs.push(point.x + \":\" + point.y)\n }\n s += pnt_strs.join(\",\") + \";\"\n }\n s += \"|\"\n }\n return s;\n }", "toString() {\n let s = '[';\n for (var i = 0; i < this.#size - 1; i++) {\n s = s + this.#array[i] + ', ';\n }\n if (this.#size > 0) {\n s = s + this.#array[this.#size - 1];\n }\n return s + ']';\n }", "toString(solution = false)\n {\n let rows = [];\n \n for (let i = 0; i < 9; i++)\n {\n let str = '';\n for (let j = 0; j < 9; j++)\n {\n if (solution)\n {\n if (Array.isArray(this.solution[i][j]))\n {\n str += this.blank;\n }\n else\n {\n str += this.solution[i][j];\n }\n }\n else\n {\n if (Array.isArray(this.puzzle[i][j]))\n {\n str += this.blank;\n }\n else\n {\n str += this.puzzle[i][j];\n }\n }\n }\n rows.push(str);\n }\n\n return rows.join('\\n');\n }", "function print2DArray(array) {\n\tvar str = '';\n\tfor(var i=0; i<array.length; i++) {\n\t\tfor(var j=0; j<array[i].length; j++) {\n\t\t\t//console.log(array[i][j]);\n\n\t\t\tstr += ' ' + array[i][j];\n\t\t}\n\n\t\tstr += '\\n';\n\t}\n\tconsole.log(str);\n}", "toString() {\n let s = \"[ \";\n for (let i = 0; i < this.table.length - 1; i++) {\n if (this.table[i]) {\n this.table[i].forEach(value => {\n if (value) {\n s += `${value}, `\n }\n });\n }\n }\n if (this.table[this.table.length - 1]) {\n let a = this.table[this.table.length - 1];\n for (let i = 0; i < a.length - 1; i++) {\n if (a[i]) {\n s += `${a[i]}, `;\n }\n }\n s += `${a[a.length - 1]} `;\n }\n s += \"]\";\n return s;\n }", "toString() {\n let s = \"[ \";\n for (let i = 0; i < this.table.length - 1; i++) {\n if (this.table[i]) {\n this.table[i].forEach(value => {\n if (value) {\n s += `${value}, `\n }\n });\n }\n }\n if (this.table[this.table.length - 1]) {\n let a = this.table[this.table.length - 1];\n for (let i = 0; i < a.length - 1; i++) {\n if (a[i]) {\n s += `${a[i]}, `;\n }\n }\n s += `${a[a.length - 1]} `;\n }\n s += \"]\";\n return s;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function print2DArray(array)\n{\n\tvar n = array.length;\n\tvar out;\n\tvar i = 0;\n\tvar j = 0;\n\tfor( i = 0; i < n ; i++)\n\t{\n\t\tfor( j=0; j < n; j++)\n\t\t{\n\t\t\tout = out + array[i][j];\n\t\t\tif ( j < n - 1)\n\t\t\t\tout = out + \" \\t\";\n\t\t}\n\t\tout = out + \"\\n\";\n\t}\n\t//print(out);\n\tdelete out\n}", "function simpleStringify(arr) {\n if (arr.length == 0) {\n return \"\";\n }\n\n var keys = Object.keys(arr[0]);\n return keys.join(\",\") + \"\\n\" +\n arr.map(function(obj) {\n return Object.values(obj).map(function(v){\n return typeof v === \"string\" ? '\"' + (''+v).replace(/\"/g,'\"\"') + '\"' : v\n }).join(\",\");\n }).join(\"\\n\");\n }", "function arrayString (val) {\n var result = '{'\n for (var i = 0; i < val.length; i++) {\n if (i > 0) {\n result = result + ','\n }\n if (val[i] === null || typeof val[i] === 'undefined') {\n result = result + 'NULL'\n } else if (Array.isArray(val[i])) {\n result = result + arrayString(val[i])\n } else if (val[i] instanceof Buffer) {\n result += '\\\\\\\\x' + val[i].toString('hex')\n } else {\n result += escapeElement(prepareValue(val[i]))\n }\n }\n result = result + '}'\n return result\n}", "function arrayString (val) {\n var result = '{'\n for (var i = 0; i < val.length; i++) {\n if (i > 0) {\n result = result + ','\n }\n if (val[i] === null || typeof val[i] === 'undefined') {\n result = result + 'NULL'\n } else if (Array.isArray(val[i])) {\n result = result + arrayString(val[i])\n } else if (val[i] instanceof Buffer) {\n result += '\\\\\\\\x' + val[i].toString('hex')\n } else {\n result += escapeElement(prepareValue(val[i]))\n }\n }\n result = result + '}'\n return result\n}", "function arrayString (val) {\n var result = '{'\n for (var i = 0; i < val.length; i++) {\n if (i > 0) {\n result = result + ','\n }\n if (val[i] === null || typeof val[i] === 'undefined') {\n result = result + 'NULL'\n } else if (Array.isArray(val[i])) {\n result = result + arrayString(val[i])\n } else if (val[i] instanceof Buffer) {\n result += '\\\\\\\\x' + val[i].toString('hex')\n } else {\n result += escapeElement(prepareValue(val[i]))\n }\n }\n result = result + '}'\n return result\n}", "toString() {\n return `Matrix [rows=${this.rows},columns=${this.columns},matrix=${JSON.stringify(this.matrix)}]`;\n }", "function stringifyArr(arr){\n\tvar str = \"[\";\n\tarr.forEach(function(e){\n\t\tstr += \"'\"+e+\"', \";\n\t});\n\tstr += \"]\";\n\treturn str.replace(\"', ]\", \"']\");\t\n}", "function convertToString() {\n var arrayString = pizzaToppings.toString();\n document.getElementById(\"tostring\").innerHTML = arrayString;\n}", "function toString(array) {\n var string = '';\n for (i = 0 ; i<array.length ; i++) {\n string = string + array[i] + ' ';\n }\n return string;\n}", "function toString() {\n\t// If there are any results\n\tif(module.exports.cols instanceof Object) {\n\t\t// Get the list of columns\n\t\tvar columns = Object.keys(module.exports.cols);\n\t\t// And determine how many rows exist with a map-reduce of each column's length\n\t\tvar rows = columns.map(function(column) {\n\t\t\treturn module.exports.cols[column].length;\n\t\t}).reduce(function(prevVal, currVal) {\n\t\t\treturn prevVal > currVal ? prevVal : currVal;\n\t\t}, -1);\n\t\t// Then build a row-based data structure (versus the column-based structure returned by the plugins that's more useful\n\t\t// for direct access of a particular data value: ``cols[label][index]`` versus ``cols[firstIndex][secondIndex+1]``)\n\t\tvar tempArrays = [ columns ];\n\t\tfor(var i = 0; i < rows; i++) {\n\t\t\tvar tempArray = [];\n\t\t\tcolumns.forEach(function(column) {\n\t\t\t\ttempArray.push(module.exports.cols[column][i]);\n\t\t\t});\n\t\t\ttempArrays.push(tempArray);\n\t\t}\n\t\t// Use a map-reduce on the array of arrays to create the CSV string\n\t\treturn tempArrays.map(function(tempArray) {\n\t\t\treturn tempArray.toString() + \"\\n\";\n\t\t}).reduce(function(prevVal, currVal) {\n\t\t\treturn prevVal + currVal;\n\t\t});\n\t// Otherwise return an empty string\n\t} else {\n\t\treturn \"\";\n\t}\n}", "toString() {\n const array = []\n // convert to a poly point string\n for (let i = 0, il = this.length; i < il; i++) {\n array.push(this[i].join(','))\n }\n\n return array.join(' ')\n }", "function stringify(array){\n\tvar arrayB=[]\n\tfor(i in array)\n\t\tarrayB[i]=\"\"+array[i];\n\treturn arrayB;\n}", "function ArrayToU8String(arr, offs, len)\r\n{\r\n\tvar str = \"[\"; \r\n\tlen += offs-1;\t\r\n\tfor(var i=offs; i <= len; i++){\r\n\t \tstr += getU8str(arr[i]);\r\n\t \tstr += i < len ? \", &nbsp;\" + (i % 4 == 3 ? \"<br/>\":\"\") : \"]\";\r\n\t}\r\n\treturn str;\r\n}", "function convertToString() {\n\tarrayString = genreInfo.toString();\n\tobjectString = JSON.stringify(userInfo);\n}", "function returnSaveString(DataArray) {\n var SaveString = \"\";\n for (var i = 0; i <= DataArray.length; i++) {\n if (DataArray[i] === null || DataArray[i] === undefined) {\n SaveString += ',';\n continue;\n }\n if (typeof DataArray[i] == 'number') {\n SaveString += DataArray[i];\n }\n else {\n SaveString += '\"' + DataArray[i] + '\"';\n }\n if (i !== DataArray.length) {\n SaveString += \",\";\n }\n }\n return SaveString;\n}", "function flattenToString(arr) {\n var i,\n iz,\n elem,\n result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += Array.isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function arrayToStr(buf)\n{\n output = '';\n for (var ind=0; ind<buf.length; ind++)\n {\n if (buf[ind] == 0)\n {\n return output;\n } else {\n output += String.fromCharCode(buf[ind]);\n }\n }\n return output;\n}", "toString() {\n return JSON.stringify(this.#array);\n }", "toString() {\n // convert to a poly point string\n for (var i = 0, il = this.length, array = []; i < il; i++) {\n array.push(this[i].join(','));\n }\n\n return array.join(' ');\n }", "function arrayBufferToString(buffer){\n\t\tif (buffer == null) {\n\t\t\treturn null;\n\t\t}\n\n var arr = new Uint8Array(buffer);\n var str = String.fromCharCode.apply(String, arr);\n\n return str;\n\t}", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function flattenToString(arr) {\n var i, iz, elem, result = '';\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n return result;\n }", "function arrayToString(obj) {\n\tvar s = '[';\n\tvar first = true;\n\t$.each(obj, function(i, val) {\n\t\tif (!first) {\n\t\t\ts += ',';\n\t\t}\n\t\tfirst = false;\n\t\ts += valueToString(val);\n\t});\n\ts += ']';\n\treturn s;\n}", "toString() {\n let out = this.size;\n for (let i = 0; i < this.size; i++) {\n out += \"\\n\";\n for (let j = 0; j < this.size; j++) {\n out += this.board[i][j];\n }\n }\n return out;\n }", "function formatArrayForSql(arr, doubles=false) {\n var newArr = [];\n for(var i = 0; i < arr.length; i++) {\n if(!doubles) newArr.push('?');\n if(doubles) newArr.push('??');\n }\n return newArr.join(',');\n}", "function gridToSerial(grid) {\n const output = [];\n for (const row of grid) output.push(row.join(''));\n return output.join('/');\n }", "function Utf8ArrayToStr(array) {\n let out, i, len, c;\n let char2, char3;\n\n out = '';\n len = array.length;\n i = 0;\n while (i < len) {\n c = array[i++];\n switch (c >> 4) {\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12:\n case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode(((c & 0x1f) << 6) | (char2 & 0x3f));\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode(\n ((c & 0x0f) << 12) | ((char2 & 0x3f) << 6) | ((char3 & 0x3f) << 0)\n );\n break;\n }\n }\n\n return out;\n }", "function Utf8ArrayToStr(array) {\n let out, i, len, c;\n let char2, char3;\n\n out = '';\n len = array.length;\n i = 0;\n while (i < len) {\n c = array[i++];\n switch (c >> 4) {\n case 0:\n case 1:\n case 2:\n case 3:\n case 4:\n case 5:\n case 6:\n case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12:\n case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode(((c & 0x1f) << 6) | (char2 & 0x3f));\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode(\n ((c & 0x0f) << 12) | ((char2 & 0x3f) << 6) | ((char3 & 0x3f) << 0)\n );\n break;\n }\n }\n\n return out;\n }", "toString() {\n var numRows = this.dimension;\n var tileNum = 0;\n var toPrint = [];\n for (var i = 0; i < numRows; i++) {\n for (var j = 0; j < numRows; j++) {\n if (this.gameState.board[tileNum] == 0) {\n toPrint.push(\"[ ]\");\n } else {\n toPrint.push(\"[\" + this.gameState.board[tileNum] + \"]\");\n }\n tileNum++;\n }\n console.log(toPrint.join(\" \"));\n toPrint = [];\n }\n }", "function utf8ArrayToStr(array) {\n\t\tvar out, i, len, c;\n\t\tvar char2, char3;\n\n\t\tout = '';\n\t\tlen = array.length;\n\t\ti = 0;\n\t\twhile (i < len) {\n\t\t\tc = array[i++];\n\t\t\tswitch(c >> 4)\n\t\t\t{\n\t\t\t\tcase 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n\t\t\t\t// 0xxxxxxx\n\t\t\t\tout += String.fromCharCode(c);\n\t\t\t\tbreak;\n\t\t\t\tcase 12: case 13:\n\t\t\t\t// 110x xxxx 10xx xxxx\n\t\t\t\tchar2 = array[i++];\n\t\t\t\tout += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n\t\t\t\tbreak;\n\t\t\t\tcase 14:\n\t\t\t\t\t// 1110 xxxx 10xx xxxx 10xx xxxx\n\t\t\t\t\tchar2 = array[i++];\n\t\t\t\t\tchar3 = array[i++];\n\t\t\t\t\tout += String.fromCharCode(((c & 0x0F) << 12) |\n\t\t\t\t\t((char2 & 0x3F) << 6) |\n\t\t\t\t\t((char3 & 0x3F) << 0));\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn out;\n\t}", "function stringifyArray(input){\n return input.join(',');\n}", "function Utf8ArrayToStr(array) {\n var out, i, len, c;\n var char2, char3;\n\n out = \"\";\n len = array.length;\n i = 0;\n while(i < len) {\n c = array[i++];\n switch(c >> 8) //was 4\n { \n case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12: case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode(((c & 0x0F) << 12) |\n ((char2 & 0x3F) << 6) |\n ((char3 & 0x3F) << 0));\n break;\n }\n }\n\n return out;\n}", "function flattenToString(arr) {\n var i,\n iz,\n elem,\n result = '';\n\n for (i = 0, iz = arr.length; i < iz; ++i) {\n elem = arr[i];\n result += isArray(elem) ? flattenToString(elem) : elem;\n }\n\n return result;\n }", "toString(){\r\n let boardString = \"\";\r\n let print = \"\";\r\n for (let x = 0; x < 13; ++x) {\r\n for (let y = 0; y < 13; ++y) {\r\n print += this.board[y][x] + \" \";\r\n }\r\n boardString = boardString + print + \"\\r\\n\";\r\n print = \"\";\r\n }\r\n return boardString;\r\n }", "function Utf8ArrayToStr(array) {\n var out, i, len, c;\n var char2, char3;\n out = \"\";\n len = array.length;\n i = 0;\n while (i < len) {\n c = array[i++];\n var c4 = c >> 4;\n if (c4 === 0 || c4 === 1 || c4 === 2 || c4 === 3 || c4 === 4 || c4 === 5 || c4 === 6 || c4 === 7) {\n // 0xxxxxxx\n out += String.fromCharCode(c);\n }\n else if (c4 === 12 || c4 === 13) {\n // 110x xxxx 10xx xxxx\n char2 = array[i++];\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n }\n if (c4 === 14) {\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++];\n char3 = array[i++];\n out += String.fromCharCode(((c & 0x0F) << 12) |\n ((char2 & 0x3F) << 6) |\n ((char3 & 0x3F) << 0));\n }\n }\n return out;\n }", "function arrayOutput(ar){\n\tvar s = \"\";\n\tar.map((el)=>{\n\t\ts += JSON.stringify(el) + \"\\n\";\n\t});\n\treturn s;\n}", "function arrToStrFormatted(a) {\n if (a != 0) {\n return a.toString().split(\",\").join(\", \");\n }\n return 0;\n }", "function _gridToString(grid) {\n let str = '';\n for (let y = 0; y < urBoard.height; y++) {\n for (let x = 0; x < urBoard.width; x++) {\n let c = grid[x][y];\n str += (c + ' ');\n }\n str += '\\n';\n }\n\n return str;\n }", "function joinElement(arr) {\n return arr.toString();\n}", "function splitArrayToString(arr) {\n var result = \"\";\n for (var i = 0; i < arr.length; i++) {\n if (i === (arr.length - 1)) result += arr[i];\n else result += arr[i] + \";\";\n }\n return result;\n }", "function encodeNestedArray(array) {\n var stack = [[[array], 0]];\n var result = '';\n for(;;) {\n var s = stack[stack.length - 1];\n if(s[1] >= s[0].length) {\n stack.pop();\n if (stack.length == 0) break;\n result += ']';\n } else {\n if(s[1] > 0) result += ',';\n var el = s[0][s[1]];\n if(Array.isArray(el)) {\n result += '[';\n stack.push([el, 0]);\n } else {\n result += el;\n }\n s[1]++;\n }\n }\n return result;\n}", "toString() {\n let result = \"Filled Cells:\";\n this.rows.forEach(row => {\n row.forEach(cell => {\n if (cell.filled) {\n result += `\\nrow=${cell.x} col=${cell.y}`;\n }\n });\n });\n return result;\n }", "function doubleToString(num){\n\t\treturn [].slice.call(\n\t\t\tnew Uint8Array(\n\t\t\t\t(\n\t\t\t\t\tnew Float64Array([num]) //create a float64 array\n\t\t\t\t).buffer) //extract the array buffer\n\t\t\t, 0) // convert the Uint8Array into a regular array\n\t\t\t.map(function(e){ //since it's a regular array, we can now use map\n\t\t\t\treturn String.fromCharCode(e) // encode all the bytes individually\n\t\t\t})\n\t\t\t.reverse() //correct the byte endianness (assume it's little endian for now)\n\t\t\t.join('') // join the bytes in holy matrimony as a string\n\t}", "function stringify(arr) {\n\tarr.forEach(function(number){\n\t\toutputStr += number + '\\n'\n\t});\n}", "function arrWithNoBrsAndSpacesToString(array) {\n\tlet arrSpaces = array.map((item) => {\n\t\treturn item.join(' ')\n\t})\n\tconsole.log(arrSpaces)\n\t// console.log(arrSpaces)\n\tlet strBrsSpaces = arrSpaces.join('<br>')\n\treturn strBrsSpaces\n}", "function stringifier (input) {\n \n var answer = [];\n\n // If not an array, it's a basic type. No need to call converter via test in that case\n // This if statement is a shortcut\n // CAN BE PLACED IN TEST BEFORE THE FOR LOOP\n\n if (Array.isArray(input) === false) {\n\n converter (input);\n }\n\n\n\n //CONVERTER\n // This function converts any type into a string and pushes it to an array\n function converter (part) {\n\n if (typeof(input) === 'undefined') {\n return undefined\n }\n \n if (typeof part == \"number\")\n {\n\n answer.push(part.toString());\n\n }\n\n \n if (typeof part == \"string\") {\n\n answer.push(\"\\\"\" + part.toString()+ \"\\\"\");\n }\n\n if (typeof part == \"function\") {\n\n return \"null\";\n }\n\n \n } \n\n \n \n //CALLER if array\n //Identifies the dimensions of the array and calls converter with each value of any array\n function test (input) {\n for (var i = 0; i < input.length; i++) {\n\n if (Array.isArray(input[i])) {\n\n stringifier (input[i]);\n\n }\n \n else {\n \n converter (input[i]);\n \n \n }\n\n }\n \n }\n\n\n var stringified = answer.join();\n return stringified;\n\n \n\n\n \n\n// -------- TESTS -------\n\n\n\n}", "rowStr (cols, row) {\n const rowStr = cols.map((col) => this.prepareValue(row[col])).join(', ')\n\n return `(${rowStr})`\n }", "__convert_2D_to_1D(data) {\n let new_data = []\n data.map(val => {\n if (this.__is_object(val)) {\n new_data.push(JSON.stringify(val))\n } else {\n new_data.push(`${val}`)\n\n }\n })\n return new_data\n }", "function array(arr){\n\n return arr.split(\",\").slice(1,-1).join(\" \") || null\n }", "function stringItUp(arr){\n return arr.toString()\n}", "function cellsToBinaryString(cells) {\n const rowSize = cells.length;\n const columnSize = cells[0].length;\n const binaryRows = cellsToBinaryRows(cells).map( rows => rows.join('')).join('');\n return `${rowSize}${DIMENSION_DELIMITER}${columnSize}${DATA_DELIMITER}${binaryRows}`\n}", "toString() {\n\t\tlet str = '\\n';\n\t\tfor (let i = 0; i < this.rows; i++) {\n\t\t\tfor (let j = 0; j < this.cols; j++) {\n\t\t\t\tif (this.grid[i][j] === 0) {\n\t\t\t\t\tstr += ' . ';\n\t\t\t\t} else {\n\t\t\t\t\tstr += ' X ';\n\t\t\t\t}\n\t\t\t}\n\t\t\tstr += \"\\n\";\n\t\t}\n\t\treturn str;\n\t}", "function board_string(board, x, y) {\n\tvar boardstr = \"\"\n\tfor (var i = 0; i < board.length; i++) {\n\t\tfor (var j = 0; j < board[i].length; j++){\n\t\t\tboardstr += board[i][j];\n\t\t}\n\t\tboardstr += \"\\n\";\n\t}\n\treturn boardstr;\n}", "static serialize(dataset) {\n if (!Array.isArray(dataset)) {\n dataset = NQuads.legacyDatasetToQuads(dataset);\n }\n const quads = [];\n for (const quad of dataset) {\n quads.push(NQuads.serializeQuad(quad));\n }\n return quads.sort().join('');\n }", "getStringFromBoard() {\n const result = [];\n for (let row = 0; row < 9; row++) {\n for (let column = 0; column < 9; column++) {\n const value = this.sudokuBoard[row][column];\n result.push(!!value ? value : '.');\n }\n }\n return result.join('');\n }", "toString(field) {\n field = field || 'rgb';\n var lines = '';\n if (field === 'rgb') {\n for (var y = 0; y < this.height; y ++) {\n for (var x = 0; x < this.width; x ++) {\n var pos = this.pixelToIndex(x, y)\n var rgb = Array.prototype.slice.call(this.picture, pos, pos + 3);\n lines += (this.rgbToNum(rgb[0], rgb[1], rgb[2]) / 100000).toFixed(2) + '\\t';\n }\n lines += '\\n';\n }\n } else {\n for (var y = 0; y < this.height; y++) {\n for (var x = 0; x < this.width; x++) {\n var val = this.energy_matrix[x][y];\n if (val && field in val) {\n lines += val[field].toFixed(2) + \"\\t\";\n } else {\n lines += '-----\\t';\n }\n }\n lines += '\\n';\n }\n }\n return lines;\n }", "formatBoard() {\n\t\treturn map2DArray(this.props.boardState.boardArray, boardCellData)\n\t}", "function reprCardArray(array: Array<Card>) {\n var cards = [];\n for(var i=0;i<array.length;i++) cards.push(array[i].reprString());\n return \"[\" + cards.join(', ') + \"]\";\n}", "function ArrayToString(arr, offs, len)\r\n{\r\n\tvar str = \"[\"; \r\n\tlen += offs-1;\t\r\n\tfor(var i=offs; i <= len; i++){\r\n\t \tstr += (arr[i] > 9 && arr[i] <= 0xffffffff) ? \"0x\" + arr[i].toString(16) : arr[i];\r\n\t \tstr += (i < len) ? \", \" : \"]\";\r\n\t}\r\n\treturn str;\r\n}", "function printArray(a){\nif (a.length == 0){\n return 'empty array' ;\n}\n var result = '';\nfor (var i = 0; i<a.length; i++) {\n result = result + 'row ' + i + ' \\n';\n console.log(result)\n for (var j=0; j<a[i].length; j++){\n result = result + a[i][j] + '\\n';\n }\n}\nreturn result;\n}", "function TwoDArray()\n{\n for (var i = 0; i <= _rows; i++)\n {\n _tblArray[i] = [];\n for (var j = 0; j <= _columns; j++)\n _tblArray[i][j] = \"\";\n }\n}", "function printGrid(arr) {\n for (var j = 0; j < arr[0].length; j++) {\n var rowStr = \"\";\n for (var i = 0; i < arr.length; i++) {\n rowStr += arr[i][j];\n }\n fs.appendFile(\"./grid.txt\", rowStr + \"\\n\", (err) => {\n if (err) {\n console.log(err);\n }\n });\n }\n}", "function nestedDataToString(nestedData) {\n let nestedArray = [],\n resultString;\n if (nestedData !== undefined) {\n nestedData.forEach(function (item) {\n nestedArray.push(item.name);\n });\n }\n resultString = nestedArray.join(\", \"); // array to string\n return resultString;\n}", "function stringJSON() {\n\treturn JSON.stringify(json_array);\n}", "toString() {\n let result = \"\";\n for (let r = 0; r < this.boardSize; ++r) {\n for (let c = 0; c < this.boardSize; ++c) {\n let candy = this.square[r][c];\n if (candy) {\n result += candy.toString().charAt(0) + \" \";\n } else {\n result += \"_ \";\n }\n }\n result += \"<br/>\";\n }\n return result.toString();\n }", "function doubleToString(num) {\n return [].slice.call(\n new Uint8Array(\n (\n new Float64Array([num]) //create a float64 array\n ).buffer) //extract the array buffer\n , 0) // convert the Uint8Array into a regular array\n .map(function(e) { //since it's a regular array, we can now use map\n return String.fromCharCode(e) // encode all the bytes individually\n })\n .reverse() //correct the byte endianness (assume it's little endian for now)\n .join('') // join the bytes in holy matrimony as a string\n }", "function json_msj(array)\n{\n\treturn JSON.stringify(array)\n}", "function boardGridToString(grid) {\n const seenPiece = {};\n return grid.map(row => {\n return row.map(piece => {\n // Only return the symbol for the top-left most coord in the piece.\n // Otherwise, return '.'\n if (piece === null || piece.id in seenPiece) {\n return '.';\n }\n seenPiece[piece.id] = true;\n return TYPE_NAME_TO_PIECE_SYMBOL_MAP[piece.type.name];\n }).join('');\n }).join('\\n');\n}", "function arrayBufferToString(input) {\n return String.fromCharCode(...new Uint8Array(input));\n}" ]
[ "0.76576245", "0.6971339", "0.68766296", "0.6825946", "0.67475617", "0.6708025", "0.6658892", "0.66103774", "0.6514228", "0.64866453", "0.64840454", "0.64628834", "0.6404085", "0.63432866", "0.6264638", "0.6248481", "0.6239691", "0.619287", "0.61865664", "0.6184741", "0.6175389", "0.61564094", "0.6145896", "0.6145306", "0.61162394", "0.6085517", "0.60753256", "0.60753256", "0.6074539", "0.606054", "0.6054579", "0.6014043", "0.6014043", "0.6014043", "0.6003584", "0.5993561", "0.5967793", "0.5933718", "0.59320956", "0.593049", "0.59266156", "0.59156615", "0.59066474", "0.5899082", "0.58950806", "0.58909047", "0.58909047", "0.58887863", "0.5851643", "0.58391845", "0.58232266", "0.5813495", "0.5813495", "0.5813495", "0.57941836", "0.5793321", "0.57857424", "0.5783321", "0.577748", "0.577748", "0.5775773", "0.5730115", "0.5724614", "0.57234335", "0.57039714", "0.5699264", "0.56960005", "0.56771433", "0.5676112", "0.5669446", "0.56574607", "0.565074", "0.56463957", "0.5645053", "0.56414187", "0.563746", "0.5633363", "0.5628755", "0.5610316", "0.56098604", "0.55762374", "0.55665076", "0.55641264", "0.5559256", "0.5548335", "0.554457", "0.55350775", "0.55328816", "0.5513551", "0.5505444", "0.55052036", "0.5501098", "0.54970443", "0.5489581", "0.54796773", "0.5468397", "0.54659766", "0.546594", "0.5448977", "0.5448514", "0.5443703" ]
0.0
-1
Reverses the conversion for database retrieval
function stringToMap (mapString) { var array = mapString.toString().split('|') var map = [] var i = 0 array.forEach(function (row) { map[i] = (row.substring(1, row.length - 1)).split(',') i++ }) return map }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reverseConvert() {\n\n }", "inverse() {\n this.transformType = 'inversed';\n const rgbValues = [...this.colorTable].map(a => {\n return [a.slice(0, 2), a.slice(2,4), a.slice(4, 6)].map(b => {\n const rgbValue = (255 - parseInt(b, 16)).toString(16);\n return rgbValue.length === 1 ? `0${rgbValue}` : rgbValue;\n }).join('');\n });\n this.updateColorTable(rgbValues.join(''));\n }", "invert() {\n this.reverse = !this.reverse;\n this._applySpeed();\n }", "invertEnPassant(enPassent){\r\n if(enPassent === \"-\") return enPassent;\r\n else{\r\n var tmp = enPassent.split(\"\")\r\n var output = \"\";\r\n output += this.mapValue(tmp[0]);\r\n output += this.mapValue(tmp[1]);\r\n }\r\n return output;\r\n }", "function reverseData(element,inputFieldValues){\r\n\tif (element.style.direction == \"rtl\"){\r\n\t\tvar text = inputFieldValues;\r\n\t\tvar len = text.length;\r\n\t\tvar temp = \"\";\r\n\t\tfor(var j=0;j<len;++j){\r\n\t\t\ttemp += text.charAt(len - j - 1);\r\n\t\t}\r\n\t\tinputFieldValues = temp;\r\n\t}\r\n\treturn inputFieldValues;\r\n}", "function tempConvert(){\n \n}", "invert(myObject){\r\n //object variable to hold inverted value:key pairs\r\n let invObject = {};\r\n // store old value and old key\r\n let oldKey = '';\r\n let oldValue = '';\r\n for (oldKey in myObject){\r\n // use bracket method to cater for all key and value types\r\n oldValue = myObject[oldKey];\r\n //swap the value for key\r\n invObject[oldValue] = oldKey;\r\n }\r\n return invObject;\r\n }", "reverse() {}", "invert() {\n this.transformType = 'inverted';\n for(var i = 0; i < this.colorTableBuffer.length; i++) {\n this.colorTableBuffer[i] = Math.floor(255 - this.colorTableBuffer[i]);\n }\n }", "inverseSorting() {\n if (this.get('order') === 'asc') {\n this.set('currentSort', this.get('inverseDasherizerized'));\n } else if (this.get('order') === 'desc') {\n this.set('currentSort', '');\n } else { // if currentSorting is not set to this field\n this.set('currentSort', this.get('dasherizerized'));\n }\n }", "function reverse(input) {}", "function invertir_text(texto) { \n return texto.split('').reverse().join('')\n}", "function convertBackwards(str) {\n let backwardsString = str.split(\"\").reverse().join(\"\");\n console.log(\"The user string backwards is: \" + backwardsString);\n var box1El = document.getElementById('box1');\n box1El.innerHTML = backwardsString;\n }", "function reversal(value1) {\n return value1.split(\"\").reverse().join(\"\");\n}", "function reverseInPlace(str) {}", "function inverti (wordToReverse) {\r\n var parolaInvertita = '';\r\n for (var i = wordToReverse.length - 1; i >= 0; i--) {\r\n parolaInvertita += wordToReverse[i];\r\n }\r\n return parolaInvertita;\r\n}", "reverse() {\n }", "reverse() {\n return exports.seq(this.toArray().reverse());\n }", "function convert2(){\n\n}", "revert() { }", "function inverse(flag){\n\tif (flag==0)\n\t\treturn \"b\";\n\tif (flag==1)\n\t\treturn \"w\";\n}", "function dataReverse(data){\r\n \r\n let newArr = [];\r\n let finalArr = [];\r\n \r\n for(let i = 0; i < data.length; i++){\r\n \r\n if(newArr.length < 8){\r\n newArr.push(data[i]);\r\n } else { \r\n finalArr.push(newArr.join(\"\"));\r\n i--;\r\n newArr = [];\r\n }\r\n }\r\n \r\n return finalArr.concat(newArr.join(\"\")).reverse().join(\"\").split(\"\").map(Number);\r\n}", "function reverse(v) {\n return REVERSE_TABLE[v & 0xff] << 24 | REVERSE_TABLE[v >>> 8 & 0xff] << 16 | REVERSE_TABLE[v >>> 16 & 0xff] << 8 | REVERSE_TABLE[v >>> 24 & 0xff];\n }", "function reverse(str) {\n \n}", "function reactionReverse () {\n direction = -direction; // Stromrichtung umkehren\n reset(); // Ausgangsstellung\n }", "function revertChanges() {\n if (typeof db.getItem(savedData) !== 'undefined' && db.getItem(savedData) !== 'undefined' && db.getItem(savedData) !== 'null' && db.getItem(savedData) != null && db.getItem(savedData) !== \"\") {\n mainP.innerHTML = db.getItem(savedData);\n //makeEditable();\n sanitizeItems();\n };\n }", "invertNumber() {\n if (isNaN(this.getLastOperator())) return;\n let lastNumber = Number(this.getLastPosition(false));\n if (lastNumber >= 0) {\n lastNumber *= -1;\n } else {\n lastNumber *= -1;\n }\n this.setLastOperator(lastNumber);\n this.updateDisplay();\n }", "function inverse(){\n\t\n\tlet inverted =\tcalculation['operand'] = -(calculation['operand']);\n\tdisplay.textContent = inverted;\n\t\n}", "function convert_data(data_db){\n\n var con = data_db.split('-');\n var data_br = con[1]+'-'+con[2]+'-'+con[0]\n return data_br;\n}", "get invert() {\n return (\"invert\" in this.raw) ? this.raw.invert : false;\n }", "Reverse() {\n\n }", "function reversNumber(number){\n var strNumber = \"\";\n strNumber = strNumber + number;\n \n var strNumberReverse = \"\";\n \n for (var i = strNumber.length-1; i >= 0; i--){\n strNumberReverse+=strNumber[i];\n }\n \n \n return parseInt(strNumberReverse, 10);\n \n}", "function reverse(str) {\n \n}", "function reverse(word_to_flip) {\r\n\tvar flipped_word = '';\r\n\tfor (var i = word_to_flip.length - 1; i >= 0; i --)\r\n\t\tflipped_word += word_to_flip[i];\r\n\t\treturn flipped_word;\r\n}", "function unformat(x)\n\t\t{\n\t\t\tvar x = x.split('/').reverse().join('-');\n\t\t\treturn x;\n\t\t}", "inverse() {\nreturn (TRX.fromTRX(this)).setInvert();\n}", "function reverse(kata) {\n if (typeof kata !== 'string') {\n return 'error input bukan string'\n } else {\n let convert = ''\n for (let m = kata.length - 1; m >= 0; m--) {\n convert += kata[m]\n }\n return convert\n }\n \n}", "invert (object) {\n const invertedObject = {};\n for(key in object) {\n let originalValue = object.key;\n invertedObject.originalValue = key;\n }\n return invertedObject;\n }", "function reverse(num) {\n num = num + \"\";\n // return num.toString().replace(/\\D/g, '0').split('').reverse().join();\n return num.split(\"\").reverse().join(\"\");\n}", "function reverseAssignment() {\n utilitymanager_1.um.utilityManager({\n utilType: utilitymanager_1.um.TIXUtilityType.utInTransform,\n sp: utilitymanager_1.um.TIXSelPolicy.Sentence,\n pat: /(\\${0,1})\\b(.+)(\\s+)([=<>]=*|[!:]=+)(\\s+)([^;]+)/,\n repl: \"$6$3$4$5$1$2\",\n });\n }", "function reverseData(date) {\n\tvar dd = date.slice(0, 2);\n\tvar mm = date.slice(3, 5);\n\tvar yyyy = date.slice(6, 10);\n\treturn yyyy + \"/\" + mm + \"/\" + dd;\n}", "function reversed(num) {\n num = parseFloat(num.toString().split(\"\").reverse().join(\"\"));\n\n return num;\n}", "invert() {\r\n this.data = this.data.map(rows => rows.map(cols => cols*-1));\r\n }", "invert() {\n this.polygons.forEach(p => p.flip());\n this.plane.flip();\n if (this.front !== null) {\n this.front.invert();\n }\n if (this.back !== null) {\n this.back.invert();\n }\n let temp = this.front;\n this.front = this.back;\n this.back = temp;\n }", "function reverseNumber(n){\n return parseFloat(n.toString().split('').reverse('').join('')) * Math.sign(n);\n }", "function inverter(objeto) {\n const objetoInvertido = {}\n\n Object.entries(objeto).forEach( parChaveValor => {\n const chave = 0;\n valor = 1;\n\n objetoInvertido[ parChaveValor[valor] ] = parChaveValor[chave]\n })\n\n return objetoInvertido\n}", "function reverse(obj) {\n if (!is_1.isValue(obj))\n return null;\n // Reverse an array.\n if (is_1.isArray(obj))\n return obj.reverse();\n // Reverse a string.\n if (is_1.isString(obj)) {\n var i = obj.toString().length;\n var tmpStr = '';\n while (i--)\n tmpStr += obj[i];\n return tmpStr;\n }\n // Reverse an object.\n var result = {};\n for (var p in obj) {\n if (is_1.isObject(obj[p]))\n continue;\n result[obj[p]] = p;\n }\n return result;\n}", "invert1(object) {\n const invertedObject = {};\n\n for (let prop in object) {\n const originalValue = object[prop];\n invertedObject[originalValue] = prop;\n }\n return invertedObject;\n }", "invertMatrix() {\n glMatrix.mat4.invert(this._inverseTransformationMatrix, this._TransformationMatrix);\n }", "function deconvertNotes(notes) {\n if (notes.ver <= 5) {\n self.log(\" Is v5\");\n return deflateNotes(notes);\n }\n else if (notes.ver <= 6) {\n self.log(\" Is v6\");\n notes = deflateNotes(notes);\n return compressBlob(notes);\n }\n return notes;\n\n // Utilities\n function compressBlob(notes) {\n // Make way for the blob!\n var users = JSON.stringify(notes.users);\n delete notes.users;\n\n notes.blob = TBUtils.zlibDeflate(users);\n return notes;\n }\n }", "function reverse(str){\n // YOUR CODE HERE\n}", "function reverse2(str2)\n{\n let z = str2.split('');\n console.log(typeof(z)); //Object\n z.reverse();\n str2 = z.join('');\n return str2;\n}", "function conversion_function() {\n for (const key in Ledger) {\n // AccountIDs to integer\n let ID_value = Ledger[key].AccountID;\n ID_value = Number(ID_value);\n Ledger[key].AccountID = ID_value;\n\n // TransactionValues to 2decimal strings\n let decimal_value = Ledger[key].TransactionValue;\n decimal_value = decimal_value.toFixed(2);\n Ledger[key].TransactionValue = decimal_value;\n }\n }", "function convert() {\n var num = $('.texty').val();\n var ara = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 6, 5, 4, 1]; //Arabic numbers\n var rom = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'VI', 'V', 'IV', 'I']; //Roman numerals\n var final = '';\n for (var i = 0; i < rom.length; i++) {\n while (num >= ara[i]) {\n final += rom[i];\n num -= ara[i];\n }\n }\n $('.texty').val(final);\n }", "reverseInPlace() {\n if (this._points.length >= 2) {\n let i0 = 0;\n let i1 = this._points.length - 1;\n while (i0 < i1) {\n const a = this._points[i0];\n this._points[i1] = this._points[i0];\n this._points[i0] = a;\n i0++;\n i1--;\n }\n }\n }", "function reverseNumber(number) {\n number = number.toString(); \n return number.split('').reverse().join(''); \n}", "function printObjectValuesInReverse(object) {\n // YOUR CODE BELOW HERE //\n //use object.values() to put keys in a separate array\n //.reverse() to reverse the array\n //forEach() method on obj array to print each indexed char if it is a key in\n let obj = Object.values(object).reverse();\n obj.forEach(prop => console.log(prop));\n\n \n //for (var key in object) {\n \n //obj.push(object[key]);\n //}\n \n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function rev6() {\n var str = document.querySelector('#box6 p').textContent;\n str = str.split(\"\").reverse().join(\"\");\n document.querySelector('#box6 p').textContent = str; \n}", "function reverse(str) {\n // viết code ở đây.\n return str.split(\"\").reverse().join('');\n}", "function reverseDirection(direction) {\n switch (direction) {\n case \"left\":\n return \"right\";\n case \"right\":\n return \"left\";\n case \"up\":\n return \"down\";\n case \"down\":\n return \"up\";\n default:\n return \"\";\n }\n}", "invert(obj) {\n const invertedObj = {};\n\n for (let [key, value] of Object.entries(obj)) {\n invertedObj[value] = key;\n }\n return invertedObj;\n }", "function restoreSortOrder()\r\n\t{\r\n\t\tvar\t\tcolObject ;\r\n\t\t\r\n\t\tvar\t\tdoReverse = false;\r\n\t\tvar\t\tcol = class_sortColumn;\r\n\t\t\r\n\t\t\r\n\t\tif( class_sortColumn.charAt( 0 ) === '-' )\r\n\t\t{\r\n\t\t\tdoReverse = true;\r\n\t\t\tcol = class_sortColumn.substring( 1 );\r\n\t\t}\t\t\t\r\n\t\t\r\n\t\tfor ( idx = 0; idx < class_columnDefinitionArray.length ; idx++ )\r\n\t\t{\r\n\r\n\t\t\tif( class_columnDefinitionArray[ idx ].GetColName() == col )\r\n\t\t\t{\r\n\t\t\t\tcolObject = class_columnDefinitionArray[ idx ];\r\n\t\t\t\tclass_myRows.sort( colObject.SortComparitor ) ;\t\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tif( doReverse === true ) \r\n\t\t{\r\n\t\t\tclass_myRows.reverse();\r\n\t\t}\r\n\r\n\t\tclass_buildTable();\r\n\r\n\t}", "function reverse(str) {\n return str.split('').reduce((rev, char) => char + rev, '');\n // show การใช้ arry ให้ interviewer อึ้งไปเลย\n // reduce รับค่า 2 ค่า คือ function และ ค่าตั้งต้นของตัวแปรตังหนึ่ง\n // โดยมันจะเอา ตัวแปรตัวนั้นไปใส่เป็น argument แรก ของ function ดังกล่าว\n // แล้ว result ที่ return จาก function ดังกล่าวก็จะเป็นตัวแปลตั้งต้นในรอบถัดๆไปแทน\n // ส่วน argrument อื่น ของ function นั้นก็ตาม array ปกติ\n}", "reverseInPlace() { const a = this._radians0; this._radians0 = this._radians1; this._radians1 = a; }", "function invertirUnaPalabra(String){\n\n}", "reverse() {\n const { _coords } = this\n const numCoords = _coords.length\n const numVertices = numCoords / 2\n let tmp\n\n for (let i = 0; i < numVertices; i += 2) {\n tmp = _coords[i]\n _coords[i] = _coords[numCoords - i - 2]\n _coords[numCoords - i - 2] = tmp\n\n tmp = _coords[i + 1]\n _coords[i + 1] = _coords[numCoords - i - 1]\n _coords[numCoords - i - 1] = tmp\n }\n }", "get reversed(){\n\t\t\treturn this.getReversed();\n\t\t}", "function reverse(str) {\n debugger;\n const array = new MyArray().fromStrings(str);\n const strArr = array.data;\n\n let temp;\n const count = array.length-1;\n\n for(let i=0; i < Math.floor(count/2) ; i++) {\n temp = strArr[i];\n strArr[i]=strArr[count-i];\n strArr[count-i]= temp;\n }\n // console.log(strArr);\n return strArr;\n\n }", "_reverseCols() {\n this.forEach(arr => {\n arr.reverse();\n });\n }", "invert() {\n let inverse = new Mapping();\n inverse.appendMappingInverted(this);\n return inverse;\n }", "function reverse(inputr) {\n return inputr.split(\"\").reverse().join(\"\");\n}", "reverse( x, y, oppositeDay ) {\n // this one is symmetric, don't need oppositeDay\n var str = this.target;\n var newStr = [];\n var pos;\n\n for (var i = 0; i < str.length; i++) {\n\n if (i < x) {\n newStr.push( str[i] );\n } else if (i > y) {\n newStr.push( str[i] );\n } else {\n for (var j=0; j <= y-x; j++, i++) {\n newStr.push( str[y-j] );\n }\n i--; // counteract outer loop\n }\n }\n this.target = newStr.join(\"\");\n }", "convertBackwards(letter) {\n const inIndex = this._inputIndex(letter)\n letter = plainAlphabet.charAt(inIndex)\n const outIndex = this._outputIndex(letter, this._rotor.alphabet)\n return plainAlphabet.charAt(outIndex)\n }", "function invertCase(string) {\n var trans = \"\";\n for (var i in string) {\n if (string[i] === string[i].toUpperCase()) {\n trans = trans + string[i].toLowerCase();\n } else {\n trans = trans + string[i].toUpperCase();\n }\n }\n console.log(trans);\n}", "function reverse(inputForReversal) {\n if (Array.isArray(inputForReversal)) {\n return inputForReversal.slice().reverse();\n } else {\n return inputForReversal.split(\"\").reverse().join(\"\");\n }\n}", "function reverse2(str) {\n\t// todo validate input\n\n\treturn str.split('').reverse().join('');\n}", "function invert(range) {\r\n var output = [],\r\n lastEnd = -1,\r\n start;\r\n XRegExp.forEach(range, /\\\\u(\\w{4})(?:-\\\\u(\\w{4}))?/, function (m) {\r\n start = dec(m[1]);\r\n if (start > (lastEnd + 1)) {\r\n output.push(\"\\\\u\" + pad4(hex(lastEnd + 1)));\r\n if (start > (lastEnd + 2)) {\r\n output.push(\"-\\\\u\" + pad4(hex(start - 1)));\r\n }\r\n }\r\n lastEnd = dec(m[2] || m[1]);\r\n });\r\n if (lastEnd < 0xFFFF) {\r\n output.push(\"\\\\u\" + pad4(hex(lastEnd + 1)));\r\n if (lastEnd < 0xFFFE) {\r\n output.push(\"-\\\\uFFFF\");\r\n }\r\n }\r\n return output.join(\"\");\r\n }", "function invert(range) {\r\n var output = [],\r\n lastEnd = -1,\r\n start;\r\n XRegExp.forEach(range, /\\\\u(\\w{4})(?:-\\\\u(\\w{4}))?/, function (m) {\r\n start = dec(m[1]);\r\n if (start > (lastEnd + 1)) {\r\n output.push(\"\\\\u\" + pad4(hex(lastEnd + 1)));\r\n if (start > (lastEnd + 2)) {\r\n output.push(\"-\\\\u\" + pad4(hex(start - 1)));\r\n }\r\n }\r\n lastEnd = dec(m[2] || m[1]);\r\n });\r\n if (lastEnd < 0xFFFF) {\r\n output.push(\"\\\\u\" + pad4(hex(lastEnd + 1)));\r\n if (lastEnd < 0xFFFE) {\r\n output.push(\"-\\\\uFFFF\");\r\n }\r\n }\r\n return output.join(\"\");\r\n }", "function invert(range) {\n var output = [],\n lastEnd = -1,\n start;\n XRegExp.forEach(range, /\\\\u(\\w{4})(?:-\\\\u(\\w{4}))?/, function (m) {\n start = dec(m[1]);\n if (start > (lastEnd + 1)) {\n output.push(\"\\\\u\" + pad4(hex(lastEnd + 1)));\n if (start > (lastEnd + 2)) {\n output.push(\"-\\\\u\" + pad4(hex(start - 1)));\n }\n }\n lastEnd = dec(m[2] || m[1]);\n });\n if (lastEnd < 0xFFFF) {\n output.push(\"\\\\u\" + pad4(hex(lastEnd + 1)));\n if (lastEnd < 0xFFFE) {\n output.push(\"-\\\\uFFFF\");\n }\n }\n return output.join(\"\");\n }", "function invert(range) {\n var output = [],\n lastEnd = -1,\n start;\n XRegExp.forEach(range, /\\\\u(\\w{4})(?:-\\\\u(\\w{4}))?/, function (m) {\n start = dec(m[1]);\n if (start > (lastEnd + 1)) {\n output.push(\"\\\\u\" + pad4(hex(lastEnd + 1)));\n if (start > (lastEnd + 2)) {\n output.push(\"-\\\\u\" + pad4(hex(start - 1)));\n }\n }\n lastEnd = dec(m[2] || m[1]);\n });\n if (lastEnd < 0xFFFF) {\n output.push(\"\\\\u\" + pad4(hex(lastEnd + 1)));\n if (lastEnd < 0xFFFE) {\n output.push(\"-\\\\uFFFF\");\n }\n }\n return output.join(\"\");\n }", "function invert(range) {\n var output = [],\n lastEnd = -1,\n start;\n XRegExp.forEach(range, /\\\\u(\\w{4})(?:-\\\\u(\\w{4}))?/, function (m) {\n start = dec(m[1]);\n if (start > (lastEnd + 1)) {\n output.push(\"\\\\u\" + pad4(hex(lastEnd + 1)));\n if (start > (lastEnd + 2)) {\n output.push(\"-\\\\u\" + pad4(hex(start - 1)));\n }\n }\n lastEnd = dec(m[2] || m[1]);\n });\n if (lastEnd < 0xFFFF) {\n output.push(\"\\\\u\" + pad4(hex(lastEnd + 1)));\n if (lastEnd < 0xFFFE) {\n output.push(\"-\\\\uFFFF\");\n }\n }\n return output.join(\"\");\n }", "function convertTemp(from, to){\n //\n}", "function reverse(sen) {\nreturn sen.split(\"\").reverse().join(\"\");\n}", "function reverseDirection( dir ) {\n if(dir === 'left') {\n return 'right';\n }\n return 'left';\n}", "function C(t,r,e,n,o){const i=function(t,r,e){void 0===r.inFormat&&(r.inFormat=e.defInFormat);void 0===r.outFormat&&(r.outFormat=e.defOutFormat);void 0===r.swap&&(r.swap=e.defSwap);if(r.inFormat===r.outFormat)return r;const n=r.inFormat.substring(0,1),o=r.outFormat.substring(0,1);let i,u=r.inFormat.substring(1,4),s=r.outFormat.substring(1,4);\"C\"===u.charAt(0)&&(i=V(t),u=\"ltr\"===i||\"rtl\"===i?i.toUpperCase():\"L\"===r.inFormat.charAt(2)?\"LTR\":\"RTL\",r.inFormat=n+u);\"C\"===s.charAt(0)&&(i=V(t),\"rtl\"===i?s=\"RTL\":\"ltr\"===i?(i=function(t){const r=t.split(\"\");return r.reverse(),V(r.join(\"\"))}(t),s=i.toUpperCase()):s=\"L\"===r.outFormat.charAt(2)?\"LTR\":\"RTL\",r.outFormat=o+s);return r}(t,{inFormat:r,outFormat:e,swap:n},o);if(i.inFormat===i.outFormat)return t;r=i.inFormat,e=i.outFormat,n=i.swap;const u=r.substring(0,1),s=r.substring(1,4),a=e.substring(0,1),f=e.substring(1,4);if(o.inFormat=r,o.outFormat=e,o.swap=n,\"L\"===u&&\"VLTR\"===e){if(\"LTR\"===s)return o.dir=nt,E(t,o);if(\"RTL\"===s)return o.dir=ot,E(t,o)}if(\"V\"===u&&\"V\"===a)return o.dir=\"RTL\"===s?ot:nt,x(t,o);if(\"L\"===u&&\"VRTL\"===e)return\"LTR\"===s?(o.dir=nt,t=E(t,o)):(o.dir=ot,t=E(t,o)),x(t);if(\"VLTR\"===r&&\"LLTR\"===e)return o.dir=nt,E(t,o);if(\"V\"===u&&\"L\"===a&&s!==f)return t=x(t),\"RTL\"===s?C(t,\"LLTR\",\"VLTR\",n,o):C(t,\"LRTL\",\"VRTL\",n,o);if(\"VRTL\"===r&&\"LRTL\"===e)return C(t,\"LRTL\",\"VRTL\",n,o);if(\"L\"===u&&\"L\"===a){const r=o.swap;return o.swap=r.substr(0,1)+\"N\",\"RTL\"===s?(o.dir=ot,t=E(t,o),o.swap=\"N\"+r.substr(1,2),o.dir=nt,t=E(t,o)):(o.dir=nt,t=E(t,o),o.swap=\"N\"+r.substr(1,2),t=C(t,\"VLTR\",\"LRTL\",o.swap,o)),t}return t}", "function inverse()\n {\n current_input = 1 / current_input\n displayCurrentInput();\n }", "function undici () {}", "function eachReverse(e,t){if(e){var i;for(i=e.length-1;i>-1&&(!e[i]||!t(e[i],i,e));i-=1);}}", "function langReverse(text) {\n let origDict = null, mapDict = null;\n\n //cyrillic\n if (/[а-яА-ЯЁё]/.test(text)) {\n origDict = Constants.DICTIONARIES_REVERSE['ru'];\n mapDict = Constants.DICTIONARIES_REVERSE['en'];\n } else {\n origDict = Constants.DICTIONARIES_REVERSE['en'];\n mapDict = Constants.DICTIONARIES_REVERSE['ru'];\n }\n return mapString(text, origDict, mapDict);\n}", "invertDictionary(dict) {\n dict['inverted'] = {};\n\n for (const prop in dict) {\n if (prop === 'inverted' || !dict.hasOwnProperty(prop)) continue;\n\n const val = dict[prop];\n\n if (typeof val === 'object' && !(val instanceof Array)) {\n this.invertDictionary(val);\n }\n else {\n if (dict['inverted'][val] === undefined) {\n dict['inverted'][val] = [prop];\n }\n else {\n dict['inverted'][val].push(prop);\n }\n }\n }\n }", "function reverser(sentence){\n return sentence.split(' ').map(word => word.split('').reverse()).join(' ').replace(/,/g,'')\n}", "reverseStepSequence(stepSequence) {\n\t\tstepSequence.reverse();\n\t\tfor (let idx in stepSequence) {\n\t\t\tconst step = stepSequence[idx];\n\t\t\tconst stepType = step[0];\n\t\t\tconst stepContent = step[1];\n\t\t\tswitch(stepType) {\n\t\t\t\tcase 'move':\n\t\t\t\t\tthis.reverseMove(stepContent);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'build':\n\t\t\t\t\tthis.reverseBuild(stepContent);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'defeat':\n\t\t\t\t\tthis.reverseDefeat(stepContent);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'activate':\n\t\t\t\t\tthis.reverseActivate(stepContent);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'mobility':\n\t\t\t\t\tthis.reverseMobility(step);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.log('UNKNOWN stepType IN stepSequence');\n\t\t\t\t\tconsole.log(step);\n\t\t\t}\n\t\t}\n\t}", "function invertirUnaPalabra(cad) {\n var invertida = \"\";\n if (typeof cad === 'string') {\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = cad[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var x = _step2.value;\n\n invertida = x + invertida;\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n return invertida;\n }\n}", "reverseInPlace() { this._bcurve.reverseInPlace(); }", "reverse() {\n var originalCompareFn = this.compare;\n this.compare = function(a, b) {\n return originalCompareFn(b, a);\n };\n }", "function flipWord(word) {\n\n //creates an empty string\n let revWord = \"\";\n\n //for every letter in the word, create a word with the letters in reverse\n for (let index = word.length - 1; index >= 0; index--) {\n let letter = word[index];\n\n revWord += letter;\n }\n\n return revWord;\n}", "function reverseOriginDestination() {\n // read what they are now\n var origin = UserPreferences.getPreference('origin');\n var originText = UserPreferences.getPreference('originText');\n var destination = UserPreferences.getPreference('destination');\n var destinationText = UserPreferences.getPreference('destinationText');\n\n // update local storage\n UserPreferences.setPreference('origin', destination);\n UserPreferences.setPreference('originText', destinationText);\n UserPreferences.setPreference('destination', origin);\n UserPreferences.setPreference('destinationText', originText);\n\n // update the text control\n typeaheads.origin.setValue(destinationText);\n typeaheads.destination.setValue(originText);\n\n // Trigger reversed event, with new origin and destination, for directions controller to use\n events.trigger(eventNames.reversed, [destination, origin]);\n }", "function reverseInt(num) {\n\tlet int = num.toString().split(\"\").reverse().join(\"\")\n\tint = parseInt(int);\n\n\t//kondisi ini untuk jika ada angka yang bernilai negative\n\tif(num < 0 ) {\n\t\treturn int * -1;\n\t}\n\n\tconsole.log(int)\n\n\n}", "function reversedNumber(num) {\n return parseFloat(num.toString().split('').reverse().join('') )\n}", "function FirstReverse(str) {\n //konversi string jadi array\n var strPisah=str.split('');\n var strBalik=[];\n //pengisian arr strBalik dengan urutan terbalik\n for (var i=0;i<str.length+1;i++) {\n strBalik[i]=strPisah[str.length-i];\n }\n //konversi array jadi string\n str=strBalik.join('');\n return str;\n\n}", "_convertTo(resource) {\n if (resource instanceof Array) {\n return resource.map(r => this._convertTo(r));\n }\n const r = resource;\n if (resource.id)\n r._id = resource.id;\n delete r.id;\n return resource;\n }" ]
[ "0.7745531", "0.6292661", "0.6172164", "0.6052386", "0.60404193", "0.603734", "0.5937914", "0.59252733", "0.59230417", "0.58855826", "0.5844509", "0.58030623", "0.57887006", "0.56212085", "0.56128436", "0.5587698", "0.55811447", "0.5567177", "0.5548188", "0.5546536", "0.55304366", "0.55255", "0.5522322", "0.5514583", "0.5514548", "0.5504548", "0.5504086", "0.55040777", "0.55007386", "0.5473664", "0.54697925", "0.5466293", "0.544193", "0.54260445", "0.5417553", "0.54163283", "0.5407353", "0.53386086", "0.53289855", "0.5327897", "0.5322025", "0.53166133", "0.5314096", "0.5313161", "0.53071976", "0.530323", "0.5301935", "0.52955705", "0.5291587", "0.52736914", "0.5272046", "0.5264069", "0.52615345", "0.52386355", "0.5225485", "0.52218616", "0.5219917", "0.5219699", "0.52155185", "0.5214407", "0.5212569", "0.5209337", "0.5208564", "0.5201839", "0.51986694", "0.5180755", "0.51798546", "0.51779425", "0.5177921", "0.5165364", "0.5157832", "0.515213", "0.51487595", "0.51478565", "0.5141199", "0.5136162", "0.5134222", "0.5134222", "0.51342183", "0.51342183", "0.51342183", "0.51337653", "0.5128207", "0.51257515", "0.5124363", "0.5122037", "0.5118553", "0.51100045", "0.510374", "0.5102481", "0.51022506", "0.50963235", "0.5091943", "0.50910467", "0.50816196", "0.50803614", "0.50782925", "0.5070034", "0.50680315", "0.5066181", "0.506388" ]
0.0
-1
get popular films from API DB
async fetchPopularFilms() { let popularFilms = 'trending/movie/week?'; try { const response = await axios.get( BASE_URL + popularFilms + API_KEY + '&language=en-US&page=' + `&page=${this.localService.getPaginationPage()}`, ); this.localService.setLocalTotalCards(response.data.total_results); this.localService.setPaginationPage(response.data.page); return response.data; } catch (error) { return error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getAllFilms() {\n const responseData = await fetch(\"https://ghibliapi.herokuapp.com/films\");\n\n const response = await responseData.json();\n\n return response;\n }", "function getPopularMovies(){\n var url = \"https://api.themoviedb.org/3/movie/popular?api_key=\" + api_key + \"&language=fr\";\n return get(url);\n}", "function fetchPopularFilmsByPage(page) {\n newApiService.pageNum = page;\n return newApiService.insertGenresToMovieObj();\n}", "function getMostPopular() {\r\n var url = 'https://api.nytimes.com/svc/mostpopular/v2/mostemailed/Magazine/30.json';\r\n let params = {\r\n q: 'query',\r\n 'api-key': '85b2939e3df349dd8502775e8623d350'\r\n }\r\n url += '?' + $.param(params)\r\n $.ajax({\r\n url: url, \r\n method: 'GET',\r\n }).done(function(result) {\r\n console.log(result);\r\n // Define which results will be displayed and display them\r\n var article_url = results.url;\r\n var title = results.title;\r\n $('#results').append(\"<li><h3>\" + title + \r\n \"</h3>\" + article_url + \"</li>\");\r\n }).fail(function(err) {\r\n throw err;\r\n });\r\n }", "getPopularMovies() {\n const requestSettings = {\n method: 'GET',\n baseURL: API_BASE_URL,\n url: AVAILABLE_API_METHODS.getPopular,\n params: {\n api_key: API_KEY\n }\n };\n\n return axios(requestSettings);\n }", "function loadMoreMovies(){\n console.log(\"Page Number = \" + pageNum)\n const endpoint = `${topRatedFilms_url}${api_key}&page=${pageNum += 1}`;\n fetchMovies(endpoint)\n }", "async fetchQueriedFilms() {\n try {\n const response = await axios.get(\n // need to verify request's url (url ok)\n BASE_URL +\n this.endPoint +\n API_KEY +\n '&language=en-US&page=' +\n `${this.localService.getPaginationPage()}&query=${this.query}`,\n );\n return response.data;\n } catch (error) {\n return error;\n }\n }", "function getPopularMovies() {\n\tif(G.hasInternet()) {\n\t\tvar url = CFG[\"URLS\"][\"MOVIES\"][\"POPULAR\"] + G.URL_PARAMETERS.API_KEY;\n\t\tvar xhr = Ti.Network.createHTTPClient({\n\t\t\ttimeout: 10000,\n\t\t\tonerror: function onerror(e) {\n\t\t\t\tG.info(e);\n\t\t\t},\n\t\t\tonload: function onload(e) {\n\t\t\t\ttry {\n\t\t\t\t\tparseResponse(this.responseText);\n\t\t\t\t\t$.movies.trigger('change');\n\t\t\t\t\t$.ptr.hide();\n\t\t\t\t} catch(e) {\n\t\t\t\t\tG.info(e);\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\txhr.open(\"GET\", url);\n\t\txhr.send();\n\t} else {\n\t\tinfo(\"No internet connection\");\n\t}\n}", "async findAllFilms(){\n return Movie.find();\n }", "async GetMovies( page = 1) {\n const data = await fetch(\n `${global.apiUrl}/popular?api_key=${global.apiKey}&language=${\n global.lang\n }&page=${page}`)\n\n const json = await data.json()\n return json\n }", "function getSevenBestMovies(url, doc){\n getMovies(url).then(function(response){\n let movies = [];\n let i = 0;\n let max = 7;\n\n while (i < response.results.length){\n movies.push(response.results[i]);\n i++;\n }\n\n if (movies.length < max){\n max = max - movies.length;\n getMovies(response.next).then(function(response){\n i = 0;\n while (i < max){\n movies.push(response.results[i]);\n i++\n };\n\n for (movie of movies){\n\n getInfos(movie, doc)\n\n }\n })\n }\n })\n}", "async function getPopularMovies() {\n const popularMoviesUrl = getUrl(\"/movie/popular\");\n const result = await getData(`${popularMoviesUrl}`);\n\n state.movies.popular = result.results;\n\n return result;\n}", "async function getMostWatched(chId, vidCount){\n // https://www.googleapis.com/youtube/v3/search?part=snippet&channelId={ch_id}&key={key}&maxResults=5&order=viewcount\n\n const getReqTemp = `https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=${chId}&key=${keys.apiKey}&maxResults=${vidCount}&order=viewcount&type=video`\n\n const response = await fetch(getReqTemp)\n const data = await response.json()\n const topVids = data.items\n\n return topVids\n}", "function howManyMovies(movies){\n if (movies == 0){}\n else {\n var dramaFilms = [];\n for (var i = 0; i < movies.length; i++){\n for (var j = 0; j < movies[i].genre.length; j++){\n if (movies[i].genre[j] === 'Drama'){\n dramaFilms.push(movies[i])\n }\n }\n}\n var stevenFilms = dramaFilms.filter(function(elm){\n return elm.director == 'Steven Spielberg';\n });\n return 'Steven Spielberg directed ' + stevenFilms.length + ' drama movies!'\n}\n}", "static async getData () {\n return await App.getPage('popular', 1);\n }", "getPopularTv() {\n return apiClient.get(\n `/tv/popular?api_key=6c1e80dae659cb7d1abdf16afd8bb0e3&language=en-US&page=1`\n )\n }", "function getAllMoviesCount(cb) {\n Movie.find({}, (err, mlist) => {\n if(err) {\n cb(err, null);\n return;\n }\n cb(null, mlist.length);\n });\n}", "function getMovies (req, resp) {\n console.log(\"\\tgetMovies called\");\n var filter = sharedVars.parseFilter(req.swagger.params);\n getFilteredMovies(filter, function(getError, data) {\n if (getError) {// If an error occured, just say it failed\n sharedVars.sendError(resp, 500, 'Failed to get a list of movies.', data);\n } else {// If successful, send json back\n // Update analytics for all the movies\n console.log(\"\\tSending analytics for movie list...\");\n for(var movieIndex in data.entities) {\n sharedVars.sendAnalytic(data.entities[movieIndex].name);\n }\n if (!sharedVars.shouldGetReviews(req.swagger.params)) {\n // If no reviews needed, just return the data\n resp.json(data);\n\n } else {\n // Add reviews to each movie in the list\n console.log(\"\\t\\tAppending reviews to list...\");\n async.each(data.entities, function(movie, callback) { // Is called for each request\n // Manually ask for connections...\n getReviews(movie, function(revError, revData) {\n movie.reviews = revData;\n if (revError) // If couldn't append reviews to movie, report error\n callback(revData);\n else // If reviews appended successfully, return\n callback();\n });\n }, function(error) { // Is called after all requests are done\n if (error) { // If an error occurred, set error message\n resp.statusCode = 500;\n data.message = error;\n }\n resp.json(data);\n });\n }\n }\n });\n}", "async findAllFilms(filmCollection){\n return movie.find(filmCollection);\n }", "function howManyMovies(collection){\n var filterMovies;\n if(collection === undefined || collection.length === 0){\n return undefined;\n }\n else{\n filterMovies = collection.filter(function(movie){\n return (movie.genre.includes(\"Drama\") && movie.director.includes(\"Steven Spielberg\"));\n });\n var numberOfMovies;\n if (filterMovies.length === 0){\n numberOfMovies = 0;\n }\n else{\n numberOfMovies = filterMovies.length;\n }\n var msg = \"Steven Spielberg directed \"+ numberOfMovies +\" drama movies!\"\n return msg;\n }\n}", "function howManyMovies (movies) {\n \n}", "function getGenres(){\n var url = \"http://api.themoviedb.org/3/genre/movie/list?api_key=\" + api_key + \"&language=fr\";\n return get(url);\n}", "function searchFilm() {\n if (searchQuery.length === 0) {\n searchQuery = \"Mr. Nobody\"\n }\n request(`http://www.omdbapi.com/?t=${searchQuery}&plot=short&apikey=5d94fa00`, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(`Movie: ${JSON.parse(body).Title}`);\n console.log(`Starring: ${JSON.parse(body).Actors}`);\n console.log(`Year: ${JSON.parse(body).Year}`);\n console.log(`Origin: ${JSON.parse(body).Country}`);\n console.log(`Language: ${JSON.parse(body).Language}`);\n console.log(`IMDB Rating: ${JSON.parse(body).imdbRating}`);\n console.log(`Tomato-meter: ${JSON.parse(body).Ratings[1].Value}`);\n console.log(`Synopsis: ${JSON.parse(body).Plot}`); \n }\n });\n}", "function howManyMovies(movies) {\n const filterd = movies.filter(function(movie) {\n return movie.director === 'Steven Spielberg' &&\n movie.genre.includes('Drama')\n })\n}", "function obterFilmesPalavraChave(palavraChave) {\n\t\tlet valorPagina = $('#paginaPesquisar').val()\n\t\tvar maximoPagina = \" \";\n\t\tconsole.log('key')\n\t\tlet xmlHttp = new XMLHttpRequest();\n\t\txmlHttp.open('GET', 'https://api.themoviedb.org/3/keyword/' + palavraChave + '/movies?api_key=bd9f051458a4c87fe4c873ef463542e3&page=' + valorPagina +'language=pt-BR&include_adult=false');\n\t\t//Pecorrendo o array xmlHttp\n\t\txmlHttp.onreadystatechange = () => {\n\t\t\t//verificando o status e o state da API.\n\t\t\tif(xmlHttp.readyState == 4 & xmlHttp.status == 200){\t\t\t\n\t\t\t\t//Criando um objeto com o response do json\n\t\t\t\tlet XMLFilmes = xmlHttp.responseText; \n\t\t\t\tlet jsonFilmes = JSON.parse(XMLFilmes);\n\t\t\t\t//tamanho = jsonFilmes.total_pages\n\t\t\t\t//Criando uma coluna para outras informações\n\n\t\t\t\tvar maximoPagina = jsonFilmes.total_pages\n\t\t\t\tconsole.log(maximoPagina)\n\t\t\t\tfor(let i in jsonFilmes['results']){\n\t\t\t\t\tlet item = \tjsonFilmes['results'][i]\n\t\t\t\t\tif(jsonFilmes['results'][i].length == 0){\n\t\t\t\t\t\t$('#botaoMostrarMais').addClass('d-none')\n\t\t\t\t\t}\n\t\t\t\t\tlet a = document.createElement('a');\n\t\t\t\t\tlet img = document.createElement('img')\n\t\t\t\t\tif(item.poster_path !== null){\n\t\t\t\t\t\ta.href = \"mistermovies_controller.php?idFilme=\" + item.id + \"&controle=9\"\n a.id = \"filme\";\n\t\t\t\t\t\timg.className = \"item round float-left mx-1 my-1 my-sm-1 mx-sm-1 my-md-3 mx-md-2\";\n\t\t\t\t\t\timg.src = \"https://image.tmdb.org/t/p/original\" + item.poster_path\n\t\t\t\t\t\t//Criando a árvore do DOM\n\t\t\t\t\t\ta.appendChild(img);\n\t\t\t\t\t\tdocument.getElementById('listaPesquisa').appendChild(a);\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t\tif(valorPagina < maximoPagina){\n\t\t\t\t\tconsole.log('entrou no if')\n\t\t\t\t\tlet paginaInt = parseInt(valorPagina);\n\t\t\t\t\tconsole.log(paginaInt)\n\t\t\t\t\tlet pagina = paginaInt + 1;\n\t\t\t\t\t$('#paginaPesquisar').val('')\n\t\t\t\t\t$('#paginaPesquisar').val(pagina)\n\t\t\t\t}else {\n\t\t\t\t\t$('#botaoMostrarMais').attr('disabled', true);\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\t//Tratamento do erro 401/404\n\t\t\telse if(xmlHttp.readyState == 4 & xmlHttp.status == 401 || xmlHttp.status == 404){\t\t\n\t\t}\n\t}\n\t\n\t\t\n\t\t\n\t\t//enviado a requisição\n\t\txmlHttp.send();\n\t}", "function howManyMovies(movies){\n\n}", "function fetchSimilars() {\n Books.getSimilar($stateParams.id)\n .then(function(result) {\n $scope.similars = result.collection;\n })\n .catch(function(error) {\n $scope.error = error;\n });\n }", "function howManyMovies (data){\n if(data.length === 0){\n return 0\n }\n \n let directorArray = data.filter(function(el){\n return el.director == 'Steven Spielberg' && el.genre.includes('Drama')\n })\n\n return directorArray.length\n}", "function addMovies() {\n fetch('https://ghibliapi.herokuapp.com/films')\n .then(response => response.json())\n .then(movies => movies.forEach(movie => addCard(movie)))\n .catch(err => console.err);\n}", "function getMoreTweets(req, res, next) {\n\n User.find({}).sort({tweets_app: -1}).limit(20).exec(\n function (err, users) {\n res.status(200).json(users);\n }\n );\n\n }", "_loadFilms() {\n this.setState({isLoading: true});\n if (this.searchedText.length > 0) {\n getFilmsFromApiWithSearchedText(this.searchedText, this.page + 1).then(data => {\n this.page = data.page;\n this.totalPage = data.totalPage;\n this.setState({\n // on concatene le tableau de nouveaux films avec celui deja recupere\n films: [...this.state.films, ...data.results],\n isLoading: false\n })\n }\n )\n }\n }", "async getTopGIFs(req, res) {\n console.log(\"getTopGIFs()\")\n\n var topGifs = []\n const docs = await GIF.find({})\n\n docs.forEach(GIF => {\n if (topGifs.length < 4) topGifs.push(GIF)\n else for (let el of topGifs) {\n topGifs.sort(function (a, b) { return b.rank - a.rank })\n if (GIF.rank > el.rank) {\n topGifs.pop()\n topGifs.push(GIF)\n break;\n }\n }\n })\n\n topGifs.sort(function (a, b) { return b.rank - a.rank })\n\n if (topGifs) res.json(topGifs)\n else res.status(404).send(\"not found\")\n }", "function getFilm(search) {\n\n\tomdb.getMovie(search)\n\n}", "function loadMoreMovies () {\n if(!vm.searchString || vm.searchType !== 'Movies'){\n vm.pageToLoad ++;\n if(vm.pageToLoad < vm.totalPages){\n MovieFactory.getPopularMovies(vm.pageToLoad).then((result) => {\n vm.shownMovies = vm.shownMovies.concat(result.data.results);\n });\n }\n }\n }", "fetchMovies() {\n const year = this.state.year;\n const genre = this.state.genre;\n superagent.get('/api/movies?year=' + year.getFullYear().toString() + '&genre=' + genre)\n .then((res) => {\n // Count the number of movies returned:\n const numMovies = res.body.reduce(function(acc, cur) {\n return acc += cur.length;\n }, 0);\n\n // If no movies, create alert state:\n const alerts = Object.assign(this.state.alerts, {});\n alerts.noMoviesFound = numMovies ? 1 : 0;\n \n // Update state of movies and alerts:\n this.setState({\n movies: res.body,\n alerts: alerts\n })\n })\n .catch(err => console.error(err))\n }", "function searchFilmsByTitle(title) {\n let format = title.split(' ').join('+'); // replace spaces with plus\n $.ajax({\n url: `https://www.omdbapi.com/?apikey=ac155d96&s=${format}`,\n dataType: \"json\"\n }).done(function(resp) {\n if (resp.Search != null) {\n let respSize = resp.Search.length;\n for (let i = 0; i < respSize; i++) {\n if(resp.Search[i].Poster != 'N/A' && resp.Search[i].Type == 'movie') {\n let myHTML = \n `<div class=\"col-sm-6\">\n <a class=\"movie-select\" href=\"#\" id=\"${resp.Search[i].imdbID}\">\n <img class=\"movie-image\" src=\"${resp.Search[i].Poster}\">\n </a>\n </div>`;\n $(\"#movies\").append(myHTML);\n }\n }\n } else {\n let myHTML =\n `<div class=\"col-sm-12\">\n <div class=\"alert alert-primary col\" role=\"alert\">\n ${resp.Error}\n </div></div>`;\n $(\"#movies\").append(myHTML);\n }\n });\n }", "function getMovieList(movieList = [], pagenum=1) {\n\t\tconst url = \"https://api.themoviedb.org/3/discover/movie?&api_key=933bee1465a61090ebe0704cd6d4c3e1\" +\n \"&with_genres=\" + genreIDs + \n \"&without_genres=\" + genreExclusions +\n\t\t\t\t\t\t\"&vote_average.gte=\" + filters.voteAverage +\n\t\t\t \"&vote_count.gte=\" + 50 +\n\t\t\t\t\t\t\"&certification_country=US\" + \n \"&certification=\" + filters.rating +\n\t\t\t\t\t\t\"&page=\" + pagenum + \n\t\t\t\t\t\t\"&primary_release_date.gte=\" + filters.releaseDecade[0] + '-01-01' +\n\t\t\t\t\t\t\"&primary_release_date.lte=\" + filters.releaseDecade[1] + '-12-31';\n \n\t\t$.ajax({\n url: url,\n datatype: 'json',\n success:function(data){\n\n if (data['total_results'] > 20*pagenum && movieList.length <= 25 ) {\n for (let movie of data['results']) {\n screenMovie(movieList, movie);\n }\n \n pagenum++\n getMovieList(movieList, pagenum);\n } else {\n scrubbedResults = scrubDuplicates(movieList);\n showResponse();\n }\n },\n failure:function(error){\n showError(error.text);\n }\n });\n\t}", "function getGenres() {\n // TODO: get categories from wp headless\n // https://movie-api.cederdorff.com/wp-json/wp/v2/categories\n}", "function getSimilarMovies(searchInput, maxResults) {\n\n const parameters = {\n api_key: tmdbKey,\n language: \"en-US\",\n query: searchInput,\n page: 1,\n }\n const queryString = formatTmdbQueryParams(parameters);\n const tmdbSearchURL = \"https://api.themoviedb.org/3/search/movie/?\"\n const similarURL = tmdbSearchURL + queryString;\n\n fetch(similarURL).then(response => {\n if(response.ok) {\n return response.json();\n } throw new Error(\"Oh the HORROR! Something went wrong :(\")\n }).then(responseJson => { \nconsole.log(`responseJson is:`, responseJson);\n if(responseJson.hasOwnProperty(\"0\")) {\n throw new Error(responseJson.Error);\n }\n let results = responseJson.results;\n let titles = results.map(item => item[\"title\"]);\n //for each result, display the title per the displaySimilarMovies function them in a list item\n displaySimilarMovies(titles, maxResults) \n }).catch(err => {\nconsole.log(`err is ${err}`)\n handleUndefined()\n });\n }", "function getMostPopularFood() {\n return rest.one(\"popularfood\").get();\n }", "searchTv(){\r\n axios.get(\"https://api.themoviedb.org/3/search/tv\", {\r\n params:{\r\n 'api_key': this.apikey,\r\n query: this.searchTitle,\r\n language: this.language,\r\n region: this.language,\r\n sort_by: \"vote_average.desc\",\r\n page: this.page\r\n }\r\n })\r\n .then(response => {\r\n let arr = response.data.results\r\n arr.map(el => el.title = el.name)\r\n arr.sort(function (a, b) {return b.vote_average - a.vote_average;})\r\n this.films = this.films.concat(arr.filter(this.validateFilm))\r\n this.maxPages = response.data.total_pages\r\n })\r\n }", "function list(limit, token, cb){\n\t\tvar q = ds.createQuery([kind])\n\t .limit(limit)\n\t .order('name')\n\t .start(token);\n\n\t ds.runQuery(q, function(err, entities, nextQuery) {\n\t if (err) { return cb(err); }\n\t var hasMore = entities.length === limit ? nextQuery.startVal : false;\n\t cb(null, entities.map(fromDatastore), hasMore);\n\t });\n\t}", "function getMovies() {\n console.log(\"fetching api\");\n fetch(\"https://imdb8.p.rapidapi.com/title/get-most-popular-movies?purchaseCountry=US&homeCountry=US&currentCountry=US\", {\n\t \"method\": \"GET\",\n\t \"headers\": {\n\t\t \"x-rapidapi-host\": \"imdb8.p.rapidapi.com\",\n\t\t \"x-rapidapi-key\": RAPID_API_KEY\n }\n })\n .then((resp) => resp.json())\n .then(resp => resp.slice(0,5))\n .then(resp => {\n setTimeout(displayMovies(resp), 1) // wait 1 sec before calling the other api because the api only supports 5 calls in 1 second.\n })\n}", "async function fetchData() {\n const response =await trackPromise(API.get(`films/`));\n console.log(response);\n let resultsArray = response.data.results;\n resultsArray = sortBy(resultsArray, o => o.episode_id)\n setMovies(resultsArray);\n }", "function getMostPopularArticles(res, days) {\n Q()\n .then(createMostPopularMap.bind(null, days))\n .all()\n .then(addArticlesToMostPopular)\n .then(prepareMostPopularForResponse)\n .then(function(results) {\n res.send(results);\n })\n .then(function() {\n mostPopular = {};\n })\n .done();\n return;\n}", "function getPesquisaFilmes() {\n\tlet nomeDoFilme = document.getElementById(\"pesquisar\").value\n\n\tlet valorPagina = $('#paginaPesquisar').val()\n\tvar maximoPagina = \" \";\n\t//buscar API\n\t/*if(h != undefined){\n\t\t$('#listaPesquisa').empty();\n\n\t}*/document.title = nomeDoFilme + \" - MisterMovie\"\n\t\tlet xmlHttp = new XMLHttpRequest();\n\t\txmlHttp.open('GET', 'https://api.themoviedb.org/3/search/movie?api_key=bd9f051458a4c87fe4c873ef463542e3&language=pt-BRS&query=' + nomeDoFilme + '&page=' + valorPagina +'&include_adult=false');\n\t\t//Pecorrendo o array xmlHttp\n\t\txmlHttp.onreadystatechange = () => {\n\t\t\t//verificando o status e o state da API.\n\t\t\tif(xmlHttp.readyState == 4 & xmlHttp.status == 200){\t\t\t\n\t\t\t\t//Criando um objeto com o response do json\n\t\t\t\tlet XMLFilmes = xmlHttp.responseText; \n\t\t\t\tlet jsonFilmes = JSON.parse(XMLFilmes);\n\t\t\t\tvar maximoPagina = jsonFilmes.total_pages\n\t\t\t\tfor(let i in jsonFilmes['results']){\n\t\t\t\t\tlet item = \tjsonFilmes['results'][i]\n\t\t\t\t\tlet a = document.createElement('a');\n\t\t\t\t\tlet img = document.createElement('img')\n\t\t\t\t\tif(item.poster_path !== null){\n\t\t\t\t\t\ta.href = \"mistermovies_controller.php?idFilme=\" + item.id + \"&controle=9\"\n a.id = \"filme\";\n\t\t\t\t\t\timg.className = \"item round float-left mx-1 my-1 my-sm-1 mx-sm-1 my-md-3 mx-md-2\";\n\t\t\t\t\t\timg.src = \"https://image.tmdb.org/t/p/original\" + item.poster_path\n\t\t\t\t\t\t//Criando a árvore do DOM\n\t\t\t\t\t\ta.appendChild(img);\n\t\t\t\t\t\t$('#listaPesquisa').append(a);\n\t\t\t\t\t}\t\t\n\t\t\t\t}\n\t\t\t\tif(valorPagina < maximoPagina ){\n\t\t\t\t\tconsole.log('entrou no if')\n\t\t\t\t\tlet paginaInt = parseInt(valorPagina);\n\t\t\t\t\tconsole.log(paginaInt)\n\t\t\t\t\tlet pagina = paginaInt + 1;\n\t\t\t\t\t$('#paginaPesquisar').val('')\n\t\t\t\t\t$('#paginaPesquisar').val(pagina)\n\t\t\t\t}else {\n\t\t\t\t\tconsole.log(jsonFilmes.results.length)\n\t\t\t\t\tif(jsonFilmes.results.length === 0){\n\t\t\t\t\t\t$('#mensagemVazia').html('Nenhum filme encontrado.')\n\t\t\t\t\t\t$('#botaoMostrarMais').removeClass('d-block')\n\t\t\t\t\t\t$('#botaoMostrarMais').addClass('d-none')\n\t\t\t\t\t}\n\t\t\t\t\t$('#botaoMostrarMais').attr('disabled', true);\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\t//Tratamento do erro 401/404\n\t\t\tif(xmlHttp.readyState == 4 & xmlHttp.status == 401 || xmlHttp.status == 404){\n\t\t\t//mensagem de erro\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//enviado a requisição\n\t\txmlHttp.send();\n\t}", "function GetFilms() {\n $.ajax({\n url: \"/api/films\",\n type: \"GET\",\n contentType: \"application/json\",\n success: function (films) {\n let rows = \"\";\n\n $.each(films, function (index, film) {\n rows += row(film);\n });\n\n $(\"table tbody\").append(rows);\n }\n });\n }", "function highestRating(movieList){\r\n //first find out which video has the higest rating, then check to see if there are any other videos with that rating.\r\n //push all videos with highest rating into var topVideos array.\r\n //access movieLists[0].videos[0].rating\r\n //access movieLists[0].videos[0].title\r\n //use a forEach loop to check every rating.\r\n var highestRating = 0;\r\n var topMovies = [];\r\n movieList.forEach(genre => {\r\n genre.videos.forEach(video => {\r\n if(video.rating > highestRating){\r\n highestRating = video.rating;\r\n }\r\n });\r\n });\r\n \r\n movieList.forEach(genre => {\r\n genre.videos.forEach(video => {\r\n if(video.rating === highestRating){\r\n topMovies.push(video.title);\r\n }\r\n });\r\n });\r\n return topMovies;\r\n}", "function getSuggestions(request, response) {\n const suggestionsURL = `https://api.themoviedb.org/3/movie/popular?api_key=${MOVIE_API_KEY}&language=en-US&page=1`;\n\n superagent\n .get(suggestionsURL)\n .then(res => {\n return res.body.results.map(movieData => new Movies(movieData));\n })\n .then(results => {\n response.send(results);\n })\n .catch(error => {\n console.log(error);\n });\n}", "function popular (page, requestedThumbnailType) {\n const thumbnailType = requestedThumbnailType || DEFAULT_THUMBNAIL_TYPE;\n const params = {\n feature: 'popular',\n image_size: `${thumbnailType}, 1080`, // get urls for both a thumbnail and full size image\n page: page || 0 // Begin loading at the first page if a page parameter isn't passed\n };\n return queryAPI('photos', params).then(photos => parsePhotos(photos, thumbnailType));\n}", "findHighestFive() {\n return `SELECT r.apiID, AVG(r.review) AvgReview, count(r.review) ReviewCount\n from reviews r\n group by r.apiID\n order by AvgReview desc, ReviewCount desc\n limit 5;`;\n }", "function getTopRatedMovies() {\n\n const path = '/movie/top_rated';\n\n const url = generateUrl(path);\n\n const render = renderMovies.bind({title: 'Top Rated Movies'});\n\n sectionMovies(url, render, handleError);\n\n}", "function howManyMovies (listMovies) {\n\n if (listMovies.length === 0){\n return undefined;\n }\n else{\n var dramaSp= \n listMovies.filter (function (array){\n return array.genre.includes('Drama') && array.director.includes ('Steven Spielberg')\n });\n\n } \n return \"Steven Spielberg directed \"+ dramaSp.length + \" drama movies!\";\n\n}", "searchMovie(name) {\n let movieByName = `https://api.themoviedb.org/3/search/movie?api_key=${this.API_KEY}&language=en-US&query=${name}&page=1&include_adult=false`\n\n fetch(movieByName)\n .then(response => {\n return response.json()\n }).then(movie => {\n let fiveMovieName = ''\n\n // Take only five movie within all movie\n if (movie) {\n try {\n fiveMovieName = movie.results.filter((movie, index) => {\n return index < 5\n })\n } catch(err) {\n \n }\n }\n this.getRelatedMovie(fiveMovieName)\n // It pass first movie id to searchMovieById\n this.searchMovieById(movie.results[0].id)\n })\n }", "function testAPI() {\n // FB.api(\n // '/me',\n // 'GET', {\n // \"fields\": \"tagged_places.limit(50)\"\n // },\n // function(response) {\n // setPlaces(response)\n // initMap()\n // }\n // );\n\n FB.api(\n '/me',\n 'GET', {\n \"fields\": \"posts.limit(1000){place,picture}\"\n },\n function(response) {\n setPlaces(response)\n initMap()\n }\n );\n}", "function getFriendsAlbums() {\n var deferred = $q.defer();\n Facebook.api('/me/friends?fields=albums.limit(5).fields(count,updated_time,name,type),name,picture', function(response) {\n if(response.data) {\n console.log(response);\n deferred.resolve(response);\n } else {\n //error handling\n }\n })\n return deferred.promise;\n }", "async function getBestQuizzes(howmany) {\n let json = [];\n //sort in result.totalcount descending order and get 'howmany' items after 'lastDocument'\n await firestore()\n .collection('AllQuiz')\n .orderBy('result.totalcount', 'desc')\n .limit(howmany)\n .get()\n .then((collection) => {\n collection.forEach((document) => {\n json.push({id: document.id, ...document.data()});\n });\n });\n\n //return list and the last and first document of this list\n return json;\n}", "function getMovieGenres () {\n var params = {\n url: 'https://api.themoviedb.org/3/genre/movie/list?&api_key=7af46ede7373e3339ef7980f35025ed3&language=en-US',\n cache: true\n };\n return servicesForProject.promiseGet(params);\n }", "getMovies() {\n let movies = []\n return fetch(`https://swapi.co/api/films`)\n .then(res => res.json())\n .then(body => body.results.forEach(movie => movies.push(movie)))\n .then(() => {\n return movies\n })\n .catch(error =>\n this.setState({\n error: \"Couldn't load movies :(\",\n isLoadingMovies: false\n })\n )\n }", "function movieFilter(req, res) {\n let response = movieListSmall;\n if (req.query.name) {\n console.log('name ran')\n response = response.filter(movie => \n movie.film_title.toLowerCase().includes(req.query.name.toLowerCase())\n )\n }\n // submit feedback for number 1.2 in assignment\n else {\n console.log('type ran')\n let responseArr = [];\n response.forEach(movie => {\n // genre\n if (movie.genre.toLowerCase() === req.query.type.toLowerCase()) {\n responseArr.push(movie)\n }\n // country\n else if (movie.country.toLowerCase() === req.query.type.toLowerCase()) {\n responseArr.push(movie)\n }\n // avg_vote\n else {\n let numOfType = Number(req.query.type)\n if (numOfType <= movie.avg_vote) {\n responseArr.push(movie)\n } \n }})\n response = responseArr\n }\n res.json(response)\n}", "function howManyMovies(param) {\n const filteredSS = param.filter(elem => elem.director.includes('Steven Spielberg'));\n const dramaSS = filteredSS.filter(elem => elem.genre.includes('Drama'));\n return dramaSS.length;\n}", "function listShowing(){\n return knex(`${table} as m`)\n .join(\"movies_theaters as mt\", \"m.movie_id\", \"mt.movie_id\")\n .select(\"m.*\")\n .where({\"mt.is_showing\": true})\n .groupBy(\"m.title\")\n}", "function howManyMovies (movies){\n var drama = movies.filter(function(movie){\n return movie.genre.includes(\"Drama\") && (movie.director === \"Steven Spielberg\")\n });\n \n return drama.length\n }", "function getFilmsByTitle (searchTerm) {\n return knex('films').where('title', 'ILIKE', '%' + searchTerm + '%')\n}", "function getAllMovies() {\n Movie.find()\n .then(allMovies => console.log('here are all the movies', allMovies))\n .catch(err => console.log('could not get all movies', err))\n}", "function btnFilter(){\r\n const url = `${path}/genre/movie/list?api_key=${api_key}&language=it-IT`\r\n fetch(url)\r\n .then((res) => res.json())\r\n .then((data) => btnGenres(data.genres))\r\n .catch((err) => console.log(err))\r\n }", "listAllRecentPopularPosts() {\n return axios.get('/posts/recent-popular');\n }", "function getMovieList(callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t\tsort_by: \"release_date.desc\",\n\t\tpage: pageCounter\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_LIST, query, callback);\n}", "function howManyMovies(tab){\n var tab2 = tab.filter(function(el){\n return el.genre.indexOf('Drama') != -1;\n }) ;\n var res = tab2.filter(function(elt){\n return elt.director == 'Steven Spielberg'; \n });\n return res.length;\n}", "function getSimilar(id){\n \n var url = 'https://api.themoviedb.org/3/movie/' + id +'/similar?api_key=224dda2ca82558ef0e550aa711aae69c';\n jQuery.ajax({\n type: 'GET',\n url: url,\n async: false,\n contentType: \"application/json\",\n dataType: 'jsonp',\n success: function(json) {\n\n //Limit the results to 15.\n length = json.results.length;\n if(length > 15){\n length = 15;\n }\n for(var i = 0; i < length; i++)\n {\n jQuery(\"#results\").append(\"<tr><td>\" + json.results[i].original_title + \"</td><td>\"+ json.results[i].vote_average + \"</td></tr>\")\n }\n jQuery(\"#results\").show();\n jQuery(\".response\").slideDown(\"2000\");\n },\n error: function(e) {\n console.log(e.message);\n }\n });\n\n}", "async function fetchMovies() {\r\n let response = await fetch(' https://api.themoviedb.org/3/movie/popular?api_key=f485e5c815c3b8ee3e79e1f1309aa1b1&language=en-US&page=1');\r\n\r\n\r\n if (response.status === 200) {\r\n let data = await response.json();\r\n\r\n console.log(data.results);\r\n showMovise(data.results);\r\n\r\n } else {\r\n\r\n\r\n console.log(response.status); // 400\r\n console.log(response.statusText); // Not Found\r\n\r\n }\r\n}", "async function fetchMovies(currentPage, searchTitle) {\n const url =\n searchTitle === undefined\n ? `${baseUrl}/discover/movie?api_key=${apiKey}&language=en-US&sort_by=popularity.desc&include_adult=false&include_video=false&page=${currentPage}&with_watch_monetization_types=flatrate`\n : `${baseUrl}/search/movie?api_key=${apiKey}&query=${searchTitle}&language=en-US&page=${currentPage}&include_adult=false`;\n\n const req = await fetch(url);\n const data = await req.json();\n if (data.total_pages !== 0) {\n print(data.results);\n totalPage = data.total_pages;\n pageButtonStyleChanger();\n return [data.results, null];\n } else {\n alert(\"Geçerli bir arama yap\");\n }\n}", "getFilteredMovies () {\n let filteredMovies = moviesFilterService.getFilteredMoviesByRating(this.data.movies);\n filteredMovies = moviesFilterService.getFilteredMoviesByGenres(filteredMovies);\n\n return filteredMovies;\n }", "function handleGetMovies(req, res){\n const { genre = \"\", country = \"\", avg_vote = \"\" } = req.query; //todo; add validation\n if(avg_vote && isNaN(avg_vote)){\n return(res.status(400).send('Please provide a number for avg_vote'));\n }\n let results = movies.filter(movie => movie.genre.toLowerCase().includes(genre.toLowerCase()));\n results = results.filter(movie => movie.country.toLowerCase().includes(country.toLowerCase()));\n results = results.filter(movie => movie.avg_vote >= avg_vote);\n\n res.status(200).json(results);\n}", "function howManyMovies(e){\n var arr = e.filter(e => e.director.includes('Steven')); \n arr = arr.filter(e => e.genre.includes('Drama'));\n return \"Steven Spielberg directed \" +arr.length +\" drama movies!\" \n}", "function getDistinctMoodsForThisImage(){\n sendCommand('get_mood_count_for_this_image');\n}", "function getFavsList(){\n let favsSlider = db.collection(\"listOfBLs\").orderBy(\"favs\", \"desc\").limit(10);\n favsSlider.get()\n .then(function(querySnapshot) {\n querySnapshot.forEach(function(doc) {\n favsList.push(doc.id);\n favsListNum.push(doc.data().favs);\n });\n crateSliderFavs(favsList, favsListNum);\n })\n .catch(function(error) {\n console.log(\"Error: \" , error);\n })\n }", "function howManyMovies(movies){\n\n if (moviesSpielberg.length == 0){\n return undefined\n }\n\n let moviesSpielberg = movies.filter(elm => {\n \n\n return elm.director == 'Steven Spielberg' && elm.genre.includes('Drama')\n })\n\n return `Steven Spielberg directed ${moviesSpielberg.length} drama movies`\n\n console.log(moviesSpielberg)\n}", "async bringFilms(){\n try {\n let getting = await database.get();\n\n if(getting){\n res.send(getting)\n }\n }catch (error) {\n console.log(error)\n }\n }", "function howManyMovies(movies) {\n const spielberg = movies.filter (function(movie) { \n if(movie.director === 'Steven Spielberg' && movie.genre.includes('Drama')) \n return movie\n })\n return spielberg.length\n}", "async findTopRated() {\n let res = await axios.get(\n \"https://api.themoviedb.org/3/movie/top_rated?api_key=210d6a5dd3f16419ce349c9f1b200d6d&language=en-US&page=1\"\n );\n\n return res.data;\n }", "function getFromApi(req, params, cb) {\n\tvar sess = req.session || req;\n\tvar name = sess.access_token.screen_name;\n\tvar u = config.twitter.base_url + '/favorites/list.json?';\n\tvar x = {\n\t\tuser_id: sess.user.id_str,\n\t\tinclude_entities: true\n\t};\n\n\tif (typeof params === 'function') {\n\t\tcb = params;\n\t\tparams = { count: 20 };\n\t}\n\t\n\tutil._extend(x, params);\n\tu += qs.stringify(x);\n\tr.get({url: u, oauth: sess.oauth, 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}", "loadFacetInfo() {\n const helper = algoliasearchHelper(client, indexName, {\n facets: [\"food_type\"]\n });\n\n helper.on(\"result\", content => {\n this.setState({\n categories: content.getFacetValues(\"food_type\", {\n sortBy: [\"count:desc\"]\n })\n });\n });\n helper.setQueryParameter(\"hitsPerPage\", 5000).search();\n }", "function loadFilmList() {\n axios.get('https://data.sfgov.org/resource/wwmu-gmzc.json').then(res => {\n renderFilmList(res.data);\n }).catch();\n}", "function howManyMovies(movies) {\n const dramaSpielberg = movies.filter(elm => elm.director === \"Steven Spielberg\" && elm.genre.includes(\"Drama\"))\n return dramaSpielberg.length\n}", "function howManyMovies (movies) {\n let stevenMovies = movies.filter (function (movie) {\n return movie.director === 'Steven Spielberg' && movie.genre.includes('Drama') \n\n });\n\n return stevenMovies.length\n}", "getLatestArticles() {\n let url = \"https://api.nytimes.com/svc/search/v2/articlesearch.json\";\n url +=\n \"?\" +\n $.param({\n \"api-key\": nytApiKey\n });\n\n axios\n .get(url)\n .then(res => {\n this.setState({\n articleRes: res.data.response.docs,\n searchQuery: \"\"\n });\n\n // get hearts count for current search results //\n axios.get(\"/favorites\").then(res => {\n this.setState({\n favRes: res.data\n });\n });\n })\n .catch(err => {\n if (err.response) {\n console.error(err.response.data);\n console.error(err.response.status);\n console.error(err.response.headers);\n } else {\n console.error(\"Error\", err.message);\n }\n });\n }", "function howManyMovies(movies) {\n let drama = movies.filter(function(movie) {\n return movie.genre.includes(\"Drama\") && movie.director === \"Steven Spielberg\"\n })\n return drama.length\n}", "function getSongsFromGenres(genres, access_token) {\n var xhr = new XMLHttpRequest();\n var query = \"limit=10\" +\n \"seed_genres=[\";\n for (var i = 0; i < genres.length; i++) {\n \tquery += genres[i];\n }\n query += \"]\";\n xhr.open(\"GET\", \"https://api.spotify.com/v1/recommendations?\" + query);\n xhr.setRequestHeader(\"Authorization\", token);\n\n xhr.onreadystatechange = function() {\n \tif (xhr.readyState == 4 && xhr.status == 200) {\n \t\tdata = filterCardData(JSON.parse(xhr.responseText));\n \t}\n }\n xhr.send(query);\n}", "async function collect(req, res) {\n try {\n const id = req.params.id;\n const movies = await imdb(id);\n\n await movies_model.insertMany(movies);\n\n res.status(200).json({\n Total: movies.length\n });\n } catch (err) {\n res.status(404).json({\n status: 'fail',\n message: err\n });\n }\n}", "function howManyMovies(movieNum) {\n let dramaMovies = movieNum.filter(elm => elm.genre.includes(\"Drama\") && elm.director === \"Steven Spielberg\")\n return dramaMovies.length\n}", "function countMovies(){\n return movies.length\n}", "function getTopRatings(res, mysql, context, complete){\n let sql = \"SELECT b.beer_id, b.beer_name, AVG(r.rating_value) AS average_stars FROM Beers b INNER JOIN Ratings r ON b.beer_id = r.beer_id GROUP by b.beer_id ORDER BY average_stars DESC LIMIT 10\";\n mysql.pool.query(sql, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.topratings = results;\n complete();\n });\n}", "function howManyMovies(aArray){\n var dramaMovies = aArray.filter(function(item){\n return (item.genre.indexOf('Drama')>-1);\n });\n var dramaMoviesOfstevenSpielberg = dramaMovies.filter(function(item){\n return item.director==='Steven Spielberg';\n });\n if (dramaMovies!=0)\n return 'Steven Spielberg directed '+dramaMoviesOfstevenSpielberg.length+' drama movies!';\n}", "function getMoviesForGenre(genreName, genreId, avg_rating){\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.themoviedb.org/3/discover/movie?with_original_language=en&with_genres=\" + genreId + \"&vote_average.gte=\" + avg_rating + \"&vote_count.gte=100&include_video=false&include_adult=false&sort_by=vote_average.desc&region=US&language=en-US&api_key=7b9a9e7e542ce68170047140f18db864\",\n \"method\": \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n }\n console.log(\"this is the avg rating i am comparing: \" + avg_rating + \" for genre \" + genreName)\n $.ajax(settings).done(function (response) {\n var rank = response.total_results\n generateGenreSection(genreName, rank, response);\n });\n\n }", "function howManyMovies(movies) {\n const stevenDrama = movies.filter(elm => elm.director === \"Steven Spielberg\" && elm.genre.includes(\"Drama\"))\n return stevenDrama.length\n}", "async function getMovies(ctx) {\n const currentDate = getCurrentDate();\n const movies = ctx.movies.find({ LastOnAir: currentDate });\n return movies.toArray();\n}", "function getLiked(req, res) {\r\n console.log('hola')\r\n let liked= []\r\n for (let i = 0; i < films.length; i++) {\r\n if (films[i].likes > 0) {\r\n liked.push(films[i])\r\n }\r\n }\r\n console.log(liked)\r\n return res.send(liked)\r\n}", "function howManyMovies(movies) {\n return movies.filter(item => item.director === 'Steven Spielberg' && item.genre.includes('Drama')).length\n}", "retrieveFavs() {\n return freendiesApi.retrieveFavs(this.__userApiToken__)\n }" ]
[ "0.7264159", "0.6814281", "0.67827076", "0.651927", "0.63706785", "0.6318846", "0.6297376", "0.62494904", "0.6239027", "0.61255807", "0.6123391", "0.6102843", "0.60699", "0.60353565", "0.6029459", "0.60192186", "0.5958336", "0.595364", "0.5898756", "0.5896913", "0.5889747", "0.58589065", "0.5855343", "0.58546096", "0.5851182", "0.58500826", "0.58432245", "0.58400714", "0.5832589", "0.58232874", "0.5820746", "0.5819121", "0.5797436", "0.5791913", "0.5785492", "0.5761196", "0.57551545", "0.57489896", "0.57452095", "0.57397", "0.57387567", "0.57130164", "0.5711899", "0.5703245", "0.5692045", "0.56908256", "0.56785065", "0.5666219", "0.5658456", "0.5655243", "0.5651487", "0.5650034", "0.5648517", "0.5647622", "0.56455505", "0.5645245", "0.5624011", "0.56200975", "0.5617443", "0.5616854", "0.5612967", "0.56126803", "0.5605057", "0.5604862", "0.5602261", "0.56016845", "0.5598779", "0.5589822", "0.5588231", "0.5586785", "0.55800754", "0.5570335", "0.556606", "0.55635625", "0.5561672", "0.5558267", "0.55561984", "0.5552645", "0.55525047", "0.5549247", "0.5546915", "0.5545493", "0.5538058", "0.55356586", "0.5518156", "0.55176294", "0.55153745", "0.5514176", "0.5513424", "0.5513395", "0.55132717", "0.55105644", "0.5508675", "0.5501035", "0.5494006", "0.54936975", "0.5489811", "0.5489645", "0.5488781", "0.5488395" ]
0.77615607
0
get searched movies by name(query)
async fetchQueriedFilms() { try { const response = await axios.get( // need to verify request's url (url ok) BASE_URL + this.endPoint + API_KEY + '&language=en-US&page=' + `${this.localService.getPaginationPage()}&query=${this.query}`, ); return response.data; } catch (error) { return error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static search(query, callback) {\n const path = `/?type=movie&s=${query}`;\n\n return makeOmdbRequest(path, (err, response) => {\n if(response) {\n // If there was no error, only return the movies array\n response = response.Search;\n }\n\n callback(err, response);\n });\n }", "function searchMovie(value) {\n\n const path = '/search/movie';\n\n const url = generateUrl(path) + '&query=' + value;\n\n const render = renderMovies.bind({title: 'Results'});\n\n sectionMovies(url, render, handleError);\n\n}", "async findByTitle({query}) {\n if (query == undefined)\n return [];\n else\n return movie.find({\"title\": query});\n }", "function searchMovies(movies){\n console.log(\"searching for:\", movies);\n axios.get(generateApiUrl('search/movie'))\n .then( (response) => {\n console.log(response);\n })\n .catch((err) => {\n console.error(err);\n });\n}", "function getFilm(search) {\n\n\tomdb.getMovie(search)\n\n}", "function searchMovies(query, callback) {\n $.ajax({\n url: api.root + \"/search/movie\",\n data: {\n api_key: api.token,\n query: query\n },\n success: function(response) {\n model.browseItems = response.results;\n callback(response);\n }\n });\n}", "searchMovie(name) {\n let movieByName = `https://api.themoviedb.org/3/search/movie?api_key=${this.API_KEY}&language=en-US&query=${name}&page=1&include_adult=false`\n\n fetch(movieByName)\n .then(response => {\n return response.json()\n }).then(movie => {\n let fiveMovieName = ''\n\n // Take only five movie within all movie\n if (movie) {\n try {\n fiveMovieName = movie.results.filter((movie, index) => {\n return index < 5\n })\n } catch(err) {\n \n }\n }\n this.getRelatedMovie(fiveMovieName)\n // It pass first movie id to searchMovieById\n this.searchMovieById(movie.results[0].id)\n })\n }", "async findByTitle({query}) {\n if(query == undefined)\n return []\n else\n return Movie.find({\"title\": query});\n }", "async function getMoviesSearch(query) {\n let response = await fetch(\n `https://api.themoviedb.org/3/search/movie?api_key=${client_key}&language=en-US&page=1&include_adult=${includeAdult}&query=${query}`\n );\n let data = await response.json();\n return data;\n}", "function movieSearch(movie, cb) {\n request(`http://www.omdbapi.com/?apikey=${omdbKey}&s=${movie}&page=${page}&type=movie&r=json`, function (error, response, body) {\n\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n\n return cb(JSON.parse(body));\n }\n\n });\n }", "function searchMovies(query, language, genre) {\n\t// ajax calling themoviedb.org api for searching movies (max 20 displayed)\n\t$.ajax({\n\t\turl: \"https://api.themoviedb.org/3/search/movie\",\n\t\tmethod: \"GET\",\n\t\tdata: {\n\t\t\tapi_key: '6258744f8a6314eddb8961371f91076e',\n\t\t\tlanguage: language,\n\t\t\tquery: query\n\t\t},\n\t\tsuccess: function (data, state) {\n\t\t\tvar movies = data.results;\n\t\t\tconsole.log(movies);\n\t\t\tprintMovies(movies, genre);\n\t\t},\n\t\terror: function (request, state, error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t});\n}", "function searchFilm() {\n if (searchQuery.length === 0) {\n searchQuery = \"Mr. Nobody\"\n }\n request(`http://www.omdbapi.com/?t=${searchQuery}&plot=short&apikey=5d94fa00`, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(`Movie: ${JSON.parse(body).Title}`);\n console.log(`Starring: ${JSON.parse(body).Actors}`);\n console.log(`Year: ${JSON.parse(body).Year}`);\n console.log(`Origin: ${JSON.parse(body).Country}`);\n console.log(`Language: ${JSON.parse(body).Language}`);\n console.log(`IMDB Rating: ${JSON.parse(body).imdbRating}`);\n console.log(`Tomato-meter: ${JSON.parse(body).Ratings[1].Value}`);\n console.log(`Synopsis: ${JSON.parse(body).Plot}`); \n }\n });\n}", "function movieSearch(event) {\n var movieSearch = $(\"#movie-input\")\n .val()\n .trim();\n\n event.preventDefault();\n\n if (!movieSearch) return;\n var queryURL =\n \"https://utelly-tv-shows-and-movies-availability-v1.p.mashape.com/lookup?\";\n var queryString = queryURL + \"country=\" + \"us\" + \"&term=\" + movieSearch;\n getMovies(queryString);\n }", "function selectMovies() {\n\n var type = Session.get('type');\n var search = Session.get('search');\n var sort = Session.get('sort');\n var filter = Session.get('filter') || {};\n\n\n\n // Update scroll position when the query changes -----------------------------\n var instantaneaousRepositionning = false;\n var query = [type, search, sort, filter.genre].join('|');\n if (query !== queryCache) {\n scroll = 0;\n scrollTo(0, 600);\n queryCache = query;\n instantaneaousRepositionning = true;\n }\n\n\n // TODO Loading icons, what happens if you search <2 letters\n\n\n // Load Data -----------------------------------------------------------------\n\n if (search.length > 1 && type === 'suggested') {\n // Global Search\n searchMovies(search, filter, sort);\n } else {\n lookupMovies(type, search, sort, filter, instantaneaousRepositionning);\n }\n}", "async function search(moviesName) {\r\n\r\n\r\n let response = await fetch(`https://api.themoviedb.org/3/search/movie?api_key=f485e5c815c3b8ee3e79e1f1309aa1b1&language=en-US&query=${moviesName}&page=1&include_adult=false`);\r\n\r\n\r\n if (response.status === 200) {\r\n let data = await response.json();\r\n\r\n showMovise(data.results);\r\n\r\n } else {\r\n\r\n\r\n console.log(response.status); // 400\r\n console.log(response.statusText); // Not Found\r\n\r\n }\r\n}", "function movieSearch() {\n var encodeName = encodeURI(searchName);\n request(\"http://www.omdbapi.com/?t=\" + encodeName + \"&y=&plot=short&r=json\", function(error, response, body) {\n\tif (!error && response.statusCode === 200) {\n\t //console.log(JSON.parse(body));\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t // year\n\t console.log(\"Year Released: \" + JSON.parse(body).Year);\n\t // imdb rating\n\t console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t // country produced\n\t console.log(\"Country: \" + JSON.parse(body).Country);\n\t // language of movie\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t // plot\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n\t // actors\n\t console.log(\"Actors: \" + JSON.parse(body).Actors);\n\t // rotten tomatoes rating\n\t console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t // rotten tomotoes url\n\t console.log(\"Rotten Tomatoes: https://www.rottentomatoes.com/search/?search=\" + encodeName);\n\t} else {\n\t console.log(error);\n\t}\n });\n} // close movie search", "searchMovie (searchTerm) { console.log(\"search\", searchTerm);\n\t\t\t\treturn $http\n\t\t\t\t\t.get(`${API_URL}s=${searchTerm}`)\n\t\t\t\t\t.then(result => result.data.Search) // Search is the key of the object returned from the API\n\t\t\t\t\t// .then(function(result){console.log(result.data)})\n\t\t\t\t\t.then(t => searchedMovies = t) // 't' is whatever is returned from the previous .then\n\t\t\t}", "function getMovies(searchText) {\n $.get(\n baseURL + searchName + searchText + \"&type=movie\",\n (respuesta, estado) => {\n if (estado === \"success\") {\n let movies = respuesta.Search;\n let output = \"\";\n $.each(movies, (i, movie) => {\n output += `\n <div class=\"col-md-3\">\n <div class=\"well text-center\">\n <img class=\"imgSearch\" src=\"${movie.Poster}\">\n <h5>${movie.Title}</h5>\n <a onclick=\"selectedMovie('${movie.imdbID}')\" class=\"btn btn-info\" href=\"#\">Mas info</a>\n </div>\n </div>\n \n `;\n });\n\n result.html(output);\n }\n }\n );\n}", "function searchMovies(title) {\n\n var url = 'http://www.omdbapi.com/?i=tt3896198&apikey=18c5a437&s=' + title;\n\n $http.get(url)\n .then(function (response) {\n model.movies = response.data.Search\n\n })\n $location.url('/movie')\n }", "searchMovies(context, keyword) {\n // 1. Set loading status\n context.commit('SET_LOADING_STATUS', 'loading');\n // 2. Make http-request - optional you can simulate a delay by wrapping it in a setTimeOut\n axios.get(url_list + keyword)\n .then(result => {\n context.commit('SET_LOADING_STATUS', 'notloading');\n context.commit('SET_MOVIES', result.data.Search); // result.data.Search, omdat de API zijn movie-resultaten teruggeeft in een array Search[]. Deze bevat de daadwerkelijke movies.\n })\n .catch(err => {\n context.commit('SET_LOADING_STATUS', 'notloading');\n context.commit('SET_MOVIES', []);\n context.commit('ADD_ERROR', err);\n })\n }", "function movieSearch(movie)\n{\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&tomatoes=true&r=json\", function (error, response, body) {\n console.log('error:', error); // Print the error if one occurre\n console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n console.log('body:', body); // Print the HTML for the Google homepage.\n console.log(body.title);\n console.log(response.title);\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 search_actor(search){\n\tvar sResult = [];\n\tfor(let films in search_results){\n\t\tvar film = search_results[films];\n\t\tif(film.folk){\n\t\tif(film.folk.toLowerCase().includes(search.toLowerCase())){\n\t\t\tactor.innerHTML+= \"<li><a href= \\\"show_movie.html?id=\" + films + \"\\\">\" + film.otitle + \"</a> </li> <br>\";\n\t\t}\n\t\t\t\n\t\t}\n\t}\n\tconsole.log(sResult);\n\t\n}", "async fetchMovies(ctx, search) {\n let result = [];\n await axios\n .get(\n \"http://www.omdbapi.com/?apiKey=\" + key.key + \"&s=\" + search + \"&page=1\"\n )\n .then(response => {\n result = response.data.Search;\n });\n ctx.commit(\"setSearchResult\", result);\n if(result == undefined) {\n ctx.commit('setSearchResponse', false);\n }\n }", "function getFilmsByTitle (searchTerm) {\n return knex('films').where('title', 'ILIKE', '%' + searchTerm + '%')\n}", "searchMovies(){\r\n document.documentElement.scrollTop = 0\r\n this.page = 1\r\n this.films = []\r\n this.searchedTitle = this.searchTitle\r\n if(this.genreSelected === \"All\"){\r\n this.searchFilm()\r\n this.searchTv()\r\n } else if(this.genreSelected === \"Films\") {\r\n this.searchFilm()\r\n } else {\r\n this.searchTv()\r\n }\r\n }", "function searchFilmsByTitle(title) {\n let format = title.split(' ').join('+'); // replace spaces with plus\n $.ajax({\n url: `https://www.omdbapi.com/?apikey=ac155d96&s=${format}`,\n dataType: \"json\"\n }).done(function(resp) {\n if (resp.Search != null) {\n let respSize = resp.Search.length;\n for (let i = 0; i < respSize; i++) {\n if(resp.Search[i].Poster != 'N/A' && resp.Search[i].Type == 'movie') {\n let myHTML = \n `<div class=\"col-sm-6\">\n <a class=\"movie-select\" href=\"#\" id=\"${resp.Search[i].imdbID}\">\n <img class=\"movie-image\" src=\"${resp.Search[i].Poster}\">\n </a>\n </div>`;\n $(\"#movies\").append(myHTML);\n }\n }\n } else {\n let myHTML =\n `<div class=\"col-sm-12\">\n <div class=\"alert alert-primary col\" role=\"alert\">\n ${resp.Error}\n </div></div>`;\n $(\"#movies\").append(myHTML);\n }\n });\n }", "search() {\n axios\n .get(this.moviesUrl + this.querySearch)\n .then(resp => {\n this.response = resp.data;\n this.moviesRes = this.response.results;\n })\n }", "function searchMovie(movieName){\n var fix=movieName.replace(/ /g,\"+\");\n console.log(fix);\n //dauflt when name is undefine\n\n axios.get(\"http://www.omdbapi.com/?t=\"+fix+\"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n console.log(\"Movie Title: \"+response.data.Title);\n console.log(\"Year: \"+response.data.Year);\n console.log(\"IMDB Rating: \"+response.data.Ratings[0]);\n console.log(\"Rotten Rating: \"+response.data.Ratings[1]);\n console.log(\"Conutry: \"+response.data.Country);\n console.log(\"Language: \"+response.data.Language);\n console.log(\"Plot of Movie: \"+response.data.Plot);\n console.log(\"Actors List: \"+response.data.Actors);\n console.log(\"-------------------------------------\");\n })\n .catch(function(error) {\n console.log(\"error\");\n });\n\n}", "searchMovie() {\n axios\n .get('https://api.themoviedb.org/3/search/movie?', {\n params: {\n 'api_key': '5081a73eac2719896b2d02d515f944ac',\n 'query': this.userInput,\n \n }\n })\n .then((response) => { \n this.movieCollection = response.data.results\n \n });\n\n axios\n .get('https://api.themoviedb.org/3/search/tv?', {\n params: {\n 'api_key': '5081a73eac2719896b2d02d515f944ac',\n 'query': this.userInput,\n \n }\n })\n .then((response) => { \n this.tvCollection = response.data.results\n \n });\n }", "async getSearchMovies() {\n const searchParams = new URLSearchParams({\n query: this.searchQuery,\n language: this.language,\n });\n const url = `${this.searchMovies}?api_key=${API__KEY}&${searchParams}&page=${this.page}`;\n try {\n const response = await axios.get(url);\n return response?.data;\n } catch {\n let warningStr =\n lang === 'en'\n ? 'Sorry: server search error, please try again later'\n : 'Извините, ошибка поиска на сервере. Пожалуйста, повторите запрос позже.';\n toastr.info(warningStr);\n }\n }", "function searchForMovie(title) {\n var promise = deferred();\n\n login().then( () => {\n request('https://tls.passthepopcorn.me/torrents.php?searchstr=' + encodeURI(title) + '&json=noredirect', function (error, res, body) {\n promise.resolve(process(JSON.parse(body)));\n });\n });\n\n return promise.promise;\n}", "function getMovies(searchText) {\r\n getData('https://www.omdbapi.com/?s=' + searchText + '&apikey=' + OMDBAPIKEY, function(err,\r\n response) {\r\n if (err) {\r\n return;\r\n }\r\n if (response.Search) {\r\n response.Search.pop();\r\n var omdbData = response.Search;\r\n var output = '';\r\n $.each(omdbData, (index, movie) => {\r\n output += htmlWriteResults(movie);\r\n });\r\n\r\n $('#movies').html(output);\r\n } else {\r\n // If we can't find any results we give a nice error message.\r\n $('#movies').html(\r\n '<section><div class=\"col-md-12\"><div class=\"well text-center\"><br><i class=\"fa fa-exclamation-triangle fa-4x whiteheader\" style=\"color: rgba(243,156,18, 1)\"></i><h2 class=\"whiteheader\">Sorry, but <b>' +\r\n searchText +\r\n '</b> gave no results</h2><br><p class=\"whiteheader\">But we would <i class=\"fa fa-heart\" style=\"color: rgba(231,76,60, 1)\"> </i> for you to try something else.</p></div></div></section>'\r\n );\r\n }\r\n });\r\n}", "searchMovieById(id) {\n this.movieById(movie => {\n this.getMovie(movie)\n }, id)\n }", "function searchIt() {\r\n if (MovieListLoaded && SeriesListLoaded) {\r\n var searchFor = window.location.href.split('?q=');\r\n var searchQuery = searchFor[1];\r\n\r\n if (searchQuery !== null && searchFor.length > 1) {\r\n document.getElementById('searchText').value = decodeURI(\r\n searchQuery);\r\n getMovies(searchQuery);\r\n }\r\n }\r\n}", "function OMDBquery(movie) {\n console.log(\"searching for movie: \" + movie);\n const queryURL =\n \"https://www.omdbapi.com/?t=\" + movie + \"=&plot=short&apikey=trilogy\";\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function (response) {\n handleMovieResponse(response);\n })\n .catch(function (error) {\n // error case\n let message = `${movie} was not found in OMDB`;\n updateErrorDiv(message);\n });\n}", "function search_genre(search){\n\tvar sResult = [];\n\tfor(let films in search_results){\n\t\tvar film = search_results[films];\n\t\tif(film.genre){\n\t\tif(film.genre.toLowerCase().includes(search.toLowerCase())){\n\t\t\tgenre.innerHTML+= \"<li><a href= \\\"show_movie.html?id=\" + films + \"\\\">\" + film.otitle + \"</a> </li> <br>\";\n\t\t}\n\t\t\t\n\t\t}\n\t}\n\tconsole.log(sResult);\n\t\n}", "function filterMovies(titlename) {\r\n const filteredMovies = movies.filter(word => word.Title.includes(titlename));\r\n addMoviesToDom(filteredMovies);\r\n}", "findMovie(movieName = \"Mr. Nobody\") {\n let query = [\n 'http://www.omdbapi.com/?',\n this.key,\n `t=${movieName}`,\n 'page=3',\n 'type=movie',\n 'r=json'\n ].join('&');\n\n console.log(`\\n=======\\nFinding the movie \"${movieName}\"`);\n this.request(query, (error, response, body) => {\n if (error) {\n console.log(\"ERROR: \", error);\n return;\n }\n\n const jsonObj = this.body2JSON(body);\n if (!jsonObj) return;\n\n console.log(`\\n=======\\nResult for the movie \"${movieName}\"`);\n this.printMovieInfo(jsonObj);\n });\n }", "async function getMovieQuery(){\n clearFields(); \n const query = document.getElementById('searchbtn')\n const input = query.value; \n if(input === ''){\n showError('Enter a movie')\n }else { \n const QUERY_URL = `https://api.themoviedb.org/3/search/movie?query=${input}&api_key=xxxxxxxxxxxxx&language=en-US&page=1&include_adult=false`; \n const response = await fetch(`${QUERY_URL}`) \n const json = await response.json(); \n showQueryData(json); \n }\n}", "function movie_find_show_all(url_query, respond){\r\n respond.write(\"<script>document.getElementById('heading').innerHTML ='Movie search All';</script>\");\r\n \r\n var search_input ='<style>input[type=search] {width: 130px;box-sizing: border-box;border: 2px solid #ccc;border-radius: 4px;font-size: 16px;background-color: white; margin:2% auto 2% 40%;background-image:url(\"searchicon.png\");background-position: 10px 10px;background-repeat: no-repeat;padding: 12px 20px 12px 40px;-webkit-transition: width 0.4s ease-in-out;transition: width 0.4s ease-in-out;}input[type=search]:focus {width: 95%;margin:2% auto 2% auto;}/* #searh_input{margin:2% auto 2% 40%;width: 50%;} */</style><input type=\"search\" name=\"search\" placeholder=\"Search..\" id=\"search_input\" onsearch =\"call_db_search()\"><button onclick=\"call_db_search()\" style =\"width:4%; height:7.5%;font-size:2.3em;border-radius:0px;background-color:transparent;\" class=\"btn btn-info\"><i class=\"fas fa-search\"></i></button><br><div id style=\"width:100%;height:7%;background-color:white;color:black;font-size:1em;\"><a href=\"movie_find_show_all\" onclick =\"\">Show all stored movies</a><br><a href=\"delete_all\" onclick =\"\">Delete all stored movies</a></div><hr><script> function call_db_search(){ var search_query = document.getElementById(\"search_input\"); if(search_query.value == \"\"){ document.getElementById(\"heading\").innerHTML =\"Please feel data to be searched for\"; } else{ window.open(\"movie_find_search?\"+search_query.value, \"_self\"); } } </script>';\r\n\r\n\r\n respond.write(search_input);\r\n \r\n \r\n //get data from db\r\n my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability\r\n if(err){\r\n // respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: \"+err+\"</p>\");\r\n //return respond.end();//ending here\r\n }\r\n else{\r\n // respond.write(\"<p>connected to db</p>\");\r\n //respond.end();//ending here\r\n }\r\n \r\n //get data from db\r\n var mysql_db_data_get = \"SELECT * FROM movie_table\"\r\n \r\n \r\n //connect to existing db\r\n \r\n my_sql_conn_db.query(mysql_db_data_get, function(err, results){\r\n \r\n if(err){\r\n // respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data adding err (serach) \"+err+\"</p>\");\r\n return ;//respond.end();//ending here\r\n }\r\n else{\r\n // respond.write(\"<p>Data added \"+JSON.stringify(results[0].m_producer)+\"</p>\");\r\n var result = results;\r\n if(results.length ==0){return respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Could'nt find movie in db, please add some</p>\");}//if record match not found\r\n var extra_results = 1;//skip result duplicate\r\n var count = 0;\r\n for(var i =0; i<=result.length; i++){\r\n db_data_shower();//break if setup is not like this\r\n extra_results =i;//capture duplicate\r\n count = i;\r\n \r\n }\r\n \r\n\r\n \r\n //respond.end();//ending here\r\n }\r\n function db_data_shower(){\r\n if(extra_results==0){return} \r\n respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Movie Title : \"+result[count].m_title+\" | Movie Director : \"+result[count].m_director+\" | Movie Producer : \"+result[count].m_producer+\" | Movie Producing Company : \"+result[count].m_production_company+\" | Movie filmed Country : \"+result[count].m_country+\" | Movie Starring : \"+result[count].m_actor+\" | Movie Genre : \"+result[count].m_genre+\" | Movie Synopsis : \"+result[count].m_description+\" | Movie Disclaimer : \"+result[count].m_disclaimer+\" | Movie Poster : \"+result[count].m_image+\"<br>\"+ \r\n '<input type=\"button\" style=\"width:40%;height:2em;margin:1% 1% 1% 1%\" onclick=\"window.open(\\'movie_update?'+result[count].movie_id+'\\',\\'_self\\')\" value=\"Update Movie\" class=\"btn btn-primary\"><input type=\"button\" style=\"width:40%;height:2em;margin:1% 1% 1% 1%\" onclick=\"window.open(\\'movie_delete?'+result[count].movie_id+'\\',\\'_self\\')\" value=\"Delete Movie\" class=\"btn btn-primary\"></p>');\r\n }\r\n }\r\n \r\n ); \r\n \r\n });\r\n \r\n}", "async fetchSpecificMovie(ctx, payload) {\n let specificSearchResult = [];\n let result = [];\n await axios.get('http://www.omdbapi.com/?apiKey='+ key.key + '&t='+ payload.searchReplaced + '&y=' + payload.year).then((response) => { specificSearchResult = response.data });\n result.push(specificSearchResult);\n ctx.commit('setSearchResult', result);\n ctx.commit('setSearchResponse', result[0].Response);\n }", "async loadSearchMovies({ commit }, search) {\n await this.$axios\n .get(`API/SearchMovie/${IMDB_KEY}/${search}`)\n .then(response => {\n commit(\"SET_MOVIES_SEARCH\", response.data.results);\n });\n }", "searchMovieAndSeries() {\n if ( this.userSearch != '' ) {\n axios\n .get( 'https://api.themoviedb.org/3/search/multi' , {\n params: {\n api_key: this.apiKey,\n query: this.userSearch\n }\n })\n .then( (response) => {\n const result = response.data;\n this.searchedMoviesAndSeries = result.results;\n });\n }\n }", "async fetchData(searchTerm) {\n const response = await axios.get('https://api.themoviedb.org/3/search/movie', {\n params: {\n api_key: 'f1aa11a7624dbaf3024fa5751d21ee70',\n query: searchTerm,\n }\n });\n // console.log(response);\n if(response.data.page === undefined){\n return [];\n }\n return response.data.results;\n }", "function findMatches(wordToMatch, movies) {\n return movies.filter(obj => {\n const regex = new RegExp(wordToMatch, 'gi');\n return obj.title.match(regex);\n });\n }", "searchByName(string){\n \n const searchName = string.toLowerCase()\n const artists = this.artistas.filter( function(artista) { return artista.name.toLowerCase().includes(searchName)} );\n const albums = this.albums.filter( function(album) { return album.name.toLowerCase().includes(searchName)} );\n const tracks = this.tracks.filter( function(track) { return track.name.includes(searchName)} );\n const playlists = this.playsLists.filter( function(playlist) { return playlist.name.includes(searchName) } );\n \n \n return {artists: artists, albums: albums, tracks: tracks, playlists: playlists};\n \n }", "getSearchedMovies () {\n\t\t\t\treturn searchedMovies;\n\t\t\t}", "function getMovie(search) {\n return fetch(\"http://www.omdbapi.com/?apikey=cc5844e4&s=\" + search)\n .then((response) => {\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n return response.json();\n })\n .then((result) => {\n if (result.Response === \"False\") {\n throw new Error(result.Error);\n }\n return result.Search;\n });\n}", "async function getMovieResults({ movieId, title }) {\n await logger(`finding: ${title}`);\n\n const parameters = querystring.stringify({\n movieId,\n apiKey: config.radarr.apiKey,\n });\n\n const searchUrl = `${_getRadarrApiPath()}/release?${parameters}`;\n return await getData({ uri: searchUrl });\n}", "function movie_find_search(url_query, respond){\r\n respond.write(\"<script>document.getElementById('heading').innerHTML ='You searched for : \"+url_query.replace(/%20/g, \" \")+\"';</script>\");\r\n \r\n var search_input ='<style>input[type=search] {width: 130px;box-sizing: border-box;border: 2px solid #ccc;border-radius: 4px;font-size: 16px;background-color: white; margin:2% auto 2% 40%;background-image:url(\"searchicon.png\");background-position: 10px 10px;background-repeat: no-repeat;padding: 12px 20px 12px 40px;-webkit-transition: width 0.4s ease-in-out;transition: width 0.4s ease-in-out;}input[type=search]:focus {width: 95%;margin:2% auto 2% auto;}/* #searh_input{margin:2% auto 2% 40%;width: 50%;} */</style><input type=\"search\" name=\"search\" placeholder=\"Search..\" id=\"search_input\" onsearch =\"call_db_search()\"><button onclick=\"call_db_search()\" style =\"width:4%; height:7.5%;font-size:2.3em;border-radius:0px;background-color:transparent;\" class=\"btn btn-info\"><i class=\"fas fa-search\"></i></button><br><hr><div id style=\"width:100%;height:7%;background-color:white;color:black;font-size:1em;\"><a href=\"movie_find_show_all\" onclick =\"\">Show all stored movies</a></div><hr><script> function call_db_search(){ var search_query = document.getElementById(\"search_input\"); if(search_query.value == \"\"){ document.getElementById(\"heading\").innerHTML =\"Please feel data to be searched for\"; } else{ window.open(\"movie_find_search?\"+search_query.value, \"_self\"); } } </script>';\r\n\r\n\r\n respond.write(search_input);//search header\r\n \r\n \r\n//clean query string\r\nvar data_to_search = url_query.replace(/%20/g, \" \"); \r\n \r\n //get data from db\r\n my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability\r\n if(err){\r\n // respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: \"+err+\"</p>\");\r\n //return respond.end();//ending here\r\n }\r\n else{\r\n // respond.write(\"<p>connected to db</p>\");\r\n //respond.end();//ending here\r\n }\r\n \r\n //get data from db\r\n //multiple row search\r\n var mysql_db_data_get = \"SELECT * FROM movie_table WHERE m_title like '%\"+data_to_search+\"%' OR m_director like '%\"+data_to_search+\"%' OR m_producer like '%\"+data_to_search+\"%' OR m_production_company like '%\"+data_to_search+\"%' OR m_country like '%\"+data_to_search+\"%' OR m_actor like '%\"+data_to_search+\"%' OR m_genre like '%\"+data_to_search+\"%' OR m_description like '%\"+data_to_search+\"%' OR m_disclaimer like '%\"+data_to_search+\"%' \";\r\n \r\n \r\n //connect to existing db\r\n \r\n my_sql_conn_db.query(mysql_db_data_get, function(err, results){\r\n \r\n if(err){\r\n // respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data connection error : \"+err+\"</p>\");\r\n return ;//respond.end();//ending here\r\n }\r\n else{\r\n // respond.write(\"<p>Data added \"+JSON.stringify(results[0].m_producer)+\"</p>\");\r\n //console.log(results.length);\r\n var result = results;\r\n if(results.length ==0){return respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Could'nt find movie with any details of whats searched for</p>\");}//if record match not found\r\n var extra_results = 1;//skip result duplicate\r\n var count = 0;\r\n for(var i =0; i<=result.length; i++){\r\n db_data_shower();//break if setup is not like this\r\n extra_results =i;//capture duplicate\r\n count = i;\r\n \r\n }\r\n \r\n\r\n \r\n //respond.end();//ending here\r\n }\r\n function db_data_shower(){\r\n if(extra_results==0){return} \r\n respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Movie Title : \"+result[count].m_title+\" | Movie Director : \"+result[count].m_director+\" | Movie Producer : \"+result[count].m_producer+\" | Movie Producing Company : \"+result[count].m_production_company+\" | Movie filmed Country : \"+result[count].m_country+\" | Movie Starring : \"+result[count].m_actor+\" | Movie Genre : \"+result[count].m_genre+\" | Movie Synopsis : \"+result[count].m_description+\" | Movie Disclaimer : \"+result[count].m_disclaimer+\" | Movie Poster : \"+result[count].m_image+\"</p><hr>\");\r\n }\r\n }\r\n \r\n ); \r\n \r\n });\r\n \r\n}", "function movieSearch(movie){\n if(!movie){\n var movieName = \"Mr. Nobody\";\n } else{\n movieName = movie;\n }\n let queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function(err, response, body){\n\n if(!err && response.statusCode === 200){\n\n //need to look at responses from IMDB, responses seem to change based on the movie\n //also if possible add some input validation\n console.log(\"Movie title: \" + JSON.parse(body).Title);\n console.log(\"Release date: \" + JSON.parse(body).Year);\n console.log(\"Rating: \" + JSON.parse(body).imdbRating);\n //rotten tomatoes rating\n if(JSON.parse(body).Ratings[1]){\n console.log(\"Rotten tomatoes rating: \" + JSON.parse(body).Ratings[1].Value);\n }\n console.log(\"Produced in \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n \n } else{\n\n console.log(err);\n }\n\n\n });\n \n\n\n}", "function searchMovie(req, res, next) {\n fetch(`${API_URL}t=${req.query.movie}&y=&plot=short&r=json`)\n\n//parses the json string on the server\n .then(results => results.json())\n .then((results) => {\n res.movie = results;\n next();\n })\n .catch((err) => {\n res.err = err;\n next();\n });\n}", "function searchMovie(searchWord, page) {\n fetch(\n `http://www.omdbapi.com/?s=${searchWord}&apikey=dd68f9f&page=${page}&plot=short`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n let searchResults = data.Search;\n results.innerHTML = \"\";\n return searchResults.map(function(movie) {\n let movieDiv = createNode(\"div\");\n let movieTitle = createNode(\"h1\");\n let moviePoster = createNode(\"img\");\n let more = createNode(\"div\");\n let movieDetails = createNode(\"p\");\n let movieID = movie.imdbID;\n let movieActors = createNode(\"p\");\n let movieDirector = createNode(\"p\");\n let movieRating = createNode(\"p\");\n\n movieDiv.className = \"movie-div\";\n\n movieTitle.textContent = `${movie.Title} (${movie.Year})`;\n movieTitle.className = \"movie-title\";\n\n moviePoster.src = movie.Poster;\n moviePoster.className = \"movie-images\";\n\n more.textContent = \"More...\";\n more.className = \"more\";\n\n movieDetails.className = \"movie-details--off\";\n\n append(results, movieDiv);\n append(movieDiv, movieTitle);\n append(movieDiv, moviePoster);\n append(movieDiv, more);\n append(more, movieActors);\n append(more, movieDirector);\n append(more, movieRating);\n append(more, movieDetails);\n\n more.addEventListener(\"click\", function(event) {\n event.preventDefault();\n if (movieDetails.className == \"movie-details--off\") {\n fetch(\n `http://www.omdbapi.com/?i=${movieID}&apikey=dd68f9f&plot=full`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n console.log(data);\n movieActors.textContent = `Cast: ${data.Actors}`;\n if (movie.Director !== \"N/A\") {\n movieDirector.textContent = `Directed by: ${data.Director}`;\n }\n movieRating.textContent = `${data.Ratings[0].Source}: ${\n data.Ratings[0].Value\n }\n ${data.Ratings[1].Source}: ${data.Ratings[1].Value}\n ${data.Ratings[2].Source}: ${data.Ratings[2].Value}`;\n\n movieDetails.className = \"movie-plot\";\n movieDetails.textContent = `Plot: ${data.Plot}`;\n });\n\n movieDetails.classList.toggle(\"movie-details--on\");\n } else if (movieDetails.className == \"movie-details--on\") {\n movieDetails.classList.toggle(\"movie-details--off\");\n }\n });\n });\n });\n}", "function searchSimilarMovies(movieID) {\n let queryURL =\n \"https://api.themoviedb.org/3/movie/\" +\n movieID +\n \"/similar?api_key=\" +\n API_KEY +\n \"&language=en-US\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n console.log(response);\n let similarMovies = [];\n for (let i = 0; i < response.results.length; i++) {\n similarMovies.push(response.results[i].title);\n }\n console.log(similarMovies);\n return similarMovies;\n });\n}", "function getMovies(searchText) {\n\n input = searchText\n\n\n $.ajax({\n url: 'https://api.themoviedb.org/3/search/movie?',\n dataType: 'json',\n type: 'GET',\n data: {\n api_key: api_key,\n lang: lang,\n query: input,\n },\n\n // FUNCTION success: USED TO PRINT IN A HTML PAGE ALL THE DATA FROM API;\n success: function data(data) {\n displayMovie(data);\n },\n\n error: function(data) {\n let movies = data.results;\n\n }\n });\n}", "function getMovieInfo() {\n if (searchTerm === \"\") {\n searchTerm = \"Star Wars\";\n }\n axios\n .get(\"http://omdbapi.com/?apikey=trilogy&s=\" + searchTerm)\n .then(function(response) {\n logString +=\n \"\\n\\n\\nYou Searched For: \" +\n searchTerm +\n \"\\nThis Search Resulted in \" +\n response.data.Search.length +\n \" results\" +\n \"\\n******** Results *********\\n\\n\";\n response.data.Search.forEach(movie => {\n logString +=\n \"Movie Title - \" +\n movie.Title +\n `\\nMovie Year - ${movie.Year}` +\n `\\nMovie IMDB ID - ${movie.imdbID}` +\n \"\\nMedia Type - \" +\n movie.Type +\n \"\\nPoster URL - \" +\n movie.Poster +\n \"\\n\\n\";\n });\n logString += \"\\n******** End *********\\n\";\n console.log(logString);\n logResults();\n });\n}", "function getSimilarMovies(searchInput, maxResults) {\n\n const parameters = {\n api_key: tmdbKey,\n language: \"en-US\",\n query: searchInput,\n page: 1,\n }\n const queryString = formatTmdbQueryParams(parameters);\n const tmdbSearchURL = \"https://api.themoviedb.org/3/search/movie/?\"\n const similarURL = tmdbSearchURL + queryString;\n\n fetch(similarURL).then(response => {\n if(response.ok) {\n return response.json();\n } throw new Error(\"Oh the HORROR! Something went wrong :(\")\n }).then(responseJson => { \nconsole.log(`responseJson is:`, responseJson);\n if(responseJson.hasOwnProperty(\"0\")) {\n throw new Error(responseJson.Error);\n }\n let results = responseJson.results;\n let titles = results.map(item => item[\"title\"]);\n //for each result, display the title per the displaySimilarMovies function them in a list item\n displaySimilarMovies(titles, maxResults) \n }).catch(err => {\nconsole.log(`err is ${err}`)\n handleUndefined()\n });\n }", "function searchMovie(imdbID){\n\t\tif(imdbID=\"undefined\")\n\t\t{\n\t\talert(\"Please Enter imdbID , from search page\");\n\t\tvar url=\"http://www.omdbapi.com/?i=tt1935859&apikey=6c3a2d45\";\n\t\t\t$http.get(url).then(function success(response){\n\t\tvalue.movies=response;\n\t\tconsole.log(response);\n\n}, function error(err) {\n\n})\n\t\t}\n\t\telse\n\t\t\n\t\tvar url=\"http://www.omdbapi.com/?i=\" + imdbID + \"&apikey=6c3a2d45\"\n\t\t$http.get(url).then(function success(response){\n\t\tvalue.movies=response;\n\t\tconsole.log(response);\n\n}, function error(err) {\n\n})\n\t\t\n\t\n\t\t\n\t\t\n\t\t\n}", "function searchItunesDatabase(name) {\n const artist = name;\n const searchTerm = artist.split(' ').join('+');\n return fetch(`http://itunes.apple.com/search?term=${searchTerm}&entity=album`, {\n method: 'GET', // *GET, POST, PUT, DELETE, etc.\n })\n .then(function(res) {\n if (!res.ok) {\n return Promise.reject(res.statusText);\n }\n return res.json()\n })\n .then(function(data) {\n data.results.map(music => music)\n return data.results\n })\n}", "function handleSearch(res, uri) {\r\n /* var contentType = 'text/html'\r\n res.writeHead(200, {'Content-type': contentType}) */\r\n searchName = qs.parse(uri.query).search;\r\n if(searchName!=undefined){\r\n\t result = movies.filter(similarName);\r\n\t res.end(result.toString());\r\n }else {\r\n res.end('no query provided');\r\n }\r\n\r\n}", "function searchOMDBbyMovie(searchObject, searchKey) {\n\n\tvar omdbApiKey = 'd20f646e';\n\n\t// query URL for OMDB API\n\tvar queryURL = 'https://www.omdbapi.com/?apikey=' + omdbApiKey \n\t\t\t\t+ '&t=' + searchObject.query;\n\n\t// AJAX request\n\t$.ajax({\n\t\tmethod: \"GET\",\n\t\turl: queryURL\n\t}).done(function(r){\n\t\tconsole.log(r);\n\t\tif (r.Response !== \"False\") {\n\t\t\t// saves results in searchObject.results\n\t\t\tsearchObject.results = r;\n\t\t\t// checks search history again using retrieved results to avoid rewriting the\n\t\t\t// same data to firebase, sending retrieved title as argument instead of query term\n\t\t\tif (!wasSearchedBefore(searchObject.results.Title, 'movie')) {\n\t\t\t\t// writes search results to firebase\n\t\t\t\twriteSearchData(searchObject, searchKey);\n\n\t\t\t\t// calls function which listens for firebase uploading to finish \n\t\t\t\t// before redirecting to 'search.html'\n\t\t\t\tafterLoadRedirectTo(searchObject, 'search.html');\n\t\t\t} //recycles old search data\n\t\t\telse {reuseSearchData(searchObject.results.Title, 'movie');}\n\t\t\t\t\n\t\t} \n\t\telse{\n\t\t\t// Materialize.toast(message, displayLength, className, completeCallback);\n \t\t\tMaterialize.toast('Sorry, your search didnt yield any results.', 4000);\n\t\t}\n\t});\n}", "function MovieSearch(movie) {\n request(omdb.url + movie, function (error, response, body) {\n if (error) {\n console.log('error:', error);\n console.log('statusCode:', response && response.statusCode);\n }\n //Convert string to JSON object\n var data = JSON.parse(body)\n //Desired properties to log\n var properties = [data.Title, data.Year, data.Rated, data.Ratings[1].Value,\n data.Country, data.Language, data.Plot, data.Actors\n ];\n //Property text (aesthetics)\n var text = ['Title: ', 'Year: ', 'Rated: ', 'Rotten Tomatoes: ',\n 'Country: ', 'Language: ', 'Plot: ', 'Actors: '\n ];\n //Log results\n for (var i = 0; i < properties.length; i++) {\n console.log(text[i], properties[i]);\n }\n });\n}", "function fetchMovie(e){\n e.preventDefault();\n \n const searchText = document.querySelector('#search-text').value;\n searchText.replace(' ','+');\n const fetchUrl =`http://www.omdbapi.com/?i=tt3896198&apikey=3f6a0e17&s=${searchText}&type=movie&page=1`;\n\n axios.get(fetchUrl)\n .then(response => {\n var ms = response.data;\n if(ms.Response){\n showMovie(ms.Search);\n }else{\n alert(\"error\")\n }\n })\n .catch(error => {\n console.log(error);\n });\n}", "function getSearch() {\n\tlet searchedVal = document.getElementById(\"search-box\").value;\n\tif (searchedVal.length > 0) {\n\t\tfetchURL = \"https://api.themoviedb.org/3/search/movie?api_key=50abfd6ea4dfae3d8f95be50a06763e0&language=en-US&query=\" + searchedVal;\n\t}\n\telse {\n\t\tfetchURL = \"https://api.themoviedb.org/3/movie/top_rated?api_key=50abfd6ea4dfae3d8f95be50a06763e0&language=en-US\";\n\t}\n\n}", "searchMovie() {\n axios\n .get('https://api.themoviedb.org/3/search/multi', {\n params: {\n \"api_key\": '6c5e72b5c6b0f7602a85d01cf04bc5cd',\n \"query\": this.movieName\n }\n }) \n .then((response) => {\n const result = response.data.results;\n this.movies = result;\n this.filteredMovies = [];\n this.movies.forEach((element) => {\n if(element.media_type == 'movie' || element.media_type == 'tv') {\n this.filteredMovies.push(element);\n }\n })\n this.movieName = '';\n\n // Faccio un loop per convertire in numeri da 1 a 5 il voto\n this.movies.forEach(element => {\n element.vote_average = element.vote_average / 2;\n element.vote_average = Math.round(element.vote_average);\n \n \n });\n this.selectGenre = '';\n this.homePage = false;\n });\n }", "searchByName(string){\n \n let res = {artists:[], albums:[] , tracks:[] , playlists:[]} \n \n res.artists = this.artists.filter((a)=>a.getName().includes(string));\n res.albums = this.collectAlbums().filter((a)=>a.getName().includes(string)); \n res.tracks = this.collecTracks(this.collectAlbums()).filter((t)=>t.getName().includes(string));\n res.playlists = this.playlists.filter((p)=>p.getName().includes(string));\n return res;\n}", "getRelatedMovie(movies) {\n // It Display Related Movie When User Search For Movie\n this.displayRelatedMovie(movies)\n }", "function searchOMDB (input) {\n // If nothing is searched, Mr. Nobody will be used.\n if (input == \"\") {\n input = \"Fantastic Mr. Fox\"\n };\n // OMDB request\n request(\"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=shortnode&apikey=trilogy\", function (error, response, body) {\n if (error) {\n console.log(\"An error occured: \" + error)\n } else {\n console.log(\n \"Movie title: \" + JSON.parse(body).Title +\n \"\\nReleased: \" + JSON.parse(body).Year +\n \"\\nIMDB Rating: \" + JSON.parse(body).imdbRating +\n \"\\nRotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value +\n \"\\nThe movie was produced in: \" + JSON.parse(body).Country +\n \"\\nLanguage: \" + JSON.parse(body).Language +\n \"\\nThe Plot: \" + JSON.parse(body).Plot +\n \"\\nThe Actors: \" + JSON.parse(body).Actors\n );\n }\n })\n}", "function search_movies() {\n\tlet input = document.getElementById('searchbar').value\n\tinput=input.toLowerCase();\n\tlet x = document.getElementsByClassName('movies');\n\t\n\tfor (i = 0; i < x.length; i++) {\n\t\tif (!x[i].innerHTML.toLowerCase().includes(input)) {\n\t\t\tx[i].style.display=\"none\";\n\t\t}\n\t\telse {\n\t\t\tx[i].style.display=\"list-item\";\t\t\t\t\n\t\t}\n\t}\n}", "movieThis() {\n const omdb = new OMDbAPI(KEYS.omdb);\n let movieName = \"Mr. Nobody\";\n\n if (this.cmdArgs.length > 0) {\n movieName = this.cmdArgs.join(\" \");\n }\n omdb.findMovie(movieName);\n }", "function searchForMovie() {\n let userMovie = \"Django Unchained\";\n let queryURL =\n \"https://api.themoviedb.org/3/search/movie?api_key=\" +\n API_KEY +\n \"&language=en-US&query=\" +\n userMovie;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n // console.log(response);\n // let title = response.results[0].title;\n // let posterURL = response.results[0].poster_path;\n // let rating = response.results[0].vote_average;\n // let releaseDate = response.results[0].release_date;\n // let summary = response.results[0].overview;\n // let genreID = response.results[0].genre_ids[0];\n let movieID = response.results[0].id;\n let streaming = whereToWatch(movieID);\n // object.entries\n let movie = {\n title: response.results[0].title,\n year: response.results[0].release_date,\n // rated: ????,\n genre: response.results[0].genre_ids[0],\n plot: response.results[0].overview,\n poster:\n \"https://image.tmdb.org/t/p/w500\" + response.results[0].poster_path,\n rating: response.results[0].vote_average,\n streaming: streaming,\n // user: ????,\n // watched: ????\n };\n\n // Poster Path: \"https://image.tmdb.org/t/p/w500\" + POSTER_URL;\n });\n}", "searchMovie() {\n //If applications just created set the boolean representation to false\n if (this.created) {\n this.created = false;\n this.searchBoxLayout = \"space-between center\";\n }\n this.url = \"https://www.omdbapi.com/?\";\n //Combine various parameters to form url\n this.url = this.url.concat(`s=${this.title}`, `&type=${this.selectedType}`, `&page=${this.page}`, `&y=${this.year}`, \"&apikey=f2de4f33\");\n fetch(this.url)\n .then(response => response.json())\n .then((data) => {\n if (data.Response == \"True\") {\n this.movies = data.Search;\n this.totalResults = data.totalResults;\n this.totalPages = Math.ceil(this.totalResults / 10);\n this.movieNotFound = false;\n }\n else if (data.Response == \"False\") {\n this.movieNotFound = true;\n this.totalResults = 0;\n this.movies = [];\n }\n });\n }", "function searchMovie(movie) {\n var queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&apikey=trilogy\";\n //console.log(queryURL);\n\n //searching for movie with omdb api\n request(queryURL, function (error, response, body) {\n //if error occurs\n if (error) {\n console.log(error);\n }\n\n //request processed successfully\n if (!error && response.statusCode === 200) {\n //console.log(JSON.parse(body));\n var result = JSON.parse(body);\n\n var title = result.Title;\n var year = result.Year;\n var rating1 = result.imdbRating;\n var rating2 = result.Ratings[1].Value;\n var country = result.Country;\n var language = result.Language;\n var plot = result.Plot;\n var actors = result.Actors;\n\n console.log(\"\\n\");\n console.log(\"Movie: \" + title);\n console.log(\"Year: \" + year);\n console.log(\"IMDB Rating: \" + rating1);\n console.log(\"Rotten Tomatos Rating: \" + rating2);\n console.log(\"Countries of production: \" + country);\n console.log(\"Language(s): \" + language);\n console.log(\"Plot: \" + plot);\n console.log(\"Actors: \" + actors);\n }\n });\n}", "function searchByProduceName(searchTerm) {\n knexInstance\n .select('product_id', 'name', 'price', 'category')\n .from('amazong_products')\n .where('name', 'ILIKE', `%${searchTerm}%`)\n .then(result => {\n console.log(result)\n });\n}", "function searchTvShows(query, language, genre) {\n\t// ajax calling themoviedb.org api for searching tv shows (max 20 displayed)\n\t$.ajax({\n\t\turl: \"https://api.themoviedb.org/3/search/tv\",\n\t\tmethod: \"GET\",\n\t\tdata: {\n\t\t\tapi_key: '6258744f8a6314eddb8961371f91076e',\n\t\t\tlanguage: language,\n\t\t\tquery: query\n\t\t},\n\t\tsuccess: function (data, state) {\n\t\t\tvar tvShows = data.results;\n\t\t\tconsole.log(tvShows);\n\t\t\tprintTvShows(tvShows, genre);\n\t\t},\n\t\terror: function (request, state, error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t});\n}", "function getMovies() {\n var movieSearch = process.argv.slice(3).join(\" \");\n var queryURL = \"http://www.omdbapi.com/?apikey=trilogy&t=\" + movieSearch;\n axios\n .get(queryURL)\n .then(function(response) {\n //Function for Response of movies.\n //console.log(response);\n var searchRes = response.data;\n console.log(\"Movie Title: \" + searchRes.Title + \n \"\\nReleased In: \" + searchRes.Year + \n \"\\nIMDB Rating: \" + searchRes.imdbRating + \n \"\\nRotten Tomatoes Rating: \" + searchRes.Ratings[1].Value + \n \"\\nCountry where movie was produced: \" + searchRes.Country + \n \"\\nLanguage: \" + searchRes.Language + \n \"\\nPlot: \" + searchRes.Plot + \n \"\\nActors: \" + searchRes.Actors);\n console.log(\"------------------------------------------\");\n })\n //Function for ERRORS\n .catch(function(error) {\n if (error.response) {\n console.log(error.response.data);\n console.log(\"------------------------------------------\");\n }\n })\n}", "function searchClick() {\n console.log(\"sono qui\");\n var query = $('#titolo_digit').val();\n console.log(query);\n movieResult(query);\n tvResult(query);\n\n}", "async function getMovies(e){\n e.preventDefault()\n page = 1\n if (!search.value.trim()){\n results.innerHTML = `Please Enter a movie keyword in the search box `\n return\n }\n const res = await fetch(`https://www.omdbapi.com/?apikey=1a241340&s=${search.value}&type=movie&page=${page}`)\n const data = await res.json()\n if (data.Response === 'False'){\n results.innerHTML = `There are no results for search ${search.value}`\n }\n else { displayMovies(data.Search, Number(data.totalResults))}\n \n}", "function querySearch(text){\n\n if (text==\"\" || text == null) {\n console.log(\"Nema: \" + text);\n return $http.get(\"/players\")\n .then(function (result) {\n return result.data;\n })\n }else{\n console.log(\"Ima: \" + text);\n return $http.get(\"/players?player_name=\"+text)\n .then(function (result) {\n return result.data;\n })\n }\n }", "async findAllFilms(){\n return Movie.find();\n }", "function movieThis() {\n var movie = \"Mr. Nobody\";\n if (searchTerm) {\n var movie = searchTerm;\n };\n let movieUrl = \"http://www.omdbapi.com/?apikey=715b0924&t=\" + movie\n axios.get(movieUrl).then(response => {\n let data = response.data;\n console.log(\"Title: \" + data[\"Title\"] + \"\\nYear: \" + data[\"Year\"] + \"\\nIMDB Rating: \" + data[\"imdbRating\"] + \"\\nRotten Tomatoes Rating: \" + data[\"Ratings\"][1][\"Value\"] + \"\\nCountry of Production: \" + data[\"Country\"] + \"\\nLanguage: \" + data[\"Language\"] + \"\\nPlot: \" + data[\"Plot\"]\n + \"\\nActors: \" + data[\"Actors\"]);\n }).catch(error => {\n console.log(error);\n });\n}", "function fetchVideos(searchTerm){\n const videos = axios.get(`https://www.googleapis.com/youtube/v3/search?q=${searchTerm}&part=snippet&key=${API_KEY}`)\n return {\n type: \"FETCH_VIDEOS\",\n payload: videos\n }\n}", "function lookupMovies(type, search, sort, filter, instantaneaousRepositionning) {\n var user = Meteor.user();\n \n // If not logged in, load public movies, cache them and repeat\n if (!user && !publicMovies.length) {\n Meteor.call('public', {}, function(error, movies) {\n publicMovies = movies;\n lookupMovies(type, search, sort, filter);\n });\n return;\n }\n\n var movies = user ? user.profile.movies : publicMovies;\n console.log('Load Movies');\n\n // Select movies on current page\n var types = type.split('|');\n movies = _.filter(movies, function(m) { return _.contains(types, m.statusType); });\n\n // Filter movies\n _.each(filter, function(value, type) {\n if (value) movies = _.filter(movies, function(m) { return filters[type](m, value); });\n });\n\n // Search movies\n if (search.length > 1) {\n movies = _.filter(movies, function(m) { return filters.title(m, search); });\n }\n\n // Sort movies\n if (sort) movies = _.sortBy(movies, sorts[sort]);\n\n selectedMovies = movies;\n initialiseMovies(instantaneaousRepositionning);\n}", "function searchMovies(event){\n event.preventDefault();\n API.search(searchState.searchTerm)\n .then(function (res){\n if(res.data.Response === \"True\"){\n console.log(res.data);\n let movieList = [];\n for(let i = 0; i < res.data.Search.length; i++){\n if(res.data.Search[i].Type === \"movie\"){\n let isNominated = false;\n for(let j = 0; j < nominationState.nominations.length; j++){\n if(nominationState.nominations[j].id === res.data.Search[i].imdbID){\n isNominated = true;\n }\n }\n let imgLink = res.data.Search[i].Poster;\n if(imgLink === \"N/A\"){\n imgLink = \"https://123moviesfree.zone/no-poster.png\"\n }\n movieList.push({id: res.data.Search[i].imdbID, title: res.data.Search[i].Title, year: res.data.Search[i].Year, poster: imgLink, nominated: isNominated});\n }\n }\n setSearchState({...searchState, searchResults: movieList});\n }\n })\n .catch(err => console.log(\"error :\", err));\n }", "function movieSearch(movieInput) { \n \n if (movieInput === \"\") {\n movieInput = \"Mr. Nobody\";\n }\n console.log(\"movie input: \" + movieInput);\n\n axios.get(\"http://www.omdbapi.com/?t=\" + movieInput + \"&y=&plot=short&apikey=trilogy\").then(\n function (response) {\n // console.log(response.data);\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Release Year: \" + response.data.Year);\n console.log(\"IMdB Rating: \" + response.data.imdbRating);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Rotten Tomatoes: \" + response.data.Ratings[0].Value);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n }\n );\n}", "function searchmovie(){\n let searchText = $('#searchText').val();\n if(searchText != \"\"){\n axios.get('https://api.themoviedb.org/3/search/movie?api_key=f13549c92bee7e0f31569758e7396edb&query='+searchText)\n .then(response=>{\n $('#movies').html(\"\"); \n let films = response.data.results;\n let output = \"\";\n $.each(films, (index,film)=>{\n output += `\n <div class=\"col-md-3 movie\">\n <div class=\"text-center\">\n <img src=\"https://image.tmdb.org/t/p/w300/${film.poster_path}\" alt=\"${film.original_title}\"/>\n <h5 id=\"movieTitle\">${film.original_title}</h5>\n <button class=\"btn btn-primary\" onclick= \"alert('Please Sign In to Book Movie!')\" id=\"bookMovie\">Book</button>\n <button onclick=\"movieSelected('${film.id}')\" data-backdrop=\"static\" data-keyboard=\"false\" data-toggle=\"modal\" data-target=\"#myModal\" class=\"btn btn-primary\" id=\"movieDetails\" href=\"#\">Movie Details</button>\n </div>\n </div>\n `;\n });\n $(\".popMovies\").text(\"Movie Search Results\");\n $(\"#movies\").html(output);\n })\n .catch(error=>{\n console.log(error);\n });\n }\n \n}", "function searchAndDivide(str){\r\n result = {\r\n match: [],\r\n unmatch: []\r\n }\r\n for(let i = 0; i < movies.length; i++){\r\n if (movies[i].Title.includes(str))\r\n result.match.push(movies[i])\r\n else\r\n result.unmatch.push(movies[i])\r\n }\r\n return result\r\n}", "axiosSearch(type) {\n const axiosOption = {\n params: {\n api_key: this.tmdbApiKey,\n query: this.textToSearch,\n language: \"it-IT\"\n }\n };\n\n axios.get(\"https://api.themoviedb.org/3/search/\" + type, axiosOption)\n .then((resp) => {\n if (type === \"movie\") {\n this.movieList = resp.data.results\n this.filteredDataMovie = resp.data.results\n }\n else if (type === \"tv\") {\n this.tvSeriesList = resp.data.results.map((tvShow) => {\n tvShow.original_title = tvShow.original_name\n tvShow.title = tvShow.name\n\n\n\n return tvShow\n })\n this.filteredDataSeries = resp.data.results.map((tvShow) => {\n tvShow.original_title = tvShow.original_name\n tvShow.title = tvShow.name\n\n\n\n return tvShow\n })\n }\n })\n\n\n\n }", "function searchShow(query) {\n var url = `https://api.tvmaze.com/search/shows?q=${query}`;\n fetch(url)\n // .then(response => response.json())\n .then(function(response){\n if(response.ok){\n return response.json();\n }\n else{\n console.log('Unable to connect to tvmaze');\n }\n })\n .then((jsonData) => {\n // gets specific string from array\n if(jsonData != null){\n var movieInfoList = jsonData.map((element) => ({\n movieId: element.show.id ? element.show.id : 0, \n movieName: element.show.name ? element.show.name : \"\", \n imgLink: element.show.image ? element.show.image.medium : \"\"\n }));\n }\n renderResults(movieInfoList);\n \n })\n .catch((error) => {\n //console.log('error', error);\n });\n}", "function movieThis(input) {\n if(input.length < 1) {\n console.log(\"Nothing was searched...\");\n console.log(\"Here! Let me try searching something!\");\n movieThis(\"Mulan\");\n }\n else{\n console.log(\"Searching \" + input + \" on IMDB...\");\n axios.get(\"https://www.omdbapi.com/?t=\" + input + \"&apikey=trilogy\")\n .then(function(response) {\n data = response.data\n var result = {\n Title : data.Title,\n Year : data.Year,\n \"IMDB Rating\" : data.imdbRating,\n Country : data.Country,\n Language : data.Language,\n Plot : data.Plot,\n Actors : data.Actors\n };\n console.log(JSON.stringify(result, null, 2));\n // Asks the user if they want to continue searching\n searchAgain();\n })\n }\n}", "function searchPlayer(term) {\n return search(term, 'soccer player', true);\n}", "search() {\n return db.many(`\n SELECT *\n FROM parks p\n WHERE p.borough LIKE '%ook%'\n `);\n }", "function list(name, year, genres, page) {\n return $.getJSON(\"/api/movies/?q=\" + encodeURIParam(name) + \"&year=\" + encodeURIParam(year) + \"&genres=\" + encodeURIParam(genres) + \"&page=\" + encodeURIComponent(page != null ? page.toString() : \"\"));\n }", "searchByTitle(title, page) {\n return new Promise((fulfill, reject) => {\n https.get(restHost + \"/search/movie\" + pathTail + \"&query=\" + title + \"&include_adult=false&page=\" + page, function (response) {\n response.setEncoding('utf8');\n var body = '';\n response.on('data', function (d) {\n body += d;\n });\n response.on('error', (e) => {\n reject(e);\n });\n response.on('end', function () {\n var parsed = JSON.parse(body);\n fulfill(parsed);\n });\n });\n });\n }", "function getSearchedMovie(movie) {\n spinner.style.display = \"block\";\n fetch('https://www.omdbapi.com/?apikey=da783fad&s=' + movie + '')\n .then((response) => response.json())\n .then(function (movies) {\n //Make sure the array is empty when doing a new search\n globalMovieArray.length = 0;\n globalMovieArray.push(movies);\n movieInformation.classList.remove('hidden')\n displayMovies(movies)\n })\n .catch(function (error) {\n let errorMessage = `<div class=\"messageNoMoviesFound\"><p>Movie not found! Please try again</p></div>`\n movieInformation.innerHTML = errorMessage\n })\n spinner.style.display = \"block\";\n searchMovie.value = \"\";\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 postSearchFromInput(search) { // post request, search multiple movies titles.\n\n\t$('.spinner').show();\n\t\n\t$.post('search', {search: search}, function(data) {\n\t\t$('.spinner').hide();\n\t\t$('.search-li').remove();\n\n var movies = data;\n\n var counter = 0;\n movies.forEach(function() {\n handleMovie(movies, counter);\n counter += 1;\n }); // amount of search results\n\n\t});\n}", "function getMovieList(callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t\tsort_by: \"release_date.desc\",\n\t\tpage: pageCounter\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_LIST, query, callback);\n}", "function searchCallback(data) {\n\n $(document.body).append('Found ' + data.total + ' results for ' + query);\n var movies = data.movies;\n\n $.each(movies, function(index, movie) {\n $(document.body).append('<h1>' + movie.title + '</h1>');\n $(document.body).append('<img src=\"' + movie.posters.thumbnail + '\" />');\n $(document.body).append('<p>' + movie.synopsis+'</p>');\n });\n}", "function searchMovie(search){\n\tvar request = require('request');\n\trequest('http://www.omdbapi.com/?apikey=40e9cece&t='+search, function (error, response, body) {\n\t\tvar movie = JSON.parse(body); \n\t \t\n\t\tif(error){\n\t \t\tconsole.log('error:', error); \n\t \t\tlog('error:', error);\n\t \t}\n\t \tif(movie.Title == null){\n\t \t\tconsole.log(\"If you haven't watched 'Mr. Nobody', then you should: http://www.imdb.com/title/tt0485947/\" );\n\t \t\tconsole.log(\"It's on Netflix!\")\n\t \t\tlog(\"If you haven't watched 'Mr. Nobody', then you should: http://www.imdb.com/title/tt0485947/\" );\n\t \t\tlog(\"It's on Netflix!\");\n\t \t}else{\n\t\t\tconsole.log(\"Title of the Movie: \" + movie.Title )\n\t\t\tconsole.log(\"Year the movie came out: \" + movie.Year)\n\t\t\tconsole.log(\"IMDB Rating of the movie: \" + movie.imdbRating)\n\t\t\tconsole.log(\"Country where the movie was produced: \" + movie.Country)\n\t\t\tconsole.log(\"Language of the Movie: \" + movie.Language)\n\t\t\tconsole.log(\"Plot of the movie: \" + movie.Plot)\n\t\t\tconsole.log(\"Actors in the movie: \" + movie.Actors)\n\t\t\tconsole.log(\"Rotten Tomatoes URL\" + movie.Website)\n\n\t\t\tlog(\"Title of the Movie: \" + movie.Title )\n\t\t\tlog(\"Year the movie came out: \" + movie.Year)\n\t\t\tlog(\"IMDB Rating of the movie: \" + movie.imdbRating)\n\t\t\tlog(\"Country where the movie was produced: \" + movie.Country)\n\t\t\tlog(\"Language of the Movie: \" + movie.Language)\n\t\t\tlog(\"Plot of the movie: \" + movie.Plot)\n\t\t\tlog(\"Actors in the movie: \" + movie.Actors)\n\t\t\tlog(\"Rotten Tomatoes URL\" + movie.Website)\n\t\t}\n\t});\n}" ]
[ "0.76910764", "0.7593642", "0.73987556", "0.7372445", "0.72973067", "0.7281578", "0.7260962", "0.7255223", "0.7186294", "0.7126738", "0.71258336", "0.712157", "0.6943218", "0.6934262", "0.6927708", "0.6858158", "0.6839239", "0.68186855", "0.6815793", "0.67871207", "0.6786041", "0.6777498", "0.6752434", "0.6750722", "0.67483896", "0.67283", "0.6707755", "0.6686839", "0.66193783", "0.6616532", "0.6598688", "0.6597149", "0.6580183", "0.65720075", "0.6571513", "0.6562808", "0.6559166", "0.6521107", "0.6514621", "0.65087014", "0.65065867", "0.64983225", "0.6496524", "0.64794385", "0.6472897", "0.6451053", "0.642637", "0.6424352", "0.6404966", "0.63922375", "0.63874125", "0.6377134", "0.6377002", "0.637622", "0.63623345", "0.6359442", "0.6343093", "0.6339504", "0.63257957", "0.6317453", "0.631625", "0.6315167", "0.63080114", "0.62991023", "0.62990135", "0.6286431", "0.6269673", "0.62664765", "0.62599576", "0.625734", "0.62469333", "0.6245813", "0.6240455", "0.62394834", "0.6236059", "0.6220496", "0.6212764", "0.62036246", "0.6200983", "0.6182814", "0.61824906", "0.61785024", "0.6177432", "0.6171223", "0.61695033", "0.6151099", "0.6147792", "0.61455595", "0.6144451", "0.61395156", "0.61282474", "0.61259", "0.61187917", "0.61094123", "0.61038035", "0.61018336", "0.6097243", "0.6096383", "0.609432", "0.609215", "0.6088332" ]
0.0
-1
============fetch film by ID============
async fetchFilmById() { try { const response = await axios.get( `${BASE_URL}movie/${this.movieId}?${API_KEY}&language=en-US`, ); return response.data; } catch (error) { return error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async findById(id) {\n return Film.findById(id);\n }", "async function getMovieInfo(id) {\n let response = await fetch('https://swapi.dev/api/films/');\n let json = await response.json();\n let selectedFilm;\n json.results.forEach((film) => {\n if (film.episode_id == id) {\n selectedFilm = {\n name: film.title,\n episodeID: film.episode_id,\n characters: film.characters,\n };\n }\n });\n return selectedFilm;\n}", "function getOneMovie(id) {\n AJAXRequest(`${serverURL}/${id}`).then(responseData => console.log(responseData))\n }", "function getFilm(search) {\n\n\tomdb.getMovie(search)\n\n}", "async findById({id: id}) {\n return movie.findOne({id: id});\n }", "function getMovieById(id) {\r\n for(let i = 0; i < movies.length; i++){\r\n if (movies[i].imdbID === id)\r\n return movies[i]\r\n }\r\n return null\r\n}", "function getMovie(id) {\n //Making changes is easy in the cloud and desktop!\n let url = 'https://www.omdbapi.com/?i='+id+'&apikey=CHANGEDONDESKTOPWITHCLOUDSPACESEXTENSION'\n return axios.get(url);\n}", "function fetchMovieInfo(id) {\n const movieUrl = `http://www.omdbapi.com/?i=${id}&apikey=${apiKey}`;\n fetch(movieUrl)\n .then(response => response.json())\n .then(body => movieInfoTempate(body));\n}", "function getMovieDetail(imdbid) {\n return fetch(\"http://www.omdbapi.com/?apikey=cc5844e4&i=\" + imdbid)\n .then((response) => response.json())\n .then((result) => result);\n}", "movieById(cb, id) {\n let movieById = `https://api.themoviedb.org/3/movie/${id}?api_key=${this.API_KEY}&language=en-US`\n fetch(movieById)\n .then(response => {\n return response.json()\n }).then(movie => {\n cb(movie)\n })\n }", "function retrieveID(){\n var retrievedID = $('#updateId').val();\n retrieveMovie(\"https://eloquent-yew-227217.appspot.com/GetFilm?ID=\"+retrievedID+\"&format=json\");\n}", "function getMovie(req,res,next){\n // var mID = req.params.id;\n db.one(`SELECT * FROM movies WHERE movie_id=($1);`, [req.params.id])\n .then((data)=>{\n console.log(data); // should get all info of a movie\n res.rows = data;\n next();\n })\n .catch(()=>{\n console.log('ERROR in GETTING MOVIE PROFILE!');\n })\n}", "function get(id) {\n return $.getJSON(\"/api/movies/\" + id);\n }", "searchResultID(id) {\n const requestUrl = 'http://api.tvmaze.com/shows/' + id;\n\n return fetch(requestUrl)\n .then(response => {\n return response.json();\n })\n }", "async findById(id) {\n return Movie.findById(id);\n }", "static find(id, cb){\n db.get('SELECT * FROM artwork WHERE id=?', id, cb);\n }", "function getPhoto(filmId, filmTitle){\n\tvar image = \"https://nelson.uib.no/o/\";\n\tvar imageURL = \"\";\n\n\t// undersøker verdien av filmens ID for å sørge for at det letes i riktig mappe på serveren\n\tif (filmId < 1000){\n\t\timageURL = image + \"0/\" + filmId + \".jpg\"; \n\t}\n\telse if (filmId > 1000 && filmId < 2000){\n\t\timageURL = image + \"1/\" + filmId + \".jpg\";\n\t}\n\telse if (filmId > 2000 && filmId < 3000) {\n\t\timageURL = image + \"2/\" + filmId + \".jpg\";\n\t}\n\telse {\n\t\timageURL = image + \"3/\" + filmId + \".jpg\";\n\t}\n\n\t// lenke til bilde\n\tvar imageLink = '<img src=\"' + imageURL + '\" alt=\"' + filmTitle + '\" width=\"300\">';\n\n\t// lenke til filmside\n\tvar clickableImage = '<a href=\"v3_showmovie.html?id=' + filmId + '\">' + imageLink;\n\n\t// returnerer et bilde som lenker til filmens informasjonsside ved klikk\n\treturn clickableImage;\n}", "find(id) {\n if(id) {\n return this.movieList.find(element => {\n return element.id === id;\n });\n }else {\n return this.movieList;\n }\n }", "function getMovieDetails(id, callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_DETAILS+id, query, callback);\n}", "function getMovieImdbId(imdbID) {\n fetch('https://www.omdbapi.com/?apikey=da783fad&i=' + imdbID + '')\n .then((response) => response.json())\n .then((theId) => {\n spinner.style.display = \"block\";\n displayMoreInformationAboutMovie(theId)\n goBackToSearchButton()\n\n })\n}", "function modelGetMovie(id) {\n for (x in movieList) {\n if (movieList[x].id === id) {\n //return movieList[x];\n return x;\n }\n }\n return undefined;\n}", "static getVideoForBookmark(id){\n let realmVideos = realm.objects('Video').filtered('_id = $0', id)\n return realmVideos[0] //should never be 0 because should be loaded before bookmarks\n }", "getMovieInfo (id) {\n\t\t\t\treturn $http\n\t\t\t\t\t.get(`${API_URL}i=${id}`)\n\t\t\t\t\t.then(result => result.data)\n\t\t\t\t\t.then(t => chosenMovie = t) // 't' is whatever is returned from the previous .then\n\t\t\t}", "static getMoviesById(id) {\n return axios(withBaseUrl(`movie/${id}`));\n /* chamando essa rota https://developers.themoviedb.org/3/movies/get-movie-details */\n }", "function addFilm(id) {\n let usersRef = db.collection('users');\n let url = \"\".concat(baseURLFilms, 'movie/', id,'?api_key=', APIkey);\n let query = usersRef.where(\"email\", \"==\", firebase.auth().currentUser.email);\n fetch(url)\n .then(result => result.json())\n .then(data => {\n query.get().then(QuerySnapshot => {\n QuerySnapshot.forEach(doc => {\n shows = doc.data().shows;\n shows.forEach(show => {\n if (show.id == data.id) {\n stop = true;\n }\n })\n if (!stop) {\n shows.push({id: data.id, type: 'film'});\n userRef = db.collection(\"users\").doc(doc.id);\n userRef.update({\n shows: shows\n })\n }\n })\n })\n })\n}", "async getDirector({}, id) {\n return await this.$axios\n .$get(\"\", {\n params: {\n apikey: \"a4bf96a7\",\n i: id,\n type: \"movie\"\n }\n })\n .then(response => {\n if (response.Response === \"False\") throw new Error(response.Error);\n\n return response.Director;\n })\n .catch(e => commit(\"setError\", e.message));\n }", "fetchById(id) {\n // There should be only one match. Return first match or null if undefined.\n return this.data.filter(fruit => fruit.id === id)[0] || null;\n }", "function openMovie(id) {\n dispatch({\n type: GET_MOVIE_REQUEST,\n id,\n });\n }", "static async getOneMovie(id) {\n try {\n // Query to check if movie exists in db\n const movie = await knex('movies')\n .select()\n .where('id', id);\n\n // Check result of query\n if (movie.length === 0) {\n return Either.Left(MovieService.ERRORS.INVALID_ID);\n }\n\n return Either.Right(movie);\n } catch (error) {\n return Either.Left();\n }\n }", "function findAllTheatersForMovie(id) \n {\n var deferred = $q.defer();\n // GET the forms from the user that match the id\n $http.get(\"/api/project/theater/\", id)\n .success(function(response) \n {\n deferred.resolve(response);\n });\n\n return deferred.promise;\n }", "function getByImdb(imdb_id) {\n let url = getFindByImdbUrl(imdb_id);\n \n return new Promise(resolve => {\n fetch(url)\n .then(function(response) {\n return resolve(response.json());\n });\n });\n }", "async updateFilm(id, title){\n const idFound = movie.findOne({id: id})\n return idFound.update(title)\n }", "function getId(query, type) {\n fetch(\n `https://watchmode.p.rapidapi.com/search/?search_field=name&search_value=${query}&types=${type}`,\n {\n method: \"GET\",\n headers: {\n \"x-rapidapi-key\":\n \"be9a60e677msh27b9eb97af299e8p1c5a0djsnb9ba03ed5bd6\",\n \"x-rapidapi-host\": \"watchmode.p.rapidapi.com\",\n },\n }\n )\n .then(response => response.json())\n .then((data) => {\n if (data.title_results.length != 0) {\n //console.log(data);\n //console.log(data.title_results);\n let id = data.title_results[0].id;\n console.log(id);\n getStreaminginfo(id)\n /*If Watchmode does not have the movie title (and thus its ID) in its database, that means it does not have any streaming options. This throws an error telling user to pick a different movie*/\n /*You can test this by inputting a movie that does not exist*/\n errormessage.textContent = \"\";\n addtolist.textContent = \"Add to Movies\";\n } else throw Error('No movie found by that name');\n })\n .catch((err) => {\n console.error(err);\n errormessage.textContent = \"No movie found by that name. Please try searching for a different movie. Unfortunately, TV shows are not accepted at this time.\"\n addtolist.textContent = \"\";\n\n });\n}", "function appendInfo (id) {\n return fetch(`${moviesURL}/${id}`, {\"method\": \"GET\", headers: header})\n .then(res => res.json())\n .catch(console.error)\n }", "function getSelectedMovie(id, movieArr){\n\tvar selectedMovie;\n\tfor(var x=0; x<movieArr.length; x++){\n\t\tif(movieArr[x].id == id){\n\t\t\tselectedMovie=movieArr[x];\n\t\t}\n\t}\n\treturn selectedMovie;\n}", "async function getMovieDetails(id) {\n var movObj;\n var apiUrl = \"https://api.themoviedb.org/3/movie/\" + id + \"?api_key=\" + apiKey;\n fetch(apiUrl).then(function (response) {\n if (response.ok) {\n response.json().then(function (data) {\n var movieTitle = data.title;\n var imdbId = data.imdb_id;\n var posterUrl = data.poster_path;\n movObj = {\n id: id,\n title: movieTitle,\n imdb: imdbId,\n poster: posterUrl\n };\n displayMovie(movObj);\n });\n }\n else {\n alert(\"Something went wrong\");\n }\n });\n}", "searchMovieById(id) {\n this.movieById(movie => {\n this.getMovie(movie)\n }, id)\n }", "async fetchMovieById(ctx, payload) {\n let movie = [];\n await axios.get('http://www.omdbapi.com/?i=' + payload.id + '&apikey='+ key.key).then((response) => { movie = response.data });\n movie.shelf = payload.movieArr.shelf;\n movie.soundtrack = payload.movieArr.soundtrack;\n movie.rating = payload.movieArr.rating;\n movie.format = payload.movieArr.format;\n movie.edition = payload.movieArr.edition;\n ctx.commit('setSelectedMovie', movie);\n }", "searchMovie(name) {\n let movieByName = `https://api.themoviedb.org/3/search/movie?api_key=${this.API_KEY}&language=en-US&query=${name}&page=1&include_adult=false`\n\n fetch(movieByName)\n .then(response => {\n return response.json()\n }).then(movie => {\n let fiveMovieName = ''\n\n // Take only five movie within all movie\n if (movie) {\n try {\n fiveMovieName = movie.results.filter((movie, index) => {\n return index < 5\n })\n } catch(err) {\n \n }\n }\n this.getRelatedMovie(fiveMovieName)\n // It pass first movie id to searchMovieById\n this.searchMovieById(movie.results[0].id)\n })\n }", "getById(id) {\n console.log(\"getById(\" + id + \")\");\n let result = this.tvShows.find(show =>\n (show === undefined ? null : show.id) == id);\n if (result) return result;\n else return null;\n }", "getMovie(context, id){\n context.commit('SET_LOADING_STATUS', 'loading');\n axios.get(url_detail + id)\n .then(result => {\n context.commit('SET_LOADING_STATUS', 'notloading');\n context.commit('SET_CURRENT_MOVIE', result.data);\n })\n .catch(err => {\n context.commit('SET_LOADING_STATUS', 'notloading');\n context.commit('SET_CURRENT_MOVIE', {});\n context.commit('ADD_ERROR', err);\n })\n }", "function findById(id) {\n return db('stories')\n .where({ id: Number(id) })\n .first();\n }", "function searchFilmsByTitle(title) {\n let format = title.split(' ').join('+'); // replace spaces with plus\n $.ajax({\n url: `https://www.omdbapi.com/?apikey=ac155d96&s=${format}`,\n dataType: \"json\"\n }).done(function(resp) {\n if (resp.Search != null) {\n let respSize = resp.Search.length;\n for (let i = 0; i < respSize; i++) {\n if(resp.Search[i].Poster != 'N/A' && resp.Search[i].Type == 'movie') {\n let myHTML = \n `<div class=\"col-sm-6\">\n <a class=\"movie-select\" href=\"#\" id=\"${resp.Search[i].imdbID}\">\n <img class=\"movie-image\" src=\"${resp.Search[i].Poster}\">\n </a>\n </div>`;\n $(\"#movies\").append(myHTML);\n }\n }\n } else {\n let myHTML =\n `<div class=\"col-sm-12\">\n <div class=\"alert alert-primary col\" role=\"alert\">\n ${resp.Error}\n </div></div>`;\n $(\"#movies\").append(myHTML);\n }\n });\n }", "function fetchMovie() {\n axi.get(\"/api/v1\").then(r => setMovie(r.data.movie));\n }", "function getMovieDetails(movie_id){\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.themoviedb.org/3/movie/\" + movie_id + \"?language=en-US&api_key=7b9a9e7e542ce68170047140f18db864\",\n \"method\": \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n }\n $.ajax(settings).done(function (response) {\n $('#movieTitle').text(\"Showing results for \" + response.title)\n for(var i = 0; i < response.genres.length; i++){\n getMoviesForGenre(response.genres[i].name, response.genres[i].id, response.vote_average)\n }\n });\n }", "function ecraFilme(id) {\n return getFilme(id)\n .then(function (filme) {\n mostraFilme(filme);\n })\n .catch(function (erro) {\n console.error(erro);\n });\n}", "function getMovie(title) {\n return $.getJSON('https://omdbapi.com?t={title}&apikey=thewdb');\n}", "function fetchMovieList(id, pageStart){\r\n if (!GM_xmlhttpRequest) {\r\n alert('Please upgrade to the latest version of Greasemonkey.');\r\n return;\r\n }\r\n \r\n //retrieve movie list\r\n GM_xmlhttpRequest({\r\n method : 'GET',\r\n url : getListUrl(id) + \"?start=\" + pageStart + \"&view=compact&sort=ratings_date:desc\",\r\n //headers: { 'Cookie': document.cookie },\r\n onload : function(responseDetails) { updateMovieList(responseDetails, id, pageStart) },\r\n onerror: function(responseDetails) { gotListError(responseDetails, id, pageStart) }\r\n });\r\n}", "function tmdbSelectedMovie(id) {\n $.getJSON(\n `${trendingApi.detailsBase}movie/${id}?api_key=${trendingApi.key}&language=en-US` // accesses api data\n ).then(function (detailsResponse) {\n let movieImdb = detailsResponse.imdb_id; // stores particilar data needed within a variable\n selectedMovie(movieImdb); // performs next function, selectedMovie() on search.js page\n });\n}", "function getMovieID(data){\n\tconst movieList = data.results.map((value, index) => displayResult(value));\n\t$(\".js-movies-result\").html(movieList);\n\ttitleClick();\n\tcloseClick();\n}", "function getMovie() {\n\n var omdbApi = require('omdb-client');\n\n var params = {\n apiKey: 'XXXXXXX',\n title: 'Terminator',\n year: 2012\n }\n omdbApi.get(params, function (err, data) {\n // process response...\n });\n}", "function getFilm(pFilmName){\n const searchTitle = titleSearch(pFilmName); \n\n const url =\"http://www.omdbapi.com/?t=\"+searchTitle+\"&apikey=c6bcf5ce\";\n //const url = \"https://aws.random.cat/meow\"\n \n axios.get(url)\n .then(function(response){\n filmInfo['poster'] = response.data.Poster;\n filmInfo['title'] =response.data.Title;\n filmInfo['decrp'] = response.data.Plot;\n })\n \n .catch(function(error){\n \n console.log(error);\n })\n .then(function(){\n showFilm();\n });\n}", "function getMovieData(e) {\n // Retrieve local storage - Movies\n var getMovieData = JSON.parse(localStorage.getItem(\"film\"));\n var movieId = e.target.getAttribute(\"data-id\");\n var selected = getMovieData.filter((film) => film.id === parseInt(movieId));\n\n if (selected.length > 0) {\n selected = selected[0];\n }\n hideMovie.classList.remove(\"hidden\");\n movieTitle.textContent = selected.original_title;\n overviewDiv.textContent = selected.overview;\n\n var movieposter = \"https://image.tmdb.org/t/p/w500/\" + selected.poster_path;\n MovieImage.src = movieposter;\n}", "getMovieById (state) {\n return (movieId) => {\n return state.loadeMovies.find((movie) => {\n return movie.id === movieId\n })\n }\n }", "async deleteFilm({id: id}) {\n const idFound = movie.findOne({id: id})\n return idFound.remove()\n }", "async deleteFilm(id) {\n return Movie.findByIdAndRemove(id)\n }", "function searchFilm() {\n if (searchQuery.length === 0) {\n searchQuery = \"Mr. Nobody\"\n }\n request(`http://www.omdbapi.com/?t=${searchQuery}&plot=short&apikey=5d94fa00`, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(`Movie: ${JSON.parse(body).Title}`);\n console.log(`Starring: ${JSON.parse(body).Actors}`);\n console.log(`Year: ${JSON.parse(body).Year}`);\n console.log(`Origin: ${JSON.parse(body).Country}`);\n console.log(`Language: ${JSON.parse(body).Language}`);\n console.log(`IMDB Rating: ${JSON.parse(body).imdbRating}`);\n console.log(`Tomato-meter: ${JSON.parse(body).Ratings[1].Value}`);\n console.log(`Synopsis: ${JSON.parse(body).Plot}`); \n }\n });\n}", "function show(id) {\n\n return resource.fetch(id)\n .then(function(data){ return data.data; });\n }", "function tmdbSelectedShow(id) {\n $.getJSON(\n `${trendingApi.detailsBase}tv/${id}/external_ids?api_key=${trendingApi.key}&language=en-US` // the api needs two functions to retrieve imdb id for tv shows and movies as they are seperate calls\n ).then(function (detailsResponse) {\n let showImdb = detailsResponse.imdb_id;\n selectedMovie(showImdb);\n });\n}", "function getTeamsFromID(idTeams) {\n var urlTeam = `${get_teamURL}${idTeams}`;\n fetchAPI(urlTeam)\n .then(teamFromID => {\n showFavTeams(teamFromID);\n })\n .catch(error => {\n console.log(error)\n })\n}", "function showTheatreMovie(req,res,next){\n // var tID = req.params.id;\n db.many(`SELECT m.movie_id, m.title, array_to_string(array_agg(tms.showtime), ',') showtimes\n FROM movies m INNER JOIN theatre_movie_showtime tms\n ON m.movie_id = tms.movie_id WHERE tms.theatre_id = ($1)\n GROUP BY m.movie_id;`, [req.params.id])\n .then((data)=>{\n console.log(data); // should get multiple movies in a theatre\n res.rows = data;\n next();\n })\n .catch(()=>{\n console.log('ERROR in showing ALL MOVIES IN A THEATRE!');\n })\n}", "function filterById(faves, id) {\n return faves.filter(function(faves) {\n return (faves.$id == id);\n })[0];\n }", "function getvalue(film) {\n $.ajax ({\n url: \"https://api.themoviedb.org/3/search/movie?api_key=67cc61914ff7a9cf3c55f2014fa568b1&query=\" + film,\n dataType: \"json\",\n success: function(res) {\n for (var i = 0; i < res.results.length; i++) {\n var title = res.results[i].original_title\n var year = res.results[i].release_date.substr(0,4)\n var image = res.results[i].poster_path\n var id = res.results[i].id\n\n var item = document.createElement(\"div\")\n var boxImg = document.createElement(\"div\")\n var itemImage = document.createElement(\"img\")\n var itemInfos = document.createElement(\"div\")\n var itemTitle = document.createElement(\"span\")\n var itemYear = document.createElement(\"span\")\n\n itemImage.src = \"http://image.tmdb.org/t/p/w185/\" + image\n itemTitle.appendChild(document.createTextNode(title))\n itemYear.appendChild(document.createTextNode(year))\n itemInfos.appendChild(itemTitle)\n itemInfos.appendChild(itemYear)\n boxImg.appendChild(itemImage)\n item.appendChild(boxImg)\n item.appendChild(itemInfos)\n item.id = id\n item.classList.add(\"item\")\n boxImg.classList.add(\"boxImg\")\n itemInfos.classList.add(\"itemInfos\")\n itemTitle.classList.add(\"itemTitle\")\n itemYear.classList.add(\"itemYear\")\n results.appendChild(item)\n }\n\n var items = document.querySelectorAll(\"#results > div.item\")\n for (var k = 0; k < items.length; k++) {\n items[k].addEventListener(\"click\", function() {\n itemId = this.id\n changeId(itemId)\n })\n }\n }\n });\n}", "function SearchByID(database,word,func) {\r\n database.query('SELECT books_basic.ID,Title,Subtitle,Image FROM books_basic WHERE ID = \"'+word+'\";',func);\r\n}", "async function getMoviesInfos(movieID) {\n const extraInfos = [];\n // const urlBase = \"http://localhost:8000/api/v1/titles/\";\n // alert(movieID);\n const url = `http://localhost:8000/api/v1/titles/${movieID}`;\n const response = await fetch(url);\n // alert(apiURL);\n const data = await response.json();\n console.log(data);\n return data;\n}", "function getDetails(){\n let id = sessionStorage.getItem('filmID');\n let name = sessionStorage.getItem('name');\n\n searchDetails(id, name); \n}", "async function showMovie(id) {\n const searchForASpecificMovie = await fetch(`https://www.omdbapi.com/?apikey=${apikey}&i=${id}`);\n const data = await searchForASpecificMovie.json();\n $('#modal').modal('show');\n showModal(data);\n console.log(data);\n }", "function fetchMovieDB (cb) {\n fetch(makeUrl(), function (err, res) {\n if (err) { cb(err); }\n cb(null, { name:res.results[random(19)].title });\n });\n }", "function updateCurrentFilmAndLoadDetails(id, title){\n props.currentFilm(id, title);\n props.history.push(`/details/${title}`);\n }", "function genreSelected(genreId) {\n // TODO: fetch movies matching the given genreId\n // `https://movie-api.cederdorff.com/wp-json/wp/v2/posts?_embed&categories=${genreId}`\n}", "onClickGalleryCell(id) {\n this.selectedMovieService.movie = this.currentMoviesService.movies\n .filter(movie => movie.id === Number(id))[0];\n }", "function getMovieFromDatabase(id, callback) {\n setTimeout(() => {\n console.log(\"Read the movie from the DB\");\n callback({id: id, name: \"Lagaan\", actor: \"Aamir Khan\"});\n }, 2000);\n}", "async deleteFilm({ id: id }) {\n const idFound = Film.findOneAndDelete({ id: id })\n return idFound.remove()\n }", "function getById(){\n\tvar deferred = Q.defer();\n\n\tdb.categoryNRf.find().toArray(function(err, cat){\n\t\t\tif(err) deferred.reject(err);\n\n\t\t\tif(cat){\n\t\t\t\tdeferred.resolve(cat);\n\t\t\t}else{\n\t\t\t\tdeferred.resolve();\n\t\t\t}\n\t});\n\treturn deferred.promise;\n\n}", "function getPlanetforFirstSpeciesInFirstMovieForPerson(id) {\n try {\n const info = new Promise(function (resolve, reject) {\n resolve(\n fetch(`https://swapi.dev/api/people/${id}/`).then(res => res.json())\n .then(person => console.log(\"Name: \" + person.name) + fetch(person.films[0]).then(res => res.json())\n .then(film => console.log(\"Film: \" + film.title) + fetch(film.species[0]).then(res => res.json())\n .then(species => console.log(\"Species: \" + species.name) + fetch(species.homeworld).then(res => res.json())\n .then(homeworld => console.log(\"Homeworld: \" + homeworld.name))\n )\n )\n )\n )\n })\n return info\n\n\n\n } catch (err) {\n console.log(err)\n }\n\n\n}", "function movieinfo() {\n \n var queryURL = \"http://www.omdbapi.com/?t=rock&apikey=//!InsertKey\";\n // Creating an AJAX call for the specific movie \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n }\n)}", "function ecraFilmePersonagens(id) {\n return getFilmePersonagens(id)\n .then(function (personagens) {\n mostraFilmePersonagens(personagens);\n })\n .catch(function (erro) {\n console.error(erro);\n });\n}", "function ecraFilmeReviews(id) {\n return getFilmeReviews(id)\n .then(function (reviews) {\n mostraFilmeReviews(reviews);\n })\n .catch(function (erro) {\n console.error(erro);\n });\n}", "function getMovies(varfn) {\r\n\r\n\r\n\r\n let apiData = {\r\n url: 'http://www.omdbapi.com/',\r\n apiKey: '?apikey=623dcc99&s=',\r\n filmnaam: varfn\r\n }\r\n\r\n const {\r\n url,\r\n apiKey,\r\n filmnaam\r\n } = apiData\r\n const apiUrl = `${url}${apiKey}${filmnaam}`\r\n\r\n let res;\r\n\r\n fetch(apiUrl)\r\n .then((response) => response.json())\r\n .then(data => res = data)\r\n .then((res) => {\r\n\r\n let movies = res.Search;\r\n let output = '';\r\n\r\n console.log(movies);\r\n $.each(movies, (index, movie) => {\r\n output += `\r\n <div class =\"col-md-3\" id=\"ruimte\">\r\n <div class=\"well text-center\">\r\n <h5>${movie.Title}</h5>\r\n <h6>Year: ${movie.Year}</h6>\r\n <img src=${movie.Poster} onclick=\"movieSelected('${movie.imdbID}')\" datatoggle=\"modal\" href=\"#\">\r\n </div>\r\n </div>\r\n `;\r\n });\r\n\r\n $('#movies').html(output); //inner html kan mss ook?\r\n });\r\n}", "function getMovie(movieId) {\n return $http.get(API_BASE_URL+'i='+movieId)\n .then(function(response){\n console.log(response.data);\n return response.data;\n },function(error){\n console.log(error);\n });\n }", "async findAllFilms(){\n return Movie.find();\n }", "function read(movieId){\n return knex(table)\n .select(\"*\")\n .where({movie_id: movieId})\n}", "async getAllFilms() {\n const responseData = await fetch(\"https://ghibliapi.herokuapp.com/films\");\n\n const response = await responseData.json();\n\n return response;\n }", "openFilmDetails(filmId) {\n this.hideFavoriteList();\n\n this.elem.modalContent.innerHTML =\n this.modalContentTemplate(this.fullList.find(film => film.id === filmId));\n\n this.elem.modalContent.querySelector('.js-fav-state-toggler')\n .addEventListener('click', (e) => {\n const btn = e.target.closest('.js-fav-state-toggler');\n\n this.toggleFilmFavoriteState(filmId);\n\n this.favFilmsIdList.indexOf(filmId) === -1\n ? btn.classList.remove(this.class.modalStar.fav)\n : btn.classList.add(this.class.modalStar.fav);\n });\n\n this.elem.modal.classList.remove(this.class.modal.hidden);\n this.elem.modal.classList.add(this.class.modal.fadeIn);\n }", "async function getPerson(id) {\n\t\n\t// get single person from starwars api ('https://swapi.dev/api/people/1')\n\tlet res = await fetch(`${baseUrl}/${id}`);\n\tlet person = await res.json();\n\t// console.log(person);\n\n\n\t// extract person's homeworld url and array of film urls\n\tlet homeworldUrl = person.homeworld; // 'http://swapi.dev/api/planets/1/',\n\tlet filmsUrlArray = person.films;\n\n\n\t// fetch person's homeworld\n\tlet homeworldRes = await fetch(homeworldUrl);\n\tlet homeworldObj = await homeworldRes.json();\n\t// console.log(homeworldObj)\n\n\n\t// fetch all of person's films\n\tlet promises = filmsUrlArray.map(filmUrl => fetch(filmUrl));\n\tlet promiseRes = await Promise.all(promises);\n\t// console.log(promiseRes);\n\tpromises = promiseRes.map(res => res.json());\n\tlet filmsArr = await Promise.all(promises);\n\t// console.log(filmsArr)\n\n\n\t// extract person name, homeworld name, and film titles\n\tlet personName = person.name // 'Luke Skywalker'\n\tlet homeworld = homeworldObj.name; // 'Tatooine'\n\tlet filmTitles = filmsArr.map(film => film.title);\n\tlet filmString = filmTitles.join(', ')\n\t// console.log(filmString);\n\n\tlet string = `hi my name is ${personName}, I am from ${homeworld}. I starred in the following films: ${filmString}`;\n\n\tconsole.log(string);\n\n\n\t// hi my name is NAME i am from HOMEWORLD and i starred in FILM, FILM, FILM\n\n\t// write and save file 'star-wars.txt'\n\n\n\t// read file\n\n\n}", "function getOneBook(id){\n return fetch(baseURL + `/${id}`)\n .then(res => res.json())\n }", "function openMovie(query) {\n\n //kada otvorimo odredjeni film/seriju sakrijemo elemente koji su do sada bili prikazani i prikazemo div za film\n $(\"#content\").hide();\n $(\"#top-part\").hide();\n $(\"#movie-show\").show();\n\n //ukoliko prikazemo neki film pa se vratimo na pretragu i otvorimo novi, prikazali bi se rezultati oba filma u div-u movie-show\n //zbog toga pozivamo pomocnu funkciju cleanMovie() kako bi ispraznili sve elemente movie-showa ukoliko su vec bili popunjeni\n cleanMovie();\n\n //div series-season se koristi prilikom prikaza odredjene epizode i on nam nije potreban kada prikazujemo film ili seriju\n //iz tog razloga ga ispraznimo kako se ne bi prikazivao bez kad je potreban\n $('#series-season').empty();\n\n //ajax reuquest prema API-u gdje izvlacimo podatke o odredjenom filmu/seriji\n $.ajax({\n type: \"GET\",\n url: \"https://www.omdbapi.com/?apikey=39c93cf7&i=\" + query,\n success: (response) => {\n //pomocna funkcija koja popunjava elemente potrebne za prikaz filma/serije\n showMovie(response);\n }\n })\n}", "function getThePage(id) {\n getStoryData().then((pages) => {\n for (let page of pages) {\n if (page.id == id) {\n storyPrint(page);\n }\n }\n })\n}", "function get_movies(d) {\n this.d_format = `\"${d}\"`;\n // this.d_format = `\"2020-06-07T18:09:32.513Z\"`;\n moviesref\n .doc(d_format)\n .get()\n .then((x) => {\n if (x.exists) {\n console.log(x.id);\n this.movies = x.data()[\"Movie_data\"];\n users = x.data()[\"users\"];\n // user function helps to send movies nad users list to populate\n Userfunction(this.movies, users);\n } else {\n alert(\"Poll hasn't started yet\");\n console.log(\"no movies add yet in the session\");\n }\n });\n}", "function getStreaming(req, res) {\n var streamingId = req.params.id;\n\n Streaming.findById(streamingId).populate({ path: 'streamingFilm' }).exec((err, streaming) => {\n if (err) {\n res.status(500).send({ message: \"Error en la peticion\" });\n } else {\n if (!streaming) {\n res.status(404).send({ message: \"El streaming no existe\" });\n } else {\n res.status(200).send({ streaming: streaming });\n //console.log(streaming);\n }\n }\n });\n}", "function getSavedMatchById() {\n var urlParams = new URLSearchParams(window.location.search);\n var idParam = urlParams.get(\"id\");\n\n getById(idParam).then(function (detail) {\n showSavedDetail(detail);\n });\n}", "function findMovie(title){\n\tvar title = processInput(title);\n\n\tif(title != undefined){\n\t\tvar formattedTitle = title.replace(\" \", \"+\");\t\n\t\tvar query = \"http://www.omdbapi.com/?t=\" + formattedTitle;\n\n\t\trequest(query, function (error, response, body) {\n\t\t\tif(error){\n\t\t\t\tconsole.log(error);\n\t\t\t} else{\n\t\t\t\tvar movieTitle = JSON.parse(body).Title;\n\t\t\t\tvar year = JSON.parse(body).Year;\n\t\t\t\tvar imdbRating = JSON.parse(body).Ratings[0].Value;\n\t\t\t\tvar country = JSON.parse(body).Country;\n\t\t\t\tvar language = JSON.parse(body).Language;\n\t\t\t\tvar plot = JSON.parse(body).Plot;\n\t\t\t\tvar actors = JSON.parse(body).Actors;\n\t\t\t\tvar rottenRating = JSON.parse(body).Ratings[1].Value;\n\t\t\t\tvar rottenURL = \"blah\";\n\n\t\t\t\tvar output = \"\\nMovie Title: \" + movieTitle + \"\\nYear Released: \" \n\t\t\t\t\t+ year + \"\\nCountry Filmed: \" + country + \"\\nLanguages Released In: \"\n\t\t\t\t\t + language + \"\\nActors: \" + actors + \"\\n\\nPlot: \" + plot + \"\\n\\nIMDB Rating: \" \n\t\t\t\t\t + imdbRating + \"\\nRotten Tomatoes Rating: \" + rottenRating + \"\\nRotten Tomatoes URL: \" \n\t\t\t\t\t + rottenURL;\n\n\t\t\t\tconsole.log(output);\n\t\t\t\twriteFS(output);\n\n\t\t\t};\n\t\t});\n\t};\n}", "function getData(genre, idName) {\n // CONVERTI LE FICHIER MINIFIER EN JSON POUR LIRE LE DATA\n fetch(genre).then((reponse) => {\n return reponse.json();\n }).then((data) => {\n //STOCKER LES DONNÉES DANS MA VARIABLE\n const content = data.results;\n // console.log(content); \n // PARCOURIR TOUS LES FILMS PAR GENRE ET INSERER LA BALISE IMG POUR AFFICHER LES IMG\n content.forEach(movie => {\n document.getElementById(\"\" + idName + \"\").insertAdjacentHTML(\"beforeend\", `<img data-id=\"${movie['id']}\" src=\"${posterUrl}${movie['poster_path']}\" class=\"posters\"/>`);\n });\n });\n}", "async findAllFilms(filmCollection){\n return movie.find(filmCollection);\n }", "function searchForActor() {\n let userActor = \"Daniel Radcliffe\";\n let queryURL =\n \"https://api.themoviedb.org/3/search/person?api_key=\" +\n API_KEY +\n \"&language=en-US&query=\" +\n userActor;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n console.log(response);\n let id = response.results[0].id;\n console.log(id);\n });\n}", "function getObject(id) {\n\n for (var i = 0; i < MAR.objects.length; i++) {\n if (MAR.objects[i].id === id) {\n return MAR.objects[i];\n }\n }\n\n return null;\n\n}", "getOne(req, res, next) {\n db.findById(req.params.id)\n .then((movie) => {\n res.locals.movie = movie;\n next();\n })\n .catch(err => next(err));\n }", "readById(id, callback) {\n visitorTimelineModel.visitor_timeline.find({ where: { visitorId: id } }).then((visitorTimeline) => {\n callback(visitorTimeline);\n });\n }", "function getSongById(id) {\n songSchema.find({id: '2'}, (err, song) => {\n if(err){\n console.log(`query error: ${err}`);\n }\n data = song;\n console.log(data);\n });\n return data;\n}", "function getMovie(search) {\n return fetch(\"http://www.omdbapi.com/?apikey=cc5844e4&s=\" + search)\n .then((response) => {\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n return response.json();\n })\n .then((result) => {\n if (result.Response === \"False\") {\n throw new Error(result.Error);\n }\n return result.Search;\n });\n}" ]
[ "0.7347444", "0.73301363", "0.7255389", "0.7101248", "0.7083853", "0.7045656", "0.7039282", "0.6974049", "0.6932695", "0.6926925", "0.6774918", "0.6694562", "0.6688595", "0.6535794", "0.65275955", "0.65091807", "0.6498809", "0.648325", "0.6456127", "0.6449105", "0.643445", "0.6433059", "0.63884956", "0.6289804", "0.62877375", "0.6273789", "0.62478137", "0.62435424", "0.6229991", "0.621633", "0.6214555", "0.6211744", "0.6176446", "0.6174077", "0.61670387", "0.6165886", "0.6159552", "0.6152555", "0.6152059", "0.6135093", "0.6128194", "0.6121281", "0.61165404", "0.6104602", "0.6103527", "0.6083024", "0.6082159", "0.60522336", "0.6048886", "0.6046693", "0.6031994", "0.602534", "0.60187435", "0.6002888", "0.60026443", "0.5996458", "0.59933656", "0.597522", "0.5973257", "0.5964132", "0.5959574", "0.5958824", "0.59568125", "0.5950779", "0.59452814", "0.5944373", "0.593805", "0.5919547", "0.5905391", "0.5903891", "0.59017897", "0.5899236", "0.58743197", "0.58719295", "0.58714134", "0.5869015", "0.58504707", "0.58431846", "0.5841993", "0.5824493", "0.5817972", "0.5807427", "0.58018845", "0.5800012", "0.5797893", "0.57926697", "0.57726127", "0.5770397", "0.5762562", "0.57614", "0.5758117", "0.5753966", "0.5747741", "0.574502", "0.5741225", "0.5738686", "0.5732655", "0.5729922", "0.57218516", "0.5719682" ]
0.6900725
10
================fetch trailer by ID==============
async fetchTrailerById() { try { const response = await axios.get( `${BASE_URL}movie/${this.movieId}/videos?${API_KEY}&language=en-US`, ); return response.data.results; } catch (error) { return error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTrailer(mID, cb) {\n return $.ajax({\n type: 'GET',\n url: '/api/trailer',\n data: {\n id: mID\n },\n dataType: 'json',\n success: function(data) {\n cb(data.result);\n },\n error: function(err) {\n cb(null);\n currentTrailer = null;\n console.log(err.responseText);\n }\n });\n}", "function getTrailer(title){\n\tconst userQuery = {\n q: `${title} official trailer`,\n part: \"snippet\",\n key: YOUTUBE_API_AUTH,\n type: \"video\",\n maxResults: 1,\n };\n $.getJSON(YOUTUBE_SEARCH_URL, userQuery, function (data){\n const showVideo = data.items.map((value, index) => displayTrailer(value));\n $('.modal-movie-detail .modal-video').html(showVideo);\n });\n}", "function fetchMovieInfo(id) {\n const movieUrl = `http://www.omdbapi.com/?i=${id}&apikey=${apiKey}`;\n fetch(movieUrl)\n .then(response => response.json())\n .then(body => movieInfoTempate(body));\n}", "movieById(cb, id) {\n let movieById = `https://api.themoviedb.org/3/movie/${id}?api_key=${this.API_KEY}&language=en-US`\n fetch(movieById)\n .then(response => {\n return response.json()\n }).then(movie => {\n cb(movie)\n })\n }", "function getMovieDetails(id, callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_DETAILS+id, query, callback);\n}", "function getOneMovie(id) {\n AJAXRequest(`${serverURL}/${id}`).then(responseData => console.log(responseData))\n }", "function appendInfo (id) {\n return fetch(`${moviesURL}/${id}`, {\"method\": \"GET\", headers: header})\n .then(res => res.json())\n .catch(console.error)\n }", "function getMovie(id) {\n //Making changes is easy in the cloud and desktop!\n let url = 'https://www.omdbapi.com/?i='+id+'&apikey=CHANGEDONDESKTOPWITHCLOUDSPACESEXTENSION'\n return axios.get(url);\n}", "function getRacerHistoryById(id, callback) {\n getPage(id, (err, $) => {\n if(err) {\n callback(err);\n }\n else {\n let hobj = {},\n heats = $('#Table1').find('a').map((i, el) => {\n let raceHistory = helpers.extractRaceHistory(el.children[0].data),\n skill = helpers.extractSkill(el.parent.next.next.children[0].data);\n\n return {\n id: helpers.extractHeatNo(el.attribs.href),\n kart: raceHistory.kart,\n desc: raceHistory.desc,\n date: el.parent.next.children[0].data.trim(),\n skill: skill.skill,\n skillDelta: skill.skillDelta,\n bestTime: el.parent.next.next.next.children[0].data,\n position: helpers.extractPosition(el.parent.next.next.next.next.children[0].data)\n };\n }).get();\n\n heats.forEach((heat) => {\n hobj[heat.id] = heat;\n });\n\n callback(null, {\n id: id,\n name: $('#lblRacerName').text(),\n skill: $('#lblSpeedLimit').text(),\n heats: hobj\n });\n }\n });\n }", "readById(id, callback) {\n visitorTimelineModel.visitor_timeline.find({ where: { visitorId: id } }).then((visitorTimeline) => {\n callback(visitorTimeline);\n });\n }", "function getTrailerIFrame() {\n return document.getElementById(\"trailer-iframe\");\n}", "function getObject(id) {\n\n for (var i = 0; i < MAR.objects.length; i++) {\n if (MAR.objects[i].id === id) {\n return MAR.objects[i];\n }\n }\n\n return null;\n\n}", "function getCastDetails(id, callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_DETAILS+id+\"/credits\", query, callback);\n}", "function getMovieById(id) {\r\n for(let i = 0; i < movies.length; i++){\r\n if (movies[i].imdbID === id)\r\n return movies[i]\r\n }\r\n return null\r\n}", "async function getMovieInfo(id) {\n let response = await fetch('https://swapi.dev/api/films/');\n let json = await response.json();\n let selectedFilm;\n json.results.forEach((film) => {\n if (film.episode_id == id) {\n selectedFilm = {\n name: film.title,\n episodeID: film.episode_id,\n characters: film.characters,\n };\n }\n });\n return selectedFilm;\n}", "async function fetchTrailer() {\n setLoading(true);\n //If item is a movie -> trailer is fetched from TMDb API in first request.\n //else if item is a TV,serial,webseries -> trailer is fetched from TMDb API in second request.\n await axios\n .get(\n `/movie/${itemDetails?.id}/videos?api_key=${API_KEY}&language=en-US`\n )\n .then((responseMovieTrailer) => {\n if (\n responseMovieTrailer.data?.results?.length === 0 ||\n !responseMovieTrailer.data?.results[0]?.key ||\n itemDetails?.media_type === \"tv\"\n ) {\n throw new Error(\"Trailer not available!\");\n } else {\n setTrailerUrl(responseMovieTrailer.data.results[0].key);\n trailerBox.current.focus();\n }\n })\n .catch(() => {\n axios\n .get(\n `/tv/${itemDetails?.id}/videos?api_key=${API_KEY}&language=en-US`\n )\n .then((responseTvTrailer) => {\n if (\n responseTvTrailer.data?.results?.length === 0 ||\n !responseTvTrailer.data?.results[0]?.key\n ) {\n setLoading(false);\n alert(\n \"Trailer not available.\\nTry:\\n1.Checking the connection.\\n2.Playing different TV,Movie trailer.\"\n );\n } else {\n setTrailerUrl(responseTvTrailer.data.results[0].key);\n trailerBox.current.focus();\n }\n })\n .catch(() => {\n // No Trailer is available for item in TMDb\n setLoading(false);\n alert(\n \"Trailer not available.\\nTry:\\n1.Checking the connection.\\n2.Playing different TV,Movie trailer.\"\n );\n });\n });\n }", "function getMovieDetail(imdbid) {\n return fetch(\"http://www.omdbapi.com/?apikey=cc5844e4&i=\" + imdbid)\n .then((response) => response.json())\n .then((result) => result);\n}", "static getVideoForBookmark(id){\n let realmVideos = realm.objects('Video').filtered('_id = $0', id)\n return realmVideos[0] //should never be 0 because should be loaded before bookmarks\n }", "searchResultID(id) {\n const requestUrl = 'http://api.tvmaze.com/shows/' + id;\n\n return fetch(requestUrl)\n .then(response => {\n return response.json();\n })\n }", "async function getRecipesDetals(id){\n\n let recipeDetails;\n let apiResponse = await fetch(`https://forkify-api.herokuapp.com/api/get?rId=${id}`);\n apiResponse = await apiResponse.json();\n recipeDetails= apiResponse.recipe;\n displayRecipeDetsils(recipeDetails);\n\n}", "function get(id) {\n return $.getJSON(\"/api/movies/\" + id);\n }", "getDetail(id) {\n return this.fetch(`${this.api}/${this.resource}/${id}`);\n }", "function table_getObjectFromID(id)\r\n {\r\n var scrollable = true;\r\n if (document.getElementById(id+'_header') == null) scrollable = false;\r\n if (scrollable == true)\r\n return document.getElementById(id+'_data')\r\n else\r\n return document.getElementById(id)\r\n }", "async findById({id: id}) {\n return movie.findOne({id: id});\n }", "function read(id) {\n return wvy.api.read(id);\n }", "getMovieInfo (id) {\n\t\t\t\treturn $http\n\t\t\t\t\t.get(`${API_URL}i=${id}`)\n\t\t\t\t\t.then(result => result.data)\n\t\t\t\t\t.then(t => chosenMovie = t) // 't' is whatever is returned from the previous .then\n\t\t\t}", "readById(id, callback) {\n visitorHistoryModel.visitor_history.find({ where: { visitorId: id } }).then((visitorHistory) => {\n callback(visitorHistory);\n });\n }", "async function getMovieDetails(id) {\n var movObj;\n var apiUrl = \"https://api.themoviedb.org/3/movie/\" + id + \"?api_key=\" + apiKey;\n fetch(apiUrl).then(function (response) {\n if (response.ok) {\n response.json().then(function (data) {\n var movieTitle = data.title;\n var imdbId = data.imdb_id;\n var posterUrl = data.poster_path;\n movObj = {\n id: id,\n title: movieTitle,\n imdb: imdbId,\n poster: posterUrl\n };\n displayMovie(movObj);\n });\n }\n else {\n alert(\"Something went wrong\");\n }\n });\n}", "function crisisReadMore(id) {\n // Make an AJAX Call to ReliefWeb Reports with the ID\n $.ajax({\n type: \"GET\",\n url: `https://api.reliefweb.int/v1/reports/${id}`,\n dataType: \"json\",\n contentType: \"application/json\"\n })\n // If Done, Render the Result\n .done(result => renderSingleCrisis(result))\n // If Fail, Log the Error\n .fail(err => console.log(err));\n}", "static find(id, cb){\n db.get('SELECT * FROM artwork WHERE id=?', id, cb);\n }", "getMovie(context, id){\n context.commit('SET_LOADING_STATUS', 'loading');\n axios.get(url_detail + id)\n .then(result => {\n context.commit('SET_LOADING_STATUS', 'notloading');\n context.commit('SET_CURRENT_MOVIE', result.data);\n })\n .catch(err => {\n context.commit('SET_LOADING_STATUS', 'notloading');\n context.commit('SET_CURRENT_MOVIE', {});\n context.commit('ADD_ERROR', err);\n })\n }", "function GetCreditNotesdByID(id) {\n try {\n var data = { \"id\": id };\n var ds = {};\n ds = GetDataFromServer(\"CreditNotes/GetCreditNotesByID/\", data);\n if (ds != '') {\n ds = JSON.parse(ds);\n }\n if (ds.Result == \"OK\") {\n return ds.Records;\n }\n if (ds.Result == \"ERROR\") {\n alert(ds.Message);\n }\n }\n catch (e) {\n notyAlert('error', e.message);\n }\n}", "function findTrailByNameForId(req, res , next){\r\n res.setHeader('Access-Control-Allow-Origin','*');\r\n console.log(\"*** find Trail for :\"+req.params.initiativeId);\r\n db.collection(req.path().split(\"/\")[1]).find({refId:mongojs.ObjectId(req.params.initiativeId)} , function(err , success){\r\n console.log('Response success '+success);\r\n console.log('Response error '+err);\r\n if(success){\r\n res.send(200 , success);\r\n return next();\r\n }\r\n return next(err);\r\n })\r\n}", "async function getMoviesInfos(movieID) {\n const extraInfos = [];\n // const urlBase = \"http://localhost:8000/api/v1/titles/\";\n // alert(movieID);\n const url = `http://localhost:8000/api/v1/titles/${movieID}`;\n const response = await fetch(url);\n // alert(apiURL);\n const data = await response.json();\n console.log(data);\n return data;\n}", "watchTrailer(xhr, index, element, movieId) {\n\n\n let data = JSON.stringify({});\n\n xhr = new XMLHttpRequest();\n xhr.withCredentials=false;\n\n let name=document.querySelector(\"#movie_title_iframe\");\n\n xhr.addEventListener(\"readystatechange\", function () {\n\n if (xhr.readyState === xhr.DONE && [200,201,203].includes(xhr.status)) {\n\n let results=JSON.parse(xhr.responseText).results;\n\n let selectedListContent = document.querySelectorAll(\".create_list\" );\n selectedListContent[0].style.display=\"none\";\n\n element.forEach(function (el) {\n\n\n if(![undefined].includes(results)){\n if(results.length===0){\n name.textContent=\"An error occurred. Please try again later\";\n el.src=\"https://www.youtube.com/embed/\"+movieId+\"?controls=1&autoplay=1\";\n\n return false;\n }\n\n results.forEach(function (val) {\n\n name.textContent=val.name.substr(0,34);\n if(val.hasOwnProperty('key')){\n el.src=\"https://www.youtube.com/embed/\"+val.key+\"?controls=1&autoplay=1\";\n\n\n }\n return false;\n })\n\n }\n\n\n });\n\n\n }\n\n });\n\n\n\n xhr.open(\"GET\", \"http://api.themoviedb.org/3/movie/\"+movieId+\"/videos?api_key=a8ac0ce418f28d6ec56424ebad76ed12&append_to_response=videos\",true);\n xhr.responseType=\"text\";\n\n xhr.send(data);\n\n\n }", "function loadCitation(id) {\n\n let xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status === 200) {\n showCitation(JSON.parse(xhr.responseText));\n } else {\n window.alert(`Erreur : ${xhr.statusText}.`);\n }\n }\n };\n\n xhr.open('GET', API_URL + \"/\" + id);\n xhr.send();\n }", "function getVideos(id, videoUl) {\n fetch(videosUrl).then(resp => resp.json())\n .then(result => result.map(video => {\n if (video.language.id === id) {\n listVideos(video, videoUl)\n }\n }))\n}", "async function findBook (id) {\n const booksEndpoint = `${cors}${baseUrl}details/?id=${id}&authorization=${key}&detaillevel=${detail}&p=jeugd&output=json`;\n const books = await fetchData(booksEndpoint, config);\n // const findData = books.find((data) => data.id == id);\n return books;\n // https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d\n}", "static getMoviesById(id) {\n return axios(withBaseUrl(`movie/${id}`));\n /* chamando essa rota https://developers.themoviedb.org/3/movies/get-movie-details */\n }", "find(id) {\n if(id) {\n return this.movieList.find(element => {\n return element.id === id;\n });\n }else {\n return this.movieList;\n }\n }", "getObjectById (id) {\n\n for (var emitters of this.emitters) {\n if (emitters.id === id) {\n return emitters\n }\n }\n\n for (var fields of this.fields) {\n if (fields.id === id) {\n return fields\n }\n }\n\n return null\n }", "function getThePage(id) {\n getStoryData().then((pages) => {\n for (let page of pages) {\n if (page.id == id) {\n storyPrint(page);\n }\n }\n })\n}", "function retrieveID(){\n var retrievedID = $('#updateId').val();\n retrieveMovie(\"https://eloquent-yew-227217.appspot.com/GetFilm?ID=\"+retrievedID+\"&format=json\");\n}", "function fetchDetails (id) {\n return limitedFetch(`${domain}/item/Details/${id}`)\n .then(res => res.text())\n .then(body => {\n var promises = [];\n const detailDom = new JSDOM(body);\n\n // Get the primary image\n const pImg = detailDom.window.document.querySelector('#PrimaryImage');\n if (pImg) {\n promises.push( fetchImage2base64(pImg.getAttribute('data-url'), package[id], 'primaryImage') )\n }\n\n // scrape the panels at the top\n detailDom.window.document.querySelectorAll('.panel-primary')\n .forEach( node=>scrapePrimaryPanel(id,node) );\n\n // Fetch the detail tabs for this resource\n [\"/Item/_Details/\",\"/Item/_LocationDisplay/\",\"/Item/_Donor/\",\"/Item/_Appraisal_Deed/\",\"/Item/_Purchases/\",\"/Item/_Condition/\",\"/Item/_MaintenanceDisplay/\"]\n .forEach( tabpath=>{\n promises.push( getTabDetail(tabpath,id) );\n });\n\n return Promise.all(promises);\n })\n}", "find(id) {\n\t\treturn this.$http.get(this.path(id), {\n\t\t\tcache: this.cache\n\t\t}).then(response => {\n\t\t\tthis.addRecent(response.data);\n\n\t\t\treturn response.data;\n\t\t});\n\t}", "getById(id) {\n console.log(\"getById(\" + id + \")\");\n let result = this.tvShows.find(show =>\n (show === undefined ? null : show.id) == id);\n if (result) return result;\n else return null;\n }", "function get_cargo(id) {\n let key = datastore.key([CARGO, parseInt(id, 10)]);\n const q = datastore.createQuery(CARGO).filter('__key__', \"=\", key);\n return datastore.runQuery(q).then((entity) => {\n return entity[0].map(ds.fromDataStore); \n });\n}", "extractTrailer(index) {\n // run forward to the dictionary start\n index = util_1.Util.locateSequence(util_1.Util.DICT_START, this.data, index) + 2;\n let obj = {};\n object_util_1.ObjectUtil.extractDictKeyRec(this.data, index, obj);\n return {\n size: obj[\"/Size\"],\n root: obj[\"/Root\"],\n prev: obj[\"/Prev\"] ? obj[\"/Prev\"] : undefined,\n is_encrypted: obj[\"/Encrypt\"] ? true : false,\n encrypt: obj[\"/Encrypt\"] ? obj[\"/Encrypt\"] : undefined,\n id: obj[\"/ID\"] ? obj[\"/ID\"] : undefined\n };\n }", "function ecraFilmeReviews(id) {\n return getFilmeReviews(id)\n .then(function (reviews) {\n mostraFilmeReviews(reviews);\n })\n .catch(function (erro) {\n console.error(erro);\n });\n}", "static async getById(id) {\n let sql = `\n SELECT id, lat, lon, name, url, lure_expire_timestamp, last_modified_timestamp, updated,\n enabled, quest_type, quest_timestamp, quest_target, quest_conditions, quest_rewards,\n quest_template, cell_id, deleted, lure_id, pokestop_display, incident_expire_timestamp,\n first_seen_timestamp, grunt_type, sponsor_id\n FROM pokestop\n WHERE id = ?\n `;\n let args = [id];\n let results = await db.query(sql, args);\n if (results && results.length) {\n let result = results[0];\n let pokestop = new Pokestop(result);\n return pokestop;\n }\n return null;\n }", "function getMovie(req,res,next){\n // var mID = req.params.id;\n db.one(`SELECT * FROM movies WHERE movie_id=($1);`, [req.params.id])\n .then((data)=>{\n console.log(data); // should get all info of a movie\n res.rows = data;\n next();\n })\n .catch(()=>{\n console.log('ERROR in GETTING MOVIE PROFILE!');\n })\n}", "function getObject(id) {\n return r.table(\"objects\").get(id).run();\n}", "function getReleaselInfo(id, next) {\n\tvar url = '/catalog/3/release?id=' + id;\n\tbeatportApi(url, function(err, json) {\n\t\tif (err) throw err;\n\t\tif (json.results.length != 1) {\n\t\t\tconsole.dir(json.results[0]);\n\t\t} else {\n\t\t\tnext('no result for ' + id, null);\n\t\t}\n\t});\n}", "function getInfo(id, cb) {\n\tvar ytdl = require('ytdl-core');\n\tvar BASE = \"http://www.youtube.com/watch?v=\";\n\tvar url = BASE + id;\n\tytdl.getInfo(url,\n\t\t\t\t{\"downloadURL\":true},\n\t\t\t\tfunction (err, info) {\n\t\t\t\t\t// Error handling if ytdl couldn't get info for the request video\n\t\t\t\t\tif (err || !info) {\n\t\t\t\t\t\tcb('error');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Calculate and format duration properly\n\t\t\t\t\tvar seconds = info.length_seconds % 60;\n\t\t\t\t\tif (seconds < 10) \n\t\t\t\t\t\tseconds = '0' + seconds;\n\n\t\t\t\t\tvar ret = {\n\t\t\t\t\t\tid : id,\n\t\t\t\t\t\turl : url,\n\t\t\t\t\t\tthumbnail : info.iurlhq,\n\t\t\t\t\t\ttitle : info.title,\n\t\t\t\t\t\taddedBy : 'DJ ROOMBA',\n\t\t\t\t\t\tlength_seconds : info.length_seconds,\n\t\t\t\t\t\tduration : Math.floor(info.length_seconds / 60) + ':' + seconds,\n\t\t\t\t\t\taudioURL : '',\n\t\t\t\t\t\tscore: 0,\n\t\t\t\t\t\tvotedOnBy : []\n\t\t\t\t\t}\n\n\t\t\t\t\tvar results = info.formats;\n\t\t\t\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\t\t\t\tif (results[i].type === undefined)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\tif ((results[i].type).indexOf(\"audio/mp4\") > -1) {\n\t\t\t\t\t\t\tret.audioURL = results[i].url;\n\t\t\t\t\t\t\tcb(ret);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t});\n}", "async getDirector({}, id) {\n return await this.$axios\n .$get(\"\", {\n params: {\n apikey: \"a4bf96a7\",\n i: id,\n type: \"movie\"\n }\n })\n .then(response => {\n if (response.Response === \"False\") throw new Error(response.Error);\n\n return response.Director;\n })\n .catch(e => commit(\"setError\", e.message));\n }", "getCarWithID(req, res, next) {\n carDocumentSchema_1.Car.findById(req.params.carId, function (err, doc) {\n if (err) {\n res.send(err);\n }\n return res.status(200).send(doc);\n });\n }", "function getChapterData(id, cb) {\n $.get('https://mangadex.org/api/?id=' + id + '&type=chapter', (chapter_data) => {\n cb(null, chapter_data);\n }).fail((jqXHR, textStatus, error) => {\n cb({ textStatus: textStatus, error: error }, null);\n });\n }", "function getMovieImdbId(imdbID) {\n fetch('https://www.omdbapi.com/?apikey=da783fad&i=' + imdbID + '')\n .then((response) => response.json())\n .then((theId) => {\n spinner.style.display = \"block\";\n displayMoreInformationAboutMovie(theId)\n goBackToSearchButton()\n\n })\n}", "function getById(id) {\n for (let i = 0; i < allListings.length; i += 1) {\n if (id === allListings[i].id) {\n return allListings[i];\n }\n }\n return null;\n}", "function ecraFilme(id) {\n return getFilme(id)\n .then(function (filme) {\n mostraFilme(filme);\n })\n .catch(function (erro) {\n console.error(erro);\n });\n}", "function getMovieFromDatabase(id, callback) {\n setTimeout(() => {\n console.log(\"Read the movie from the DB\");\n callback({id: id, name: \"Lagaan\", actor: \"Aamir Khan\"});\n }, 2000);\n}", "async findById(id) {\n return Film.findById(id);\n }", "function fetchMovieList(id, pageStart){\r\n if (!GM_xmlhttpRequest) {\r\n alert('Please upgrade to the latest version of Greasemonkey.');\r\n return;\r\n }\r\n \r\n //retrieve movie list\r\n GM_xmlhttpRequest({\r\n method : 'GET',\r\n url : getListUrl(id) + \"?start=\" + pageStart + \"&view=compact&sort=ratings_date:desc\",\r\n //headers: { 'Cookie': document.cookie },\r\n onload : function(responseDetails) { updateMovieList(responseDetails, id, pageStart) },\r\n onerror: function(responseDetails) { gotListError(responseDetails, id, pageStart) }\r\n });\r\n}", "function loadTrailer(pos) {\n if(movies[pos]) {\n if (movies[pos].trailer) {\n embedTrailer(movies[pos].trailer);\n currentTrailer = movies[pos]._id;\n } else {\n getTrailer(movies[pos]._id, function(trailerKey) {\n movies[pos].trailer = trailerKey;\n embedTrailer(trailerKey);\n currentTrailer = movies[pos]._id;\n });\n }\n }\n}", "async function get_info(ID){\n let url_ = url_2.replace(\"{id}\", id);\n const response = await fetch(url_, {\n method : 'GET',\n mode : 'cors',\n headers:{\n 'Content-Type' : 'application/json'\n }\n });\n return response.json();\n}", "getTrackById(id) {\n let tracks = this.collecTracks(this.collectAlbums());\n let track = tracks.find((t)=>t.id===id)\n return this.returnIfExists(track , \"track\") ;\n }", "function getDownloadUrl(id) {\n\treturn fetch('https://www.yt-download.org/api/button/mp3/' + id)\n\t\t.then(response => response.text())\n\t\t.then(text => {\n\t\t\tconst html = new DOMParser().parseFromString(text, 'text/html');\n\t\t\tconst download_link = html.documentElement.querySelector('div.download > a').href;\n\t\t\treturn download_link;\n\t\t})\n\t\t.catch(error => {\n\t\t\tconsole.log(error);\n\t\t\treturn null;\n\t\t});\n}", "async findById(id) {\n return Movie.findById(id);\n }", "async function getCharacter (id) {\n\tconst charactersEndpoint = createCharactersEndpoint(id);\n\tconst characters = await fetch(charactersEndpoint);\n\tconst findData = characters.find((data) => data.id == id);\n\treturn findData;\n\t// https://medium.com/poka-techblog/simplify-your-javascript-use-map-reduce-and-filter-bd02c593cc2d\n}", "get(id)\n {\n return this._fetch(this._url + '/' + id);\n }", "function get_rental(id)\n{\n for(var j=0; j<rentals.length;j++)\n {\n if(id==rentals[j].id)\n {\n return rentals[j];\n }\n }\n return;\n}", "function getId(query, type) {\n fetch(\n `https://watchmode.p.rapidapi.com/search/?search_field=name&search_value=${query}&types=${type}`,\n {\n method: \"GET\",\n headers: {\n \"x-rapidapi-key\":\n \"be9a60e677msh27b9eb97af299e8p1c5a0djsnb9ba03ed5bd6\",\n \"x-rapidapi-host\": \"watchmode.p.rapidapi.com\",\n },\n }\n )\n .then(response => response.json())\n .then((data) => {\n if (data.title_results.length != 0) {\n //console.log(data);\n //console.log(data.title_results);\n let id = data.title_results[0].id;\n console.log(id);\n getStreaminginfo(id)\n /*If Watchmode does not have the movie title (and thus its ID) in its database, that means it does not have any streaming options. This throws an error telling user to pick a different movie*/\n /*You can test this by inputting a movie that does not exist*/\n errormessage.textContent = \"\";\n addtolist.textContent = \"Add to Movies\";\n } else throw Error('No movie found by that name');\n })\n .catch((err) => {\n console.error(err);\n errormessage.textContent = \"No movie found by that name. Please try searching for a different movie. Unfortunately, TV shows are not accepted at this time.\"\n addtolist.textContent = \"\";\n\n });\n}", "fetchById(id) {\n // There should be only one match. Return first match or null if undefined.\n return this.data.filter(fruit => fruit.id === id)[0] || null;\n }", "async fetchFilmById() {\n try {\n const response = await axios.get(\n `${BASE_URL}movie/${this.movieId}?${API_KEY}&language=en-US`,\n );\n return response.data;\n } catch (error) {\n return error;\n }\n }", "downloadId( id ) {\n return this.url( id );\n }", "async function viewObjectDetails(id){\n\t//retrieve object data\n\tconst p = new Parameters();\n\tp.addParams(\"q\", `objectid:${id}`);\n\tconst data = await getSearchData(OBJECT, p.getParams());\n\tconst obj = data[0];\n\tlet html = \"\";\n\t//retrieve images through IIIF\n\tfor (let i in obj.images){\n\t\tconst base_uri = obj.images[i].iiifbaseuri;\n\t\tconst json = await getData(base_uri + \"/info.json\"); //can be slower than loading the rest of the info\n\t\tconst info = json.profile[1];\n\t\tconst ext = (info.formats.includes(\"png\") ? \"png\" : \"jpg\");\n\t\tconst full_uri = base_uri + `/full/full/0/native.${ext}`;\n\t\thtml += `<img src='${full_uri}' width='300' onclick=\"viewFullImg('${full_uri}')\">`;\n\t}\n\t//display object properties\n\thtml += \"<table><tr><th colspan='2'>Object Details</th></tr>\";\n\tfor (let prop in obj){\n\t\tif (!obj.hasOwnProperty(prop)){ continue; }\n\t\tlet val = obj[prop];\n\t\thtml += `<tr><td>${prop}</td><td>${val}</td></tr>`;\n\t}\n\thtml += \"</table>\";\n\tdocument.getElementById(\"results\").innerHTML = html;\n}", "function filterMovies(id) {\r\n var isDownloaded = false;\r\n this.data.forEach(function(type) {\r\n [type].forEach(function(entry) {\r\n $.each(entry, function(i, item) {\r\n $.each(item, function(x, y) {\r\n if (y.imdbId === id && y.sizeOnDisk >= 0) {\r\n isDownloaded = true;\r\n }\r\n });\r\n });\r\n });\r\n });\r\n return isDownloaded;\r\n}", "function modelGetMovie(id) {\n for (x in movieList) {\n if (movieList[x].id === id) {\n //return movieList[x];\n return x;\n }\n }\n return undefined;\n}", "fetch(id) {\n return this._callApi('get', id);\n }", "obterPorId(_id){\n return this.lista.filter( aluno => aluno._id === _id )[0];\n }", "fetch_details({ commit }, id) {\n return new Promise((resolve, reject) => {\n fetch(`/api/details/${id}`)\n .then(resp => resp.json())\n .then(resp => resolve(resp));\n });\n }", "function getRentalbyId(id)\n{\n var rentalInfo = 0;\n rentals.forEach(\n function(eachRental)\n {\n if(eachRental.id==id)\n {\n rentalInfo = eachRental;\n }\n }\n );\n return rentalInfo;\n}", "async function searchFromId(id) {\n const searchURL = `https://www.thecocktaildb.com/api/json/v1/1/lookup.php?i=${id}`;\n try {\n let response = await axios.get(searchURL);\n let data = response.data.drinks[0];\n showCocktailName(data);\n showRecepie(data);\n showIngredients(data);\n showCocktailImg(data);\n } catch (error) {\n console.log(`bob err 2nd api: ${error}`);\n }\n}", "function getById(id) {\n return db.hgetallAsync(KEYS.id2article(id))\n .then(format);\n}", "function getOneBook(id){\n return fetch(baseURL + `/${id}`)\n .then(res => res.json())\n }", "async getById (req, res) {\n const { id } = req.params\n\n const { properties, location} = await readExtractData(dataPath)\n\n let data = properties.filter(item => item.id == id)\n\n data = data ? data.map(buildObjResponse(location)): undefined\n\n res.json(data)\n }", "function show(id) {\n\n return resource.fetch(id)\n .then(function(data){ return data.data; });\n }", "getCreditByPersonId(id) {\n return new Promise((fulfill, reject) => {\n https.get(restHost + \"/person/\" + id + pathTail + \"&append_to_response=movie_credits\", function (res) {\n var _data = '';\n res.on('data', (d) => {\n _data += d;\n });\n\n res.on('end', () => {\n var rs = JSON.parse(_data);\n fulfill(rs);\n });\n });\n });\n }", "async function getDiyRecById(id) {\n const response = await axios.get(`/diy_recipes/${id}`);\n return response.data.diy_recipe;\n }", "function getPlaylistById(id){\n let playlistById = player.playlists.filter(playlist =>{\n if(playlist.id === id){\n return playlist;\n }\n })\n return playlistById[0];\n }", "function fetchCourseDescription(id) {\n\tvar result;\n\tif (id === 'CSC200') {\n\t\tresult = readCalendarEntry(id + 'Y1');\n\t} else if (id === 'Calc1') {\n\t\tresult = readCalendarEntry('MAT135H1') + readCalendarEntry('MAT136H1') + readCalendarEntry('MAT137Y1') + readCalendarEntry('MAT157Y1');\n\t} else if (id === 'Lin1') {\n\t\tresult = readCalendarEntry('MAT221H1') + readCalendarEntry('MAT223H1') + readCalendarEntry('MAT240H1');\n\t} else if (id === 'Sta1') {\n\t\tresult = readCalendarEntry('STA247H1') + readCalendarEntry('STA255H1');\n\t} else if (id === 'Sta2') {\n\t\tresult = readCalendarEntry('STA248H1') + readCalendarEntry('STA261H1');\n\t} else {\n\t\tresult = readCalendarEntry(id + 'H1');\n\t}\n\n\t$('#calendar').html(result);\n}", "_getHead(id) {\n\n }", "getById(id) {\n return this.get(id).then(response => {\n const item = response.data.data;\n this.setCid(item);\n return item;\n });\n }", "async getBookById({ id }) {\n const response = await this.get(`volumes/${id}`);\n return this.bookReducer(response);\n }", "function getSingleDancer(id) {\n return fetch(danceURL + `/${id}`)\n .then(res => res.json())\n}", "async function getFile(id) {\n var file = await db.readDataPromise('file', { id: id })\n return file[0];\n}", "function getInfo( title, year, id, callback ) {\n\tnewTitle = title.replace( / /g, '+' );\n\t// var queryString = '/?t=' + newTitle + '&y=' + year + '&plot=short&r=json';\n\tvar queryString = '/3/movie/' + id + '?api_key=' + tvdbAPIKey;\n\tconsole.log( queryString );\n\tvar options = {\n\t\thost: 'api.themoviedb.org',\n\t\tpath: queryString,\n\t\tmethod: 'GET',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json'\n\t\t}\n\t};\n\n\tvar getData = http.request( options, function( data ) {\n\t\tvar output = '';\n\n\t\tconsole.log( options.host + ':' + data.statusCode );\n\n\t\tdata.setEncoding( 'utf8' );\n\n\t\tdata.on( 'data', function( chunk ) {\n\t\t\toutput += chunk;\n\t\t} );\n\n\t\tdata.on( 'end', function() {\n\t\t\tcallback( null, JSON.parse( output ) );\n\t\t} );\n\n\t} );\n\n\tgetData.end();\n\n}", "static fetchReviewsById(id, callback) {\r\n\t\tDBHelper.readAllFromDB(`reviews-${id}`)\r\n\t\t\t.then(data => {\r\n\t\t\t\tif (data.length == 0) {\r\n\t\t\t\t\treturn DBHelper.getDataFromURL(REVIEW);\r\n\t\t\t\t}\r\n\t\t\t\treturn data;\r\n\t\t\t})\r\n\t\t\t.then(reviews => {\r\n\t\t\t\tcallback(null, reviews);\r\n\t\t\t});\r\n\t\tDBHelper.readAllFromDB('reviews-on-hold')\r\n\t\t\t.then(data => {\r\n\t\t\t\treturn data;\r\n\t\t\t})\r\n\t\t\t.then(reviews => {\r\n\t\t\t\tcallback(null, reviews);\r\n\t\t\t});\r\n\t\t/**\r\n\t\t * NOTE: this last readAllFromDB() call will display all reviews added in offline mode,\r\n\t\t * independently of the self.restaurant in the actual page, so some reviews that don't belong to\r\n\t\t * that restaurant will appear, but in online mode they will be added in the right place.\r\n\t\t */\r\n\t}", "function getMovieDetails(movie_id){\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.themoviedb.org/3/movie/\" + movie_id + \"?language=en-US&api_key=7b9a9e7e542ce68170047140f18db864\",\n \"method\": \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n }\n $.ajax(settings).done(function (response) {\n $('#movieTitle').text(\"Showing results for \" + response.title)\n for(var i = 0; i < response.genres.length; i++){\n getMoviesForGenre(response.genres[i].name, response.genres[i].id, response.vote_average)\n }\n });\n }", "async retrieve(id) {\n\n let client = await MongoClient.connect(this.mongoDb)\n let results = await client.db(this.database).collection(this.collection).find(new ObjectID(id)).toArray()\n\n return results[0]\n }" ]
[ "0.71374357", "0.66372436", "0.65327764", "0.618922", "0.6118345", "0.6107566", "0.6033754", "0.602162", "0.6006127", "0.5993829", "0.5944225", "0.59165883", "0.59071666", "0.5898653", "0.5877318", "0.5862976", "0.5845037", "0.5840162", "0.5780638", "0.57175267", "0.5688476", "0.56796104", "0.56531817", "0.5633389", "0.5626464", "0.5619435", "0.56180966", "0.5616676", "0.56072336", "0.5605941", "0.55760974", "0.55429465", "0.5538087", "0.5534873", "0.55191433", "0.5508071", "0.5506661", "0.5506476", "0.5501545", "0.5484011", "0.54810095", "0.5480087", "0.5475136", "0.54586303", "0.5452821", "0.5433118", "0.5422604", "0.5418612", "0.5413415", "0.541051", "0.5406666", "0.54009855", "0.5386331", "0.5383625", "0.53826493", "0.53725046", "0.5369467", "0.5361344", "0.53610873", "0.5358884", "0.53545916", "0.53411925", "0.53346616", "0.5318609", "0.53181255", "0.5312563", "0.5307006", "0.5305258", "0.53042436", "0.53017175", "0.5298154", "0.529588", "0.52785933", "0.52774066", "0.5274714", "0.5274463", "0.52739066", "0.52698475", "0.5260097", "0.5255574", "0.52522117", "0.5251942", "0.52440834", "0.5243756", "0.5243369", "0.5240505", "0.5230283", "0.5210047", "0.5207785", "0.5202755", "0.51973146", "0.5195752", "0.5188865", "0.51869404", "0.51859426", "0.5183408", "0.51819015", "0.5180583", "0.5177107", "0.5173864" ]
0.7265544
0
Only change code below this line
function urlSlug(title) { var arrTitle = [...title]; var newTitle = ''; for(let i=0;i<arrTitle.length;i++){ newTitle = newTitle + (arrTitle[i]); } return newTitle .split(/\W/) .filter(obj => { return obj !== ""; }) .join("-") .toLowerCase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected internal function m252() {}", "private internal function m248() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "transient final protected internal function m174() {}", "transient private internal function m185() {}", "transient protected internal function m189() {}", "transient final private protected internal function m167() {}", "static private protected internal function m118() {}", "transient final private internal function m170() {}", "updated() {}", "static final private internal function m106() {}", "preset () { return false }", "transient final private protected public internal function m166() {}", "transient private public function m183() {}", "static transient final protected internal function m47() {}", "static postUpdate() {\n return false;\n }", "transient private protected public internal function m181() {}", "function kp() {\n $log.debug(\"TODO\");\n }", "livelyPrepareSave() {\n }", "hacky(){\n return\n }", "static private internal function m121() {}", "static transient final private internal function m43() {}", "static final private protected internal function m103() {}", "async 'after sunbath' () {\n console.log( 'see? I appear here because of the first custom above' )\n }", "_update() {\n }", "update() {\n // Subclasses should override\n }", "static transient final private protected internal function m40() {}", "function updateroster() {\n\n}", "function jessica() {\n $log.debug(\"TODO\");\n }", "preorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "static private protected public internal function m117() {}", "change() { }", "function _____SHARED_functions_____(){}", "onModifyDef() {}", "onModifySpA() {}", "static transient private protected internal function m55() {}", "onModifyAtk() {}", "function welcomeToBooleans() {\n\n// Only change code below this line.\n\nreturn true; // Change this line\n\n// Only change code above this line.\n}", "function welcomeToBooleans() {\n\n// Only change code below this line.\n\nreturn true; // Change this line\n\n// Only change code above this line.\n}", "function welcomeToBooleans() {\n\n// Only change code below this line.\n\nreturn true; // Change this line\n\n// Only change code above this line.\n}", "function comportement (){\n\t }", "__init7() {this._isEnabled = false;}", "function additionalSettings(){\n\n\n}", "incapacitate(){\n\t\t//\n\t}", "editTattoo () {\n\n }", "function customHandling() { }", "static transient final protected public internal function m46() {}", "upgrade() {}", "postorder() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "static final private protected public internal function m102() {}", "afterValidChange() { }", "patch() {\n }", "static protected internal function m125() {}", "fixupFrame() {\n // stub, used by Chaos Dragon\n }", "_onProcessReplaceableContent() {}", "function update() {\n // ... no implementation required\n }", "static transient private protected public internal function m54() {}", "function yst_overrideElemFunction() {\n\treturn;\n}", "update() {\r\n throw new Error('must be set in subclass');\r\n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "afterUpdate() {}", "_reflow() {\n this._init();\n }", "function StupidBug() {}", "update()\n {\n \n }" ]
[ "0.68709457", "0.67526597", "0.65493727", "0.6521837", "0.6354909", "0.6270197", "0.62660617", "0.61954707", "0.5806521", "0.5790502", "0.5773313", "0.575885", "0.57579", "0.57178414", "0.5706308", "0.56971264", "0.56926125", "0.56757665", "0.56499755", "0.56336206", "0.56300366", "0.5605449", "0.5582053", "0.5559374", "0.5545978", "0.5544571", "0.5542089", "0.55207413", "0.54989237", "0.5470329", "0.5467675", "0.5455564", "0.544132", "0.5427635", "0.54232204", "0.54124343", "0.5410664", "0.5410368", "0.5405642", "0.5405642", "0.5405642", "0.5403164", "0.5401354", "0.5400777", "0.53963125", "0.53958863", "0.5356611", "0.53385353", "0.533235", "0.53265613", "0.5318242", "0.5312697", "0.52953196", "0.52823955", "0.5265654", "0.5256879", "0.52558875", "0.5253407", "0.5245018", "0.52397645", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.5228272", "0.52255374", "0.5222366", "0.5221526", "0.5202202" ]
0.0
-1
TeamDetailController Team Detail controller use detail.html view
function TeamDetailController($scope, $timeout, $stateParams, RestFul) { if (!$stateParams.ud) { return; } $scope.teamDetailLoading = true; RestFul.error( {"action": "Account:TeamDetail", "params": {"team": $stateParams.ud}}, function(response) { if (!response) { return; }; if (response.hasOwnProperty('message') && response.hasOwnProperty('data')) { $scope.team = response.data; $timeout(function() { $scope.teamDetailLoading = false; }, 300) } else { $timeout(function() { $scope.teamDetailLoading = false; }, 300) } } ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showTeamDetails(context) {\n context.loggedIn = sessionStorage.getItem('authtoken') !== null;\n context.username = sessionStorage.getItem('username');\n context.teamId = context.params._id.substring(1);\n context.isOnTeam = sessionStorage.getItem('teamId') !== \"undefined\"\n && sessionStorage.getItem('teamId') === context.teamId;\n\n auth.getUsers()\n .then(resp => {\n context.members = resp.filter((key) => key.teamId === context.teamId);\n\n this.loadPartials({\n header: './templates/common/header.hbs',\n footer: './templates/common/footer.hbs',\n teamMember: './templates/catalog/teamMember.hbs',\n teamControls: './templates/catalog/teamControls.hbs'\n }).then(function () {\n teamsService.loadTeamDetails(context.teamId)\n .then(res => {\n context.isAuthor = sessionStorage.getItem('userId') === res._acl.creator;\n context.name = res.name;\n context.comment = res.comment;\n\n this.partial('./templates/catalog/details.hbs');\n }).catch(auth.handleError);\n });\n\n }).catch(auth.handleError);\n }", "function showDetail() {\n showModal('detail.html');\n}", "function showMyTeamDetails(context) {\n const myTeamId = sessionStorage.getItem('teamId');\n context.redirect(`#/catalog/:${myTeamId}`);\n }", "function getTeam() {\n $http.get('/assets/json/people.json')\n .success(function (data) {\n $scope.team = data;\n });\n }", "function getTeam() {\n teamDataService.getTeam(vm.team.id)\n .then(function (data) {\n vm.team = data;\n });\n }", "function viewDetail() {\n if(typeof($scope.detail) == 'function') {\n $scope.detail();\n }\n }", "TeamViewInSpace (baseUrl,username,spacename,teamname){\n browser.get(baseUrl + username + \"/\" + spacename +\"/teams/\" + teamname);\n }", "function getTeamDetail() {\n return new Promise((resolve, reject) => {\n let id = localStorage.getItem(\"team_id\") || null;\n if (!id) loadPage(\"home\");\n\n if (\"caches\" in window) {\n caches.match(`${BASE_URL}teams/${id}`).then((res) => {\n if (res) {\n res.json().then((data) => {\n renderSingleCard(data);\n resolve(data);\n });\n }\n });\n }\n\n fetch(`${BASE_URL}teams/${id}`, header)\n .then(status)\n .then(json)\n .then((data) => {\n renderSingleCard(data);\n\n resolve(data);\n })\n .catch(error);\n });\n}", "function teamDetails(msg, done, team) {\n const snippets = robot.brain.get(team);\n if (!Array.isArray(snippets)) {\n return teamDoesNotExist(msg, team, done)\n }\n\n msg.send(`Details for ${team}:\\n${snippets.map(snippet => ` - ${snippet}`).join('\\n')}`, done);\n }", "function getTeam() {\n // Ambil nilai query parameter (?id=)\n let urlParams = new URLSearchParams(window.location.search);\n let idParam = urlParams.get(\"id\");\n\n fetch(`${base_url}competitions/${idParam}/teams`, {\n headers: {\n 'X-Auth-Token': authToken\n }\n })\n .then(res=>{\n return res.json()\n })\n .then(resjson=>{\n showTeam(resjson)\n })\n}", "function handleClick(index) {\n control.openDetailView(\n data.getTableId(),\n index,\n 'tables/femaleClients/html/femaleClients_detail.html');\n}", "function viewCaseworker(caseworker_id) {\n console.log('view details clicked ', caseworker_id);\n $http.get('/caseworkers/' + caseworker_id).then(function(response) {\n caseworker.selected = response.data;\n console.log('Caseworker record back from db: ', caseworker.selected);\n });\n }", "function viewIssue() {\n getTicketDetails(\n function (data) {\n client.interface.trigger(\"showModal\", {\n title: \"Github Issue Details\",\n template: \"./modal/modal.html\",\n data: data.ticket,\n });\n },\n function (error) {\n console.error(error);\n }\n );\n}", "@route('/studios/:studio.id/movies/:id') get ItemWithStudioPage() {\n return function () {\n return `Movie #${this.id}`;\n };\n }", "function openDetail () {\n\t\t\t$state.go('about.detail');\n\t\t}", "async details({ params, view }) {\n const post = await Post.find(params.id)\n //redirecting to the details page\n return view.render('posts.details', {\n post: post\n })\n }", "function showTargetView(data){\n\t\tvar view = this;\n\t\tvar $e = view.$el;\n\t\tvar reportType = view.reportType;\n\t\tvar mailingSetName = view.mailingSetName;\n\t\tvar $content = $e.find(\".viewEmailsPicker-content\");\n\t\t$content.empty();\n\t\t$content.html(data.data);\n\t}", "async show({ params, request, response, view }) {\n }", "async show({ params, request, response, view }) {}", "function showProjectDetails( urlObj, options )\n{\n var pid = urlObj.hash.replace( /.*pid=/, \"\" ),\n\n // The pages we use to display our content are already in\n // the DOM. The id of the page we are going to write our\n // content into is specified in the hash before the '?'.\n pageSelector = urlObj.hash.replace( /\\?.*$/, \"\" );\n pw.projects.getProjectEx(\n {'pid' : pid},\n //success callback\n function(myProject){\n // Get the page we are going to dump our content into.\n var $page = $( pageSelector );\n pw.activeProject = pid;\n pw.activeProjectObject = myProject;\n renderProjectDetails(myProject);\n\t\t\trenderAssetsList(myProject);\n renderProjectDetailsScripts();\n\n // Pages are lazily enhanced. We call page() on the page\n // element to make sure it is always enhanced before we\n // attempt to enhance the listview markup we just injected.\n // Subsequent calls to page() are ignored since a page/widget\n // can only be enhanced once.\n $page.page();\n\n // We don't want the data-url of the page we just modified\n // to be the url that shows up in the browser's location field,\n // so set the dataUrl option to the URL for the category\n // we just loaded.\n options.dataUrl = urlObj.href;\n\n // Now call changePage() and tell it to switch to\n // the page we just modified.\n $.mobile.changePage( $page, options );\n\n //console.log(\"OPTIONS: \" + JSON.stringify(options));\n },function(e){\n console.log(\"ERROR in showProjectDetails: {0}\".format(JSON.stringify(e)));\n }\n );\n}", "function viewProject(elmnt){\n var title = projects[elmnt.id].title;\n var desc = projects[elmnt.id].desc;\n var date = projects[elmnt.id].date;\n var products = projects[elmnt.id].products;\n displayModal(title, desc, date, products, elmnt.id);\n}", "async viewProjDetails({\n view,\n params\n }) {\n const service = await Service.find(params.id)\n return view.render('/services/serviceview', {\n service: service.toJSON()\n })\n }", "function getTeam(teamId) {\n var teamURL = selectTeam(teamId);\n \n // Displays basic team records \n function populateScreenTeam (teamObj){\n let team = \"<p>\" + teamObj.name + \"</p>\";\n let wins = \"<p style='color: #2b9642'>\";\n wins += teamObj.wins;\n wins += \" wins</p>\";\n let losses = \"<p style='color: #7a212c'>\";\n losses += teamObj.losses;\n losses += \" losses</p>\";\n $('#about-team').append(team);\n $('#about-team').append(wins);\n $('#about-team').append(losses);\n }\n \n // If sessions contains a team, we use that, otherwise we ajax call the team object\n if (sessionStorage.getItem(teamURL) != null && sessionStorage.getItem(teamURL) !== undefined) {\n var storedTeam = sessionStorage.getItem(teamURL);\n var data = $.parseJSON(storedTeam);\n setTimeout(populateScreenTeam(data), 2000);\n } else {\n $.ajax({\n url: teamURL,\n method: 'GET',\n success: function(result) {\n sessionStorage.setItem(teamURL, JSON.stringify(result));\n populateScreenTeam(result);\n }\n });\n }\n }", "function detailPage(ind){\n displayDetails(formatDetails('detail', json.list[ind]));\n // console.log(json.list[ind]);\n document.getElementById(\"homepage\").style.display = \"none\";\n document.getElementById(\"detailpage\").style.display = \"block\";\n }", "function GrouponDetailView() {\n BaseView.apply(this, arguments);\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "async show ({ params, request, response, view }) {\n }", "function populateScreenTeam (teamObj){\n let team = \"<p>\" + teamObj.name + \"</p>\";\n let wins = \"<p style='color: #2b9642'>\";\n wins += teamObj.wins;\n wins += \" wins</p>\";\n let losses = \"<p style='color: #7a212c'>\";\n losses += teamObj.losses;\n losses += \" losses</p>\";\n $('#about-team').append(team);\n $('#about-team').append(wins);\n $('#about-team').append(losses);\n }", "function getLeagueTeams(req, rsp,next) {\n debug(\"/teams for:\"+req.params.id);\n leaguesModel.getTeams(parseInt(req.params.id),(err, fixtures) => {\n if (err!==undefined) debug(\"/league read ERROR:\"+err);\n debug(\"/teams read:\"+fixtures[0]);\n rsp.render(\"teams\", {title: fixtures[0], fixtures: fixtures.fixtures })\n });\n}", "function showDetailViewTab()\r\n{\r\n\r\n\tvar open=getTabIndexByTitle('View Detail');\r\n\tif (open<0)// if the tab is not open yet\r\n\t{\t\r\n\t\tvar aTab= createDetailViewTab('tabPanel','View Detail' , true);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tshowTab('tabPanel',open[1]);\r\n\t}\r\n}", "function draftTeamInfo(id) {\n\tif (draft.infoTeamRow) {\n\t\tdraft.infoTeamRow.remove();\n\t\tdraft.infoTeamRow = null;\n\n\t\t// Click a second time to close\n\t\tif (id == draft.infoTeamId) {\n\t\t\tdraft.infoTeamId = -1;\n\t\t\treturn;\n\t\t}\n\t}\n\n\tvar teamIdx = 0;\n\tdraft.teams.forEach(function(v, k) {\n\t\tif (v.id == id) {\n\t\t\tteamIdx = k;\n\t\t}\n\t});\n\n\tdraft.infoTeamId = id;\n\tdust.render('expandedDraftTeam', draft.teams[teamIdx], function(err, out) {\n\t\t$('tr[data-teamid=\"'+id+'\"]').after(out);\n\t\tdraft.infoTeamRow = $('#expandedTeamInfo');\n\t});\n}", "async getTeam () {\n\t\tthis.team = await this.data.teams.getById(this.payload.teamId);\n\t}", "viewAllTeamInSpace (baseUrl,username,spacename){\n browser.get(baseUrl + username + \"/\" + spacename +\"/teams\");\n }", "function getTeam(req, res) {\n Team.findById(req.params.id, (err, team) => {\n if (err) res.send(err);\n //If no errors, send it back to the client\n res.json(team);\n });\n}", "function selectRow(e) {\n\tvar index = e.index;\n\tvar team = e.rowData.team;\t\n\n\t//init teamdetail window\n\tvar detailsWin = Ti.UI.createWindow({\n\t\turl: 'teamdetails.js',\n\t\tteam: team,\n\t\ttitle: team.name\n\t});\n\t\t\n\tif (Titanium.Platform.name == 'android') {\n\t\tdetailsWin.open({modal: true});\n\t}\n\telse {\n\t\twin._navGroup.open(detailsWin);\n\t}\n}", "function GetFlightULDSTACKDetails() {\n ShowIndexView(\"divStackDetail\", \"Services/FlightControl/FlightControlService.svc/GetFlightTransGridData/FLIGHTCONTROL/FlightControl/ULDSTACK/\" + CurrentFlightSno + \"/STACK\");\n}", "function getDetailTeams() {\n\n isLoading()\n return new Promise(function (resolve, reject) {\n\n // Get parameter query from id\n let urlParams = new URLSearchParams(window.location.search);\n let idParam = urlParams.get(\"id\");\n\n if (\"caches\" in window) {\n caches.match(BASE_URL + \"teams/\" + idParam).then(function (response) {\n if (response) {\n response.json().then(function (data) {\n showDetailTeam(data);\n resolve(data);\n })\n }\n })\n }\n\n fetchAPI(BASE_URL + \"teams/\" + idParam)\n .then(data => {\n showDetailTeam(data);\n resolve(data);\n })\n .catch(err => {\n error(err)\n showError()\n })\n });\n}", "function viewHtml() {\n var entry = ProjectManager.getSelectedItem();\n if (entry === undefined) {\n entry = DocumentManager.getCurrentDocument().file;\n }\n var path = entry.fullPath;\n var w = window.open(path);\n w.focus();\n }", "function activate() {\n vm.team.id = +$routeParams.teamId || 0;\n vm.assessmentId = +$routeParams.assessmentId;\n if (vm.team.id > 0) {\n getTeam(vm.team.id);\n }\n }", "function showFlow() {\r\n\t\tif (issueheadPanel.selModel.hasSelection()) {\r\n\t\t\tvar record = issueheadPanel.getSelectionModel().getSelected();\r\n\t\t\tvar entryId = record.get(\"workFlowNo\");\r\n\t\t\tif (entryId == null) {\r\n\t\t\t\tExt.Msg.alert(\"提示\", \"流程未启动!\");\r\n\t\t\t} else {\r\n\t\t\t\tvar url = application_base_path + \"workflow/manager/show/show.jsp?entryId=\"\r\n\t\t\t\t\t\t+ entryId;\r\n\r\n\t\t\t\twindow.open(url);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tExt.Msg.alert(\"提示\", \"请先选择要查看的记录!\");\r\n\t\t}\r\n\t}", "function detail(id){\n\tvar kelas ='.detail-'+id;\n\tvar data = $(kelas).data('id');\n\tvar links;\n\n\t$('h3.semibold').html(data.judulMateri);\n\t\t// links = '<?=base_url();?>assets/video/' + data.namaFile;\n\t\t$('#isicontent').html(data.isiMateri); \n\t\t$('.detail_materi').modal('show');\n\n\n\t}", "function get_teams() {\n $.ajax({\n type: \"GET\",\n url: '/datawake/plugin/teams',\n dataType: 'json',\n success: function (response) {\n console.log(\"GOT TEAMS\")\n console.log(response)\n $scope.teams = response\n $scope.$apply()\n },\n error: function (jqxhr, textStatus, reason) {\n console.error(textStatus + \" \" + reason);\n }\n\n });\n }", "function viewDetail(row, attribute) {\n location.href = configs.path.gbActivity + '/' + row.id;\n }", "function renderTeam() {\n\tconst htmlPageContent = [];\n\tconst htmlPageHead = `\n\t<!DOCTYPE html>\n<html lang=\"en\">\n\t<head>\n\t\t<meta charset=\"UTF-8\" />\n\t\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n\t\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n\t\t<link\n\t\t\thref=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\"\n\t\t\trel=\"stylesheet\"\n\t\t\tintegrity=\"sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl\"\n\t\t\tcrossorigin=\"anonymous\"\n\t\t/>\n\t\t<link rel=\"stylesheet\" href=\"./style.css\" />\n\t\t<title>Team</title>\n\t</head>\n\n\t<body>\n\t\t<div class=\"container\">\n\t\t\t<div class=\"jumbotron text-center\">\n\t\t\t\t<div class=\"container\">\n\t\t\t\t\t<h1 class=\"display-2\">Our Team</h1>\n\t\t\t\t\t<h2>\"Role call!\"</h2>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n \n\t\t<div class=\"container\">\n\t\t\t<div class=\"row p-4 justify-content-center\">\n\t\t\t\t<div class=\"row p-3 d-flex justify-content-between\">`\n\n\thtmlPageContent.push(htmlPageHead);\n\n\tfor (let i = 0; i < employees.length; i++) {\n\t\tlet card = `\n\t\t\t\t\t<div class=\"card\" style=\"width: 19rem\">\n\t\t\t\t\t\t<div class=\"card-body\">\n\t\t\t\t\t\t\t<h3 class=\"card-title\">${employees[i].name}</h3>\n\t\t\t\t\t\t\t<h5 class=\"card-subtitle\">${employees[i].role}</h5>\n\t\t\t\t\t\t\t<ul class=\"list-group list-group-flush\">\n\t\t\t\t\t\t\t\t<li class=\"list-group-item\">\n\t\t\t\t\t\t\t\t\t<strong>ID:</strong> ${employees[i].id}\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t<li class=\"list-group-item\">\n\t\t\t\t\t\t\t\t\t<strong>Email:</strong>\n\t\t\t\t\t\t\t\t<a href=\"mailto:${employees[i].email}\"\n\t\t\t\t\t\t\t\t\t>${employees[i].email}</a\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t</li>`;\n\t\t\tif (employees[i].officeNumber) {\n\t\t\t\tcard += `\n\t\t\t\t\t\t\t\t<li class=\"list-group-item\">\n\t\t\t\t\t\t\t\t\t<strong>Office Number: </strong>${employees[i].officeNumber}\n\t\t\t\t\t\t\t\t</li>`;\n\t\t\t}if (employees[i].gitHub) {\n\t\t\t\tcard += `\n\t\t\t\t\t\t\t\t<li class=\"list-group-item\">\n\t\t\t\t\t\t\t\t\t<strong>GitHub:</strong> <a href=\"https://github.com/${employees[i].gitHub}\">${employees[i].gitHub}</a>\n\t\t\t\t\t\t\t\t</li>`;\n\t\t\t}if (employees[i].school) {\n\t\t\tcard += `\n\t\t\t\t\t\t\t\t<li class=\"list-group-item\">\n\t\t\t\t\t\t\t\t\t<strong>School:</strong> ${employees[i].school}\n\t\t\t\t\t\t\t\t</li>`;\n\t\t\t}\n\t\t\tcard += `\n\t\t\t\t\t\t\t</ul>\t\t\t\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>`;\n\n\t\thtmlPageContent.push(card);\n\t}\n\n\t\n\tconst htmlFoot = `\n\t\t\t\t</div >\n\t\t\t</div >\n \t\t</div >\n\t \n\t\t<script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/js/\tbootstrap.bundle.min.js\"\n integrity=\"sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0\"\n crossorigin=\"anonymous\"></script>\n </body>\n \n</html>`;\n\thtmlPageContent.push(htmlFoot);\n\n\tfs.writeFile('dist/index.html', htmlPageContent.join(''), (err) =>\n\t\terr ? console.log(err) : console.log('Successfully created index.html!')\n\t);\n}", "function TeamsListPage() {\n this.open = function() {\n browser.get('/');\n };\n\n this.getTeamsListRows = function() {\n return element.all(by.repeater('team in teamListCtrl.teams'));\n };\n\n this.getRankForRow = function(row) {\n return element(\n by.repeater('team in teamListCtrl.teams')\n .row(row).column('team.rank'));\n };\n\n this.getNameForRow = function(row) {\n return element(\n by.repeater('team in teamListCtrl.teams')\n .row(row).column('team.name'));\n };\n\n this.isLoginLinkVisible = function() {\n return element(by.css('.login-link')).isDisplayed();\n };\n\n this.isLogoutLinkVisible = function() {\n return element(by.css('.logout-link')).isDisplayed();\n };\n}", "function showBuildingDetails(title,attributes){\n \tvar controller = View.controllers.get(\"abRplmPfadminGpdGisCtrl\");\n\tvar blId = title;\n\tcontroller.openDetailsPopUp(blId);\n}", "function showData(list) {\n // Header is set to the team name\n $(\"#teamName\").text(list.TeamName);\n\n // Create card for manager\n let managerCard = createManagerCard(list);\n $(\"#team-details\").append(managerCard);\n\n // Create card for team 'rules'\n let requirementCard = createRequirementCard(list);\n $(\"#team-details\").append(requirementCard);\n\n // Create card for members\n if(list.Members.length == 0) {\n $(\"#team-members\").append($(\"<p>\")\n .text(\"There are currently no team members registered!\")\n .prop(\"class\", \"white\"));\n }\n else {\n for(let i = 0; i < list.Members.length; i++) {\n let memberCard = createMemberCard(list.Members[i]);\n $(\"#team-members\").append(memberCard);\n }\n }\n}", "productDetailView(req, res) {\n res.render(\"pages/products/product-details\", {\n title: \"AD - Product Name\"\n })\n }", "function makeDetailHtml(data){\r\n var count = 0;\r\n var i = 0;\r\n var html = '<div style=\"display: none; \" class=\"detail_info\" id=\"detail_info_' + data.index + '\">'\r\n // id\r\n html += '<p class=\"detail_id\">id: DOID:' + data.info.id + '</p>';\r\n // name\r\n html += '<p class=\"detail_name\">name: ' + data.info.name + '</p>';\r\n //def\r\n if (data.info.definition != null){\r\n // html += '<p class=\"detail_def\">def: ' + data.info.definition + '</p>';\r\n var s=data.info.definition;\r\n if(s.match('url')){\r\n var t1=s.substring(s.lastIndexOf('[')+1,s.lastIndexOf(']'));\r\n var t2=s.substring(0,s.lastIndexOf('['));\r\n var txt=t2.substring(1,t2.length-2);\r\n html += '<p class=\"detail_def\">def: '+ txt+'url:';\r\n if(t1.match(',')){\r\n var t=t1.split(',');\r\n count=t.length;\r\n for(i=0;i < count;i++){\r\n if(t[i].match('http')){\r\n html+='<a href=\"'+makeUrl(t[i])+ '\" target=\"blank\" style=\"text-decoration:underline;\">'+makeUrl(t[i])+'</a>'+(i==(count-1)? '&nbsp;':'&nbsp;|&nbsp;'); \r\n }\r\n } \r\n }else{\r\n html +='<a href=\"'+makeUrl(t1)+ '\" target=\"blank\" style=\"text-decoration:underline;\">'+makeUrl(t1)+'</a>';\r\n }\r\n html+='</p>';\r\n }\r\n } \r\n // alt_id\r\n if (data.info.alt_ids != null){\r\n count = data.info.alt_ids.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_alt_id\">alt_id: DOID:' + data.info.alt_ids[i].alt_id + '</p>';\r\n }\r\n } \r\n // subset\r\n if (data.info.subsets != null){\r\n count = data.info.subsets.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_subset\">subset: ' + data.info.subsets[i].subset + '</p>';\r\n }\r\n }\r\n // synonym\r\n if (data.info.synonyms != null){\r\n count = data.info.synonyms.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_synonym\">synonym: ' + data.info.synonyms[i].synonym + '</p>';\r\n }\r\n } \r\n // xref\r\n if (data.info.xrefs != null){\r\n count = data.info.xrefs.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_xref\">xref: ' + data.info.xrefs[i].xref_name + ':' + data.info.xrefs[i].xref_value + '</p>';\r\n }\r\n } \r\n // relations\r\n if (data.info.relations != null){\r\n count = data.info.relations.length;\r\n for (i = 0; i < count; i++){\r\n html += '<p class=\"detail_relation\">' + data.info.relations[i].relation + ': ' + data.info.relations[i].term2_id + '</p>';\r\n }\r\n }\r\n html += '</div>';\r\n return html;\r\n}", "function displayProject(callbackFn) {\n // Get current url\n const url = window.location.search;\n // Get the id of the selected project from the url\n itemId = getParamValFromUrl(url, 'id');\n if (!itemId) {\n alert('Project id is missing');\n return;\n }\n getProjectInfo(callbackFn, itemId);\n}", "function loadDetailedView(prop) {\n current_prop = prop;\n enablePropertyOptions();\n $(\"#mortgagebtn\").unbind();\n var property = prop.card;\n $(\"#propDetails\").html(\" \");\n var detailedView = $(\"<div>\").addClass(\"propertyCard\");\n var titleDeed = $(\"<div>\").addClass(\"titleDeed\");\n var mortgaged = $(\"<div>\").addClass(\"mortgaged\").html(\"MORTGAGED\");\n if (prop.mortgaged) mortgaged.show();\n titleDeed.append(mortgaged);\n var titleTextColor = \"black\";\n if (property.color === \"blue\" || property.color === \"purple\") {\n titleTextColor = \"white\";\n }\n var details;\n var costTable;\n if (property.color === \"rr\") { // handle railroad\n titleDeed.append($(\"<div>\").addClass(\"railroadImg\"));\n titleDeed.append($(\"<div>\").addClass(\"propertyName\")\n .addClass(\"railroad\")\n .append($(\"<h1>\").html(property.title))\n .css(\"color\", titleTextColor));\n details = $(\"<div>\").addClass(\"details\")\n .addClass(\"railroad\");\n details.append($(\"<div>\").addClass(\"rentDisplay\")\n .html(property.rent + \".\"));\n var houseCosts = $(\"<div>\").addClass(\"houseCosts\");\n\n costTable = $(\"<table>\").addClass(\"railroad\");\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"If 2 R.R.'s are owned\"),\n $(\"<td>\").html(\"$ \" + property.tworr + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"If 3 &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\"\"),\n $(\"<td>\").html(property.threerr + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"If 4 &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\" &nbsp; &nbsp; \\\"\"),\n $(\"<td>\").html(property.fourrr + \".\")));\n houseCosts.append(costTable);\n\n details.append(houseCosts);\n details.addClass(\"railroad\");\n details.append($(\"<div>\").addClass(\"mortgage\")\n .html(property.mortgage + \".\"));\n details.append($(\"<div>\").addClass(\"copyright\")\n .html(\"&copy;1935 Hasbro, Inc.\"));\n\n } else if (property.color === \"utility\") { // duquesne light or PWSA\n if (property.title.indexOf(\"Light\") != -1) {\n titleDeed.append($(\"<div>\").addClass(\"electricImg\"));\n } else {\n titleDeed.append($(\"<div>\").addClass(\"waterImg\"));\n }\n\n titleDeed.append($(\"<div>\").addClass(\"propertyName\")\n .addClass(\"utility\")\n .append($(\"<h1>\").html(property.title))\n .css(\"color\", titleTextColor));\n details = $(\"<div>\").addClass(\"details\")\n .addClass(\"utility\");\n var houseCosts = $(\"<div>\").addClass(\"houseCosts\");\n\n costTable = $(\"<div>\").addClass(\"utilityCostTable\");\n costTable.append($(\"<span>\").addClass(\"utilityText\")\n .html(\"If one \\\"Utility\\\" is owned rent is 4 times amount shown on dice.\"));\n costTable.append($(\"<span>\").addClass(\"utilityText\")\n .html(\"If both \\\"Utilities\\\" are owned rent is 10 times amount shown on dice.\"));\n houseCosts.append(costTable);\n\n details.append(houseCosts);\n details.append($(\"<div>\").addClass(\"mortgage\")\n .html(property.mortgage + \".\"));\n details.append($(\"<div>\").addClass(\"copyright\")\n .html(\"&copy;1935 Hasbro, Inc.\"));\n\n } else { // handle regular property\n titleDeed.append($(\"<div>\").addClass(\"propertyName\")\n .addClass(property.color)\n .append($(\"<h1>\").html(property.title))\n .css(\"color\", titleTextColor));\n details = $(\"<div>\").addClass(\"details\");\n details.append($(\"<div>\").addClass(\"rentDisplay\")\n .html(property.rent + \".\"));\n var houseCosts = $(\"<div>\").addClass(\"houseCosts\");\n\n var costTable = $(\"<table>\");\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 1 House\"),\n $(\"<td>\").html(\"$ \" + property.onehouse + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 2 Houses\"),\n $(\"<td>\").html(property.twohouse + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 3 Houses\"),\n $(\"<td>\").html(property.threehouse + \".\")));\n costTable.append($(\"<tr>\").append($(\"<td>\").html(\"With 4 Houses\"),\n $(\"<td>\").html(property.fourhouse + \".\")));\n houseCosts.append(costTable);\n details.append(houseCosts);\n\n details.append($(\"<div>\").addClass(\"hotel\")\n .html(property.hotel + \".\"));\n details.append($(\"<div>\").addClass(\"mortgage\")\n .html(property.mortgage + \".\"));\n details.append($(\"<div>\").addClass(\"houses\")\n .html(property.housecost + \".\"));\n details.append($(\"<div>\").addClass(\"hotelCost\")\n .html(property.hotelcost + \".\"));\n details.append($(\"<div>\").addClass(\"monopoly\")\n .html(\"If a player owns ALL the Lots of any Color-Group, the rent is Doubled on Unimproved Lots in that group.\"));\n details.append($(\"<div>\").addClass(\"copyright\")\n .html(\"&copy;1935 Hasbro, Inc.\"));\n }\n\n\n titleDeed.append(details);\n detailedView.append(titleDeed);\n detailedView.hide();\n $(\"#propDetails\").append(detailedView);\n var widthPercent = (document.documentElement.clientWidth * 0.40) / 440;\n var heightPercent = (document.documentElement.clientHeight) / 520;\n var percentScale = (widthPercent > heightPercent) ? heightPercent : widthPercent;\n $(\"#propDetails .propertyCard\").css(\"-webkit-transform\", \"scale(\" + percentScale + \")\");\n $(\"#propDetails .propertyCard\").css(\"transform\", \"scale(\" + percentScale + \")\");\n $(\"#propDetails .propertyCard\").css(\"-ms-transform\", \"scale(\" + percentScale + \")\");\n\n detailedView.show();\n setupMortgageBtn(prop);\n setupHouseButtons();\n\n // Send currently viewed property to the server so the board can update\n socket.emit('inspectProperty', {\n fbid: window.fbid,\n property: propertyDatabase[property.title].id\n });\n}", "async show(matches) {\n // URL-Parameter auswerten\n this._recordId = matches[1];\n this._data = await this._app.database.selectById(this._recordId, \"restaurants\");\n\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-detail/page-detail.html\");\n let css = await fetch(\"page-detail/page-detail.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n let bewertung = await this.bewertungBerechnen();\n let pageDom = this._processTemplate(html, bewertung);\n\n this._app.setPageTitle(` ${this._data.name}`, {isSubPage: true});\n this._app.setPageCss(css);\n this._app.setPageHeader(pageDom.querySelector(\"header\"));\n this._app.setPageContent(pageDom.querySelector(\"main\"));\n }", "function viewAgency(agency_id) {\n console.log('view details clicked ', agency_id);\n $http.get('/agencies/' + agency_id).then(function(response) {\n agency.selected = response.data;\n console.log('Agency record back from db: ', agency.selected);\n });\n }", "handleViewDetailsClick() {\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n recordId: this.location.Id,\n objectApiName: LOCATION_OBJECT.objectApiName,\n actionName: 'view'\n }\n });\n }", "function showDetails() {\n $(this).closest('.panel-body').find('.projInfo').slideDown();\n }", "function renderSingleMoviePage(details) {\n\t\tvar page = $('.single-movie');\n\t\tvar container = $('.preview-large');\n\n\t\t// Show the page.\n\t\tpage.addClass('visible');\n\t}", "function ProjectDetailPage() {\n const params = useParams();\n const projectParam = params.id;\n\n return (\n <DetailPage name={projectParam} infoSource={Projects} header={ProjectDetailHeader} \n footer={ProjectDetailFooter} sections={projectSections} />\n )\n}", "function listPeopleView(targetid, people) {\n\n apply_template(targetid,\"people-list-template\", {'people': people});\n\n}", "function viewAllTeams(){\n console.log( \"inside viewAllTeams\");\n $('#pastOutputDiv').empty();\n getTeams();\n }//ends viewAllTeams", "function renderSingleTeamPage(team_i, data) {\n // debugger;\n var players = [];\n //first mypromise function will execute...\n myPromise().then(function () {\n var info = $('.team-info .jumbotron .team-display');\n var list = $('.team-info .player-list');\n $.each(data, function (key, value) {\n if (value.id == team_i) {\n $('.jumbotron').css({\n \"background\": \"url(\" + value.team_bg + \") no-repeat \",\n \"-webkit-background-size\": \"cover\", \"-moz-background-size\": \"cover\",\n \"-o-background-size\": \"cover\", \"background-size\": \"cover\",\n \"padding\": \"8em inherit\", \"opacity\": \"0.2px\"\n });\n info.append(\n \"<li><b>Team Name : <b>\" + value.team_name + \"</li>\" +\n \"<li><b>Team Owner : <b>\" + value.team_owner + \"</li>\" +\n \"<li><b>Team Captain : <b>\" + value.team_captain + \"</li>\" +\n \"<li><b>Team Coach : <b>\" + value.team_coach + \"</li>\" +\n \"<li><b>Team Name : <b>\" + value.team_home_venue + \"</li>\");\n // debugger;\n console.log(value.team_players);\n var theTemplateScript = $(\"#players-template\").html();\n // console.log(theTemplateScript);\n //compile the template\n player = value.team_players;\n var theTemplate = Handlebars.compile(theTemplateScript);\n list.append(theTemplate(value.team_players));\n }\n })\n\n //displays modal view \n list.find('li').on('click', function (e) {\n debugger;\n e.preventDefault();\n var teamIndex = $(this).data('index');\n var list1 = $('.team-info .player ');\n $.each(player, function (k, v) {\n //debugger;\n if (v.id == teamIndex) {\n // debugger\n var theTemplateScript1 = $(\"#Splayer-template\").html();\n // console.log(theTemplateScript);\n //compile the template\n //debugger\n var theTemplate1 = Handlebars.compile(theTemplateScript1);\n //debugger;\n list1.append(theTemplate1(v));\n console.log(v);\n }\n })\n });\n }).catch(function (data) {\n console.log(data);\n })\n\n\n\n\n }", "function getSavedDataTeams() {\n getAll().then(function(data) {\n var dataHTML = \"\";\n data.forEach(function(data) {\n dataHTML += `\n <table>\n <tr id=${data.id}>\n <td><img src=${data.crestUrl.replace(\n /^http:\\/\\//i,\n \"https://\"\n )} style=\"width: 100px;\" alt=\"${data.name}\" /></td>\n <td>${data.shortName}</td>\n <td>\n <a \n class=\"waves-effect light-blue accent-3 btn-small\" \n href=\"./detail_team.html?id=${data.id}&saved=true\"\n >\n OPEN\n </a>\n <a \n class=\"waves-effect red darken-1 btn-small\" \n onclick=\"deleteBtn(${data.id})\">\n <i class=\"material-icons\">delete</i>\n </a>\n </td>\n </tr>\n </table>\n `;\n });\n // Sisipkan komponen card ke dalam elemen dengan id #body-content\n document.getElementById(\"body-content\").innerHTML = dataHTML;\n });\n}", "function showDetails(){\n\tView.controllers.get('visitorController')['editTag']=true;\n var grid = View.panels.get('visitorsGrid');\n var selectedRow = grid.rows[grid.selectedRowIndex];\n var visitorId = selectedRow[\"visitors.visitor_id\"];\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"visitors.visitor_id\", visitorId, \"=\");\n View.panels.get('visitorsForm').refresh(restriction,false);\n}", "function ShowDetails(uid) {\n $.ajax({\n type: \"Get\",\n url: \"/ControlPanel/Details\",\n data: { id: uid },\n success: function (response) {\n $(\"#details #Details_Body\").html(response);\n $(\".modal-header\").html(\"User Details\");\n $(\"#details\").modal(\"show\");\n }\n })\n}", "function queryExpertDetail(vm , expertId){\r\n vm.expert = [];\r\n\t\t\tvm.id = expertId;\r\n getExpertById(vm.id, function (data) {\r\n vm.expert = data;\r\n $(\"#queryExportDetailsS\").kendoWindow({\r\n width: \"80%\",\r\n height: \"620px\",\r\n title: \"专家详细信息\",\r\n visible: false,\r\n modal: true,\r\n open:function(){\r\n $(\"#expertPhotoSrc\").attr(\"src\", rootPath + \"/expert/transportImg?expertId=\" + vm.expert.expertID + \"&t=\" + Math.random());\r\n //tab标签\r\n $(\"#busi_baseinfoS\").addClass(\"active\").addClass(\"in\").show(500);\r\n\r\n $('#myTabExpertS li').click(function (e) {\r\n $(\"#busi_baseinfoS\").removeClass(\"active\").removeClass(\"in\");\r\n $(\"#busi_workplanS\").removeClass(\"active\").removeClass(\"in\");\r\n var aObj = $(\"a\", this);\r\n e.preventDefault();\r\n aObj.tab('show');\r\n var showDiv = aObj.attr(\"for-div\");\r\n // $(\"#\" + showDiv).removeClass(\"active\").removeClass(\"in\");\r\n $(\"#\" + showDiv).addClass(\"active\").addClass(\"in\").show(500);\r\n })\r\n //评审过项目\r\n vm.reviewProjectList2 = [];\r\n reviewProjectGrid(vm.id,function(data){\r\n vm.isLoading = false;\r\n if(data && data.length > 0){\r\n vm.reviewProjectList2 = data;\r\n vm.noData = false;\r\n }else{\r\n vm.noData = true;\r\n }\r\n\r\n });\r\n },\r\n closable: true,\r\n actions: [\"Pin\", \"Minimize\", \"Maximize\", \"Close\"]\r\n }).data(\"kendoWindow\").center().open();\r\n });\r\n\t\t}", "function gotoeditteamsFunction() {\n var x = document.getElementById(\"addteamshtml\");\n var i = document.getElementById(\"editteamshtml\");\n var a = document.getElementById(\"homepagehtml\");\n x.style.display = \"none\";\n i.style.display = \"block\";\n a.style.display = \"none\"\n }", "function viewDetails(appointment_id) {\n console.log('view details clicked ', appointment_id);\n $http.get('/appointments/' + appointment_id).then(function(response) {\n appointment.selected = response.data;\n console.log('Apt & Client details back from db: ', appointment.selected);\n });\n }", "function viewDetails(object) {\n if (target.value == 'person') {\n $('#person-edit-model').modal('show');\n setEditValuesPerson(object.target.id);\n } else if (target.value == 'company') {\n $('#company-edit-model').modal('show');\n setEditValuesCompany(object.target.id);\n } else {\n return;\n }\n}", "function renderSearcheValues(req,res) {\n let teamName=req.body.teamname;\n let URL=`https://www.thesportsdb.com/api/v1/json/1/searchteams.php?t=${teamName}`;\n superagent.get(URL)\n .then(data=>{\n\n let arrofTeams=data.body.teams.map(val=>{\n\n let newData= new Team(val);\n\n return newData;\n });\n res.render('index',{teams:arrofTeams});\n });\n\n}", "function fnTeacherTimeTableSummaryDetail() {\n\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\t// Specific Screen Scope Starts\n\t$scope.teacherName = \"\";\n\t$scope.teacherID = \"\";\n\t$scope.authStat = \"\";\n\t\n\t$scope.teacherNamereadOnly = true;\n\t$scope.teacherIDreadOnly = true;\n\t$scope.authStatreadOnly = true;\n\t$scope.recordStatreadOnly = true;\n\t$scope.mvwAddDeteleDisable = true; //Multiple View\n\t// Screen Specific Scope Ends\n\t// Generic Field starts\n\t$scope.operation = 'View';\n\t$scope.mastershow = true;\n\t$scope.detailshow = false;\n\t$scope.searchShow = false;\n\t$scope.selectedIndex = 0;\n\t// Generic Field Ends\t\n\tvar lscreenKeyObject = new Object();\n\tlscreenKeyObject.teacherID = $scope.TeacherTimeTableSummaryTable[$scope.selectedIndex].teacherID;\n\n\tfninvokeDetailScreen('TeacherTimeTable', lscreenKeyObject, $scope);\n\n\treturn true;\n}", "function setupOurteamPage() {\n\t$('body').on('click', '.short-text', function() {\n\t\t$(this).hide();\n\t\t$(this).siblings('.full-text').removeClass('hide');\n\t\t$.get($(this).siblings('.short-text-url').val());\n\t});\n}", "function showDetails(gathdataId,projectpath) {\n\thideElements('memberLayer');\n\tshowElements('detailLayer','blanket');\n\t\n\tvar x = document.getElementById('detailLayer');\n\tAssignPosition(x,650);\n\tvar url = projectpath+'observation/show.do?doDetail&gathdataId='+gathdataId+'&panel';\n\tvar panel = '<div id=\"detailContent\"></div>';\n\t\n\tvar closelink = \"<div class='closelink'><a href='javascript:hideElements(\\\"detailLayer\\\",\\\"blanket\\\");' title=\\\"close\\\">[x]</a></div>\";\n\t\n\tx.innerHTML= closelink + panel;\n\tloadContentSync(url,'detailContent');\n}", "function showTargetView(){\n\t\tvar view = this;\n\t\tvar $e = view.$el;\n\t\tvar reportType = view.reportType;\n\t\tvar mailingSetName = view.mailingSetName;\n\t\tvar $content = $e.find(\".targetPicker-content\");\n\t\t$content.empty();\n\t\t$content.append(smr.render(\"tmpl-targetPicker-mailingView\",{reportType:reportType}));\n\t\tvar $tags = $content.find(\".tags\");\n\t\tvar defaultTag = \"selectTargets\";\n\t\t\t\t\n\t\t// tags\n\t\tvar $selectTargets = $(smr.render(\"tmpl-targetPicker-tag-selectTargets\",{reportType:reportType}));\n\t\t$tags.append($selectTargets);\n\t\t\n\t\t//default show select mailing tag\n\t\tvar setType = smr.getSetAndType(reportType,mailingSetName);\n\t\t\n\t\tshowTag.call(view,defaultTag);\n\t\tregisterViewEvent.call(view);\n\t}", "function uiDetailMovies(res) {\n const detail = document.querySelector(\".modal-body\");\n const titleMovie = document.querySelector(\".title-movie\");\n let detailMovie = showMovieDetail(res);\n detail.innerHTML = detailMovie;\n titleMovie.innerHTML = `${res.Title} (${res.Year})`;\n}", "view(options) {\n return this.wizardInvokeService.openWizard(Object.assign(options, {\n title: this._buildTitle(options.service.entityName, 'wizard_view_caption'),\n isNew: false,\n readonly: true,\n commitOnClose: false\n }));\n }", "async getTeam () {\n\t\tthis.team = this.team || await this.data.teams.getById(this.teamId);\n\t\tif (!this.team) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'team' });\n\t\t}\n\t}", "static generateTableForTeamInfo(teamDetails) {\n if (teamDetails) {\n // Currently, aadGroupId is present but is not defined in the TeamInfo typings\n return `<table border='1'>\n <tr><td> Team id </td><td>${teamDetails.id}</td></tr>\n <tr><td> Team name </td><td>${teamDetails.name}</td></tr>\n <tr><td> AAD group id </td><td>${teamDetails.aadGroupId}</td><tr>\n </table>`;\n }\n return \"\";\n }", "function viewPlace(yelpid) {\n UserService.back.push('user/' + $routeParams['uid']);\n $location.url('/details/' + $routeParams['uid'] + '/'+ yelpid);\n }", "function GetPartialView() {\n this.append(getView(settings.dataSourceurl, \"GET\",));\n }", "function displayTeams() {\n\tfor (var i = 0; i < teams.length; i++) {\n\t\tvar findTeam = document.getElementById(teams[i].id);\n\t\t// Logic for displaying each team's info\n\t\tfindTeam.querySelector(\".team-name\").innerHTML = teams[i].name; // Displays the Team name\n\t\tfindTeam.querySelector(\".logo\").src = \"img/\" + teams[i].id + \".png\";\n\t\tfindTeam.querySelector(\".star\").src = \"img/\" + teams[i].star + \".png\";\n\t\tfor (var u = 0; u < teams[i].facts.length; u++) {\n\t\t\tfindTeam.querySelector(\".facts\").innerHTML += \"<li>\" + teams[i].facts[u] + \"</li>\";\n\t\t}\n\t\tfor (var u = 0; u < teams[i].champs.length; u++) {\n\t\t\tfindTeam.querySelector(\".championships\").innerHTML += \"<li>\" + teams[i].champs[u] + \"</li>\";\n\t\t}\n\t}\n}", "function OrganizationAlipayDetailView() {\n BaseView.apply(this, arguments);\n }", "function buildTeamView() {\n teamViewDom.style.display = 'block';\n var teamMember;\n var generateOrderBtn = teamViewDom.querySelector( 'button' );\n var teamCheckboxListDom = teamViewDom.querySelector( 'ul' );\n\n for ( var i = 0, len = team.length; i < len; i++ ) {\n teamMember = team[i];\n \n // Create list item\n var listItemElement = document.createElement( 'li' );\n listItemElement.innerHTML = '<label><input type=\"checkbox\" name=\"team\" value=\"' + \n teamMember + '\" checked>' + teamMember + '</label>';\n\n teamCheckboxListDom.appendChild( listItemElement );\n }\n\n generateOrderBtn.addEventListener( 'click', showListView );\n}", "get team() {\r\n return new Team(this);\r\n }", "details(context) {\r\n let {\r\n id\r\n } = context.params\r\n\r\n models.Ideas.getSingle(id)\r\n .then((res) => {\r\n let currentIdea = docModifier(res)\r\n context.idea = currentIdea\r\n console.log(context.idea)\r\n //Check for author of cause! \r\n if (currentIdea.uid !== localStorage.getItem('userId')) {\r\n context.isAuthor = false;\r\n } else {\r\n context.isAuthor = true;\r\n }\r\n\r\n extend(context).then(function () {\r\n this.partial('../templates/cause/details.hbs')\r\n })\r\n })\r\n .catch((err) => console.error(err))\r\n }", "function getFavTeamById() {\n let id = localStorage.getItem(\"team_id\");\n\n getById(id).then((team) => {\n renderSingleCard(team);\n });\n}", "function getTeam(idTeam,info,n,cb) {\r\n info.group.teams.forEach((t)=> {\r\n if(t.teamID == idTeam) {\r\n info.team = t.teamName;\r\n }\r\n });\r\n\r\n info.team ? getTeamFixtures(idTeam,cb,processFixtures) : cb(404,null);\r\n\r\n\r\n function processFixtures(fix) {\r\n var lastGames=[], nextGames=[];\r\n var N = n;\r\n var i= 0, j=0;\r\n fix.fixtures.forEach((fix) => {\r\n if(j==N){ return;}\r\n if(fix.status!=\"FINISHED\"){\r\n nextGames[j++] = fix;\r\n }\r\n });\r\n\r\n fix.fixtures.reverse().forEach((fix) => {\r\n if(i==N){ return;}\r\n if(fix.status==\"FINISHED\"){\r\n lastGames[i++] = fix;\r\n }\r\n });\r\n\r\n info.lastGames = lastGames;\r\n info.nextGames = nextGames;\r\n\r\n cb(null,info);\r\n }\r\n}", "function templateShow(req){\n Sunstone.runAction(\"Template.show\",req.request.data[0][0]);\n}", "async getTeam () {\n\t\tthis.team = await this.data.teams.getById(this.tokenInfo.teamId);\n\t\tif (!this.team || this.team.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'team' });\n\t\t}\n\t}", "function viewSpecDetail(row, attribute) {\n $('#myModal').modal('show');\n $scope.productSpecNumber = row.serial;\n getProductSpec($scope.productSpecNumber); \n }", "function ProjectRoomInfoController(){}", "function clickViewBatch ( e ) {\n console.groupCollapsed(\"Batch Details Click\");\n /* retrieve batch id from html markup */\n var batchId = parseInt($(e.currentTarget).attr('data-target'));\n if (isNaN(batchId)) { \n console.error(\"Invalid Batch Id: %s\", batchId);\n return;\n }\n console.debug(\"batch Id: %i\", batchId);\n\n /* retrieve batch object */\n var res = batches.filter(function ( b ) {\n return b.id == batchId;\n });\n console.debug(\"batches found: %i\", res.length);\n /* sanity check. should never happen */\n if (res.length < 1) { console.error(\"No Batches Found On Lookup\"); return; }\n if (res.length > 1) { console.error(\"More Than 1 Batch Found On Lookup\"); return; }\n\n var batch = res[0];\n console.debug(\"batch object: %O\", batch);\n\n /* build info from template */\n var tmp = BATCH_INFO_TEMPLATE;\n tmp = tmp.replace(\"__batchid__\", batch.id);\n tmp = tmp.replace(\"__batchname__\", batch.coursename);\n tmp = tmp.replace(\"__coursesummary__\", batch.summary);\n tmp = tmp.replace(\"__availseats__\", batch.availseats);\n tmp = tmp.replace(\"__maxseats__\", batch.maxseats);\n\n /* update modal */\n $('#btn-register').attr('data-target', batch.id);\n $('#batchDetails .modal-body').html(tmp);\n $('#batchDetails').modal();\n\n console.groupEnd();\n}", "function personView(targetid, person) {\n\n apply_template(targetid,\"person-template\", person);\n}", "function toggleDetails() {\n ToggleComponent('shipment.detailView').toggle();\n }", "function redirectToDetailPage() {\n console.log(\"in global.redirectToDetailPage\");\n // switch the browser to the detail page\n window.location ='detail.html';\n }", "function getTeams() {\n const token = getToken();\n $.ajax({\n url: '/api/teams',\n headers: {\n Authorization: `Bearer ${token}`,\n },\n success: (response) => {\n const payloadData = parseJwt(token);\n $('.username').html(`<p>${payloadData.username}</p>`);\n for (let i = 0; i < response.length; i++) {\n const baseUrl = window.location.origin;\n $('#teams').append(\n `<div class =\"team row row-eq-height\">\n <div class =\"col-md-8\"> ${response[i].name} </div>\n <div class =\"col-md-2\"><a href='${baseUrl}/teamview.html#${response[i]._id}'>View/Edit</a></div>\n <div class =\"col-md-2\"><a class=\"delete\" data-id=\"${response[i]._id}\" href='#'>Delete</a>\n <button class=\"btn btn-info btn-block ${response[i]._id} hidden confirmdelete\" data-id=\"${response[i]._id}\" type=\"submit\">Delete?</button></div>\n </div> `,\n );\n }\n },\n error: () => {\n sessionStorage.removeItem('token');\n window.location.href = 'http://localhost:3000/';\n },\n });\n}", "function openNameDetail(id) {\n Modal.editArtist(id);\n }" ]
[ "0.6645024", "0.6386735", "0.6361377", "0.594887", "0.5912718", "0.58985436", "0.5890389", "0.57476956", "0.5669936", "0.56580126", "0.56304306", "0.5623452", "0.5599954", "0.5529331", "0.5481744", "0.54762566", "0.5456242", "0.5450122", "0.5447499", "0.5447481", "0.54187036", "0.5408716", "0.5408264", "0.5405531", "0.5403181", "0.5377768", "0.5377768", "0.5377768", "0.5377768", "0.5377768", "0.5377768", "0.5377768", "0.535819", "0.5350605", "0.5347263", "0.5343264", "0.5318807", "0.5317293", "0.53107077", "0.5298926", "0.5298166", "0.528295", "0.5282563", "0.52789944", "0.5255589", "0.52551544", "0.5236497", "0.5230602", "0.52303517", "0.52131957", "0.5206154", "0.5193709", "0.5172741", "0.51667434", "0.5163155", "0.51603997", "0.51587105", "0.5157229", "0.51492417", "0.5148731", "0.5135017", "0.5134749", "0.51345235", "0.51111996", "0.5108233", "0.510742", "0.5097105", "0.5086479", "0.5086283", "0.5068887", "0.50666046", "0.50648725", "0.50595915", "0.5053177", "0.5049691", "0.5042703", "0.50395936", "0.5038011", "0.5029773", "0.5029711", "0.5029407", "0.50138164", "0.50122714", "0.49966654", "0.4982471", "0.49793947", "0.4978339", "0.49762776", "0.49569324", "0.4952927", "0.49497575", "0.49474508", "0.49435133", "0.4943", "0.49405476", "0.4932266", "0.49271595", "0.49202892", "0.4918577", "0.49070036" ]
0.66104364
1
Monkey patching filesaver and html2canvas
function monkeyPatch() { return { transform: (code, id) => { const file = path.parse(id).base; // Only one define call per module is allowed by requirejs so // we have to remove calls that other libraries make if (file === 'FileSaver.js') { code = code.replace(/define !== null\) && \(define.amd != null/g, '0') } else if (file === 'html2canvas.js') { code = code.replace(/&&\s+define.amd/g, '&& define.amd && false') } return code } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addPolyfills(){// Polyfill for canvas.toBlob().\nif(!HTMLCanvasElement.prototype.toBlob){Object.defineProperty(HTMLCanvasElement.prototype,'toBlob',{value:function(callback,type,quality){var binStr=atob(this.toDataURL(type,quality).split(',')[1]);var len=binStr.length;var arr=new Uint8Array(len);for(var i=0;i<len;i++){arr[i]=binStr.charCodeAt(i)}callback(new Blob([arr],{type:type||'image/png'}))}})}}", "function exportPNG() {\n var canvas = document.getElementById('myCanvas');\n var html = \"<img src='\" + canvas.toDataURL('image/png') + \"' />\";\n if ($.browser.msie) {\n window.winpng = window.open('/static/html/export.html');\n window.winpng.document.write(html);\n window.winpng.document.body.style.margin = 0;\n } else {\n window.winpng = window.open();\n window.winpng.document.write(html);\n window.winpng.document.body.style.margin = 0;\n }\n\n}", "function exportPNG() {\n var canvas = document.getElementById('myCanvas');\n var html = \"<img src='\" + canvas.toDataURL('image/png') + \"' />\"\n if ($.browser.msie) {\n window.winpng = window.open('/static/html/export.html');\n window.winpng.document.write(html);\n window.winpng.document.body.style.margin = 0;\n } else {\n window.winpng = window.open();\n window.winpng.document.write(html);\n window.winpng.document.body.style.margin = 0;\n }\n\n}", "onBeforeSave( info ) {\n //console.dir _.omit( info, 'mk' ), depth: null, colors: true\n if ((info.ext !== 'html') && (info.ext !== 'pdf')) { return info.mk; }\n let safe_eng = info.opts.pdf || 'wkhtmltopdf';\n if (safe_eng === 'phantom') { safe_eng = 'phantomjs'; }\n if (_.has(engines, safe_eng)) {\n this.errHandler = info.opts.errHandler;\n engines[ safe_eng ].call(this, info.mk, info.outputFile, info.opts, this.onError);\n return null; // halt further processing\n }\n }", "phantomjs( markup, fOut, opts, on_error ) {\n // Save the markup to a temporary file\n const tempFile = fOut.replace(/\\.pdf$/i, '.pdf.html');\n FS.writeFileSync(tempFile, markup, 'utf8');\n let scriptPath = PATH.relative(process.cwd(), PATH.resolve( __dirname, '../utils/rasterize.js' ));\n scriptPath = SLASH(scriptPath);\n const sourcePath = SLASH(PATH.relative( process.cwd(), tempFile));\n const destPath = SLASH(PATH.relative( process.cwd(), fOut));\n SPAWN('phantomjs', [ scriptPath, sourcePath, destPath ], false, on_error, this);\n }", "function guardarPixelArt() {\n html2canvas($(\"#grilla-pixeles\"), {\n onrendered: function (canvas) {\n theCanvas = canvas;\n canvas.toBlob(function (blob) {\n saveAs(blob, \"pixel-art.png\");\n });\n }\n });\n}", "function monkeyPatch() {\n return {\n transform: (code, id) => {\n var file = id.split('/').pop()\n\n // Only one define call per module is allowed by requirejs so\n // we have to remove calls that other libraries make\n if (file === 'FileSaver.js') {\n code = code.replace(/define !== null\\) && \\(define.amd != null/g, '0')\n } else if (file === 'html2canvas.js') {\n code = code.replace(/&&\\s+define.amd/g, '&& define.amd && false')\n }\n\n return code\n }\n }\n}", "function saveAsPNG() {\n html2canvasAngular.renderBody().then(function(canvas){\n canvas.toBlob(function (blob) {\n //console.log(blob);\n saveAs(blob, 'map.png');\n }, 'image/png');\n //document.body.appendChild(canvas);\n });\n }", "function Screenshot() {\n}", "function downloadCanvas() {\r\n // <-- Don't work in Firefox\r\n var canvases = $(\"#parent-container\").find(\"canvas\");\r\n if (canvases.length === 1) {\r\n removeOverlayingEmojiCanvases();\r\n removeOverlayingCaptionCanvases();\r\n var dataURL = base_canvas.toDataURL(\"image/png\");\r\n var link = document.createElement(\"a\");\r\n link.download = Date.now() + \".png\";\r\n link.href = base_canvas\r\n .toDataURL(\"image/png\")\r\n .replace(\"image/png\", \"image/octet-stream\");\r\n link.click();\r\n } else {\r\n alert(\"You should merge the canvas before downloading!\");\r\n }\r\n }", "saveFile() {\n lively.warn(\"#TODO implement save\")\n }", "function generateHTMLFile() {\r\n\tvar fileContents = \"\";\r\n\tfileContents += \"<html><body>\";\r\n\tfileContents += $(\"#canvas\").html();\r\n\tfileContents += \"</body></html>\";\r\n\t\r\n\tvar tempLink = document.createElement('a');\r\n tempLink.setAttribute('href', 'data:text/html;charset=utf-8,' + encodeURIComponent(fileContents));\r\n tempLink.setAttribute('download', 'wysiwygHtml');\r\n\r\n tempLink.style.display = 'none';\r\n document.body.appendChild(tempLink);\r\n\r\n tempLink.click();\r\n\r\n document.body.removeChild(tempLink);\r\n}", "function startSaveListener(){\r\n\tdocument.getElementById(\"saveit\").addEventListener(\"click\", saveGraph);\r\n document.getElementById(\"pushit\").addEventListener(\"click\", savepng);\r\n}", "function exportToPdf() {\n scope.isLoading = true;\n\n $log.debug('benchmark - export to pdf - start');\n html2canvas(element, {\n onrendered: function (canvas) {\n $log.debug('benchmark - export to pdf - onrendered');\n\n var imgData = canvas.toDataURL('image/png');\n $log.debug('benchmark - export to pdf - converted canvas');\n\n var doc = new jsPDF('p', 'mm');\n $log.debug('benchmark - export to pdf - created jspdf doc');\n\n var imgWidth = doc.internal.pageSize.width; //210;\n $log.debug('benchmark - export to pdf - imgWidth');\n\n var pageHeight = doc.internal.pageSize.height; //295;\n $log.debug('benchmark - export to pdf - pageHeight');\n\n var imgHeight = canvas.height * imgWidth / canvas.width;\n $log.debug('benchmark - export to pdf - imgHeight');\n\n var heightLeft = imgHeight;\n $log.debug('benchmark - export to pdf - heightLeft');\n\n var position = 0;\n $log.debug('benchmark - export to pdf - position');\n\n // addimage(imageData, format, x, y, w, h, alias, compression, rotation)\n doc.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight);\n $log.debug('benchmark - export to pdf - added first image');\n\n heightLeft -= pageHeight;\n\n while (heightLeft >= 0) {\n $log.debug('benchmark - export to pdf - adding page');\n\n position = heightLeft - imgHeight;\n doc.addPage();\n doc.addImage(imgData, 'PNG', 0, position, imgWidth, imgHeight);\n heightLeft -= pageHeight;\n }\n\n $log.debug('benchmark - export to pdf - saving');\n doc.save(scope.fileName);\n\n scope.isLoading = false;\n scope.$apply();\n $log.debug('benchmark - export to pdf - done');\n }\n });\n }", "static save(_toSave, _type = \"text/plain\") {\n for (let filename in _toSave) {\n let content = _toSave[filename];\n let blob = new Blob([content], { type: _type });\n let url = window.URL.createObjectURL(blob);\n //*/ using anchor element for download\n let downloader;\n downloader = document.createElement(\"a\");\n downloader.setAttribute(\"href\", url);\n downloader.setAttribute(\"download\", filename);\n document.body.appendChild(downloader);\n downloader.click();\n document.body.removeChild(downloader);\n window.URL.revokeObjectURL(url);\n }\n return new Promise(_resolve => {\n _resolve(_toSave);\n // function hndSaved(_event: Event): void {\n // FileIoBrowserLocal.removeEventListener(EVENT.FILE_SAVED, hndSaved);\n // _resolve((<CustomEvent>_event).detail);\n // }\n // FileIoBrowserLocal.addEventListener(EVENT.FILE_SAVED, hndSaved);\n // let event: CustomEvent = new CustomEvent(EVENT.FILE_SAVED, { detail: { mapFilenameToContent: _toSave } });\n // FileIoBrowserLocal.targetStatic.dispatchEvent(event);\n });\n }", "saveAsOneFile() {\r\n // HTML exportation\r\n this.saveFile('index', 'HTML', this.content)\r\n // We show the export result\r\n setTimeout(this.showOutput, 2500)\r\n }", "function exportImage(htmlId) {\n var svg = document.getElementById(htmlId);\n var canvas = document.getElementById('saveCanvas');\n canvas.height = svg.clientHeight;\n canvas.width = svg.clientWidth;\n var ctx = canvas.getContext('2d');\n var data = (new XMLSerializer()).serializeToString(svg);\n var DOMURL = window.URL || window.webkitURL || window;\n\n var img = new Image();\n var svgBlob = new Blob([data], { type: 'image/svg+xml;charset=utf-8' });\n var url = DOMURL.createObjectURL(svgBlob);\n img.src = url;\n\n img.onload = function () {\n ctx.drawImage(img, 0, 0);\n var imgURI = canvas\n .toDataURL('image/png')\n .replace('image/png', 'image/octet-stream');\n\n triggerDownload(imgURI);\n };\n\n}", "_saveContextSVG(){\n this.getGraphicsContext().saveSVG();\n }", "function main(){\nif(!documents.length) return;\nvar doc = activeDocument;\nvar oldPath = activeDocument.path;\n \nvar outFolder = new Folder(oldPath + \"/out\");\nif (!outFolder.exists) {\n outFolder.create();\n}\n \nscanLayerSets(doc);\n \nfunction scanLayerSets(el) {\n // find layer groups\n for(var a=0;a<el.layerSets.length;a++){\n var lname = el.layerSets[a].name;\n if (lname.substr(-4) == \".png\") {\n saveLayer(el.layers.getByName(lname), lname, oldPath, true);\n } else {\n // recursive\n scanLayerSets(el.layerSets[a]);\n }\n }\n \n \n // find plain layers in current group whose names end with .png\n for(var j=0; j<el.artLayers.length; j++) {\n var name = el.artLayers[j].name;\n if (name.substr(-4) == \".png\") {\n saveLayer(el.layers.getByName(name), name, oldPath, false);\n }\n }\n \n}\n \nfunction saveLayer(layer, lname, path, shouldMerge) {\n activeDocument.activeLayer = layer;\n dupLayers();\n if (shouldMerge === undefined || shouldMerge === true) {\n activeDocument.mergeVisibleLayers();\n }\n activeDocument.trim(TrimType.TRANSPARENT,true,true,true,true);\n var saveFile= File(path +\"/out/\"+lname);\n SavePNG(saveFile);\n app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);\n}\n \n}", "function Export() {\n\n var element = document.createElement('a');\n element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(Canvas.toDataURL()));\n element.setAttribute('download', \"img\");\n element.style.display = 'none';\n document.body.appendChild(element);\n element.click();\n document.body.removeChild(element);\n}", "function printDocument(){\r\n\r\n var map = document.querySelector(\"#map\");\r\n \r\n var width = map.offsetWidth;//map.clientWidth; \r\n var height = map.offsetHeight;//map.clientHeight \r\n var canvas = document.createElement(\"canvas\");\r\n var scale = 1; \r\n\r\n canvas.width = width * scale;\r\n canvas.height = height * scale; \r\n canvas.getContext(\"2d\").scale(scale,scale);\r\n\r\n var opts = {\r\n scale: scale,\r\n canvas: canvas, \r\n logging: true,\r\n width: width,\r\n heihgt: height,\r\n useCORS: true,\r\n foreignObjectRendering: false,\r\n allowTaint: true,\r\n imageTimeout: 0,\r\n };\r\n\r\n html2canvas(map, opts).then(function(canvas) {\r\n \r\n var context = canvas.getContext('2d');\r\n context.ImageSmoothingEnabled = false;\r\n context.webkitImageSmoothingEnabled = false;\r\n context.msImageSmoothingEnabled = false;\r\n context.imageSmoothingEnabled = false;\r\n var img = canvas2image.convertToJPEG(canvas, canvas.width, canvas.height);\r\n\r\n var a = document.createElement('a');\r\n var event = new MouseEvent('click');\r\n a.download = 'Bauhinia';\r\n a.href = img.src;\r\n a.dispatchEvent(event);\r\n })\r\n}", "function takeScreenshot_T() {\n\ttinyMCE.triggerSave();\n\tvar copyText = document.getElementById(\"TruthTable\");\n\tcopyText.select();\n\tdocument.execCommand(\"copy\");\n\tvar iframe=document.createElement('iframe');\n\tdocument.body.appendChild(iframe);\n\tsetTimeout(function(){\n\t var iframedoc=iframe.contentDocument||iframe.contentWindow.document;\n\t iframedoc.body.innerHTML=copyText.value;\n\t html2canvas(iframedoc.body, {\n\t \t\t//useCORS: true,\n\t \t\tallowTaint: true,\n\t \t\tbackground: '#fff',\n\t \t\tscale: 1.5,\n\t \t\tonrendered: function(canvas) {\n\t \t\t\tvar fileNameToSaveAs = document.getElementById(\"inputFileNameToSaveAsT\").value;\n\t \t\t\tvar downloadLink = document.createElement(\"a\");\n\t \t\t\tdownloadLink.download = fileNameToSaveAs + \".png\";\n\t \t\t\tdownloadLink.innerHTML = \"Download File\";\n\t \t\t\tdownloadLink.href = canvas.toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\");\n\t \t\t\tdownloadLink.onclick = destroyClickedElement;\n\t \t\t\tdownloadLink.style.display = \"none\";\n\t \t\t\tdocument.body.appendChild(downloadLink);\n\t \t\t\tdownloadLink.click();\n\t \t\t\tdocument.body.removeChild(iframe);\n\t }\n\t });\n\t}, 10);\n}", "function exportCanvas() {\n //export canvas as SVG\n var v = '<svg width=\"300\" height=\"200\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\\\n <rect x=\"0\" y=\"0\" height=\"200\" width=\"300\" style=\"stroke:#000000; fill: #FFFFFF\"/>\\\n <path d=\"M100,100 C200,200 100,50 300,100\" style=\"stroke:#FFAAFF;fill:none;stroke-width:3;\" />\\\n <rect x=\"50\" y=\"50\" height=\"50\" width=\"50\"\\\n style=\"stroke:#ff0000; fill: #ccccdf\" />\\\n </svg>';\n\n\n\n //get svg\n var canvas = getCanvas();\n\n var v2 = '<svg width=\"' + canvas.width + '\" height=\"' + canvas.height + '\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">';\n v2 += STACK.toSVG();\n v2 += CONNECTOR_MANAGER.toSVG();\n v2 += '</svg>';\n alert(v2);\n\n //save SVG into session\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"../common/controller.php\", {action: 'saveSvg', svg: escape(v2)},\n function(data) {\n if (data == 'svg_ok') {\n //alert('SVG was save into session');\n }\n else if (data == 'svg_failed') {\n Log.info('SVG was NOT save into session');\n }\n }\n );\n\n //open a new window that will display the SVG\n window.open('./svg.php', 'SVG', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');\n}", "function gd(){}", "function checkBrowser() {\n startWork();\n browser.checked = true;\n\n checkEncodesBase64();\n checkADownloads();\n checkSavesMsBlobs();\n checkCreatesObjectUrls();\n checkExportsSvg(finishWork);\n\n\n function checkEncodesBase64() {\n browser.encodesBase64 = !!root.btoa;\n\n // setup shim for IE9\n if (!browser.encodesBase64) {\n setupBase64Shim();\n }\n }\n\n function checkADownloads() {\n browser.aDownloads = document.createElement('a').download !== undefined;\n }\n\n function checkSavesMsBlobs() {\n browser.savesMsBlobs = !!navigator.msSaveOrOpenBlob;\n }\n\n function checkCreatesObjectUrls() {\n var domUrl = root.URL || root.webkitURL;\n browser.createsObjectUrls = domUrl && domUrl.createObjectURL;\n }\n\n function checkExportsSvg() {\n startWork();\n\n browser.exportsSvg = false;\n\n var iframe = document.body.appendChild(document.createElement('iframe'));\n iframe.style.visibility = 'hidden';\n var doc = iframe.contentWindow.document;\n\n iframe.onload = function () {\n try {\n var svg = doc.querySelector('svg');\n var img = doc.querySelector('img');\n var canvas = doc.querySelector('canvas');\n var context = canvas.getContext('2d');\n canvas.width = img.getAttribute('width') * 1;\n canvas.height = img.getAttribute('height') * 1;\n var sourceImg = new Image();\n sourceImg.width = canvas.width;\n sourceImg.height = canvas.height;\n sourceImg.onload = function () {\n try {\n context.drawImage(sourceImg, 0, 0, img.width, img.height);\n img.src = canvas.toDataURL();\n\n browser.exportsSvg = true; // yay\n } catch (e) {}\n\n svgExportChecked();\n };\n var xml = (new XMLSerializer()).serializeToString(svg);\n sourceImg.src = 'data:image/svg+xml,' + encodeURIComponent(xml);\n } catch (e) {\n svgExportChecked();\n }\n };\n\n doc.open();\n doc.write('<!DOCTYPE html>');\n doc.write('<html><head></head><body>');\n doc.write('<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"2\" height=\"2\" viewBox=\"0 0 1 1\"><circle r=\"1\" fill=\"red\"/></svg>');\n doc.write('<img width=\"2\" height=\"2\">');\n doc.write('<canvas></canvas>');\n doc.write('</body></html>');\n doc.close();\n\n\n function svgExportChecked() {\n document.body.removeChild(iframe);\n\n // load Canvg SVG renderer for browsers that can't safely export SVG\n if (browser.exportsSvg) {\n finishWork();\n } else {\n setupCanvgShim(finishWork);\n }\n }\n }\n\n // base64 shim, for IE9\n function setupBase64Shim() {\n var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\n function InvalidCharacterError(message) {\n this.message = message;\n }\n InvalidCharacterError.prototype = new Error();\n InvalidCharacterError.prototype.name = 'InvalidCharacterError';\n\n // base64 encoder\n // from https://gist.github.com/999166\n root.btoa = function (input) {\n var str = String(input);\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars, output = '';\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new InvalidCharacterError('\"btoa\" failed: The string to be encoded contains characters outside of the Latin1 range.');\n }\n block = block << 8 | charCode;\n }\n return output;\n };\n }\n\n // Canvg shim, for IE9-11 and Safari\n function setupCanvgShim(done) {\n var scripts = [\n 'https://cdnjs.cloudflare.com/ajax/libs/canvg/1.4/rgbcolor.min.js',\n 'https://cdnjs.cloudflare.com/ajax/libs/stackblur-canvas/1.4.1/stackblur.min.js',\n 'https://cdn.jsdelivr.net/npm/canvg/dist/browser/canvg.min.js'\n ];\n var remaining = scripts.length;\n scripts.forEach(function (srcURL) {\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.onload = function () {\n remaining--;\n if (remaining === 0) done();\n };\n script.src = srcURL;\n document.head.appendChild(script);\n });\n }\n}", "function SaveAsSVG(document, newname)\r{\r var targetFolder = Folder(MATERIAL_EXPORT_PATH);\r\r if (! targetFolder.exists) {\r // geef een melding en \r throw(\"Onderstaande folder niet gevonden, is de netwerkverbinding gemaakt? \\n\\n\" +\r MATERIAL_EXPORT_PATH);\r }\r\r var exportOptions = new ExportOptionsSVG();\r var exportType = ExportType.SVG;\r\r var targetFile = MakeTempInvisibleFile(targetFolder, newname, \".ai\");\r // alert(targetFile);\r\r exportOptions.embedRasterImages = true;\r exportOptions.compressed = true;\r exportOptions.embedAllFonts = false;\r exportOptions.fontSubsetting = SVGFontSubsetting.GLYPHSUSED;\r exportOptions.cssProperties = SVGCSSPropertyLocation.PRESENTATIONATTRIBUTES;\r exportOptions.optimezForSVGViewer = true;\r\r document.exportFile( targetFile, exportType, exportOptions );\r document.close( SaveOptions.DONOTSAVECHANGES );\r\r var exportedFile = MakeTempInvisibleFile(targetFolder, newname, \".svgz\");\r // alert(exportedFile);\r if (exportedFile.exists) {\r if (! exportedFile.rename(newname+ \".svgz\")) {\r // bij aanwezig zijn oude file, deze proberen te deleten en vervolgens nogmaal renamen:\r var fl = new File(targetFolder + \"/\" + newname + \".svgz\");\r // alert(fl);\r if (fl.remove()) \r exportedFile.rename(newname+ \".svgz\")\r else\r alert(SCRIPT_NAME + \" is niet goed gelukt, oude file is nog aanwezig en niet te overschrijven!\") \r }\r } \r else\r alert(SCRIPT_NAME + \" is niet goed gelukt!\") \r}", "function takeScreenshot_P() {\n\ttinyMCE.triggerSave();\n\tvar copyText = document.getElementById(\"Proof\");\n\tcopyText.select();\n\tdocument.execCommand(\"copy\");\n\tvar iframe=document.createElement('iframe');\n\tdocument.body.appendChild(iframe);\n\tsetTimeout(function(){\n\t var iframedoc=iframe.contentDocument||iframe.contentWindow.document;\n\t iframedoc.body.innerHTML=copyText.value;\n\t html2canvas(iframedoc.body, {\n\t \t\t//useCORS: true,\n\t \t\tallowTaint: true,\n\t \t\tbackground: '#fff',\n\t \t\tscale: 1.5,\n\t \t\tonrendered: function(canvas) {\n\t \t\t\tvar fileNameToSaveAs = document.getElementById(\"inputFileNameToSaveAsP\").value;\n\t \t\t\tvar downloadLink = document.createElement(\"a\");\n\t \t\t\tdownloadLink.download = fileNameToSaveAs + \".png\";\n\t \t\t\tdownloadLink.innerHTML = \"Download File\";\n\t \t\t\tdownloadLink.href = canvas.toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\");\n\t \t\t\tdownloadLink.onclick = destroyClickedElement;\n\t \t\t\tdownloadLink.style.display = \"none\";\n\t \t\t\tdocument.body.appendChild(downloadLink);\n\t \t\t\tdownloadLink.click();\n\t \t\t\tdocument.body.removeChild(iframe);\n\t }\n\t });\n\t}, 10);\n}", "function main() {\n $('.box').css('left', originX - rbx);\n $('.box').css('top', originY + lty);\n $('.box').css('width', rbx - ltx);\n $('.box').css('height', rby - lty);\n\n html2canvas(document.body, {\n allowTaint: true,\n logging: true,\n width: 1484,\n height: 1119,\n onrendered: function(canvas) {\n $('.bg').css('display', 'none');\n $('.box').css('display', 'none');\n var img = new Image();\n img.setAttribute('crossOrigin', 'anonymous');\n img.src = canvas.toDataURL();\n document.body.appendChild(img);\n }\n });\n}", "function Fsave() { \n var imageToSave = document.getElementById(\"btnsave\");// se activa cuando el evento click sea activado \n imageToSave.addEventListener(\"click\", function () { // atraves del boton btnsave \n var date = canvas.toDataURL(\"image/png\",0.1);// se define la ruta,tipo y calidad de la image\n date = date.replace(\"image/png\", \"image/octet-stream\");\n document.location.href = date;// se lanza la imagen para que esta se descarge automaticamente\n }, false);\n // Nota: La primera vez que se ejecuta esta funcion , toma unos segundos en responder, \n // luego la descarga se realiza de manera inmmediata ya que parte de la imagen se encuentra en la cache \n // del navegador\n}", "function saveCanvas(canvas, file) {\n\n if (!file.exists()) {\n file.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE,\n parseInt('0666', 8));\n }\n var data = null;\n canvas.toBlob(function(blob) {\n let reader = new parentwin.FileReader();\n reader.onloadend = function() {\n data = reader.result;\n };\n reader.readAsBinaryString(blob);\n });\n\n var thread = Services.tm.currentThread;\n while (data === null) {\n thread.processNextEvent(true);\n }\n\n var localfile = Components.classes[\"@mozilla.org/file/local;1\"]\n .createInstance(Components.interfaces.nsILocalFile);\n var stream = Components.classes[\"@mozilla.org/network/file-output-stream;1\"]\n .createInstance(Components.interfaces.nsIFileOutputStream);\n localfile.initWithPath(file.path);\n\n try {\n stream.init(file, PR_WRONLY | PR_TRUNCATE, parseInt('0666', 8), 0);\n stream.write(data, data.length);\n stream.flush();\n }\n finally {\n stream.close();\n }\n}", "function getDisplayImage(){\n //html2canvas実行\n html2canvas(document.getElementById(\"target\")).then(function(canvas) {\n downloadImage(canvas.toDataURL());\n });\n}", "function saveToFile(privewHtml) {\n try {\n fs.mkdirSync(PREVIEW_DIR);\n } catch(err) {\n if (err.code != 'EEXIST')\n throw err;\n }\n fs.writeFile(PREVIEW_PATH, privewHtml);\n }", "function writeHtml() { //写html\n\n\tvar htmlOut,\n\t\timages = exportImageData,\n\t\tidx = images.length - 1,\n\t\thdr = exportHeader;\n\n\thtmlOut = new File(hdr.outDir + '/' + hdr.prefix + '.html');\n\thtmlOut.open('w');\n\thtmlOut.writeln('<!doctype html>');\n\thtmlOut.writeln('<html>');\n\thtmlOut.writeln('<head>');\n\thtmlOut.writeln(' <meta charset=\"utf-8\">');\n\thtmlOut.writeln(' <meta name=\"viewport\" content=\"width=device-width, user-scalable=no,initial-scale=1.0\"></meta>');\n\thtmlOut.writeln(' <title>' + hdr.psdName + ' export</title>');\n\thtmlOut.writeln(' <link rel=\"stylesheet\" href=\"' + hdr.cssDir + '/'+ hdr.prefix + '.css' + '\">');\n\t// 添加script\n\thtmlOut.writeln('<script>');\n\n\t// 增加单位适配\n\thtmlOut.writeln('function setDocFontSize(base) {');\n\t\thtmlOut.writeln('var width = 375,');\n\t\thtmlOut.writeln('domEle = document.documentElement;');\n\t\thtmlOut.writeln('dw = domEle.clientWidth || width,');\n\t\thtmlOut.writeln('iw = window.innerWidth || width,');\n\t\thtmlOut.writeln('sw = window.screen.width || iw,');\n\t\thtmlOut.writeln('saw = window.screen.availWidth || iw,');\n\t\thtmlOut.writeln('w = Math.min(dw, iw, sw, saw);');\n\n\t\thtmlOut.writeln('base = base || 750;');\n\t\thtmlOut.writeln('if (w > base) {');\n\t\t\thtmlOut.writeln('w = base;');\n\t\t\thtmlOut.writeln('}');\n\t\t\thtmlOut.writeln('if (window.devicePixelRatio) {');\n\t\t\t\thtmlOut.writeln('dpr = window.devicePixelRatio;');\n\t\t\t\thtmlOut.writeln('} else {');\n\t\t\t\t\thtmlOut.writeln('dpr = navigator.userAgent.match(/iphone/i) ? (w > 818 ? 3 : w > 480 ? 2 : 1) : 1;');\n\t\t\t\t\thtmlOut.writeln('}');\n\t\t\t\t\thtmlOut.writeln('dpr = Math.floor(dpr);');\n\t\t\t\t\thtmlOut.writeln('domEle.style.fontSize = w / base * 100 + \"px\";');\n\t\t\t\t\thtmlOut.writeln('domEle.dataset.dpr = dpr;');\n\t\t\t\t\thtmlOut.writeln('}');\n\n\thtmlOut.writeln('</script>');\n\t// end\n\n\thtmlOut.writeln('</head>');\n\thtmlOut.writeln('<body onload=\"setDocFontSize('+ hdr.psdWidth +')\">');\n\thtmlOut.writeln('<div class=\"wrap ' + hdr.prefix + '\">');\n\n\t// Photoshop extracts top first; we'll put em on the page bottom first\n\tfor (idx; idx >= 0; idx -= 1) {\n\t\thtmlOut.writeln(' <div class=\"' + removeHyphen(images[idx].name) + '\"></div>');\n\t}\n\t//src:\"imgs/'+images[idx].name+hdr.extension\n\n\thtmlOut.writeln('</div>');\n\thtmlOut.writeln('</body>');\n\thtmlOut.writeln('</html>');\n\thtmlOut.close();\n}", "saveDrawing(){\n var self = this;\n if(this.drawingHelper.canvas.toBlob) {\n this.drawingHelper.canvas.toBlob(function(blob){\n $(self.refs.myCanvas).data('changed', CONSTANTS.VALUES.TRUE)\n var blobUrl = URL.createObjectURL(blob)\n $(self.refs.preview_image).attr('src', blobUrl)\n self.modal.close()\n })\n }\n }", "function saveCanvas() {\n // Generate SVG.\n var save_button = $('#save');\n var save_svg = $('#canvas').innerHTML.replace('<svg', '<svg xmlns=\"http://www.w3.org/2000/svg\"');\n var data_uri = 'data:image/svg+xml;base64,' + window.btoa(save_svg);\n var filename = 'bustashape-' + window.location.hash.replace('#', '') + '-' + Date.now() + '.svg';\n\n // Prep link for new download.\n save_button.setAttribute('href', data_uri);\n save_button.setAttribute('download', filename);\n}", "saveAsMultipleFiles() {\r\n // Load the needed data for text file exportation\r\n let head = this.editorHTML.getValue().substr(0, this.editorHTML.getValue().indexOf('</head>')-1)\r\n let style = '\\n\\t<link rel=\"stylesheet\" href=\"style.css\">'\r\n let chead = '\\n</head>\\n'\r\n let bodyTag = this.editorHTML.getValue().indexOf('<body>')\r\n let bodyLines = this.editorHTML.getValue().substr(bodyTag)\r\n let html = bodyLines.substr(0, bodyLines.length-15)\r\n let script = '\\t<script src=\"script.js\"></script>\\n'\r\n let endDoc = '</body>\\n</html>'\r\n \r\n let todo = head\r\n \r\n // CSS exportation\r\n if (this.editorCSS.getValue().length > 0) {\r\n todo += style\r\n this.saveFile('style', 'CSS', this.editorCSS.getValue())\r\n }\r\n\r\n todo += chead\r\n todo += html\r\n\r\n // JS exportation\r\n if (this.editorJS.getValue().length > 0) {\r\n todo += script\r\n this.saveFile('script', 'JS', this.editorJS.getValue())\r\n }\r\n\r\n todo += endDoc\r\n\r\n // HTML exportation\r\n this.saveFile('index', 'HTML', todo)\r\n // We show the export result\r\n setTimeout(this.showOutput, 2500)\r\n\r\n }", "function save() {\n // document.getElementById(\"canvasimg\").style.border = \"2px solid\";\n // const savedImage = canvas.toDataURL();\n // document.getElementById(\"canvasimg\").src = savedImage;\n\n // document.getElementById(\"canvasimg\").style.display = \"inline\"; \n //--- this is prob the line of code that saves it next to the current\n }", "function SaveFile() {\n return {\n save: saveAsFile\n };\n}", "function takeScreenshot_S() {\n\ttinyMCE.triggerSave();\n\tvar copyText = document.getElementById(\"Statement\");\n\tcopyText.select();\n\tdocument.execCommand(\"copy\");\n\tvar iframe=document.createElement('iframe');\n\tdocument.body.appendChild(iframe);\n\tsetTimeout(function(){\n\t var iframedoc=iframe.contentDocument||iframe.contentWindow.document;\n\t iframedoc.body.innerHTML=copyText.value;\n\t html2canvas(iframedoc.body, {\n\t \t\t//useCORS: true,\n\t \t\tallowTaint: true,\n\t \t\tbackground: '#fff',\n\t \t\tscale: 1.5,\n\t \t\tonrendered: function(canvas) {\n\t \t\t\tvar fileNameToSaveAs = document.getElementById(\"inputFileNameToSaveAsS\").value;\n\t \t\t\tvar downloadLink = document.createElement(\"a\");\n\t \t\t\tdownloadLink.download = fileNameToSaveAs + \".png\";\n\t \t\t\tdownloadLink.innerHTML = \"Download File\";\n\t \t\t\tdownloadLink.href = canvas.toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\");\n\t \t\t\tdownloadLink.onclick = destroyClickedElement;\n\t \t\t\tdownloadLink.style.display = \"none\";\n\t \t\t\tdocument.body.appendChild(downloadLink);\n\t \t\t\tdownloadLink.click();\n\t \t\t\tdocument.body.removeChild(iframe);\n\t }\n\t });\n\t}, 10);\n}", "function downloadCanvas(link, canvasId, filename) {\n var canElement = document.getElementsByClassName(\"download-canvas\");\n link.href = canElement[0].toDataURL();\n link.download = filename;\n $('#saveIMG').remove();\n}", "function downloadCanvas(link, canvasId, filename) {\n link.href = document.getElementById('myCanvas').toDataURL();\n link.download = filename;\n}", "function save() {\n\t var imgg=canvas.toDataURL(\"image/png\");\n\t window.location = imgg;\n}", "function encodeAsImgAndLink(svg) {\n if ($.browser.msie) {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n window.winsvg = window.open('/static/html/export.html');\n window.winsvg.document.write(dummy.innerHTML);\n window.winsvg.document.body.style.margin = 0;\n } else {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n\n var b64 = Base64.encode(dummy.innerHTML);\n\n //window.winsvg = window.open(\"data:image/svg+xml;base64,\\n\"+b64);\n var html = \"<img style='height:100%;width:100%;' src='data:image/svg+xml;base64,\" + b64 + \"' />\"\n window.winsvg = window.open();\n window.winsvg.document.write(html);\n window.winsvg.document.body.style.margin = 0;\n }\n}", "setFileDetector() {}", "function Fnc_DescargarGrafico(formato) {\n var canvas = document.createElement(\"canvas\");\n canvas.width = 950;\n canvas.height = 600;\n if ($(\"#\" + WebChart.uniqueID).is(\":visible\")) {\n var imgChart = document.getElementById(WebChart.uniqueID).getElementsByTagName(\"img\")[0],\n contexto = canvas.getContext(\"2d\");\n contexto.drawImage(imgChart, 0, 0);\n } else {\n var imgChart = document.getElementById(WebChart1.uniqueID).getElementsByTagName(\"img\")[0],\n contexto = canvas.getContext(\"2d\");\n contexto.drawImage(imgChart, 0, 0);\n }\n\n\n var Base69String = canvas.toDataURL()\n if (formato == \"pdf\") {\n var doc = new jsPDF();\n doc.addImage(Base69String, 'JPEG', 15, 40, 180, 95);\n doc.save(\"Grafico.pdf\")\n return true;\n }\n else if (formato == \"png\") {\n Base69String = Base69String.replace(\"data:image/png;base64\", \"data:image/png;base64\");\n }\n else if (formato == \"jpeg\") {\n Base69String = Base69String.replace(\"data:image/png;base64\", \"data:image/jpeg;base64\");\n }\n var Save = document.createElement(\"a\")\n Save.href = Base69String;\n Save.download = \"Grafico\"\n var EventoClick = new MouseEvent(\"click\", {\n \"view\": window,\n \"bubbles\": true,\n \"cancelable\": true\n });\n Save.dispatchEvent(EventoClick);\n\n}", "function _renderImageOnCanvas( data, formattype, rerendercallable ) {\n\t\t'use strict'\n\t\t// #1. Do NOT rely on this. No worky on IE\n\t\t// (url max len + lack of base64 decoder + possibly other issues)\n\t\t// #2. This does NOT affect what is captured as \"signature\" as far as vector data is\n\t\t// concerned. This is treated same as \"signature line\" - i.e. completely ignored\n\t\t// the only time you see imported image data exported is if you export as image.\n\n\t\t// we do NOT call rerendercallable here (unlike in other import plugins)\n\t\t// because importing image does absolutely nothing to the underlying vector data storage\n\t\t// This could be a way to \"import\" old signatures stored as images\n\t\t// This could also be a way to import extra decor into signature area.\n\n\t\tvar img = new Image()\n\t\t// this = Canvas DOM elem. Not jQuery object. Not Canvas's parent div.\n\t\t, c = this;\n\n\t\timg.onload = function () {\n\t\t\tvar ctx = c.getContext(\"2d\");\n\t\t\tvar oldShadowColor = ctx.shadowColor;\n\t\t\tctx.shadowColor = \"transparent\";\n\t\t\tctx.drawImage(\n\t\t\t\timg, 0, 0\n\t\t\t\t, ( img.width < c.width) ? img.width : c.width\n\t\t\t\t, ( img.height < c.height) ? img.height : c.height\n\t\t\t);\n\t\t\tctx.shadowColor = oldShadowColor;\n\t\t};\n\n\t\timg.src = 'data:' + formattype + ',' + data;\n\t}", "function clickFileItenAdmin(id) {\n var idchan = '#imgLog' + id;\n var idchankey = 'imgLog' + id;\n $(idchan).click();\n const imgFile = document.getElementById(idchankey);\n imgFile.addEventListener(\"change\", function () {\n const file = this.files[0];\n var tmppath = URL.createObjectURL(this.files[0]);\n var yave = '#ImganItenAdmin' + id;\n if (file) {\n const render = new FileReader();\n render.addEventListener(\"load\", function (event) {\n console.log(this.result);\n $(yave).attr(\"src\", this.result);\n $(yave).attr(\"value\", $(idchan).val());\n });\n render.readAsDataURL(file);\n }\n });\n}", "function save( dataBlob, filesize ){\n\t\t\t\t\tsaveAs( dataBlob, that.element.id + '.png' ); // FileSaver.js function\n\t\t\t\t}", "saveImage() {\n console.log(this.stripStyles(this.state.svgString));\n canvg('canvas', this.stripStyles(this.state.svgString));\n document.getElementById('canvas').toBlob((blob) => {\n saveAs(blob, `tri2-${new Date().toISOString()}.png`);\n });\n }", "function saveAsGif() {\n // var count = 0;\n // saveFrames(\"out\", \"png\", 1, frameArray.length, data => {\n // var x = document.createElement(\"IMG\");\n // x.setAttribute(\"src\", data[count].imageData);\n // x.setAttribute(\"width\", \"960\");\n // x.setAttribute(\"height\", \"350\");\n // x.setAttribute(\"position\", \"absolute\");\n // x.setAttribute(\"top\", \"0\");\n // x.setAttribute(\"height\", \"350\");\n // document.body.appendChild(x);\n // print(data);\n // count += 1;\n // });\n capturer = new CCapture({\n FPS:frameSpeed,\n format:'gif',\n display: true,\n frameLimit: 180,\n workersPath:'./js/',\n verbose:true\n });\n exporting = true;//so canvas knows when to record\n console.log(\"export Starting\");\n gifCounter = frameCount;\n gifLength += frameCount;\n framePosition = 0;\n noStroke();\n capturer.start();//starts the capture function. might try moving to html\n\n\n /* previous code for saving frames as pngs. unsure of if using this later or not.\n noStroke();\n frameRate(1);\n\n framePosition = 0;\n\n for (let i = 0; i < frameArray.length; i++) {\n for (let i = 0; i < boxArray.length; i++) {\n //displays frames for drawing\n boxArray[i].display();\n }\n\n console.log(framePosition);\n loadFrame(framePosition);\n save(\"frame#00\" + framePosition);\n framePosition += 1;\n }\n\n framePosition = 0;\n console.log(\"exported\");\n stroke(1);\n frameRate(60);\n */\n}", "function saveFile(docRef, fileNameBody, exportInfo) { //保存文档\n\n\tvar fileToSave;\n\n\tswitch (exportInfo.fileType) {\n\n\t\tcase jpegIndex:\n\t\t\tdocRef.bitsPerChannel = BitsPerChannelType.EIGHT;\n\t\t\tfileToSave = new File(exportInfo.destination +'/'+ exportHeader.imgDir+ '/' + fileNameBody + '.jpg');\n\t\t\tjpgSaveOptions = new JPEGSaveOptions();\n\t\t\tjpgSaveOptions.embedColorProfile = exportInfo.icc;\n\t\t\tjpgSaveOptions.quality = exportInfo.jpegQuality;\n\t\t\tdocRef.saveAs(fileToSave, jpgSaveOptions, true, Extension.LOWERCASE);\n\t\t\tbreak;\n\n\t\tcase png8Index:\n\t\t\tsavePng8(fileNameBody, exportInfo, dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter.value, dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Trans.value);\n\t\t\t//var saveFile = new File(exportInfo.destination + '/' + fileNameBody + '.png');\n\n\t\t\tbreak;\n\n\t\tcase png24Index:\n\t\t\tsavePng24(fileNameBody, exportInfo, dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Inter.value, dlgMain.pnlFileType.pnlOptions.grpPNG24Options.png24Trans.value);\n\t\t\t//var saveFile = new File(exportInfo.destination + '/' + fileNameBody + '.png');\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tif (DialogModes.NO != app.playbackDisplayDialogs) {\n\t\t\t\talert(strUnexpectedError);\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\tfunction savePng24(fileNameBody, exportInfo, interlacedValue, transparencyValue) { //保存png24\n\t\t// alert(exportInfo.destination + '/'+ exportInfo.imgDir + \"/\" + fileNameBody + \".png\");\n\t\tvar id6 = charIDToTypeID(\"Expr\");\n\t\tvar desc3 = new ActionDescriptor();\n\t\tvar id7 = charIDToTypeID(\"Usng\");\n\t\tvar desc4 = new ActionDescriptor();\n\t\tvar id8 = charIDToTypeID(\"Op \");\n\t\tvar id9 = charIDToTypeID(\"SWOp\");\n\t\tvar id10 = charIDToTypeID(\"OpSa\");\n\t\tdesc4.putEnumerated(id8, id9, id10);\n\t\tvar id11 = charIDToTypeID(\"Fmt \");\n\t\tvar id12 = charIDToTypeID(\"IRFm\");\n\t\tvar id13 = charIDToTypeID(\"PN24\");\n\t\tdesc4.putEnumerated(id11, id12, id13);\n\t\tvar id14 = charIDToTypeID(\"Intr\");\n\t\tdesc4.putBoolean(id14, interlacedValue);\n\t\tvar id15 = charIDToTypeID(\"Trns\");\n\t\tdesc4.putBoolean(id15, transparencyValue);\n\t\tvar id16 = charIDToTypeID(\"Mtt \");\n\t\tdesc4.putBoolean(id16, true);\n\t\tvar id17 = charIDToTypeID(\"MttR\");\n\t\tdesc4.putInteger(id17, 255);\n\t\tvar id18 = charIDToTypeID(\"MttG\");\n\t\tdesc4.putInteger(id18, 255);\n\t\tvar id19 = charIDToTypeID(\"MttB\");\n\t\tdesc4.putInteger(id19, 255);\n\t\tvar id20 = charIDToTypeID(\"SHTM\");\n\t\tdesc4.putBoolean(id20, false);\n\t\tvar id21 = charIDToTypeID(\"SImg\");\n\t\tdesc4.putBoolean(id21, true);\n\t\tvar id22 = charIDToTypeID(\"SSSO\");\n\t\tdesc4.putBoolean(id22, false);\n\t\tvar id23 = charIDToTypeID(\"SSLt\");\n\t\tvar list1 = new ActionList();\n\t\tdesc4.putList(id23, list1);\n\t\tvar id24 = charIDToTypeID(\"DIDr\");\n\t\tdesc4.putBoolean(id24, false);\n\t\tvar id25 = charIDToTypeID(\"In \");\n\t\tdesc4.putPath(id25, new File(exportInfo.destination + '/'+ exportHeader.imgDir + \"/\" + fileNameBody + \".png\"));\n\t\tvar id26 = stringIDToTypeID(\"SaveForWeb\");\n\t\tdesc3.putObject(id7, id26, desc4);\n\t\texecuteAction(id6, desc3, DialogModes.NO);\n\t}\n\n\tfunction savePng8(fileNameBody, exportInfo, interlacedValue, transparencyValue) { //保存png8\n\t\tvar id5 = charIDToTypeID(\"Expr\");\n\t\tvar desc3 = new ActionDescriptor();\n\t\tvar id6 = charIDToTypeID(\"Usng\");\n\t\tvar desc4 = new ActionDescriptor();\n\t\tvar id7 = charIDToTypeID(\"Op \");\n\t\tvar id8 = charIDToTypeID(\"SWOp\");\n\t\tvar id9 = charIDToTypeID(\"OpSa\");\n\t\tdesc4.putEnumerated(id7, id8, id9);\n\t\tvar id10 = charIDToTypeID(\"Fmt \");\n\t\tvar id11 = charIDToTypeID(\"IRFm\");\n\t\tvar id12 = charIDToTypeID(\"PNG8\");\n\t\tdesc4.putEnumerated(id10, id11, id12);\n\t\tvar id13 = charIDToTypeID(\"Intr\"); //Interlaced\n\t\tdesc4.putBoolean(id13, interlacedValue);\n\t\tvar id14 = charIDToTypeID(\"RedA\");\n\t\tvar id15 = charIDToTypeID(\"IRRd\");\n\t\tvar id16 = charIDToTypeID(\"Prcp\"); //Algorithm\n\t\tdesc4.putEnumerated(id14, id15, id16);\n\t\tvar id17 = charIDToTypeID(\"RChT\");\n\t\tdesc4.putBoolean(id17, false);\n\t\tvar id18 = charIDToTypeID(\"RChV\");\n\t\tdesc4.putBoolean(id18, false);\n\t\tvar id19 = charIDToTypeID(\"AuRd\");\n\t\tdesc4.putBoolean(id19, false);\n\t\tvar id20 = charIDToTypeID(\"NCol\"); //NO. Of Colors\n\t\tdesc4.putInteger(id20, 256);\n\t\tvar id21 = charIDToTypeID(\"Dthr\"); //Dither\n\t\tvar id22 = charIDToTypeID(\"IRDt\");\n\t\tvar id23 = charIDToTypeID(\"Dfsn\"); //Dither type\n\t\tdesc4.putEnumerated(id21, id22, id23);\n\t\tvar id24 = charIDToTypeID(\"DthA\");\n\t\tdesc4.putInteger(id24, 100);\n\t\tvar id25 = charIDToTypeID(\"DChS\");\n\t\tdesc4.putInteger(id25, 0);\n\t\tvar id26 = charIDToTypeID(\"DCUI\");\n\t\tdesc4.putInteger(id26, 0);\n\t\tvar id27 = charIDToTypeID(\"DChT\");\n\t\tdesc4.putBoolean(id27, false);\n\t\tvar id28 = charIDToTypeID(\"DChV\");\n\t\tdesc4.putBoolean(id28, false);\n\t\tvar id29 = charIDToTypeID(\"WebS\");\n\t\tdesc4.putInteger(id29, 0);\n\t\tvar id30 = charIDToTypeID(\"TDth\"); //transparency dither\n\t\tvar id31 = charIDToTypeID(\"IRDt\");\n\t\tvar id32 = charIDToTypeID(\"None\");\n\t\tdesc4.putEnumerated(id30, id31, id32);\n\t\tvar id33 = charIDToTypeID(\"TDtA\");\n\t\tdesc4.putInteger(id33, 100);\n\t\tvar id34 = charIDToTypeID(\"Trns\"); //Transparency\n\t\tdesc4.putBoolean(id34, transparencyValue);\n\t\tvar id35 = charIDToTypeID(\"Mtt \");\n\t\tdesc4.putBoolean(id35, true); //matte\n\t\tvar id36 = charIDToTypeID(\"MttR\"); //matte color\n\t\tdesc4.putInteger(id36, 255);\n\t\tvar id37 = charIDToTypeID(\"MttG\");\n\t\tdesc4.putInteger(id37, 255);\n\t\tvar id38 = charIDToTypeID(\"MttB\");\n\t\tdesc4.putInteger(id38, 255);\n\t\tvar id39 = charIDToTypeID(\"SHTM\");\n\t\tdesc4.putBoolean(id39, false);\n\t\tvar id40 = charIDToTypeID(\"SImg\");\n\t\tdesc4.putBoolean(id40, true);\n\t\tvar id41 = charIDToTypeID(\"SSSO\");\n\t\tdesc4.putBoolean(id41, false);\n\t\tvar id42 = charIDToTypeID(\"SSLt\");\n\t\tvar list1 = new ActionList();\n\t\tdesc4.putList(id42, list1);\n\t\tvar id43 = charIDToTypeID(\"DIDr\");\n\t\tdesc4.putBoolean(id43, false);\n\t\tvar id44 = charIDToTypeID(\"In \");\n\t\tdesc4.putPath(id44, new File(exportInfo.destination + '/'+ exportHeader.imgDir + \"/\" + fileNameBody + \".png\"));\n\t\tvar id45 = stringIDToTypeID(\"SaveForWeb\");\n\t\tdesc3.putObject(id6, id45, desc4);\n\t\texecuteAction(id5, desc3, DialogModes.NO);\n\t}\n}", "function saveToImageFile() { \n const a = document.createElement('a')\n a.href = rcanvas.toDataURL()\n a.download = \"map.png\"\n document.body.appendChild(a)\n a.click()\n document.body.removeChild(a)\n console.log('file created!')\n rcanvas.parentNode.removeChild(rcanvas)\n }", "function save_and_export() {\r\n\r\n}", "function saveFrame() {\r\n canvasFrame = context.getImageData(0, 0, canvas.width, canvas.height);\r\n}", "function save() {\n\n //alert(\"save triggered! diagramId = \" + diagramId );\n Log.info('Save pressed');\n\n if (state == STATE_TEXT_EDITING) {\n currentTextEditor.destroy();\n currentTextEditor = null;\n state = STATE_NONE;\n }\n\n var dataURL = null;\n try {\n dataURL = renderedCanvas();\n }\n catch (e) {\n if (e.name === 'SecurityError' && e.code === 18) {\n /*This is usually happening as we load an image from another host than the one Diagramo is hosted*/\n alert(\"A figure contains an image loaded from another host. \\\n \\n\\nHint: \\\n \\nPlease make sure that the browser's URL (current location) is the same as the one saved in the DB.\");\n }\n }\n\n// Log.info(dataURL);\n// return false;\n if (dataURL == null) {\n Log.info('save(). Could not save. dataURL is null');\n alert(\"Could not save. \\\n \\n\\nHint: \\\n \\nCanvas's toDataURL() did not functioned properly \");\n return;\n }\n\n var diagram = {c: canvasProps, s: STACK, m: CONNECTOR_MANAGER, p: CONTAINER_MANAGER, v: DIAGRAMO.fileVersion};\n //Log.info('stringify ...');\n// var serializedDiagram = JSON.stringify(diagram, Util.operaReplacer);\n var serializedDiagram = JSON.stringify(diagram);\n// Log.error(\"Using Util.operaReplacer() somehow break the serialization. o[1,2] \\n\\\n// is transformed into o.['1','2']... so the serialization is broken\");\n// var serializedDiagram = JSON.stringify(diagram);\n //Log.info('JSON stringify : ' + serializedDiagram);\n\n var svgDiagram = toSVG();\n\n// alert(serializedDiagram);\n// alert(svgDiagram);\n //Log.info('SVG : ' + svgDiagram);\n\n //save the URLs of figures as a CSV\n var lMap = linkMap();\n\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"./common/controller.php\",\n {action: 'save', diagram: serializedDiagram, png: dataURL, linkMap: lMap, svg: svgDiagram, diagramId: currentDiagramId},\n function(data) {\n if (data === 'firstSave') {\n Log.info('firstSave!');\n window.location = './saveDiagram.php';\n }\n else if (data === 'saved') {\n //Log.info('saved!');\n alert('saved!');\n }\n else {\n alert('Unknown: ' + data);\n }\n }\n );\n\n\n}", "save(elementId){\n document.getElementById(elementId).addEventListener('click', () => {\n // prompt the user to name the file \n let name = prompt(\"name of file: \");\n if(name === \"\"){\n const date = new Date(); \n name = date.toISOString() + \"_funSketch_saveFile\";\n }else if(name === null){\n return;\n }\n const savedData = [];\n this.animationProj.frameList.forEach(function(frame){\n // get frame metadata\n const newFrame = frame.getMetadata();\n newFrame['layers'] = []; // list of objects\n frame.canvasList.forEach(function(layer){\n // get layer metadata\n const newLayer = {\n 'id': layer.id,\n 'width': layer.getAttribute(\"width\"),\n 'height': layer.getAttribute(\"height\"),\n 'zIndex': layer.style.zIndex,\n 'opacity': layer.style.opacity,\n };\n // add layer image data\n newLayer['imageData'] = layer.toDataURL();\n newFrame.layers.push(newLayer);\n });\n savedData.push(JSON.stringify(newFrame));\n });\n let json = \"[\\n\";\n json += savedData.join(\",\\n\"); // put a line break between each new object, which represents a frame\n json += \"\\n]\";\n // make a blob so it can be downloaded \n const blob = new Blob([json], { type: \"application/json\" });\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = name + \".json\";\n link.click();\n });\n }", "static saveFiles(){\n\t\treturn (context, arr) => {\n\t\t\tvar fs = context.createProvider(\"default:fs\");\n\t\t\tarr.each((file) => {\n\t\t\t\tLib.saveFile(fs, file);\n\t\t\t});\n\t\t\treturn arr;\n\t\t}\n\t}", "generateFile (entry) {\n this.reColorSVG('#CCCCCC');\n this.imageTemplate(this.encodedSVG());\n }", "function uslikaj() {\n html2canvas(document.querySelector(\".slika\")).then(function(canvas) {\n document.body.appendChild(canvas);\n document.querySelector(\"canvas\").className = \"uslikano\";\n document.querySelector(\"canvas\").prepend = \"Slika. Desnim klikom je spremi\";\n });\n}", "runConverter(){\n return this.getFiles().forEach((file) =>{\n file.convert();\n file.getScreenshots();\n });\n }", "function guardarComImatge() {\n document.getElementById(\"descargarImagen\").download = \"canvas.png\";\n document.getElementById(\"descargarImagen\").href = document\n .getElementById(\"canvas\")\n .toDataURL(\"image/png\");\n }", "constructor() {\n super()\n this.defaultExt = 'html'\n }", "function saveAsPNG() {\n // draw to canvas...\n drawingCanvas.toBlob(function(blob) {\n saveAs(blob, \"canvas.png\");\n });\n }", "function encodeAsImgAndLink(svg) {\n if ($.browser.msie) {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n window.winsvg = window.open('/static/html/export.html');\n window.winsvg.document.write(dummy.innerHTML);\n window.winsvg.document.body.style.margin = 0;\n } else {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n\n var b64 = Base64.encode(dummy.innerHTML);\n\n //window.winsvg = window.open(\"data:image/svg+xml;base64,\\n\"+b64);\n var html = \"<img style='height:100%;width:100%;' src='data:image/svg+xml;base64,\" + b64 + \"' />\"\n window.winsvg = window.open();\n window.winsvg.document.write(html);\n window.winsvg.document.body.style.margin = 0;\n }\n}", "phototaked(file) {}", "function copy_html(cb) {\n src(\"src/renderer/*.html\").pipe(dest(\"build/renderer\")).on(\"end\", cb);\n}", "function save(e) {\n render();\n let url = canvas.toDataURL();\n let image = new Image();\n image.src = url;\n let w = window.open();\n let a = document.createElement(\"a\");\n a.href = url;\n a.download = \"graph\";\n a.textContent = \"Download\";\n a.id = \"download\";\n setTimeout(function(){\n w.document.write(\"<title>Saved Image</title>\")\n w.document.write(image.outerHTML);\n w.document.write(a.outerHTML);\n w.document.write(`\n <style>\n body {\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n }\n img {\n margin: 1em;\n }\n #download {\n border-radius: .25em;\n padding: .5em;\n color: black; /*rgb(80, 235, 126)*/\n font-family: 'Segoe UI', Tahoma, Geneva, Verdana, Noto Sans, sans-serif;\n background: white;\n box-shadow: 2px 2px 5px 0 #0004;\n height: min-content;\n width: min-content;\n display: block;\n text-decoration: none;\n }\n #download:hover {\n box-shadow: 1px 1px 3px 0 #0004;\n }\n </style>\n `);\n }, 0);\n }", "onload() {}", "function shot() {\r\n //step 1: show description text of all tags\r\n showAllTags(taggd);\r\n //step 2: shot pic with tags\r\n html2canvas($(\"#mydiv\"), {\r\n \theight:$(\"#mydiv\").innerHeight(),\r\n onrendered:function (canvas) {\r\n \tvar stmFileName = getProPicName();\r\n var url = canvas.toDataURL();\r\n mui.post(ip+\"/proPic.do\",{\r\n \tcommand:\"savePicWithSpots\",\r\n \tbaseStr:(url.split(\",\"))[1],\r\n \tfileName:stmFileName,\r\n \tproPic:proPic\r\n },function(data){\r\n },\"json\");\r\n /* console.log(url);\r\n \tconsole.log($(\"#mydiv\").html());\r\n var triggerDownload = $(\"<a>\").attr(\"href\", url).attr(\"download\", Date.parse(new Date())+\".png\").appendTo(\"body\");\r\n triggerDownload[0].click();\r\n triggerDownload.remove();\r\n */\r\n }\r\n });\r\n //step 3: hide description text of all tags\r\n hideAllTags(taggd);\r\n }", "function convertSVGtoPNG() {\n var canvas = document.getElementById('the-canvas');\n var context = canvas.getContext('2d');\n canvas.width = triOptions.width();\n canvas.height = triOptions.height();\n\n var image = new Image();\n\n $(image).on(\"load\", function() {\n context.drawImage(image, 0, 0);\n $(\"#download-btn\").attr(\"href\", canvas.toDataURL(\"image/png\"));\n });\n\n image.src = currentPattern.dataUri;\n var imagePath = canvas.toDataURL(\"image/png\");\n \n \n\n }", "function doProcessExportLocally()\n {\n var counter = 0;\n var arrivedCounter = 0;\n\n //var myImage = document.createElement('img');\n //document.body.appendChild(myImage);\n\n\n //******************************************\n // Attention.\n // This line modifies the legacy code\n // of Highcharts.com.\n // This is the only change and the only\n // place were this change happens in\n // this application.\n Highcharts.downloadURL = downloadURL;\n //******************************************\n\n\n ///dataURL is a thing which can be assigned to href in <a href=...\n function downloadURL(dataURL, filename) {\n try{\n //console.log( filename );\n var piggyBackCounter = parseInt(filename);\n insertImage( dataURL, piggyBackCounter )\n // //\\\\ good debug\n //if( piggyBackCounter === 1 ) ccc( dataURL );\n //myImage.src = dataURL;\n //ccc( 'chart image ' + piggyBackCounter + ' added to pdfDoc-options' );\n // \\\\// good debug\n arrivedCounter++;\n if( arrivedCounter >= contCharts.length ) {\n //ccc( 'all charts are converted' );\n //not good to reset exporter set this way here: arrivedCounter = 0;\n\n //.missing this setTimeout and calling this function directly\n //.apparently creates repeated calls to exporter in\n //.case of the function errors and leading to big mess\n setTimeout( continueAfterChartsLoaded, 1 );\n } \n } catch (err) {\n ccc( 'err in downloadURL=', err );\n }\n };\n callLocalConverter();\n return;\n\n function callLocalConverter()\n {\n var chartRack = contCharts[counter];\n chartRack.options = ns.paste( chartRack.options,\n {\n exporting: {\n filename : ''+counter,\n fallbackToExportServer: false, //true,\n error: function() { ccc( 'error in exporting: ', arguments ); },\n enabled: false // hides button\n }\n });\n chartRack.options.chart.events =\n {\n load: function( event ) {\n //ccc( Date.now() +' after load');\n if( !this.userOptions.chart.forExport ) {\n //ccc( Date.now() +' starting export of chart ' + counter +\n // ' \"' + chartRack.options.title.text + '\"');\n // chartRack.options );\n this.exportChartLocal();\n\n //.make blob ... why?\n //this.exportChartLocal({ type: 'image/svg+xml' });\n\n //ccc( Date.now() +' exportChartLocal called' );\n }\n } \n };\n\n //ccc( 'exporting chart ' + counter + ' of ' + ( contCharts.length - 1 ) );\n //if( chartRack.options.chart.type === 'columnpyramid' )\n // chartRack.options.chart.type = 'column';\n\n var container = $$.div().to(document.body)\n .css('position', 'absolute' )\n .css('left', '-10000px' )\n ();\n Highcharts.chart( container, chartRack.options );\n counter++;\n\n if( counter < contCharts.length ) {\n ////perhaps this is good to split conversion a bit,\n ////this is why delay is 1 ms\n setTimeout( callLocalConverter, 1 );\n } \n }\n }", "putFile(path,data,callback) { this.engine.putFile(path,data,callback); }", "function downloadPNG(){\r\n\tcrackPoint.remove();\r\n\tpaper.view.update();\r\n var canvas = document.getElementById(\"paperCanvas\");\r\n var downloadLink = document.createElement(\"a\");\r\n downloadLink.href = canvas.toDataURL(\"image/png;base64\");\r\n downloadLink.download = simText+'.png';\r\n document.body.appendChild(downloadLink);\r\n downloadLink.click();\r\n document.body.removeChild(downloadLink);\r\n\tcrackPoint.insertAbove(concreteObjects[concreteObjects.length-1]);\r\n}", "function ImageTracer(){\n\tvar _this = this;\n\n\t////////////////////////////////////////////////////////////\n\t//\n\t// User friendly functions\n\t//\n\t////////////////////////////////////////////////////////////\n\t\n\t// Loading an image from a URL, tracing when loaded,\n\t// then executing callback with the scaled svg string as argument\n\tthis.imageToSVG=function(url,callback,options){\n\t\toptions = options || {}; _this.checkoptions(options);\n\t\t// loading image, tracing and callback\n\t\t_this.loadImage(url,\n\t\t\tfunction(canvas){\n\t\t\t\tcallback(\n\t\t\t\t\t_this.imagedataToSVG( _this.getImgdata(canvas),options )\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t},// End of imageToSVG()\n\t\n\t// Tracing imagedata, then returning the scaled svg string\n\tthis.imagedataToSVG=function(imgd,options){\n\t\toptions = options || {}; _this.checkoptions(options);\n\t\t// tracing imagedata\n\t\tvar td = _this.imagedataToTracedata(imgd,options);\n\t\t// returning SVG string\n\t\treturn _this.getsvgstring( \n\t\t\t\timgd.width*options.scale, imgd.height*options.scale, \n\t\t\t\ttd.layers, td.palette, td.background, \n\t\t\t\toptions.scale, options.lcpr, options.qcpr);\n\t\n\t},// End of imagedataToSVG()\n\t\n\t// Loading an image from a URL, tracing when loaded,\n\t// then executing callback with tracedata as argument\n\tthis.imageToTracedata=function(url,callback,options){\n\t\toptions = options || {}; _this.checkoptions(options);\n\t\t// loading image, tracing and callback\n\t\t_this.loadImage(url,\n\t\t\t\tfunction(canvas){\n\t\t\t\t\tcallback(\n\t\t\t\t\t\t_this.imagedataToTracedata(_this.getImgdata(canvas),options)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t);\t\n\t},// End of imageToTracedata()\n\t\n\t// Tracing imagedata, then returning tracedata \n\t// (layers with paths, palette, background color number)\n\tthis.imagedataToTracedata=function(imgd,options){\n\t\toptions = options || {}; _this.checkoptions(options);\n\t\t\n\t\t// 1. Color quantization \n\t\tvar cq = _this.colorquantization(imgd,options.pal,options.numberofcolors,options.mincolorratio,options.colorquantcycles);\n\t\t\n\t\t// 2. Layer separation and edge detection\n\t\tvar ls = _this.layering(cq.array);\n\t\t\n\t\t// Optional visualization\n\t\tif(options.layercontainerid){\n\t\t\t_this.drawLayers(ls,_this.generatepalette(16),4,options.layercontainerid);\n\t\t}\n\t\t\n\t\t// 3. Batch pathscan\n\t\tvar bps = _this.batchpathscan(ls,options.pathomit);\n\t\t\n\t\t// 4. Batch interpollation\n\t\tvar bis = _this.batchinternodes(bps);\n\t\t\n\t\t// 5. Batch tracing\n\t\treturn {\n\t\t\t'layers':_this.batchtracelayers(bis,options.ltres,options.qtres),\n\t\t\t'palette':cq.palette,\n\t\t\t'background':cq.background\n\t\t};\n\t\t\n\t},// End of imagedataToTracedata()\n\t\n\t// creating options object, setting defaults for missing values\n\tthis.checkoptions=function(options){\n\t\toptions = options || {};\n\t\t// Defaults for optional parameters\n\t\t// Tracing\n\t\toptions.ltres = options.ltres || 1;\n\t\toptions.qtres = options.qtres || 1;\n\t\toptions.pathomit = options.pathomit || 8;\n\t\t// Color quantization\n\t\toptions.numberofcolors = options.numberofcolors || 16;\n\t\toptions.mincolorratio = options.mincolorratio || 0.02;\n\t\toptions.colorquantcycles = options.colorquantcycles || 3;\n\t\t// options.pal is not defined here\n\t\t// SVG rendering\n\t\toptions.scale = options.scale || 1;\n\t\toptions.lcpr = options.lcpr || 0;\n\t\toptions.qcpr = options.qcpr || 0;\n\t\t// options.layercontainerid is not defined here\n\t\t\n\t},// End of checkoptions()\n\t\n\t////////////////////////////////////////////////////////////\n\t//\n\t// Vectorizing functions\n\t//\n\t////////////////////////////////////////////////////////////\n\t\n\t// 1. Color quantization\n\t// Using a form of k-means clustering repeatead 'cycles' times. http://en.wikipedia.org/wiki/Color_quantization\n\tthis.colorquantization=function(imgd,pal,numberofcolors,minratio,cycles){\n\t\tvar arr = [], idx=0, cd,cdl,ci,c1,c2,c3, paletteacc = [];\n\t\tcycles=cycles||3; minratio=minratio||0.2; numberofcolors=numberofcolors||16;\n\t\t\n\t\t// Use custom palette if pal is defined or generate custom length palette\n\t\tvar palette = pal || _this.generatepalette(numberofcolors);\n\t\t\n\t\t// Repeat clustering step 'cycles' times\n\t\tfor(var cnt=0;cnt<cycles;cnt++){\n\t\t\t\n\t\t\t// Reseting palette accumulator for averaging\n\t\t\tfor(var i=0;i<palette.length;i++){paletteacc[i]={};paletteacc[i].r=0;paletteacc[i].g=0;paletteacc[i].b=0;paletteacc[i].n=0;}\n\t\t\t\n\t\t\t// loop through all pixels\n\t\t\tfor(var j=0;j<imgd.height;j++){\n\t\t\t\tarr[j]=[];\n\t\t\t\tfor(var i=0;i<imgd.width;i++){\n\t\t\t\t\t\n\t\t\t\t\tidx = (j*imgd.width+i)*4;\n\t\t\t\t\t// find closest color from palette\n\t\t\t\t\tcdl = 256+256+256; ci=0;\n\t\t\t\t\tfor(var k=0;k<palette.length;k++){\t\n\t\t\t\t\t\t// In my experience, https://en.wikipedia.org/wiki/Rectilinear_distance works better than https://en.wikipedia.org/wiki/Euclidean_distance\n\t\t\t\t\t\tc1 = Math.abs(palette[k].r-imgd.data[idx]);\n\t\t\t\t\t\tc2 = Math.abs(palette[k].g-imgd.data[idx+1]);\n\t\t\t\t\t\tc3 = Math.abs(palette[k].b-imgd.data[idx+2]);\n\t\t\t\t\t\tcd = c1+c2+c3;\n\t\t\t\t\t\tif(cd<cdl){\n\t\t\t\t\t\t\tcdl = cd; ci = k;\n\t\t\t\t\t\t}\n\t\t\t\t\t}// End of palette loop\n\t\t\t\t\t\n\t\t\t\t\t// add to palettacc\n\t\t\t\t\tpaletteacc[ci].r += imgd.data[idx];\n\t\t\t\t\tpaletteacc[ci].g += imgd.data[idx+1];\n\t\t\t\t\tpaletteacc[ci].b += imgd.data[idx+2];\n\t\t\t\t\tpaletteacc[ci].n++;\n\t\t\t\t\t\n\t\t\t\t\tarr[j][i] = ci; \n\t\t\t\t}// End of i loop\n\t\t\t}// End of j loop\n\t\t\t\n\t\t\t// averaging paletteacc for palette\n\t\t\tvar ratio;\n\t\t\tfor(var k=0;k<palette.length;k++){\n\t\t\t\t// averaging\n\t\t\t\tif(paletteacc[k].n>0){\n\t\t\t\t\tpalette[k].r = Math.floor(paletteacc[k].r/paletteacc[k].n);\n\t\t\t\t\tpalette[k].g = Math.floor(paletteacc[k].g/paletteacc[k].n);\n\t\t\t\t\tpalette[k].b = Math.floor(paletteacc[k].b/paletteacc[k].n);\n\t\t\t\t}\n\t\t\t\tratio = paletteacc[k].n/(imgd.width*imgd.height);\n\t\t\t\t//console.log('color '+k+' '+torgbstr(palette[k]) +' pixels '+paletteacc[k].n+' pixel ratio '+ratio);\n\t\t\t\t\n\t\t\t\t// Randomizing a color, if there are too few pixels and there will be a new cycle\n\t\t\t\tif((ratio<minratio)&&(cnt<cycles-1)){\n\t\t\t\t\tpalette[k].r = Math.floor(Math.random()*255);\n\t\t\t\t\tpalette[k].g = Math.floor(Math.random()*255);\n\t\t\t\t\tpalette[k].b = Math.floor(Math.random()*255);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}// End of palette loop\n\t\t\t\n\t\t}// End of Repeat clustering step 'cycles' times\n\t\t\n\t\treturn {'array':arr,'palette':palette,'background':arr[0][0]};\n\t},// End of colorquantization()\n\t\n\t// Generating a palette with numberofcolors\n\tthis.generatepalette=function(numberofcolors){\n\t\tvar palette = [];\n\t\tif(numberofcolors<8){ \n\t\t\t\n\t\t\t// Grayscale\n\t\t\tvar graystep = Math.floor(255/(numberofcolors-1));\n\t\t\tfor(var ccnt=0;ccnt<numberofcolors;ccnt++){\n\t\t\t\tpalette.push({'r':ccnt*graystep,'g':ccnt*graystep,'b':ccnt*graystep,'a':255});\n\t\t\t}\n\t\t\t\n\t\t}else{ \n\t\t\t\n\t\t\t// RGB color cube\n\t\t\tvar colorqnum = Math.floor(Math.pow(numberofcolors, 1/3)), // Number of points on each edge on the RGB color cube\n\t\t\tcolorstep = Math.floor(255/(colorqnum-1)), // distance between points\n\t\t\trndnum = numberofcolors - colorqnum*colorqnum*colorqnum; // number of random colors\n\t\t\tfor(var rcnt=0;rcnt<colorqnum;rcnt++){\n\t\t\t\tfor(var gcnt=0;gcnt<colorqnum;gcnt++){\n\t\t\t\t\tfor(var bcnt=0;bcnt<colorqnum;bcnt++){\n\t\t\t\t\t\tvar newr = rcnt*colorstep, newg = gcnt*colorstep, newb = bcnt*colorstep,\n\t\t\t\t\t\tnewcolor = {'r':newr,'g':newg,'b':newb,'a':255};\n\t\t\t\t\t\tpalette.push(newcolor);\n\t\t\t\t\t}// End of blue loop\n\t\t\t\t}// End of green loop\n\t\t\t}// End of red loop\n\t\t\t\n\t\t\t// Rest is random\n\t\t\tfor(var rcnt=0;rcnt<rndnum;rcnt++){\n\t\t\t\tpalette.push({'r':Math.floor(Math.random()*255),'g':Math.floor(Math.random()*255),'b':Math.floor(Math.random()*255),'a':255});\n\t\t\t}\n\n\t\t}// End of numberofcolors check\n\t\t\n\t\treturn palette;\n\t},// End of generatepalette()\n\t\n\t// 2. Layer separation and edge detection\n\t// Edge node types ( ▓:light or 1; ░:dark or 0 )\n\t// 12 ░░ ▓░ ░▓ ▓▓ ░░ ▓░ ░▓ ▓▓ ░░ ▓░ ░▓ ▓▓ ░░ ▓░ ░▓ ▓▓\n\t// 48 ░░ ░░ ░░ ░░ ░▓ ░▓ ░▓ ░▓ ▓░ ▓░ ▓░ ▓░ ▓▓ ▓▓ ▓▓ ▓▓\n\t// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\t//\n\tthis.layering=function(arr){\n\t\t// Creating layers for each indexed color in arr\n\t\tvar layers = {}, val=0, ah = arr.length, aw = arr[0].length, n1,n2,n3,n4,n5,n6,n7,n8;\n\t\tfor(var j=0;j<ah;j++){\n\t\t\tfor(var i=0;i<aw;i++){\n\t\t\t\t\n\t\t\t\t// This pixel's indexed color\n\t\t\t\tval = arr[j][i];\n\t\t\t\t// Create new layer if there's no one with this indexed color\n\t\t\t\tif(!layers.hasOwnProperty(val)){\n\t\t\t\t\tlayers[val] = [];\n\t\t\t\t\tfor(var lj=0;lj<=arr.length;lj++){\n\t\t\t\t\t\tlayers[val][lj] = [];\n\t\t\t\t\t\tfor(var li=0;li<=arr[0].length;li++){\n\t\t\t\t\t\t\tlayers[val][lj][li]=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Node types\n\t\t\t\t\n\t\t\t\t// Are neighbor pixel colors the same?\n\t\t\t\tif((j>0)&&(i>0)){ n1 = arr[j-1][i-1]===val?1:0; }else{ n1 =0; }\n\t\t\t\tif(j>0){ n2 = arr[j-1][i]===val?1:0; }else{ n2 =0; }\n\t\t\t\tif((j>0)&&(i<aw-1)){ n3 = arr[j-1][i+1]===val?1:0; }else{ n3 =0; }\n\t\t\t\tif(i>0){ n4 = arr[j][i-1]===val?1:0; }else{ n4 = 0; }\n\t\t\t\tif(i<aw-1){ n5 = arr[j][i+1]===val?1:0; }else{ n5 = 0; }\n\t\t\t\tif((j<ah-1)&&(i>0)){ n6 = arr[j+1][i-1]===val?1:0; }else{ n6 = 0; }\n\t\t\t\tif(j<ah-1){ n7 = arr[j+1][i]===val?1:0; }else{ n7 = 0; }\n\t\t\t\tif((j<ah-1)&&(i<aw-1)){ n8 = arr[j+1][i+1]===val?1:0; }else{ n8 = 0; }\n\t\t\t\t\n\t\t\t\t// this pixel's type and looking back on previous pixels\n\t\t\t\tlayers[val][j+1][i+1] = 1 + n5 * 2 + n8 * 4 + n7 * 8 ;\n\t\t\t\tif(!n4){ layers[val][j+1][i] = 0 + 2 + n7 * 4 + n6 * 8 ; }\n\t\t\t\tif(!n2){ layers[val][j][i+1 ] = 0 + n3*2 + n5 * 4 + 8 ; }\n\t\t\t\tif(!n1){ layers[val][j][i] = 0 + n2*2 + 4 + n4 * 8 ; }\n\t\t\t\t\n\t\t\t}// End of i loop\n\t\t}// End of j loop\n\t\t\t\n\t\treturn layers;\n\t},// End of layering()\n\t\n\t\n\t// 3. Walking through an edge node array, discarding edge node types 0 and 15 and creating paths from the rest.\n\t// Walk directions (dir): 0 > ; 1 ^ ; 2 < ; 3 v \n\t// Edge node types ( ▓:light or 1; ░:dark or 0 )\n\t// ░░ ▓░ ░▓ ▓▓ ░░ ▓░ ░▓ ▓▓ ░░ ▓░ ░▓ ▓▓ ░░ ▓░ ░▓ ▓▓\n\t// ░░ ░░ ░░ ░░ ░▓ ░▓ ░▓ ░▓ ▓░ ▓░ ▓░ ▓░ ▓▓ ▓▓ ▓▓ ▓▓\n\t// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15\n\t//\n\tthis.pathscan=function(arr,pathomit){\n\t\tpathomit=pathomit||8;\n\t\tvar paths=[], pacnt=0,pcnt=0,px=0,py=0,w=arr[0].length,h=arr.length,dir=0,pathfinished=true,stepcnt=0,maxsteps=w*h*2;\n\t\t\n\t\tfor(var j=0;j<h;j++){\n\t\t\tfor(var i=0;i<w;i++){\n\t\t\t\tif((arr[j][i]===0)||(arr[j][i]===15)){// Discard\n\t\t\t\t\tstepcnt++;\n\t\t\t\t}else{// Follow path\n\t\t\t\t\t\n\t\t\t\t\t// Init\n\t\t\t\t\tpx = i; py = j;\n\t\t\t\t\tpaths[pacnt] = [];\n\t\t\t\t\tpathfinished = false;\n\t\t\t\t\tpcnt=0;\n\t\t\t\t\t// fill paths will be drawn, but hole paths are also required to remove unnecessary edge nodes\n\t\t\t\t\tif(arr[py][px]===1){dir = 0;}\n\t\t\t\t\tif(arr[py][px]===2){dir = 3;}\n\t\t\t\t\tif(arr[py][px]===3){dir = 0;}\n\t\t\t\t\tif(arr[py][px]===4){dir = 1; paths[pacnt].type = 'fill';}\n\t\t\t\t\tif(arr[py][px]===5){dir = 0;}\n\t\t\t\t\tif(arr[py][px]===6){dir = 3;}\n\t\t\t\t\tif(arr[py][px]===7){dir = 0; paths[pacnt].type = 'hole';}\n\t\t\t\t\tif(arr[py][px]===8){dir = 0;}\n\t\t\t\t\tif(arr[py][px]===9){dir = 3;}\n\t\t\t\t\tif(arr[py][px]===10){dir = 3;}\n\t\t\t\t\tif(arr[py][px]===11){dir = 1;paths[pacnt].type = 'hole';}\n\t\t\t\t\tif(arr[py][px]===12){dir = 0;}\n\t\t\t\t\tif(arr[py][px]===13){dir = 3;paths[pacnt].type = 'hole';}\n\t\t\t\t\tif(arr[py][px]===14){dir = 0;paths[pacnt].type = 'hole';}\n\t\t\t\t\t// Path points loop\n\t\t\t\t\twhile(!pathfinished){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// New path point\n\t\t\t\t\t\tpaths[pacnt][pcnt] = {};\n\t\t\t\t\t\tpaths[pacnt][pcnt].x = px;\n\t\t\t\t\t\tpaths[pacnt][pcnt].y = py;\n\t\t\t\t\t\tpaths[pacnt][pcnt].t = arr[py][px];\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Node types\n\t\t\t\t\t\tif(arr[py][px]===1){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===0){\n\t\t\t\t\t\t\t\tpy--;dir=1; \n\t\t\t\t\t\t\t}else if(dir===3){\n\t\t\t\t\t\t\t\tpx--;dir=2; \n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(arr[py][px]===2){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===3){\n\t\t\t\t\t\t\t\tpx++;dir=0; \n\t\t\t\t\t\t\t}else if(dir===2){\n\t\t\t\t\t\t\t\tpy--;dir=1; \n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if(arr[py][px]===3){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===0){\n\t\t\t\t\t\t\t\tpx++;\n\t\t\t\t\t\t\t}else if(dir===2){\n\t\t\t\t\t\t\t\tpx--;\n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(arr[py][px]===4){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===1){\n\t\t\t\t\t\t\t\tpx++;dir=0; \n\t\t\t\t\t\t\t}else if(dir===2){\n\t\t\t\t\t\t\t\tpy++;dir=3; \n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(arr[py][px]===5){\n\t\t\t\t\t\t\tif(dir===0){\n\t\t\t\t\t\t\t\tarr[py][px] = 13;py++;dir=3; \n\t\t\t\t\t\t\t}else if(dir===1){\n\t\t\t\t\t\t\t\tarr[py][px] = 13;px--;dir=2; \n\t\t\t\t\t\t\t}else if(dir===2){\n\t\t\t\t\t\t\t\tarr[py][px] = 7;py--;dir=1; \n\t\t\t\t\t\t\t}else if(dir===3){\n\t\t\t\t\t\t\t\tarr[py][px] = 7;px++;dir=0; \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(arr[py][px]===6){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===1){\n\t\t\t\t\t\t\t\tpy--;\n\t\t\t\t\t\t\t}else if(dir===3){\n\t\t\t\t\t\t\t\tpy++;\n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if(arr[py][px]===7){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===0){\n\t\t\t\t\t\t\t\tpy++;dir=3; \n\t\t\t\t\t\t\t}else if(dir===1){\n\t\t\t\t\t\t\t\tpx--;dir=2; \n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(arr[py][px]===8){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===0){\n\t\t\t\t\t\t\t\tpy++;dir=3; \n\t\t\t\t\t\t\t}else if(dir===1){\n\t\t\t\t\t\t\t\tpx--;dir=2; \n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(arr[py][px]===9){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===1){\n\t\t\t\t\t\t\t\tpy--;\n\t\t\t\t\t\t\t}else if(dir===3){\n\t\t\t\t\t\t\t\tpy++;\n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(arr[py][px]===10){\n\t\t\t\t\t\t\tif(dir===0){\n\t\t\t\t\t\t\t\tarr[py][px] = 11;py--;dir=1; \n\t\t\t\t\t\t\t}else if(dir===1){\n\t\t\t\t\t\t\t\tarr[py][px] = 14;px++;dir=0; \n\t\t\t\t\t\t\t}else if(dir===2){\n\t\t\t\t\t\t\t\tarr[py][px] = 14;py++;dir=3; \n\t\t\t\t\t\t\t}else if(dir===3){\n\t\t\t\t\t\t\t\tarr[py][px] = 11;px--;dir=2; \n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\telse if(arr[py][px]===11){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===1){\n\t\t\t\t\t\t\t\tpx++;dir=0; \n\t\t\t\t\t\t\t}else if(dir===2){\n\t\t\t\t\t\t\t\tpy++;dir=3; \n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(arr[py][px]===12){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===0){\n\t\t\t\t\t\t\t\tpx++;\n\t\t\t\t\t\t\t}else if(dir===2){\n\t\t\t\t\t\t\t\tpx--;\n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(arr[py][px]===13){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===2){\n\t\t\t\t\t\t\t\tpy--;dir=1; \n\t\t\t\t\t\t\t}else if(dir===3){\n\t\t\t\t\t\t\t\tpx++;dir=0; \n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\telse if(arr[py][px]===14){\n\t\t\t\t\t\t\tarr[py][px] = 0;\n\t\t\t\t\t\t\tif(dir===0){\n\t\t\t\t\t\t\t\tpy--;dir=1; \n\t\t\t\t\t\t\t}else if(dir===3){\n\t\t\t\t\t\t\t\tpx--;dir=2; \n\t\t\t\t\t\t\t}else{console.log('Invalid dir '+dir+' on px '+px+' py '+py);pathfinished=true;paths.pop();pacnt--;}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Close path\n\t\t\t\t\t\tif((px===paths[pacnt][0].x)&&(py===paths[pacnt][0].y)){ \n\t\t\t\t\t\t\tpathfinished = true;\n\t\t\t\t\t\t\t// Discarding 'hole' type paths\n\t\t\t\t\t\t\tif(paths[pacnt].type==='hole'){\n\t\t\t\t\t\t\t\tpaths.pop();pacnt--;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Discarding if path is shorter than pathomit\n\t\t\t\t\t\t\tif(paths[pacnt].length<pathomit){\n\t\t\t\t\t\t\t\tpaths.pop();pacnt--;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Error: path going out of image\n\t\t\t\t\t\tif((px<0)||(px>=w)||(py<0)||(py>=h)){\n\t\t\t\t\t\t\tpathfinished = true;\n\t\t\t\t\t\t\tconsole.log('path '+pacnt+' error w '+w+' h '+h+' px '+px+' py '+py);\n\t\t\t\t\t\t\tpaths.pop();pacnt--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Error: stepcnt>maxsteps\n\t\t\t\t\t\tif(stepcnt>maxsteps){\n\t\t\t\t\t\t\tpathfinished = true;\n\t\t\t\t\t\t\tconsole.log('path '+pacnt+' error stepcnt '+stepcnt+' maxsteps '+maxsteps+' px '+px+' py '+py);\n\t\t\t\t\t\t\tpaths.pop();pacnt--;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tstepcnt++;\n\t\t\t\t\t\tpcnt++;\n\t\t\t\t\t\t\n\t\t\t\t\t}// End of Path points loop\n\t\t\t\t\tpacnt++;\n\t\t\t\t\t\n\t\t\t\t}// End of Follow path\n\t\t\t\t\n\t\t\t}// End of i loop\n\t\t}// End of j loop\n\t\t\n\t\treturn paths;\n\t},// End of pathscan()\n\n\t// 3. Batch pathscan\n\tthis.batchpathscan=function(layers,pathomit){\n\t\tpathomit=pathomit||8;\n\t\tvar bpaths = [];\n\t\tfor (k in layers) {\n\t\t\tif(!layers.hasOwnProperty(k)){ continue; }\n\t\t\tbpaths[k] = _this.pathscan(layers[k],pathomit);\n\t\t}\n\t\treturn bpaths;\n\t},\n\t\n\t// 4. interpollating between path points for nodes with 8 directions ( East, SouthEast, S, SW, W, NW, N, NE )\n\tthis.internodes=function(paths){\n\t\tvar ins = [], palen=0,nextidx=0;\n\t\t// paths loop\n\t\tfor(var pacnt=0;pacnt<paths.length;pacnt++){\n\t\t\tins[pacnt]=[];\n\t\t\tins[pacnt].type = paths[pacnt].type;\n\t\t\tpalen = paths[pacnt].length;\n\t\t\t// pathpoints loop\n\t\t\tfor(var pcnt=0;pcnt<palen;pcnt++){\n\t\t\t\n\t\t\t\t// interpolate between two path points\n\t\t\t\tnextidx = (pcnt+1)%palen;\n\t\t\t\tins[pacnt][pcnt]={};\n\t\t\t\tins[pacnt][pcnt].x = (paths[pacnt][pcnt].x+paths[pacnt][nextidx].x) /2;\n\t\t\t\tins[pacnt][pcnt].y = (paths[pacnt][pcnt].y+paths[pacnt][nextidx].y) /2;\n\t\t\t\t\n\t\t\t\t// line segment direction to the next point\n\t\t\t\tif(paths[pacnt][pcnt].x<paths[pacnt][nextidx].x){ \n\t\t\t\t\tif(paths[pacnt][pcnt].y<paths[pacnt][nextidx].y){ ins[pacnt][pcnt].linesegment = 1; // SouthEast\n\t\t\t\t\t}else if(paths[pacnt][pcnt].y>paths[pacnt][nextidx].y){ ins[pacnt][pcnt].linesegment = 7; // NE\n\t\t\t\t\t}else{ ins[pacnt][pcnt].linesegment = 0; } // E\n\t\t\t\t}else if(paths[pacnt][pcnt].x>paths[pacnt][nextidx].x){\n\t\t\t\t\tif(paths[pacnt][pcnt].y<paths[pacnt][nextidx].y){ ins[pacnt][pcnt].linesegment = 3; // SW\n\t\t\t\t\t}else if(paths[pacnt][pcnt].y>paths[pacnt][nextidx].y){ ins[pacnt][pcnt].linesegment = 5; // NW\n\t\t\t\t\t}else{ ins[pacnt][pcnt].linesegment = 4; } // N\n\t\t\t\t}else{\n\t\t\t\t\tif(paths[pacnt][pcnt].y<paths[pacnt][nextidx].y){ ins[pacnt][pcnt].linesegment = 2; // S\n\t\t\t\t\t}else if(paths[pacnt][pcnt].y>paths[pacnt][nextidx].y){ ins[pacnt][pcnt].linesegment = 6; // N\n\t\t\t\t\t}else{ ins[pacnt][pcnt].linesegment = 8; }// center, this should not happen\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}// End of pathpoints loop \n\t\t\t\t\t\t\n\t\t}// End of paths loop\n\t\t\n\t\treturn ins;\n\t},// End of internodes()\n\t\n\t// 4. Batch interpollation\n\tthis.batchinternodes=function(bpaths){\n\t\tvar binternodes = [];\n\t\tfor (k in bpaths) {\n\t\t\tif(!bpaths.hasOwnProperty(k)){ continue; }\n\t\t\tbinternodes[k] = _this.internodes(bpaths[k]);\n\t\t}\n\t\treturn binternodes;\n\t},\n\t\n\t// 5. tracepath() : recursively trying to fit straight and quadratic spline segments on the 8 direction internode path\n\t\n\t// 1. Apply only 1 smoothing to original path, so there will be 8 segment types: East, SouthEast, S, SW, W, NW, N, NE, between the new points\n\t// 2. Find sequences of points with only 2 segment types\n\t// 3. Fit a straight line on the sequence\n\t// 4. If the straight line fails (an error>ltreshold), find the point with the biggest error\n\t// 5. Fit a quadratic spline through errorpoint (project this to get controlpoint), then measure errors on every point in the sequence\n\t// 6. If the spline fails (an error>qtreshold), find the point with the biggest error\n\t// 7. Set splitpoint = (fitting point + errorpoint)/2\n\t// 8. Split sequence and recursively apply 3. - 7. to startpoint-splitpoint and splitpoint-endpoint sequences\n\t// 9. TODO? If splitpoint-endpoint is a spline, try to add new points from the next sequence\n\tthis.tracepath=function(path,ltreshold,qtreshold){\n\t\tif(path.length<3){return {'segments':[],'type':'transparent'};}\n\t\tvar pcnt=0,segtype1,segtype2,seqend,smp=[];\n\t\twhile(pcnt<path.length){\n\t\t\t// 2. Find sequences of points with only 2 segment types\n\t\t\tsegtype1 = path[pcnt].linesegment; segtype2 = -1; seqend=pcnt+1;\n\t\t\twhile(((path[seqend].linesegment===segtype1)||(path[seqend].linesegment===segtype2)||(segtype2===-1))&&(seqend<path.length-1)){\n\t\t\t\tif((path[seqend].linesegment!==segtype1)&&(segtype2===-1)){segtype2 = path[seqend].linesegment;}\n\t\t\t\tseqend++;\n\t\t\t}\n\t\t\t// 3. - 8. Split sequence and recursively apply 3. - 7. to startpoint-splitpoint and splitpoint-endpoint sequences\n\t\t\tsmp = smp.concat(_this.fitseq(path,ltreshold,qtreshold,pcnt,seqend));\n\t\t\t// 9. If splitpoint-endpoint is a spline, try to add new points from the next sequence\n\t\t\t// TODO?\n\t\t\t\n\t\t\t// forward pcnt;\n\t\t\tpcnt = seqend;\n\t\t\t\n\t\t\t// check if there are enough remaining points\n\t\t\tif(pcnt>path.length-3){\n\t\t\t\tif(pcnt===path.length-2){\n\t\t\t\t\tsmp.push({'type':'Q', 'x1':path[pcnt].x,'y1':path[pcnt].y, 'x2':path[path.length-1].x,'y2':path[path.length-1].y, 'x3':path[0].x,'y3':path[0].y});\n\t\t\t\t\tpcnt = path.length;\n\t\t\t\t}else{\n\t\t\t\t\tsmp.push({'type':'L', 'x1':path[pcnt].x,'y1':path[pcnt].y, 'x2':path[0].x,'y2':path[0].y});\n\t\t\t\t\tpcnt = path.length;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}// End of pcnt loop\n\t\t\n\t\treturn {'segments':smp,'type':path.type};\n\t\t\n\t},// End of tracepath()\n\t\t\n\t// 5. recursively fitting a straight or quadratic line segment on this sequence of path nodes, called from tracepath()\n\tthis.fitseq=function(path,ltreshold,qtreshold,seqstart,seqend){\n\t\t// return if 0 length\n\t\tif(seqstart>=seqend){return [];}\n\t\t\n\t\tvar errorpoint=seqstart, errorval=0, curvepass=true, px, py, dist2;\n\t\tvar vx = (path[seqend].x-path[seqstart].x) / (seqend-seqstart), vy = (path[seqend].y-path[seqstart].y) / (seqend-seqstart);\n\t\t\n\t\t// 3. Fit a straight line on the sequence\n\t\tfor(var pcnt=seqstart+1;pcnt<seqend;pcnt++){\n\t\t\tpx = path[seqstart].x + vx * (pcnt-seqstart); py = path[seqstart].y + vy * (pcnt-seqstart);\n\t\t\tdist2 = (path[pcnt].x-px)*(path[pcnt].x-px) + (path[pcnt].y-py)*(path[pcnt].y-py);\n\t\t\tif(dist2>ltreshold){curvepass=false;}\n\t\t\tif(dist2>errorval){ errorpoint=pcnt; errorval=dist2; }\n\t\t\tpcnt++;\n\t\t}\n\t\t// return straight line if fits\n\t\tif(curvepass){return [{'type':'L', 'x1':path[seqstart].x,'y1':path[seqstart].y, 'x2':path[seqend].x,'y2':path[seqend].y}]; }\n\t\t\n\t\t// 4. If the straight line fails (an error>ltreshold), find the point with the biggest error\n\t\tvar fitpoint = errorpoint; curvepass = true; errorval = 0;\n\t\t\n\t\t// 5. Fit a quadratic spline through this point, measure errors on every point in the sequence\n\t\t// helpers and projecting to get control point\n\t\tvar t=(fitpoint-seqstart)/(seqend-seqstart), t1=(1-t)*(1-t), t2=2*(1-t)*t, t3=t*t;\n\t\tvar cpx = (t1*path[seqstart].x + t3*path[seqend].x - path[fitpoint].x)/-t2 ,\n\t\t\tcpy = (t1*path[seqstart].y + t3*path[seqend].y - path[fitpoint].y)/-t2 ;\t\n\t\t// Check every point\n\t\tfor(var pcnt=seqstart+2;pcnt<seqend-1;pcnt++){\n\t\t\t\n\t\t\tt=(pcnt-seqstart)/(seqend-seqstart); t1=(1-t)*(1-t); t2=2*(1-t)*t; t3=t*t;\n\t\t\tpx = t1*path[seqstart].x+t2*cpx+t3*path[seqend].x; py = t1*path[seqstart].y+t2*cpy+t3*path[seqend].y;\n\t\t\t\n\t\t\tdist2 = (path[pcnt].x-px)*(path[pcnt].x-px) + (path[pcnt].y-py)*(path[pcnt].y-py);\n\t\t\t\n\t\t\tif(dist2>qtreshold){curvepass=false;}\n\t\t\tif(dist2>errorval){ errorpoint=pcnt; errorval=dist2; }\n\t\t\tpcnt++;\n\t\t}\n\t\t// return spline if fits\n\t\tif(curvepass){return [{'type':'Q', 'x1':path[seqstart].x,'y1':path[seqstart].y, 'x2':cpx,'y2':cpy, 'x3':path[seqend].x,'y3':path[seqend].y}]; }\n\t\t\n\t\t// 6. If the spline fails (an error>qtreshold), find the point with the biggest error\n\t\t// 7. Set splitpoint = (fitting point + errorpoint)/2\n\t\tvar splitpoint = Math.floor((fitpoint + errorpoint)/2);\n\t\t\n\t\t// 8. Split sequence and recursively apply 3. - 7. to startpoint-splitpoint and splitpoint-endpoint sequences\n\t\tvar sm = _this.fitseq(path,ltreshold,qtreshold,seqstart,splitpoint);\n\t\tsm = sm.concat(_this.fitseq(path,ltreshold,qtreshold,splitpoint,seqend));\n\t\treturn sm;\n\t\t\n\t},// End of fitseq()\n\t\n\t// 5. Batch tracing paths\n\tthis.batchtracepaths=function(internodepaths,ltres,qtres){\n\t\tvar btracedpaths = []; \n\t\tfor(var pacnt=0;pacnt<internodepaths.length;pacnt++){ \n\t\t\tbtracedpaths.push( _this.tracepath(internodepaths[pacnt],ltres,qtres) ); \n\t\t}\n\t\treturn btracedpaths;\n\t},\n\t\n\t// 5. Batch tracing layers\n\tthis.batchtracelayers=function(binternodes,ltres,qtres){\n\t\tvar btbis = [];\n\t\tfor (k in binternodes) {\n\t\t\tif(!binternodes.hasOwnProperty(k)){ continue; }\n\t\t\tbtbis[k] = _this.batchtracepaths(binternodes[k],ltres,qtres);\n\t\t}\n\t\treturn btbis;\n\t},\n\t\n\t////////////////////////////////////////////////////////////\n\t//\n\t// SVG Drawing functions\n\t//\n\t////////////////////////////////////////////////////////////\n\t\n\t// Getting SVG path element string from a traced path\n\tthis.svgpathstring=function(desc,segments,fillcolor,sc,lcpr,qcpr){\n\t\t// Path\n\t\tvar str = '<path fill=\"'+fillcolor+'\" stroke=\"'+fillcolor+'\" stroke-width=\"1\" desc=\"'+desc+'\" d=\"';\n\t\tstr += 'M'+segments[0].x1*sc+' '+segments[0].y1*sc+' ';\n\t\tfor(var pcnt=0;pcnt<segments.length;pcnt++){\n\t\t\tstr += segments[pcnt].type+' '+segments[pcnt].x2*sc+' '+segments[pcnt].y2*sc+' ';\n\t\t\tif(segments[pcnt].x3){\n\t\t\t\tstr += segments[pcnt].x3*sc+' '+segments[pcnt].y3*sc+' ';\n\t\t\t}\n\t\t}\n\t\tstr += 'Z \" />';\n\t\t\n\t\t// Rendering control points\n\t\tif(lcpr&&qcpr){\n\t\t\tfor(var pcnt=0;pcnt<segments.length;pcnt++){\n\t\t\t\tif(segments[pcnt].x3){ \n\t\t\t\t\tstr += '<circle cx=\"'+segments[pcnt].x2*sc+'\" cy=\"'+segments[pcnt].y2*sc+'\" r=\"'+qcpr+'\" fill=\"cyan\" stroke-width=\"'+qcpr*0.2+'\" stroke=\"black\" />';\n\t\t\t\t\tstr += '<circle cx=\"'+segments[pcnt].x3*sc+'\" cy=\"'+segments[pcnt].y3*sc+'\" r=\"'+qcpr+'\" fill=\"white\" stroke-width=\"'+qcpr*0.2+'\" stroke=\"black\" />';\n\t\t\t\t\tstr += '<line x1=\"'+segments[pcnt].x1*sc+'\" y1=\"'+segments[pcnt].y1*sc+'\" x2=\"'+segments[pcnt].x2*sc+'\" y2=\"'+segments[pcnt].y2*sc+'\" stroke-width=\"'+qcpr*0.2+'\" stroke=\"cyan\" />';\n\t\t\t\t\tstr += '<line x1=\"'+segments[pcnt].x2*sc+'\" y1=\"'+segments[pcnt].y2*sc+'\" x2=\"'+segments[pcnt].x3*sc+'\" y2=\"'+segments[pcnt].y3*sc+'\" stroke-width=\"'+qcpr*0.2+'\" stroke=\"cyan\" />';\n\t\t\t\t}else{\n\t\t\t\t\tstr += '<circle cx=\"'+segments[pcnt].x2*sc+'\" cy=\"'+segments[pcnt].y2*sc+'\" r=\"'+lcpr+'\" fill=\"white\" stroke-width=\"'+lcpr*0.2+'\" stroke=\"black\" />';\n\t\t\t\t}\n\t\t\t}\n\t\t}else if(lcpr){\n\t\t\tfor(var pcnt=0;pcnt<segments.length;pcnt++){\n\t\t\t\tif(!segments[pcnt].x3){ \n\t\t\t\t\tstr += '<circle cx=\"'+segments[pcnt].x2*sc+'\" cy=\"'+segments[pcnt].y2*sc+'\" r=\"'+lcpr+'\" fill=\"white\" stroke-width=\"'+lcpr*0.2+'\" stroke=\"black\" />';\n\t\t\t\t}\n\t\t\t}\n\t\t}else if(qcpr){\n\t\t\tfor(var pcnt=0;pcnt<segments.length;pcnt++){\n\t\t\t\tif(segments[pcnt].x3){ \n\t\t\t\t\tstr += '<circle cx=\"'+segments[pcnt].x2*sc+'\" cy=\"'+segments[pcnt].y2*sc+'\" r=\"'+qcpr+'\" fill=\"cyan\" stroke-width=\"'+qcpr*0.2+'\" stroke=\"black\" />';\n\t\t\t\t\tstr += '<circle cx=\"'+segments[pcnt].x3*sc+'\" cy=\"'+segments[pcnt].y3*sc+'\" r=\"'+qcpr+'\" fill=\"white\" stroke-width=\"'+qcpr*0.2+'\" stroke=\"black\" />';\n\t\t\t\t\tstr += '<line x1=\"'+segments[pcnt].x1*sc+'\" y1=\"'+segments[pcnt].y1*sc+'\" x2=\"'+segments[pcnt].x2*sc+'\" y2=\"'+segments[pcnt].y2*sc+'\" stroke-width=\"'+qcpr*0.2+'\" stroke=\"cyan\" />';\n\t\t\t\t\tstr += '<line x1=\"'+segments[pcnt].x2*sc+'\" y1=\"'+segments[pcnt].y2*sc+'\" x2=\"'+segments[pcnt].x3*sc+'\" y2=\"'+segments[pcnt].y3*sc+'\" stroke-width=\"'+qcpr*0.2+'\" stroke=\"cyan\" />';\n\t\t\t\t}\n\t\t\t}\n\t\t}// End of quadratic control points\n\t\t\n\t\treturn str;\n\t},// End of svgpathstring()\n\t\n\t// Converting tracedata to an SVG string, paths are drawn according to a Z-index \n\t// the optional lcpr and qcpr are linear and quadratic control point radiuses \n\tthis.getsvgstring=function(w,h,tracedata,palette,background,scale,lcpr,qcpr){\n\t\tscale=scale||1; lcpr=lcpr||0; qcpr=qcpr||0;\n\t\t// SVG start\n\t\tvar svgstr = '<svg width=\"'+w+'px\" height=\"'+h+'px\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" desc=\"Created with imagetracer.js\" >';\n\n\t\t// Background\n\t\tsvgstr += '<rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill=\"'+_this.torgbstr(palette[background])+'\" />';\n\t\t\n\t\t// creating Z-index\n\t\tvar zindex = {}, label;\n\t\t// Layer loop\n\t\tfor (k in tracedata) {\n\t\t\tif(!tracedata.hasOwnProperty(k)){ continue; }\n\t\t\t\n\t\t\t// Path loop\n\t\t\tfor(var pcnt=0;pcnt<tracedata[k].length;pcnt++){\n\t\t\t\n\t\t\t\t// Label (Z-index key) is the startpoint of the path, linearized\n\t\t\t\tlabel = tracedata[k][pcnt].segments[0].y1*w+tracedata[k][pcnt].segments[0].x1;\n\t\t\t\t// Creating new list if required\n\t\t\t\tif(!zindex[label]){ zindex[label] = []; }\n\t\t\t\t// Adding layer and path number to list \n\t\t\t\tvar l = ''+k, p = ''+pcnt;\n\t\t\t\tzindex[label].push({'l':l,'p':p});\n\t\t\t\t\n\t\t\t}// End of path loop\n\t\t\t\n\t\t}// End of layer loop\n\t\t\n\t\t// Sorting Z-index\n\t\tvar zindexkeys = Object.keys(zindex), l, p;\n\t\tzindexkeys.sort(_this.compareNumbers);\n\t\t// Drawing\n\t\t// Z-index loop\n\t\tfor(var k=0;k<zindexkeys.length;k++){\n\t\t\t// Paths loop\n\t\t\tfor(var j=0;j<zindex[zindexkeys[k]].length;j++){\n\t\t\t\tl = zindex[zindexkeys[k]][j].l; p = zindex[zindexkeys[k]][j].p;\n\t\t\t\t// Adding SVG <path> string, desc contains layer and path number\n\t\t\t\tsvgstr += _this.svgpathstring('l '+l+' p '+p,tracedata[l][p].segments,_this.torgbstr(palette[l]),scale,lcpr,qcpr);\n\t\t\t}// End of paths loop\n\t\t\t\n\t\t}// End of Z-index loop\n\t\t\n\t\t// SVG End\n\t\tsvgstr+='</svg>';\n\t\t\n\t\treturn svgstr;\n\t\t\n\t},// End of getsvgstring()\n\t\n\t// Comparator for numeric Array.sort\n\tthis.compareNumbers=function(a,b){ return a - b; },\n\t\n\t// Convert color object to rgb string\n\tthis.torgbstr=function(c){return 'rgb('+c.r+','+c.g+','+c.b+')'},\n\t\n\t// Helper function: Appending an <svg> element to a container from an svgstring\n\tthis.appendSVGString=function(svgstr,parentid){\n\t\tvar div;\n\t\tif(parentid){\n\t\t\tdiv = document.getElementById(parentid);\n\t\t\tif(!div){\n\t\t\t\tdiv = document.createElement('div');\n\t\t\t\tdiv.id = parentid;\n\t\t\t\tdocument.body.appendChild(div);\n\t\t\t}\n\t\t}else{\n\t\t\tdiv = document.createElement('div');\n\t\t\tdocument.body.appendChild(div);\n\t\t}\n\t\tdiv.innerHTML += svgstr;\n\t},\n\t\n\t////////////////////////////////////////////////////////////\n\t//\n\t// Canvas functions\n\t//\n\t////////////////////////////////////////////////////////////\n\t\n\t// Helper function: loading an image from a URL, then executing callback with canvas as argument\n\tthis.loadImage=function(url,callback){\n\t\tvar img = new Image();\n\t\timg.src = url;\n\t\timg.onload = function(){\n\t\t\tvar canvas = document.createElement('canvas');\n\t\t\tcanvas.width=img.width;\n\t\t\tcanvas.height=img.height;\n\t\t\tvar context = canvas.getContext('2d');\n\t\t\tcontext.drawImage(img,0,0);\n\t\t\tcallback(canvas);\n\t\t}\n\t},\n\t\n\t// Helper function: getting ImageData from a canvas\n\tthis.getImgdata=function(canvas){\n\t\tvar context = canvas.getContext('2d');\n\t\treturn context.getImageData(0,0,canvas.width,canvas.height);\n\t},\n\t\n\t// Helper function: Drawing all edge node layers into a container\n\tthis.drawLayers=function(layers,palette,scale,parentid){\n\t\tscale = scale||1;\n\t\tvar w,h,idx;\n\t\t\n\t\t// Preparing container\n\t\tvar div;\n\t\tif(parentid){\n\t\t\tdiv = document.getElementById(parentid);\n\t\t\tif(!div){\n\t\t\t\tdiv = document.createElement('div');\n\t\t\t\tdiv.id = parentid;\n\t\t\t\tdocument.body.appendChild(div);\n\t\t\t}\n\t\t}else{\n\t\t\tdiv = document.createElement('div');\n\t\t\tdocument.body.appendChild(div);\n\t\t}\n\t\t\n\t\t// Layers loop\n\t\tfor (k in layers) {\n\t\t\tif(!layers.hasOwnProperty(k)){ continue; }\n\t\t\t\n\t\t\t// width, height\n\t\t\tw=layers[k][0].length; h=layers[k].length; idx=0;\n\t\t\t\n\t\t\t// Creating new canvas for every layer \n\t\t\tvar canvas = document.createElement('canvas'); canvas.width=w*scale; canvas.height=h*scale; \n\t\t\tvar context = canvas.getContext('2d');\n\t\t\t\n\t\t\t// Drawing\n\t\t\tfor(var j=0;j<h;j++){\n\t\t\t\tfor(var i=0;i<w;i++){\n\t\t\t\t\tcontext.fillStyle = _this.torgbstr(palette[ layers[k][j][i]%palette.length ]);\n\t\t\t\t\tcontext.fillRect(i*scale,j*scale,scale,scale); \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Appending canvas to container\n\t\t\tdiv.appendChild(canvas);\n\t\t}// End of Layers loop\n\t}// End of drawlayers\n\t\n\treturn this;\n}// End of ImageTracer object ", "function loadHTML2Canvas(cb){\n\t\t//Make sure HTML2Canvas is not already loaded\n\t\tif(typeof html2canvas === \"undefined\" ){\n\t\t\t//If we have require, use it\n\t\t\tif(typeof requirejs !== \"undefined\"){\n\t\t\t\ttry {\n\t\t\t\t\treturn requirejs([\"html2canvas\"],function(h2){\n\t\t\t\t\t\th2canvas = h2;\n\t\t\t\t\t\treturn cb();\n\t\t\t\t\t});\n\t\t\t\t} catch(exception) {\n\t\t\t\t\tconsole.warn(\"Require loading has failed, attempting to load html2canvas manually.\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if no require then load directly\n\t\t\tCIQ.loadScript(getMyRoot() +\"/html2canvas.js\",function(){\n\t\t\t\th2canvas = html2canvas;\n\t\t\t\treturn cb();\n\t\t\t});\n\t\t}else{\n\t\t\th2canvas = html2canvas;\n\t\t\treturn cb();\n\t\t}\n\t}", "function main() {\n\tcleanup();\n\twindow.onbeforeunload = function() {\n\t\tif (reloadPreventFlag) return \"Are you sure want to leave ?\";\n\t};\n\t\n\tvar i,tmp;\n\tholdercanvas = document.getElementById(\"holdercanvas\");\n\tmaincanvas = document.getElementById(\"drawcanvas\");\n\tmargincanvas = document.getElementById(\"margincanvas\");\n\tmaincanvas.addEventListener('mousedown', DrawCanvasMouseDown);\n\tmaincanvas.addEventListener('mousemove', DrawCanvasMouseMove);\n\twindow.addEventListener('mouseup', DrawCanvasMouseUp);\n\twindow.addEventListener('keydown', KeyManager);\n\twindow.addEventListener('resize', WindowResize);\n\t\n\tdocument.getElementById('addBorder').addEventListener('change',addBorder);\n\tborderWidth = document.getElementById('borderWidth');borderWidth.addEventListener('input',changeWidth);\n\tborderMargin = document.getElementById('borderMargin');borderMargin.addEventListener('input',changeMargin);\n\ttmp = {};tmp.target = document.getElementById('addBorder');\n\taddBorder(tmp);\n\t\n\tdocument.getElementById(\"heightCanvas\").addEventListener(\"change\",changeSizeCustom);\n\tdocument.getElementById(\"widthCanvas\").addEventListener(\"change\",changeSizeCustom);\n\tdocument.getElementById(\"selectionLengthCanvas\").addEventListener(\"change\",changeSizeDropDown);\n\t\t\n\tcacheDeleteButton = document.getElementById(\"DeleteButton\");\n\tcacheCloneButton = document.getElementById(\"CloneButton\");\n\tcacheUndoButton = document.getElementById(\"UndoButton\");\n\tcacheRedoButton = document.getElementById(\"RedoButton\");\n\tcacheZoomFactorInput = document.getElementById(\"ZoomFactorInput\");\n\tcacheSaveButton = document.getElementById(\"SaveButton\");\n\tcachePreviewDesign = document.getElementById(\"previewDesign\");\n\tcacheCoverProgressBar = document.getElementById(\"uploadProgressBar\");\n\tcacheCloneButton.addEventListener(\"click\",CloneAction);\n\tcacheUndoButton.addEventListener(\"click\",UndoAction);\n\tcacheRedoButton.addEventListener(\"click\",RedoAction);\n\tcacheDeleteButton.addEventListener(\"click\",DeleteAction);\n\tdocument.getElementById(\"LogoButton\").addEventListener(\"click\",goBackToOrder);\n\tdocument.getElementById(\"SubmitButton\").addEventListener(\"click\",submitDesign);\n\tdocument.getElementById(\"closeCover\").addEventListener(\"click\",closeSubmit);\n\tdocument.getElementById(\"UploadButton\").addEventListener(\"click\",UploadAction,false);\n\tdocument.getElementById(\"AddTextButton\").addEventListener(\"click\",AddTextAction);\n\tdocument.getElementById(\"ShapesButton\").addEventListener(\"click\",ClipArtPanelAction);\n\tdocument.getElementById(\"HelpButton\").addEventListener(\"click\",HelpPanelAction);\n\tdocument.getElementById('UploadImage').addEventListener('change',FileUploadAction);\n\tdocument.getElementById(\"ZoomReset\").addEventListener(\"click\",ZoomResetAction);\n\tdocument.getElementById(\"ZoomInButton\").addEventListener(\"click\",ZoomInAction);\n\tdocument.getElementById(\"ZoomOutButton\").addEventListener(\"click\",ZoomOutAction);\n\tcacheZoomFactorInput.addEventListener(\"change\",ZoomCustomAction);\n\tcacheSaveButton.addEventListener(\"click\",SaveDraftAction);\n\tsetTimeout(SaveDraftAction, autoSaveInterval);\n\n\tcacheFontSizeInput = document.getElementById('fontSize');\n\tdocument.getElementById('textContent').addEventListener('input',changeTextContent);\n\tdocument.getElementById('fontFamily').addEventListener('change',changeFontFamily);\n\tcacheFontSizeInput.addEventListener('change',changeFontSize);\n\tdocument.getElementById('boldText').addEventListener('change',changeFontBold);\n\tdocument.getElementById('italicText').addEventListener('change',changeFontItalic);\n\tdocument.getElementById('underlineText').addEventListener('change',changeFontUnderline);\n\ttmp = document.getElementsByName('textAlign');for (i = 0;i < tmp.length;++i) tmp[i].addEventListener('change',changeFontAlign);\n\tdocument.getElementById('fadeImage').addEventListener('input',changeImageOpacity);\n\tdocument.getElementById('fadeShape').addEventListener('input',changeImageOpacity);\n\tdocument.getElementById('convertWhiteToTransparent').addEventListener('change',changeImageWhiteToTransparent);\n\tdocument.getElementById(\"uploadbackgroundbutton\").addEventListener(\"click\",BackgroundImageAction);\n\tdocument.getElementById(\"BackgroundUploadImage\").addEventListener(\"change\",BackgroundImageUploadAction);\n\tdocument.getElementById(\"removebackgroundbutton\").addEventListener(\"click\",RemoveBackgroundImage);\n\t\n\tdocument.getElementById(\"shapeFlip\").addEventListener(\"change\",flipShape);\n\t\n\tcacheClipArtFilterInput = document.getElementById(\"searchClipArt\");\n\tcacheClipArtCategory = document.getElementById(\"categoryClipArt\");\n\tdocument.getElementById(\"searchClipArtButton\").addEventListener(\"click\",filterShape);\n\tcacheClipArtCategory.addEventListener(\"change\",filterShape);\n\t\n\ttmp = document.getElementsByClassName('layerbutton front');for (i = 0;i < tmp.length;++i) tmp[i].addEventListener('click',layerFront);\n\ttmp = document.getElementsByClassName('layerbutton back');for (i = 0;i < tmp.length;++i) tmp[i].addEventListener('click',layerBack);\n\ttmp = document.getElementsByTagName('input');\n\tfor (i = 0;i < tmp.length;++i)\n\t{\n\t\tif (tmp[i].type == \"file\" || tmp[i].type == \"color\" || tmp[i].type == \"radio\" || tmp[i].classList.contains(\"system\")) continue;\n\t\tif (tmp[i].type == \"range\")\n\t\t{\n\t\t\ttmp[i].addEventListener('focus',selectorPreRegisterAction);\n\t\t\ttmp[i].addEventListener('change',selectorRegisterAction);\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttmp[i].addEventListener('focus',inputRegisterAction);\n\t\t\ttmp[i].addEventListener('input',inputRegisteringAction);\n\t\t\ttmp[i].addEventListener('change',inputFinishAction);\n\t\t}\n\t\tif (tmp[i].type == \"text\")\n\t\t{\n\t\t\ttmp[i].addEventListener('focus',preventKeyManagerActive);\n\t\t\ttmp[i].addEventListener('blur',preventKeyManagerDeactive);\n\t\t}\n\t}\n\ttmp = document.getElementsByTagName('select');\n\tfor (i = 0;i < tmp.length;++i)\n\t{\n\t\tif (tmp[i].classList.contains(\"system\")) continue;\n\t\ttmp[i].addEventListener('focus',selectorPreRegisterAction);\n\t\ttmp[i].addEventListener('change',selectorRegisterAction);\n\t}\n}", "function exportImage() {\n console.log(\"clicked\");\n canvas = document.getElementsByTagName(\"canvas\");\n // document.write('<img src=\"'+canvas[0].toDataURL(\"image/png\")+'\"/>');\n var canvasURL = canvas[0].toDataURL(\"image/png\");\n console.log(\"image copied\")\n var img = document.getElementById(\"image1\").src = canvasURL;\n console.log(img);\n}", "function exportPNGWrapper() {\n let blob = cy.png({ scale: 2.0, output: 'blob' }); \n saveAs(blob, \"arm-template.png\")\n}", "function saveFile(fileName) {\r\n\tvar draw_canvas = document.getElementById('visible');\r\n\tvar image = draw_canvas.toDataURL(\"image/png\");\r\n\tif (fileName != null) {\r\n\t\tsocket.emit(\"appDrawingSave\", image, fileName, function (message) {\r\n\t\t\tif (message.error) {\r\n\t\t\t\tconsole.error(message.error);\r\n\t\t\t\tshowItemSaveNotice(message.error);\r\n\t\t\t} else if (message.fileName) {\r\n\t\t\t\tshowItemSaveNotice(\"saved \" + message.fileName + \" successfully\");\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error(message);\r\n\t\t\t\tshowItemSaveNotice(\"Someting went wrong\");\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}", "function saveAsPDF(){\n\t\t\t$('.savepdf').css('visibility','hidden');\n\t\t\tcreate_jpg_web();\t// create JPG file from canvas\n\t\t\tif (widthCanvas < heightCanvas) {\t\t\t\n\t\t\tflipCanvas = true;\n\t\t\tvar wC = heightCanvas;\n\t\t\tvar hC = widthCanvas;\n\t\t\twCmm = height_in_mm;\n\t\t\thCmm = width_in_mm;\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\tflipCanvas = false;\n\t\t\tvar wC = widthCanvas;\n\t\t\tvar hC = heightCanvas;\n\t\t\twCmm = width_in_mm;\n\t\t\thCmm = height_in_mm;\n\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\topenPDF();\n\n\t\t}", "function download() {\n const a = document.createElement(\"a\");\n\n document.body.appendChild(a);\n a.href = canvas.toDataURL();\n a.download = \"canvas.png\";\n a.click();\n document.body.removeChild(a);\n}", "function saveAs() {\n var dataURL = renderedCanvas();\n\n// var $diagram = {c:canvas.save(), s:STACK, m:CONNECTOR_MANAGER};\n var $diagram = {c: canvasProps, s: STACK, m: CONNECTOR_MANAGER, p: CONTAINER_MANAGER, v: DIAGRAMO.fileVersion};\n var $serializedDiagram = JSON.stringify($diagram);\n// $serializedDiagram = JSON.stringify($diagram, Util.operaReplacer);\n var svgDiagram = toSVG();\n\n //save the URLs of figures as a CSV\n var lMap = linkMap();\n\n //alert($serializedDiagram);\n\n //see: http://api.jquery.com/jQuery.post/\n $.post(\"./common/controller.php\", {action: 'saveAs', diagram: $serializedDiagram, png: dataURL, linkMap: lMap, svg: svgDiagram},\n function(data) {\n if (data == 'noaccount') {\n Log.info('You must have an account to use that feature');\n //window.location = '../register.php';\n }\n else if (data == 'step1Ok') {\n Log.info('Save as...');\n window.location = './saveDiagram.php';\n }\n }\n );\n}", "draw(canvas, rect, viewId, elementId, elementType, widgetTime, stateTime, mode, attributes) {\n\n canvas.imageSmoothingEnabled=true;\n\n if (elementType == \"background\") {\n\n this.drawBackground(canvas, rect, viewId, elementId, widgetTime, stateTime, mode, attributes);\n\n } else if (elementType == \"button\") {\n\n this.drawButton(canvas, rect, viewId, elementId);\n\n } else if (elementType == \"buttonImage\") {\n\n this.drawButtonImage(canvas, rect, viewId, elementId, widgetTime, stateTime, mode, attributes);\n\n } else if (elementType == \"image\") {\n \n this.drawImage(canvas, rect, viewId, elementId, widgetTime, stateTime, mode, attributes);\n \n } else if (elementType == \"imageError\") {\n\n this.drawImageError(canvas, rect, viewId, elementId, widgetTime, stateTime, mode, attributes);\n\n } else if (elementType == \"text\") {\n\n this.drawText(canvas, rect, viewId, elementId, widgetTime, stateTime, mode, attributes);\n\n } else if (elementType == \"faceSearcher\") {\n \n this.drawFaceSearcher(canvas, rect, viewId, elementId, widgetTime, stateTime, mode, attributes);\n \n } else if (elementType == \"video\") {\n\n if (viewId == \"Extractor\") {\n if (this.extractionMode == FPhi.Selphi.Mode.Register)\n this.drawImageWithClippingCircle(canvas, rect, attributes.player, rect.x + rect.width / 2.0, rect.y + rect.height / 2.0, rect.width / 2.0);\n } else {\n this.drawImageWithClippingCircle(canvas, rect, attributes.player, rect.x + rect.width / 2.0, rect.y + rect.height / 2.0, rect.width / 2.0);\n }\n //this.drawImage(canvas,rect,attributes.player);\n\n } else if (elementType == \"camera\") {\n\n var progress = attributes.progress;\n var borderWidth = this.rm.getSetupFloat(\"facephi-widget-conf\", \"\", this.landscape, \"width_progress_bar\");\n var colorProgress = this.rm.getSetupColor(\"facephi-widget-conf\", \"\", this.landscape, \"color_progress_bar\");\n var colorWarning = this.rm.getSetupColor(\"facephi-widget-conf\", \"\", this.landscape, \"color_warning_message\");\n var colorExcellent = this.rm.getSetupColor(\"facephi-widget-conf\", \"\", this.landscape, \"color_quality_excellent\");\n var colorLow = this.rm.getSetupColor(\"facephi-widget-conf\", \"\", this.landscape, \"color_quality_low\");\n\n /*\n canvas.save();\n canvas.translate(this.width, 0);\n canvas.scale(-1, 1);\n\n\n this.cameraWidth = attributes.width;\n this.cameraHeight = attributes.height;\n this.cameraRotation = attributes.cameraRotation;\n this.faceDataRect = attributes.faceDataRect;\n this.faceTracking = attributes.faceTracking;\n\n // draw camera image to visible canvas\n if ((this.faceDataRect != 'undefined') && (this.faceDataRect != null) && (this.faceTracking)) {\n this.faceCenterOffsetTarget = { x: (this.faceDataRect.x + this.faceDataRect.width / 2.0) - this.circleX, y: (this.faceDataRect.y + this.faceDataRect.height / 2.0) - this.circleY }\n }\n this.faceCenterOffset.x += (this.faceCenterOffsetTarget.x - this.faceCenterOffset.x) * 0.1;\n this.faceCenterOffset.y += (this.faceCenterOffsetTarget.y - this.faceCenterOffset.y) * 0.1;\n var tRect = this.scaleRect({ width: this.cameraWidth, height: this.cameraHeight }, { x: 0, y: 0, width: this.width, height: this.height });\n\n // limit camera offset to circle bounds.\n var localCameraX = tRect.x + this.faceCenterOffset.x;\n if (localCameraX >= this.circleX - this.circleRadius) localCameraX = this.circleX - this.circleRadius;\n if (localCameraX + tRect.width <= this.circleX + this.circleRadius) localCameraX = this.circleX + this.circleRadius - tRect.width;\n var localCameraY = tRect.y - this.faceCenterOffset.y;\n if (localCameraY >= this.circleY - this.circleRadius) localCameraY = this.circleY - this.circleRadius;\n if (localCameraY + tRect.height <= this.circleY + this.circleRadius) localCameraY = this.circleY + this.circleRadius - tRect.height;\n\n*/\n canvas.save();\n canvas.beginPath();\n canvas.arc(this.circleX, this.circleY, this.circleRadius, 0, 2 * Math.PI, false);\n canvas.clip();\n //canvas.drawImage(attributes.camera, localCameraX, localCameraY, tRect.width, tRect.height);\n \n if ((attributes.state == \"UCLivenessMoveStabilizing\") || (attributes.state==\"UCLivenessMoveStabilized\") || (attributes.state==\"UCLivenessMoveDetecting\") || (attributes.state==\"UCLivenessMoveProcessing\")) {\n // Capa translucida negra para resaltar las letras\n canvas.fillStyle = \"#00000033\";\n canvas.fillRect(rect.x, rect.y, rect.width, rect.height);\n }\n\n //canvas.drawImage(attributes.camera, tRect.x, tRect.y, tRect.width, tRect.height);\n canvas.restore();\n\n //canvas.drawImage(attributes.camera, 0,0, tRect.width, tRect.height);\n\n var circleColor = colorProgress; // this.rm.getSetupColor(\"facephi-widget-conf\", \"\", \"color_progress_bar\");\n if (mode == \"Warning\")\n circleColor = colorWarning; // this.rm.getSetupColor(\"facephi-widget-conf\", \"\", \"color_warning_message\");\n\n if (progress == 0.0 && mode == \"Warning\") {\n // Arco completo\n canvas.beginPath();\n canvas.strokeStyle = colorLow; // this.rm.getSetupColor(\"facephi-widget-conf\",\"\",\"color_quality_low\");\n canvas.lineWidth = borderWidth; // this.rm.getSetupFloat(\"facephi-widget-conf\", \"\", \"width_progress_bar\");\n canvas.lineCap = \"round\";\n canvas.arc(this.circleX, this.circleY, this.circleRadius - (canvas.lineWidth / 2) + 0.5, -Math.PI / 2, 2 * Math.PI - Math.PI / 2);\n canvas.stroke();\n }\n\n if ((attributes.state == \"UCLivenessMoveStabilizing\") || (attributes.state==\"UCLivenessMoveStabilized\") || (attributes.state==\"UCLivenessMoveDetecting\") || (attributes.state==\"UCLivenessMoveProcessing\")) {\n progress = 1.0;\n if (attributes.liveness_move_last_result) circleColor = colorExcellent; // this.rm.getSetupColor(\"facephi-widget-conf\",\"\",\"color_quality_excellent\");\n else circleColor = colorLow; // this.rm.getSetupColor(\"facephi-widget-conf\",\"\",\"color_quality_low\");\n \n if (attributes.state==\"UCLivenessMoveDetecting\" || attributes.state==\"UCLivenessMoveProcessing\") {\n // Arco completo\n canvas.beginPath();\n canvas.strokeStyle = colorProgress; // this.rm.getSetupColor(\"facephi-widget-conf\",\"\",\"color_progress_bar\");;\n canvas.lineWidth = borderWidth; // this.rm.getSetupFloat(\"facephi-widget-conf\", \"\", \"width_progress_bar\");\n canvas.lineCap = \"round\";\n canvas.arc(this.circleX, this.circleY, this.circleRadius - (canvas.lineWidth / 2) + 0.5, -Math.PI / 2, 2 * Math.PI - Math.PI / 2);\n canvas.stroke(); \n }\n\n } else {\n \n if (progress > 1.0) progress=1.0;\n if (this.extractionMode == FPhi.Selphi.Mode.Authenticate)\n progress = progress*progress*(3.0 - 2.0*progress); //smoothstep\n\n canvas.beginPath();\n canvas.strokeStyle = circleColor;\n canvas.lineWidth = borderWidth; // this.rm.getSetupFloat(\"facephi-widget-conf\", \"\", \"width_progress_bar\");\n canvas.lineCap = \"round\";\n canvas.arc(this.circleX, this.circleY, this.circleRadius - (canvas.lineWidth / 2) + 0.5, -Math.PI / 2, 2 * Math.PI * progress - Math.PI / 2);\n canvas.stroke();\n\n var colorShutter = this.rm.getSetupColor(\"facephi-widget-conf\", \"\", this.landscape, \"color_shutter\");\n this.drawBlind(canvas, this.circleX, this.circleY, this.circleRadius, attributes.eyesYLevel, attributes.blind, colorShutter, attributes.blindText); \n }\n\n\n\n } else if (elementType == \"results\") {\n\n var totalTransitionTime = 1.000 + 1.500 * attributes.progress;\n var progressTime = stateTime / totalTransitionTime;\n if (progressTime > 1.0) {\n progressTime = 1.0;\n }\n\n // Calculamos la interpolacion de la barra de progreso (OutQuad -> InOutQuad)\n progressTime = progressTime * (2.0 - progressTime);\n progressTime = progressTime < 0.5 ? 2 * progressTime * progressTime : -1 + (4 - 2 * progressTime) * progressTime;\n\n canvas.beginPath();\n canvas.fillStyle = this.rm.getSetupColor(viewId, elementId, this.landscape, \"background_color\");\n canvas.arc(this.circleX, this.circleY, this.circleRadius, -Math.PI / 2, 2 * Math.PI - Math.PI / 2);\n canvas.fill();\n\n var scoreColor = this.rm.getSetupColor(\"facephi-widget-conf\", \"\", this.landscape, \"color_quality_excellent\");\n if (attributes.progress <= 0.33)\n scoreColor = this.rm.getSetupColor(\"facephi-widget-conf\", \"\", this.landscape, \"color_quality_low\");\n else if (attributes.progress <= 0.66)\n scoreColor = this.rm.getSetupColor(\"facephi-widget-conf\", \"\", this.landscape, \"color_quality_good\");\n\n canvas.beginPath();\n canvas.strokeStyle = scoreColor;\n canvas.lineWidth = this.rm.getSetupFloat(\"facephi-widget-conf\", \"\", this.landscape, \"width_progress_bar\");\n canvas.lineCap = \"round\";\n canvas.arc(this.circleX, this.circleY, this.circleRadius - (canvas.lineWidth / 2) * 0.5, -Math.PI / 2, 2 * Math.PI * attributes.progress * progressTime - Math.PI / 2);\n canvas.stroke();\n\n // score text\n var message = \"\";\n var tipMessage = \"\";\n if (attributes.progress >= 1.0) {\n message = this.rm.translate(\"results_quality_excellent\");\n tipMessage = this.rm.translate(\"results_quality_message\");\n } else if (attributes.progress >= 0.333) {\n message = this.rm.translate(\"results_quality_good\");\n tipMessage = this.rm.translate(\"results_quality_message\");\n } else {\n message = this.rm.translate(\"results_quality_low\");\n tipMessage = this.rm.translate(\"results_quality_message\");\n }\n\n var textSize = this.rm.getSetupFloat(viewId, elementId, this.landscape, \"fontResult_size\");\n var lineHeight = textSize+1;\n var textFont = this.rm.getSetupResourceId(viewId, elementId, this.landscape, \"fontResult\");\n var align = \"CENTER\";\n var valign = \"TOP\";\n this.drawStringMultiline(canvas, message, { x: 0, y: this.circleY - 5, width: this.width, height: this.height }, scoreColor, textFont, textSize,lineHeight,align,valign);\n\n textSize = this.rm.getSetupFloat(viewId, elementId, this.landscape, \"fontQuality_size\");\n var lineHeight = textSize+1;\n textFont = this.rm.getSetupResourceId(viewId, elementId, this.landscape, \"fontQuality\");\n var align = \"CENTER\";\n var valign = \"TOP\";\n this.drawStringMultiline(canvas, tipMessage, { x: 0, y: this.circleY + 5 + textSize, width: this.width, height: this.height }, scoreColor, textFont, textSize,lineHeight,align,valign);\n\n } else if (elementType == \"animation\") {\n var direction=0;\n //if (attributes.state == \"UCLivenessMoveDetecting\") {\n if (\"livenessMoveDirection\" in attributes)\n direction = attributes.livenessMoveDirection;\n if (elementId!=\"liveness_move\") direction=0;\n //}\n this.drawAnimation(canvas, rect, viewId, elementId, widgetTime, stateTime, mode, attributes,direction);\n } else if (elementId == \"progress\") {\n canvas.fillStyle = this.rm.getSetupColor(viewId, elementId, this.landscape, \"background_color\");\n canvas.fillRect(rect.x, rect.y, rect.width, rect.height);\n\n canvas.fillStyle = this.rm.getSetupColor(viewId, elementId, this.landscape, \"progress_color\");\n canvas.fillRect(rect.x, rect.y, rect.width*attributes.progress, rect.height);\n }\n }", "function replaceWriteFiles(func) {\n _writeFiles = func;\n }", "function DOMRenderer() {}", "function download_in_ie(canvas, filename,format) {\n return(navigator.msSaveOrOpenBlob && navigator.msSaveOrOpenBlob(canvas.msToBlob(), filename+format));\n}", "function NodesaveFile(html_id,data, encoding) {\n var chooser = document.querySelector(html_id);\n chooser.addEventListener(\"change\", function(evt) {\n var fs = require('fs');// save it now\n\n if(encoding === true){\n var base64Data = data.replace(/^data:application\\/pdf;filename=generated.pdf;base64,/, \"\");\n fs.writeFile(this.value, base64Data , 'base64' , function(err) {\n if(err) {\n alert(\"Error write to file\"+err);\n }\n });\n }\n else\n {\n\n fs.writeFile(this.value, data , function(err) {\n if(err) {\n alert(\"Error write to file\"+err);\n }\n });\n }\n\n }, false);\n\n chooser.click();\n}", "function mockCanvas(window) {\n window.HTMLCanvasElement.prototype.getContext = () => ({\n fillRect: () => ({}),\n clearRect: () => ({}),\n getImageData: (x, y, w, h) => ({ data: new Array(w * h * 4) }),\n putImageData: () => ({}),\n createImageData: () => [],\n setTransform: () => ({}),\n drawImage: () => ({}),\n save: () => ({}),\n fillText: () => ({}),\n restore: () => ({}),\n beginPath: () => ({}),\n moveTo: () => ({}),\n lineTo: () => ({}),\n closePath: () => ({}),\n stroke: () => ({}),\n translate: () => ({}),\n scale: () => ({}),\n rotate: () => ({}),\n arc: () => ({}),\n fill: () => ({}),\n measureText: () => ({ width: 0 }),\n transform: () => ({}),\n rect: () => ({}),\n clip: () => ({}),\n });\n\n window.HTMLCanvasElement.prototype.toDataURL = () => '';\n}", "function mockCanvas(window) {\n window.HTMLCanvasElement.prototype.getContext = () => ({\n fillRect: () => ({}),\n clearRect: () => ({}),\n getImageData: (x, y, w, h) => ({ data: new Array(w * h * 4) }),\n putImageData: () => ({}),\n createImageData: () => [],\n setTransform: () => ({}),\n drawImage: () => ({}),\n save: () => ({}),\n fillText: () => ({}),\n restore: () => ({}),\n beginPath: () => ({}),\n moveTo: () => ({}),\n lineTo: () => ({}),\n closePath: () => ({}),\n stroke: () => ({}),\n translate: () => ({}),\n scale: () => ({}),\n rotate: () => ({}),\n arc: () => ({}),\n fill: () => ({}),\n measureText: () => ({ width: 0 }),\n transform: () => ({}),\n rect: () => ({}),\n clip: () => ({}),\n });\n\n window.HTMLCanvasElement.prototype.toDataURL = () => '';\n}", "function downloadCanvas(link, canvasId, filename) {\n link.href = document.getElementById(canvasId).toDataURL();\n link.download = filename;\n}", "patched() {\n this._handleImageLoad();\n }", "function downloadpdf(){\n console.log('Scarica PDF');\n html2canvas(document.getElementById('exportthis'), {\n onrendered: function (canvas) {\n var data = canvas.toDataURL();\n var docDefinition = {\n content: [{\n\n image: data,\n width: 500,\n }]\n };\n pdfMake.createPdf(docDefinition).download(\"requirements.pdf\");\n }\n });\n }", "function saveDrawing() {\n var canvas5 = document.getElementById(\"demo5\");\n window.open(canvas5.toDataURL(\"image/png\"));\n}", "function exportPNG() {\n var exportCanvas = document.getElementById(\"myCanvas\");\n var dataURL = exportCanvas.toDataURL();\n\n if (window.navigator.msSaveBlob) {\n window.navigator.msSaveBlob(exportCanvas.msToBlob(), \"exportImage.png\");\n }\n else {\n const a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.href = exportCanvas.toDataURL();\n a.download = \"exportImage.png\";\n a.click();\n document.body.removeChild(a);\n }\n}", "dispatchFileClickEvent(caller, data) {\n caller.dispatchEvent(\n new CustomEvent('fileClicked', {detail: data\n ,bubbles: true\n ,cancelable: true\n ,composed: false})\n )\n }", "function exportPng(fileName) {\r var docExportOptions = new ExportOptionsSaveForWeb();\r docExportOptions.format = SaveDocumentType.PNG;\r docExportOptions.transparency = true;\r docExportOptions.blur = 0.0;\r docExportOptions.includeProfile = false;\r docExportOptions.interlaced = false;\r docExportOptions.optimized = true;\r docExportOptions.quality = 100;\r docExportOptions.PNG8 = false;\r\r var file = new File(activeDocument.path + '/' + fileName);\r activeDocument.exportDocument(file, ExportType.SAVEFORWEB, docExportOptions);\r}", "function exportChart(chart) {\n chart.exportChart({format: \"jpg\"});\n}", "function screenshot() {\n window.scrollTo(0, 0);\n html2canvas(document.querySelector(\"#colorcontainer\"), {\n scrollX: 0,\n scrollY: 0,\n }).then(function (canvas) {\n console.log(canvas);\n var a = document.createElement(\"a\");\n // toDataURL defaults to png, so we need to request a jpeg, then convert for file download.\n a.href = canvas\n .toDataURL(\"image/jpeg\")\n .replace(\"image/jpeg\", \"image/octet-stream\");\n console.log(a.href);\n a.download = \"colourpallete.jpg\";\n a.click();\n });\n }", "function salvaImagem(){\n\t\n\tvar oCanvas = document.getElementById(\"cnvs\");\n\tCanvas2Image.saveAsPNG(oCanvas);\n\t\n}", "function downloadPNG2x() {\n document.getElementById('svg').removeAttribute('style');\n panZoomInstance.moveTo(0, 0);\n panZoomInstance.zoomAbs(0, 0, 1);\n saveSvgAsPng(document.getElementById(\"svg\"), \"GeometricIllustration.png\", {scale: 2});\n}" ]
[ "0.6206442", "0.58366096", "0.5816326", "0.5688424", "0.5676449", "0.56013495", "0.55822086", "0.5444166", "0.5323304", "0.5279519", "0.5212804", "0.51723444", "0.5165379", "0.5152642", "0.5143034", "0.5131296", "0.512579", "0.51093173", "0.50984883", "0.5091003", "0.5090299", "0.5090032", "0.5083822", "0.5071449", "0.50626624", "0.50457835", "0.5034575", "0.5018366", "0.50161606", "0.49998283", "0.499599", "0.49831063", "0.49755657", "0.49710763", "0.49617335", "0.49574277", "0.49561867", "0.49545303", "0.4951922", "0.4937533", "0.49161825", "0.491429", "0.4908529", "0.49040443", "0.49000916", "0.48885345", "0.4886282", "0.488267", "0.487525", "0.48714918", "0.48548028", "0.48546913", "0.48476443", "0.48369935", "0.48355478", "0.48355016", "0.48324463", "0.48315293", "0.4830155", "0.48284292", "0.48151383", "0.48079005", "0.4805926", "0.47962138", "0.4795821", "0.47917047", "0.4771092", "0.47671744", "0.4763443", "0.47609755", "0.4759841", "0.4758306", "0.47442508", "0.47426802", "0.47350693", "0.47349954", "0.4727747", "0.47238368", "0.4723335", "0.4717273", "0.47145706", "0.4712492", "0.47068158", "0.47063118", "0.47008535", "0.46996418", "0.46954376", "0.46943286", "0.46943286", "0.4692814", "0.46919113", "0.4680661", "0.46782944", "0.46743375", "0.46734473", "0.46635306", "0.46615508", "0.4661501", "0.4660641", "0.465857" ]
0.54754424
7
Rollup removes local variables unless used within a module. This plugin makes sure specified local variables are preserved and kept local. This plugin wouldn't be necessary if es2015 modules would be used.
function rawjs(opts) { opts = opts || {} return { transform: (code, id) => { var variable = opts[id.split('/').pop()] if (!variable) return code var keepStr = '/*rollup-keeper-start*/window.tmp=' + variable + ';/*rollup-keeper-end*/' return code + keepStr }, transformBundle: (code) => { for (var file in opts) { var r = new RegExp(opts[file] + '\\$\\d+', 'g') code = code.replace(r, opts[file]) } var re = /\/\*rollup-keeper-start\*\/.*\/\*rollup-keeper-end\*\//g return code.replace(re, '') } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanContextForImports () {\n __define = global.define\n try {\n global.define = undefined\n } catch (_) {\n console.warn('IXO Keysafe - global.define could not be deleted.')\n }\n}", "function pruneExportedFunctions (body, options) {\n var newBody = []\n , wanted = options.wanted\n\n function keep(node) {\n return ~wanted.indexOf(node.left.property.name)\n }\n\n function name(exp) {\n return exp.property.name\n }\n\n body.forEach(function (node) {\n var keepNode = unassign(node, keep)\n , exps\n\n if ((exps = exported(node))) {\n console.error('exported ' + exps.map(name).join(', '))\n }\n\n if (keepNode) {\n newBody.push(node)\n }\n })\n\n return newBody\n}", "function TempVars() {\n}", "function u(t,e){return t(e={exports:{}},e.exports),e.exports}", "function globalsPreset(\n context /*: any */,\n {target, transformGlobals, assumeNoImportSideEffects} /*: any */\n) {\n return {\n plugins: [\n ...(transformGlobals\n ? [\n [require.resolve('babel-plugin-transform-cup-globals'), {target}],\n assumeNoImportSideEffects && [\n require.resolve(\n './babel-plugins/babel-plugin-transform-tree-shake'\n ),\n {target},\n ],\n ].filter(Boolean)\n : []),\n ],\n };\n}", "function setup() {\n\t'use strict';\n\n}", "function addStrict(moduleMeta) {\n console.log(\"transform '\" + moduleMeta.name + \"'\");\n moduleMeta.configure({source: \"'use strict;'\\n\" + moduleMeta.source});\n}", "function noGlobalExport(body /*, options*/) {\n return body.filter(function (node) {\n return !(node.type === 'IfStatement' &&\n node.test.left &&\n node.test.left.argument &&\n node.test.left.argument.name === 'exports')\n })\n}", "function lt(t,i){return t(i={exports:{}},i.exports),i.exports}", "function def_reduce_vars(node, func) {\n node.DEFMETHOD(\"reduce_vars\", func);\n}", "function unclobberInjections() {\n this.validDependencyInjections.forEach(({ name, paths }) => {\n const newFunctionName = newFunctionNameGenerator(name, this.fileName);\n // TODO: Make sure newFunctionName is not clobbering\n // another function\n paths.forEach((path) => {\n path.node.name = newFunctionName;\n });\n });\n}", "function reset() {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__session__[\"a\" /* remove */])('logged_in');\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__session__[\"a\" /* remove */])('username');\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__session__[\"a\" /* remove */])('user');\n}", "function myLocalScope() {\n 'use strict'; // you shouldn't need to edit this line\n var myVar = \"foo\";\n console.log(myVar);\n}", "function myLocalScope() {\n 'use strict'; // you shouldn't need to edit this line\n var myVar = \"test\";\n console.log(myVar);\n}", "fixImports() {\n const undefinedVariables = (0, _findUndefinedIdentifiers2['default'])(this.ast, this.config.get('globals'));\n const usedVariables = (0, _findUsedIdentifiers2['default'])(this.ast);\n const oldImports = this.findCurrentImports();\n const newImports = oldImports.imports.clone();\n\n const unusedImportVariables = new Set();\n oldImports.imports.forEach(importStatement => {\n importStatement.variables().forEach(variable => {\n if (!usedVariables.has(variable)) {\n unusedImportVariables.add(variable);\n }\n });\n });\n newImports.deleteVariables(unusedImportVariables);\n\n const addedItems = new Set(this.injectSideEffectImports(newImports));\n\n return new Promise((resolve, reject) => {\n const allPromises = [];\n undefinedVariables.forEach(variable => {\n allPromises.push(this.findOneJsModule(variable));\n });\n Promise.all(allPromises).then(results => {\n results.forEach(jsModule => {\n if (!jsModule) {\n return;\n }\n const imported = jsModule.hasNamedExports ? '{ ' + String(jsModule.variableName) + ' }' : jsModule.variableName;\n addedItems.add(String(imported) + ' from \\'' + String(jsModule.importPath) + '\\'');\n newImports.push(jsModule.toImportStatement(this.config));\n });\n\n this.replaceImports(oldImports.range, newImports);\n\n const message = fixImportsMessage(unusedImportVariables, addedItems);\n if (message) {\n this.message(message);\n }\n\n resolve(this.results());\n })['catch'](error => {\n reject(error);\n });\n });\n }", "function resetPropOverridesForVariables(spec, props, variables) {\n\t var initialVariables = spec.initialVariables;\n\t for (var _key2 in initialVariables) {\n\t if (_key2 in props && !__webpack_require__(223)(props[_key2], variables[_key2])) {\n\t return initialVariables;\n\t }\n\t }\n\t return variables;\n\t}", "function wipe_module(name){\n\t\t\t\t\t\t//console.log(\"Reloading \"+define.fileName(name))\n\t\t\t\t\t\tfor(var key in define.factory){\n\t\t\t\t\t\t\tvar deps = define.factory[key].deps\n\t\t\t\t\t\t\tif(key !== name && define.module[key] && deps && deps.indexOf(name) !== -1){\n\t\t\t\t\t\t\t\t// remove module\n\t\t\t\t\t\t\t\tdefine.module[key] = undefined\n\t\t\t\t\t\t\t\t// try to wipe all modules that depend our this one\n\t\t\t\t\t\t\t\twipe_module(key)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t}", "function foo() {\n \"use strict\";\n}", "function changeLocal() {\n\n // global can be used here\n\n var a = 2; // local\n\n // local a now = 2\n\n return a;\n}", "function foo() {\n console.log(b);\n var b = 1; // Split out and hoisted to the top\n}", "function removeModuleDirCalls() {\n return replace({\n delimiters: ['', ''],\n values: {\n 'getModuleDirectory(import.meta)': '\"\"',\n },\n });\n}", "function NoUnusedVariables(context) {\n var variableDefs = [];\n\n return {\n OperationDefinition: {\n enter: function enter() {\n variableDefs = [];\n },\n leave: function leave(operation) {\n var variableNameUsed = _Object$create(null);\n var usages = context.getRecursiveVariableUsages(operation);\n var opName = operation.name ? operation.name.value : null;\n\n usages.forEach(function (_ref) {\n var node = _ref.node;\n\n variableNameUsed[node.name.value] = true;\n });\n\n variableDefs.forEach(function (variableDef) {\n var variableName = variableDef.variable.name.value;\n if (variableNameUsed[variableName] !== true) {\n context.reportError(new _error.GraphQLError(unusedVariableMessage(variableName, opName), [variableDef]));\n }\n });\n }\n },\n VariableDefinition: function VariableDefinition(def) {\n variableDefs.push(def);\n }\n };\n}", "function jsClean() {\n return gulp\n .src(\"./src/js/*.js\")\n .pipe(\n babel({\n presets: [\"@babel/env\"],\n })\n )\n .pipe(uglify())\n .pipe(gulp.dest(\"dist/js\"));\n}", "resolveImports() {\n return { safeMath: true, pausable: true, tokenInterface: true };\n }", "function NoUnusedVariables(context) {\n var variableDefs = [];\n\n return {\n OperationDefinition: {\n enter: function enter() {\n variableDefs = [];\n },\n leave: function leave(operation) {\n var variableNameUsed = Object.create(null);\n var usages = context.getRecursiveVariableUsages(operation);\n var opName = operation.name ? operation.name.value : null;\n\n usages.forEach(function (_ref) {\n var node = _ref.node;\n\n variableNameUsed[node.name.value] = true;\n });\n\n variableDefs.forEach(function (variableDef) {\n var variableName = variableDef.variable.name.value;\n if (variableNameUsed[variableName] !== true) {\n context.reportError(new _error.GraphQLError(unusedVariableMessage(variableName, opName), [variableDef]));\n }\n });\n }\n },\n VariableDefinition: function VariableDefinition(def) {\n variableDefs.push(def);\n }\n };\n}", "function addLooseExports(parse, Parser$$1, plugins$$1) {\n exports.parse_dammit = parse; // eslint-disable-line camelcase\n exports.LooseParser = Parser$$1;\n exports.pluginsLoose = plugins$$1;\n}", "function addLooseExports(parse, Parser$$1, plugins$$1) {\n exports.parse_dammit = parse; // eslint-disable-line camelcase\n exports.LooseParser = Parser$$1;\n exports.pluginsLoose = plugins$$1;\n}", "rollup(config, options) {\n console.log(config);\n const originalExternal = config.external;\n config.external = function (id) {\n if (id.startsWith(`unist-util-`)) {\n return false;\n }\n return originalExternal(id);\n };\n return config;\n }", "function restoreContextAfterImports () {\n try {\n global.define = __define\n } catch (_) {\n console.warn('IXO Keysafe - global.define could not be overwritten.')\n }\n}", "function myLocalScope() {\n 'use strict'; // you shouldn't need to edit this line\n var myVar = 7;\n console.log(myVar);\n}", "function hooks() {\n \"use strict\";\n}", "function foo() {\r\n var f1;\r\n function g() {\r\n x = f1; /**bp:locals()**/\r\n }\r\n g();\r\n}", "function NoUnusedVariables(context) {\n var variableDefs = [];\n return {\n OperationDefinition: {\n enter: function enter() {\n variableDefs = [];\n },\n leave: function leave(operation) {\n var variableNameUsed = Object.create(null);\n var usages = context.getRecursiveVariableUsages(operation);\n var opName = operation.name ? operation.name.value : null;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = usages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _ref2 = _step.value;\n var node = _ref2.node;\n variableNameUsed[node.name.value] = true;\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n var _arr = variableDefs;\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var variableDef = _arr[_i];\n var variableName = variableDef.variable.name.value;\n\n if (variableNameUsed[variableName] !== true) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](unusedVariableMessage(variableName, opName), variableDef));\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(def) {\n variableDefs.push(def);\n }\n };\n}", "function prepareModule(module, load) {\n registerClosureInspector(module);\n function theModule(imports) {\n // The supplied 'imports' contain arguments supplied by the caller of the\n // module. We need to add the primordials (Array, Object, ...) to these\n // before invoking the Cajita module.\n var completeImports = copy(sharedImports);\n completeImports.load = load;\n // Copy all properties, including Cajita-unreadable ones since these may\n // be used by privileged code.\n var k;\n for (k in imports) {\n if (hasOwnProp(imports, k)) { completeImports[k] = imports[k]; }\n }\n return module.instantiate(___, primFreeze(completeImports));\n }\n theModule.FUNC___ = 'theModule';\n\n // Whitelist certain module properties as visible to Cajita code. These\n // are all primitive values that do not allow two Cajita entities with\n // access to the same module object to communicate.\n setStatic(theModule, 'cajolerName', module.cajolerName);\n setStatic(theModule, 'cajolerVersion', module.cajolerVersion);\n setStatic(theModule, 'cajoledDate', module.cajoledDate);\n setStatic(theModule, 'moduleURL', module.moduleURL);\n // The below is a transitive freeze because includedModules is an array\n // of strings.\n if (!!module.includedModules) {\n setStatic(theModule, 'includedModules',\n ___.freeze(module.includedModules));\n }\n\n return primFreeze(theModule);\n }", "function myLocalScope() {\n 'use strict'; // you shouldn't need to edit this line\n var myVar;\n console.log(myVar);\n}", "function localInitialize() {\n return {}\n}", "function iifeSafe() { \n (function(global, name) { \n let greeting = 'Hello';\n global.greeting = 'Howdy!'\n console.log(`${greeting}, ${name}!`); // Hello, Carmen!\n }(window, 'Carmen'));\n}", "function isUnnecessaryModuleReactivityWarning({ code, message}) {\n return (code === 'module-script-reactive-declaration' &&\n message === '\"init\" is declared in a module script and will not be reactive'\n );\n}", "function test() {\n var local = 123\n console.log(local)\n}", "function shadowOuterVariable() {\n let outer = 'global outer being shadowed here';\n console.log(outer); // 'global outer being shadowed here'\n}", "function strictly() {\n 'use strict';\n\n}", "function OutsideScope() {\n \n //No warning or error on build that 'user' is not in scope here\n console.log(\"Outside Scope user value: \" + user); //'user is not defined' in debug window\n }", "function _clear() {\n \n // if one or more module ids are passed, remove them\n var loc = arguments.length, moduleId;\n if (loc>0) {\n while(--loc>=0) {\n moduleId = arguments[loc];\n if (moduleId && allModules[moduleId]) {\n delete allModules[moduleId];\n delete usedModules[moduleId];\n modules.splice(modules.indexOf(moduleId), 1);\n }\n }\n\n // no arguments passed, clear ALL exports.\n } else {\n allModules = {} ;\n usedModules = {};\n modules.length = 0 ;\n }\n }", "function foo(){\n 'use strict';\n var undefined = 2;\n console.log( undefined ); // 2\n}", "function adjustImports(source) {\n return source.replace('from \"svelte/internal\";', 'from \"svelte/internal/index.mjs\";')\n}", "function resetVar() {\n debug(\"Resetting global bulkWhois object\");\n returnValue = JSON.parse(JSON.stringify(defaultBulkWhois));\n debug(\"bulkWhois object: {0}\".format(returnValue));\n return returnValue;\n}", "function NoUnusedVariables(context) {\n\t var variableDefs = [];\n\n\t return {\n\t OperationDefinition: {\n\t enter: function enter() {\n\t variableDefs = [];\n\t },\n\t leave: function leave(operation) {\n\t var variableNameUsed = _Object$create(null);\n\t var usages = context.getRecursiveVariableUsages(operation);\n\t var opName = operation.name ? operation.name.value : null;\n\n\t usages.forEach(function (_ref) {\n\t var node = _ref.node;\n\n\t variableNameUsed[node.name.value] = true;\n\t });\n\n\t variableDefs.forEach(function (variableDef) {\n\t var variableName = variableDef.variable.name.value;\n\t if (variableNameUsed[variableName] !== true) {\n\t context.reportError(new _error.GraphQLError(unusedVariableMessage(variableName, opName), [variableDef]));\n\t }\n\t });\n\t }\n\t },\n\t VariableDefinition: function VariableDefinition(def) {\n\t variableDefs.push(def);\n\t }\n\t };\n\t}", "function dolibnoparent() {\n return src(core)\n .pipe(replace(/\\/\\* global[\\w$_\\s,]+\\*\\//g, '/* - */'))\n .pipe(replace('{{lib:version}}', version))\n .pipe(modulify(`${name}${noparent}.js`, {\n header: fs.readFileSync(header, 'utf8'),\n footer: fs.readFileSync(footer, 'utf8'),\n }))\n .pipe(dest(destination))\n ;\n}", "restore(){\n if (this.prevModule) {\n require.cache[this.modulePath] = this.prevModule;\n } else {\n delete require.cache[this.modulePath];\n }\n }", "function forgettingDeclaringVariablesBeforeUseingDeclaresThemOnTheGlobalObject(){\n i = 1;//ReferenceError in strict mode.\n}", "function removeRequireDotEnv(root, j) {\n const dotenvVariables = root\n .findVariableDeclarators()\n .filter(j.filters.VariableDeclarator.requiresModule('dotenv-safe'))\n\n if (dotenvVariables.size() > 0) {\n const dotenvVariableName = dotenvVariables.nodes()[0].id.name\n root\n .find(j.CallExpression, {\n callee: {\n object: {\n name: dotenvVariableName,\n },\n property: {\n name: 'config',\n },\n },\n })\n .remove()\n }\n\n dotenvVariables.remove()\n}", "_filterGlobals() {\n\t\tif (!global.RocketGlobals)\n\t\t\treturn;\n\n\t\tconst {defineGlobals} = new Function(`return {${global.RocketGlobals}}`)();\n\t\t\n\t\tconst globals = Object.assign([], globalList, defineGlobals !== undefined ? defineGlobals() : []);\n\t\t\n\t\tvar fileData = global.RocketFunction;\n\n\t\tglobals.forEach(glob => {\n\t\t\tfileData = fileData.replace(new RegExp(`:\\\\s*${glob}`), `: \"${glob}\"`);\n\t\t});\n\n\t\tglobal.RocketFunction = fileData;\n\t}", "function NoUnusedVariablesRule(context) {\n var variableDefs = [];\n return {\n OperationDefinition: {\n enter: function enter() {\n variableDefs = [];\n },\n leave: function leave(operation) {\n var variableNameUsed = Object.create(null);\n var usages = context.getRecursiveVariableUsages(operation);\n\n for (var _i2 = 0; _i2 < usages.length; _i2++) {\n var _ref2 = usages[_i2];\n var node = _ref2.node;\n variableNameUsed[node.name.value] = true;\n }\n\n for (var _i4 = 0, _variableDefs2 = variableDefs; _i4 < _variableDefs2.length; _i4++) {\n var variableDef = _variableDefs2[_i4];\n var variableName = variableDef.variable.name.value;\n\n if (variableNameUsed[variableName] !== true) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](operation.name ? \"Variable \\\"$\".concat(variableName, \"\\\" is never used in operation \\\"\").concat(operation.name.value, \"\\\".\") : \"Variable \\\"$\".concat(variableName, \"\\\" is never used.\"), variableDef));\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(def) {\n variableDefs.push(def);\n }\n };\n}", "function NoUnusedVariablesRule(context) {\n var variableDefs = [];\n return {\n OperationDefinition: {\n enter: function enter() {\n variableDefs = [];\n },\n leave: function leave(operation) {\n var variableNameUsed = Object.create(null);\n var usages = context.getRecursiveVariableUsages(operation);\n\n for (var _i2 = 0; _i2 < usages.length; _i2++) {\n var _ref2 = usages[_i2];\n var node = _ref2.node;\n variableNameUsed[node.name.value] = true;\n }\n\n for (var _i4 = 0, _variableDefs2 = variableDefs; _i4 < _variableDefs2.length; _i4++) {\n var variableDef = _variableDefs2[_i4];\n var variableName = variableDef.variable.name.value;\n\n if (variableNameUsed[variableName] !== true) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](operation.name ? \"Variable \\\"$\".concat(variableName, \"\\\" is never used in operation \\\"\").concat(operation.name.value, \"\\\".\") : \"Variable \\\"$\".concat(variableName, \"\\\" is never used.\"), variableDef));\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(def) {\n variableDefs.push(def);\n }\n };\n}", "function NoUnusedVariablesRule(context) {\n var variableDefs = [];\n return {\n OperationDefinition: {\n enter: function enter() {\n variableDefs = [];\n },\n leave: function leave(operation) {\n var variableNameUsed = Object.create(null);\n var usages = context.getRecursiveVariableUsages(operation);\n\n for (var _i2 = 0; _i2 < usages.length; _i2++) {\n var _ref2 = usages[_i2];\n var node = _ref2.node;\n variableNameUsed[node.name.value] = true;\n }\n\n for (var _i4 = 0, _variableDefs2 = variableDefs; _i4 < _variableDefs2.length; _i4++) {\n var variableDef = _variableDefs2[_i4];\n var variableName = variableDef.variable.name.value;\n\n if (variableNameUsed[variableName] !== true) {\n context.reportError(new _GraphQLError.GraphQLError(operation.name ? \"Variable \\\"$\".concat(variableName, \"\\\" is never used in operation \\\"\").concat(operation.name.value, \"\\\".\") : \"Variable \\\"$\".concat(variableName, \"\\\" is never used.\"), variableDef));\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(def) {\n variableDefs.push(def);\n }\n };\n}", "function NoUnusedVariablesRule(context) {\n var variableDefs = [];\n return {\n OperationDefinition: {\n enter: function enter() {\n variableDefs = [];\n },\n leave: function leave(operation) {\n var variableNameUsed = Object.create(null);\n var usages = context.getRecursiveVariableUsages(operation);\n\n for (var _i2 = 0; _i2 < usages.length; _i2++) {\n var _ref2 = usages[_i2];\n var node = _ref2.node;\n variableNameUsed[node.name.value] = true;\n }\n\n for (var _i4 = 0, _variableDefs2 = variableDefs; _i4 < _variableDefs2.length; _i4++) {\n var variableDef = _variableDefs2[_i4];\n var variableName = variableDef.variable.name.value;\n\n if (variableNameUsed[variableName] !== true) {\n context.reportError(new _GraphQLError.GraphQLError(operation.name ? \"Variable \\\"$\".concat(variableName, \"\\\" is never used in operation \\\"\").concat(operation.name.value, \"\\\".\") : \"Variable \\\"$\".concat(variableName, \"\\\" is never used.\"), variableDef));\n }\n }\n }\n },\n VariableDefinition: function VariableDefinition(def) {\n variableDefs.push(def);\n }\n };\n}", "function foo() {\n var bar;\n\n function zip() {\n var quux;\n }\n}", "function LocalVariabletoSNOMEDSIRS (localVariableName){\n\treturn false;\n}", "takeMainModule(){\r\n old_val = main_module;\r\n main_module = false;\r\n return old_val;\r\n }", "function overrideByEnv() {\n const localmoduleOverride = window.Cypress.env('LOCALMODULE');\n\n cy.window().then(function(win) {\n win.sessionStorage.setItem('automation-no-analytics', true);\n if (localmoduleOverride) {\n win.localStorage.localmodule = localmoduleOverride;\n };\n });\n}", "function variables()\n{\n var local = 10;\n console.log(global + local);\n}", "function foo() {\n var bar;\n}", "function subtractVars() {\n\t\n}", "function uglify(name) {\n console.log(\"Hello \" + name);\n}", "function clearGlobalsVariables(){\n\tglobalFileName = null;\n\tglobalFileContent = null;\n\tglobalFileMimeType = null;\n\tglobalFilePath = null;\n\tglobalFileExtension = null;\n}", "function multiply2(a) {\n // a este variabila locala\n a = a * 2\n=======\n//a este variabila locala\nvar a = 10;\n\nfunction multiply2(a) {\n //a este variabila locala\n a *= 2\n>>>>>>> f62828c58f8c7aa63780b7cc331471e7ab3b73fb\n console.log(a)\n}\n\nfunction multiply3(b) {\n<<<<<<< HEAD\n // a este variabila globala\n a = a * 3\n=======\n //a este vriabila globala\n a *= 3\n>>>>>>> f62828c58f8c7aa63780b7cc331471e7ab3b73fb\n console.log(a)\n}\n\nfunction multiply4(x) {\n<<<<<<< HEAD\n // a este locala\n // (let creaza o variabila locala)\n var a = 50\n a = a * 4\n console.log(a)\n}\n\nfunction defineVars() {\n // defineste doua variabile locale\n var c = 123\n let d = 321\n}\n\n// o bucla care se executa o singura data\ndo {\n // e este o variabila locala\n // pentru ca este definita in bucla\n let e = 10\n // f este o variabila globala\n // cand este definita cu var in bucla\n var f = 33\n} while(false)\n\nconsole.log(f)\n\n// o sa ne dea eroare:\n// console.log(e)\n\nif (true) {\n // g este locala\n let g = 77\n // h este globala\n var h = 99\n}\n// console.log(g)\nconsole.log(h)\n\n// aplica functia pentru valoarea 1\nmultiply2(1)\nmultiply3(1)\nmultiply4(1)\n// apeleaza functia defineVars\ndefineVars()\n\n// cele doua varible nu sunt vizibile aici\n// si daca rulam codul o sa ne dea o eroare:\n// console.log(c)\n// console.log(d)\n\nconsole.log(a)\n=======\n //let si var creaza o variabila locala\n var a = 50\n a *= 4\n console.log(a)\n}", "function nonStrictMode() {\n let x = 34;\n\n //..\n 'use strict';\n //..\n }", "function teste() {\n \"use strict\"\n let testando = 'teste';\n}", "function evaluateImportDeclaration(_options) {\n // Noop\n}", "resetVars() {\r\n this._current = undefined;\r\n this._nextRevisionNr = exports.INITIAL_REVISION_NEXT_NR;\r\n }", "function clean(context, msg) {\n\tmsg.modules = msg.modules || [];\n\t\n\tvar i, keys;\n\t// remove the standard modules used\n\tkeys = Object.keys(standards);\n\tfor (i = 0; i < keys.length; i++) {\n\t\tdelete context[keys[i]];\n\t}\n\t\n\t// delete the required modules\n\tfor(i = 0; i < msg.modules.length; i++) {\n\t\tdelete context[msg.modules[i]];\n\t}\n\t\n\t// delete require\n\tif (context.require) {\n\t\tdelete context.require;\n\t}\n\t\n\t// return the context with circular references replaced\n\treturn dotprune.circular(context);\n}", "function prepareLocalRunEnvironment() {\n if (!util_1.isLocalRun()) {\n return;\n }\n core.debug(\"Action is running locally.\");\n if (!process.env.GITHUB_JOB) {\n core.exportVariable(\"GITHUB_JOB\", \"UNKNOWN-JOB\");\n }\n if (!process.env.CODEQL_ACTION_ANALYSIS_KEY) {\n core.exportVariable(\"CODEQL_ACTION_ANALYSIS_KEY\", `LOCAL-RUN:${process.env.GITHUB_JOB}`);\n }\n}", "function transform(/*loader*/) {\n return function(moduleMeta) {\n return moduleMeta;\n };\n }", "function removeUseStrictDirective(path, module) {\n var directives = path.node.directives;\n\n for (var i = 0; i < directives.length; i++) {\n var directive = directives[i];\n\n if (directive.value.value === 'use strict') {\n var start = directive.start;\n var end = directive.end;\n\n // Eat any trailing newlines.\n\n while (module.source.charAt(end) === '\\n') {\n end++;\n }\n\n module.magicString.remove(start, end);\n directives.splice(i, 1);\n metadata$1(module).directives.push(cleanNode(directive));\n }\n }\n }", "function testVariables () {\n var thisIsNotAvailableOutside = true;\n console.log(thisIsAVariable);\n}", "function remove_vars(s){\n var m = s.match(var_regex);\n if(!(m)){\n m = [];\n };\n s = s.replace(var_regex, \"\");\n return({s:s, vars:m});\n }", "async function bootstrapLibrary(url, out, asBrowserModule = true, globalName) {\n module(url)._source = null\n let m = new LivelyRollup({ rootModule: module(url), asBrowserModule, globalName });\n m.excludedModules = ['babel-plugin-transform-jsx'];\n let res = await m.rollup(true, 'es2019')\n await resource(System.baseURL).join(out).write(res.min); \n}", "function foo() {\n var a = b = 0;\n}", "function foo() {\n var a = b = 0;\n}", "function CleanTempVariables()\n{\n\tarrDanger = [];\n\t\n\t//cache current targets for next frame\n\tfor(var i = 0; i < NUMBER_OF_TANK; i++)\n\t\tarrOldTargets[i] = arrTargets[i];\n\t\t\n\tarrTargets = [];\n}", "function f1() {\n var n = 5;\n if (true) {\n var _n = 10;\n }\n console.log(n); // 5\n}", "function resetLess() {\n\tdelete require.cache[ require.resolve( \"gulp-less\" ) ];\n\tdelete require.cache[ require.resolve( \"less\" ) ];\n\tgulpLess = require( \"gulp-less\" ); // eslint-disable-line global-require\n}", "function removeVariableDeclarator (decl) {\n if (decl.parent.type === 'VariableDeclaration' && decl.parent.declarations.length === 1) {\n var removed = decl.parent.getSource()\n decl.parent.edit.update(wrapComment('removed: ' + removed) + ';')\n } else {\n decl.edit.update('__dummy')\n }\n}", "function _BindGlobals(){\r\n\t\t\r\n\t\tif(typeof window.$$ !== \"undefined\"){\r\n\t\t\t_Original$$ = window.$$;\r\n\t\t}\r\n\t\t\r\n\t\twindow.$$ = _Penguin;\r\n\t\twindow.Penguin = _Penguin;\r\n\t\t\r\n\t}", "function Dn(t, e) {\n return e = {\n exports: {}\n },\n t(e, e.exports),\n e.exports\n }", "function f(a, b) { // local\n var x = 20;\n var res = a + b; // unexpected mutation\n var y = 2141234124124;\n\n // x, a, b, res, y -> local variables\n console.log(x, res, y);\n}", "function dummyFunction() {\n let myVar = 'Hi there';\n console.log(myVar);\n}", "function ignore() { }", "function resetModule(moduleName) {\n delete require.cache[require.resolve(moduleName)];\n}", "function use(...names) {\n let globalVars = last(globalsToUseStack);\n var obj = {};\n for (let key of names) {\n obj[key] = globalVars[key];\n }\n allGlobalsRequested.push(obj);\n return obj;\n}", "function sum() {\n // \"use strict\"\n var number = 5;\n console.log(number);\n}", "function doDestruct(moduleName) {\n var module = modules.modules[moduleName];\n module.isEnabled = false;\n module.destruct();\n }", "locals(options) {\n let name = dasherize(options.entity.name);\n let component = classify(name);\n let className = classify(options.entity.name);\n let blueprintVersion = require('./package').version;\n\n return {\n name,\n className,\n component,\n blueprintVersion\n };\n }", "function useLessFuntion() {\n // function scope\n var myVariable = \"Some Text\";\n}", "function teste(){\n var local = 123\n console.log(local)\n}", "function removeOrginalFiles() {\n return (tree) => {\n [\n `${project.root}/README.md`,\n `${project.sourceRoot}/main.ts`,\n `${project.sourceRoot}/environments/environment.prod.ts`,\n `${project.sourceRoot}/environments/environment.ts`,\n `${project.sourceRoot}/styles.less`,\n `${project.sourceRoot}/favicon.ico`,\n `${project.sourceRoot}/app/app.module.ts`,\n `${project.sourceRoot}/app/app.component.spec.ts`,\n `${project.sourceRoot}/app/app.component.ts`,\n `${project.sourceRoot}/app/app.component.html`,\n `${project.sourceRoot}/app/app.component.less`,\n `${project.sourceRoot}/app/app-routing.module.ts`\n ]\n .filter(p => tree.exists(p))\n .forEach(p => tree.delete(p));\n };\n}", "function func1(){\n var hey = 10;\n var hey = 20; // BAD PRACTICE!\n console.log(hey);\n }", "function secret() {\n\t\tvar unused1;\n\t}", "function teardownModule() {\n //XXX: No test memory to cleanup right now\n}" ]
[ "0.53870076", "0.5314278", "0.5276699", "0.5224326", "0.5140773", "0.5140009", "0.5133236", "0.5044251", "0.49828306", "0.4943855", "0.49427938", "0.49379557", "0.49250337", "0.49080613", "0.48930615", "0.4850101", "0.4823939", "0.4816564", "0.4810062", "0.4808998", "0.47980896", "0.47845906", "0.47812364", "0.47808444", "0.4777242", "0.47719353", "0.47719353", "0.4768701", "0.4758687", "0.47515076", "0.47465873", "0.47370312", "0.4736812", "0.47355336", "0.47206485", "0.47206286", "0.4717635", "0.46995983", "0.46900436", "0.46790096", "0.46784896", "0.46659753", "0.46594962", "0.4647771", "0.46472013", "0.46324247", "0.46246764", "0.46224633", "0.46199605", "0.46170035", "0.461339", "0.46042705", "0.45956582", "0.45956582", "0.45910987", "0.45910987", "0.45901868", "0.45893088", "0.45820594", "0.45757595", "0.45439142", "0.45368364", "0.45335126", "0.45331773", "0.45325798", "0.45310983", "0.45300996", "0.45266524", "0.45254284", "0.45106256", "0.44996518", "0.4493466", "0.44825512", "0.4481468", "0.44813433", "0.44809923", "0.4466391", "0.4465084", "0.4465084", "0.4464556", "0.44630125", "0.44610664", "0.4455891", "0.44543275", "0.44483587", "0.44338596", "0.44331518", "0.443207", "0.4431145", "0.44302052", "0.44284335", "0.4424252", "0.4404349", "0.44042253", "0.43987384", "0.43981495", "0.43905982", "0.43899968", "0.43858573" ]
0.43849525
100
middleware allows you to do https
function getJSON(url, callback) { //replacement for $.getJSON https.get(url, (response) => { var body = ''; response.on('data', function(d) { body += d; }); response.on('end', function() { callback(null, JSON.parse(body)); }); }).on('error', function(e) { //e is a common convention for error, which is why the functino is named e callback(e); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function https(ctx, next){\n if (window.location.protocol[4] == 's') return next();\n else window.location.href = format('https://%s', hostname);\n next();\n}", "function checkHttps(req, res, next){\n if(req.get('X-Forwarded-Proto').indexOf(\"https\")!=-1){\n return next()\n } else {\n res.redirect('https://' + req.hostname + req.url);\n }\n}", "function secureRequest ( req, res, next ) {\n if ( req.headers[ 'x-forwarded-proto' ] === 'https' ) {\n return next();\n }\n\n res.redirect( 'https://' + req.headers.host + '/' + req.path );\n}", "function forceSsl (req, res, next) {\n let isHealthCheck = () => req.url === \"/api\";\n let isForwardedHttp = () => req.headers[\"x-forwarded-proto\"] === \"http\";\n let getHost = () => req.headers.host;\n\n if (isForwardedHttp() && !isHealthCheck()) {\n let newUrl = `https://${getHost()}${req.url}`;\n debug(`Redirect HTTP request => ${newUrl}`);\n res.redirect(newUrl);\n } else {\n next();\n }\n}", "function ensureSecure(req, res, next) {\n //Heroku stores the origin protocol in a header variable. The app itself is isolated within the dyno and all request objects have an HTTP protocol.\n if (req.get('X-Forwarded-Proto')=='https' || req.hostname == 'localhost') {\n //Serve Vue App by passing control to the next middleware\n next();\n } else if(req.get('X-Forwarded-Proto')!='https' && req.get('X-Forwarded-Port')!='443'){\n //Redirect if not HTTP with original request URL\n res.redirect('https://' + req.hostname + req.url);\n }\n}", "function ensureSecure(req, res, next){\n if(req.secure){\n // OK, continue\n return next();\n };\n // handle port numbers if you need non defaults\n res.redirect('https://' + req.hostname + req.url); \n}", "function ensureSecure(req, res, next) {\n\tif(req.secure) {\n\t\t// OK, continue\n\t\treturn next();\n \t};\n\t\n\t// handle port numbers if you need non defaults\n \t// res.redirect('https://' + req.host + req.url); // express 3.x\n\tres.redirect('https://' + req.hostname + \":5000\" + req.url); // express 4.x\n}", "function withHttps() {\n\tconst config = {\n\t\tdomain: 'localhost', // your domain\n\t\thttps: {\n\t\t\tport: 4000, // any port that is open and not already used on your server\n\t\t\toptions: {\n\t\t\t\tpassphrase: 'fabian',\n\t\t\t\tpfx: fs.readFileSync(\n\t\t\t\t\tpath.resolve(process.cwd(), 'cert/CA/testingdomain.pfx')\n\t\t\t\t),\n\t\t\t},\n\t\t},\n\t};\n\n\tconst serverCallback = server.callback();\n\n\ttry {\n\t\tconst httpsServer = https.createServer(\n\t\t\tconfig.https.options,\n\t\t\tserverCallback\n\t\t);\n\n\t\thttpsServer.listen(config.https.port, function (err) {\n\t\t\tif (!!err) {\n\t\t\t\tconsole.error('HTTPS server FAIL: ', err, err && err.stack);\n\t\t\t} else {\n\t\t\t\tconsole.log(\n\t\t\t\t\t`HTTPS server OK: https://${config.domain}:${config.https.port}`\n\t\t\t\t);\n\t\t\t}\n\t\t});\n\t} catch (ex) {\n\t\tconsole.error('Failed to start HTTPS server\\n', ex, ex && ex.stack);\n\t}\n}", "function ensureHttps() {\n if (window.location.protocol != \"https:\") {\n window.location.href = \"https:\" + window.location.href.substring(window.location.protocol.length);\n }\n}", "function ensureHttps() {\n if (window.location.protocol != \"https:\" && window.location.protocol != \"file:\" && window.location.hostname != \"localhost\") {\n window.location.href = \"https:\" + window.location.href.substring(window.location.protocol.length);\n }\n}", "function vertifyHttps(urllink){\n var result = 0;\n if (urllink.indexOf(\"https\") == 0){\n result = 1;\n }\n return result;\n}", "isSecure() {\n return this.https ? true : false;\n }", "function proxyHttps() {\n httpServer.on('connect', function (req, socket, upgradeHead) {\n var netClient = net.createConnection(INTERNAL_HTTPS_PORT);\n\n netClient.on('connect', function () {\n\n socket.write(\"HTTP/1.1 200 Connection established\\r\\nProxy-agent: Netscape-Proxy/1.1\\r\\n\\r\\n\");\n });\n\n socket.on('data', function (chunk) {\n netClient.write(chunk);\n });\n socket.on('end', function () {\n netClient.end();\n });\n socket.on('close', function () {\n netClient.end();\n });\n socket.on('error', function (err) {\n log.error('socket error ' + err.message);\n netClient.end();\n });\n\n netClient.on('data', function (chunk) {\n socket.write(chunk);\n });\n netClient.on('end', function () {\n socket.end();\n });\n netClient.on('close', function () {\n socket.end();\n });\n netClient.on('error', function (err) {\n\n socket.end();\n });\n\n });\n}", "function redirectToHTTPS() {\n if (location.protocol !== \"https:\") {\n location.href =\n \"https:\" +\n window.location.href.substring(window.location.protocol.length);\n }\n}", "async function httpsWorker (glx) {\n const fastify = Fastify({\n logger: true,\n serverFactory (handler) {\n const tlsOptions = null\n return glx.http2Server(tlsOptions, handler)\n }\n })\n\n await initialize(fastify)\n\n await fastify.listen(443, '::').catch(e => console.error(e))\n\n // Listening to 80 to solve HTTP-01 challenges and redirecting clueless people to HTTPS\n const httpServer = glx.httpServer()\n\n httpServer.listen(80, '::', function () {\n console.info('Listening on ', httpServer.address())\n })\n}", "function isSecure(entry) {\n return entry.request.url.indexOf(\"https://\") === 0;\n}", "__ssl() {\n /// TODO: nothing, I guess?\n }", "forceSSL(opt = {}) {\n this.enableForceSSL = opt;\n }", "function httpRequester(url) {\n return url && url.startsWith('https://') ? https : http;\n}", "function startHttpsServer(app) {\n var httpServer;\n var credentials = loadSslCredentials();\n\n if (!credentials) { console.log('SSL issue'); }\n\n try {\n httpServer = https.createServer(credentials, app);\n httpServer.on('error', httpError);\n httpServer.listen(config.httpsPort);\n console.log('Server started on HTTPS: ' + config.httpsPort);\n } catch (e) {\n console.error('Error while starting HTTPS server on ' + config.httpsPort + ':');\n console.error(e);\n throw e;\n }\n}", "function enableSSL(app, env) {\n if (env.sslKey) {\n var crypto = require('crypto');\n app.setSecure(crypto.createCredentials({\n key: env.sslKey,\n cert: env.sslCrt\n }));\n }\n}", "function addHttps() {\n const httpProtocol = 'https';\n\n return inputEl.value.includes(httpProtocol)\n ? myLeads.push(inputEl.value)\n : myLeads.push(`${httpProtocol}://${inputEl.value}`);\n}", "function whathost(ssl) {\r\n if (ssl) return \"https://ssl.what.cd/\";\r\n else if (!ssl) return \"http://what.cd/\";\r\n}", "setSecure(https) {\n this.https = https ? true : false;\n return this;\n }", "function set_https_secure_check(is_enable) {\n if(!is_enable) {\n console.log(\"[INFO] Turn OFF https security checks\");\n\n // disable https security checks to avoid DEPTH_ZERO_SELF_SIGNED_CERT error\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = \"0\";\n } else if(typeof process.env.NODE_TLS_REJECT_UNAUTHORIZED !== 'undefined') {\n console.log(\"[INFO] Turn ON https security checks\");\n\n // enable https security checks\n delete process.env.NODE_TLS_REJECT_UNAUTHORIZED;\n }\n }", "function forwardRequestSSL(host, port){\n \n ipc.server.broadcast('ConnectReq', \"Forwarding a HTTPS request to \" + host);\n\n // use DNS to translate hostname to IP\n dns.lookup(host, (error, addr, fam) => {\n \n if(error){\n console.error(\"Error parsing this hostname: \" + error);\n return;\n }\n \n // create a TCP connection to the webserver's IP\n ProxyCLientS = net.connect(port ,addr, () => {\n console.log(\"connected to webserver\");\n\n ProxyCLientS.setKeepAlive(true)\n\n ProxyCLientS.on('error', (error) => {\n console.error('Received an error at the connection between server and proxy' + error)\n });\n\n // Set the callback to the event where the proxy connection with the web server\n // receives data, to send the data to the client\n ProxyCLientS.on('data', (dataFromWebServer) => {\n // console.log(\"Tunnelling data from server to client\");\n // console.log(\"forwarding this RESPONSE to whichever source requested \" + host);\n socket.write(dataFromWebServer)\n });\n\n // And finally, send a response to the client indicating the proxy is ready\n // to pipe data from the client to the web server\n socket.write(\"HTTP/1.1 200 Connection established\\r\\n\\r\\n\");\n\n })\n });\n }", "function configureSecurity() {\n app.use(helmet());\n app.use(cookieParser());\n app.use(helmet.noCache());\n app.enable('trust proxy');\n if (!isLocal) {\n app.use(express_enforces_ssl());\n }\n}", "function onHttpsListening() {\n const addr = https_server.address()\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port: ' + addr.port\n //打印log\n console.log(CGlobal.logLang('clothingshop:server HTTPS启动成功,{0} IP地址为:{1}', bind, ip || 'localhost'))\n console.timeEnd('HTTPS service start time is')\n // console.log('Node 界面访问 https://%s:%s/superLogin', hostname, addr.port);\n // console.log('界面访问 https://%s:%s/index', hostname, addr.port);\n // console.log('Angular 界面访问 https://%s:%s/ng-index', hostname, addr.port);\n }", "function fixRedirectUrlScheme(proxyRes) {\n if (proxyRes.headers['location']) {\n var loc = url.parse(proxyRes.headers['location']);\n if (loc.protocol == 'http:' && loc.port == tlsPort) {\n if (hostNames.indexOf(loc.hostname.toLowerCase()) >= 0) {\n loc.protocol = 'https:';\n proxyRes.headers['location'] = loc.format();\n console.log('### http -> https: ' + loc.protocol + loc.host + loc.path + ' ...');\n }\n }\n }\n}", "function defaultRequest(req, res) {\n console.log(\"http/https request received\");\n var done = finalhandler(req, res);\n serve(req, res, done);\n}", "function startHttp2({port, key, cert}, app) {\n const spdy = require('spdy');\n\n spdy.createServer({ key, cert }, app)\n .listen(config.SSL.port, err => err ? console.error(err) : console.log('Express Server Listening on port %s with HTTP/2', config.SSL.port));\n}", "static get port() {\n return 443;\n }", "static get port() {\n return 443;\n }", "static get port() {\n return 443;\n }", "static get port() {\n return 443;\n }", "static get port() {\n return 443;\n }", "function middleware(request, response, next) {}", "function get (url, cb) {\n if (url.indexOf('https') !== 0) {\n cb(new Error('SSL only!'))\n } else {\n cb(null, 'some data!')\n }\n}", "function wwwhisper(injectLogoutIframe) {\n configure();\n if (wwwhisperURL === null) {\n return function wwwhisperDisabled(req, res, next) {\n next();\n };\n }\n if (injectLogoutIframe === undefined) {\n injectLogoutIframe = true;\n }\n\n return function isAuthorized(req, res, next) {\n // A reason why node <= 0.8.* is not supported is that starting from\n // node 0.10, req is a readable stream that does not emit data until\n // a reader is ready. With node 0.8 req emits 'data' events\n // immediately (req.readable becomes false).\n var uri = normalizedUri(req.url);\n req.url = uri.toString();\n if (req.url.search(/^\\/wwwhisper\\/auth\\//) !== -1) {\n authorized(req, res, next);\n } else {\n var options = subRequestOptions(req, 'GET', authQuery(uri.path()),\n AUTH_REQUEST_FORWARDED_HEADERS);\n var authReq = http.request(options, function(authRes) {\n if (authRes.statusCode === 200) {\n var user = authRes.headers['user'];\n if (user !== undefined) {\n req.remoteUser = user;\n res.setHeader('User', user);\n }\n var callChain = injectLogoutIframe ? [injector, authorized, next] :\n [authorized, next];\n chain(req, res, callChain);\n } else {\n writeHead(res, authRes.statusCode, authRes.headers);\n authRes.on('data', function(chunk) {\n res.write(chunk);\n });\n authRes.on('end', function() {\n res.end();\n });\n }\n });\n authReq.on('error', reportError(res, 'auth request failed'));\n authReq.end();\n }\n };\n}", "static get port() {\n return 443;\n }", "static get port() {\n return 443;\n }", "function middleware(req, res, next) {\n\tns.run(() => next());\n}", "function makeURLSecure (url) {\n return url.replace(/^http:/, 'https:')\n}", "function get (parsed, opts, fn) {\n opts.http = https;\n http(parsed, opts, fn);\n}", "function get (parsed, opts, fn) {\n opts.http = https;\n http(parsed, opts, fn);\n}", "function fhmiddleware() {\n var fh = fhMbaasApi.getFhApi();\n return function(req, res, next) {\n var requestTime = new Date().getTime();\n\n // TODO - need to dig into analytics here and find out what exactly funct should be,\n // and possibly replace funct with url in analytics\n var funct = req.url;\n\n // Note we can't peek into the request body for POST/PUT as can can't assume its been unrolled at this stage\n var params = {};\n params = paramsUtils.parseFHParams(req);\n\n params._headers = req.headers;\n params._files = req.files;\n\n var msgParams = params;\n msgParams.ipAddress = getIPofClient(req);\n msgParams.agent = (req.headers && req.headers['user-agent']) ? req.headers['user-agent'] : '-';\n msgParams.funct = funct;\n\n function getIPofClient(req) {\n var ret = \"nonset\"; // default value\n\n if (req.headers && req.headers['x-forwarded-for']) {\n ret = req.headers['x-forwarded-for']; // this may be a comma seperated list of addresses added by proxies and load balancers\n } else if (req.connection && req.connection.remoteAddress) {\n ret = req.connection.remoteAddress;\n }\n return ret;\n }\n\n // check secure endpoints\n req.pause();\n authentication(req, res, params).authenticate(funct, function(err) {\n req.resume();\n\n if (err) {\n res.writeHead(err.code, {\n \"Cache-Control\": \"no-cache\",\n \"Content-Type\": \"application/json\"\n });\n return res.end(JSON.stringify(err));\n }\n\n\n res.on('finish', function() {\n sendReport();\n });\n\n function sendReport() {\n var responseTime = new Date().getTime();\n msgParams.status = res.statusCode || 200;\n msgParams.time = (responseTime - requestTime); //milisecs;\n msgParams.start = requestTime;\n msgParams.end = responseTime;\n\n try {\n fhreports.sendReport({\n func: funct,\n fullparams: msgParams,\n topic: 'fhact'\n });\n } catch (e) {\n // error purposely ignored\n }\n\n // also log live stat\n fh.stats.timing(funct + '_request_times', msgParams['time'], true);\n fh.stats.timing('__fh_all_request_times', msgParams['time'], true);\n }\n\n next();\n });\n };\n}", "function enrichHTTPSOptions(key, dflt) {\n key = 'HTTPS_' + key.toUpperCase();\n var value = process.env[key];\n if (value && value != 1 && /^[^-----]/.test(value) && fs.existsSync(value)) {\n value = fs.readFileSync(body, 'utf-8');\n }\n return (value == 1 ? dflt : value) || null;\n}", "use (middleware) {\n this.app.use(middleware)\n }", "function wwwRedirect(req, res, next) {\n console.log('Got url ' + req.headers.host)\n console.log('req.get(\"host\") ' + req.get('host'))\n console.log('req.host ' + req.host)\n console.log('req.originalUrl ' + req.originalUrl)\n console.log('req.url ' + req.url)\n if (req.headers.host.slice(0, 4) === 'www.') {\n var newHost = req.headers.host.slice(4);\n return res.redirect(301, req.protocol + '://' + newHost + req.originalUrl);\n console.log('New url ' + req.protocol + '://' + newHost + req.originalUrl)\n }\n next();\n}", "function getMiddleware(sessionStore) {\r\n middleware.getMiddleware(options, function(err, _middleware, _restRouter) {\r\n if (err) fsm.fire(\"error\", err); else {\r\n var mirror = null,\r\n deferCompletion = false,\r\n tlsOptions;\r\n\r\n //stash the rest interface\r\n cache.setItem(\"feather-rest-router\", _restRouter);\r\n cache.setItem(\"feather-rest\", _restRouter.rest);\r\n\r\n //defer final server setup until SSL/mirroring is sorted out below\r\n var completeServerSetup = function() {\r\n //create the underlying Connect server instance\r\n var server = Connect();\r\n _.each(_middleware, function(ware) {\r\n server.use(ware);\r\n });\r\n\r\n // configure session path ignores\r\n if (options.connect.session.ignorePaths && server.session) {\r\n var si = options.connect.session.ignorePaths.length-1;\r\n while (si >= 0) {\r\n server.session.ignore.push(options.connect.session.ignorePaths[si]);\r\n si -= 1;\r\n }\r\n }\r\n\r\n //start listening\r\n var port = options.port;\r\n if (options.ssl && options.ssl.enabled && options.ssl.port) port = options.ssl.port;\r\n\r\n if (options.ssl && options.ssl.enabled) {\r\n server.httpServer = https.createServer(tlsOptions, server).listen(port);\r\n } else {\r\n server.httpServer = http.createServer(server).listen(port);\r\n }\r\n\r\n // now that ports have been bound we can change the process user and group\r\n if (options.daemon.runAsDaemon == true && options.daemon.runAsUser) {\r\n\r\n console.debug('setting process and group ids (eval whether this should happen for clustered workers or just group leader - then remove debug log statement)...');\r\n\r\n if (process.env['USER'] === 'root') {\r\n if (options.daemon.runAsGroup) {\r\n process.setgid(options.daemon.runAsGroup);\r\n }\r\n\r\n process.setuid(options.daemon.runAsUser);\r\n }\r\n }\r\n\r\n server.sessionStore = sessionStore;\r\n fsm.fire(\"complete\", server, mirror);\r\n };\r\n\r\n //use ssl?\r\n if (options.ssl && options.ssl.enabled) {\r\n if (options.ssl.routes && (!options.ssl.port || options.ssl.port == options.port)) {\r\n throw new Error(\"When explicit SSL routes are defined, you must also specify a value for ssl.port which must be different from the top level (non-SSL) port.\");\r\n }\r\n\r\n tlsOptions = {\r\n // This is the default secureProtocol used by Node.js, but it might be\r\n // sane to specify this by default as it's required if you want to\r\n // remove supported protocols from the list. This protocol supports:\r\n //\r\n // - SSLv2, SSLv3, TLSv1, TLSv1.1 and TLSv1.2\r\n //\r\n secureProtocol: 'SSLv23_method',\r\n key: fs.readFileSync(options.ssl.key),\r\n cert: fs.readFileSync(options.ssl.cert)\r\n };\r\n\r\n // disable SSLv2 and SSLv3 by default to prevent POODLE exploit\r\n // There is a bit of a debate on when this will appear in node core \r\n // and whether it will be on or off by default. https://github.com/joyent/node/pull/8551\r\n // This current solution will work until the Node community decides.\r\n if (!options.ssl.allowSSLv23) {\r\n\r\n // Supply `SSL_OP_NO_SSLv3` and `SSL_OP_NO_SSLv2` constant as secureOption to disable SSLv2 and SSLv3\r\n // from the list of supported protocols that SSLv23_method supports.\r\n tlsOptions.secureOptions = constants.SSL_OP_NO_SSLv3|constants.SSL_OP_NO_SSLv2;\r\n }\r\n\r\n if (options.ssl.ca) {\r\n tlsOptions.ca = [];\r\n _.each(options.ssl.ca, function(ca) {\r\n var certs = fs.readFileSync(ca);\r\n tlsOptions.ca.push(certs);\r\n });\r\n }\r\n _middleware.unshift(tlsOptions);\r\n\r\n if (options.ssl.useRedirectServer && !options.ssl.routes) {\r\n //ssl is configured as \"strict, always on\" - i.e. no explicit ssl routes are defined,\r\n //therefore, the 'mirror' server on the redirect port need only be a 'throw-away' shim that redirects all requests to SSL\r\n var redirectServer = Connect(\r\n function(req, res, next) {\r\n //do the redirect\r\n res.statusCode = 302;\r\n var host = options.host;\r\n var port = options.ssl.clientRedirectPort || options.ssl.port;\r\n\r\n //if ssl port is non-standard (443), make sure it gets included in the redirect url\r\n host += port === 443 ? \"\" : \":\" + port;\r\n res.setHeader(\"Location\", \"https://\" + host + req.url);\r\n res.end();\r\n }\r\n );\r\n redirectServer.listen(options.ssl.redirectServerPort);\r\n } else if (options.ssl.routes) {\r\n //ssl is defined as only _enforced_ for a subset of routes (all routes MAY still use https, but the configured routes MUST use it),\r\n //therefore we must create a full mirror server that has logic to force-redirect to ssl for specific routes\r\n\r\n deferCompletion = true; //indicate final server setup needs to be deferred\r\n\r\n //get another copy of the middleware stack for the mirror (cannot use shared stack as each server needs its own)\r\n middleware.getMiddleware(options, function(err, __middleware, __rest) {\r\n //stash the mirror's rest interface\r\n cache.setItem(\"feather-rest-mirror\", __rest);\r\n\r\n //add the SSL route enforcement middleware module at the top of the new stack\r\n __middleware.unshift(connectRouter(function(app) {\r\n _.each(options.ssl.routes, function(route) {\r\n\r\n //redirect all http verbs\r\n _.each(connectRouter.methods, function(verb) {\r\n (app[verb])(new RegExp(route), function(req, res, next) {\r\n //do the redirect\r\n res.statusCode = 302;\r\n var host = options.host;\r\n var port = options.ssl.clientRedirectPort || options.ssl.port;\r\n //if ssl port is non-standard (443), make sure it gets included in the redirect url\r\n host += port === 443 ? \"\" : \":\" + port;\r\n res.setHeader(\"Location\", \"https://\" + host + req.url);\r\n res.end();\r\n });\r\n });\r\n });\r\n }));\r\n\r\n //spin up mirror and complete server setup\r\n mirror = Connect();\r\n _.each(__middleware, function(ware) {\r\n mirror.use(ware);\r\n });\r\n\r\n mirror.httpServer = http.createServer(mirror).listen(options.port);\r\n\r\n completeServerSetup();\r\n });\r\n }\r\n }\r\n\r\n if (!deferCompletion) completeServerSetup();\r\n }\r\n });\r\n }", "function httpsGet(opt) {\n return new Promise((fres, frej) => https.get(opt, (res) => {\n var err = null, cod = res.statusCode, dat = '';\n if(cod!==200) err = new Error(`HTTPS GET failed (${cod}).\\n${opt}`);\n if(err) { res.resume(); return frej(err); }\n res.setEncoding('utf8');\n res.on('data', (cnk) => dat+=cnk);\n res.on('end', () => fres(dat));\n }).on('error', frej));\n}", "function Proxy(proxy_options) {\n this.options = process_options(proxy_options);\n //this.processor_class = processor_class ? new Processor(processor_class) : null;\n\n var that = this;\n\n var https_opts = {\n key: fs.readFileSync('www.github.com.key'),\n cert: fs.readFileSync('www.github.com.crt'),\n ca: fs.readFileSync('ca.crt'),\n SNICallback: getCredentialsContext\n };\n\n\n // HTTPS Virtual Server.\n\n var virtual_server_https = https.createServer(https_opts, function (request, response) {\n sys.log(\"http message to be handled.\")\n handle_request(that, request, response, \"https\");\n });\n\n virtual_server_https.addListener('error', function(err) {\n sys.log(\"error on virtual_server_https\");\n sys.log(err);\n });\n virtual_server_https.listen(this.options.virtual_server_https_port);\n if(this.options.verbose) console.log('https virtual server'.blue + ' started '.green.bold + 'on port '.blue + (\"\"+this.options.virtual_server_https_port).yellow);\n\n\n // HTTP Virtual Server\n var virtual_server_http = http.createServer(function(request, response) {\n sys.log(\"http message to be handled.\")\n handle_request(that, request, response, \"http\");\n });\n virtual_server_http.addListener('error', function(err) {\n sys.log(\"error on virutal_server_http\");\n sys.log(err);\n });\n\n // Handle connect request (for https), the client is attempting to upgrade to a https connection.\n virtual_server_http.addListener('upgrade', function(req, socket, upgradeHead) {\n sys.log(\"attempting to upgrade the connection.\")\n var proxy = net.createConnection(that.options.virtual_server_https_port, 'localhost');\n\n proxy.on('connect', function() {\n socket.write( \"HTTP/1.0 200 Connection established\\r\\nProxy-agent: Netscape-Proxy/1.1\\r\\n\\r\\n\");\n });\n\n // connect pipes\n proxy.on( 'data', function(d) { socket.write(d) });\n socket.on('data', function(d) { try { proxy.write(d) } catch(err) {}});\n\n proxy.on( 'end', function() { socket.end(); });\n socket.on('end', function() { proxy.end(); });\n\n proxy.on( 'close',function() { socket.end(); });\n socket.on('close',function() { proxy.end(); });\n\n proxy.on( 'error',function() { socket.end(); });\n socket.on('error',function() { proxy.end(); });\n });\n\n\n virtual_server_http.listen(this.options.virtual_server_http_port);\n if(this.options.verbose) console.log('http virtual server '.blue + 'started '.green.bold + 'on port '.blue + (\"\"+this.options.virtual_server_http_port).yellow);\n}", "function sseMiddleware(req, res, next) {\n res.sseConnection = new Connection(res);\n next();\n}", "function security (req, res, next)\n{\n\tif (! has_started_serving_apis)\n\t{\n\t\tif (is_openbsd) // drop \"rpath\"\n\t\t\tpledge.init(\"error stdio tty prot_exec inet dns recvfd\");\n\n\t\thas_started_serving_apis = true;\n\t}\n\n\tconst api = url.parse(req.url).pathname;\n\n\t// Not an API !\n\tif ((! api.startsWith(\"/auth/v1/\")))\n\t\treturn next();\n\n\tconst cert\t\t\t= req.socket.getPeerCertificate(true);\n\tconst min_class_required\t= MIN_CERTIFICATE_CLASS_REQUIRED.get(api);\n\n\tif (! min_class_required)\n\t{\n\t\treturn END_ERROR (\n\t\t\tres, 404,\n\t\t\t\t\"No such API. Please visit: \"\t+\n\t\t\t\t\"<http://auth.iudx.org.in> for documentation.\"\n\t\t);\n\t}\n\n\tcert.serialNumber\t= cert.serialNumber.toLowerCase();\n\tcert.fingerprint\t= cert.fingerprint.toLowerCase();\n\n\tif (is_iudx_certificate(cert))\n\t{\n\t\tlet\tinteger_cert_class\t= 0;\n\t\tconst\tcert_class\t\t= cert.subject[\"id-qt-unotice\"];\n\n\t\tif (cert_class)\n\t\t{\n\t\t\tinteger_cert_class = parseInt(\n\t\t\t\tcert_class.split(\":\")[1],10\n\t\t\t) || 0;\n\t\t}\n\n\t\tif (integer_cert_class < 1)\n\t\t\treturn END_ERROR(res, 403, \"Invalid certificate class\");\n\n\t\tif (integer_cert_class < min_class_required)\n\t\t{\n\t\t\treturn END_ERROR (\n\t\t\t\tres, 403,\n\t\t\t\t\t\"A class-\" + min_class_required\t+\n\t\t\t\t\t\" or above certificate \"\t+\n\t\t\t\t\t\"is required to call this API\"\n\t\t\t);\n\t\t}\n\n\t\tif (api.endsWith(\"/introspect\") && integer_cert_class !== 1)\n\t\t{\n\t\t\treturn END_ERROR (\n\t\t\t\tres, 403,\n\t\t\t\t\t\"A class-1 certificate is required \" +\n\t\t\t\t\t\"to call this API\"\n\t\t\t);\n\t\t}\n\n\t\tconst error = is_secure(req,res,cert,true); // validate emails\n\n\t\tif (error !== \"OK\")\n\t\t\treturn END_ERROR (res, 403, error);\n\n\t\tpool.query(\"SELECT crl FROM crl LIMIT 1\", [], (error,results) =>\n\t\t{\n\t\t\tif (error || results.rows.length === 0)\n\t\t\t{\n\t\t\t\treturn END_ERROR (\n\t\t\t\t\tres, 500,\n\t\t\t\t\t\"Internal error!\", error\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst CRL = results.rows[0].crl;\n\n\t\t\tif (has_certificate_been_revoked(req.socket,cert,CRL))\n\t\t\t{\n\t\t\t\treturn END_ERROR (\n\t\t\t\t\tres, 403,\n\t\t\t\t\t\"Certificate has been revoked\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (! (res.locals.body = body_to_json(req.body)))\n\t\t\t{\n\t\t\t\treturn END_ERROR (\n\t\t\t\t\tres, 400,\n\t\t\t\t\t\"Body is not a valid JSON\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tres.locals.cert\t\t= cert;\n\t\t\tres.locals.cert_class\t= integer_cert_class;\n\t\t\tres.locals.email\t= cert\n\t\t\t\t\t\t\t.subject\n\t\t\t\t\t\t\t.emailAddress\n\t\t\t\t\t\t\t.toLowerCase();\n\n\t\t\treturn next();\n\t\t});\n\t}\n\telse\n\t{\n\t\tocsp.check({cert:cert.raw, issuer:cert.issuerCertificate.raw},\n\t\tfunction (err, ocsp_response)\n\t\t{\n\t\t\tif (err)\n\t\t\t{\n\t\t\t\treturn END_ERROR (\n\t\t\t\t\tres, 403,\n\t\t\t\t\t\"Your certificate issuer did \"\t+\n\t\t\t\t\t\"NOT respond to an OCSP request\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (ocsp_response.type !== \"good\")\n\t\t\t{\n\t\t\t\treturn END_ERROR (\n\t\t\t\t\tres, 403,\n\t\t\t\t\t\"Your certificate has been \"\t+\n\t\t\t\t\t\"revoked by your certificate issuer\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Certificates issued by other CAs\n\t\t\t// may not have an \"emailAddress\" field.\n\t\t\t// By default consider them as a class-1 certificate\n\n\t\t\tconst error = is_secure(req,res,cert,false);\n\n\t\t\tif (error !== \"OK\")\n\t\t\t\treturn END_ERROR (res, 403, error);\n\n\t\t\tres.locals.cert_class\t= 1;\n\t\t\tres.locals.email\t= \"\";\n\n\t\t\t// but if the certificate has a valid \"emailAddress\"\n\t\t\t// field then we consider it as a class-2 certificate\n\n\t\t\tif (is_valid_email(cert.subject.emailAddress))\n\t\t\t{\n\t\t\t\tres.locals.cert_class\t= 2;\n\t\t\t\tres.locals.email\t= cert\n\t\t\t\t\t\t\t\t.subject\n\t\t\t\t\t\t\t\t.emailAddress\n\t\t\t\t\t\t\t\t.toLowerCase();\n\t\t\t}\n\n\t\t\tif (res.locals.cert_class < min_class_required)\n\t\t\t{\n\t\t\t\treturn END_ERROR (\n\t\t\t\t\tres, 403,\n\t\t\t\t\t\"A class-\" + min_class_required\t+\n\t\t\t\t\t\" or above certificate is\"\t+\n\t\t\t\t\t\" required to call this API\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (! (res.locals.body = body_to_json(req.body)))\n\t\t\t{\n\t\t\t\treturn END_ERROR (\n\t\t\t\t\tres, 400,\n\t\t\t\t\t\"Body is not a valid JSON\"\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tres.locals.cert\t= cert;\n\n\t\t\treturn next();\n\t\t});\n\t}\n}", "function routeRedirect( server ) {\n\tfunction redirect( request, reply ) {\n\t\treturn reply.redirect( `https://${request.info.host}${request.path}`)\n\t}\n\tserver.route( { method: 'GET', path: '/', handler: redirect, options: { cors: true } } )\n\tserver.route( { method: 'GET', path: '/index.html', handler: redirect, options: { cors: true } } )\n}", "function webAuthentication(req, res, next) { // TODO: move with authentication to separate file\n if(req.isAuthenticated()) {\n next();\n }\n else {\n var rootUrl = req.protocol + '://' + req.get('host');\n res.redirect(rootUrl + '/login.html');\n }\n}", "function proxySite(res, url) {\n request({\n url: url\n }, function (error, response, body) {\n response.headers['Access-Control-Allow-Origin'] = '*';\n res.writeHead(response.statusCode, response.headers);\n res.write(body);\n res.end();\n });\n}", "function configureExpress() {\n const server = express();\n // Needed only to parse the CSP report. If it catches any other types, it will cause other JSON posts to Next.js to fail.\n server.use(bodyParser.json({\n type: ['application/csp-report']\n }));\n server.use(bodyParser.text());\n // Set up rules which prevent embedding of the application into other sites\n // and disallow the page from contacting sites other than itself and the backend server\n server.use(helmet({\n contentSecurityPolicy: {\n directives: {\n defaultSrc: [\"'none'\"], // default for all directives\n scriptSrc: [\"'self'\", \"'unsafe-inline'\", \"'unsafe-eval'\"], // only allow from self and inline code - needed for React\n styleSrc: [\"'self'\", \"'unsafe-inline'\"], // only allow from self and inline code - needed for styled components\n imgSrc: ['*'],\n objectSrc: [\"'none'\"], // embedded object sources\n mediaSrc: [\"'none'\"], // A/V media sources\n frameSrc: [\"'none'\"], // items allowed to be placed in frames/iframes\n fontSrc: [\"'self'\"],\n childSrc: [\"'self'\"],\n connectSrc: [\"'self'\", backendUrl], // limits the URLs to which the front-end code can connect\n reportUri: '/csp-violation', // posts any attempted violations here\n },\n reportOnly: false,//process.env.NODE_ENV === 'development',\n },\n frameguard: {\n action: 'deny', // don't allow application to be displayed within a frame on another website\n }\n }));\n // Set up local session management needed for passport\n server.use(require('express-session')({\n secret: process.env.SESSION_SECRET,\n resave: false,\n saveUninitialized: false,\n cookie: { maxAge: process.env.SESSION_EXPIRE_HOURS * 60 * 60 * 1000},\n }));\n server.use(passport.initialize());\n server.use(passport.session());\n\n // Login module which creates the needed JWT token which can authN against the back end\n server.get('/login', (req, res, next) => {\n passport.authenticate(\n require(`./lib/auth-${authMethod}`).passportAuthMethod,\n { failureRedirect: '/_error' },\n // eslint-disable-next-line no-unused-vars\n (err, user, info) => {\n // eslint-disable-next-line no-unused-vars\n req.logIn(user, (err) => {\n const token = jwt.sign({}, jwtSecret,\n { expiresIn: process.env.SESSION_EXPIRE_HOURS + 'h',\n algorithm: 'HS384',\n subject: req.user.id,\n issuer: `${process.env.APP_NAME}-${process.env.INSTANCE_ID}` });\n res.cookie('apiAuthToken', token, { maxAge: process.env.SESSION_EXPIRE_HOURS * 60 * 60 * 1000});\n res.redirect('/');\n });\n })(req, res, next);\n });\n\n // disconnect the login session and kill the cookie\n server.get('/logout', (req, res) => {\n res.cookie('apiAuthToken', '', {maxAge: -1});\n req.logout();\n req.session.destroy();\n res.redirect('/');\n });\n\n // Log any instances of the CSP rules being violated\n server.post('/csp-violation', (req, res) => {\n if (req.body) {\n logger.warn('CSP Violation: ', req.body);\n } else {\n logger.warn('CSP Violation: No data received!');\n }\n\n res.status(204).end();\n });\n\n // log information posted from the client to the server logs\n server.post('/logger', passport.authenticate('bearer'), (req, res) => {\n // user is set if the authentication was successful\n if ( req.user ) {\n getLogger('client').info(req.body);\n res.status(200).end();\n return;\n }\n res.status(403).end();\n });\n\n // Pass anything not covered by the above to Next.js\n server.all('*', (req, res) => handleNextJsRequest(req, res));\n\n // Start the server\n server.listen(process.env.FRONTEND_PORT, (err) => {\n if (err) throw err;\n logger.info(`> Ready on ${process.env.FRONTEND_URL}`);\n });\n}", "function handleRootCertRequest(req, res) {\n if (checkUserIpAddress(req, res, true) == false) { return; }\n res.set({ 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Content-Type': 'application/octet-stream', 'Content-Disposition': 'attachment; filename=' + certificates.RootName + '.cer' });\n res.send(new Buffer(getRootCertBase64(), 'base64'));\n }", "static checkSecurity (req, res) {\n res.status(200).send()\n }", "function InitSSL(initial, sslOpts = {}) {\n this.config.ssl = this.getCoreOpts(moduleName, sslOpts, initial)\n\n if (this.config.ssl.enabled) {\n const https = require('https')\n const enforceSSL = require('express-enforces-ssl-update')\n let configMessage = 'to use certificates on this machine'\n\n if (!this.config.ssl.sites || this.config.ssl.sites.length === 0) {\n const altnames = [this.config.host]\n Object.keys(this.config.subdomains).forEach((subdomain) => {\n if (subdomain !== 'index') {\n altnames.push(`${subdomain}.${this.config.host}`)\n }\n\n const subdomainAliases = this.config.subdomains[subdomain].aliases || []\n\n if (subdomainAliases.length) {\n subdomainAliases.forEach((alias) => {\n altnames.push(`${alias}.${this.config.host}`)\n })\n }\n })\n\n Object.keys(this.coreSubdomains).forEach((index) => {\n const subdomain = this.coreSubdomains[index]\n altnames.push(`${subdomain}.${this.config.host}`)\n })\n this.config.ssl.sites = [{ subject: this.config.host, altnames }]\n }\n\n const path = require('path')\n const fs = require('fs')\n const mkdirp = require('mkdirp')\n let serverOpts = {}\n this.config.ssl.strategy =\n this.config.host === 'localhost' ? 'localhost' : this.config.ssl.strategy\n\n switch (this.config.ssl.strategy) {\n case 'localhost':\n /// This creates an error, let's swallow it.\n // this.config.ssl.port = this.config.debug ? this.getPort() : this.config.ssl.port\n configMessage = `to use self-signed certs and httpsLocalHost`\n\n this.__ssl = async () => {\n const httpsLocalhost = require('https-localhost')()\n const certs = await httpsLocalhost.getCerts()\n this.config.ssl.opts = {\n certAndKey: certs,\n }\n\n this.log.status(`configuring SSL for localhost`, certs)\n\n return https.createServer(certs, this.app)\n }\n break\n\n case 'greenlock':\n const configDir = path.join(this.config.folders.configFolder, 'greenlock.d')\n if (!fs.existsSync(configDir)) {\n mkdirp.sync(configDir)\n const configFile = path.join(configDir, 'config.json')\n this.log.status(\n `creating greenlock.d config folder and autopopulating ssl config`,\n { sites: this.config.ssl, configFile },\n )\n\n fs.writeFileSync(configFile, JSON.stringify(this.config.ssl))\n }\n\n this.__ssl = () => {\n const greenlock = require('greenlock-express')\n const serverOpts = {\n packageRoot: this.config.folders.appFolder,\n configDir,\n\n // Staging for testing environments\n staging: this.config.debug,\n\n // contact for security and critical bug notices\n maintainerEmail: this.config.author.email,\n\n // whether or not to run at cloudscale\n cluster: false,\n\n // for an RFC 8555 / RFC 7231 ACME client user agent\n packageAgent: `${this.config.name}/${this.config.version}`,\n }\n\n this.config.ssl.opts = serverOpts\n greenlock.init(serverOpts).serve(this.app)\n\n this.log.status(\n `configuring SSL using certificate strategy [${this.config.ssl.strategy}]`,\n serverOpts,\n )\n\n return false\n }\n break\n\n case 'letsencrypt':\n const certDir = '/etc/letsencrypt/live'\n if (fs.existsSync(certDir)) {\n const certDirectoryFiles = fs.readdirSync(certDir)\n const certficates = []\n\n certDirectoryFiles.forEach((domain) => {\n const domainPath = path.join(certDir, domain)\n const isDirectory = fs.lstatSync(domainPath).isDirectory()\n\n if (isDirectory) {\n certficates[domain] = {}\n\n certficates[domain].key = fs.readFileSync(\n path.join(certDir, domain, 'privkey.pem'),\n )\n certficates[domain].cert = fs.readFileSync(\n path.join(certDir, domain, 'fullchain.pem'),\n )\n }\n })\n\n /// TODO: Change this to use as many certs for as many servers as needed\n serverOpts = {\n /// TODO: change this from using the passphrase to domain\n cert: certficates[this.config.ssl.passphrase].cert,\n key: certficates[this.config.ssl.passphrase].key,\n }\n }\n\n this.__ssl = () => {\n this.log.status(\n `configuring SSL using certificate strategy [${this.config.ssl.strategy}]`,\n serverOpts,\n )\n return https.createServer(serverOpts, this.app)\n }\n break\n\n case 'file':\n serverOpts = {\n cert: fs.readFileSync(this.config.ssl.certificateFilename, 'utf-8'),\n key: fs.readFileSync(this.config.ssl.certificateKeyFilename, 'utf-8'),\n // ca: fs.readFileSync(this.config.ssl.certificateAuthorityFilename, 'utf-8'),\n passphrase: this.config.ssl.passphrase,\n }\n\n this.__ssl = () => {\n this.log.status(\n `configuring SSL using certificate strategy [${this.config.ssl.strategy}]`,\n serverOpts,\n )\n return https.createServer(serverOpts, this.app)\n }\n break\n }\n\n this.config.ssl.opts = serverOpts\n\n this.config.protocol = 'https'\n this.app.enable('trust proxy')\n this.app.use(enforceSSL({ port: this.config.ssl.port }))\n\n this.log.info(\n `🔐 ssl has been configured with ${this.config.ssl.strategy} ${configMessage}`,\n this.config.ssl,\n )\n }\n}", "handleGet(req, res) {\n let mode = req.query['hub.mode'];\n let token = req.query['hub.verify_token'];\n let challenge = req.query['hub.challenge'];\n\n if (mode && token) {\n if (mode === 'subscribe' && token === this.verifyToken) {\n console.log('WEBHOOK_VERIFIED');\n res.status(200).send(challenge);\n\n } else {\n res.sendStatus(403);\n }\n } else {\n res.sendStatus(404);\n }\n }", "function rewriteHost(requestSpec, context, ee, next) {\n // We must set Host to this to avoid being redirected\n requestSpec.headers.host = 'www.yourmagentostore.com';\n // But we want to make requests directly to the Apache instance to go around\n // Clouflare\n requestSpec.uri = requestSpec.uri.replace(/(www\\.)?yourmagentostore\\.com/, '000.000.000.00');\n // And we need to send the cookie - request won't do it for us because domains won't match\n var cookie = requestSpec.jar.getCookieString('http://yourmagentostore.com/');\n requestSpec.headers.cookie = cookie;\n context._jar = request.jar();\n requestSpec.jar = context._jar;\n return next(null);\n}", "function get(url, middleware) {\n\t\t\t\tapp.gets[url] = middleware\n\t\t\t}", "async function startWebServer () {\n const shutdownOptions = {\n logger: console,\n forceTimeout: 30000\n }\n\n if (sslEnabled) {\n secureCtx = await createSecureContext()\n // create with `secureCtx` so we can renew certs without restarting the server\n const httpsServer = https.createServer(\n {\n SNICallback: (_, cb) => cb(null, secureCtx)\n },\n app\n )\n // update secureCtx to reassign the new cert files\n app.use(\n '/reload-certs',\n async () => (secureCtx = await createSecureContext())\n )\n // graceful shutdown prevents new clients from connecting & waits for to diconnect\n app.use(graceful(httpsServer, shutdownOptions))\n // websocket uses same fd\n attachWebSocket(httpsServer)\n // callback gets public facing ip\n httpsServer.listen(sslPort, checkPublicIpAddress)\n }\n\n const httpServer = http.createServer(app)\n app.use(graceful(httpServer, shutdownOptions))\n\n if (sslEnabled) {\n // set up a route to redirect http to https\n httpServer.get('*', function (req, res) {\n res.redirect('https://' + req.headers.host + req.url)\n })\n } else {\n attachWebSocket(httpServer)\n }\n httpServer.listen(port, checkPublicIpAddress)\n}", "function wwwRedirect(req, res, next) {\n if (req.headers.host.slice(0, 4) === 'www.') {\n var newHost = req.headers.host.slice(4);\n return res.redirect(301, req.protocol + '://' + newHost + req.originalUrl);\n }\n next();\n}", "function start_server(){\n let options = {}\n\n if (config.https.enabled) {\n options = {\n key: fs.readFileSync(config.https.key_file).toString(),\n cert: fs.readFileSync(config.https.cert_file).toString()\n };\n if (config.https.ca_certs) {\n options.ca = [];\n for (const ca in config.https.ca_certs) {\n options.ca.push(fs.readFileSync(config.https.ca_certs[ca]).toString());\n }\n }\n }\n\n const app = require('../app');\n server = http.createServer(app); \n\n /**\n * Get port from environment and store in Express.\n */\n server.listen(normalize_port(config.port));\n server.on('error', on_error);\n server.on('listening', on_listening);\n\n if (config.https.enabled) {\n const serverSecure = https.createServer(options, app);\n\n serverSecure.listen(config.https.port, function() {\n debug('Listening on port ' + serverSecure.address().port);\n });\n }\n}", "function getRequestProtocol(req, isForwarded) {\n if (!isForwarded) return req.connection.encrypted ? 'https' : 'http';\n\n if (req.headers['x-forwarded-ssl'] === 'on') return 'https';\n\n if (req.headers['x-forwarded-scheme']) {\n return req.headers['x-forwarded-scheme'];\n }\n\n if (req.headers['x-forwarded-proto']) {\n return req.headers['x-forwarded-proto'].split(/\\s*,\\s*/)[0];\n }\n\n return req.connection.encrypted ? 'https' : 'http';\n}", "function remoteDevtoolsSecurityHeadersMiddleware(req, res, next) {\n // Block any cross origin request.\n if (typeof req.headers.origin === 'string' && !req.headers.origin.match(/^https?:\\/\\/localhost:/) && !req.headers.origin.match(/^https:\\/\\/chrome-devtools-frontend\\.appspot\\.com/)) {\n next(new Error(`Unauthorized request from ${req.headers.origin}. ` + 'This may happen because of a conflicting browser extension to intercept HTTP requests. ' + 'Please try again without browser extensions or using incognito mode.'));\n return;\n }\n\n // Block MIME-type sniffing.\n res.setHeader('X-Content-Type-Options', 'nosniff');\n next();\n}", "function makeSecure(url) {\r\n return url.substring(0, 4) + \"s\" + url.substring(4);\r\n }", "serve() {\n // a no-op, these are absolute URLs\n return function(req, res, next) {\n next();\n };\n }", "function onLoad() {\n // This cookie is a first-party cookie. The third-party cookie will be set\n // via the header of the HTTPS response.\n var cookieString = \"coooookie=tasty\";\n document.cookie = cookieString;\n}", "function localMiddleware (req, res, next) {\n // Tell the client what Socket.IO namespace to use,\n // trim the leading slash because the cookie will turn into a %2F\n res.setHeader('uibuilder-namespace', node.ioNamespace)\n res.cookie('uibuilder-namespace', uiblib.trimSlashes(node.ioNamespace), {path: node.url, sameSite: true})\n //res.write( '<script>var uibuilderIOnamespace = ' + node.ioNamespace + '</script>')\n next()\n }", "sendHTTPRequest(options) {\n return new Promise((resolve, reject) => {\n const request = https.request(options, response => {\n let data = '';\n console.log(`Status Code : ${response.statusCode}`)\n if(response.statusCode == 200) {\n response.on('data', (chunk) => {\n data += chunk;\n }).on('end', () => {\n resolve(JSON.parse(data));\n });\n }else\n reject(response);\n });\n request.on('error', error => {\n reject(error);\n });\n request.end();\n });\n }", "async function accept_signed_request(req, res) {\n try {\n let body_len = 0;\n req.originalUrl = req.url;\n const parsed_url = url.parse(req.originalUrl, true);\n req.url = parsed_url.pathname;\n req.query = parsed_url.query;\n const virtual_hosted_bucket = req.headers.host.split('.', 1)[0];\n if ((/[a-zA-Z][a-zA-Z0-9]*/).test(virtual_hosted_bucket)) {\n req.virtual_hosted_bucket = virtual_hosted_bucket;\n }\n res.setHeader('Connection', 'close');\n if (req.method === 'OPTIONS') return res.end();\n log(\n 'Handle:', req.method, req.originalUrl,\n 'query', req.query,\n 'headers', req.headers);\n const hasher = crypto.createHash('sha256');\n await new Promise((resolve, reject) => req\n .on('data', data => {\n hasher.update(data);\n body_len += data.length;\n log(`Request body length so far ${body_len}`);\n })\n .once('end', resolve)\n .once('error', reject)\n );\n const sha256_buf = hasher.digest();\n log(`Request body ended body length ${body_len} sha256 ${sha256_buf.toString('hex')}`);\n const UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD';\n const STREAMING_PAYLOAD = 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD';\n const content_sha256_hdr = req.headers['x-amz-content-sha256'];\n req.content_sha256_sig = req.query['X-Amz-Signature'] ?\n UNSIGNED_PAYLOAD :\n content_sha256_hdr;\n if (typeof content_sha256_hdr === 'string' &&\n content_sha256_hdr !== UNSIGNED_PAYLOAD &&\n content_sha256_hdr !== STREAMING_PAYLOAD) {\n req.content_sha256_buf = Buffer.from(content_sha256_hdr, 'hex');\n if (req.content_sha256_buf.length !== 32) {\n throw new Error('InvalidDigest');\n }\n }\n if (req.content_sha256_buf) {\n if (Buffer.compare(req.content_sha256_buf, sha256_buf)) {\n throw new Error('XAmzContentSHA256Mismatch');\n }\n } else {\n req.content_sha256_buf = sha256_buf;\n if (!req.content_sha256_sig) req.content_sha256_sig = req.content_sha256_buf.toString('hex');\n }\n const auth_token = signature_utils.make_auth_token_from_request(req);\n const signature = signature_utils.get_signature_from_auth_token(auth_token, SECRETS[auth_token.access_key]);\n log('auth_token', auth_token, 'signature', signature);\n if (signature !== auth_token.signature) {\n throw new Error('Signature mismatch');\n }\n res.end(JSON.stringify(auth_token));\n\n } catch (err) {\n console.error('SIGNATURE ERROR', err.stack);\n res.statusCode = 500;\n res.end();\n }\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "intercept(req, next) {\n if (req.method === 'JSONP') {\n return this.jsonp.handle(req);\n }\n // Fall through for normal HTTP requests.\n return next.handle(req);\n }", "function proxyMiddleware(req, res, next) {\n /*\n * This test is the switch of each request to determine if the request is\n * for a static file to be handled by BrowserSync or a backend request to proxy.\n *\n * The existing test is a standard check on the files extensions but it may fail\n * for your needs. If you can, you could also check on a context in the url which\n * may be more reliable but can't be generic.\n */\n if (/\\.(html|css|js|png|jpg|jpeg|gif|ico|xml|rss|txt|eot|svg|ttf|woff|cur)(\\?((r|v|rel|rev)=[\\-\\.\\w]*)?)?$/.test(req.url)) {\n next();\n } else {\n proxy.web(req, res);\n }\n }", "function setupMiddleware (linkResolver) {\n app.route('*').get((req, res, next) => {\n Prismic.api(config.apiEndpoint, config.accessToken)\n .then((api) => {\n req.prismic = { api: api };\n res.locals.ctx = {\n endpoint: config.apiEndpoint,\n linkResolver: linkResolver\n };\n next();\n })\n .catch((err) => {\n if (handleError) {\n handleError(err, req, res);\n } else {\n next(err);\n }\n });\n });\n }", "function my_middleware(req, res, next){\n\tconsole.log('Hello Middleware');\n\tnext();\n}", "function createMITMHttpsServer(hostUrl, port, callback) {\n console.log('create local https server on port: ' + port + ' to host ' + hostUrl);\n\n signHost(hostFromUrl(hostUrl), function(err, result) {\n if (err) {\n console.log('error create cert: ' + err);\n if (callback) {\n callback(err);\n }\n } else {\n var httpsOptions = {\n key: result.clientKey,\n cert: result.certificate,\n };\n\n // create the mitm server with certs signed by ourself\n https.createServer(httpsOptions, function (req, res) {\n uri = url.parse(req.url);\n console.log(\"got uri path: \" + uri.path);\n console.log(\"got method: \" + req.method);\n console.log(\"got header: \" + util.inspect(req.headers));\n\n var target = \"https://\" + req.headers.host + uri.path;\n console.log(\"forward target: \" + target);\n\n if (pendingActions.length > 0) {\n processPendingActions(req, res, target);\n\n } else {\n setupProxyToTarget(req, res, target); \n }\n }).listen(port);\n\n if (callback) {\n callback();\n }\n }\n });\n}", "async function runHttpsServer()\n{\n\tlogger.info('running an HTTPS server...');\n\n\t// HTTPS server for the protoo WebSocket server.\n\tconst tls =\n\t{\n\t\tcert : fs.readFileSync(config.https.tls.cert),\n\t\tkey : fs.readFileSync(config.https.tls.key)\n\t};\n\n\thttpsServer = https.createServer(tls, expressApp);\n\n\tawait new Promise((resolve) =>\n\t{\n\t\thttpsServer.listen(\n\t\t\tNumber(config.https.listenPort), config.https.listenIp, resolve);\n\t});\n}", "function onResponse(ctx, callback)\n{\n const resp_headers = ctx.serverToProxyResponse.headers;\n const req_headers = ctx.clientToProxyRequest.headers;\n\n // !!!! todo: for now we remove the csp header\n // delete resp_headers['content-security-policy'];\n\n /* The Expect-CT header allows sites to opt in to reporting\n * and/or enforcement of Certificate Transparency\n * requirements, which prevents the use of misissued\n * certificates for that site from going unnoticed.\n */\n delete resp_headers['expect-ct'];\n\n\n // note: headers converted to lowercase by nodejs\n const is_html = 'content-type' in resp_headers &&\n resp_headers['content-type'].startsWith('text/html');\n const is_xhr = ('x-requested-with' in req_headers);\n const is_cors = ('origin' in req_headers);\n\n ctx.must_inject = (ENABLE_INJECTION && is_html && !ctx.no_inject &&\n !is_xhr && !is_cors);\n\n\n if (ctx.must_inject)\n {\n delete resp_headers['content-length'];\n const csp = resp_headers['content-security-policy'];\n const default_csp = csp;\n\n delete resp_headers['etag'];\n delete resp_headers['last-modified'];\n\n if (csp){\n const policy = new Policy(csp);\n const script_src = policy.get('script-src');\n const frm_src = policy.get('frame-src');\n const default_src = policy.get('default-src');\n\n // inject script as inline content\n if (SHARED_STORE_IFRAME_URL.length){\n const ifr_url = new URL(SHARED_STORE_IFRAME_URL);\n\n if (!frm_src && default_src){\n policy.set('frame-src', default_src);\n }\n policy.add('frame-src', ifr_url.origin);\n }\n\n let script_inject_data;\n if (INJECTION_METHOD === 'url'){\n const url = new URL(INJECTED_SCRIPT_URL);\n script_inject_data = url.origin;\n }else{\n //\n const sha256 = getInjectedHash();\n script_inject_data = \"'\"+sha256+\"'\";\n }\n\n\n if (!script_src && default_src){\n policy.set('script-src', default_src);\n }\n policy.add('script-src', script_inject_data);\n\n let modified_csp = policy.toString();\n console.log(\"\\n\\n### orig csp: %s\", default_csp);\n console.log(\"### modified csp: %s\", modified_csp);\n resp_headers['content-security-policy'] = modified_csp;\n }//end if csp\n }// end if must_inject\n return callback();\n}", "_initFallbackListener() {\n\n this.server.get('*', (req, res) => {\n\n this._htpasswdMiddleware(req, res);\n\n // Serve the service-worker\n\n if (req.url === '/service-worker.js') {\n this.nextApp.serveStatic(req, res, paths.appStatic + req.url);\n\n // If no language has been defined in the request, we should try to find a route that matches the request.\n // If a route has been founded, we must trigger a redirection to add the language segment to the url.\n // For example, /products should probably be resolved to /en/products.\n\n } else {\n return this.nextApp.getRequestHandler()(req, res);\n }\n });\n }", "function checkKeyMiddleware( req, res, next ) {\n console.log(\"Received Method:\", req.method);\n console.log(\"Received Path:\", req.path);\n console.log(\"Received Params:\", req.params);\n console.log(\"Received Body:\", req.body);\n console.log(\"Received Query:\", req.query);\n // console.log(\"Checking for key: \", req.query.key);\n // if( req.query.key ) {\n // next();\n // } else {\n // console.log(\"You are blocked\");\n // // TODO: create session key for secure requests and block invalid requests here\n // // res.send(\"You are blocked\");\n // next();\n // };\n next();\n }", "function _getVerifyMiddleware () {\n // Fetch the JWKS data used to verify the signature of incoming JWT tokens\n const pemsDownloadProm = _init()\n .catch((err) => {\n // Failed to get the JWKS data - all subsequent auth requests will fail\n console.error(err)\n return { err }\n })\n return function (req, res, next) {\n _verifyMiddleWare(pemsDownloadProm, req, res, next)\n }\n}", "serve() {\n return function (req, res, next) {\n next();\n };\n }", "function isSecureEnvironment(req) {\n if (!req || !req.headers || !req.headers.host) {\n throw new Error('The \"host\" request header is not available');\n }\n if (process.env.NODE_ENV !== 'production') {\n return false;\n }\n const host = (req.headers.host.indexOf(':') > -1 && req.headers.host.split(':')[0]) || req.headers.host;\n if (['localhost', '127.0.0.1'].indexOf(host) > -1) {\n return false;\n }\n return true;\n}", "function podPress_https_check(url) {\r\n\t\tvar siteurl_without_protocol = podPressBlogURL.match(/^https?:\\/\\//i, url);\r\n\t\tvar url_without_protocol = podPressBlogURL.replace(siteurl_without_protocol, '');\r\n\t\tvar siteurl_regexp = new RegExp( url_without_protocol, 'i' );\r\n\t\tif ( -1 != url.search(siteurl_regexp) ) {\r\n\t\t\treturn url.replace(/^http:/i, window.location.protocol);\r\n\t\t} else {\r\n\t\t\treturn url;\r\n\t \t}\r\n\t}", "function middle(req, res, next)\n{\n console.log(`Incoming request: ${request.original}`)\n\n\n next();//always at end of middleware function\n}", "function startAppServer() {\n\t\n\tif (!config.SERVER_BEHIND_REVERSE_PROXY) {\n\t\t\n\t\tif (config.SERVER_PORT != config.SERVER_PORT_PUBLIC) {\n\t\t\t\n\t\t\tvar redirectApp = express();\n\t\t\tredirectApp.use(function (req, res) { // we don't need to call next()\n\t\t\t\tres.redirect(301, config.SERVER_URL_PUBLIC + req.path);\n\t\t\t});\n\t\t\thttp.createServer(redirectApp).listen(config.SERVER_PORT);\n\t\t}\n\t\t\n\t\tvar fs = require('fs');\n\t\t\n\t\tvar options = {\n\t\t\tca: config.SERVER_CA && util.transform_(config.SERVER_CA.split(','), fs.readFileSync),\n\t\t\tkey: fs.readFileSync(config.SERVER_KEY),\n\t\t\tcert: fs.readFileSync(config.SERVER_CERT),\n\t\t\tpassphrase: config.SERVER_PASSPHRASE || undefined\n\t\t};\n\t\tvar appServer = require('https').createServer(options, app);\n\t\tappServer.listen(config.SERVER_PORT_PUBLIC);\n\t\treturn appServer;\n\t}\n\telse {\n\t\t\n\t\tvar appServer = http.createServer(app);\n\t\tappServer.listen(config.SERVER_PORT);\n\t\treturn appServer;\n\t}\n}", "function splitHTTPS(url){\n return url.split('https://')[1];\n}", "serve() {\n\t // a no-op, these are absolute URLs\n\t return function (req, res, next) {\n\t next();\n\t };\n\t}", "function isAuthenticated(req, res, next) {\n\n\n if (isProduction) {\n if (!req.isAuthenticated()) {\n res.status(403).send(\"Not authorized\");\n }\n } else {\n console.log(\"-- not production mode -- NO SECURITY!!!!!\");\n }\n return next();\n\n}", "async function keepAlive (req,h) {\n let SASLogon = `${process.env.VIYA_SERVER}/SASLogon/`;\n return h.response().redirect(SASLogon).code(302);\n}", "static MIDDLEWARE () {\n return []\n }", "constructor() {\n this.state = \"secure\"\n this.securityState = Ci.nsIWebProgressListener.STATE_IS_SECURE\n this.errorCode = Cr.NS_OK\n this.shortSecurityDescription = \"Content Addressed\"\n this.SSLStatus = {\n cipherSuite: \"TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256\",\n // TLS_VERSION_1_2\n protocolVersion: 3,\n isDomainMismatch: false,\n isNotValidAtThisTime: true,\n serverCert: {\n subjectName: \"Content Addressing\",\n displayName: \"Content Addressing\",\n certType: Ci.nsIX509Cert.CA_CERT,\n isSelfSigned: true,\n validity: {}\n }\n }\n }", "function getapi(){\n\tif (window.location.protocol != \"https:\"){\n\t\treturn \"http://wev.se/etc/api\";\n\t} else{\n\t\treturn \"https://wev.se/etc/api\";\n\t}\n}" ]
[ "0.79086655", "0.75939727", "0.7393396", "0.73186237", "0.7176339", "0.6907513", "0.6646805", "0.6548563", "0.64782864", "0.64768726", "0.64257205", "0.6335271", "0.6189638", "0.6168532", "0.6163034", "0.6147502", "0.61321795", "0.60296875", "0.60231704", "0.598694", "0.5957439", "0.58956355", "0.587666", "0.5846057", "0.5831476", "0.5808597", "0.57953566", "0.57734954", "0.57622325", "0.5727533", "0.5722543", "0.5687453", "0.5687453", "0.5687453", "0.5687453", "0.5687453", "0.5600157", "0.55966854", "0.5585415", "0.55480725", "0.55480725", "0.54725444", "0.5434847", "0.5432432", "0.5432432", "0.5421688", "0.5407954", "0.5316553", "0.5313503", "0.5305281", "0.5287113", "0.5268209", "0.5242112", "0.51953405", "0.5193984", "0.5171394", "0.51635855", "0.5156764", "0.5150651", "0.51476574", "0.5147474", "0.5132459", "0.51318926", "0.5128326", "0.5125753", "0.5109446", "0.5103171", "0.5099811", "0.5069037", "0.5056671", "0.50564706", "0.50350386", "0.5024401", "0.50152445", "0.50146776", "0.5011305", "0.5011305", "0.5011305", "0.5011305", "0.5011305", "0.5009017", "0.49964306", "0.4991125", "0.4984627", "0.49743962", "0.49652407", "0.4955485", "0.4947624", "0.49440983", "0.49385715", "0.49352133", "0.49313495", "0.49308112", "0.49077374", "0.49073985", "0.49038526", "0.49032715", "0.4900937", "0.49005106", "0.4893037", "0.48866013" ]
0.0
-1
As a user I want to participate into a colormez by clicking on participate button I can go to colorme view
participate(useruid, colormezid) { this.$state.go('colorme', { useruid: useruid, colormezid: colormezid }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function joined(e) {\n userId = e.id;\n $('#controls').show();\n startPrompts();\n}", "getResult(userId, colormezId) {\n this.$state.go('outro');\n }", "function reply() {\r\n var fromWhere = JSON.parse(localStorage.getItem(\"emailToView\")).fromWhere;\r\n if (fromWhere == FROM_ADMIN_INBOX) {\r\n linkAdminCompose(fromWhere);\r\n } else if (fromWhere == FROM_STUDENT_INBOX) {\r\n linkStudentCompose(fromWhere);\r\n }\r\n}", "async function clickedChat(l) {\n // //console.log(\"userToken\", String(userToken).length);\n \n // var userToken = await AsyncStorage.getItem('userToken');\n // if(token!=null){\n\n // navigation.navigate(\"ChatSpecificScreenFinal\", {\n // name: l.uservisibility.name,\n // profilePic: l.uservisibility.profilePic,\n // jid: l.jid_main,\n // });\n // // return (<LoginToAccessScreen></LoginToAccessScreen>)\n // } else {\n // Login.current.open();\n // }\n if (token!=null) {\n var found =false;\n chat_roster_main.forEach(list=>{\n //console.log('sdsdsd',list.jid,l.jid)\n if(list.jid == l.jid){\n found = true;\n }\n })\n\n if(found){\n navigation.navigate(\"ChatSpecificScreen\", {\n // name: l.uservisibility.name.substr(0, 15),\n // profilePic: l.uservisibility.profilePic,\n // jid: l.jid_main,\n\n name: l.uservisibility.name.substr(0, 15),\n profilePic: l.uservisibility.profilePic,\n jid: l.jid,\n xmpp: null,\n messages: [],\n media: []\n });\n }else{\n alert('Sorry')\n }\n \n // return (<LoginToAccessScreen></LoginToAccessScreen>)\n } else {\n Login.current.open();\n }\n }", "function navProfile() {\n var cUser = null;\n socket.emit('isMe', token,cUser , function(res){\n window.location = \"/user/\"+res[1];\n });\n}", "function goToChat() {\n origin;\n jQuery(\".chat_banner\").hide();\n jQuery(\".banner-modal-box\").slideDown();\n jQuery(\"#history_div\").mCustomScrollbar({\n theme: \"dark-thick\",\n });\n document.getElementById('input_area').focus();\n chat();\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 appear_connected(){\n var conectados = document.createElement(\"div\");\n conectados.innerHTML = \"<div class='user'>\" +\n \"<div class='avatar mycon'><img src='\" + avatarPath + \"''></div>\" +\n \"<p class='userme mycon'>\" + guestname + \"</p>\" +\n \"</div>\";\n var people = document.querySelector(\"#pp\"); // cogemos el sitio donde iran los conectados\n people.appendChild(conectados);\n\n // EL PRIMERO QUE SE CONECTE NO NECESITA \n // NINGUN TIPO DE HANDSHAKING\n setCamera(myList[0]);\n myList[0].active = true;\n}", "function onConnectionSuccess(){\n\t\t\tconsole.log(\"onConnectionSuccess getting my display Name ::: \" + _roomCredentials.name);\n\t\t\t\n\t\t _room = _connection.initJitsiConference(_roomCredentials.name, _roomConfOptions);\n\t\t \n\t\t _room.on(JitsiMeetJS.events.conference.TRACK_ADDED, onRemoteTrack);\n\t\t _room.on(JitsiMeetJS.events.conference.TRACK_REMOVED, function (track) {\n\t\t console.log(\"track removed!!!\" + track);\n\t\t });\n\t\t _room.on(JitsiMeetJS.events.conference.CONFERENCE_JOINED, onConferenceJoined);\n\t\t _room.on(JitsiMeetJS.events.conference.CONFERENCE_FAILED, onConferenceFailed);\n\t\t _room.on(JitsiMeetJS.events.conference.KICKED, onUserKicked);\n\t\t \n\t\t //room.on(JitsiMeetJS.events.conference.USER_JOINED, function(id){ console.log(\"user join\");remoteTracks[id] = [];});\n\t\t _room.on(JitsiMeetJS.events.conference.USER_JOINED, onUserJoined);\n\t\t \n\t\t _room.on(JitsiMeetJS.events.conference.USER_LEFT, onUserLeft);\n\n _room.addCommandListener(CONFERENCE_BROADCAST.MEETING_ENDED,function (values) {\n // onUserKicked();\n\t\t\t\t$rootScope.$broadcast(MEETING_CUSTOM_COMMANDS.CUSTOM_END,values.attributes)\n });\n\n // room.addCommandListener(MEETING_CUSTOM_COMMANDS.MEMBER_REMOVED,function (values) {\n //\n // });\n\n\t\t /* room.on(JitsiMeetJS.events.conference.USER_ROLE_CHANGED, function (id ,role){\n\t\t \t console.log(\"USER_ROLE_CHANGED :: \"+id + \" - \" + role);\n\t\t \t userRole = role;\n\t\t \t console.log(\"USER_ROLE_CHANGED :: userRole ==== \"+userRole);\n\t\t \t var userDisplayName =\"Name : \" + id + \", Role : \" + userRole + \", Id : \" + id;\n\t\t \t var userRemoveRoleName =\"Name : \" + id + \", Role : \" + participantString + \", Id : \" + id;\n\t\t \t \n\t\t \t var index = participentsList.indexOf(userRemoveRoleName);\n\t\t \t if (index > -1) {\n\t\t \t \tparticipentsList.splice(index, 1);\n\t\t \t }\n\t\t \t setParticipentsList(participentsList);\n\t\t \t participentsList.push(userDisplayName);\n\t\t \t if(id === localId){\n\t\t \t\t isModerator = true;\n\t\t \t\t console.log(\"I'm moderator, locking room with password\" + password);\n\t\t \t\t room.lock(password);\n\t\t \t }\n\t\t \t \n\t\t \t getUserList();\n\t\t });\n\t\t \n\t\t \n\t\t */\n\t\t JitsiMeetJS.mediaDevices.addEventListener(JitsiMeetJS.events.mediaDevices.PERMISSION_PROMPT_IS_SHOWN, function(environmentType ){\n\t\t \t//environmentTypes : 'chrome'|'opera'|'firefox'|'iexplorer'|'safari'|'nwjs'|'react-native'|'android'\n\t\t\t\t // alert(\"Enable browser permission to access audio devices for \" + environmentType +\"browser.\" );\n\t\t\t });\n\t\t \n\t\t console.info('Room Joined ');\n\t\t \n\t\t // var password = \"sagar\";\n\t\t _room.setDisplayName(_roomCredentials.displayName);\n\t\t \n\t\t if (! _connectorRole.MODERATOR) {\n\t\t\t console.log(\"not moderator\");\n\t\t\t _room.join(_roomCredentials.password);\n\t\t } else {\n\t\t \tconsole.log(\" moderator\");\n\t\t \t_room.join();\n\t\t \t_room.lock(_roomCredentials.password);\n\t\t }\n\t\t \n\t\t _room.addCommandListener(\"AddedNewParticipant\", function(values){\n\t\t\t console.log(\"========= New participant is added to the conference =============\");\n\t\t });\n\t\t \n\t\t JitsiMeetJS.createLocalTracks({devices: [\"audio\"]}, true).\n\t\t then(onLocalTracks).catch(function (error) {\n\t\t \t console.log(\"connect localtrack erroe=r ::;\");\n\t\t throw error;\n\t\t });\n\t\t \n\t\t _room.addCommandListener(MEETING_CUSTOM_COMMANDS.NEW_MEMBER_ADDED, function (values) {\n\t\t\t console.log(\"MEETING_CUSTOM_COMMANDS.NEW_MEMBER_ADDED ::: \"+angular.toJson(values));\n\t\t\t\t$rootScope.$broadcast(MEETING_CUSTOM_COMMANDS.NEW_MEMBER_ADDED, {userDetails : values,\n\t\t\t});\n\t\t });\n\t\t \n\t\t _room.addCommandListener(MEETING_CUSTOM_COMMANDS.MEMBER_REMOVED, function (values) {\n\t\t\t console.log(\"MEETING_CUSTOM_COMMANDS.MEMBER_REMOVED ::: \"+angular.toJson(values));\n\t\t\t\t$rootScope.$broadcast(MEETING_CUSTOM_COMMANDS.MEMBER_REMOVED, {userDetails : values,\n\t\t\t});\n\t\t });\n\t\t \n\t\t _room.addCommandListener(MEETING_CUSTOM_COMMANDS.MEETING_EXTENDED, function (values) {\n\t\t\t console.log(\"MEETING_CUSTOM_COMMANDS.MEETING_EXTENDED ::: \"+angular.toJson(values));\n\t\t\t\t$rootScope.$broadcast(MEETING_CUSTOM_COMMANDS.MEETING_EXTENDED, values.attributes);\n\t\t });\n\t\t \n\t\t \n\t\t \n\t\t}", "function setJoinCallBtn() {\n joinCallBtn.addEventListener(\"click\", async (e) => {\n window.location.href='/join/' + roomId;\n });\n}", "async connect() {\n Channel.botMessage('Welcome to Routefusion Chat!\\n\\n');\n this.user = await this.setUser();\n this.greetUser();\n }", "function showPersonalChat(event)\n{\n var spot = $(event.currentTarget).parent();\n showPersonalChatWithSpot(spot.get(0));\n $(\"#msgBoard > input.chatTo\", spot).focus();\n}", "function connect() {\n\n\n var username = document.getElementById(\"userNameField\").value;\n var password = document.getElementById(\"passwordField\").value;\n if (username) {\n easyrtc.setUsername(username);\n }\n if (password) {\n easyrtc.setCredential({password: password});\n }\n\n\n connectToRoom(room);\n easyrtc.setPeerListener(dispatchIncomingData);// set callback function on reception of message\n easyrtc.setRoomOccupantListener(generateRoomOccupants);\n\n\n if (room === \"default\" && firstConnect === true) {\n easyrtc.connect(\"multichat\", loginSuccess, loginFailure);\n firstConnect = false;\n }\n //console.log(easyrtc.username);\n\n //pouchDB\n updateRoomListIndex();\n connectToDb(room);\n //vis.js\n generateGraph(room);\n\n const $sendStuff = $(\"#sendStuff\");\n $sendStuff.on(\"click\", sendMessage);// FIXME some things can be moved outside this function to avoid being called several times unnecessarily\n $sendStuff.html(\"Send to room: \" + room);\n\n //experimental stuff :\n if (experimental) {\n showRooms();\n }\n}", "function reply() {\r\n try {\r\n var fromWhere = JSON.parse(localStorage.getItem(\"emailToView\")).fromWhere;\r\n if (fromWhere == FROM_ADMIN_INBOX) {\r\n linkAdminCompose(fromWhere);\r\n } else if (fromWhere == FROM_STUDENT_INBOX) {\r\n linkStudentCompose(fromWhere);\r\n }\r\n } catch(e) {\r\n alert(e.name + \"\\n\" + e.message);\r\n }\r\n}", "function aboutmeClick(){\r\n\t\tcallAjax(createAboutme, \"aboutme\", \"get\");\r\n\t}", "function inviteToChat() {\n if (selectedContactRegIds.length > 0) {\n messenger.chatInvite(selectedChatId, selectedContactRegIds).then(function () {\n console.log(\"inviteToChat: done for \" + selectedContactRegIds);\n });\n }\n\n //Switch back to the chat tab\n showTab(\"chat\");\n}", "render() {\n const currentUser = JSON.parse(sessionStorage.getItem(\"credentials\"))\n if (parseInt(this.props.user.userId) === currentUser.id) {\n return <></>\n } else {\n if (this.props.user.vetoad === true && this.props.user.canSuggestEvent === false) {\n return (\n <Card className='participantCard'>\n <Card.Content className='participantCard'>\n <li>\n <div className='participantButtonContainer'>\n <p className='addEventUserName'>{this.props.user.name}</p>\n <div className='addEventButtonContainer'>\n <Button className='addEventButtons' color='green' onClick={() => this.props.updateVetoad(this.props.user.userId)}>Vetoad</Button>\n <Button className='addEventButtons' onClick={() => this.props.updateCanSuggestEvent(this.props.user.userId)}>Make Contributor</Button>\n <Button className='addEventButtons' icon='trash alternate outline' onClick={() => this.props.removeParticipant(this.props.user.userId)}></Button>\n </div>\n </div>\n </li>\n </Card.Content>\n </Card>\n )\n } else if (this.props.user.canSuggestEvent === true && this.props.user.vetoad === false) {\n return (\n <Card className='participantCard'>\n <Card.Content className='participantCard'>\n <li>\n <div className='participantButtonContainer'>\n <p className='addEventUserName'>{this.props.user.name}</p>\n <div className='addEventButtonContainer'>\n <Button className='addEventButtons' onClick={() => this.props.updateVetoad(this.props.user.userId)}>Vetoad</Button>\n <Button className='addEventButtons' color='green' onClick={() => this.props.updateCanSuggestEvent(this.props.user.userId)}>Make Contributor</Button>\n <Button className='addEventButtons' icon='trash alternate outline' onClick={() => this.props.removeParticipant(this.props.user.userId)}></Button>\n </div>\n </div>\n </li>\n </Card.Content>\n </Card>\n )\n } else if (this.props.user.canSuggestEvent === true && this.props.user.vetoad === true) {\n return (\n <Card className='participantCard'>\n <Card.Content className='participantCard'>\n <li>\n <div className='participantButtonContainer'>\n <p className='addEventUserName'>{this.props.user.name}</p>\n <div className='addEventButtonContainer'>\n <Button className='addEventButtons' color='green' onClick={() => this.props.updateVetoad(this.props.user.userId)}>Vetoad</Button>\n <Button className='addEventButtons' onClick={() => this.props.updateCanSuggestEvent(this.props.user.userId)} color='green'>Make Contributor</Button>\n <Button className='addEventButtons' icon='trash alternate outline' onClick={() => this.props.removeParticipant(this.props.user.userId)}></Button>\n </div>\n </div>\n </li>\n </Card.Content>\n </Card>\n )\n } else {\n return (\n <Card className='participantCard'>\n <Card.Content className='participantCard'>\n <li>\n <div className='participantButtonContainer'>\n <p className='addEventUserName'>{this.props.user.name}</p>\n <div className='addEventButtonContainer'>\n <Button className='addEventButtons' onClick={() => this.props.updateVetoad(this.props.user.userId)}>Vetoad</Button>\n <Button className='addEventButtons' onClick={() => this.props.updateCanSuggestEvent(this.props.user.userId)}>Make Contributor</Button>\n <Button className='addEventButtons' icon='trash alternate outline' onClick={() => this.props.removeParticipant(this.props.user.userId)}></Button>\n </div>\n </div>\n </li>\n </Card.Content>\n </Card>\n )\n }\n }\n }", "function onClickName() {\n /*\n document.getElementById(\"dark-mode-user-name\").textContent = prompt(\"What do you want your name to be\");\n picture = prompt(\"Link for image\");\n name = document.getElementById(\"dark-mode-user-name\").textContent;\n socket.emit('profile', picture);\n socket.emit('new-user', name);\n */\n var closeModal = document.getElementById('close-modal');\n var okProfile = document.getElementById('ok-profile');\n okProfile.addEventListener('click', profileInputHandle);\n closeModal.addEventListener('click', cancelModal);\n ShowModal();\n \n}", "function userLoggedInListener (roomName, occupants, isPrimary) {\n //update the global occupants list for this user.\n all_occupants_list = occupants;\n\n //as this callback method is also called on any user disconnection...\n //remove any 'zombie' easyrtc id from 'all_occupants_details' variable\n removeZombieClientsFromOccupantsDetails(occupants);\n\n //update the online/offline status as per the new list.\n //this update is important for someone leaves the connection.\n updateOnlineStatusOfClients(all_occupants_details);\n\n //spawn telepointers for the logged in users.\n spawnTelepointers(occupants);\n\n //inform my email, name along with easyrtc id, which is later used for different tracking\n informMyDetailsToAllOtherClients(occupants);\n\n //notifyAll('disconnected', \"Hello\");\n\n\n //FOR VIDEO STRM\n clearConnectList();\n var otherClientDiv = document.getElementById(\"otherClients\");\n for(var easyrtcid in occupants) {\n var button = document.createElement(\"button\");\n button.onclick = function(easyrtcid) {\n return function() {\n performCall(easyrtcid);\n };\n }(easyrtcid);\n var label = document.createTextNode(\"Call \" + getNameForAnEasyRTCid( easyrtc.idToName(easyrtcid) ) );\n button.appendChild(label);\n otherClientDiv.appendChild(button);\n }\n\n\n\n\n\n}", "goToChat(roomId, title, active, trainerPic, opponentId) {\n if (this.props.connectedToSendBird)\n this.props.gotoChatView({\n roomId,\n title,\n active,\n trainerPic,\n opponentId\n });\n }", "joined() {\n this.app.setAlert(<Alert type=\"success\">{i18n('followed')}</Alert>);\n\n this.setState({\n changePending: false,\n });\n\n // Analytics tracking\n Backbone.trigger(\n 'analytics:trackEvent',\n 'Activity',\n 'Followed ' + this.props.followType,\n this.props.trackLabel,\n );\n }", "function switchToConnected() {\n // show and hide the proper navbar sections\n document.getElementById(\"connectedNav\").style.display = \"inherit\";\n document.getElementById(\"notConnectedNav\").style.display = \"none\";\n // display the welcome message\n document.getElementById(\"welcomeUser\").innerHTML = \"Bienvenue <b>\" + getUsername() + \"</b>\";\n // display the list of users\n displayUsersList();\n}", "function loggedInAttend(I,result,source){\n if(result.status == 1){\n userData.visitorId = result.visitor_id ;\n userData.encodeId = result.encode_id ;\n profileUpdate();\n if(source == 'interest'){\n $('.covid-follow').remove();\n }\n if(pageType == 'live' && (source == 'video_comment')){\n user_profile_complete(I,result,'video_comment');\n }\n if(result.isComplete==1)\n gaEvent(\"Goal\",\"Thank You after 2nd screen\");\n if((pageType=='live') && ($(I).hasClass('live-eve-follow') || $(I).hasClass('vid-eve-follow'))){\n if($(I).hasClass('vid-eve-follow')){\n $('#TenTimes-Modal').modal('hide');\n $('.vid-eve-follow').html(\"<i class='fa fa-check fa-fw'></i> Following\").addClass('disabled');\n }\n return true;\n } \n if( pageType == 'profile' || source== 'followVs' || pageType == 'org_detail' || (typeof only_thankyou!=='undefined' && only_thankyou==1)){\n // consentup(10);\n if($(eventData.dis).hasClass(\"action-dir\")) {\n map_open($(\"#event_latitude\").html(),$(\"#event_longude\").html(),1);\n hitMyData();\n return true;\n }\n showThank('event');\n }\n else if(pageType == 'about' && $(I).hasClass('download_brochure')){\n window.open($(I).data('url'));\n download_brochure($('#br_id').val());\n return true;\n }\n else if(pageType == 'dashboard_events'){\n // consentup(10);\n swap_function(I,source);\n } \n else if(source.search(/orgdetails/)>-1){ \n \n \n if($('#modalData').html() == \"\")\n $('#modalData').html(getModal());\n $('#TenTimes-Modal .modal-dialog').removeClass('modal-500');\n $('#TenTimes-Modal .modal-dialog').addClass('modal-740');\n $('#TenTimes-Modal .modal-title').replaceWith(function() { return \"<h3 class='modal-title' id='myModalLabel'\"+\">\" + this.innerHTML + \"</h3>\"; });\n $('#TenTimes-Modal .modal-title').html('');\n var data = {\n pageType:pageType,\n for:'verify_modal',\n orgdetailsSource:orgdetailsSource\n };\n var messageHtml='';\n $.ajax({\n type: \"POST\",\n url: site_url_attend + \"/ajax/modaldata\",\n data:data,\n success: function(n) {\n messageHtml=$.parseJSON(n);\n $('#TenTimes-Modal .modal-title').html(messageHtml.title);\n $('#TenTimes-Modal .modal-title').siblings('h5').remove();\n $('#TenTimes-Modal .modal-body').html('');\n $('#TenTimes-Modal').modal('show');\n if(orgdetailsSource == \"ticket\"){\n var requestfor = \"ticket\";\n }\n else if(orgdetailsSource == \"webinar\"){\n var requestfor = \"webinar\";\n }\n else {\n var requestfor = \"eventContact\"; \n }\n var userResult = result;\n var userResult = result; \n if (typeof $(\"#privateFlag\").val()!='undefined' ){\n var privateFlag=1\n }\n else{\n var privateFlag=0\n }\n \n $.ajax({type: \"GET\", url: site_url_attend + \"/ajax?for=\"+requestfor+\"&eventId=\"+eventData.id+\"&privateFlag=\"+privateFlag,\n success: function(result) {\n var newData= JSON.parse(result);\n if(orgdetailsSource == \"website\" || orgdetailsSource == \"ticket\") {\n if(orgdetailsSource == \"website\"){\n contactWebsite = newData.event_website;\n var websiteIsValid = newData.websiteIsValid;\n }\n else {\n if(newData.status == '1' || newData.status.code == 1) {\n contactWebsite = newData.data;\n var websiteIsValid = newData.isvalid;\n }\n }\n if (websiteIsValid == 1) {\n var websiteTab = window.open();\n if(websiteTab == null) { \n showPopupBlockMessage(contactWebsite , orgdetailsSource);\n }\n else{\n $('#TenTimes-Modal').modal('hide');\n websiteTab.location.href = contactWebsite;\n }\n }\n else {\n showOrgWebsite(orgdetailsSource,userResult);\n }\n }\n if(orgdetailsSource == \"webinar\") {\n var agendaTitles = [];\n var webcastUrls = [];\n var webinarUrl = '';\n for(var i=0; i < newData['data']['agenda'].length ; i++){\n let data = newData[\"data\"][\"agenda\"][i];\n agendaTitles.push(data[\"title\"]);\n if(newData['data']['agenda'][i]['id'] == $(eventData.dis).attr('data-id')){\n webinarUrl = newData['data']['agenda'][i]['attachment']['webcasturl'];\n } else {\n if(nullCheck(data[\"attachment\"])) {\n data = data[\"attachment\"];\n if(nullCheck(data['webcasturl'])) {\n webcastUrls.push(data['webcasturl']);\n }\n }\n }\n }\n webcastUrls.push(webinarUrl);\n showPopupBlockMessage(webcastUrls, orgdetailsSource, agendaTitles);\n }\n if(orgdetailsSource == \"contact\") {\n contactName = newData['contacts'][0]['name'];\n contactEmail = newData['contacts'][0]['email'];\n contactPhone = newData['contacts'][0]['phone'];\n showOrgContact(newData['contacts']);\n }\n }\n });\n },\n error: function(data){\n showToast('Something went wrong!!!');\n }\n });\n \n \n }\n else if(pageType == \"live\"){\n if(source=='bookmark'){\n $(I).removeAttr('onclick');\n $(I).children().removeClass('fa-bookmark-o').addClass('fa-bookmark');\n $(I).children().addClass('text-orange').removeClass('text-muted');\n showThank('event');\n }\n }\n else if(\"ProfileDash\" == pageType)\n dashboardAttendResponse(I, source)\n else if(typeof source != \"undefined\" && getStallFlag(source) == 1){\n if(result.stallAnswer==1)\n redirectTo(result,source);\n else\n openQuestion(source,result);\n }\n else if(pageType == 'listing' || pageType==\"org_detail\" || pageType=='venue_detail' || pageType.search('top100')>-1 || pageType=='homepage'){\n if(source.search(\"follow\") > -1 || source.search(\"bookmark\") > -1 || source.search(\"interest\") > -1){\n if(pageType=='venue_detail' || pageType=='homepage' || pageType == 'org_detail')\n hitMyData();\n\n show_thankyou == true ? showThank('event') : postActionResponse();\n }\n else{ \n redirectTo(result,source);\n }\n }\n else if (pageType=='group' && source=='going'){\n hitMyData();\n showThank('event');\n }\n else if (pageType=='thankyou_new' || pageType=='register_new' || pageType=='login_new')\n updateActionButtonsThankyou(source,I);\n else if (pageType=='udash_recommendation')\n {\n updateActionButton(source,I); \n showThank('event'); \n }\n else{\n if($(I).hasClass(\"stopRedirection\"))\n {\n if(pageType == \"about\"){\n if(source=='interest'){\n $(I).html('<i class=\"fa fa-check text-orange\" aria-hidden=\"true\"></i> Interested').removeAttr( \"onClick\" );\n $(I).css(\"pointer-events\",\"none\");\n $(I).addClass(\"text-orange\");\n $(I).parent().siblings().find(\".orgEventbm\")\n $(I).parent().siblings().find(\".orgEventbm\").removeAttr('onclick');\n $(I).parent().siblings().find(\".orgEventbm\").children().removeClass('fa-bookmark-o').addClass('fa-bookmark');\n $(I).parent().siblings().find(\".orgEventbm\").children().addClass('text-orange');\n showThank('event');\n }\n else if(source == 'bookmark'){\n $(I).removeAttr('onclick');\n $(I).children().removeClass('fa-bookmark-o').addClass('fa-bookmark');\n $(I).children().addClass('text-orange');\n showThank('event');\n }\n }\n if((pageType == \"speakers\" || pageType == \"visitors\") && source == \"bookmark\")\n {\n $(I).removeClass('fa-bookmark-o text-muted').addClass('fa-bookmark text-orange').removeAttr( \"onClick\" );\n $(I).css(\"pointer-events\",\"none\");\n }\n if((pageType == \"speakers\" || pageType == \"visitors\") && source == \"interested_attend\")\n {\n $(I).html('<i class=\"fa fa-check\" aria-hidden=\"true\"></i> Join Community').css('opacity','0.7').removeAttr( \"onClick\" );\n $(I).css(\"pointer-events\",\"none\");\n }\n return true;\n }\n if($(I).hasClass(\"agendaWatch\")){\n if($('.action-in').text() == 'Interested')\n var actionBtn = 'Interested';\n else if($('.action-in').text() == 'Follow')\n var actionBtn = 'Following';\n else if($('.action-in').text() == 'Register')\n var actionBtn = 'Registered'; \n if($(I).hasClass(\"a-m\")) {\n $('.action-in').html('<i class=\"fa fa-check\" aria-hidden=\"true\"></i> '+actionBtn).unbind('click').click(function(){alreadyClickAction(this)});\n $('.action-fix-in').html('<i class=\"fa fa-check\" aria-hidden=\"true\"></i> '+actionBtn).unbind('click').click(function(){alreadyClickAction(this)});\n $(\".action-save\").html(\"<i class='fa fa-bookmark fa-fw text-orange'></i> \"+actionBtn).unbind('click').click(function(){alreadyClickAction(this)});\n }\n postActionResponse();\n return true;\n } \n redirectTo(result,source);\n }\n }\n\n else{\n showloading(); \n if(result.status == 0 && result.hasOwnProperty('error') && result.hasOwnProperty('userData') && result.userData.hasOwnProperty('id') && result.error.hasOwnProperty('invalidData')){\n $( \".modal-backdrop\" ).removeClass('modal-backdrop');\n var attendInput = ['fields','title','social','subtitle','actionName','actionLabel','eventId','eventName'];\n var tag = source.search(\"follow\");\n if(tag > -1){\n attendInput['fields'] = ['name','user','city','company','designation','phone'];\n attendInput['actionLabel'] = 'Follow Now';\n }\n else if(hide_individual == 1)\n {\n attendInput['fields'] = ['name','user','city','company','designation','phone','autointroduce'];\n attendInput['actionLabel'] = 'Send Stall Booking Request';\n }\n else{\n attendInput['fields'] = ['name','user','city','company','designation','phone','autointroduce'];\n attendInput['actionLabel'] = 'Submit'; \n }\n attendInput['title'] = getTitle();\n attendInput['subtitle'] = getSubTitle();\n attendInput['eventName'] = getEventName();\n attendInput['eventId'] = getEventId();\n attendInput['actionName'] = \"gaEvent('User','Basic Popup Submit');RegisterForm();\";\n getForm(function (modalHtml){\n $(\"#modalData\").html(modalHtml.mainHtml); \n \n if(hide_individual == 1)\n $(\"#checkDiv\").hide();\n if(!document.getElementById('userSource')){\n $(\"#TenTimes-Modal\").append(addHidden('user_source','userSource','')); \n }\n $(\"#TenTimes-Modal\").modal(\"show\");\n if(result.userData.userCompany==null || result.userData.userCompany==''){\n getcompanydata(function(z){\n result.userData.userCompany=z.data[0].name;\n $('#userCompany').val(z.data[0].name);\n $('.alert_company').css('display','none');\n });\n }\n showValidationError(result);\n calling_detail();\n profileUpdate();\n gaEvent('User','Basic Popup Open');\n hideloading(); \n clickCompany();\n postFormOpenSettings(result.userData.country);\n var phoneno='';\n if(getCookie('user_token'))\n phoneno=result.userData.number_valid.nationalFormat;\n\n vcardopen(result.userData.name,result.userData.email,result.userData.designation,result.userData.userCompany,result.userData.cityName,result.userData.countryName,'',result.userData.id,result.userData.profilepicture,phoneno,result.userData.place_id);\n\n $('[data-toggle=\"tooltip\"]').tooltip();\n $(\"#TenTimes-Modal #userSource\").val(source);\n openform();\n },attendInput,source);\n }\n else{\n // consentup(10);\n window.location.assign(login_url + \"/ticket_transaction/going/\" + eventData.id);\n }\n hideloading();\n }\n}", "function handleClickOnSeparatePersonChat() {\n var eventPersonId = Number($(this).attr(\"data-inter-id\"));\n\n if (eventPersonId === currentActiveDiscussionId) {\n return;\n }\n $(chatInterContElement).removeClass(\"is-active\");\n $(this).addClass(\"is-active\");\n refreshEventsList(eventPersonId);\n } // end of click on separate person in interpreters list handler function", "function i(e){return(0,w.default)(e.participants,{state:\"JOINED\"})}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n //document.getElementById('no-connection').style.visibility = 'hidden';\n $('#myModal').modal('hide');\n client.subscribe(\"shercolor/#\", {\n qos: 2\n });\n}", "function selectConciergeFromList(){\n var parentUl = $('.user-content').children('ul');\n var users = parentUl.children('li');\n var user = users.get(0);\n\n // Clear message contents..\n $('#messages').html('');\n\n // Set user to select..\n for(var i = 0; i < users.length; i++) {\n user = users.get(i);\n user.setAttribute(\"style\", \"\");\n }\n users.get(0).setAttribute(\"style\", \"background-color: #eee;\");\n selectedIndex = 0;\n\n disableActionButton();\n var oneUser = {\n id : \"CONCIERGE\",\n contact_id: \"Concierge_\" + userSelf.email,\n username : \"Concierge\",\n email : \"CONCIERGE EMAIL\",\n img : \"/images/concierge.png\"\n };\n\n selectFlag = \"CON\";\n userSelected = oneUser;\n\n showUserInfo(oneUser);\n\n curConvId = \"Concierge_\" + userSelf.email;\n // Load conversation content of this user..\n var msgObj = {\n from: userSelf.email,\n contact_id: \"Concierge_\" + userSelf.email\n };\n socket.emit('loadConv', msgObj);\n}", "function activateChat() {\n $('#helpandchatimg').attr('alt', 'Chat');\n $('#helpandchatimg').attr('src', '/sites/all/themes/corvusbie/images/comment-discussion.svg');\n $('#helpandchattext').text('Ask a Librarian');\n $('#helpandchatlink').attr('href', '#');\n $('#helpandchatlink').click(function( event ) {\n event.preventDefault();\n window.open(\"https://ca.libraryh3lp.com/chat/[email protected]?skin=15653\", \"AskUs\", \"resizable=1,width=375,height=350\");\n });\n }", "function displayWelcome() {\n Reddcoin.messenger.getAppState(response => {\n if (!response.walletObj.dataAvailable) {\n $('#frame-wallet-interact').hide();\n $('#frame-wallet-interact').removeClass('active');\n $('#menuRegister').hide();\n $('#nav').hide();\n\n let bubbles = $(\".intro-bubble\"),\n frame;\n\n setInterval(function() {\n if (!$('#frame-intro').hasClass('active')) {\n return;\n }\n\n for (let i = 0, n = bubbles.length; i < n; i++) {\n let bubble = bubbles[i];\n\n if (bubble.classList.contains('active')) {\n let attribute = bubble.getAttribute('data-frame');\n\n frame = parseInt(attribute[attribute.length - 1]) + 1;\n\n if (frame > 4) {\n frame = 1;\n }\n\n $(`[data-frame='intro-${frame}']`).trigger('click');\n return;\n }\n }\n }, 1000 * 10);\n }\n else {\n $('#frame-intro').hide();\n $('#menuRegister').show();\n $('#nav').show();\n\n $('#header').show();\n\n $('#frames').addClass('frames--wallet');\n\n displayWallet();\n\n Reddcoin.messenger.getUserIds(function (result) {\n debug.log(`${result.length} user ids registered`);\n\n if (result.length > 0) {\n $('.reddid--greyed').addClass('disabled');\n\n $('.reddid--button-replace').replaceWith(`\n <div class=\"create-reddid button button--center button--faded button--full button--red button--large button--static\">\n ${result[0]}\n </div>\n `);\n }\n });\n }\n });\n}", "function inviteOthers() {\n //specify inviteContacts as tab so it will customize button\n showTab(\"inviteContacts\");\n}", "switchChannel(name, event){\n event.preventDefault();\n if (this.data.currentUser && this.data.currentUser.username != name) {\n this.props.switch(name);\n }\n }", "function connect() {\n\n socket.emit(\"resetMeeteing\");\n $.getJSON(url, function(data) {\n socket.emit(\"takeControl\",userName);\n identity = data.identity;\n \n // Bind button to join Room.\n \n roomName = \"Lobby\"\n\n log(\"Joining room '\" + roomName + \"'...\");\n var connectOptions = {\n name: roomName,\n logLevel: \"error\",\n video:{width:600},\n audio:true\n\n };\n\n if (previewTracks) {\n connectOptions.tracks = previewTracks;\n }\n\n // Join the Room with the token from the server and the\n // LocalParticipant's Tracks.\n Video.connect(data.token, connectOptions).then(roomJoined, function(error) {\n log(\"Could not connect to Twilio: \" + error.message);\n });\n });\n}", "function openChat(userID){\n if(page_type=='profile'){\n if($('#TenTimes-Modal .modal-title').text().search('Mutual')>-1){\n $('#TenTimes-Modal').modal('hide');\n }\n }\n showloading();\n channelChat.push(function() {\n channelizeUI.openChatBox(userID);\n });\n channelizeInit.callChannelize();\n}", "isActivate(e){\n\t\tif(this.state.user.activate == 0){\n\t\treturn(\n\t\t\t<div>\n\t\t\t\t<span className=\"mr-20\">\n\t\t\t\t\t<button type=\"button\" className=\"Confirm_Button\" onClick={this.rejectPerson}> Reject </button>\n\t\t\t\t</span>\n\t\t\t\t<button type=\"button\" className=\"Confirm_Button\" onClick={this.AddPerson}> Confirm </button>\n\t\t\t</div> \n\t\t);\n\t\t}else{\n\t\t\tif (this.state.user.id == this.props.auth_user.id){\n\t\t\treturn;\n\t\t\t}\n\t\treturn <button type=\"button\" className=\"AddPositionButton\" onClick={this.handleShowRecommend}> Recommend</button> ;\n\t\t}\n\t}", "getInitiateConversationUI() {\n if (this.props.newSelectedUser !== null) {\n return (\n <div className=\"message-thread start-chatting-banner\">\n <p className=\"heading\">\n You haven't chatted with {this.props.newSelectedUser.username} in a while,\n <span className=\"sub-heading\"> Say Hi.</span>\n </p>\t\t\t\n </div>\n )\n } \n }", "function initiateConversation(adminID){\n rainbowSDK.contacts.searchById(adminID).then((contact)=>{\n console.log(\"[DEMO] :: \" + contact);\n if(mocClicked == \"Chat\"){\n rainbowSDK.conversations.openConversationForContact(contact).then(function(conversation) {\n console.log(\"[DEMO] :: Conversation\", conversation);\n conversation1 = conversation;\n rainbowSDK.im.getMessagesFromConversation(conversation, 30).then(function() {\n console.log(\"[DEMO] :: Messages\", conversation);\n chat();\n }).catch(function(err) {\n console.error(\"[DEMO] :: Error Messages 1\", err);\n });\n }).catch(function(err) {\n console.error(\"[DEMO] :: Error conversation\", err);\n });\n }else{\n //check browser compatibility\n if(rainbowSDK.webRTC.canMakeAudioVideoCall()) {\n console.log(\"[DEMO] :: Audio supported\");\n if(rainbowSDK.webRTC.hasAMicrophone()) {\n /* A microphone is available, you can make at least audio call */\n console.log(\"[DEMO] :: microphone supported\");\n var res = rainbowSDK.webRTC.callInAudio(contact);\n if(res.label === \"OK\") {\n call();\n /* Your call has been correctly initiated. Waiting for the other peer to answer */\n console.log(\"[DEMO] :: Contact Successful\");\n let paragraph = document.getElementById(\"p1\");\n paragraph.innerHTML(\"Waiting for Admin to pick up.\");\n }\n else{console.log(\"[DEMO] :: Call not initialised successfully.\");}\n }else {\n alert(\"DEMO :: no microphone found\");\n }\n }else{\n alert(\"DEMO :: browser does not support audio\")\n }\n }\n }).catch((err)=>{\n console.log(err);\n });\n}", "function sendChatMessage() {\n // Create user object for the current page\n let user = new User({\"userID\" : profileUserID});\n\n // If their is a userid for the current profile page then send that using the post request\n let getParams = new URLSearchParams(window.location.search);\n\n // Send Message\n user.sendMessage(requestToken, user.userID, encodeURIComponent( quill.container.firstChild.innerHTML.replace(\"\\\\n\", \"\")));\n\n // Clear the message box\n quill.setText('')\n\n // Update the contents of the chatbox\n updateChat();\n}", "function urlCreateAccount(){\n let btn = document.querySelector(\"#cont-menu > #user\");\n btn.onclick = (e)=>{\n location.href = \"/login/signup\"\n }\n}", "function addReaction()\n{\n getCurrentReactionInfo();\n displayModelInfo();\n if(currentReactionNumber == 1)\n { //if there is at least one reaction allow user to add pathway to database\n document.getElementById('login-button').style.display = 'block';\n }\n}", "function next(){\n player2=new user(document.user2.name.value);\n player2.setGrid();\n fadeForm(\"user2\");\n showForm(\"boats\");\n turnInfo(player2.name);\n \n turn++;\n unlockMap(turn);\n bindGrid(turn);\n}", "function login(k) {\n\tkey = k;\n\tlocalStorage.setItem(\"keyPair\", JSON.stringify(k));\n\tiris.Channel.initUser(gun, key);\n\tgun.user()\n\t\t.get(\"profile\")\n\t\t.get(\"username\")\n\t\t.on(async (name) => {\n\t\t\tusername = await name;\n\t\t\t$(\"#my-username\").text(username);\n\t\t\t$(\"#my-edit-username\").text(username);\n\t\t});\n\tgun.user()\n\t\t.get(\"profile\")\n\t\t.get(\"avatar\")\n\t\t.on(async (avatar) => {\n\t\t\tavatar = await avatar;\n\t\t\t$(\"#header-content\")\n\t\t\t\t.find(\".profile-avatar\")\n\t\t\t\t.attr(\"src\", generateAvatarURL(avatar));\n\t\t\t$(\"#my-edit-profile\")\n\t\t\t\t.find(\".profile-avatar\")\n\t\t\t\t.attr(\"src\", generateAvatarURL(avatar));\n\t\t\t$(\"#profile-settings-avatar\")\n\t\t\t\t.find(\".profile-avatar\")\n\t\t\t\t.attr(\"src\", generateAvatarURL(avatar));\n\t\t});\n\t$(\"#vibe-page\").show().siblings(\"div#start-page\").hide();\n\tsetOurOnlineStatus();\n\tiris.Channel.getChannels(gun, key, addFriend);\n\tvar chatId =\n\t\thelpers.getUrlParameter(\"vibeWith\") ||\n\t\thelpers.getUrlParameter(\"channelId\");\n\tvar inviter = helpers.getUrlParameter(\"inviter\");\n\tfunction go() {\n\t\tif (inviter !== key.pub) {\n\t\t\tnewFriend(chatId, window.location.href);\n\t\t}\n\t\twindow.history.pushState(\n\t\t\t{},\n\t\t\t\"letsVibe\",\n\t\t\t\"/\" +\n\t\t\t\twindow.location.href\n\t\t\t\t\t.substring(window.location.href.lastIndexOf(\"/\") + 1)\n\t\t\t\t\t.split(\"?\")[0]\n\t\t); // remove param\n\t}\n\tif (chatId) {\n\t\tif (inviter) {\n\t\t\tsetTimeout(go, 2000); // wait a sec to not re-create the same chat\n\t\t} else {\n\t\t\tgo();\n\t\t}\n\t}\n}", "function pressColorButton(color) {\n if (listenToPlayer === true) {\n animate(color);\n playerSequence.push(color);\n\n if (!sequencesMatch() && strictMode) {\n gameLost();\n } else if (!sequencesMatch()) {\n wrongSequenceTryAgain();\n } else if (playerSequence.length === gameSequence.length && gameSequence.length === winningLevel) {\n gameWon();\n } else if (playerSequence.length === gameSequence.length) {\n incrementSuccess();\n }\n }\n}", "acceptHelper(learnerId, helperId, questionId) {\n \n //create session table\n axios.post('/accept', {\n id_learner: learnerId, \n id_helper: helperId, \n id_question: questionId,\n })\n .then(res => {\n console.log('========== Success saving collaborate session');\n // setState to include learnerId, helperId, questionId, roomNumber?\n // redirect to collaborate?\n })\n .catch(err => {\n if (err) {\n console.log('Error saving collaborate session', err);\n }\n });\n }", "enterClientInAblyPresenceSet(vueContext) {\n this.state.channelInstances.outgoingChat.presence.enter({\n username: this.state.username\n });\n }", "function setUserStyle() {\n\n // Update on color picker input\n $userAura.change(function() {\n // Save color picker value\n let $theme = $userAura.val();\n $appearSFX2.play();\n // Set styling of question div and 'next' button according to color value\n // (Class selector wasn't overriding default button styling so had to set using IDs)\n $('#textwrapper').css('background-color', $theme).css('filter', 'hue-rotate(-40deg)');\n $('#nextbutton').css('background-color', $theme).css('filter', 'hue-rotate(-40deg)');\n $('#zodiacbackground').css('background-color', $theme);\n $playButton.css('background-color', $theme);\n $wordOption.css('background-color', $theme);\n\n $affirmation.fadeIn();\n $playButton.fadeIn();\n\n // Reveal 'next' button\n setTimeout(function() {\n $nextButton.fadeIn();\n }, 2000);\n });\n\n}", "function handleOffer(offer, name) { \n document.getElementById('dv_gotCall').hidden = false;\n document.getElementById('callInitiator').style.display = 'none';\n document.getElementById('callReceiver').style.display = 'block';\n document.getElementById('controlVid').style.display = 'none';\n\n createPeerConnection();\n \n connectedUser = name; \n document.getElementById('callFrom').innerHTML = '來自 ' + name;\n /* Call answer functionality starts */\n answerBtn.addEventListener(\"click\", function () { \n //connectedUser = name; 上移\n yourConn.setRemoteDescription(new RTCSessionDescription(offer)); \n \n //create an answer to an offer \n yourConn.createAnswer(function (answer) { \n yourConn.setLocalDescription(answer); \n \n send({ \n type: \"answer\", \n answer: answer\n });\n \n }, function (error) { \n alert(\"Error when creating an answer\"); \n });\n document.getElementById('remoteImg').hidden = false;\n document.getElementById('remoteImg').src = '' + remoteImgUrl;\n document.getElementById('controlVid').style.display = 'block';\n document.getElementById('callReceiver').style.display = 'none';\n document.getElementById('callOngoing').style.display = 'block';\n });\n /* Call answer functionality ends */\n /* Call decline functionality starts */\n declineBtn.addEventListener(\"click\", function () {\n send({ \n type: \"decline\",\n reqFrom: name\n });\n handleLeave();\n });\n\n/*Call decline functionality ends */\n}", "function startMusaChat() {\n $(\"#musa\").on(\"click\", function () {\n $(\".contacts\").addClass(\"hide\");\n $(\"musaH2\").addClass(\"hide\");\n musaChat();\n });\n}", "function feedback(message, guid){\n // var pid = getPidForUser(guid);\n var session = getSessionForUser(guid);\n var originalguid = getFirstGuid(guid);\n // send to session pages - control page can display\n io.to(session).emit('feedback', {\"message\": message, \"user\": originalguid});\n }", "onShowContactChat() {\n App.bus.trigger(OPEN_CONTACT_CHAT);\n }", "function handleAccessViewPlayer() {\n var userId = localStorage.getItem(\"user\");\n if(userId != null) {\n var query = firebase.database().ref('Users/' + userId);\n query.once(\"value\").then(function(snapshot) {\n var coach = snapshot.child(\"coach\").val();\n var manager = snapshot.child(\"manager\").val();\n\n if(coach == true || manager == true){\n var editButton = document.getElementById('edit-player-button');\n editButton.style.display = 'block';\n document.getElementById('view-player-record-id').className = \"nav-item\";\n document.getElementById('nav-edit-player').className = \"desktop-hidden\";\n }\n });\n }\n}", "function onNewParticipant(message) {\n receiveVideoFrom(message.new_user_id)\n}", "function chat() {\n\t\tvar loginform = document.getElementById('loginform');\n\t\tvar channel_name = document.getElementById('channel_name');\n\t\tif(loginform && channel_name) {\n\t\t\tvar selector;\n\t\t\tvar button;\n\t\t\tif(sticks.get_cookie('chat_theme', 'dark') === 'light') {\n\t\t\t\tsticks.addClass(document.body, 'light-theme');\n\t\t\t\tselector = '.settings-item[data-settings-type=chat-theme] i';\n\t\t\t\tbutton = document.querySelector(selector);\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-on');\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-off');\n\t\t\t}\n\t\t\tif(sticks.get_cookie('smooth_scroll', 'on') === 'off') {\n\t\t\t\t_smooth_scroll = false;\n\t\t\t\tselector = '.settings-item[data-settings-type=smooth-scroll-mode] i';\n\t\t\t\tbutton = document.querySelector(selector);\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-on');\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-off');\n\t\t\t}\n\t\t\tif(sticks.get_cookie('join_mode', 'hide') === 'show') {\n\t\t\t\t_show_join_leave_message = true;\n\t\t\t\tselector = '.settings-item[data-settings-type=join-mode] i';\n\t\t\t\tbutton = document.querySelector(selector);\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-on');\n\t\t\t\tsticks.toggleClass(button, 'fa-toggle-off');\n\t\t\t}\n\t\t\tchannel_name = channel_name.value;\n\t\t\tvar webchat_uri = loginform.getAttribute('data-webchat-uri');\n\t\t\tsticks.on(loginform, 'submit', function(event) {\n\t\t\t\tsticks.preventDefault(event);\n\t\t\t\tsticks.chat.connect(webchat_uri, channel_name);\n\t\t\t\ttoggle_spinner(true);\n\t\t\t\tpulse_channel_window(channel_name, true);\n\t\t\t\t_connect_timeout = setTimeout(on_connection_timeout, 5000);\n\t\t\t\treturn false;\n\t\t\t});\n\t\t\tvar tab = document.getElementById('channel-tab-template');\n\t\t\tinit_channel_tab_event_listeners(tab);\n\t\t\tvar settings_items = tab.parentNode.querySelectorAll('.settings-item');\n\t\t\tfor(var idx=0; idx < settings_items.length; idx++) {\n\t\t\t\tsticks.on(settings_items[idx], 'click', function(e) {\n\t\t\t\t\tsettings_item_toggle(e.currentTarget);\n\t\t\t\t\treturn sticks.preventDefault(e);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\tsticks.on(window, 'beforeunload', disconnect)\n\t}", "async handle() {\r\n await this.client.user.setActivity('TruckersMP', {\r\n url: 'https://truckersmp.com',\r\n type: 'PLAYING',\r\n }).catch(console.error);\r\n\r\n // Load global libraries with managers\r\n const RoleManager = require('../lib/RoleManager.js');\r\n global['roleManager'] = new RoleManager(this.client);\r\n\r\n // Load all emojis to the client so on every reaction the bot does not have to connect to the database\r\n this.client.roles = {};\r\n this.client.guilds.each(async guild => {\r\n this.client.roles[guild.id] = {};\r\n\r\n const roles = await Role.query().where('guild', guild.id);\r\n roleManager.fetchRoles(guild.id, roles);\r\n });\r\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 handleCoachAccess(){\n var userId = localStorage.getItem(\"user\");\n if(userId != null) {\n var query = firebase.database().ref('Users/' + userId);\n query.once(\"value\").then(function(snapshot) {\n var manager = snapshot.child(\"manager\").val();\n\n if(manager == true){\n document.getElementById('edit-delete-player').className = \"btn btn-danger\";\n }\n });\n }\n}", "function call() {\n // Not currently in a room\n disableElements(\"call\");\n var message = {\n id : 'call',\n from : document.getElementById('userName').value,\n to : document.getElementById('otherUserName').value\n };\n sendMessage(message);\n}", "function onSendClicked() {\n var target=vw.getPeerName();// NOT from mc.userParams.targetUsername, so that you can chat and speak with different users \n if ( ! target) {\n //vw.showAlert(\"Peer user name required\");\n alert(\"Peer user name required\");\n return false;\n }\n var msg = {\n text: vw.getTextInp(),\n type: \"message\",\n id: up.clientID,\n date: Date.now(),\n user: up.user,\n }; \n //alert(target);\n if (target) msg.target=target;\n signallingConnection.sendRelay(msg);\n vw.clearTextInp();\n}", "onClick() {\n\t\t// region button clicked event\n\t\tMeteor.call('openRegion', Meteor.userId(), this.props.regions._id, this.props.regions.regionName);\n\n\t\t// render chat body component\n\t\tSession.set('regionName', this.props.regions.regionName);\n\t}", "function TextContainer({ users,room}){\n\n function linkGenerate(){\n // var { name,room } = queryString.parse(location.url);\n var link=\"http://localhost:4000/video/\";\n\n window.location.href = link+encodeURI(room);\n\n }\n\n\n return(\n <div className=\"textContainer\">\n \n\n <button className=\"button mt-20\" onClick={linkGenerate}>Video call</button>\n <div>\n\n </div>\n {\n users\n ? (\n <div>\n <h1>People currently Online:</h1>\n <div className=\"activeContainer\">\n <h2>\n {users.map(({name}) => (\n <div key={name} className=\"activeItem\">\n {name}\n <img alt=\"Online Icon\" src={onlineIcon}/>\n </div>\n ))}\n </h2>\n </div>\n </div>\n )\n : null\n }\n </div>\n);\n}", "function addToConference(){\n\tvar connectToUser = $callerName.innerHTML;\n\tconsole.log(connectToUser + ' call accepted');\n\tsocket.emit('acceptIntoConference',connectToUser );\n\t$caller.style.display = 'none';\n\t$addToConferenceButtons.style.display = 'none';\n\t$ringingSound.pause();\n}", "function view(userID) {\n // Logger.log(userID);\n var curruser = userExists(userID);\n // Logger.log(curruser.firstName.length);\n if (!curruser.firstName) {\n sendText(\n userID,\n \"Hey there! We couldn't find you in our user database, join us using /register\"\n );\n } else {\n sendText(userID, 'Which session?', dayKeyboard('view-', curruser.zone));\n }\n }", "function joinCommunity() {\n if (document.getElementById('join-community')) {\n let join = document.getElementById('join-community');\n join.innerHTML = `<i class=\"fas fa-check\" aria-hidden=\"true\"></i>&nbsp;Subscribe`;\n join.classList.remove('btn-orange');\n join.classList.add('btn-success');\n join.removeAttribute('onclick');\n join.disabled = true;\n }\n}", "function exhibitorSetMeetingCallBack(exhibitorId) {\n if(page_type=='thankyou_new'){\n $(\"#connect-\"+exhibitorId+\".exhibitorConnect\").removeClass(\"btn-orange fa-check\").addClass(\"btn-default disabled\");\n $(\"#connect-\"+exhibitorId+\".exhibitorConnect\").html(\"<i class='fa fa-check text-success' style='font-size:12px;'></i> Request Sent\");\n }else{\n $(\"#connect-\"+exhibitorId+\".exhibitorConnect\").html(\"<i class='fa fa-check text-success'></i> Request Sent\");\n $(\"#connect-\"+exhibitorId+\".exhibitorConnect\").removeClass(\"btn-orange\").addClass(\"btn-default disabled\");\n }\n if($(\"#connect-\"+exhibitorId+\".exhibitorConnect\").text().trim()==\"Request Sent\" && pageType==\"about\")\n $(\"#connect-\"+exhibitorId+\".exhibitorConnect\").next().css('margin-left','14%');\n\n $(\"#connect-\"+exhibitorId+\".exhibitorConnect\").css({'opacity': '1','color': '#333'});\n}", "function userClick(user) {\n if (store.get('profile').user_id == user.user_id) {\n return;\n }\n logger.info('[TEST] Messaging ' + (user.name || user.nickname));\n }", "function getParticipants() {\n\tdocument.getElementById(\"acceptQuest\").style.display = \"inline\";\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += \"\\n> please accept/decline quest by clicking below\"\n\tif (isAI) {\n\t\tvar data = JSON.stringify({\n\t\t\t'AICommand' : \"AskToParticipateQuest\"\n\t\t})\n\t\tsetTimeout(function(){ socketConn.send(data); }, 1000);\n\t\tdocument.getElementById(\"acceptQuest\").style.display = \"none\";\n\t\tserverMsg.value += \"\\n> wait for other players...\";\n\t}\n\tgetCurrHand();\n\tfor(var i=0; i<handCardSRC.length; i++) {\n\t\tif(handCardSRC[i].includes(\"Merlin\")) {\n\t\t\tdocument.getElementById(\"merlin\").style.display = \"block\";\n\t\t\tdocument.getElementById(\"merlinPrompt\").innerText = \"You have Merlin in hand, preview stage?\";\n\t\t\tvar data = JSON.stringify({\n\t\t\t\t'hasMerlin' : 0,\n\t\t\t\t'name' : PlayerName\n\t\t\t})\n\t\t\tsocketConn.send(data);\n\t\t}\n\t}\n}", "function proceed() {\r\n $scope.status = ''\r\n $scope.logo.class = 'animated zoomOutDown'\r\n AppService.getMutualMatches() // load in the background\r\n // disable the back button\r\n $ionicHistory.nextViewOptions({\r\n historyRoot: true,\r\n disableBack: true\r\n })\r\n\r\n // the timeout is to give the drop CSS animation time\r\n $timeout(() => AppService.goToNextLoginState(), 1000)\r\n\r\n var profile = AppService.getProfile();\r\n var user = {\r\n userId: profile.uid,\r\n name: profile.name,\r\n custom_attributes: {\r\n Name: profile.name,\r\n user_id: profile.uid\r\n }\r\n };\r\n\r\n intercom.updateUser(user, function() {\r\n intercom.displayMessenger();\r\n });\r\n }", "function channelsReceived() {\n let matches = JSON.parse(this.responseText);\n let list = document.getElementById(\"matches\");\n for (key in matches) {\n let match = matches[key];\n let button = document.createElement(\"button\");\n button.setAttribute('class', 'channel');\n button.setAttribute('onclick', \"window.location.href='../pages/channel.php?name=\" + match.name + \"'\");\n button.innerHTML = '<p> Channel </p><h1>' + match.name + '</h1>';\n\n list.appendChild(button);\n }\n}", "@computed get respondToUserHi() {\n // Once we have the users name, start Skype and respond with greeting\n if(this.userInfo.name !== null) {\n window.setTimeout(() => {\n appState.sendInput(`Nice to meet you ${appState.userInfo.name}`, false);\n // messageList.push({body: `Nice to meet you ${userInfo.name}`, user: false}); \n }, 1000); \n }\n }", "function personExperience(event, senderId) {\n allSenders[senderId].states++;\n allSenders[senderId].lastWorkPosition = event.message.text;\n sendFBmessage.sendQuickReplies(senderId, CV_text, -1, ['No']);\n}", "function user_chats(name){\n //clear any current channel from the local storage\n localStorage.setItem('channel', null);\n const request = new XMLHttpRequest();\n request.open('POST', '/direct');\n request.onload = () => {\n const data = JSON.parse(request.responseText);\n //now, we crate a unique indentifier for every private chat,\n //which is the length of the two names of the chatting people\n let all_names = data.current + data.other;\n localStorage.setItem('id', all_names.length);\n localStorage.setItem('name', name);\n //clear nav about any channel aspects\n document.querySelector('#current-channel').innerHTML = '';\n document.querySelector('#users-number').innerHTML = '';\n\n //now get messages btn the two users\n get_user_messages(data);\n }\n const data = new FormData();\n data.append('name', name);\n request.send(data);\n }", "async onAcceptMember(getRequestMember,cliqueName){\n const userModel = await UserManagement.getCurrentUserModel(true);\n if(userModel.username == this.state.cliqueLeader){\n\n await CliqueManagement.acceptCliqueMember(getRequestMember,cliqueName);\n const userModel = await UserManagement.getCurrentUserModel(true);\n let cliqueData = await CliqueManagement.getOneClique(userModel.cliqueId);\n let memberArray = [];\n for(var i=0;i<cliqueData.cliqueRequest.length;i++){\n memberArray.push({requestName:cliqueData.cliqueRequest[i]})\n }\n this.setState({cliqueRequestList:memberArray,cliqueName: cliqueData.cliqueName});\n\n\n }else{\n Alert.alert('Error', 'You are not clique leader', [\n {text: 'OK', onPress: () => console.log('Cancel'), style: 'cancel'},\n ]);\n }\n\n }", "function onConnect() {\n const data = {\n isGroup: false, // TODO: will be justed for group chat, later\n participants: [currentUser.id, partnerUser.id]\n };\n FIREBASE.firestore().collection('connections').add(data)\n .then((doc) => doc.get())\n .then((snapShot) => ({ ...snapShot.data(), id: snapShot.id }))\n .then((connection) => setState((prev) => ({ ...prev, connection })))\n }", "function setCurrentContestant(\n iAmCurrentContestant,\n nameOfPlayer,\n currentlyGuessable\n) {\n document.getElementById(\"interact\").style.visibility =\n iAmCurrentContestant && currentlyGuessable ? \"visible\" : \"hidden\";\n document.getElementById(\"user-guess\").innerHTML = currentlyGuessable\n ? \"Waiting for guess\"\n : document.getElementById(\"user-guess\").innerHTML;\n document.getElementById(\"user-prompt\").innerHTML = iAmCurrentContestant\n ? \"It's your turn!\"\n : `${nameOfPlayer}</br>playing now!`;\n document.getElementById(\n \"user-prompt\"\n ).style.backgroundColor = iAmCurrentContestant\n ? currentlyGuessable\n ? \"chartreuse\"\n : \"aquamarine\"\n : \"silver\";\n document.getElementById(\"user-prompt\").innerHTML = currentlyGuessable\n ? document.getElementById(\"user-prompt\").innerHTML\n : \"\";\n}", "function inviteParticipants() {\n if (roomUrl === null)\n return;\n\n var sharedKeyText = \"\";\n if (sharedKey && sharedKey.length > 0) {\n sharedKeyText =\n \"This conference is password protected. Please use the \" +\n \"following pin when joining:%0D%0A%0D%0A\" +\n sharedKey + \"%0D%0A%0D%0A\";\n }\n\n var conferenceName = roomUrl.substring(roomUrl.lastIndexOf('/') + 1);\n var subject = \"Invitation to a Jitsi Meet (\" + conferenceName + \")\";\n var body = \"Hey there, I%27d like to invite you to a Jitsi Meet\" +\n \" conference I%27ve just set up.%0D%0A%0D%0A\" +\n \"Please click on the following link in order\" +\n \" to join the conference.%0D%0A%0D%0A\" +\n roomUrl +\n \"%0D%0A%0D%0A\" +\n sharedKeyText +\n \"Note that Jitsi Meet is currently\" +\n \" only supported by Chromium,\" +\n \" Google Chrome and Opera, so you need\" +\n \" to be using one of these browsers.%0D%0A%0D%0A\" +\n \"Talk to you in a sec!\";\n\n if (window.localStorage.displayname) {\n body += \"%0D%0A%0D%0A\" + window.localStorage.displayname;\n }\n\n window.open(\"mailto:?subject=\" + subject + \"&body=\" + body, '_blank');\n }", "viewconference(conference){\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}", "function setShareRoomBtn() {\n shareRoomBtn.addEventListener(\"click\", async (e) => {\n const myRoomUrl = window.location.href;\n Swal.fire({ background: background, position: \"top\", \n html: `<br/><p style=\"color:white;\">Share this meeting invite for others to join.</p>\n <p style=\"color:#376df9;\">` + myRoomUrl + `</p>`,\n showDenyButton: true, confirmButtonText: `Copy URL`, confirmButtonColor: 'black', denyButtonText: `Close`, denyButtonColor: 'grey',})\n .then((result) => { if (result.isConfirmed) copyRoomURL(); }); \n });\n}", "function setShareRoomBtn() {\n shareRoomBtn.addEventListener(\"click\", async (e) => {\n const myRoomUrl = window.location.href;\n Swal.fire({ background: background, position: \"top\", \n html: `<br/><p style=\"color:white;\">Share this meeting invite for others to join.</p>\n <p style=\"color:#376df9;\">` + myRoomUrl + `</p>`,\n showDenyButton: true, confirmButtonText: `Copy URL`, confirmButtonColor: 'black', denyButtonText: `Close`, denyButtonColor: 'grey',})\n .then((result) => { if (result.isConfirmed) copyRoomURL(); }); \n });\n}", "render() {\n return (\n <AuthConsumer>\n {({ userInfo, createChat, goToChat, colorScheme }) => (\n <>\n {/*These divs are for consistency with the styling of the other pages.*/}\n <div className={`${colorScheme.secondary} h-screen`}>\n <div className={`${colorScheme.primary} ${colorScheme.text} w-full`}><a href='/' className=\"fa fa-home\">Home</a></div>\n <div className={`${colorScheme.primary} ${colorScheme.text} profileHeader flex flex-col h-48 w-full font-mono py-16`}></div>\n\n <br />\n <div className={`${colorScheme.text}`}>\n <h1><b>Add a Contact:</b></h1><br />\n <h4>Enter their id below:</h4>\n <input type=\"text\" value={this.state.addingID} onChange={this.boxChange} />\n <h4>Your unique id: {userInfo.uniqueId}</h4>\n <button className={`${colorScheme.primary} border-black border-2`} onClick={(e) => this.addContact(userInfo, createChat)}>Add Contact</button>\n <p>{this.state.addResponse}</p>\n\n <br /><br /><br />\n\n\n <h1><b>Contacts:</b></h1>\n {this.state.buttonInfo ? this.state.buttonInfo.map((info) => this.makeButton(info, goToChat, colorScheme)) : <></>}\n </div>\n </div>\n </>\n )}\n </AuthConsumer>\n )\n }", "function getTournie() {\n\tdocument.getElementById(\"askTournament\").style.display = \"inline\";\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += \"\\n> please accept/decline quest by clicking below\"\n\tif (isAI) {\n\t\tvar data = JSON.stringify({\n\t\t\t'AICommand' : \"AskTournament\",\n\t\t\t'name': PlayerName\n\t\t})\n\t\tsetTimeout(function(){ socketConn.send(data); }, 1000);\n\t\tdocument.getElementById(\"askTournament\").style.display = \"none\";\n\t\tserverMsg.value += \"\\n> wait for other players...\";\n\t}\n\n}", "function onConferenceJoined() {\n console.log('INFO (join.js): Conference joined!');\n isJoined = true;\n for (let i = 0; i < localTracks.length; i++) {\n room.addTrack(localTracks[i]);\n }\n /*$('#mainBtn').attr('disabled', false);*/ //No one leaves untill 5th person joins\n $.toast({\n text: 'You have joined the Panel.',\n icon: 'success',\n showHideTransition: 'fade',\n allowToastClose: false,\n hideAfter: 5000,\n stack: 5,\n\tloader: false,\n position: 'top-right',\n textAlign: 'left',\n bgColor: '#333333',\n textColor: '#ffffff'\n });\n}", "function action_addCollaborator() {\n var info = $('#input-addCollaborator').val();\n if(info == ''){\n return;\n }\n\n var userAdded = collaboratorList.find(function(oneUser) {\n if(oneUser.email === info || oneUser.username === info)\n return oneUser;\n });\n\n if(userAdded) {\n return;\n }\n\n var msgObj = {\n from: userSelf.email,\n info: info\n };\n\n socket.emit('addCollaborator', msgObj);\n}", "function changeUserView(url, guid, session){\n var data = {};\n if(url === '/dial'){\n data.content = fs.readFileSync(dialContent,\"utf8\").toString();\n data.scripts = dialScripts;\n data.title = \"Dial testing \";\n }\n else if(url === '/wheel'){\n data.content = fs.readFileSync(wheelContent,\"utf8\").toString();\n data.scripts = wheelScripts;\n data.title = \"Emotion wheel \";\n }\n else if(url === '/questions'){\n data.content = fs.readFileSync(questionContent,\"utf8\").toString();\n data.scripts = questionScripts;\n data.title = \"Questionnaire \";\n }\n else if(url === '/fob'){\n data.content = fs.readFileSync(fobContent,\"utf8\").toString();\n data.scripts = fobScripts;\n data.title = \"Fob \";\n }\n if(guid === 'all'){\n // socket.to(session).broadcast.emit('static', data);\n log(\"setting all users in \"+ session + \" to view \" + url, session);\n io.to(session).emit('static', data);\n }\n else{\n log(\"setting user \" + guid + \" to view \" + url, session);\n io.to(guid).emit('static', data);\n // socket.emit('static', data);\n }\n\n }", "onJoin (client, options) {\r\n\t\tif(GameStarted == true){throw new Error(\"Partie Complète\")}\r\n\t\telse{\r\n\t\tthis.state.players.set(client.sessionId, new Player());\r\n\t\tif(this.state.carteInit==false)\r\n\t\t{\r\n\t\t\tthis.broadcast(\"CarteInit\",this.state.carte);\r\n\t\t\tthis.state.carteInit = true;\r\n\t\t}\r\n\t\tthis.state.players.get(client.sessionId).color = changeColorFunction()\r\n\t\t// Affichage liste users présent\r\n\t\tthis.broadcast(\"listUserConnected\", this.state.players);\r\n\t\tconst player = this.state.players.get(client.sessionId);\r\n\t\tOrder.push(client.sessionId)\r\n\t\tthis.broadcast(\"messages\", [('('+client.sessionId+') : vient d\\'arriver !'),player.nom,player.color]);\r\n\t\t}\r\n\t}", "function display(user)\n{\n\tif (user == \"P\") document.getElementById(\"participant\").style.visibility = \"visible\";\n\telse document.getElementById(\"experimenter\").style.visibility = \"visible\";\n}", "function SetUserActive(Username, Nama)\n{\n new Messi('Apakah anda ingin mengaktifkan user : <b>' + Username + '</b>( '+ Nama + ')', {title: 'Info', modal: true, titleClass: 'info', buttons: [{id: 0, label: 'Yes', val: 'Y' , btnClass: 'btn-success'}, {id: 1, label: 'No', val: 'N', btnClass: 'btn-danger'}], \n callback: function(val) \n {\n if (val==\"Y\")\n {\n parent.window.location = '?m=user&a=SetUserActive&Username='+Username;\n }\n }\n }); \n}", "function acceptQuestParticipate() {\n\tdocument.getElementById(\"merlin\").style.display = \"none\";\n\tstageCounter = 0;\n\tdocument.getElementById('acceptQuest').style.display = \"none\";\n\tvar data = JSON.stringify({\n\t\t'name' : PlayerName,\n\t\t'participate_quest' : true\n\t});\n\tsocketConn.send(data);\n\tvar serverMsg = document.getElementById('serverMsg');\n\tserverMsg.value += (\"\\n> waiting for others to answer\");\n}", "constructor(model) { // Set up subscriptions and DOM event handlers.\n super(model);\n this.model = model;\n this.users = new Map(Array.from(this.model.users.values()).map(userModel => [userModel.userId, new UserView(userModel, this)]));\n this.subscribe(this.sessionId, \"view-join\", this.ensureLocalModel);\n this.subscribe(this.sessionId, 'addUserView', this.addUserView);\n this.subscribe(this.sessionId, 'displayNearby', this.displayNearby);\n this.subscribe(this.sessionId, 'log', this.logMessage);\n \n this.introScreens = ['none', 'intro', 'info', 'infoSettings', 'selfie', 'contact', 'threeWords'];\n Array.from(document.querySelectorAll(\".next\")).forEach(button => button.onclick = () => this.nextIntroScreen());\n Array.from(document.querySelectorAll(\".back\")).forEach(button => button.onclick = () => this.previousIntroScreen());\n \n\n qr.onclick = () => this.findUser('Share').toggleSelection();\n takeSelfie.onclick = () => this.takeSelfie();\n retakeSelfie.onclick = () => this.setupSelfie();\n contactName.oninput = () => {\n if (!tags.value) tags.placeholder = this.tagsDefault() || 'e.g., blockchain expert';\n }\n reset.onclick = () => this.reset();\n cloud.addEventListener('wordcloudstop', () => {\n console.log('wordcloudstop', cloud.dataset.userId, this.publish);\n this.publish(cloud.dataset.userId, 'renderedCloud');\n });\n wordInput.onchange = () => {\n function clickSpanIfFound(span) {\n if (span.textContent === word) {\n user.updateForNewSpanChoice(span);\n return true;\n }\n }\n const user = this.findUser(cloud.dataset.userId),\n word = wordInput.value;\n if (!user.eachCloudSpan(clickSpanIfFound)) {\n this.publish(this.model.userId, 'rate', {word: word});\n this.yourPick = word;\n user.renderCloud(); // FIXME- after round trip\n }\n }\n }", "render(){\n if(!Session.get(\"dataReady\"))\n {\n Session.set(\"waitBackURL\",\"/chat\");\n return(\n <Redirect to={\"/wait\"}/>\n )\n }\n else{\n // let sender=true;\n return (\n <div className=\"row\">\n <div class=\"col-md-3\">\n <div class=\"card\">\n <div class=\"card-header\">\n <h4 class=\"card-title\">Users Groups</h4>\n </div>\n <div class=\"card-content\">\n <div class=\"panel-group\" id=\"accordion\" role=\"tablist\" aria-multiselectable=\"true\">\n\t\t\t\t\t\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\" role=\"tab\" id=\"headingOne\">\n <a role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseOne\" aria-expanded=\"false\" aria-controls=\"collapseOne\" class=\"collapsed\">\n <h4 class=\"panel-title\">\n Doctors\n <i class=\"material-icons\">keyboard_arrow_down</i>\n </h4>\n </a>\n </div>\n <div id=\"collapseOne\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"headingOne\" aria-expanded=\"false\" style={{height: 0}}>\n <div class=\"panel-body\">\n <table className=\"table table-hover table-fixed\">\n <thead className=\"text-success\">\n <tr>\n <th>Name</th>\n </tr>\n </thead>\n <tbody>\n {instance.state.loadPatientCompleted?\n\t\t\t\t\t\t\t\t\t\t\n instance.state.doctors.map((doctor)=>{\n\t\t\t\t\t\t\t\t\t\t\tdebugger;\n return(\n <tr onClick={instance.userSelect.bind(instance,doctor)}>\n <td>{doctor.name}</td>\n </tr>\n )\n })\n :\n <h3><i className=\"fa fa-spinner fa-pulse\"></i> Loading doctors...</h3>\n }\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\" role=\"tab\" id=\"headingTwo\">\n <a class=\"collapsed\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseTwo\" aria-expanded=\"false\" aria-controls=\"collapseTwo\">\n <h4 class=\"panel-title\">\n Staffs\n <i class=\"material-icons\">keyboard_arrow_down</i>\n </h4>\n </a>\n </div>\n <div id=\"collapseTwo\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"headingTwo\" aria-expanded=\"false\">\n <div class=\"panel-body\">\n <table className=\"table table-hover table-fixed\">\n <thead className=\"text-success\">\n <tr>\n <th>Name</th>\n </tr>\n </thead>\n <tbody>\n {instance.state.loadPatientCompleted?\n instance.state.staffs.map((staff)=>{\n return(\n <tr onClick={instance.userSelect.bind(instance,staff)}>\n <td>{staff.name}</td>\n </tr>\n )\n })\n :\n <h3><i className=\"fa fa-spinner fa-pulse\"></i> Loading staffs...</h3>\n }\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\" role=\"tab\" id=\"headingThree\">\n <a class=\"collapsed\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseThree\" aria-expanded=\"false\" aria-controls=\"collapseThree\">\n <h4 class=\"panel-title\">\n Patients\n <i class=\"material-icons\">keyboard_arrow_down</i>\n </h4>\n </a>\n </div>\n <div id=\"collapseThree\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"headingThree\" aria-expanded=\"false\">\n <div class=\"panel-body\">\n <table className=\"table table-hover table-fixed\">\n <thead className=\"text-success\">\n <tr>\n <th>Name</th>\n </tr>\n </thead>\n <tbody>\n {instance.state.loadPatientCompleted?\n instance.state.patients.map((patient)=>{\n return(\n <tr onClick={instance.userSelect.bind(instance,patient)}>\n <td>{patient.name}</td>\n </tr>\n )\n })\n :\n <h3><i className=\"fa fa-spinner fa-pulse\"></i> Loading patients...</h3>\n }\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\" role=\"tab\" id=\"headingFour\">\n <a class=\"collapsed\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseFour\" aria-expanded=\"false\" aria-controls=\"collapseFour\">\n <h4 class=\"panel-title\">\n Patients Contacts\n <i class=\"material-icons\">keyboard_arrow_down</i>\n </h4>\n </a>\n </div>\n <div id=\"collapseFour\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"headingFour\" aria-expanded=\"false\">\n <div class=\"panel-body\">\n <table className=\"table table-hover table-fixed\">\n <thead className=\"text-success\">\n <tr>\n <th>Name</th>\n </tr>\n </thead>\n <tbody>\n {instance.state.loadPatientCompleted?\n instance.state.contacts.map((contact)=>{\n return(\n <tr onClick={instance.userSelect.bind(instance,contact)}>\n <td>{contact.name}</td>\n </tr>\n )\n })\n :\n <h3><i className=\"fa fa-spinner fa-pulse\"></i> Loading contacts...</h3>\n }\n </tbody>\n </table>\n </div>\n </div>\n </div>\n\t\t\t\t\t\t<div class=\"panel panel-default\">\n <div class=\"panel-heading\" role=\"tab\" id=\"headingOne\">\n <a role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseZero\" aria-expanded=\"false\" aria-controls=\"collapseOne\" class=\"collapsed\">\n <h4 class=\"panel-title\">\n Admin\n <i class=\"material-icons\">keyboard_arrow_down</i>\n </h4>\n </a>\n </div>\n <div id=\"collapseZero\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"headingOne\" aria-expanded=\"false\" style={{height: 0}}>\n <div class=\"panel-body\">\n <table className=\"table table-hover table-fixed\">\n <thead className=\"text-success\">\n <tr>\n <th>Name</th>\n </tr>\n </thead>\n <tbody>\n {instance.state.loadPatientCompleted?\n\t\t\t\t\t\t\t\t\t\t\n instance.state.admins.map((admin)=>{\n\t\t\t\t\t\t\t\t\t\t\tdebugger;\n return(\n <tr onClick={instance.userSelect.bind(instance,admin)}>\n <td>{admin.name}</td>\n </tr>\n )\n })\n :\n <h3><i className=\"fa fa-spinner fa-pulse\"></i> Loading admins...</h3>\n }\n </tbody>\n </table>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n\n {instance.state.user.name.length>0?\n <div className=\"col-lg-9\">\n <h2> chat with {instance.state.user.name}</h2>\n <div className=\"frame\">\n <ul id=\"chatlist\" className=\"chat\">\n {instance.state.messages.map((message)=>{\n sender=(message.from===Meteor.userId());\n if(sender)\n return (\n <li key={message._id} tabIndex=\"1\" style={{width:\"100%\",marginTop: 25}}>\n <div className=\"msj macro\">\n <div className=\"avatar\"><img className=\"img-circle\" style={{width:\"100%\"}} src=\"/assets/img/from.jpg\" /></div>\n <div className=\"text text-l\">\n <p>{message.text}</p>\n <p><small>{message.dateTime}</small></p>\n </div>\n </div>\n </li>);\n else\n return (\n <li key={message._id} tabIndex=\"1\" style={{width:\"100%\",marginTop: 25}}>\n <div className=\"msj-rta macro\">\n <div className=\"text text-r\">\n <p>{message.text}</p>\n <p><small>{message.dateTime}</small></p>\n </div>\n <div className=\"avatar\" style={{padding:\"0px 0px 0px 10px !important\"}}>\n <img className=\"img-circle\" style={{width:\"100%\"}} src=\"/assets/img/to.jpg\" />\n </div>\n </div>\n </li>\n );\n })}\n </ul>\n <div>\n <div className=\"msj-rta macro\" style={{margin:\"auto\",width:\"100%\"}}>\n <div className=\"text text-r\" style={{background:\"whitesmoke !important\",width:\"100%\"}}>\n <form id=\"loginForm\" onSubmit={this.onSubmit.bind(this)}>\n <input ref=\"messageText\" className=\"mytext\" style={{width: \"100%\", color:\"black\"}} placeholder=\"Type a message\"/>\n {/* <button type=\"submit\" >send</button> */}\n </form>\n </div>\n </div>\n </div>\n </div>\n </div>\n :\"\"}\n </div>\n );\n }\n }", "function selectUerChatBox(element, userId, userName) {\n console.log(\"Duy dsadashdsd\" + element);\n myFriend.id = userId;\n myFriend.name = userName;\n $('#box').show();\n $('#messages').show();\n $('#onlineUsers div').removeClass('active');\n\n $('#onlineGroups div').removeClass('active');\n\n $(element).addClass('active');\n $('#notifyTyping').text('');\n $('#m').val('').focus();\n // Reset chat message count to 0\n clearChatNotificationCount(userId);\n // load all chat message for selected user \n $('#messages').html('');\n\n socket.emit(\"loadPreviousMess\", {\n sender: myUser.name,\n receiver: myFriend.name\n })\n}", "function ViewMemes() {\n navigation.navigate('ReadStorage') // navigate to ReadStorage\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}", "@track((undefined, state) => {\n return {action: `enter-attempt-to-channel: ${state.channel.name}`};\n })\n enterChannel(channel){\n\n let addNewMessage = this.props.addNewMessage;\n let updateMessage = this.props.updateMessage;\n\n sb.OpenChannel.getChannel(channel.url, (channel, error) => {\n if(error) return console.error(error);\n\n channel.enter((response, error) => {\n if(error) return console.error(error);\n\n //set app store to entered channel\n this.props.setEnteredChannel(channel);\n //fetch the current participantList to append\n this.fetchParticipantList(channel);\n //fetch 30 previous messages from channel\n this.fetchPreviousMessageList(channel);\n });\n });\n }", "function changeContainer() {\n startContainer.classList.add(\"none\");\n formContainer.classList.add(\"block\");\n\n window.watsonAssistantChatOptions = {\n integrationID: \"cd5dd492-1bba-451a-9c5b-a74e0f0efc37\", // The ID of this integration.\n region: \"us-south\", // The region your integration is hosted in.\n serviceInstanceID: \"6c7f0bcd-fc6e-4678-8cd9-2bc7fa1c6303\", // The ID of your service instance.\n onLoad: function (instance) {\n instance.render();\n }\n };\n setTimeout(function () {\n const t = document.createElement(\"script\");\n t.src =\n \"https://web-chat.global.assistant.watson.appdomain.cloud/loadWatsonAssistantChat.js\";\n document.head.appendChild(t);\n });\n clickSound.play();\n}", "function checkUser(){\n //console.log('check user started');\n cumputerTurn = false;\n if(userClicked == true){\n \n }\n}", "function Profile(props) {\n const { mainViewUser, changeView } = props;\n const { username, name, profilePicURL, interests } = mainViewUser;\n\n function handleClick(e) {\n changeView(e.target.dataset.target, mainViewUser)\n }\n\n function getViewTarget(target) {\n changeView(target, mainViewUser)\n }\n\n return (\n \n \n // <MainViewHeader getViewTarget={getViewTarget}/>\n \n <div className=\"\">\n <div className=\"\">\n <img className=\"img-thumbnail img-lg\" src={profilePicURL} />\n <h4>@{username}</h4>\n <h3>{name}</h3>\n <button data-target=\"dm\" type=\"button\" className=\"btn btn-sm btn-success\" onClick={handleClick}>slide into {username}'s DM </button>\n {/* <ul className=\"list-group\">{interests.map(interest => <button key={interest} type=\"button\" className=\"list-group-item list-group-item-action\">{interest}</button>)}</ul> */}\n </div>\n </div>\n \n );\n}", "function showUserAnswer(){\n\t\t$(\"#solution_\" + user_answer + \"_container\").css(\"background-color\", \"#730046\");\n\t\t$(\"#solution_\" + user_answer + \"_container\").css(\"color\", \"#DCDCDC\");\n\t\tif (user_type == 'host') {\n\t\t\t$(\"#reveal_answer\").fadeIn('slow');\n\t\t}\n\t}", "function actionOnContactClick () {\n\n window.location = (\"/contacts/\" + lastName)\n \n }", "function clientConnected() {\n firebaseConnect();\n $('#id, #start').hide();\n $('#disconnect').fadeIn();\n $('#status').css({\n 'color': '#5E9F21'\n }).text('CONNECTED');\n tlog('You have succussfully connected to this Twilio chat room as <strong>' + id + '</strong>.');\n if (!lmedia) {\n startConversation();\n };\n conversationInvite();\n}", "async function openChat(userTag) {\n fetch('/getFriendInfo',{\n method: 'POST',\n headers: {\n \"content-type\":\"application/json\"\n },\n body: JSON.stringify({from:localStorage.getItem('userId'),to:userTag.id})\n }).then(res=>res.json())\n .then(async data=>{\n let ul = document.getElementById(\"messageContainer\");\n ul.innerHTML = ''\n\n let {Friend,messages,User} = await data\n user = User\n friend = Friend\n \n messages.forEach(message=>{\n let ul = document.getElementById(\"messageContainer\");\n let li = document.createElement(\"li\");\n let browserUser = localStorage.getItem(\"userId\");\n let img = document.createElement(\"img\");\n \n if (browserUser === message.from) {\n li.className = \"me\";\n img.src = `images/resources/${User.profilePhotos}`;\n } else {\n li.className = \"you\";\n img.src = `images/resources/${Friend.profilePhotos}`;\n }\n let figure = document.createElement(\"figure\");\n\n let p = document.createElement(\"p\");\n p.innerHTML = message.text;\n figure.appendChild(img);\n li.appendChild(figure);\n li.appendChild(p);\n ul.appendChild(li);\n })\n \n await outputFriendHeader(Friend)\n \n })\n \n}" ]
[ "0.6197418", "0.6117911", "0.5996526", "0.590721", "0.58773685", "0.5848359", "0.5722655", "0.56414956", "0.56211436", "0.5587096", "0.5571765", "0.5542437", "0.5498132", "0.5498008", "0.54924893", "0.5484999", "0.54826796", "0.5481697", "0.54814404", "0.547902", "0.54433036", "0.54333913", "0.5412315", "0.5405626", "0.5373386", "0.53625923", "0.53589964", "0.5356966", "0.5353379", "0.5335486", "0.53299505", "0.5329038", "0.5326211", "0.5324512", "0.529644", "0.5290727", "0.52855295", "0.528461", "0.5284384", "0.5279872", "0.52791286", "0.5272289", "0.5269133", "0.52678525", "0.52667785", "0.52421", "0.5233386", "0.5229104", "0.5228949", "0.52270883", "0.5224302", "0.52224755", "0.5216752", "0.5216751", "0.5212049", "0.5211534", "0.52113885", "0.52094483", "0.52081954", "0.5200299", "0.5198761", "0.5194568", "0.51917124", "0.51916087", "0.5190519", "0.5186073", "0.518441", "0.5180066", "0.51779836", "0.51772153", "0.5174049", "0.51721406", "0.51710755", "0.51690197", "0.51667196", "0.5162215", "0.51622", "0.51622", "0.5162137", "0.51617956", "0.5158946", "0.5149924", "0.5149264", "0.51490295", "0.5137306", "0.51341194", "0.51334864", "0.51311916", "0.5128348", "0.5127245", "0.51239234", "0.5121534", "0.5113822", "0.5110485", "0.51079357", "0.51049834", "0.51024824", "0.5101676", "0.5096189", "0.50880945" ]
0.75869477
0
As a user I want to see the result of a colormez
getResult(userId, colormezId) { this.$state.go('outro'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsernameColor(){\n\t\tvar colore;\n\t\tvar nmCasuale = function (){\n\t\t\tvar j = Math.floor( Math.random() * 255);\n\t\t\treturn j;\n\t\t}\n\t\tcolore = \"rgb(\"+nmCasuale()+\",\" +nmCasuale()+ \",\" +nmCasuale()+\")\";\n\t\treturn colore;\n\t}", "function convertColor() {\n var colorEntry = document.querySelector(\".convertValue\")\n var entryValue = colorEntry.value\n m\n .request({\n method: 'PUT',\n url: `http://localhost:8001/color/handle`,\n body: {\n \"value\": entryValue\n }\n })\n //should return hex! otherwise error\n .then((response) => {\n if (response) {\n let data = response\n console.log(\"data\", data)\n\n if (response != \"Color not supported\") {\n\n document.querySelector(\".returnText\").innerHTML = `Hex value is ` + data\n let root = document.documentElement\n\n root.style.setProperty('--color', '#' + data)\n return\n }\n document.querySelector(\".returnText\").innerHTML = `Error! ` + data\n \n }\n })\n\n\n }", "function getColor() {\n\tconsole.log(\"Current color is: \" + color);\n}", "function parse_color() {\n var value = prompt(\"Enter a color value.\");\n if (! value) return;\n\n var success = current_color.parse_color(value);\n if (success) {\n update_color();\n }\n else {\n alert(\"Invalid color.\");\n }\n}", "function colorGen($usr) {\n var hexArray = GM_getValue(\"hexArrayStore\", \"\") || [];\n var tempArray = [];\n\n // Convert string to hex\n var hexStr = $usr.text();\n var result = \"\";\n for (var i=0; i<hexStr.length; i++) {\n result += hexStr.charCodeAt(i).toString(16);\n }\n\n var hexName = result.split(\"\");//Splitting each character up with \"\"s and converting to hex\n\n var adder = 1;\n $.each(hexName, function(ind,num){\n num = (parseInt(num) + 1);\n if (num !== 0 && !isNaN(num)){//math\n adder = adder * num;\n }\n });\n adder = adder.toString().replace(\".\", \"\").split(\"0\").join(\"\");\n let start = adder.length-10;\n let end = adder.length-4;\n var firstThree = adder.toString().substring(start, end);//moremath\n var amt = 60;\n\n //Will loop twice, once for light and once for dark, then escapes to Robin colors\n for (i=0;i<2;i++){\n var r = firstThree.slice(0,2);\n var g = firstThree.slice(2,4);\n var b = firstThree.slice(4,6);\n if (rowAlternator) amt+=10; // TODO: Might want to rethink this\n var randR = (Math.seededRandom(r*100,120,175));\n var randG = (Math.seededRandom(g*100,120,175));\n var randB = (Math.seededRandom(b*100,120,175));\n // This is the randomizer, not much to know about this. Buncha math\n var suppress = (Math.seededRandom(firstThree*r*10,0,6));\n var modAmt =2 ;\n switch(suppress) {\n case 0:\n randR/=modAmt;\n break;\n case 1:\n randG/=modAmt;\n break;\n case 2:\n randB/=modAmt;\n break;\n case 4:\n randR/=modAmt;\n randG/=modAmt;\n break;\n case 5:\n randR/=modAmt;\n randB/=modAmt;\n break;\n case 6:\n randG/=modAmt;\n randB/=modAmt;\n break;\n default:\n break;\n }\n var hexR = (parseInt(randR) + parseInt(amt)).toString(16);\n var hexG = (parseInt(randG) + parseInt(amt)).toString(16);\n var hexB = (parseInt(randB) + parseInt(amt)).toString(16);\n amt=-40;\n tempArray.push(hexR + hexG + hexB); //pushing the 6 character string to a temporary array, one for light, one for dark\n }\n\n //Robin Colors\n var colors = [\"e50000\", \"db8e00\", \"ccc100\", \"02be01\", \"0083c7\", \"820080\"];\n var e = $usr.text().toLowerCase(),\n t = e.replace(/[^a-z0-9]/g, \"\"),\n n = parseInt(t, 36) % 6;\n\n //Cascading array used to add color schemes to master hex array on a 1:1 user:colorset basis\n //AKA, arrays within an array (multidimensional array)\n tempArray.push(colors[n]);\n hexArray.push(tempArray);\n //console.log(hexArray);\n GM_setValue(\"hexArrayStore\", hexArray); //Store array in scriptmonkey settings for later access\n }", "function analyzeColor(input) {\n var message;\n\n switch(input) {\n case \"red\":\n message = \"Roses are red\";\n break;\n case \"orange\":\n message = \"Orange you glad I didn't say banana\";\n break;\n case \"yellow\":\n message = \"Gold is yellow, sorta\";\n break;\n case \"green\":\n message = \"Grass is green\";\n break;\n case \"blue\":\n message = \"Blue is the color of the sky.\";\n break;\n case \"violet\":\n message = \"Violets are violet\";\n break;\n case \"indigo\":\n message = \"Jeans are indigo\";\n break;\n default:\n message = \"I don't know anything about the color \" + input;\n break;\n }\n\n return message;\n}", "function readColor(){\n var color=$('div#output1').css(\"background-color\");\n\tvar patt=/([0-9]+), ([0-9]+), ([0-9]+)/;\n\tcolor=patt.exec(color);\n\tred=Number(color[1]);\n\tgreen=Number(color[2]);\n\tblue=Number(color[3]);\n\t//read others\n\thsv=rgbToHsv(red,green,blue);\n\thsl=rgbToHsl(red,green,blue);\n\tcmyk=rgbToCmyk(red,green,blue);\n\t}", "function getTypedInColor()\n{\n const color = colorChangerInput.value.toLowerCase()\n clearCurrentColor()\n if (!isColor(color))\n {\n alert('That\\'s not a valid color')\n return\n }\n currentColorDescription.textContent = `You are coloring in ${color}!`\n currentColorDescription.style.cssText = `color : ${color}; border: 4px ${color} solid`\n drawOnGrid(gridItems, color)\n}", "get colorValue() {}", "function chcolor(input)\n{\n document.body.style.color = input; \n}", "function color(magnitude){\n\n if (magnitude > 5){\n return 'red'\n } else if (magnitude > 4){\n return 'orange'\n } else if (magnitude > 3){\n return 'yellow'\n } else if (magnitude > 2){\n return 'green'\n } else if (magnitude > 1){\n return 'lightblue'\n } else {\n return 'purple'\n }\n }", "async function rankcolor(data) {\n\tif (data.chat_admin === \"1\") {\n\t return \"0xFF0000\"; //if player is admin, return red\n\t} else if (data.chat_moderator === \"2\") {\n\t return \"0x3498DB\"; //^but headmoderator dark blue\n\t} else if (data.chat_moderator === \"1\") {\n\t return \"0x00F5FF\"; //moderator\n\t} else if (data.multiplayer_moderator === \"1\") {\n\t return \"0x26FF00\";//pretty sure i never figured out if this is trial staff or support. look into.\n\t} else { //XXX ADD DB QUERY TO SEE IF VERIFIED USER LATER??? XXX\n\t\treturn \"0xF1C40F\"; //Unknown User\n\t };\n\t}", "function getUsernameColor(userName) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < userName.length; i++) {\n hash = userName.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n}", "function getUsernameColor (username) {\r\n // Compute hash code\r\n var hash = 7;\r\n for (var i = 0; i < username.length; i++) {\r\n hash = username.charCodeAt(i) + (hash << 5) - hash;\r\n }\r\n // Calculate color\r\n var index = Math.abs(hash % COLORS.length);\r\n return COLORS[index];\r\n}", "function colorPreview() {\r\n\t\t\t//récupération de la case \"aperçu\" à colorier et remplissage avec la couleur en cours\r\n\t \t$preview = $('#preview');\t\r\n\t\t\tvar previewCtx = $preview[0].getContext(\"2d\");\r\n\t\t previewCtx.fillStyle = color;\r\n\t\t previewCtx.fillRect(0, 0, 30.000, 30.000);\r\n\t\t}", "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "function c(type,data,color){\n if(data!==undefined){\n if(color !== undefined){\n // logs the type in color then the text as the default color ex: type: [SERVER]\n switch(color){\n case \"red\":\n console.log(clc.red(type) + \" \" + data);\n break;\n case \"green\":\n console.log(clc.greenBright(type) + \" \" + data);\n break;\n case \"blue\":\n console.log(clc.blueBright(type) + \" \" + data);\n break;\n case \"yellow\":\n console.log(clc.yellowBright(type) + \" \" + data);\n break;\n case \"cyan\":\n console.log(clc.cyanBright(type) + \" \" + data);\n break; \n case \"white\":\n console.log(clc.cyanBright(type) + \" \" + data);\n break; \n case \"purple\":\n console.log(clc.magentaBright(type) + \" \" + data);\n break; \n default:\n break; \n }\n }else{\n console.log(\"one of the c() logs are missing the color...\")\n console.log(\"The text is : \" + data)\n }\n }else{\n console.log(\" \");\n }\n}", "function updateColor(color) {\n var hexColor = \"transparent\";\n if (color) {\n hexColor = color.toHexString();\n }\n $('.background').css('background-color', hexColor);\n\n $('.ratio').each( function (i) {\n $(this).html(contrastRatio(colors[i], hexColor));\n });\n\n $('.pass').each( function (i) {\n $(this).html(isPassing(contrastRatio(colors[i], hexColor)));\n });\n }", "function getUsernameColor (username) {\n\t// Compute hash code\n\tvar hash = 7;\n\tfor (var i = 0; i < username.length; i++) {\n\t\thash = username.charCodeAt(i) + (hash << 5) - hash;\n\t}\n\t// Calculate color\n\tvar index = Math.abs(hash % COLORS.length);\n\treturn COLORS[index];\n}", "function getUsernameColor(username) {\n // Compute hash code\n var hash = 7\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length)\n return COLORS[index]\n}", "function promptRGB() {\n let colorsIndex = Math.floor(Math.random() * colors.length);\n rgbCode.textContent = colors[colorsIndex];\n pickedColor = colors[colorsIndex];\n return;\n}", "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length)\n return COLORS[index]\n }", "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % TEXTCOLORS.length);\n return TEXTCOLORS[index];\n }", "get color() {}", "function color() {\n\tvar alpha = 0,\n\t\t s = 1,\n\t\t v = 1,\n\t\t c, h, x, r1, g1, b1, m,\n\t\t red, blue, green;\n\thue %= 360;\n\th = hue / 60;\n\tif (hue < 0) {\n\t hue += 360;\n\t}\n\tc = v * s;\n\th = hue / 60;\n\tx = c * (1 - Math.abs(h % 2 - 1));\n\tm = v - c;\n\tswitch (Math.floor(h)) {\n\t\tcase 0: r1 = c; g1 = x; b1 = 0; break;\n\t\tcase 1: r1 = x; g1 = c; b1 = 0; break;\n\t\tcase 2: r1 = 0; g1 = c; b1 = x; break;\n\t\t/*case 3: r1 = 0; g1 = x; b1 = c; break;\n\t\tcase 4: r1 = x; g1 = 0; b1 = c; break;\n\t\tcase 5: r1 = c; g1 = 0; b1 = x; break;*/\n\t}\n\tred = Math.floor((r1 + m) * 255);\n\tgreen = Math.floor((g1 + m) * 255);\n\tblue = Math.floor((b1 + m) * 255);\n\n // $(\".flashing-banner\").css('backgroundColor', 'rgba(' + red + ',' + green + ',' + blue + ',' + 1 + ')'); // commented on 21.10.17\n hue++;\n}", "function functionDelegator() {\n colorCalc();\n showColors();\n displayHex();\n displayRGB();\n displayHSL();\n}", "function eleccion_color(){\r\n\r\n }", "function getUsernameColor (username) {\n\t\t\t// Compute hash code\n\t\t\tvar hash = 7;\n\t\t\tfor (var i = 0; i < username.length; i++) {\n\t\t\t\thash = username.charCodeAt(i) + (hash << 5) - hash;\n\t\t\t}\n\t\t\t// Calculate color\n\t\t\tvar index = Math.abs(hash % COLORS.length);\n\t\t\treturn COLORS[index];\n\t\t}", "printSolution( color ) {\n\n console.log(\"Solution Exists: Following are the assigned colors\");\n let str = \"\";\n for (let i = 0; i < this.v; i++) {\n str += color[i] + \" \";\n }\n console.log(str);\n }", "function setHexColor(colorName) {\n http.get(encodeURI(`https://www.colorhexa.com/color.php?c=${colorName}`), (res) => {\n const { statusCode } = res;\n const contentType = res.headers['content-type'];\n\n let error;\n if (statusCode !== 200) {\n error = new Error('Request Failed.\\n' + `Status Code: ${statusCode}`);\n }\n if (error) {\n console.error(error.message);\n res.resume();\n return;\n }\n\n res.setEncoding('utf8');\n let rawData = '';\n res.on('data', (chunk) => { rawData += chunk; });\n res.on('end', () => {\n try {\n // An incredibly fragile way to yoinketh the\n // hex color value from the page returned by colorhexa.com\n let hexColor = rawData.match(/hex [#]([0-9a-fA-F]+)/)\n pushMessage(hexColor[1])\n } catch (e) {\n console.error(e.message);\n }\n });\n }).on('error', (e) => {\n console.error(`Got error: ${e.message}`);\n }); \n}", "function getUsernameColor(username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "function getUsernameColor(username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "function getUsernameColor (username) {\n // Compute hash code\n var hash = 7;\n for (var i = 0; i < username.length; i++) {\n hash = username.charCodeAt(i) + (hash << 5) - hash;\n }\n // Calculate color\n var index = Math.abs(hash % COLORS.length);\n return COLORS[index];\n }", "function colorForCurrent(){\n\n}", "function color(){\r\n cl = prompt(\"Please enter the name of the colour you want your pen to be. (if hex precede with '#')\");\r\n black = false;\r\n}", "function colorScreen(color){\n var doc = document.getElementById(\"plate\");\n var context = dc.getContext(\"2d\");\n context.fillStyle = numsToRGBHex(color);\n context.fillRect(50,50,50,50);\n}", "function color() {\n var map = {\n \"black\" : [ 0/255,0/255,0/255 ],\n \"silver\": [ 192/255,192/255,192/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"maroon\": [ 128/255,0/255,0/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"purple\": [ 128/255,0/255,128/255 ],\n \"fuchsia\": [ 255/255,0/255,255/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"yellow\": [ 255/255,255/255,0/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aliceblue\" : [ 240/255,248/255,255/255 ],\n \"antiquewhite\" : [ 250/255,235/255,215/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aquamarine\" : [ 127/255,255/255,212/255 ],\n \"azure\" : [ 240/255,255/255,255/255 ],\n \"beige\" : [ 245/255,245/255,220/255 ],\n \"bisque\" : [ 255/255,228/255,196/255 ],\n \"black\" : [ 0/255,0/255,0/255 ],\n \"blanchedalmond\" : [ 255/255,235/255,205/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"blueviolet\" : [ 138/255,43/255,226/255 ],\n \"brown\" : [ 165/255,42/255,42/255 ],\n \"burlywood\" : [ 222/255,184/255,135/255 ],\n \"cadetblue\" : [ 95/255,158/255,160/255 ],\n \"chartreuse\" : [ 127/255,255/255,0/255 ],\n \"chocolate\" : [ 210/255,105/255,30/255 ],\n \"coral\" : [ 255/255,127/255,80/255 ],\n \"cornflowerblue\" : [ 100/255,149/255,237/255 ],\n \"cornsilk\" : [ 255/255,248/255,220/255 ],\n \"crimson\" : [ 220/255,20/255,60/255 ],\n \"cyan\" : [ 0/255,255/255,255/255 ],\n \"darkblue\" : [ 0/255,0/255,139/255 ],\n \"darkcyan\" : [ 0/255,139/255,139/255 ],\n \"darkgoldenrod\" : [ 184/255,134/255,11/255 ],\n \"darkgray\" : [ 169/255,169/255,169/255 ],\n \"darkgreen\" : [ 0/255,100/255,0/255 ],\n \"darkgrey\" : [ 169/255,169/255,169/255 ],\n \"darkkhaki\" : [ 189/255,183/255,107/255 ],\n \"darkmagenta\" : [ 139/255,0/255,139/255 ],\n \"darkolivegreen\" : [ 85/255,107/255,47/255 ],\n \"darkorange\" : [ 255/255,140/255,0/255 ],\n \"darkorchid\" : [ 153/255,50/255,204/255 ],\n \"darkred\" : [ 139/255,0/255,0/255 ],\n \"darksalmon\" : [ 233/255,150/255,122/255 ],\n \"darkseagreen\" : [ 143/255,188/255,143/255 ],\n \"darkslateblue\" : [ 72/255,61/255,139/255 ],\n \"darkslategray\" : [ 47/255,79/255,79/255 ],\n \"darkslategrey\" : [ 47/255,79/255,79/255 ],\n \"darkturquoise\" : [ 0/255,206/255,209/255 ],\n \"darkviolet\" : [ 148/255,0/255,211/255 ],\n \"deeppink\" : [ 255/255,20/255,147/255 ],\n \"deepskyblue\" : [ 0/255,191/255,255/255 ],\n \"dimgray\" : [ 105/255,105/255,105/255 ],\n \"dimgrey\" : [ 105/255,105/255,105/255 ],\n \"dodgerblue\" : [ 30/255,144/255,255/255 ],\n \"firebrick\" : [ 178/255,34/255,34/255 ],\n \"floralwhite\" : [ 255/255,250/255,240/255 ],\n \"forestgreen\" : [ 34/255,139/255,34/255 ],\n \"fuchsia\" : [ 255/255,0/255,255/255 ],\n \"gainsboro\" : [ 220/255,220/255,220/255 ],\n \"ghostwhite\" : [ 248/255,248/255,255/255 ],\n \"gold\" : [ 255/255,215/255,0/255 ],\n \"goldenrod\" : [ 218/255,165/255,32/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"greenyellow\" : [ 173/255,255/255,47/255 ],\n \"grey\" : [ 128/255,128/255,128/255 ],\n \"honeydew\" : [ 240/255,255/255,240/255 ],\n \"hotpink\" : [ 255/255,105/255,180/255 ],\n \"indianred\" : [ 205/255,92/255,92/255 ],\n \"indigo\" : [ 75/255,0/255,130/255 ],\n \"ivory\" : [ 255/255,255/255,240/255 ],\n \"khaki\" : [ 240/255,230/255,140/255 ],\n \"lavender\" : [ 230/255,230/255,250/255 ],\n \"lavenderblush\" : [ 255/255,240/255,245/255 ],\n \"lawngreen\" : [ 124/255,252/255,0/255 ],\n \"lemonchiffon\" : [ 255/255,250/255,205/255 ],\n \"lightblue\" : [ 173/255,216/255,230/255 ],\n \"lightcoral\" : [ 240/255,128/255,128/255 ],\n \"lightcyan\" : [ 224/255,255/255,255/255 ],\n \"lightgoldenrodyellow\" : [ 250/255,250/255,210/255 ],\n \"lightgray\" : [ 211/255,211/255,211/255 ],\n \"lightgreen\" : [ 144/255,238/255,144/255 ],\n \"lightgrey\" : [ 211/255,211/255,211/255 ],\n \"lightpink\" : [ 255/255,182/255,193/255 ],\n \"lightsalmon\" : [ 255/255,160/255,122/255 ],\n \"lightseagreen\" : [ 32/255,178/255,170/255 ],\n \"lightskyblue\" : [ 135/255,206/255,250/255 ],\n \"lightslategray\" : [ 119/255,136/255,153/255 ],\n \"lightslategrey\" : [ 119/255,136/255,153/255 ],\n \"lightsteelblue\" : [ 176/255,196/255,222/255 ],\n \"lightyellow\" : [ 255/255,255/255,224/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"limegreen\" : [ 50/255,205/255,50/255 ],\n \"linen\" : [ 250/255,240/255,230/255 ],\n \"magenta\" : [ 255/255,0/255,255/255 ],\n \"maroon\" : [ 128/255,0/255,0/255 ],\n \"mediumaquamarine\" : [ 102/255,205/255,170/255 ],\n \"mediumblue\" : [ 0/255,0/255,205/255 ],\n \"mediumorchid\" : [ 186/255,85/255,211/255 ],\n \"mediumpurple\" : [ 147/255,112/255,219/255 ],\n \"mediumseagreen\" : [ 60/255,179/255,113/255 ],\n \"mediumslateblue\" : [ 123/255,104/255,238/255 ],\n \"mediumspringgreen\" : [ 0/255,250/255,154/255 ],\n \"mediumturquoise\" : [ 72/255,209/255,204/255 ],\n \"mediumvioletred\" : [ 199/255,21/255,133/255 ],\n \"midnightblue\" : [ 25/255,25/255,112/255 ],\n \"mintcream\" : [ 245/255,255/255,250/255 ],\n \"mistyrose\" : [ 255/255,228/255,225/255 ],\n \"moccasin\" : [ 255/255,228/255,181/255 ],\n \"navajowhite\" : [ 255/255,222/255,173/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"oldlace\" : [ 253/255,245/255,230/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"olivedrab\" : [ 107/255,142/255,35/255 ],\n \"orange\" : [ 255/255,165/255,0/255 ],\n \"orangered\" : [ 255/255,69/255,0/255 ],\n \"orchid\" : [ 218/255,112/255,214/255 ],\n \"palegoldenrod\" : [ 238/255,232/255,170/255 ],\n \"palegreen\" : [ 152/255,251/255,152/255 ],\n \"paleturquoise\" : [ 175/255,238/255,238/255 ],\n \"palevioletred\" : [ 219/255,112/255,147/255 ],\n \"papayawhip\" : [ 255/255,239/255,213/255 ],\n \"peachpuff\" : [ 255/255,218/255,185/255 ],\n \"peru\" : [ 205/255,133/255,63/255 ],\n \"pink\" : [ 255/255,192/255,203/255 ],\n \"plum\" : [ 221/255,160/255,221/255 ],\n \"powderblue\" : [ 176/255,224/255,230/255 ],\n \"purple\" : [ 128/255,0/255,128/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"rosybrown\" : [ 188/255,143/255,143/255 ],\n \"royalblue\" : [ 65/255,105/255,225/255 ],\n \"saddlebrown\" : [ 139/255,69/255,19/255 ],\n \"salmon\" : [ 250/255,128/255,114/255 ],\n \"sandybrown\" : [ 244/255,164/255,96/255 ],\n \"seagreen\" : [ 46/255,139/255,87/255 ],\n \"seashell\" : [ 255/255,245/255,238/255 ],\n \"sienna\" : [ 160/255,82/255,45/255 ],\n \"silver\" : [ 192/255,192/255,192/255 ],\n \"skyblue\" : [ 135/255,206/255,235/255 ],\n \"slateblue\" : [ 106/255,90/255,205/255 ],\n \"slategray\" : [ 112/255,128/255,144/255 ],\n \"slategrey\" : [ 112/255,128/255,144/255 ],\n \"snow\" : [ 255/255,250/255,250/255 ],\n \"springgreen\" : [ 0/255,255/255,127/255 ],\n \"steelblue\" : [ 70/255,130/255,180/255 ],\n \"tan\" : [ 210/255,180/255,140/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"thistle\" : [ 216/255,191/255,216/255 ],\n \"tomato\" : [ 255/255,99/255,71/255 ],\n \"turquoise\" : [ 64/255,224/255,208/255 ],\n \"violet\" : [ 238/255,130/255,238/255 ],\n \"wheat\" : [ 245/255,222/255,179/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"whitesmoke\" : [ 245/255,245/255,245/255 ],\n \"yellow\" : [ 255/255,255/255,0/255 ],\n \"yellowgreen\" : [ 154/255,205/255,50/255 ] };\n\n var o, i = 1, a = arguments, c = a[0], alpha;\n\n if(a[0].length<4 && (a[i]*1-0)==a[i]) { alpha = a[i++]; } // first argument rgb (no a), and next one is numeric?\n if(a[i].length) { a = a[i], i = 0; } // next arg an array, make it our main array to walk through\n if(typeof c == 'string')\n c = map[c.toLowerCase()];\n if(alpha!==undefined)\n c = c.concat(alpha);\n for(o=a[i++]; i<a.length; i++) {\n o = o.union(a[i]);\n }\n return o.setColor(c);\n}", "function sky() {\n echo(\"The sky is \" + colour);\n }", "function getcolor(c) {\n if(c == \"naranja\") return '#FCAF00'; else\n if (c == \"tradicional\") return '#3FDAD6';\n\tif (c == \"aliado\") return '#FE52D4';\n }", "function getValue(){\r\n\r\n // tanking the values of red , blue , green and alpha.\r\n\r\n let Red = document.getElementById(\"red\").value;\r\n // console.log(Red);\r\n let Green = document.getElementById(\"green\").value;\r\n // console.log(Green);\r\n let Blue = document.getElementById(\"blue\").value;\r\n // console.log(Blue);\r\n let Alpha = document.getElementById(\"alpha\").value;\r\n // console.log(Alpha);\r\n\r\n // Adding style on bankgroung and input in pniut box\r\n\r\n getBody.style.background = `rgba(${Red},${Green},${Blue},${Alpha}) `;\r\n outputBox.innerHTML = `rgba(${Red},${Green},${Blue},${Alpha})`;\r\n}", "function show(){\n output = \"#\"+red+green+blue;\n hex.innerHTML = output;\n display.style.backgroundColor = output;\n}", "function showColors() {\n for (let i = 0; i < colorCalc().length; i++) {\n const rgbValue = hslToRGB(colorCalc()[i]);\n const hexValue = rgbToHex(rgbValue);\n document.getElementsByClassName(\"colorvisual\")[\n i\n ].style.backgroundColor = hexValue;\n }\n}", "get color() {\n\n\t}", "getColorFor(username) {\n let name = `${username}`;\n if (typeof(username) !== \"string\") {\n let arg_msg = `${typeof(username)}, ${JSON.stringify(username)}`;\n Util.Error(`Expected string, got ${arg_msg}`);\n }\n if (!this._userColors.hasOwnProperty(name)) {\n /* Taken from Twitch vendor javascript */\n let r = 0;\n for (let i = 0; i < name.length; ++i) {\n r = (r << 5) - r + name.charCodeAt(i);\n }\n r = r % this._defaultColors.length;\n if (r < 0) r += this._defaultColors.length;\n this._userColors[name] = this._defaultColors[r];\n }\n return this._userColors[name];\n }", "function displayRGB() {\n for (let i = 0; i < colorCalc().length; i++) {\n const rgbValue = hslToRGB(colorCalc()[i]);\n console.log(rgbValue);\n document.getElementsByClassName(\"rgbspan\")[i].textContent =\n rgbValue.r + \", \" + rgbValue.g + \", \" + rgbValue.b;\n }\n}", "function getColor(name) {\n\n\t\t//find the covid data for that county\n\t\t//covid_cases = ;\n\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: \"/shading/\",\n\t\t\tdata: {data: name}\n\t\t }).done(function( o ) {\n\t\t\t//were done;\n\t\t });\n\t\t\n\t\t /*\n\t\tvar order = document.getElementById({county_cases}).value;\n\t\t\n\t\tconsole.log();\n\t\t */\n\t\treturn covid_cases > 30000 ? 'red' :\n\t\t\t\tcovid_cases > 10000 ? '#BD0026' :\n\t\t\t\tcovid_cases > 5000 ? '#E31A1C' :\n\t\t\t\tcovid_cases > 1000 ? '#FC4E2A' :\n\t\t\t\tcovid_cases > 500 ? '#FD8D3C' :\n\t\t\t\tcovid_cases > 100 ? '#FEB24C' :\n\t\t\t\tcovid_cases > 10 ? '#FED976' :\n\t\t\t\t\t\t\t\t\t\t 'white';\n\t}", "function colorCar (color){\n\nconsole.log(\"a \" + color + \" car\")\n\n\n}", "function colorDemo() {\n\tif (systemState != \"demo\") {\n\t\t//no more\n\t\treturn;\n\t}\n\n\tfor (var id in hue) {\n\t\tvar payload = {\n\t\t\ton : true,\n\t\t\tbri: 255,\n\t\t\thue: hueValue,\n\t\t\tsat: 255\n\t\t};\n\t\t//console.log(JSON.stringify(payload))\n\t\tif (!put('/api/loganrooper/lights/'+hue[id]+'/state', payload)) {\n\t\t\t//errors\n\t\t\tconsole.log('connection to hue has errors');\n\t\t}\n\t}\n\thueValue += 3000*n;\n\tif (hueValue > 65535 || hueValue < 1) {\n\t\tn *= -1;\n\t}\n\n}", "function getColor(magnitude) {\r\n //Condtionals for magnitude \r\n if (magnitude >= 5) {\r\n return \"red\";\r\n }\r\n else if (magnitude >= 4){\r\n return \"peru\";\r\n }\r\n else if (magnitude >= 3) {\r\n return \"darkorange\";\r\n }\r\n else if (magnitude >= 2) {\r\n return \"yellow\";\r\n }\r\n else if (magnitude >= 1) {\r\n return \"yellowgreen\";\r\n }\r\n else {\r\n return \"green\";\r\n }\r\n}", "function enteredColor(r, g, b){\n document.getElementById('entered').textContent = 'R: '+r+' G: '+g+' B: '+b;\n document.getElementById('result').style.borderBottomColor = '#000';\n }", "function getNewAiColor() {\n\tvar digit = getRandomColorDigit();\n\t\n\n\tvar oneHotVector = net.run(digit).map(function (score) {\n\t\treturn score.toFixed(4); // cull to 4 decimal places\n\t});\n\n $('.guess-ai').text(getLargestValueInIndex(oneHotVector));\n\t$('.mnist-one-hot-vector').text('[ ' + oneHotVector.join(' , ') + ' ]');\n}", "function tastetherainbow(msg){\n\n\t// Building the request to colourlovers\n\trequest('http://www.colourlovers.com/api/colors/random?format=json', function (error, response, body){\n\n\t\t// If there are no errors from the response parse the JSON\n\t\tif (!error && response.statusCode < 300){\n\t\t\tvar colorData = JSON.parse(response.body),\n\n\t\t\t\t// Get the name of the Color\n\t\t\t\tcolorName = colorData[0].title;\n\n\t\t\t\t// Grab the color image returned from the response\n\t\t\t\tcolorCard = colorData[0].imageUrl;\n\t\t\t\n\t\t\t// Display the color name \n\t\t\tmsg.send(\"Your color name is: \" + colorName.toUpperCase());\n\n\t\t\t// Output the color image\n\t\t\tmsg.send(colorCard);\n\n\t\t}else{\n\n\t\t\t// If there was an error in the request rensponse tell the user something evil is lurking and they need to retry\n\t\t\tmsg.send(\"Yuck!!! That rainbow was nasty... Try running that again\");\n\t\t}\n\t});\n}", "function color(input)\n{\n var operands = input.split(\" \");\n if (operands[0] == operands[1]) return;\n\tif (operands[0] == operands[2]) return;\n if (operands.length > 3) return;\n\tif (operands.length < 2) return;\n else{\n chcolor(operands[0]);\n bkcolor(operands[1]);\n\t\tolcolor(operands[2]);\n }\n}", "function colour(v,type){\n\n\t\t// Colour scales defined by SAOImage\n\t\tif(type==\"blackbody\" || type==\"heat\") return [((v<=127.5) ? v*2 : 255), ((v>63.75) ? ((v<191.25) ? (v-63.75)*2 : 255) : 0), ((v>127.5) ? (v-127.5)*2 : 0)];\n\t\telse if(type==\"A\") return [((v<=63.75) ? 0 : ((v<=127.5) ? (v-63.75)*4 : 255)), ((v<=63.75) ? v*4 : ((v<=127.5) ? (127.5-v)*4 : ((v<191.25) ? 0: (v-191.25)*4))), ((v<31.875) ? 0 : ((v<127.5) ? (v-31.875)*8/3 : ((v < 191.25) ? (191.25-v)*4 : 0)))];\n\t\telse if(type==\"B\") return [((v<=63.75) ? 0 : ((v<=127.5) ? (v-63.75)*4 : 255)), ((v<=127.5) ? 0 : ((v<=191.25) ? (v-127.5)*4 : 255)), ((v<63.75) ? v*4 : ((v<127.5) ? (127.5-v)*4 : ((v<191.25) ? 0 : (v-191.25)*4 ))) ];\n\t\telse{\n\t\t\t// The Planck colour scheme\n\t\t\tvar dv,dr,dg,db,rgb;\n\t\t\t\n\t\t\tif(v < 42){\n\t\t\t\tdv = v/42;\n\t\t\t\trgb = [0,0,255];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = 112;\n\t\t\t\tdb = 0;\n\t\t\t}else if(v >= 42 && v < 85){\n\t\t\t\tdv = (v - 42)/43;\n\t\t\t\trgb = [0,112,255];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = 109;\n\t\t\t\tdb = 0;\n\t\t\t}else if(v >= 85 && v < 127){\n\t\t\t\tdv = (v - 85)/42;\n\t\t\t\trgb = [0,221,255];\n\t\t\t\tdr = 255;\n\t\t\t\tdg = 16;\n\t\t\t\tdb = -38;\n\t\t\t}else if(v >= 127 && v < 170){\n\t\t\t\tdv = (v - 127)/43;\n\t\t\t\trgb = [255,237,217];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = -57;\n\t\t\t\tdb = -217;\n\t\t\t}else if(v >= 170 && v < 212){\n\t\t\t\tdv = (v-170)/42;\n\t\t\t\trgb = [255,180,0];\n\t\t\t\tdr = 0;\n\t\t\t\tdg = -105;\n\t\t\t\tdb = 0;\n\t\t\t}else if(v >= 212){\n\t\t\t\tdv = (v-212)/43;\n\t\t\t\trgb = [255,75,0];\n\t\t\t\tdr = -155;\n\t\t\t\tdg = -75;\n\t\t\t\tdb = 0;\n\t\t\t}\n\t\t\treturn [Math.round(rgb[0] + dv*dr), Math.round(rgb[1] + dv*dg), Math.round(rgb[2] + dv*db)];\n\t\t}\n\t}", "function voterOutput(){\r\n var outstring = \"Voter Model with \" + colorNumber + \" colors.\";\r\n // \" for \" + turn_max + \" times\"\r\n return outstring;\r\n}", "function wallColorizer() {\n return 'rgb(150,150,150)';\n}", "get healthyColor() {}", "function Colorir(cor) {\n//transform.renderer.material.color = Color(.1, .9, .9, 1);\n\t\n\t\n\t//print(transform.renderer);\n\tif (transform.renderer.material) {\n\t\tif (cor == \"OriginalColor\") {\n\t\t\ttransform.renderer.material.color = originalColor;\n\t\t}\n\t\t\n\t\tif (cor == \"Slow\") {\n\t\t\ttransform.renderer.material.color = Color.cyan;\n\t\t}\n\t\t\n\t\tif (cor == \"Haste\") {\n\t\t\ttransform.renderer.material.color = Color.yellow;\n\t\t}\n\t\t\n\t\tif (cor == \"TravaArma\") {\n\t\t\ttransform.renderer.material.color = Color.green;\n\t\t}\n\t\t\n\t\tif (cor == \"TravaDirecao\") {\n\t\t\ttransform.renderer.material.color = Color.magenta;\n\t\t}\n\t\t\n\t\tif (cor == \"Confusao\") {\n\t\t\ttransform.renderer.material.color = Color.black;\n\t\t}\n\t\t\n\t\t// Cor do heavy e hyperArmor\n\t\tif (cor == \"Danificado\") {\n\t\t\ttransform.renderer.material.color = Color.red;\n\t\t}\n\t}\n}", "function getColor(magnitude) {\r\n if (magnitude > 5) {\r\n return \"#ea2c2c\";\r\n }\r\n if (magnitude > 4) {\r\n return \"#ea822c\";\r\n }\r\n if (magnitude > 3) {\r\n return \"#ee9c00\";\r\n }\r\n if (magnitude > 2) {\r\n return \"#eecc00\";\r\n }\r\n if (magnitude > 1) {\r\n return \"#d4ee00\";\r\n }\r\n return \"#98ee00\";\r\n}", "function answer(){\n let random = Math.floor(Math.random() * colors.length);\n return colors[random];\n }", "function generateHex(){\n \n //Chroma library used here to use its random function of the chroma class \n const ranColor = chroma.random();\n\n return ranColor;\n}", "redder(){\n\t\tthis.multiplyColorValue(\"red\", 1.2);\n\t}", "function colorAnalyzer(color) {\n switch (color) {\n case \"red\":\n return color + \" \" + \"is Danger\";\n case \"blue\":\n return color + \" \" + \" is Peace\";\n case \"green\":\n return color + \" \" + \" is Nature\";\n case \"yellow\":\n return color + \" \" + \"is Warning\";\n default:\n return color + \" \" + \" is Error case\";\n }\n}", "async ColorChanger(name) {\n var colore = null\n var colorCur = $(name).spectrum(\"get\");\n if (typeof colorCur.toHex !== \"undefined\") {\n colore = colorCur.toHex();\n }\n\n $(\"name\").spectrum(\"destroy\");\n $(name).spectrum({\n color: colore,\n type: \"component\",\n showPalette: false,\n disabled: true,\n showButtons: false,\n allowEmpty: false,\n showAlpha: false\n\n });\n if (colore == null) {\n this.scene.traverse((child) => {\n if (child.isMesh && child.name == \"Struttura\") {\n $(name).spectrum(\"set\", child.material.color.getHexString());\n }\n });\n }\n\n\n $(name).off(\"dragstop.spectrum\");\n\n\n $(name).on(\"dragstop.spectrum\",(e, color) => {\n this.scene.traverse((child) => {\n if (child.isMesh && child.name == \"Struttura\") {\n child.material.color.setHex(\"0x\" + color.toHexString().substring(1));\n }\n\n });\n });\n\n if (colore != null) {\n $(name).trigger(\"dragstop.spectrum\", [colorCur])\n }\n\n $(name).spectrum(\"enable\");\n }", "function showOutput() {\n const color = rgbArr.join('')\n outputRGBPanel.textContent = `#${color}`\n rangeContainer.style.backgroundColor = `#${color}`\n}", "color(value) {\n\n //Check if it's a number\n if(!isNaN(value)){\n\n //Yes, it is a number, so just return it\n return value;\n }\n\n //No it's not a number, so it must be a string \n else {\n\n return parseInt(this.colorToHex(value));\n /*\n\n //Find out what kind of color string it is.\n //Let's first grab the first character of the string\n let firstCharacter = value.charAt(0);\n\n //If the first character is a \"#\" or a number, then\n //we know it must be a RGBA color\n if (firstCharacter === \"#\") {\n console.log(\"first character: \" + value.charAt(0))\n }\n */\n }\n \n /*\n //Find out if the first character in the string is a number\n if (!isNaN(parseInt(string.charAt(0)))) {\n \n //It's not, so convert it to a hex code\n return colorToHex(string);\n \n //The use input a number, so it must be a hex code. Just return it\n } else {\n \n return string;\n }\n \n */\n\n }", "function calculateAndApplyColor(i,j){\n var result = tab[i][j];\n var color1 = \"grey\";\n var color2 = \"lightblue\";\n var color3 = \"blue\";\n var color4 = \"rgb(138,3,3)\";\n \n if( tab[i][j] === undefined){\n score++;\n result = 1;\n ctx.fillStyle = color1;\n $('#container').css('z-index','1');\n }\n \n else if( tab[i][j] === 1){\n score++;\n result = 2;\n ctx.fillStyle = color2;\n $('#container').css('z-index','1');\n }\n else if(tab[i][j] === 4){\n score++;\n result = 4;\n ctx.fillStyle = color4;\n life--;\n $('#container').css('z-index','3');\n setTimeout(function(){\n setInterval(function(){\n \n $('#container').show();\n \n },100)\n \n $('#container').hide();\n },300)\n if(life == 0){\n looseWindow();\n }\n }\n\n else{\n result = 3;\n if(tab[i][j] != 3){\n score++;\n }\n ctx.fillStyle = color3;\n $('#container').css('z-index','1');\n } \n \n var k = parseFloat(masque.style.left) - 777;\n var v = parseFloat(masque.style.top) - 375;\n ctx.fillRect(k,v,29,29);\n \n return result;\n }", "function textoColor(){\n var ingresaColor = prompt(\"Ingresa el codigo de color o nombre en inglés: \\n ej. white o #ffffff\");\n document.getElementById('previoComentario').style.color = ingresaColor;\n}", "function getColor() {\n const color = inquirer.prompt({\n type: \"list\",\n message: \"What is your favorite color?\",\n name: \"color\",\n choices: [\"Green\", \"Blue\", \"Pink\", \"Red\"]\n });\n return color\n}", "function myColor() {\n console.log( `Hello! I am ${this.color} in colo(u)r.`); \n}", "function printColorScheme(colors){\n console.log(`Image is in ${colors.isBwImg ? 'black and white' : 'color'}`);\n console.log(`Dominant colors: ${colors.dominantColors.join(', ')}`);\n console.log(`Dominant foreground color: ${colors.dominantColorForeground}`);\n console.log(`Dominant background color: ${colors.dominantColorBackground}`);\n console.log(`Suggested accent color: #${colors.accentColor}`);\n }", "function randomrgb(){ //output: rgb(r,g,b) huemin etc from sliders\n\t\t//var hmin = document.getElementById(\"huemin\").value;\n\t\t//var hmax = document.getElementById(\"huemax\").value;\n\t\t//var smin = document.getElementById(\"satmin\").value;\n\t\t//var smax = document.getElementById(\"satmax\").value;\n\t\t//var lmin = document.getElementById(\"lumin\").value;\n\t\t//var lmax = document.getElementById(\"lumax\").value;\n\t\n\t\tvar hue = getRandomInt(document.getElementById(\"huemin\").value, document.getElementById(\"huemax\").value);\n\t\tvar sat = getRandom(document.getElementById(\"satmin\").value/100, document.getElementById(\"satmax\").value/100);\n\t\tvar light = getRandom(document.getElementById(\"lumin\").value/100, document.getElementById(\"lumax\").value/100);\n\t\tvar col = chroma.hsl(hue, sat, light);\n\t\n\t\treturn \"rgb(\" + col.rgb() + \")\";\n\t}", "greener(){\n\t\tthis.multiplyColorValue(\"green\", 1.2);\n\t}", "function displayMode(color) {\n\tdocument.querySelector('body').style.backgroundColor = color.a\n\tscene.fog = new THREE.FogExp2(color.b,0.007)\n\tfor (var i = 0; i < NBR_OBJ; i++) {\n var meshObj = scene.children[i]\n if (meshObj instanceof THREE.Mesh && meshObj.geometry.type == 'BoxGeometry') {\n\t\t\tmeshObj.material.color.setHex(color.c)\n }\n\t}\n}", "function chooseColor(mag) {\n var color;\n if (mag >= 5) {\n color = \"red\"\n } else if (mag >= 4) {\n color = \"orange\"\n } else if (mag >= 3) {\n color = \"yellow\"\n } else if (mag >= 2) {\n color = \"lightgreen\"\n } else {\n color = \"green\"\n }\n return color\n }", "function displayHex() {\n for (let i = 0; i < colorCalc().length; i++) {\n const rgbValue = hslToRGB(colorCalc()[i]);\n const hexValue = rgbToHex(rgbValue);\n document.getElementsByClassName(\"hexspan\")[i].textContent = hexValue;\n }\n}", "function getColor(cName) {\n\t\tswitch(cName){\n\t\t\tcase \"light_yellow\":\tc = \"#E6FB04\";\n\t\t\tcase \"neon_red\": \t\tc = \"#FF0000\";\n\t\t\tcase \"neon_purple\": \tc = \"#7CFC00\";\n\t\t\tcase \"neon_pink\":\t\tc = \"#FF00CC\";\n\t\t\tcase \"neon_yellow\":\tc = \"#FFFF00\";\n\t\t\tcase \"neon_green\": c = \"#00FF66\";\n\t\t\tcase \"light_blue\": c = \"#00FFFF\";\n\t\t\tcase \"dark_blue\": c = \"#0033FF\";\n\t\t\tdefault: \t\t\t\t\tc = '#FAEBD7';\n\t\t}\n \treturn c;\n\t}", "function getColor(magnitude) {\n if (magnitude > 5) {\n return \"#ea2c2c\";\n }\n if (magnitude > 4) {\n return \"#ea822c\";\n }\n if (magnitude > 3) {\n return \"#ee9c00\";\n }\n if (magnitude > 2) {\n return \"#eecc00\";\n }\n if (magnitude > 1) {\n return \"#d4ee00\";\n }\n return \"#98ee00\";\n}", "function proceduralTexture(u, v, data) {\n\tvar opr = \"+\";//data.proceduralTexture.operator?data.proceduralTexture.operator:\"+\"\n\tvar Color = {};\n\tvar noiser = 0, noiseg = 0, noiseb = 0;\n\tif (data.isNoiseOn)\n\t\tnoiser = noiseg = noiseb = noise(u, v, data);\n\tvar u_ = parseInt(u * 10);\n\tvar v_ = parseInt(v * 10);\n\tif (data.proceduralTexture) {\n\t\tswitch (data.proceduralTexture.operator) {\n\t\t\tcase \"%\":\n\t\t\t\tColor = {\n\t\t\t\t\tr: eval(2 * u + opr + (1 - u)) + noiser,\n\t\t\t\t\tg: eval((1 - u) + opr + 2 * v) + noiseg,\n\t\t\t\t\tb: eval(2 * u + opr + 2 * v) + noiseb\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"-\":\n\t\t\t\tColor = {\n\t\t\t\t\tr: (u_ % 2 == 0 && v_ % 2 == 0) == 0 ? u : v,\n\t\t\t\t\tg: (u_ % 2 != 0 && v_ % 2 != 0) == 0 ? u : v,\n\t\t\t\t\tb: 0.5,\n\t\t\t\t};\n\t\t\t\tColor.b = Color.r == Color.g ? u : v;\n\t\t\t\tif (Color.r == Color.g) {\n\t\t\t\t\tColor.b = Color.g = Color.r = 0.9;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"*\":\n\t\t\t\tColor = {\n\t\t\t\t\tr: (u_ % 2 == 0 && v_ % 2 == 0) == 0 ? u : v,\n\t\t\t\t\tg: 0,\n\t\t\t\t\tb: 0,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase \"+\":\n\t\t\t\tColor = {\n\t\t\t\t\t// r: (u+v)/2,//eval(Math.sin(u*u*3.14))+noiser,\n\t\t\t\t\t// g: (u>0.1&&u<0.9)&&(v>0.1&&v<0.9)?(u+v)/2:0,//Math.sin(v*v*3.14),//0,//eval(v)+noiseg,\n\t\t\t\t\t// b: (u>0.4&&u<0.8)&&(v>0.4&&v<0.8)?(u+v)/2:0//(Math.cos(u*3.14)+Math.cos(v*3.14))/2,//eval((2-u-v)/2)+noiseb\n\t\t\t\t\tr: Math.sin(u > v ? u : v),\n\t\t\t\t\tg: Math.sin(u < v ? u : v),//(u_%2!=0&&v_%2!=0)==0?u:v,\n\t\t\t\t\tb: 0,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t}\n\t}\n\telse {\n\t\tColor = {\n\t\t\t// r: (u+v)/2,//eval(Math.sin(u*u*3.14))+noiser,\n\t\t\t// g: (u>0.1&&u<0.9)&&(v>0.1&&v<0.9)?(u+v)/2:0,//Math.sin(v*v*3.14),//0,//eval(v)+noiseg,\n\t\t\t// b: (u>0.4&&u<0.8)&&(v>0.4&&v<0.8)?(u+v)/2:0//(Math.cos(u*3.14)+Math.cos(v*3.14))/2,//eval((2-u-v)/2)+noiseb\n\t\t\tr: (u_ % 2 == 0 && v_ % 2 == 0) == 0 ? u : v,\n\t\t\tg: (u_ % 2 != 0 && v_ % 2 != 0) == 0 ? u : v,\n\t\t\tb: 0.5,\n\t\t};\n\t\tColor.b = Color.r == Color.g ? u : v;\n\t\tif (Color.r == Color.g) {\n\t\t\tColor.b = Color.g = Color.r = 0.9;\n\t\t}\n\t\t// Color.b = Color.r==Color.g?u:v;\n\t\t// if(Color.r==Color.g){\n\t\t// \tColor.b=Color.g = Color.r=0.9;\n\t\t// }\n\t}\n\tColor.r += noiser;\n\tColor.g += noiseg;\n\tColor.b += noiseb;\n\t//console.log(\"u_:\"+u_+\" g:\"+Color.g+\" b:\"+Color.b);\n\tColor.r = (Color.r < 0 ? ((Color.r + 1) / 2) : (Color.r > 1 ? 1 : Color.r)) * 255;\n\tColor.g = (Color.g < 0 ? 0 : (Color.g > 1 ? 1 : Color.g)) * 255;\n\tColor.b = (Color.b < 0 ? 0 : (Color.b > 1 ? 1 : Color.b)) * 255;\n\treturn { Color: Color };\n}", "function checkChosenColor() {\n const colorPicker = document.querySelector(\".colorpicker\");\n let hexValue = colorPicker.value;\n return hexValue;\n}", "function CharacterColors({ eye_color, skin_color, hair_color}) {\n return (\n <CharacterFeatures>\n <p>Eye Color: {eye_color}</p>\n <p>Skin Color: {skin_color}</p>\n <p>Hair Color: {hair_color}</p>\n </CharacterFeatures>\n );\n}", "function obtenerColores() { //amarillo, naranja,lavanda , rosa, gris, marron, violeta\r\n return [\"#ff0000\",\"#00ff00\",\"#0000ff\",\"#ffff00\",\"#FF8000\",\"#8000FF\",\"#FF8080\",\"#808080\",\"#800000\",\"#800080\"];\r\n}", "function displayHex() {\n document.getElementById('hex').textContent = fullColorHex(r, g, b);\n}", "function aboutPlugin() {\n alert(\"About Colorize Text...\",\n \"Colorize Text is a plugin that provides several text colorizing utilities:\",\n \"• Gradient: applies a gradient between the first and last characters in a text node\",\n \"• Repeat: repeats a color pattern in a text node\",\n \"• Randomize: applies random colors to each character in a text node\",\n \"For more information, please see:\",\n \"https://github.com/AdobeXD/Plugin-Samples/tree/master/e2e-colorize-text\"\n );\n}", "function getColor(magnitude) {\n if (magnitude > 5) {\n return \"#ea2c2c\";\n }\n if (magnitude > 4) {\n return \"#ea822c\";\n }\n if (magnitude > 3) {\n return \"#ee9c00\";\n }\n if (magnitude > 2) {\n return \"#eecc00\";\n }\n if (magnitude > 1) {\n return \"#d4ee00\";\n }\n return \"#98ee00\";\n}", "function setRGBDisplay() {\r\n redDisplay.textContent = redCorrect;\r\n greenDisplay.textContent = greenCorrect;\r\n blueDisplay.textContent = blueCorrect;\r\n}", "function Qcolor(magnitude) {\n if (magnitude >= 5) {\n return \"#990000\";} \n else if (magnitude >= 4 && magnitude <5) {\n return \"#D60000\";} \n else if (magnitude >= 3 && magnitude <4) {\n return \"#FF4848\";} \n else if (magnitude >= 2 && magnitude <3){\n return \"#FFB0B0\";} \n else if (magnitude >= 1 && magnitude <2){\n return \"#FFCACA\"; } \n else if (magnitude < 1){\n return \"#FFE4E4\";} \n }", "function Color() {}", "function colorCalc() {\n let hsl = rgbToHsl(hexToRGB(checkChosenColor()));\n let c1, c2, c3, c4, c5;\n switch (checkSelectedOption()) {\n case \"analogous\":\n c1 = {\n h: (hsl.h + 20) % 360,\n s: hsl.s,\n l: hsl.l,\n };\n c2 = {\n h: (hsl.h + 100) % 360,\n s: hsl.s,\n l: hsl.l,\n };\n c3 = {\n h: hsl.h,\n s: hsl.s,\n l: hsl.l,\n };\n c4 = {\n h: (hsl.h + 200) % 360,\n s: hsl.s,\n l: hsl.l,\n };\n c5 = {\n h: (hsl.h + 280) % 360,\n s: hsl.s,\n l: hsl.l,\n };\n return [c1, c2, c3, c4, c5];\n case \"monochromatic\":\n c1 = {\n h: hsl.h,\n s: (hsl.s + 10) % 100,\n l: hsl.l,\n };\n c2 = {\n h: hsl.h,\n s: (hsl.s + 40) % 100,\n l: hsl.l,\n };\n c3 = {\n h: hsl.h,\n s: hsl.s,\n l: hsl.l,\n };\n c4 = {\n h: hsl.h,\n s: (hsl.s + 50) % 100,\n l: hsl.l,\n };\n c5 = {\n h: hsl.h,\n s: (hsl.s + 60) % 100,\n l: hsl.l,\n };\n //console.log([c1, c2, c3, c4, c5]);\n return [c1, c2, c3, c4, c5];\n case \"triad\":\n c1 = {\n h: (hsl.h + 180) % 360,\n s: hsl.s,\n l: hsl.l,\n };\n c2 = {\n h: (hsl.h + 240) % 360,\n s: hsl.s,\n l: hsl.l,\n };\n c3 = {\n h: hsl.h,\n s: hsl.s,\n l: hsl.l,\n };\n c4 = {\n h: (hsl.h + 60) % 360,\n s: hsl.s,\n l: hsl.l,\n };\n c5 = {\n h: (hsl.h + 120) % 360,\n s: hsl.s,\n l: hsl.l,\n };\n //console.log([c1, c2, c3, c4, c5]);\n return [c1, c2, c3, c4, c5];\n case \"complementary\":\n c1 = {\n h: (hsl.h + 180) % 360,\n s: hsl.s,\n l: (hsl.l + 10) % 100,\n };\n c2 = {\n h: (hsl.h + 180) % 360,\n s: hsl.s,\n l: (hsl.l + 30) % 100,\n };\n c3 = {\n h: hsl.h,\n s: hsl.s,\n l: hsl.l,\n };\n c4 = {\n h: hsl.h,\n s: hsl.s,\n l: (hsl.l + 40) % 100,\n };\n c5 = {\n h: hsl.h,\n s: hsl.s,\n l: (hsl.l + 70) % 100,\n };\n //console.log([c1, c2, c3, c4, c5]);\n return [c1, c2, c3, c4, c5];\n case \"compound\":\n c1 = {\n h: (hsl.h + 80) % 360,\n s: hsl.s,\n l: (hsl.l + 5) % 100,\n };\n c2 = {\n h: (hsl.h + 180) % 360,\n s: hsl.s,\n l: hsl.l,\n };\n c3 = {\n h: hsl.h,\n s: hsl.s,\n l: hsl.l,\n };\n c4 = {\n h: (hsl.h + 120) % 360,\n s: hsl.s,\n l: hsl.l,\n };\n c5 = {\n h: (hsl.h + 150) % 360,\n s: hsl.s,\n l: (hsl.l + 70) % 100,\n };\n //console.log([c1, c2, c3, c4, c5]);\n return [c1, c2, c3, c4, c5];\n case \"shades\":\n c1 = {\n h: hsl.h,\n s: hsl.s,\n l: (hsl.l + 40) % 100,\n };\n c2 = {\n h: hsl.h,\n s: hsl.s,\n l: (hsl.l + 30) % 100,\n };\n c3 = {\n h: hsl.h,\n s: hsl.s,\n l: hsl.l,\n };\n c4 = {\n h: hsl.h,\n s: hsl.s,\n l: (hsl.l + 10) % 100,\n };\n c5 = {\n h: hsl.h,\n s: hsl.s,\n l: (hsl.l + 70) % 100,\n };\n //console.log([c1, c2, c3, c4, c5]);\n return [c1, c2, c3, c4, c5];\n }\n}", "function Color() { }", "function cambioColorFondo(){\n //En esta línea pedimos al usuario que elija el color en hexadecimal\n var pedirColorFondo = prompt(\"Elige un color HEXADECIMAL de fondo : \");\n //Aquí igualamos la variable a lo que el usuario escribió, además agrego el \"#\" para que no sea necesario que el usuario lo ponga\n pedirColorFondo = \"#\" + pedirColorFondo;\n document.getElementById(\"vistaAnterior\").style.backgroundColor = pedirColorFondo;\n}", "function getColor(magnitude) {\n if (magnitude > 7) {\n return 'red'\n } else if (magnitude > 6) {\n return 'orange'\n } else if (magnitude > 5) {\n return 'yellow'\n } else if (magnitude > 4) {\n return 'lightgreen'\n } else if (magnitude > 2) {\n return 'green'\n } else {\n return 'blue'\n }\n}", "function getColor(color) {\n\tif (color.includes(\"Magno-Gold\"))\n\t\treturn \"#F6A723\"\n\telse if (color.includes(\"Gold\"))\n\t\treturn \"#6E5012\"\n\telse if (color.includes(\"Carbon Crystal\"))\n\t\treturn \"#BC3731\"\n\telse if (color.includes(\"Carbon\"))\n\t\treturn \"#7C322E\"\n\telse if (color.includes(\"TetraCobalt\"))\n\t\treturn \"#025B85\"\n\telse if (color.includes(\"Cobalt\"))\n\t\treturn \"#0B4762\"\n\telse if (color.includes(\"Cadmium\"))\n\t\treturn \"#581115\"\n\telse if (color.includes(\"Copper\"))\n\t\treturn \"#946714\"\n\telse if (color.includes(\"Emeril\"))\n\t\treturn \"#294C23\"\n\telse if (color.includes(\"Indium\"))\n\t\treturn \"#0C3662\"\n\telse if (color.includes(\"Chromatic Metal\"))\n\t\treturn \"#251314\"\n\telse if (color.includes(\"Ammonia\"))\n\t\treturn \"#0A723C\"\n\telse if (color.includes(\"Aronium\"))\n\t\treturn \"#F6A723\"\n\telse if (color.includes(\"Ferrite\"))\n\t\treturn \"#5B5A55\"\n\telse if (color.includes(\"Silver\"))\n\t\treturn \"#5C5A55\"\n\telse if (color.includes(\"Cactus Flesh\"))\n\t\treturn \"#1D6827\"\n\telse if (color.includes(\"Destablised Sodium\"))\n\t\treturn \"#F16E17\"\n\telse if (color.includes(\"Sodium\"))\n\t\treturn \"#9C4E22\"\n\telse if (color.includes(\"Salt\"))\n\t\treturn \"#1B623A\"\n\telse if (color.includes(\"Solanium\"))\n\t\treturn \"#78361E\"\n\telse if (color.includes(\"Chlorine\"))\n\t\treturn \"#113611\"\n\telse if (color.includes(\"Chloride Lattice\"))\n\t\treturn \"#1E8941\"\n\telse if (color.includes(\"Coprite\"))\n\t\treturn \"#533E2D\"\n\telse if (color.includes(\"Di-hydrogen Jelly\"))\n\t\treturn \"#C21646\"\n\telse if (color.includes(\"Di-hydrogen\"))\n\t\treturn \"#25465C\"\n\telse if (color.includes(\"Dioxite\"))\n\t\treturn \"#1C3D8C\"\n\telse if (color.includes(\"Mordite\"))\n\t\treturn \"#392634\"\n\telse if (color.includes(\"Dirty Bronze\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Grantine\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Herox\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Geodesite\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Iridesite\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Lemmium\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Thermic Condensate\"))\n\t\treturn \"#F1AA22\"\n\telse if (color.includes(\"Platinum\"))\n\t\treturn \"#385457\"\n\telse if (color.includes(\"Pyrite\"))\n\t\treturn \"#925113\"\n\telse if (color.includes(\"Gamma Root\"))\n\t\treturn \"#7E5E21\"\n\telse if (color.includes(\"Fungal Mould\"))\n\t\treturn \"#08733C\"\n\telse if (color.includes(\"Frost Crystal\"))\n\t\treturn \"#193F8C\"\n\telse if (color.includes(\"Kelp Sac\"))\n\t\treturn \"#1B768F\"\n\telse if (color.includes(\"Oxygen\"))\n\t\treturn \"#7B3430\"\n\telse if (color.includes(\"Living Slime\"))\n\t\treturn \"#3E522F\"\n\telse if (color.includes(\"Runaway Mould\"))\n\t\treturn \"#405130\"\n\telse if (color.includes(\"Marrow Bulb\"))\n\t\treturn \"#475930\"\n\telse if (color.includes(\"Nitrogen\"))\n\t\treturn \"#8D6623\"\n\telse if (color.includes(\"Sulphurine\"))\n\t\treturn \"#214532\"\n\telse if (color.includes(\"Radon\"))\n\t\treturn \"#36305E\"\n\telse if (color.includes(\"Paraffinium\"))\n\t\treturn \"#383442\"\n\telse if (color.includes(\"Phosphorus\"))\n\t\treturn \"#8C240F\"\n\telse if (color.includes(\"Nanite\"))\n\t\treturn \"#192E3F\"\n\telse if (color.includes(\"Pugneum\"))\n\t\treturn \"#4C2A56\"\n\telse if (color.includes(\"Rare Metal Element\"))\n\t\treturn \"#8B7E71\"\n\telse if (color.includes(\"Residual Goop\"))\n\t\treturn \"#5B6F35\"\n\telse if (color.includes(\"Viscous Fluid\"))\n\t\treturn \"#40512F\"\n\telse if (color.includes(\"Glass\"))\n\t\treturn \"#F3A923\"\n\telse if (color.includes(\"Star Bulb\"))\n\t\treturn \"#296879\"\n\telse if (color.includes(\"Rusted Metal\"))\n\t\treturn \"#3E5230\"\n\telse if (color.includes(\"Superoxide Crystal\"))\n\t\treturn \"#BA3930\"\n\telse if (color.includes(\"Tritium\"))\n\t\treturn \"#DDDCD0\"\n\telse if (color.includes(\"Uranium\"))\n\t\treturn \"#A37610\"\n\telse if (color.includes(\"Unstable Plasma\"))\n\t\treturn \"#C01746\"\n\telse if (color.includes(\"Warp Cell\"))\n\t\treturn \"#C01746\"\n\telse if (color.includes(\"Starship Launch Fuel\"))\n\t\treturn \"#C01746\"\n\telse if (color.includes(\"Ion Battery\"))\n\t\treturn \"#F3A923\"\n\telse if (color.includes(\"Life Support Gel\"))\n\t\treturn \"#C01746\"\n\telse if (color.includes(\"Deuterium\"))\n\t\treturn \"#25465C\"\n}", "function magColor(mag) {\n var color = \"\";\n if (mag <= 2) { color = \"#006633\"; }\n else if (mag <= 3) {color = \"#99CC00\"; }\n else if (mag <= 4) { color = \"#FFFF00\"; }\n else if (mag <= 5) {color = \"#FF6600\"; }\n else { color = \"#006633\"; }\n \n return color;\n \n }", "function checkCalcColor(c) {\n if (mdc.checked == true) {\n // returns array of [rgbString, mdColorName, mdTinkNumber]...\n var tmp = calcColor(c);\n c = tmp[0];\n mh.innerHTML = tmp[1];\n }\n else {\n mh.innerHTML = \"Picker Unlocked\";\n }\n return c;\n }" ]
[ "0.61485434", "0.6098682", "0.59763724", "0.596199", "0.59580344", "0.59469306", "0.5903203", "0.58860654", "0.5870233", "0.58403987", "0.5826559", "0.5819501", "0.57843626", "0.5783196", "0.57649446", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.5746544", "0.57371426", "0.57298446", "0.5724983", "0.57240343", "0.5707804", "0.56989515", "0.56986004", "0.56969535", "0.56797975", "0.5675462", "0.56751895", "0.56722975", "0.5669991", "0.56689364", "0.5666226", "0.5666226", "0.5661458", "0.56536335", "0.56445706", "0.5632997", "0.56265324", "0.561327", "0.56125706", "0.56006473", "0.5592981", "0.5589559", "0.5584327", "0.5577901", "0.55774784", "0.5571222", "0.55700994", "0.5555327", "0.5554164", "0.5553621", "0.5547294", "0.55425256", "0.5540473", "0.5539222", "0.5535331", "0.5522293", "0.5519236", "0.55152977", "0.5500345", "0.5493017", "0.5483649", "0.5481038", "0.5479595", "0.54788196", "0.5456103", "0.54526806", "0.54511416", "0.54507905", "0.54354054", "0.543529", "0.542817", "0.54264843", "0.54245985", "0.54154676", "0.5410995", "0.54068184", "0.5405705", "0.5399175", "0.53970575", "0.53960496", "0.53929216", "0.539047", "0.538676", "0.5382584", "0.53822017", "0.53806114", "0.5370294", "0.53699183", "0.53664935", "0.53662544", "0.53613204", "0.53603613", "0.53551793", "0.53534937", "0.5350878" ]
0.5494445
64
hack moved from itemdetails controller end
function toggleProrate() { $scope.isProrate = !$scope.isProrate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onItemSelect(item) {\n // handle action to render the new page!\n\n Actions.editdetails({text: item});\n }", "openItemDetails(item){if(!this._isDetailsOpened(item)){this.push(\"detailsOpenedItems\",item)}}", "function trapItemDetails() {\n\n console.log(GM_info.script.name + ': trapItemDetails');\n\n //debugger;\n\n let parentDiv = $('div.ReactVirtualized__Grid').get();\n if (!validPointer(parentDiv) || !parentDiv.length) {return;}\n\n let owlItem = $(parentDiv).find('div.info___3-0WL').get();\n if (!owlItem.length || !validPointer(owlItem)) {return;}\n\n let clearfix = $(owlItem).find('div.info-content > div.clearfix.info-wrap')[0];\n if (!validPointer(clearfix)) {return;}\n\n //let pricingUl = $(clearfix).find('ul.info-cont')[0];\n //if (!validPointer(pricingUl)) {return;}\n\n let statsUl = $(clearfix).find('ul.info-cont.list-wrap')[0];\n if (!validPointer(statsUl)) {return;}\n\n let newItem = getNewItem();\n\n //getNameTypeItemInfo(owlItem, newItem);\n //getPricingInfo(pricingUl, newItem);\n getStatInfo(statsUl, newItem);\n\n console.log(GM_info.script.name + ': newItem: ', newItem);\n\n\n }", "function loadDetails(item) {\n return loadDetailsFunctionality(item);\n }", "gotoItemDetails(result, e) {\n\t\tif(this.props.itemDetailsPath && result.resourceId) {\n\t\t\tFlexRouter.gotoItemDetails(this.props.itemDetailsPath, result, this.props.searchTerm);\n\t\t} else {\n\t\t\tthis.setState({showModal: true})\n\t\t}\n\t}", "function MainController($scope,$routeParams,$http,$location, itemsService) {\n\n // @@@@@@@@@@@@@@@@@@@@@@@@ G E N E R A L @@@@@@@@@@@@@@@@@@@@@@@@@@ //\n $scope.itemsService =itemsService; \n $scope.pageCatg = $routeParams.pageCatg; // import the page title\n $scope.pageType = $routeParams.pageType; // import the page type --> which items we should see on each page\n $scope.products = itemsService.itemsList($scope.pageCatg,$scope.pageType, function(products){\n $scope.products=products;\n console.log($scope.products);\n }); \n\n// console.log($scope.products);\n $scope.prod ={};\n $scope.classType = \"span3A\";\n $scope.title = $routeParams.title;\n \n // @@@@@@@@@@@@@@@@@@@@@@@@ F U N C T I O N S @@@@@@@@@@@@@@@@@@@@@@@@@@ // \n\n // -----------------ADMIN ONLY - function when NEW Item CREATED ------------------//\n\n $scope.newItem = function(obj){\n console.log(obj);\n console.log(obj['_id']); \n \n var myform = $http({\n method: 'POST',\n url: '/admin/new',\n data: [obj]\n }).\n then(function(res){ \n console.log(res.data);\n $location.path('/confirmation/Updated');\n $scope.prod ={}; // CLEAR object //\n }, \n function(error){\n console.log(error);\n }); \n };\n \n\n//---------------------- END of new ITEM created function -------------//\n\n//------------- change size of products grid ------------------// \n \n $scope.changeClass = function(){\n if ($scope.classType === \"span3A\")\n $scope.classType = \"span2\";\n else\n $scope.classType = \"span3A\";\n };\n//-------------------END of function size of grid--------------// \n\n// ------- redirect the page to admin.html -------- //\n $scope.sendform = function(){\n $location.path('/admin');\n };\n\n// --------------- END redirect ---------------//\n// --------------- products view options ------------------------// \n \n $scope.views = [{ \n viewTitle: 'list-view',\n lines: 20,\n columns: 1\n }, { \n viewTitle: 'grid-view',\n lines: 4,\n columns: 3\n \n }, { \n viewTitle: 'icon-view',\n lines: 6,\n columns: 4\n }];\n\n//-------------------------------------------------------------------------------// \n \n }", "updateItemDetails(itemDetails) {\n const {\n consumerID,\n distributorID,\n itemSKU,\n itemState,\n itemUPC,\n originFarmInformation,\n originFarmLatitude,\n originFarmLongitude,\n originFarmName,\n originFarmerID,\n ownerID,\n productID,\n productNotes,\n productPrice,\n farmerDocumentID,\n } = itemDetails;\n\n farmerDocumentID !== \"\" &&\n this.jquery(\"#uploadedDocuments\").html(\n `<a href=\"https://gateway.pinata.cloud/ipfs/${farmerDocumentID}\">See farmer document</a>`\n );\n this.jquery(\"#productDetailsLabel\").html(`Product ${itemUPC}`);\n this.jquery(\"#productCurrentOwner\").val(ownerID);\n this.jquery(\"#productItemCode\").val(`${itemSKU}`);\n this.jquery(\"#productFarmerId\").val(originFarmerID);\n this.jquery(\"#productFarmName\").val(originFarmName);\n this.jquery(\"#productLatitude\").val(originFarmLatitude);\n this.jquery(\"#productLongitude\").val(originFarmLongitude);\n this.jquery(\"#productState\").val(parseInt(itemState));\n }", "function prodCtrl($scope,$routeParams,$http, $location,itemsService ) {\n \n // @@@@@@@@@@@@@@@@@@@@@@@@ G E N E R A L @@@@@@@@@@@@@@@@@@@@@@@@@@ //\n\n \n $scope.pageCatg = 'All Jewelry & Watches'; // import the page title\n $scope.pageType = '13'; // import the page type --> which items we should see on each page\n $scope.products = itemsService.itemsList($scope.pageCatg,$scope.pageType, function(products){\n $scope.products=products;\n $scope.ITEM = getById($routeParams.ID); // calling function that recive ID and bring the relevant object to $scope\n console.log($scope.ITEM);\n }); \n\n console.log($routeParams.ID);\n $scope.ITEM = getById($routeParams.ID); // calling function that recive ID and bring the relevant object to $scope\n console.log($scope.ITEM);\n\n \n \n // @@@@@@@@@@@@@@@@@@@@@@@@ F U N C T I O N S @@@@@@@@@@@@@@@@@@@@@@@@@@ //\n \n \n //--------------- get ITEM OBJECT by ID (function) ------------------// \n function getById (id) {\n // console.log(id);\n // console.log($scope.products); \n\n for (var key in $scope.products) {\n if ($scope.products[key]['_id'] == id) {\n console.log($scope.products[key]);\n return $scope.products[key]; \n } \n }\n\n return 'item not found';\n\n}\n\n// ----------------- ADMIN ONLY - function when UPDTATE Item ------------------//\n\n$scope.updateform = function(obj){\n\n console.log(obj);\n\n var myform = $http({\n method: 'POST',\n url: '/admin/edit',\n data: [obj]\n }).\n then(function(res){\n console.log(res.data);\n $location.path('/confirmation/Updated');\n }, \n function(error){\n console.log(error);\n }); \n };\n\n\n// ----------------- ADMIN ONLY - function when DELETE Item ------------------//\n\n$scope.deleteItem = function(obj){\n var myproducts = $http({\n method: 'POST',\n url: '/admin/delete',\n data: [obj]\n }).\nthen(function(res){\nconsole.log(res.data);\n$location.path('/confirmation/Deleted');\n}, \nfunction(error){\nconsole.log(error);\n});\n \n};\n// -------------------END ------------//\n}", "closeItemDetails(item){if(this._isDetailsOpened(item)){this.splice(\"detailsOpenedItems\",this._getItemIndexInArray(item,this.detailsOpenedItems),1)}}", "function loadDetails(item) {\n\t\t\tlet url = item.detailsUrl;\n\t\t\treturn fetch(url)\n\t\t\t\t.then(function (response) {\n\t\t\t\treturn response.json();\n\t\t\t\t})\n\t\t\t\t\t.then(function (details) {\n// Now we add the details to the item\n\t\t\titem.name = details.name;\n\t\t\titem.imageUrl = details.sprites.front_default;\n\t\t\titem.imageUrlB =details.sprites.back_default;\n\t\t\titem.height = details.height;\n\t\t\titem.weight = details.weight;\n\t\t\titem.types = details.types;\n\t\t\t})\n\t\t\t.catch(function (e) {\n\t\t\tconsole.error(e);\n\t\t\t});\n\t\t}", "function trapItemDetails(observer) {\n if (doingBazaarMaintainance()) {\n if ($('#xedx-main-div').length > 0) {\n $(targetNode).unbind('DOMNodeInserted');\n $('#xedx-main-div').remove();\n }\n return;\n }\n buildUI(); // If needed...\n\n let parentDiv = isBazaar ? $('div.ReactVirtualized__Grid').get() : itemsGetActiveClass();\n if (!validPointer(parentDiv) || !parentDiv.length) {return;}\n\n let owlItem = isBazaar ? $(parentDiv).find('div.info___3-0WL').get() :\n $(parentDiv).find('li.show-item-info.bottom-round').get();\n if (!owlItem.length || !validPointer(owlItem)) {return;}\n\n let clearfix = $(owlItem).find('div.info-content > div.clearfix.info-wrap')[0];\n if (!validPointer(clearfix)) {return;}\n\n let pricingUl = $(clearfix).find('ul.info-cont')[0];\n if (!validPointer(pricingUl)) {return;}\n\n let statsUl = $(clearfix).find('ul.info-cont.list-wrap')[0];\n if (!validPointer(statsUl)) {return;}\n\n let newItem = getNewItem();\n\n // We give a unique ID to a root node that persists (I hope)\n // to prevent doing this more than once. We also hash the\n // resulting object to prevent array insertion more than once\n // in case this fails for whatever reason. The hash value is\n // saved in a separate array.\n if (isItemTagged(pricingUl, newItem)) {return;}\n\n getNameTypeItemInfo(owlItem, newItem);\n getPricingInfo(pricingUl, newItem);\n getStatInfo(statsUl, newItem);\n\n console.log('newItem: ', newItem);\n\n // Generate a unique hash value for this, so as not to add twice.\n // Should never get here if already added.\n // The hash can't be part of the data, for obvious reasons - at\n // least not when calculating the hash. But we can add it to be saved\n // into the spreadsheet, to prevent inserting duplicates, if you go to the\n // same place twice by mistake.\n let jsonData = JSON.stringify(newItem);\n let hash = jsonData.hashCode();\n\n console.log('Hashcode for the ' + newItem.name + ': ' + hash);\n if (!detectedItemsHashTable.includes(hash)) {\n detectedItemsHashTable.push(hash);\n\n // We add the hash value to the item immediately before pushing onto our array.\n // This allows it to be recorded by the Google Sheets script, to prevent\n // duplicates from being inserted into the sheet.\n newItem.hash = hash.toString();\n detectedItemsArray.push(newItem);\n console.log('Pushed a \"' + newItem.name + '\" onto array');\n\n // Check for really good weapons - based just on quality.\n // Shuld also use the (acc+def) /100 (?) method.\n let q = newItem.quality;\n let end = q.indexOf('%');\n let n = q.slice(0, end-1);\n if (parseInt(n) > 90) {\n alert('This ' + newItem.name + ' has a quality rating of ' + newItem.quality + ' !');\n }\n\n if (INSTANT_UPLOAD) {\n submitFunction();\n }\n }\n }", "function GoToProductDetail(e) {\n Ti.API.info(\"inside GoToProductDetails\");\n Ti.API.info(\"on click\" + e);\n Ti.API.info(\"on click stringify\" + JSON.stringify(e));\n Ti.API.info(e.section.getItemAt(e.itemIndex));\n Ti.API.info(e.section.getItemAt(e.itemIndex).properties.Mid);\n var ProductDetail = Alloy.createController('ProductDetail', e.section.getItemAt(e.itemIndex).properties.Mid, access_token).getView();\n ProductDetail.open();\n\n}", "function showDetail(item) {\n detailLogo.style.backgroundPosition = item.pos;\n detailInput.value = \":\" + item.name + \":\";\n if (unicodeInput) {\n unicodeInput.value = item.unicode || \"\";\n }\n }", "function _addDetail() {\n for (var i = 0; i < vm.items.length; i++) {\n vm.items[i].actions = [{\n label: vm.items[i].description\n }];\n vm.items[i].startsAt = new Date(vm.items[i].startsAt); //as per requirement of bootstrap calendar\n vm.items[i].endsAt = new Date(vm.items[i].endsAt); //as per requirement of bootstrap calendar\n }\n }", "function displaySelectedItem() {\n var fi = findItem();\n if (fi) {\n $scope.item.category = fi.category;\n $scope.item.text = fi.text;\n $scope.item.amount = fi.amount;\n }\n else\n {\n //item add\n $scope.item.category={};\n $scope.item.text = '';\n $scope.item.amount = '';\n $rootScope.editMode = false;\n }\n }", "function loadDetails(item) {\n var url = item.detailsUrl;\n return $.ajax(url, {\n dataType: 'json',\n })\n .then(function (responseJSON) {\n // Now we add the details to the item\n item.imageUrl = responseJSON.sprites.front_default;\n item.height = responseJSON.height;\n // loop through types\n item.types = '';\n responseJSON.types.forEach(function (result) {\n item.types += result.type.name + ' ';\n });\n })\n .catch(function (e) {\n console.error(e);\n });\n }", "function loadDetailsFunctionality(item) {\n let url = item.detailsUrl;\n return fetch(url)\n .then(function (response) {\n return response.json();\n })\n .then(function (details) {\n // Now we add the details to the item\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.types = details.types;\n })\n .catch(function (e) {\n console.error(e);\n });\n}", "handleDetail(item) {\n if (this.props.onDetail) this.props.onDetail(item);\n }", "function InitDynamicDetailsView() {\n var _isEmpty = angular.equals({}, $location.search());\n if (!_isEmpty) {\n DynamicDetailsViewCtrl.ePage.Masters.Pkey = helperService.decryptData($location.search().key);\n DynamicDetailsViewCtrl.ePage.Masters.Item = helperService.decryptData($location.search().item);\n }\n }", "function announceItemChange(){angular.isFunction($scope.itemChange)&&$scope.itemChange(getItemAsNameVal($scope.selectedItem));}", "function loadDetails(item) {\n let url = item.detailsUrl;\n return fetch(url).then(function (response) {\n return response.json();\n }).then(function (details) {\n item.id =details.id;\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.weight = details.weight;\n item.types = details.types;\n }).catch(function (e) {\n console.error(e);\n });\n }", "function showDetails(item) {\n loadDetails(item).then(function () {\n // call function to display items in modal\n populateModal(item);\n });\n }", "function loadDetails(item) {\n let url = item.detailsURL;\n return fetch(url).then(function (response) {\n return response.json();\n }).then(function (details){\n // Now we add the details to the Item\n item.imageURLFront = details.sprites.front_default;\n item.imageURLBack = details.sprites.back_default;\n item.height = details.height;\n item.weight = details.weight;\n // item.types = details.type;\n // item.abilities = details.abilities;\n }).catch(function (e) {\n console.error(e); // eslint-disable-line no-console\n });\n }", "itemClicked(e, item) {\n e.preventDefault()\n e.stopPropagation()\n\n // If the Quick Add button was clicked\n if (e.target.type === 'button') {\n this.addToCartClicked(e, item)\n\n return\n }\n\n this.props.actions.product.setProduct(item)\n\n // TODO: Leave this in as log if debug mode\n console.log('opening product page for item:')\n console.log(item)\n window.location.hash = '#/product/' + item['product_id'] + '/' + item['name'] // TODO: Use mappings! And use websafe/SEO URL (currently unavailable)\n\n /*let stepId = 'options'\n let stepDescriptor = this.stepper.getStepById(stepId) || null\n\n if (stepDescriptor !== null) {\n let data = item\n\n let isEnded = false\n // Execute the step handler\n this.stepper.load(stepDescriptor, data, isEnded, this.setStep.bind(this, stepId))\n this.stepper.addItem(item.id, 1, item)\n }*/\n }", "detailViewOf(item) {\n var view = item ? item.getDetailView() : null;\n //region Get rid of old view\n if (this.detailView.view) {\n var old = this.detailView.view;\n this.detailView.view = null;\n old.element.remove();\n }\n //endregion\n if (view) {\n this.detailView.view = view;\n this.btnSaveDetail.enabled = false;\n view.unsavedChangesChanged.add(() => {\n //log(\"Unsaved changes changed\")\n //log(\"Unsaved changes \" + view.unsavedChanges)\n this.btnSaveDetail.enabled = view.unsavedChanges;\n if (!view.unsavedChanges) {\n item.syncUI();\n }\n });\n }\n if (item) {\n // TODO: Temproarily removed delete button\n this.btnRemoveDetail.visible = false;\n }\n this.detailViewItem = item;\n // this._listSelectedItem = item;\n }", "eventUpdateItem(record) {\n this.openView(true);\n this.operation = \"Update\";\n this.selected_index = parseInt(record.id.replace(\"update\", \"\"));\n this.tbItems = JSON.parse(this.loadPass());\n var item = JSON.parse(this.tbItems[this.selected_index]);\n document.getElementById(\"txtTitulo\").value = item.titulo;\n document.getElementById(\"txtDesc\").value = item.desc;\n document.getElementById(\"txtLink\").value = item.link;\n document.getElementById(\"txtLogin\").value = item.login;\n document.getElementById(\"txtPass\").value = item.pass;\n if (item.hidden) {\n item.hidden = item.hidden.toString();\n }\n if (item.hidden != \"true\") {\n item.hidden = false;\n }\n jQuery(\"#checkHidden\").prop(\"checked\", item.hidden);\n jQuery(\"#txtCategoria\").val(item.category);\n console.log(item.category);\n this.changeSubCategory();\n jQuery(\"#txtSubcategoria\").val(item.subcategory);\n document.getElementById(\"txtTitulo\").focus();\n }", "function purchasedItem(listItem) {\n listItem.hide();\n purchased.append(listItem);\n listItem.show('slow');\n }", "function item_info(item) {\n return parent.G.items[item.name];\n}", "function _getByIdSuccess(res) {\n vm.item = res.data.item;\n console.log(vm.item);\n }", "function selectedItemChange(item, pr) {\n if (item != null && item.Id != null) {\n pr.IngredientId = item.Id; self.markEditedDetail(pr);\n } else {\n pr.IngredientId = null; self.markEditedDetail(pr);\n }\n }", "function loadDetails(item) {\n var url = item.detailsUrl;\n return fetch(url).then(function (response) {\n return response.json();\n }).then(function (details) {\n // Now we add the details to the item\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.types = Object.keys(details.types);\n }).catch(function (e) {\n console.error(e);\n });\n }", "handleItemViewDetails(row) {\n alert(`Viewing details for \"${row.original.id}\"!`);\n }", "function showDetails(item) {\n dogRepository.loadDetails(item).then(function() {\n return item;\n }).then(function(item) {\n showModal(item);\n });\n}", "function showDetails(item) {\n pokemonRepository.loadDetails(item).then(function () {\n console.log(item);\n showModal(item);\n });\n }", "function loadDetails(item) {\n let url = item.detailsUrl;\n return fetch(url).then(function (response){\n return response.json();\n }).then(function (details){\n item.imageUrlFront = details.sprites.other.dream_world.front_default;\n item.height = details.height;\n item.weight = details.weight;\n item.types = [];\n details.types.forEach(function(itemType) {\n item.types.push(itemType.type.name);\n });\n item.abilities = [];\n details.abilities.forEach(function(itemAbilities) {\n item.abilities.push(itemAbilities.ability.name);\n });\n \n }).catch(function(e){\n console.error(e);\n });\n}", "function showDetails(item) {\n dogRepository.loadDetails(item).then(function() {\n console.log(item);\n return item;\n }).then(function(item) {\n console.log('TCL: showDetails -> item', item);\n showModal(item);\n });\n}", "function viewItemToEdit(item) {\n\t\tOverlayModule.enableOverlay();\n\t\tvar viewProduct = findItem(item)[0];\n\t\tvar div = document.getElementById(\"itemImage\");\n\t\tdiv.src = \"images/\"+item+\".jpg\";\n\n\n\t\tvar itemFullName = viewProduct.p_variation + \" \" + viewProduct.p_name;\n\t\tvar itemCurrency = viewProduct.c_currency;\n\t\tvar itemName = viewProduct.p_name;\n\t\tvar itemMRPrice = viewProduct.p_originalprice;\n\t\tvar itemPrice = viewProduct.p_price;\n\t\tvar itemAvailSizes = viewProduct.p_available_options.sizes;\n\t\tvar itemAvailColors = viewProduct.p_available_options.colors;\n\t\t$(\"#iId\").attr(\"value\", viewProduct.p_id);\n\t\t$(\"#iFullName\").html(itemFullName);\t\n\t\t$(\"#iCurrency\").html(itemCurrency);\n\t\t$(\"#iName\").html(itemName);\t\t\t\t\n\t\t$(\"#iMRPrice\").html(itemMRPrice);\t\t\t\t\n\t\t$(\"#iPrice\").html(itemPrice);\t\t\t\t\n\n\t\tif (itemMRPrice === itemPrice) {\n\t\t\t$(\"#iMRPrice\").css(\"visibility\", \"hidden\");\n\t\t\t$(\"#iMRPrice\").html(\"\");\n\t\t}\n\n\t\tfor (var i=0; i < itemAvailColors.length; i++){\n\t\t\t$('ul#iColorOption').append(\"<li id='\"+itemAvailColors[i].hexcode+\"' class='colorOps' style = 'background-color:\"+itemAvailColors[i].hexcode+\"' title='\"+itemAvailColors[i].name+\"'></li>\");\n\t\t}\n\t\tfor (var i=0; i < itemAvailSizes.length; i++){\n\t\t\t$('#iSizeOption').append(new Option(itemAvailSizes[i].code.toUpperCase(), itemAvailSizes[i].name));\n\t\t}\n\t\treturn;\n\t}", "function loadDetails(item) {\n console.log(item);\n showLoadingMessage ();\n let url = item.detailsUrl;\n return fetch(url).then(function (response) {\n return response.json();\n }).then(function (details) { //details is the parameter that would be the return value of the previous function\n // Now we add the details to the item\n hideLoadingMessage();\n item.imageUrl = details.sprites.front_default; //sprites is the key of the object with the imgs\n item.height = details.height;\n item.image = details.sprites.other.dream_world.front_default;\n item.types = []; \n \n details.types.forEach(function(pokemon){\n item.types.push(pokemon.type.name)\n })\n }).catch(function (e) {\n hideLoadingMessage();\n console.error(e);\n });\n }", "function viewDetailNote(itemID, type) {\n showProcessingDiaglog();\n var windowName = type + \"Window\";\n showWindow(windowName);\n\n $(\"#\" + windowName + \" .title-bar\").html(\"Edit \" + type + \" item\");\n var btnSave = $(\"#\" + windowName + \" .btnSave\");\n $(btnSave).val(\"Save\").attr(\"onclick\", \"saveItem(\" + itemID + \",'\" + type + \"')\");\n $(\"#\" + windowName + \" .pageRibbon img\").css(\"display\", \"block\");\n\n //Get all data of that item\n var getItemData = $.ajax({\n url: \"Handler/ItemHandler.ashx\",\n data: {\n action: \"viewItem\",\n projectID: projectID,\n itemID: itemID,\n type: type\n },\n type: \"get\",\n success: function (result) {\n result = result[0];\n (type == \"backlog\") ? displayBacklogDetail(result) : displayTaskDetail(result);\n\n $(\"#taskWindow\").attr(\"data-task-id\", itemID);\n }\n });\n\n //View all assignee of that item\n var getAssignee = viewAssignee(itemID, type);\n assigneeChange = false;\n\n\n // Turn off processing diaglog when everything is loaded\n $.when(getItemData, getAssignee).done(function () {\n $(\".diaglog.success\").fadeOut(100);\n });\n\n if (type == \"backlog\") loadTaskBacklogTable(itemID);\n else {\n viewTaskComment(itemID);\n viewTaskFile(itemID);\n $(\"#btnSubmitComment\").attr(\"data-task-id\", itemID);\n $(\"#inputUploadFile\").attr(\"data-task-id\", itemID).val(\"\");\n }\n}", "function AddToGridDangerousGoods() {\n var _isEmpty = angular.equals(oneThreePackingEditModalCtrl.ePage.Masters.ShipmentDangerousGoods.FormView, {});\n if (_isEmpty) {\n toastr.warning(\"Please fill the Details..\")\n } else {\n var _index = oneThreePackingEditModalCtrl.ePage.Masters.ShipmentDangerousGoods.FormView.index\n\n if (_index == undefined) {\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentDangerousGoods.FormView.PK = \"\";\n oneThreePackingEditModalCtrl.ePage.Masters.Package.FormView.JobDangerousGoods.push(oneThreePackingEditModalCtrl.ePage.Masters.ShipmentDangerousGoods.FormView);\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentDangerousGoods.IsFormView = false;\n GetDangerousGoodsDetails();\n } else {\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentDangerousGoods.buttonText = 'Add New';\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentDangerousGoods.IsFormView = false;\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentDangerousGoods.FormView.IsModified = true;\n oneThreePackingEditModalCtrl.ePage.Masters.Package.FormView.JobDangerousGoods[_index] = oneThreePackingEditModalCtrl.ePage.Masters.ShipmentDangerousGoods.FormView;\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentDangerousGoods.FormView = {};\n }\n }\n }", "function dispatch_details_update_row(items, obj) {\n var item;\n for(i in items) {\n\titem = items[i];\n\tif((order_list_store.getValue(item, 'id')==obj['id'])) {\n\t attrs = order_list_store.getAttributes(item);\n\t for(j in attrs) {\n\t\torder_list_store.setValue(item, attrs[j], obj[attrs[j]]);\n\t }\n\t return true;\n\t}\n }\n return false;\n}", "function item_page (set_or_item, db){\n if (document.querySelector(`.${set_or_item}_div`)){\n document.querySelectorAll(`.${set_or_item}_div`).forEach(div =>{\n div.onclick = () =>{\n for (j=0; j<db.length; j++){\n if(db[j]['pk'].toString() === div.id){\n item_name = db[j]['fields'][`${set_or_item}_name`];\n item_id = db[j]['pk'];\n item_type = set_or_item;\n }\n }\n window.location.replace(\"http://127.0.0.1:8000/\" + item_name + \"/\" + item_type + \"/\" + item_id);\n }\n });\n }\n }", "function getItemText(item){return item&&$scope.itemText?$scope.itemText(getItemAsNameVal(item)):null;}", "function renderItemDetail(id, detailsSelector, insertAtSelector) {\n\t\tif (id && detailsSelector) {\n\t\t\t$('[data-item-rendered]').remove();\n\t\t\tvar details$ = $(detailsSelector).clone().hide();\n\t\t\tfetchItem(id, function(item) {\n\t\t\t\tdetails$.attr('id', 'item_' + item.item_id);\n\t\t\t\tfor (var f = 0; f < item.flags.length; f++) {\n\t\t\t\t\tdetails$.addClass(flagToClass(item.flags[f]));\n\t\t\t\t}\n\t\t\t\tdetails$.addClass(flagToClass(item.type, 'type'))\n\t\t\t\tdetails$.find('.item-id').append(item.item_id);\n\t\t\t\tdetails$.find('.item-name').append(item.name);\n\t\t\t\tdetails$.find('.item-description').append(stripHtml(item.description));\n\t\t\t\tdetails$.find('.item-type').append(splitName(item.type));\n\t\t\t\tdetails$.find('.item-level').append(item.level);\n\t\t\t\tdetails$.find('.item-rarity').append(item.rarity);\n\t\t\t\tdetails$.addClass('item-rarity-' + item.rarity.toLowerCase());\n\t\t\t\tdetails$.find('.item-value').append(parseItemValue(item.vendor_value));\n\t\t\t\tdetails$.find('.item-game-types').append(item.game_types.join(', '));\n\t\t\t\tdetails$.find('.item-flags').append(parseItemFlags(item.flags));\n\t\t\t\tdetails$.find('.item-restrictions').append(item.restrictions.join(', '));\n\t\t\t\tdetails$.find('.item-crafting-material').append(item.crafting_material);\n\t\t\t\t\n\t\t\t\tvar suffix_item_id = 0;\n\t\t\t\tvar itemstat = item.weapon || item.armor || item.back || item.trinket || item.upgrade_component || item.consumable;\n\t\t\t\tvar stats$ = details$.find('.stats').hide();\n\t\t\t\tif (itemstat) {\n\t\t\t\t\tif (itemstat.type && itemstat.type !== 'Default' && itemstat.type !== 'Generic') {\n\t\t\t\t\t\tdetails$.addClass(flagToClass(itemstat.type, 'subtype')).find('.item-type').empty().append(splitName(itemstat.type));\n\t\t\t\t\t}\n\t\t\t\t\tif (itemstat.damage_type) {\n\t\t\t\t\t\tstats$.find('.damage-type').append(itemstat.damage_type);\n\t\t\t\t\t}\n\t\t\t\t\tif (itemstat.weight_class) {\n\t\t\t\t\t\tstats$.find('.weight-class').append(itemstat.weight_class);\n\t\t\t\t\t}\n\t\t\t\t\tif (itemstat.min_power || itemstat.max_power) {\n\t\t\t\t\t\tstats$.find('.min-power').append(itemstat.min_power);\n\t\t\t\t\t\tstats$.find('.max-power').append(itemstat.max_power);\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof itemstat.defense !== 'undefined') {\n\t\t\t\t\t\tstats$.find('.defense').append(itemstat.defense);\n\t\t\t\t\t}\n\t\t\t\t\tif (itemstat.infusion_slots) {\n\t\t\t\t\t\tfor (var i = 0; i < itemstat.infusion_slots.length; i++) {\n\t\t\t\t\t\t\tvar inf = itemstat.infusion_slots[i];\n\t\t\t\t\t\t\tstats$.find('.infusion-slots').append('<span class=\"infusion-slot\">' + parseInfusionFlags(inf.flags) + '</span>');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (itemstat.infix_upgrade) {\n\t\t\t\t\t\tif (itemstat.infix_upgrade.buff) {\n\t\t\t\t\t\t\tstats$.find('.buff').append(stripHtml(itemstat.infix_upgrade.buff.description));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor (var a = 0; a < itemstat.infix_upgrade.attributes.length; a++) {\n\t\t\t\t\t\t\tvar attrib = itemstat.infix_upgrade.attributes[a];\n\t\t\t\t\t\t\tstats$.find('.attributes').append('<span class=\"attribute\">' + (attrib.modifier < 0 ? '-' : '+') + attrib.modifier + \n\t\t\t\t\t\t\t\t' ' + splitName(attrib.attribute) + '</span>');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (itemstat.description) { // consumables\n\t\t\t\t\t\tstats$.find('.buff').append(stripHtml(itemstat.description));\n\t\t\t\t\t}\n\t\t\t\t\tif (itemstat.suffix_item_id) {\n\t\t\t\t\t\tsuffix_item_id = itemstat.suffix_item_id;\n\t\t\t\t\t}\n\t\t\t\t\tif (itemstat.bonuses) {\n\t\t\t\t\t\tvar nbonus = itemstat.bonuses.length;\n\t\t\t\t\t\tfor (var b = 0; b < nbonus; b++) {\n\t\t\t\t\t\t\tstats$.find('.attributes').append('<span class=\"attribute attribute-set attribute-set-' + (b + 1) + '\">' + stripHtml(itemstat.bonuses[b]) + ' (' + (b + 1) + '/' + nbonus + ')</span>');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tstats$.show();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// for upgraded items\n\t\t\t\tvar upgrade$ = details$.find('.upgrade').hide();\n\t\t\t\tif (suffix_item_id) {\n\t\t\t\t\tconsole.log('Loading upgrade item: ' + suffix_item_id);\n\t\t\t\t\tfetchItem(suffix_item_id, function(upgrade) {\n\t\t\t\t\t\tif (upgrade && upgrade.upgrade_component) {\n\t\t\t\t\t\t\tupgrade$.attr('id', 'upgrade_item_' + upgrade.item_id);\n\t\t\t\t\t\t\tupgrade$.find('.upgrade-name').append(upgrade.name);\n\t\t\t\t\t\t\tupgrade$.find('.upgrade-rarity').append(upgrade.rarity);\n\t\t\t\t\t\t\tupgrade$.addClass('upgrade-rarity-' + upgrade.rarity.toLowerCase());\n\t\t\t\t\t\t\tif (upgrade.upgrade_component.infix_upgrade) {\n\t\t\t\t\t\t\t\tif (upgrade.upgrade_component.infix_upgrade.buff) {\n\t\t\t\t\t\t\t\t\tupgrade$.find('.upgrade-buff').append(stripHtml(upgrade.upgrade_component.infix_upgrade.buff.description));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tfor (var a = 0; a < upgrade.upgrade_component.infix_upgrade.attributes.length; a++) {\n\t\t\t\t\t\t\t\t\tvar attrib = upgrade.upgrade_component.infix_upgrade.attributes[a];\n\t\t\t\t\t\t\t\t\tupgrade$.find('.upgrade-attributes').append('<span class=\"upgrade-attribute\">' + (attrib.modified < 0 ? '-' : '+') + attrib.modifier +\n\t\t\t\t\t\t\t\t\t\t' ' + splitName(attrib.attribute) + '</span>');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (upgrade.upgrade_component.bonuses) {\n\t\t\t\t\t\t\t\tvar nbonus = upgrade.upgrade_component.bonuses.length;\n\t\t\t\t\t\t\t\tfor (var b = 0; b < nbonus; b++) {\n\t\t\t\t\t\t\t\t\tupgrade$.find('.upgrade-attributes').append('<span class=\"upgrade-attribute upgrade-set upgrade-set-' + (b + 1) + '\">' + stripHtml(upgrade.upgrade_component.bonuses[b]) + ' (' + (b + 1) + '/' + nbonus + ')</span>');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tupgrade$.show();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$(insertAtSelector).append(details$);\n\t\t\t\tdetails$.attr('data-item-rendered', 'true');\n\t\t\t\tdetails$.show();\n\t\t\t});\n\t\t}\n\t}", "processItems() {}", "function loadDetails(item) {\n let url = item.detailsUrl;\n return fetch(url).then(function(response) {\n return response.json();\n }).then(function(details) {\n //add details to the item\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.weight = details.weight;\n }).catch(function(e) {\n /* eslint-disable no-console */\n console.error(e);\n /* eslint-enable no-console */\n });\n }", "showDetailModal(item,e) {\n e.stopPropagation();\n const originalTask = JSON.parse(JSON.stringify(item));\n this.setState({\n detailConfirm: true,\n item: item,\n originalTask: originalTask,\n id: this.props.todoList.indexOf(item)\n });\n }", "function itemsClicked(callback) {\n var itemForm = {\n name : callback.item.naturalName,\n catalogCode : callback.item.catalogCode,\n number : 1\n };\n vm.store.createShoppingItem(itemForm);\n vm.externalModel = []; // use to clear the selected items\n }", "function ProductDetailsController($scope, __DataStore, appServices,\n\t$stateParams, __Form, $rootScope, $state, __Utils) {\n\n\t\tvar scope = this;\n\n\t\t\tscope.productID = __globals.getAppJSItem('productID');\n\t\t\tscope.categoryID = __globals.getAppJSItem('categoryID');\n scope.currencySymbol = __globals.getAppJSItem('currencySymbol');\n scope.currencyValue = __globals.getAppJSItem('currencyValue');\n\n\t\t\tscope = __Form.setup(scope, 'add_product_in_cart_form', 'productData', {\n\t modelUpdateWatcher:false\n\t });\n\t \n\t\t\tscope.pageStatus \t= false;\n\t \t\tscope.optionLength \t= false;\n\n \t/**\n * display all active products list\n *\n * @return void\n *---------------------------------------------------------------- */\n \t\n scope.getProductDetails = function() {\n\n\t // send http request to server\n \t__DataStore.fetch({\n\t 'apiURL' : 'product.quick.view.details.support_data',\n\t 'productID' : scope.productID,\n\t 'categoryID?' : scope.categoryID\n\t }).success(function(responseData) {\n \t \n \tappServices.processResponse(responseData, null, function(reactionCode) {\n \t\t\t\n\t\t\t\t\tvar requestData = responseData.data.details;\n\n\t\t\t\t\tscope.productDetails = requestData;\n\n\t\t\t\t\tscope.productData = {\n\t\t\t\t\t\t'name' : scope.productDetails.name, \n\t\t\t\t\t\t'quantity' : 3, \n\t\t\t\t\t\t'isCartExist': false\n\t\t\t\t\t};\n\n\t\t\t\t\tscope = __Form.updateModel(scope, scope.productData);\n\n\t\t \tscope.productDetails.basePriceWithAddonPrice = requestData.newTotalPrice;\n\n\t\t\t\t\tscope.newTotalPriceCount = requestData.newTotalPriceCount;\n\n\t\t\t\t\tscope.productDetails.selectedOptions = requestData.getSelectedOptions;\n\n\t\t\t\t\tif (scope.productDetails) {\n\t\t\t \tscope.productData.name = requestData.name;\n\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\tif(!_.isEmpty(scope.productDetails.getSelectedOptions)) {\n\t\t\t\t\t\tscope.optionLength = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.productDetails.priceDetails = {\n \t\t\t'option' \t : requestData.getSelectedOptions,\n \t\t\t'total' \t : requestData.getPrice.total,\n \t\t\t'base_price' : requestData.getPrice.base_price\n \t};\n\n \t// product quantity\n\t\t\t\t\tif (requestData.qtyCart > 0) {\n\n\t\t\t\t\t\tscope.productData.quantity = requestData.qtyCart;\n\t\t\t\t\t\tscope.checkNumber = true;\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscope.productData.quantity = 1;\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.btnQuantity = requestData.qtyCart;\n\t\t\t\t\tscope.productData.isCartExist = requestData.isCartExist;\n\n\t\t\t\t\tscope.pageStatus = true;\n\t\t\t\t\t\n\t\t });\n \t\t});\n };\n scope.getProductDetails();\n\n\n /**\n * increment decrement quantity\n *\n * @param boolean status \n * @param int quantity\n *\n * @return void\n *---------------------------------------------------------------- */\n\t \tscope.getQtyAction = function(status, quantity) {\n\n\t\t\t// if product status is true \n\t\t\tif (status == true) {\n\t\t\t\t(quantity == undefined || isNaN(quantity)) \n\t\t\t\t? scope.productData.quantity = 1 \n\t\t\t\t: scope.productData.quantity = quantity + 1;\n\n\t\t\t} else {\n\t\t\t\t// product quantity must be greterThan -1\n\t\t\t\tvar newValue = (quantity - 1);\n\t\t\t\t(newValue <= 0) \n\t\t\t\t? scope.productData.quantity = 1 \n\t\t\t\t: scope.productData.quantity = newValue;\n\t\t\t}\n\n\t\t};\n\t\t\n\n\t\t/**\n\t * Add product as a cart item\n\t *\n\t * @return void\n\t *---------------------------------------------------------------- */\n\tscope.cartAction = false;\n\n\tscope.addToCart = function() { \n\t\t\n\t __Form.process({\n\t apiURL : 'cart.add.item',\n\t productID : scope.productID\n\t }, scope).success(function(responseData) {\n\t \t\n\t \tscope.cartAction = true;\n\n\t \tvar requestData = responseData.data;\n\n\t appServices.processResponse(\n\t responseData,\n\t null, \n\t function() {\n\t \t\n\t \tscope.data = {\n\t 'cart_string': responseData.data.cartItems,\n\t 'status' : true\n\t }\n\t scope.updateCartRow(scope.productID, true);\n\t $scope.$emit('lw.update.cart.string', scope.data);\n\t }\n\t );\n\n\t });\n\t};\n\n // when the cart item remove from to cart\n $rootScope.$on('remove.cart.row',function(events,resposeData) {\n\n \tif (resposeData.status) {\n \t\t//scope.getProductDetails();\n \t\tscope.updateCartRow(scope.productID, true);\n \t};\n \n });\n\n\t/**\n\t * Add product as a cart item\n\t *\n\t * @return void\n\t *---------------------------------------------------------------- */\n\n\tscope.updateCartRow = function(productID, option) { \n\n\t\tvar checkOption = true;\n\n\t\tscope.addonPrices = [];\n\t\t\n\t\tif (scope.productData.options != undefined) {\n\t \t// hold option of addon_price related data \n\t \tscope.productDetails.selectedOptions = scope.productData.options[productID];\n\t \tangular.forEach(scope.productData.options[productID], \n\t \t\tfunction( value, key ) {\n\t \t\t\t\n\t\t\t \tthis.push({\n\t\t\t \t\t\toption_name:key,\n\t\t\t \t\t \tvalue_name :value.name,\n\t\t\t \t\t \taddon_price:value.addon_price_format\n\t\t\t \t});\n\t\t\t}, scope.addonPrices );\n\n\t \t// hold empty options data \n\t\t\tangular.forEach(scope.productData.options[productID], \n\t\t\t\tfunction( value, key ) {\n\n\t\t\t\t\tif (value == '' ) {\n\t\t\t\t\t\tcheckOption = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}, checkOption );\n\t\t} \n\n\t\t__Form.process({\n\t \tapiURL :'cart.product.qty.update',\n\t \tproductID : productID\n\t }, scope).success(function(responseData) {\n\n\t appServices.processResponse(\n\t responseData,\n\t null, \n\t function(reactionCode) {\n\n\t \tvar requestData = responseData.data;\n\n\t \tscope.productDetails.basePriceWithAddonPrice = requestData.formatedTotalPrice;\n \n\t \tscope.productDetails.priceDetails = {\n\t \t\t\t'option' \t : scope.productDetails.selectedOptions,\n\t \t\t\t'total' \t : requestData.totalPrice,\n\t \t\t\t'base_price' : requestData.base_price\n\t \t}\n\n\t\t\t\t\tscope.productData.isCartExist = requestData.isCartExist;\n\n\t \tif (requestData.qtyCart > 0 ) {\n\t\t\t\t\t\tscope.productData.quantity = requestData.qtyCart;\n\t\t\t\t\t\tscope.btnQuantity = requestData.qtyCart;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscope.btnQuantity = 0;\n\t\t\t\t\t\tscope.productData.quantity = 1;\n\t\t\t\t\t}\n\t }\n\t );\n\n\n\t });\n\n\t};\n\n\t}", "function renderNew() {\n Items.getAll()\n .then(res => {\n $scope.items = res.data;\n })\n .catch(err => {\n $scope.items = err;\n });\n }", "function RENDER_items(items) {\n\n }", "function addItem(item) {\n $state.go('main.addItem', {item: item, foodListId: $stateParams.foodListId});\n }", "_renderItem({ item }) {\n const custom = styles(this.props);\n const responsive = responsives(this.props);\n\n return (\n <View style={custom.PartView}>\n <ListItem style={custom.PartListItem} onPress={() => this._handleRead(item.worker_id, item.worker_fname, item.worker_sname, item.worker_lname, item.worker_email, item.worker_mobile, item.worker_address, item.worker_pincode, item.worker_tiw, item.worker_riw)}>\n <MaterialCommunityIcons name=\"worker\" style={custom.PartIcon}/>\n <Text style={responsive.PartName}>{item.worker_fname} {item.worker_sname} {item.worker_lname}</Text>\n </ListItem>\n </View>\n );\n }", "function getItem(itemId) {\n $.ajax({\n url: '/products/getitem/' + itemId,\n type: 'GET',\n\n\n }).then(data => {\n\n $(\"#item\").val(data[0].Ptype);\n $(\"#size\").val(data[0].size);\n $(\"#color\").val(data[0].color);\n $(\"#imgUrl\").val(data[0].imgUrl);\n $(\"#productUrl\").val(data[0].productUrl);\n $(\"#price\").val(data[0].price);\n $(\"#occasion\").val(data[0].occasion);\n $(\"#gender\").val(data[0].gender);\n $(\"#brand\").val(data[0].brand);\n $(\"#height\").val(data[0].height)\n $(\"#edititem\").val(data[0].id);\n\n })\n }", "saveItem() {\n let description = this.view.getDescription();\n let expireDate = this.view.getExpireDate();\n let errorMsgDescription = Validator.validateDescription(description);\n let errorMsgExpireDate = Validator.validateExpireDate(expireDate);\n if (errorMsgDescription.length > 0 || errorMsgExpireDate.length > 0) {\n if (errorMsgExpireDate.length > 0) {\n this.view.setInvalidExpireDate(errorMsgExpireDate);\n }\n if (errorMsgDescription.length > 0) {\n this.view.setInvalidDescription(errorMsgDescription);\n }\n this.view.setInputError(\n errorMsgDescription + \"<br>\" + errorMsgExpireDate\n );\n } else {\n if (this.item == null) {\n let itemDefault = new Item(\n \"default\",\n DateConverter.toString(new Date()),\n false\n );\n this.item = this.itemDao.save(itemDefault);\n }\n this.item.setDescription(description);\n this.item.setExpireDate(expireDate);\n this.view.setDescription(this.item.getDescription());\n this.view.setExpireDate(this.item.getExpireDate());\n this.view.setCurrentDate(this.item.getCreationDate());\n this.view.removeNewMark();\n this.view.viewMe();\n this.itemDao.update(this.item);\n }\n }", "function displayItemDetails(){\r\n var item = Office.cast.item.toItemRead(Office.context.mailbox.item);\r\n jQuery('#subject').text(item.subject);\r\n\r\n var from;\r\n if (item.itemType === Office.MailboxEnums.ItemType.Message) {\r\n from = Office.cast.item.toMessageRead(item).from;\r\n } else if (item.itemType === Office.MailboxEnums.ItemType.Appointment) {\r\n from = Office.cast.item.toAppointmentRead(item).organizer;\r\n }\r\n\r\n if (from) {\r\n jQuery('#from').text(from.displayName);\r\n jQuery('#from').click(function(){\r\n app.showNotification(from.displayName, from.emailAddress);\r\n });\r\n }\r\n }", "handlegood(event) {\n const goodId = event.detail; \n console.log(goodId); \n // Navigate to product record page\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n recordId: goodId,\n objectApiName: 'Product__c',\n actionName: 'view',\n },\n });\n }", "function clean_item()\n{\n // clean widget area before any add-action\n RMPApplication.debug (\"begin Item cleaned\");\n c_debug(debug.init, \"=> clean_item\");\n id_details_item.setVisible(true);\n id_details_item.open();\n RMPApplication.set(\"my_item\", \"{}\");\n RMPApplication.set(\"action\", \"add\");\n RMPApplication.debug(\"end \" + itemName + \" Widget Area cleaned\");\n}", "_renderItem(item,index)\n {\n \treturn(\n \t\t<ListItem item={item.item}/>\n \t\t)\n }", "get itemObjectId() {\n return this.catalogItemObj.id;\n }", "function et_update_item () {\n\n\t\tvar items = $(\"ul#menu-to-edit li.menu-item\");\n\t\t// Go through all items and display link & thumb\n\t\tfor ( var i = 0; i < items.length; i++ ) {\n\t\t\tvar id = $(items[i]).children(\"#nmi_item_id\").val();\n\n\t\t\tvar sibling = $(\"#edit-menu-item-attr-title-\"+id).parent().parent();\n\t\t\tvar image_div = $(\"li#menu-item-\"+id+\" .nmi-current-image\");\n\t\t\tvar link_div = $(\"li#menu-item-\"+id+\" .nmi-upload-link\");\n\t\t\tvar other_fields = $(\"li#menu-item-\"+id+\" .nmi-other-fields\");\n\n\t\t\tif ( image_div ) {\n\t\t\t\tsibling.after( image_div );\n\t\t\t\timage_div.show();\n\t\t\t}\n\t\t\tif ( link_div ) {\n\t\t\t\tsibling.after( link_div );\n\t\t\t\tlink_div.show();\n\t\t\t}\n\t\t\tif ( other_fields ) {\n\t\t\t\tsibling.after( other_fields );\n\t\t\t\tother_fields.show();\n\t\t\t}\n\n\t\t}\n\n\t\t// Save item ID on click on a link\n\t\t$(\".nmi-upload-link\").click( function() {\n\t\t\twindow.clicked_item_id = $(this).parent().parent().children(\"#nmi_item_id\").val();\n\t\t} );\n\n\t\t// Display alert when not added as featured\n\t\twindow.send_to_editor = function( html ) {\n\t\t\talert(nmi_vars.alert);\n\t\t\ttb_remove();\n\t\t};\n\t}", "function ItemDetails(i, item_id, alt_qty, uom_id, price_amt, price_disc, discpercent, boxtype_size, stock_qty, cart_id, mode, rateclass_id) {\r\n\tvar cart_session_id = CheckNumeric(document.getElementById(\"txt_session_id\").value);\r\n\tvar config_inventory_current_stock = CheckNumeric(document.getElementById(\"txt_config_inventory_current_stock\").value);\r\n\tvar location_id = CheckNumeric(document.getElementById(\"txt_location_id\").value);\r\n\tvar gst_type = document.getElementById(\"txt_gst_type\").value;\r\n\tvar branch_id = CheckNumeric(document.getElementById(\"txt_branch_id\").value);\r\n\tdocument.getElementById(\"cart_id\").value = cart_id;\r\n\tdocument.getElementById(\"uom_id\").value = uom_id;\r\n\trateclass_id = CheckNumeric(rateclass_id);\r\n\tif (rateclass_id == 0) {\r\n\t\trateclass_id = CheckNumeric(document.getElementById(\"dr_voucher_rateclass_id\").value);\r\n\t\t// alert(rateclass_id);\r\n\t\tif (rateclass_id == 0) {\r\n\t\t\talert(\"Select Rate Class!\");\r\n\t\t}\r\n\t}\r\n\tif (price_amt == 0 || price_amt == '' || isNaN(price_amt) == true || price_amt == null) {\r\n\t\tprice_amt = 0.0;\r\n\t}\r\n\tif (price_disc == 0 || price_disc == '' || isNaN(price_disc) == true || price_disc == null) {\r\n\t\tprice_disc = 0.0;\r\n\t}\r\n\tif (boxtype_size == 0 || boxtype_size == '' || isNaN(boxtype_size) == true || boxtype_size == null) {\r\n\t\tboxtype_size = 0.0;\r\n\t}\r\n\tvoucherclass_id = CheckNumeric(document.getElementById(\"txt_voucherclass_id\").value);\r\n\tvouchertype_id = CheckNumeric(document.getElementById(\"txt_vouchertype_id\").value);\r\n\t$('.searchresult').hide();\r\n\tvar voucher_so_id = CheckNumeric(document.getElementById(\"txt_voucher_so_id\").value);\r\n\tif (item_id != 0 && rateclass_id != 0) {\r\n\t\tvar id = 'itemindex_' + i;\r\n\t\tconsole.log('../accounting/invoice-details2.jsp?' \r\n\t\t\t\t+ 'cart_session_id=' + cart_session_id \r\n\t\t\t\t+ '&voucher_so_id=' + voucher_so_id \r\n\t\t\t\t+ '&row_no=' + i \r\n\t\t\t\t+ '&branch_id=' + branch_id \r\n\t\t\t\t+ '&gst_type=' + gst_type \r\n\t\t\t\t+ '&config_inventory_current_stock=' + config_inventory_current_stock \r\n\t\t\t\t+ '&location_id=' + location_id \r\n\t\t\t\t+ '&cart_item_id=' + item_id \r\n\t\t\t\t+ '&cart_boxtype_size=' + boxtype_size\r\n\t\t\t\t+ '&cart_discpercent=' + discpercent \r\n\t\t\t\t+ '&cart_vouchertype_id=' + vouchertype_id \r\n\t\t\t\t+ '&voucherclass_id=' + voucherclass_id \r\n\t\t\t\t+ '&cart_alt_qty=' + alt_qty \r\n\t\t\t\t+ '&cart_price=' + price_amt\r\n\t\t\t\t+ '&disc=' + price_disc \r\n\t\t\t\t+ '&cart_uom_id=' + uom_id \r\n\t\t\t\t+ '&mode=' + mode \r\n\t\t\t\t+ '&cart_id=' + cart_id \r\n\t\t\t\t+ '&configure1=yes' \r\n\t\t\t\t+ '&rateclass_id=' + rateclass_id);\r\n\t\tshowHintAddItem('../accounting/invoice-details2.jsp?' \r\n\t\t\t\t+ 'cart_session_id=' + cart_session_id \r\n\t\t\t\t+ '&voucher_so_id=' + voucher_so_id \r\n\t\t\t\t+ '&row_no=' + i \r\n\t\t\t\t+ '&branch_id=' + branch_id \r\n\t\t\t\t+ '&gst_type=' + gst_type \r\n\t\t\t\t+ '&config_inventory_current_stock=' + config_inventory_current_stock \r\n\t\t\t\t+ '&location_id=' + location_id \r\n\t\t\t\t+ '&cart_item_id=' + item_id \r\n\t\t\t\t+ '&cart_boxtype_size=' + boxtype_size\r\n\t\t\t\t+ '&cart_discpercent=' + discpercent \r\n\t\t\t\t+ '&cart_vouchertype_id=' + vouchertype_id \r\n\t\t\t\t+ '&voucherclass_id=' + voucherclass_id \r\n\t\t\t\t+ '&cart_alt_qty=' + alt_qty \r\n\t\t\t\t+ '&cart_price=' + price_amt\r\n\t\t\t\t+ '&disc=' + price_disc \r\n\t\t\t\t+ '&cart_uom_id=' + uom_id \r\n\t\t\t\t+ '&mode=' + mode \r\n\t\t\t\t+ '&cart_id=' + cart_id \r\n\t\t\t\t+ '&configure1=yes' \r\n\t\t\t\t+ '&rateclass_id=' + rateclass_id, id);\r\n\r\n\t\t// setTimeout('document.getElementById(\"txt_item_qty\").focus()', 500);\r\n\t\t// setTimeout('CalculateNewTotal()', 200);\r\n\t}\r\n}", "function useItem(){\n\t\n}", "_editItem() {\n // Edit Item from Order's Items array:\n let items = this.order.items;\n items[this.item.key] = this.item;\n this.order.items = items;\n // Update current Order:\n this.orderService.setCurrentOrder(this.order);\n this._closeEditItem(); // Close edit Product modal view:\n }", "function _selectResult(item) {\n\n \n\n itemUrl = item.data(\"url\");\n\n \n\n window.location = itemUrl;\n\n \n\n }", "function announceItemChange () {\n angular.isFunction($scope.itemChange) && $scope.itemChange(getItemAsNameVal($scope.selectedItem));\n }", "function announceItemChange () {\n angular.isFunction($scope.itemChange) && $scope.itemChange(getItemAsNameVal($scope.selectedItem));\n }", "function announceItemChange () {\n angular.isFunction($scope.itemChange) && $scope.itemChange(getItemAsNameVal($scope.selectedItem));\n }", "function showDetails(item) {\n\n\t\t\tflickrService.showDetails(item).then(function(response) {\n\t\t\t\tresponse.viewUrl = 'views/photoDetail';\n\t\t\t\tapp.showDialog(response);\n\n\t\t\t},handleError);\n\t\t}", "function displayItem(item) {\n // details will be details#error or details#warning\n const details = document.getElementById(item.type);\n const section = document.createElement('section');\n const h2 = document.createElement('h2');\n h2.innerHTML = item.title;\n section.appendChild(h2);\n const detailsDiv = document.createElement('div');\n detailsDiv.classList.add('details');\n detailsDiv.innerHTML = item.details;\n section.appendChild(detailsDiv);\n const learnMoreDiv = document.createElement('div');\n learnMoreDiv.classList.add('learn-more');\n learnMoreDiv.innerHTML = item.learnMore;\n section.appendChild(learnMoreDiv);\n details.appendChild(section);\n}", "handlePanelItemSelection(View3dShowImage, View3dImageUrl, SelItem){\n this.updateDress(SelItem);\n if(SelItem == null || SelItem.itemData.modelUrl == \"\"){ \n this.setState({\n showImage: View3dShowImage,\n imageUrl: View3dImageUrl\n });\n }\n }", "function SPGetdetails()\r\n{\r\n\tdebugger;\r\n\t$(\"#detailscls\").removeClass(\"active\");\r\n\t$(\"#historycls\").addClass(\"active\");\r\n\t\r\n\t$(\"#informationid\").empty()\t;\r\n\t$(\"#emailid\").empty();\r\n\t$(\"#departmntid\").empty();\r\n\t$(\"#detialsdiv\").hide() ;\r\n\t\t\r\n\tGetALLlibraryItems(SPDocudetailsId,DocumentlistName, siteurl,GetALLlibraryItemsSuccess,GetALLlibraryItemsFailure);\r\n\t}", "itemClick(){\n //store list item data\n UIActionCreators.simpleListItemRequest(this.props.store);\n //store transition\n RouterStore.storeNextTransitionKey(this.props.transitionKey || 'show-from-right');\n }", "renderListItems(items) {\n if (!items) return null;\n return items.map(item => (\n <ListItemInfo\n key={item.id}\n item={item}\n itemsNumber={items.length}\n campaignId={this.props.campaignId}\n redirectToItemPage={this.redirectToItemPage}\n />\n ));\n }", "_closeAddNewItem() {\n // Update current Order:\n this.order = this.orderService.getCurrentOrder();\n this.$scope.newItemModal.hide();\n this.item = this.defaultItem;\n }", "function loadDetails(item) {\n var url = item.detailsUrl;\n showLoadingMessage('Loading Pokemon details, please wait...');\n return fetch(url)\n .then(function(response) {\n hideLoadingMessage();\n return response.json();\n })\n .then(function(details) {\n // now add details to the list__item\n item.imageUrl = details.sprites.front_default;\n item.height = details.height;\n item.weight = details.weight;\n item.types = Object.keys(details.types);\n })\n .catch(function(e) {\n /* eslint-disable no-console */\n console.error(e);\n /* eslint-enable no-console */\n });\n }", "getItemId(item){return this.itemIdPath?this.get(this.itemIdPath,item):item}", "renderItem(item) { return item; }", "function getIdOfItem(item){\n return item.id;\n}", "function quickitemview(prodcode,buttonType) {\n\tpcode = prodcode;\n\tbtype = buttonType;\n\tvar url = '';\n\n\tGrainger.Modals.waitModal(\"quickitemview\", \"quickitemview\");\n\n\tif(btype=='update'){\n\t\turl = \"/product/quickview/\"+ pcode +\"?buttonType=\"+btype;\n\t} else {\n\t\turl = '/product/quickview/'+ pcode;\n\t}\n\n\tjQuery.ajax({\n\t\turl: url,\n\t\tcache: false,\n\t\tsuccess: function(data) {\n\t\t\tGrainger.Modals.createAndShowModal(\"quickitemview\", \"quickitemview\", data);\n\t\t},\n\t\terror: function() {\n\t\t\tGrainger.Modals.killModal();\n\t\t}\n\t});\n}", "onItemClick() {\n this.navigateTo(this.item.path);\n }", "function showdetailstask(itemGuid, element) {\n var $thea = $(element);\n var $idlist = $($thea.attr(\"data-otf-target\"))\n $idlist.load($thea.attr(\"data-otf-action\") + \"?itemguid=\" + itemGuid)\n}", "function handleItem(event){\n setCurrent(event.target.innerHTML);\n \n for(let i=0;i<todoList.length;i++){ //Get details of clicked item\n if(todoList[i].name===event.target.innerHTML){\n setTitleEdit(todoList[i].name);\n setDescriptionEdit(todoList[i].description);\n setTeamEdit(todoList[i].team);\n break;\n }\n }\n setListOpen(true);\n }", "handleClick(itemName, type) {\n console.log(\"Click in ProjDetail\");\n console.log(itemName);\n console.log(type);\n //Already got the table, sp, func details in this.state; don't need to call API again\n switch(type) {\n case \"tables\":\n this.getCurrentDBItem(this.state.tableItems, itemName, \"TABLE\");\n break;\n case \"sp\":\n this.getCurrentDBItem(this.state.spItems, itemName, \"SP\");\n break;\n case \"func\":\n this.getCurrentDBItem(this.state.funcItems, itemName, \"FUNCTION\");\n break;\n default:\n console.log(\"Sorry No Data\");\n }\n }", "constructor(item_data) {\n this.item_data = item_data\n }", "_handleItem(item)\n {\n var formData = new FormData();\n formData.append(\"item\", item);\n const requestOptions = \n {\n method: 'POST',\n body: formData,\n }\n // fetch item from database item table\n fetch('https://mi-linux.wlv.ac.uk/~2006100/ci3/index.php/Game/getItem', requestOptions)\n .then(res => res.json())\n .then(data => {\n \n const item = data[0];\n \n // check to see if item is a potion or equipment\n if(item.type === 'consumable') this._drinkPotion();\n else this._equipItem(item);\n \n })\n .catch(console.log);\n\n \n }", "function page_getItems(request) {\r\n\r\n\r\n\r\n return _PROCESSFORM;\r\n}", "function _itemHandler() {\n\t _tracks = [];\n\t _tracksById = {};\n\t _unknownCount = 0;\n\t }", "get item(){\n return items[this.itemID]\n }", "function openModal(item) {\n if(item.type == \"artist\"){\n getAlbums(item.id);\n } else {\n getTracks(item.id);\n }\n vm.showModal = item;\n }", "function bidItem() { }", "function getItemById(id){\n\t$.each($.fn.items, function(key, item) {\n\t\tif(String(item.id) == String(id)){\n\t\t\t$.fn.itemDetail = item;\n\t\t\treturn false;\n\t\t}\n\t});\n}", "function processItemDetails(response, media_type){\n let m_item = {};\n m_item['id'] = response.id;\n m_item['media_type'] = media_type;\n field_name = 'title';\n if(media_type == 'tv'){\n\tfield_name = \"name\";\n }\n if(response[field_name] !== undefined && response[field_name] !== null ){\n m_item['title'] = response[field_name];\n }\n if(response.genres !== undefined && response.genres.length > 0){\n let genre_list = [];\n for(var i = 0; i < response.genres.length ; i++){\n genre_list.push(response.genres[i].name);\n }\n m_item['genres'] = genre_list.join(\", \");\n }\n if(response.spoken_languages !== undefined && response.spoken_languages.length > 0){\n let lang_list = [];\n for(var i = 0; i < response.spoken_languages.length ; i++){\n lang_list.push(response.spoken_languages[i].english_name);\n }\n m_item['spoken_languages'] = lang_list.join(\",\");\n }\n let raw_release_date = response.release_date;\n if(media_type == \"tv\"){\n raw_release_date = response.first_air_date;\n }\n if(raw_release_date !== undefined && raw_release_date !== null){\n const split_date = raw_release_date.split(\"-\");\n m_item['year'] = split_date[0];\n m_item['release_date'] = raw_release_date;\n }\n let raw_runtime = response.runtime;\n if(media_type == \"tv\"){\n raw_runtime = response.episode_run_time[0];\n }\n if(raw_runtime !== undefined && raw_runtime !== null){\n const hours = Math.floor(Number(raw_runtime) /60);\n const minutes = Number(raw_runtime) % 60;\n\tif(hours === 0 || hours === 0.0){\n\t \n const runtime = minutes + \"mins\";\n m_item['runtime'] = runtime;\n\t}\n\telse{\n const runtime = hours + \"hrs\" + ' ' + minutes + \"mins\";\n m_item['runtime'] = runtime;\n\t}\n }\n if(response.overview !== undefined && response.overview !== null){\n m_item['overview'] = response.overview;\n }\n\n if(response.vote_average !== undefined && response.vote_average !== null){\n if (Number(response.vote_average) === 0.0){\n m_item['vote_average'] = \"0\";\n }\n else{\n m_item['vote_average'] = String(response.vote_average);\n }\n }\n\n if(response.tagline !== undefined && response.tagline !== null){\n m_item['tagline'] = response.tagline;\n }\n\n if(response.poster_path !== null && response.poster_path !== undefined){\n m_item['poster_path'] = post_prefix + response.poster_path;\n }\n else{\n\tm_item['poster_path'] = \"https://cinemaone.net/images/movie_placeholder.png\";\n }\n \n return m_item;\n}", "function showItems() {\n\n}", "function RedirectToItemDetails(ev) {\n let id = ev.target.parentNode.id;\n console.log(id);\n window.open('/items/' + id);\n}", "prepareItems(items) {\n if(!items)\n return items;\n \n if (items.total_count)\n this.total_count = items.total_count;\n \n if(items.items)\n items = items.items; // this is an exceptional behavior for Magento2 api for attributes\n\n return items;\n }", "function announceItemChange () {\n angular.isFunction($scope.itemChange) &&\n $scope.itemChange(getItemAsNameVal($scope.selectedItem));\n }", "get item() {\r\n return this.i.item;\r\n }", "goDetails(item, index){\n if(item && item.trip_cost >0){\n item.roundoffCost = Math.round(item.trip_cost).toFixed(2);\n item.roundoff = (Math.round(item.roundoffCost)-item.trip_cost).toFixed(2);\n this.props.navigation.push('RideDetails',{data:item});\n }else{\n item.roundoffCost = Math.round(item.estimate).toFixed(2);\n item.roundoff = (Math.round(item.roundoffCost)-item.estimate).toFixed(2);\n this.props.navigation.push('RideDetails',{data:item});\n }\n \n }", "function onViewInfo(item) {\n cdm.stepWizard({\n extension: \"DomainTenantExtension\",\n steps: [\n {\n template: \"viewInfo\",\n contactInfo: global.DomainTenantExtension.Controller.getCurrentUserInfo(),\n domain: selectedRow\n }\n ]\n }, { size: \"mediumplus\" });\n }", "function getTitle(item){\n return item.title;\n \n}" ]
[ "0.70145565", "0.68789303", "0.6768766", "0.63184226", "0.6291037", "0.61602044", "0.61037314", "0.6078139", "0.6070692", "0.60560954", "0.6024116", "0.60155594", "0.6015305", "0.60104316", "0.5976696", "0.5973291", "0.5960391", "0.59586275", "0.5946677", "0.5944019", "0.59269565", "0.5921036", "0.5914965", "0.59100413", "0.5908715", "0.58926374", "0.5866412", "0.5862766", "0.58578056", "0.58545405", "0.5850777", "0.5837731", "0.58367336", "0.5819512", "0.58100015", "0.5807887", "0.5806512", "0.5795221", "0.57866704", "0.57806927", "0.57746124", "0.5771226", "0.57627445", "0.5748808", "0.57474244", "0.5739588", "0.57381994", "0.572382", "0.57141113", "0.57109404", "0.5697643", "0.5695637", "0.5686071", "0.56827164", "0.5681852", "0.5681726", "0.5679029", "0.5677275", "0.5663963", "0.56581897", "0.5657196", "0.5643977", "0.56372213", "0.56369215", "0.5630491", "0.56191057", "0.56191057", "0.56191057", "0.5617951", "0.56155306", "0.5607433", "0.5605941", "0.55959", "0.55831057", "0.55754197", "0.5575266", "0.557146", "0.5569751", "0.5569068", "0.55668646", "0.55602235", "0.5559816", "0.553987", "0.5539267", "0.553411", "0.5532744", "0.55274737", "0.55248904", "0.5522651", "0.5517789", "0.5515991", "0.55125606", "0.5512392", "0.5511915", "0.5507885", "0.55009705", "0.5499906", "0.54967636", "0.5496627", "0.54956084", "0.5490981" ]
0.0
-1
Functions: Loads list of available website crawlers.
function loadCrawlers(e) { var datalist = document.getElementById('website-crawlers'); var country = $('input[name=country]:checked').val(); var crawlers = { uk: [ 'Yell.com' ], us: [ 'Citysearch.com', 'Yellowpages.com', 'Restaurant.com', 'Tripdavisor.com', 'Yelp.com' ] } var crawler; if (country == 'United States') { crawler = crawlers['us']; } else if (country == 'United Kingdom') { crawler = crawlers['uk']; } if (datalist.hasChildNodes()) { while (datalist.firstChild) { datalist.removeChild(datalist.firstChild); } } for (var i = 0; i < crawler.length; i++) { var option = document.createElement('option'); option.value = crawler[i]; datalist.appendChild(option); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDeslideSupportedSites() {\n return { \n 'about.com': '*.about.com', 'accessatlanta.com': '*.accessatlanta.com', 'answers.com': '*.answers.com', 'aol.com': '*.aol.com', 'askmen.com': '*.askmen.com', 'bleacherreport.com': '*.bleacherreport.com', 'cafemom.com': '*.cafemom.com', 'cbslocal.com': '*.cbslocal.com', 'cnn.com': '*.cnn.com', 'competitor.com': '*.competitor.com', 'complex.com': '*.complex.com', 'egotastic.com': '*.egotastic.com', 'eonline.com': '*.eonline.com', 'ew.com': '*.ew.com', 'fark.com': '*.fark.com', 'forbes.com': '*.forbes.com', 'howstuffworks.com': '*.howstuffworks.com', 'ibtimes.com': '*.ibtimes.com', 'imageshack.us': '*.imageshack.us', 'instyle.com': '*.instyle.com', 'latimes.com': '*.latimes.com', 'likes.com': '*.likes.com', 'mercurynews.com': '*.mercurynews.com', 'metromix.com': '*.metromix.com', 'msn.com': '*.msn.com', 'nymag.com': '*.nymag.com', 'nytimes.com': '*.nytimes.com', 'omaha.com': '*.omaha.com', 'photobucket.com': '*.photobucket.com', 'reuters.com': '*.reuters.com', 'seriouseats.com': '*.seriouseats.com', 'sfgate.com': '*.sfgate.com', 'slate.com': '*.slate.com', 'talkingpointsmemo.com': '*.talkingpointsmemo.com', 'theglobeandmail.com': '*.theglobeandmail.com', 'time.com': '*.time.com', 'topix.com': '*.topix.com', 'uproxx.com': '*.uproxx.com', 'viralnova.com': '*.viralnova.com', 'wtnh.com': '*.wtnh.com', 'yahoo.com': '*.yahoo.com', 'diply.com': '*diply.com', 'wildammo.com': '*wildammo.com', //' ': 'Coppermine galleries', // huh?\n 'abcnews.go.com': 'abcnews.go.com', \n 'espn.go.com': 'espn.go.com', 'all-that-is-interesting.com': 'all-that-is-interesting.com', 'animal.discovery.com': 'animal.discovery.com', 'arstechnica.com': 'arstechnica.com', 'austin.culturemap.com': 'austin.culturemap.com', 'blastr.com': 'blastr.com', 'blog.chron.com': 'blog.chron.com', 'blog.laptopmag.com': 'blog.laptopmag.com', 'blog.makezine.com': 'blog.makezine.com', 'blog.moviefone.com': 'blog.moviefone.com', 'blog.seattlepi.com': 'blog.seattlepi.com', 'blog.timesunion.com': 'blog.timesunion.com', 'blog.amctv.com': 'blogs.amctv.com', 'blog.laweekly.com': 'blogs.laweekly.com', 'bossip.com': 'bossip.com', 'boston.com': 'boston.com', 'thestreet.com': 'business-news.thestreet.com', 'bustedcoverage.com': 'bustedcoverage.com', 'buzzlie.com': 'buzzlie.com', 'celebritytoob.com': 'celebritytoob.com', 'celebuzz.com': 'celebslam.celebuzz.com', 'coed.com': 'coed.com', 'coedmagazine.com': 'coedmagazine.com', 'collegecandy.com': 'collegecandy.com', 'kiplinger.com': 'content.kiplinger.com', 'dailycaller.ca': 'dailycaller.ca', 'dailycaller.com': 'dailycaller.com', 'dailysanctuary.com': 'dailysanctuary.com', 'dallas.culturemap.com': 'dallas.culturemap.com', 'darkroom.baltimoresun.com': 'darkroom.baltimoresun.com', 'deadspin.com': 'deadspin.com', 'definition.org': 'definition.org', 'diffuser.fm': 'diffuser.fm', 'dvice.com': 'dvice.com', 'einestages.spiegel.de': 'einestages.spiegel.de', 'emgn.com': 'emgn.com', 'empireonline.com': 'empireonline.com', 'english.caixin.com': 'english.caixin.com', \n 'fansided.com': 'fansided.com', 'fashion.telegraph.co.uk': 'fashion.telegraph.co.uk', 'firstwefeast.com': 'firstwefeast.com', 'flavorwire.com': 'flavorwire.com', 'fu-berlin.de': 'fu-berlin.de', 'funnie.st': 'funnie.st', 'gamedayr.com': 'gamedayr.com', 'gamerant.com': 'gamerant.com', 'gamingbolt.com': 'gamingbolt.com', 'gawker.com': 'gawker.com', // Gawker Are Fucking Dead\n 'gizmodo.com': 'gizmodo.com', 'gothamist.com': 'gothamist.com', 'guff.com': 'guff.com', 'guyism.com': 'guyism.com', 'hdden.com': 'hdden.com', 'heavy.com': 'heavy.com', 'heldendesalltags.net': 'heldendesalltags.net', 'hollywoodlife.com': 'hollywoodlife.com', 'houston.culturemap.com': 'houston.culturemap.com', 'humorsignals.com': 'humorsignals.com', 'idolator.com': 'idolator.com', 'images.businessweek.com': 'images.businessweek.com', 'imgur.com': 'imgur.com', 'io9.com': 'io9.com', 'jalopnik.com': 'jalopnik.com', 'jezebel.com': 'jezebel.com', 'juicyceleb.com': 'juicyceleb.com', 'justviral.eu': 'justviral.eu', 'kittentoob.com': 'kittentoob.com', 'kotaku.com': 'kotaku.com', 'lifehacker.com': 'lifehacker.com', 'listcovery.com': 'listcovery.com', 'lotsoflaughters.com': 'lotoflaughters.com', 'm.n4g.com': 'm.n4g.com', 'm.spiegel.de': 'm.spiegel.de', 'madamenoire.com': 'madamenoire.com', 'makezine.com': 'makezine.com', 'mashable.com': 'mashable.com', 'mediacenter.dailycamera.com': 'mediacenter.dailycamera.com', 'mediagallery.usatoday.com': 'mediagallery.usatoday.com', 'menify.com': 'menify.com', 'mentalflare.com': 'mentalflare.com', 'metv.com': 'metv.com', 'mommynoire.com': 'mommynoire.com', 'motherjones.com': 'motherjones.com', 'moviesum.com': 'movieseum.com', 'msn.foxsports.com': 'msn.foxsports.com', 'myfox8.com': 'myfox8.com', 'n4g.com': 'n4g.com', 'natmonitor.com': 'natmonitor.com', 'news.cincinnati.com': 'news.cincinnati.com', 'news.cnet.com': 'news.cnet.com', 'news.discovery.com': 'news.discovery.com', 'news.moviefone.com': 'news.moviefone.com', 'news.nationalgeographic.com': 'news.nationalgeographic.com', 'news.xinhuanet.com': 'news.xinhuanet.com', 'nflspinzone.com': 'nflspinzone.com', 'noisey.vice.com': 'noisey.vice.com', 'nypost.com': 'nypost.com', 'opinion.people.com.cn': 'opinion.people.com.cn', 'origin.wtsp.com': 'origin.wtsp.com', 'perezhilton.com': 'perezhilton.com', 'photos.caixin.com': 'photos.caixin.com', 'photos.denverpost.com': 'photos.denverpost.com', 'photos.ellen.warnerbros.com': 'photos.ellen.warnerbros.com', 'photos.nj.com': 'photos.nj.com', 'photos.pennlive.com': 'photos.pennlive.com', 'photos.tmz.com': 'photos.tmz.com', 'photos.toofab.com': 'photos.toofab.com', 'picasaweb.google.com': 'picasaweb.google.com', 'popnhop.com': 'popnhop.com', 'puppytoob.com': 'puppytoob.com', 'pyz.am': 'pyz.am', 'radaronline.com': 'radaronline.com', 'rantchic.com': 'rantchic.com', 'regretfulmorning.com': 'regretfulmorning.com', 'reviews.cnet.com': 'reviews.cnet.com', 'ripbird.com': 'ripbird.com', 'rottenpanda.com': 'rottenpanda.com', 'runt-of-the-web.com': 'runt-of-the-web.com', 'salary.com': 'salary.com', 'screencrush.com': 'screencrush.com', 'screenrant.com': 'screenrant.com', 'seattletimes.com': 'seattletimes.com', 'seattletimes.nwsource.com': 'seattletimes.nwsource.com', 'shortlist.com': 'shortlist.com', 'slideshow.nbcnews.com': 'slideshow.nbcnews.com', 'slideshow.today.com': 'slideshow.today.com', 'slideshows.collegehumor.com': 'slideshows.collegehumor.com', 'socialitelife.com': 'socialitelife.com', 'static.thefrisky.com': 'static.thefrisky.com', 'story.wittyfeed.com': 'story.wittyfeed.com', 'styleblazer.com': 'styleblazer.com', 'sz-magazin.sueddeutsche.de': 'sz-magazin.sueddeutsche.de', 'theblemish.com': 'theblemish.com', 'thehill.com': 'thehill.com', 'theweek.com': 'theweek.com', 'thewire.co.uk': 'thewire.co.uk', 'time.com': 'time.com', 'travel.allwomenstalk.com': 'travel.allwomenstalk.com', // always wonder how to parse this - \"all women's talk\" or \"all women stalk\"??\n 'twentytwowords.com': 'twentytwowords.com', 'venturebeat.com': 'venturebeat.com', 'viewmixed.com': 'viewmixed.com', 'wallstcheatsheet.com': 'wallstcheatsheet.com', 'whatculture.com': 'whatculture.com', 'worldwideinterweb.com': 'worldwideinterweb.com', 'worthly.com': 'worthly.com', 'wtkr.com': 'wtkr.com', 'wtvr.com': 'wtvr.com', '10best.com': 'www.10best.com', '123inspiration.com': 'www.123inspiration.com', '29-95.com': 'www.29-95.com', 'aarp.org': 'www.aarp.org', 'adweek.com': 'www.adweek.com', 'ajc.com': 'www.ajc.com', 'animalplanet.com': 'www.animalplanet.com', 'aolnews.com': 'www.aolnews.com', 'art-magazin.de': 'www.art-magazin.de', 'autobild.de': 'www.autobild.de', 'azcentral.com': 'www.azcentral.com', 'azfamily.com': 'www.azfamily.com', 'babble.com': 'www.babble.com', 'baltimoresun.com': 'www.baltimoresun.com', 'bankrate.com': 'www.bankrate.com', 'bbc.co.uk': 'www.bbc.co.uk', 'bbc.com': 'www.bbc.com', 'belfasttelegraph.co.uk': 'www.belfasttelegraph.co.uk', 'bellasugar.com': 'www.bellasugar.com', 'berliner-zeitung.de': 'www.berliner-zeitung.de', 'bild.de': 'www.bild.de', 'bizjournals.com': 'www.bizjournals.com', 'blastr.com': 'www.blastr.com', 'bleedingcool.com': 'www.bleedingcool.com', 'bloomberg.com': 'www.bloomberg.com', 'bobvila.com': 'www.bobvila.com', 'bonappetit.com': 'www.bonappetit.com', 'boredlion.com': 'www.boredlion.com', 'boston.com': 'www.boston.com', 'bostonherald.com': 'www.bostonherald.com', 'bracketsdaily.com': 'www.bracketsdaily.com', 'brainjet.com': 'www.brainjet.com', 'break.com': 'www.break.com', 'brisbanetimes.com.au': 'www.brisbanetimes.com.au', 'brobible.com': 'www.brobible.com', // ew\n 'buddytv.com': 'www.buddytv.com', 'businessinsider.com': 'www.businessinsider.com', 'businessnewsdaily.com': 'www.businessnewsdaily.com', 'bustle.com': 'www.bustle.com', 'buzzfeed.com': 'www.buzzfeed.com', 'buzzsugar.com': 'www.buzzsugar.com', 'bytesized.me': 'www.bytesized.me', 'canberratimes.com.au': 'www.canberratimes.com.au', 'casasugar.com': 'www.casasugar.com', 'cbc.ca': 'www.cbc.ca', 'cbs.com': 'www.cbs.com', 'cbsnews.com': 'www.cbsnews.com', 'cbssports.com': 'www.cbssports.com', 'celebritynetworth.com': 'www.celebritynetworth.com', 'celebstyle.com': 'www.celebstyle.com', // ' ': 'www.celebuzz.com', \n 'celebzen.com': 'www.celebzen.com', 'celebzen.com.au': 'www.celebzen.com.au', 'chacha.com': 'www.chacha.com', 'cheatcc.com': 'www.cheatcc.com', 'chicagotribune.com': 'www.chicagotribune.com', 'chip.de': 'www.chip.de', 'chron.com': 'www.chron.com', 'cinemablend.com': 'www.cinemablend.com', 'cio.com': 'www.cio.com', 'classicfm.com': 'www.classicfm.com', 'clickorlando.com': 'www.clickorlando.com', 'cnbc.com': 'www.cnbc.com', 'cntraveler.com': 'www.cntraveler.com', 'collegehumor.com': 'www.collegehumor.com', 'comicbookmovie.com': 'www.comicbookmovie.com', 'complexmag.ca': 'www.complexmag.ca', 'complexmag.com': 'www.complexmag.com', 'computerworld.com': 'www.computerworld.com', 'corriere.it': 'www.corriere.it', 'cosmopolitan.co.uk': 'www.cosmopolitan.co.uk', 'cosmopolitan.com ': 'www.cosmopolitan.com', 'courant.com': 'www.courant.com', 'cracked.com': 'www.cracked.com', 'csmonitor.com': 'www.csmonitor.com', 'csoonline.com': 'www.csoonline.com', 'ctnow.com': 'www.ctnow.com', 'dailyfunlists.com': 'www.dailyfunlists.com', 'dailygazette.com': 'www.dailygazette.com', 'dallasobserver.com': 'www.dallasobserver.com', 'darkreading.com': 'www.darkreading.com', 'daytondailynews.com': 'www.daytondailynews.com', 'delish.com': 'www.delish.com', 'designsponge.com': 'www.designsponge.com', 'desmoinesregister.com': 'www.desmoinesregister.com', 'digitalone.com.sg': 'www.digitalone.com.sg', 'digitalspy.co.uk': 'www.digitalspy.co.uk', 'digitalspy.com': 'www.digitalspy.com', 'digitalspy.com.au': 'www.digitalspy.com.au', 'dispatch.com': 'www.dispatch.com', 'dorkly.com': 'www.dorkly.com', 'ebaumsworld.com': 'www.ebaumsworld.com', 'elle.com': 'www.elle.com', 'empireonline.com': 'www.empireonline.com', 'entertainmentwise.com': 'www.entertainmentwise.com', 'environmentalgraffiti.com': 'www.environmentalgraffiti.com', 'escapehere.com': 'www.escapehere.com', 'esquire.com': 'www.esquire.com', 'everyjoe.com': 'www.everyjoe.com', 'eweek.com': 'www.eweek.com', 'examiner.com': 'www.examiner.com', 'fabsugar.com': 'www.fabsugar.com', 'fame10.com': 'www.fame10.com', 'fastcodesign.com': 'www.fastcodesign.com', 'faz.net': 'www.faz.net', 'fieldandstream.com': 'www.fieldandstream.com', 'fitsugar.com': 'www.fitsugar.com', 'flavorwire.com': 'www.flavorwire.com', 'focus.de': 'www.focus.de', 'food.com': 'www.food.com', 'foodandwine.com': 'www.foodandwine.com', 'footballnation.com': 'www.footballnation.com', 'foreignpolicy.com': 'www.foreignpolicy.com', 'fox2now.com': 'www.fox2now.com', 'fox40.com': 'www.fox40.com', 'fox59.com': 'www.fox59.com', 'fox5sandiego.com': 'www.fox5sandiego.com', 'foxnews.com': 'www.foxnews.com', 'fr-online.de': 'www.fr-online.de', 'gameranx.com': 'www.gameranx.com', 'gamesblog.it': 'www.gamesblog.it', 'gamespot.com': 'www.gamespot.com', 'gamesradar.com': 'www.gamesradar.com', 'geeksaresexy.net': 'www.geeksaresexy.net', 'geeksugar.com': 'www.geeksugar.com', 'gigwise.com': 'www.gigwise.com', 'gizmopod.com': 'www.gizmopod.com', 'golf.com': 'www.golf.com', 'gq.com': 'www.gq.com', 'grated.com': 'www.grated.com', 'guardian.co.uk': 'www.guardian.co.uk', 'haikudeck.com': 'www.haikudeck.com', 'harpersbazaar.com': 'www.harpersbazaar.com', 'health.com': 'www.health.com', 'heise.de': 'www.heise.de', 'hgtvremodels.com': 'www.hgtvremodels.com', 'highrated.net': 'www.highrated.net', 'hitfix.com': 'www.hitfix.com', 'hlntv.com': 'www.hlntv.com', 'hollyscoop.com': 'www.hollyscoop.com', 'hollywood.com': 'www.hollywood.com', 'hollywoodreporter.com': 'www.hollywoodreporter.com', 'hollywoodtuna.com': 'www.hollywoodtuna.com', 'houstonpress.com': 'www.houstonpress.com', 'huffingtonpost.com': 'www.huffingtonpost.*', // TODO\n 'idolator.com': 'www.idolator.com', 'ign.com': 'www.ign.com', 'imdb.com': 'www.imdb.com', 'informationweek.com': 'www.informationweek.com', 'infoworld.com': 'www.infoworld.com', 'irishcentral.com': 'www.irishcentral.com', 'itworld.com': 'www.itworld.com', 'ivillage.com': 'www.ivillage.com', 'kare11.com': 'www.kare11.com', 'katu.com': 'www.katu.com', 'kentucky.com': 'www.kentucky.com', 'kicker.de': 'www.kicker.de', 'killsometime.com': 'www.killsometime.com', 'kiplinger.com': 'www.kiplinger.com', 'kitv.com': 'www.kitv.com', 'ktla.com': 'www.ktla.com', 'ktvu.com': 'www.ktvu.com', 'kvia.com': 'www.kvia.com', 'laudable.com': 'www.laudable.com', 'laweekly.com': 'www.laweekly.com', 'life.com': 'www.life.com', 'lifebuzz.com': 'www.lifebuzz.com', 'lifedaily.com': 'www.lifedaily.com', 'lifescript.com': 'www.lifescript.com', 'lilsugar.com': 'www.lilsugar.com', 'littlethings.com': 'www.littlethings.com', 'livescience.com': 'www.livescience.com', 'livestrong.com': 'www.livestrong.com', 'local10.com': 'www.local10.com', 'london2012.com': 'www.london2012.com', 'makezine.com': 'www.makezine.com', 'mandatory.com': 'www.mandatory.com', 'marketwatch.com': 'www.marketwatch.com', 'mcall.com': 'www.mcall.com', 'menshealth.com': 'www.menshealth.com', 'miamiherald.com': 'www.miamiherald.com', 'mirror.co.uk': 'www.mirror.co.uk', 'mlive.com': 'www.mlive.com', 'mnn.com': 'www.mnn.com', 'monopol-magazin.de': 'www.monopol-magazin.de', 'motherjones.com': 'www.motherjones.com', 'myfox8.com': 'www.myfox8.com', 'myhealthnewsdaily.com': 'www.myhealthnewsdaily.com', 'mysanantonio.com': 'www.mysanantonio.com', 'nationaltimes.com.au': 'www.nationaltimes.com.au', 'nba.com': 'www.nba.com', 'nbc.com': 'www.nbc*', // TODO\n 'nbcnews.com': 'www.nbcnews.com', 'networkworld.com': 'www.networkworld.com', 'neverunderdressed.com': 'www.neverunderdressed.com', 'news800.com': 'www.news800.com', 'newsarama.com': 'www.newsarama.com', 'newser.com': 'www.newser.com', 'newstimes.com': 'www.newstimes.com', 'newyorker.com': 'www.newyorker.com', 'nfl.com': 'www.nfl.com', 'ngz-online.de': 'www.ngz-online.de', 'nj.com': 'www.nj.com', 'nme.com': 'www.nme.com', 'notsafeforwhat.com': 'www.notsafeforwhat.com', 'npr.org': 'www.npr.org', 'nsmbl.nl': 'www.nsmbl.nl', 'numberfire.com': 'www.numberfire.com', 'nuts.co.uk': 'www.nuts.co.uk', 'nydailynews.com': 'www.nydailynews.com', 'nypost.com': 'www.nypost.com', 'ocregister.com': 'www.ocregister.com', 'ocweekly.com': 'www.ocweekly.com', 'officialplaystationmagazine.co.uk': 'www.officialplaystationmagazine.co.uk', 'omghacks.com': 'www.omghacks.com', 'opposingviews.com': 'www.opposingviews.com', 'oregonlive.com': 'www.oregonlive.com', 'orlandosentinel.com': 'www.orlandosentinel.com', 'ouramazingplanet.com': 'www.ouramazingplanet.com', 'parenting.com': 'www.parenting.com', 'parents.com': 'www.parents.com', 'parentsociety.com': 'www.parentsociety.com', 'pcgamer.com': 'www.pcgamer.com', 'pcmag.com': 'www.pcmag.com', 'pcworld.com': 'www.pcworld.com', 'people.com': 'www.people.com', 'peoplepets.com': 'www.peoplepets.com', 'peoplestylewatch.com': 'www.peoplestylewatch.com', 'petsugar.com': 'www.petsugar.com', 'philly.com': 'www.philly.com', 'phoenixnewtimes.com': 'www.phoenixnewtimes.com', 'politico.com': 'www.politico.com', 'popcrunch.com': 'www.popcrunch.com', 'popsci.com': 'www.popsci.com', 'popsugar.com': 'www.popsugar.com', 'popularmechanics.com': 'www.popularmechanics.com', 'press-citizen.com': 'www.press-citizen.com', 'pressroomvip.com': 'www.pressroomvip.com', 'q13fox.com': 'www.q13fox.com', 'ranker.com': 'www.ranker.com', 'rantchic.com': 'www.rantchic.com', 'rantfood.com': 'www.rantfood.com', 'rantlifestyle.com': 'www.rantlifestyle.com', 'rantsports.com': 'www.rantsports.com', 'rd.com': 'www.rd.com', 'readersdigest.ca': 'www.readersdigest.ca', 'realclearscience.com': 'www.realclearscience.com', 'realclearworld.com': 'www.realclearworld.com', 'realsimple.com': 'www.realsimple.com', 'realtor.com': 'www.realtor.com', 'rebelcircus.com': 'www.rebelcircus.com', 'redeyechicago.com': 'www.redeyechicago.com', 'refinedguy.com': 'www.refinedguy.com', 'refinery29.com': 'www.refinery29.com', 'repubblica.it': 'www.repubblica.it', 'riverfronttimes.com': 'www.riverfronttimes.com', 'roasted.com': 'www.roasted.com', 'rollingstone.com': 'www.rollingstone.com', 'rottenpanda.com': 'www.rottenpanda.com', 'rottentomatoes.com': 'www.rottentomatoes.com', 'rp-online.de': 'www.rp-online.de', 'rsvlts.com': 'www.rsvlts.com', // 'salary.com': 'www.salary.com', \n 'salon.com': 'www.salon.com', 'savvysugar.com': 'www.savvysugar.com', 'seattlepi.com': 'www.seattlepi.com', 'seattleweekly.com': 'www.seattleweekly.com', 'sfweekly.com': 'www.sfweekly.com', 'sfx.co.uk': 'www.sfx.co.uk', 'shape.com': 'www.shape.com', 'shebudgets.com': 'www.shebudgets.com', 'shefinds.com': 'www.shefinds.com', 'shortlist.com': 'www.shortlist.com', 'si.com': 'www.si.com', 'slideshare.net': 'www.slideshare.net', 'sltrib.com': 'www.sltrib.com', 'smh.com.au': 'www.smh.com.au', 'smithsonianmag.com': 'www.smithsonianmag.com', 'snakkle.com': 'www.snakkle.com', 'southernliving.com': 'www.southernliving.com', 'space.com': 'www.space.com', 'spiegel.de': 'www.spiegel.de', 'spin.com': 'www.spin.com', 'sportal.de': 'www.sportal.de', 'sportsradiokjr.com': 'www.sportsradiokjr.com', 'stamfordadvocate.com': 'www.stamfordadvocate.com', 'star-telegram.com': 'www.star-telegram.com', 'starpulse.com': 'www.starpulse.com', 'stereogum.com': 'www.stereogum.com', 'stereotude.com': 'www.stereotude.com', 'stern.de': 'www.stern.de', 'stuff.co.nz': 'www.stuff.co.nz', 'stuffyoushouldknow.com': 'www.stuffyoushouldknow.com', 'stylebistro.com': 'www.stylebistro.com', 'stylelist.com': 'www.stylelist.com', 'stylist.co.uk': 'www.stylist.co.uk', 'sueddeutsche.de': 'www.sueddeutsche.de', 'suggest.com': 'www.suggest.com', 'sun-sentinel.com': 'www.sun-sentinel.com', 'tagesschau.de': 'www.tagesschau.de', 'tagesspiegel.de': 'www.tagesspiegel.de', 'takepart.com': 'www.takepart.com', 'techconnect.com': 'www.techconnect.com', 'technewsdaily.com': 'www.technewsdaily.com', 'techradar.com': 'www.techradar.com', 'techrepublic.com': 'www.techrepublic.com', 'techworld.com.au': 'www.techworld.com.au', 'telegraph.co.uk': 'www.telegraph.co.uk', 'theage.com.au': 'www.theage.com.au', 'theatlantic.com': 'www.theatlantic.com', 'thedailybeast.com': 'www.thedailybeast.com', 'thedailymeal.com': 'www.thedailymeal.com', 'thefiscaltimes.com': 'www.thefiscaltimes.com', 'thefrisky.com': 'www.thefrisky.com', 'thefumble.com': 'www.thefumble.com', 'theguardian.com': 'www.theguardian.com', 'theleek.com': 'www.theleek.com', 'thelocal.com': 'www.thelocal.*', // TODO\n 'theonion.com': 'www.theonion.com', 'thepostgame.com': 'www.thepostgame.com', 'therichest.com': 'www.therichest.com', 'thesmokinggun.com': 'www.thesmokinggun.com', 'thestreet.com': 'www.thestreet.com', 'thesun.co.uk': 'www.thesun.co.uk', 'thesuperficial.com': 'www.thesuperficial.com', 'thevine.com.au': 'www.thevine.com.au', 'thewrap.com': 'www.thewrap.com', 'thinkadvisor.com': 'www.thinkadvisor.com', 'thisoldhouse.com': 'www.thisoldhouse.com', 'tmz.com': 'www.tmz.com', 'today.com': 'www.today.com', 'tomorrowoman.com': 'www.tomorrowoman.com', 'tomsguide.com': 'www.tomsguide.com', 'tomshardware.com': 'www.tomshardware.com', 'topgear.com': 'www.topgear.com', 'torontosun.com': 'www.torontosun.com', 'totalfilm.com': 'www.totalfilm.com', 'totalprosports.com': 'www.totalprosports.com', 'travelandleisure.com': 'www.travelandleisure.com', 'treehugger.com': 'www.treehugger.com', 'tressugar.com': 'www.tressugar.com', 'trutv.com': 'www.trutv.com', 'tvguide.com': 'www.tvguide.com', 'tvovermind.com': 'www.tvovermind.com', 'upi.com': 'www.upi.com', 'usmagazine.com': 'www.usmagazine.com', 'usnews.com': 'www.usnews.com', 'vanityfair.com': 'www.vanityfair.com', 'vg247.com': 'www.vg247.com', 'vh1.com': 'www.vh1.com', 'vice.com': 'www.vice.com', 'villagevoice.com': 'www.villagevoice.com', 'viralands.com': 'www.viralands.com', 'vulture.com': 'www.vulture.com', 'washingtonpost.com': 'www.washingtonpost.com', 'watoday.com.au': 'www.watoday.com.au', 'wbaltv.com': 'www.wbaltv.com', 'wcvb.com': 'www.wcvb.com', 'weather.com': 'www.weather.com', 'weblyest.com': 'www.weblyest.com', 'welt.de': 'www.welt.de', 'wesh.com': 'www.wesh.com', 'westworld.com': 'www.westword.com', 'wftv.com': 'www.wftv.com', 'wgal.com': 'www.wgal.com', 'whas11.com': 'www.whas11.com', 'wholeliving.com': 'www.wholeliving.com', 'wired.co.uk': 'www.wired.co.uk', 'wired.com': 'www.wired.com', 'wisn.com': 'www.wisn.com', 'wittyfeed.com': 'www.wittyfeed.com', 'wlac.com': 'www.wlac.com', 'wlsam.com': 'www.wlsam.com', 'wlwt.com': 'www.wlwt.com', 'wmtw.com': 'www.wmtw.com', 'wowthatscool.com': 'www.wowthatscool.com', 'wpix.com': 'www.wpix.com', 'wptv.com': 'www.wptv.com', 'wsbtv.com': 'www.wsbtv.com', 'wtae.com': 'www.wtae.com', 'wtkr.com': 'www.wtkr.com', 'wtsp.com': 'www.wtsp.com', 'wusa9.com': 'www.wusa9.com', 'wwe.com': 'www.wwe.com', 'wwtdd.com': 'www.wwtdd.com', 'yumsugar.com': 'www.yumsugar.com', 'zagat.com': 'www.zagat.com', 'zap2it.com': 'www.zap2it.com', 'zdnet.com': 'www.zdnet.com', 'zeit.de': 'www.zeit.de', 'zimbio.com': 'www.zimbio.com', 'www2.tbo.com': 'www2.tbo.com', 'xfinity.comcast.net': 'xfinity.comcast.net', 'xhamster.com': 'xhamster.com' // not sure about this one\n };\n}", "function Crawler() {\n // Array of files and directories\n this.alldirs = [];\n this.allfiles = [];\n\n this.crawlingCompleted = null;\n this.filesCount = 1;\n}", "function getSupportedSitesInfo() {\n var sites = {\n\n // Example URLs:\n // http://www.refinery29.com/2016/12/133127/how-to-wrap-presents\n \"refinery29.com\": {\n loadAll: function (thisInfo, fullArticleContainer, url) {\n addClassToDOMElements('.opener', 'isVisible active', function (unused) {\n addClassToDOMElements('.slide', 'isVisible active', function (msg) {\n displayResult('Loaded ' + (msg.numLoaded ? msg.numLoaded : 'all') + ' slides');\n });\n });\n }\n },\n\n \"knowable.com\": {\n // Example URLs:\n // http://www.knowable.com/a/23-people-were-asked-what-is-the-most-messed-up-family-secret-you-know/p-1\n getReplaceFormat: function (url) {\n var ret = '';\n var regex = /(http[s]?:\\/\\/)?(www\\.)*(knowable\\.com\\/a\\/[^\\/]+)((\\/p-)([0-9]+))?(.*)/i;\n var matches = url.match(regex);\n if (!matches) {\n renderStatus('Invalid URL format :(');\n return ret;\n }\n // Reconstruct URL\n ret += (matches[1] ? matches[1] : '') // http://\n + (matches[2] ? matches[2] : '') // www.\n + (matches[3]) // knowable.com/a/article-title-here\n + (matches[4] ? matches[5] + '{0}' : '/p-{0}') // /p-X\n + (matches[7] ? matches[7] : ''); // anything after that\n return ret;\n },\n articleMeatSelector: '.article-body',\n isLastPage: function (responseText) {\n // If there isn't a 'Next' button, or there is one that links to '/t/end-gallery',\n // this is the last page\n var html = $.parseHTML(responseText);\n var nextLink = $(html).find('.article-body .btn-next-xl');\n return (!nextLink.length || nextLink.attr('href') == '/t/end-gallery');\n },\n loadAll: function (thisInfo, fullArticleContainer, url) {\n // Recursively retrieve pages of article until the last one\n var urlFormat = thisInfo.getReplaceFormat(url);\n var addPage = function (pageNum) {\n httpGet(urlFormat.format(pageNum), function (responseText) {\n // Get the meat of the article and append it to our fullArticleContainer element\n var html = $.parseHTML(responseText);\n var articleMeat = $(html).find(thisInfo.articleMeatSelector);\n if (pageNum > 1) { // hide article title after page 1\n articleMeat.find('.article-header').addClass('hidden');\n }\n articleMeat.find('.article-footer-v2').addClass('hidden');\n fullArticleContainer.append(articleMeat);\n // Examine the page. If it's the last one, add the elements to the page;\n // otherwise, keep going.\n if (thisInfo.isLastPage(responseText)) {\n fullArticleContainer.addClass(thisInfo.articleMeatSelector);\n // Done - get the appropriate element on the page and replace it with \n // the element that we created.\n replaceDOMElements(thisInfo.articleMeatSelector, fullArticleContainer[0].outerHTML, function (msg) {\n if (msg && msg.success) {\n displayResult('Loaded ' + (pageNum) + ' pages');\n }\n else {\n console.error(msg.error);\n displayResult(GENERIC_ERROR);\n }\n });\n }\n else {\n addPage(pageNum + 1);\n }\n });\n }\n addPage(1);\n }\n },\n\n \"suggest.com\": { // also applies to minq.com\n // Example URLs:\n // http://www.suggest.com/lifestyle/1600362/how-did-they-even-get-hired-employees-share-their-17-most-insane-crazy-employee-stories?story_page=1\n // http://www.minq.com/lifestyle/1599990/21-people-share-awesome-stories-about-how-they-became-friends-with-their-bffs?story_page=1\n getReplaceFormat: function (url) {\n var ret = '';\n var regex = /(http[s]?:\\/\\/)?(www\\.)*(.+\\.com\\/[^\\/]+\\/[^\\/]+\\/[^\\/]+)((\\/\\?story_page=)([0-9]+))?(.*)/i;\n var matches = url.match(regex);\n if (!matches) {\n renderStatus('Invalid URL format :(');\n return ret;\n }\n // Reconstruct URL\n ret += (matches[1] ? matches[1] : '') // http://\n + (matches[2] ? matches[2] : '') // www.\n + (matches[3]) // suggest.com/section/1234/article-title-here OR minq.com/...\n + (matches[4] ? matches[5] + '{0}' : '/?story_page={0}') // /?story_page=X\n + (matches[7] && matches[7] != '/' ? matches[7] : ''); // anything after that\n return ret;\n },\n articleMeatSelector: '.slide',\n isLastPage: function (responseText) {\n // If there isn't a 'Next' button, or there is one that links to '#',\n // this is the last page\n var html = $.parseHTML(responseText);\n var nextLink = $(html).find('.next-story');\n return (!nextLink.length || nextLink.attr('href').indexOf('story_page') == -1); // next page is a new article\n },\n loadAll: function (thisInfo, fullArticleContainer, url) {\n // Recursively retrieve pages of article until the last one\n var urlFormat = thisInfo.getReplaceFormat(url);\n var addPage = function (pageNum) {\n httpGet(urlFormat.format(pageNum), function (responseText) {\n // Get the meat of the article and append it to our fullArticleContainer element\n var html = $.parseHTML(responseText);\n var articleMeat = $(html).find(thisInfo.articleMeatSelector);\n fullArticleContainer.append(articleMeat);\n // Examine the page. If it's the last one, add the elements to the page;\n // otherwise, keep going.\n if (thisInfo.isLastPage(responseText)) {\n fullArticleContainer.addClass(thisInfo.articleMeatSelector + ' partial content_story_pages_slide primary');\n // Done - get the appropriate element on the page and replace it with \n // the element that we created.\n replaceDOMElements('.slot[data-slot=\"center\"]', fullArticleContainer[0].outerHTML, function (msg) {\n if (msg && msg.success) {\n displayResult('Loaded ' + (pageNum) + ' pages');\n }\n else {\n console.error(msg.error);\n displayResult(GENERIC_ERROR);\n }\n });\n }\n else {\n addPage(pageNum + 1);\n }\n });\n }\n addPage(1);\n }\n },\n\n \"emgn.com\": {\n // Example URL:\n // http://emgn.com/s2/19-extreme-body-transformations-thatll-leave-jaw-aching/1\n getReplaceFormat: function (url) {\n var ret = '';\n var regex = /(http[s]?:\\/\\/)?(www\\.)*(emgn\\.com\\/[^\\/]+\\/[^\\/]+)((\\/)([0-9]*))?(.*)/i;\n var matches = url.match(regex);\n if (!matches) {\n renderStatus('Invalid URL format :(');\n return ret;\n }\n // Reconstruct URL\n ret += (matches[1] ? matches[1] : '') // http://\n + (matches[2] ? matches[2] : '') // www.\n + (matches[3]) // emgn.com/something/article-title-here\n + (matches[4] ? matches[5] + '{0}' : '/{0}') // /X\n + (matches[7] ? matches[7] : ''); // anything after that\n return ret;\n },\n articleMeatSelector: '.content > *:not(aside):not(.pagination):not(.rrssb-holder)',\n isPastLastPage: function (responseText) {\n // If there isn't a 'Next' button, or there is one with text 'Next Article',\n // we've past the last page\n var html = $.parseHTML(responseText);\n var nextDiv = $(html).find('.pagination .next');\n return (nextDiv.length && (nextDiv[0].innerText).indexOf('Article') >= 0); // this is the junky page before next article\n },\n loadAll: function (thisInfo, fullArticleContainer, url) {\n // Function to execute after retrieving all of the article content\n var afterLastPage = function (pageNum) {\n fullArticleContainer.addClass('content');\n // Done - get the appropriate element on the page and replace it with \n // the element that we created.\n replaceDOMElements('article.content', fullArticleContainer[0].outerHTML, function (msg) {\n if (msg && msg.success) {\n displayResult('Loaded ' + (pageNum) + ' pages');\n }\n else {\n console.error(msg.error);\n displayResult(GENERIC_ERROR);\n }\n });\n }\n // Recursively retrieve pages of article until the last one\n var urlFormat = thisInfo.getReplaceFormat(url);\n var addPage = function (pageNum) {\n httpGet(urlFormat.format(pageNum), function (responseText) {\n // Get the meat of the article and append it to our fullArticleContainer element\n var html = $.parseHTML(responseText);\n if (thisInfo.isPastLastPage(responseText)) {\n afterLastPage(pageNum);\n }\n else {\n if (pageNum > 1) {\n thisInfo.articleMeatSelector += ':not(h1)'; // don't show the title more than once\n }\n var articleMeat = $(html).find(thisInfo.articleMeatSelector);\n fullArticleContainer.append(articleMeat);\n addPage(pageNum + 1);\n }\n });\n }\n addPage(1);\n }\n },\n\n \"lifebuzz.com\": {\n // Example URL:\n // http://www.lifebuzz.com/princess-diana/1/\n getReplaceFormat: function (url) {\n var ret = '';\n var regex = /(http[s]?:\\/\\/)?(www\\.)*(lifebuzz\\.com\\/[^\\/]+)((\\/)([0-9]*))?(.*)/i;\n var matches = url.match(regex);\n if (!matches) {\n renderStatus('Invalid URL format :(');\n return ret;\n }\n // Reconstruct URL\n ret += (matches[1] ? matches[1] : '') // http://\n + (matches[2] ? matches[2] : '') // www.\n + (matches[3]) // lifebuzz.com/article-title-here\n + (matches[4] ? matches[5] + '{0}' : '/{0}') // /X\n + (matches[7] ? matches[7] : ''); // anything after that\n return ret;\n },\n articleMeatSelector: '.single > *:not(#desktop-below-post-trending)',\n isLastPage: function (responseText) {\n // If there isn't a 'Next' button, or there is one that links to '/t/end-gallery',\n // this is the last page\n var html = $.parseHTML(responseText);\n var nextLink = $(html).find('a.next-post');\n return (nextLink.length);\n },\n loadAll: function (thisInfo, fullArticleContainer, url) {\n // Recursively retrieve pages of article until the last one\n var urlFormat = thisInfo.getReplaceFormat(url);\n var addPage = function (pageNum) {;\n httpGet(urlFormat.format(pageNum), function (responseText) {\n // Get the meat of the article and append it to our fullArticleContainer element\n var html = $.parseHTML(responseText);\n var articleMeat = $(html).find(thisInfo.articleMeatSelector);\n articleMeat.find('img.lazy').each(function (index, listItem) {\n $(listItem).attr('src', $(listItem).attr('data-original'));\n });\n fullArticleContainer.append(articleMeat);\n // Examine the page. If it's the last one, add the elements to the page;\n // otherwise, keep going.\n if (thisInfo.isLastPage(responseText)) {\n // Done - get the appropriate element on the page and replace it with \n // the element that we created.\n fullArticleContainer.addClass('single');\n fullArticleContainer.find('.post-pagination').addClass('hidden');\n fullArticleContainer.find('.share-bar').addClass('hidden');\n replaceDOMElements('.single', fullArticleContainer[0].outerHTML, function (msg) {\n if (msg && msg.success) {\n displayResult('Loaded ' + (pageNum) + ' pages');\n }\n else {\n console.error(msg.error);\n displayResult(GENERIC_ERROR);\n }\n });\n }\n else {\n addPage(pageNum + 1);\n }\n });\n }\n addPage(1);\n }\n },\n\n \"forbes.com\": {\n buttonNote: '(will open in new window)',\n // Example URL:\n // http://www.forbes.com/sites/michaelbobelian/2016/12/16/democrats-best-hope-to-defeat-trumps-cabinet-picks-lies-in-glare-of-confirmation-process/\n loadAll: function (thisInfo, fullArticleContainer, url) {\n // Click the 'print' button\n triggerEventOnDOMElement('.print a', 'click', function (msg) {\n if (msg && msg.success) {\n displayResult('Opened full article');\n }\n else {\n console.error(msg.error);\n displayResult(GENERIC_ERROR);\n }\n });\n }\n },\n }\n\n // minq.com has the same format as suggest.com (wat)\n sites['minq.com'] = sites['suggest.com'];\n\n return sites;\n}", "function loadBlockedSites() {\n chrome.cookies.getAll({ url: \"http://example.com/\" }, function(cookies) {\n // if (cookies.length == 0) {\n blockedSites = [];\n // } \n for (var i = 0; i < cookies.length; i++) {\n var cookieStr = JSON.stringify(cookies[i]);\n var obj = JSON.parse(cookieStr);\n var website = obj.name.substring(0, obj.name.length - 1).substr(1);\n if (!blockedSites.includes(website)) {\n blockedSites.push(website);\n }\n }\n });\n}", "function getUrls() {\n\t// Get all URLs\n\tqueue = [...document.querySelectorAll( 'a:not([data-nocache])' )]\n\t\t.reduce( ( acc, url ) => {\n\n\t\t\t// Bail if the URL does not have an href\n\t\t\tif ( url.href === undefined ) {\n\t\t\t\treturn acc\n\t\t\t}\n\n\t\t\turl = new Url( url.href )\n\n\t\t\t// Bail if url is an asset\n\t\t\tif ( url.pathname.includes( '.' ) ) {\n\t\t\t\treturn acc\n\t\t\t}\n\n\t\t\t// If local, bail\n\t\t\tif ( !url.isLocal() ) {\n\t\t\t\treturn acc\n\t\t\t}\n\n\t\t\t// If admin, bail\n\t\t\tif ( url.pathname.includes( 'wp-admin' ) || url.pathname.includes( 'wp-login' ) ) {\n\t\t\t\treturn acc\n\t\t\t}\n\n\t\t\t// If cached, bail\n\t\t\tif ( url.getCache() ) {\n\t\t\t\treturn acc\n\t\t\t}\n\n\t\t\t// If the URL is already in the queue, bail\n\t\t\tif ( acc.find( accUrl => accUrl.matchesUrl( url ) ) ) {\n\t\t\t\treturn acc\n\t\t\t}\n\n\t\t\tacc.push( url )\n\n\t\t\treturn acc\n\t\t}, [] )\n}", "function crawlingPage(){\n\t\n\tpage.open(get_url(), function(status) {\n\n \t\t/* ------------------------------------------------------------ */\n \t\t/* get DOM to parse from loaded url */\n \t\tvar current = page.evaluate(function() {\n \treturn document.getElementById(\"b_results\").querySelector(\".sb_pagS\").textContent;\n \t});\n\t\t\n\t\t/* ------------------------------------------------------------ */\n \t/* Check is browser have more pages and if doesnt kill proces */\n \tif(current == pagina){\n \t\tfs.write(path, content, 'w');\n \t\tconsole.log( '------------------------------------------------------------');\n\t\t\tconsole.log( ' _____ ___ ___ _____ ___ ___ _ _ ___ ___ _ _ ___ ___ ');\n\t\t\tconsole.log( ' |_ _| __/ __|_ _| | __|_ _| \\| |_ _/ __| || | __| \\ ');\n\t\t\tconsole.log( ' | | | _|\\__ \\ | | | _| | || .` || |\\__ \\ __ | _|| |) | ');\n\t\t\tconsole.log( ' |_| |___|___/ |_| |_| |___|_|\\_|___|___/_||_|___|___/ ');\n\t\t\tconsole.log( '');\n\t\t\tconsole.log( '------------------------------------------------------------');\n \t\tconsole.log( 'Summary. Cravled '+pagina+' Bing sites and '+counter+' urls' );\n \t\tphantom.exit();\n \t}\n\t\t\n\t\t/* ------------------------------------------------------------ */\n\t\t/* Grab URLs from current page */\n\t\tvar content_to_parse = page.evaluate(function() {\n\t\t\t//return document.body.innerHTML;\n\t\t\treturn document.getElementById(\"b_results\").innerHTML;\n\t\t});\n\n\t\t/* ------------------------------------------------------------ */\n\t\t/* Get result data array */\n\t\tvar result = extractUrls(content_to_parse); \n\t\tfor (var i = 0; i < result.length; i++) {\n\t\t\tvar res = get_host(result[i]);\n\n\t\t\t/* filter bing translator urls */\n\t\t\tif(res != 'www.microsofttranslator.com'){\n\t\t\t\tconsole.log( get_host(result[i]) );\n\t\t\t\tcontent += get_host(result[i])+\"\\n\";\n\t\t\t\t//content += get_host(result[i])+\",\"+query+\"\\n\";\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t};\n\t\t\n\t\t/* ------------------------------------------------------------ */\n\t\t/* increment page and run crawler again */\n\t\tpagina++;\n\t\tcrawlingPage(); \n\n\t});\n}", "function scrapeSite(){\n\n scrapeIt(sitePath + 'shirts.php', {\n\n pages: {\n listItem: 'ul.products li',\n data: {\n url: {\n selector: 'a',\n attr: 'href'\n }\n }\n }\n }).then(({ data, response }) => {\n\n pages = data.pages;\n scrapePages(pages);\n\n }).catch( (error) => {\n const errorMsg = `Cannot connect to ${sitePath}`;\n writeErrorLog(errorMsg);\n });\n}", "function loadURLs(urls, fDone, individualClasses) {\n var fNext = function() {\n if (urls.length > 0) {\n var url = urls.shift();\n if (url.search(/http/) == 0) {\n // For coursews data\n \tExhibit.importers[\"application/jsonp\"].load(\n url, \n window.database, \n fNext, \n function(json) {\n return processOfficialData(json, individualClasses);\n });\n } else { loadStaticData(url, window.database, fNext); }\n } else { fDone(); }\n };\n fNext();\n}", "function crawlWeb (seed){\n\tvar toCrawl = [seed];\n\tvar crawled = [];\n\twhile (toCrawl.length > 0){\n\t\tvar page = toCrawl.pop();\n\t\tfor(var i = 0; i < crawled.length; i++){\n\t\t\tif (page == crawled[i]){\n\t\t\t\treturn crawled;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tunion(tocrawl, getAllLinks(page))\n\t\t\t\tcrawled.push(page);\n\n\t\t\t}\n\t\t}\n\n\t\t\n\n\t}\n\n}", "static getWebsites() {\r\n let websites;\r\n if (localStorage.getItem('websites') === null) {\r\n websites = [];\r\n } else {\r\n websites = JSON.parse(localStorage.getItem('websites'));\r\n }\r\n return websites;\r\n }", "async function listAllItemUrls(page) {\n await page.goto(url)\n const html = await page.content()\n const $ = cheerio.load(html)\n\n await page.waitForSelector('.title')\n const results = $('.title').map((index, item) => { return 'https://webscraper.io' + $(item).attr('href') }).get()\n\n return results\n}", "async function scraper(urls) {\n return Promise.all(\n urls.map(async (url) => {\n const addJob = await crawlQueue.add({ url }, { removeOnComplete: true });\n return addJob;\n }),\n );\n}", "function getOffersPages() {\n\n return getHtml(URL_RH_website)\n .catch(err => {\n console.log(err);\n })\n .then(html => {\n var $ = cheerio.load(html);\n //Get the list of urls where there are offers\n var list_url_pages = [];\n list_url_pages[0] = URL_RH_website;\n $('#resultatPagination').first().find('a')\n .filter((i, el) => {\n // Remove the last element\n return el.attribs['id'] != \"ctl00_ctl00_corpsRoot_corps_Pagination_linkSuivPage\";\n })\n .each((i, el) => {\n list_url_pages.push(el.attribs['href']);\n });\n return list_url_pages;\n });\n}", "getComscoreSites(cb) {\n //get all sites /sites\n let self = this;\n this.getGlobalConfig((err) => {\n if (err) cb(err);\n let sites = [];\n self.services.forEach((row) => {\n sites.push('/sites/' + row.site);\n });\n cb(null, sites);\n });\n }", "function spider(url) {\n\n\t// first we make sure to add this to the list of visited URLs\n\t// otherwise we could (and probably would) get into an infinite loop\n\tif( visited.indexOf(url) >= 0 ){\n\t\treturn;\n\t}else{\n\t\tvisited.push(url);\n\t}\n\n /***********************************************************\n\t\tURLs\n\n\t \tfirst we look for an exact URL match\n\t **********************************************************/\n\turlStatus = findMatch( url, data.urls, \"url\" );\n\n\t//if that came back false\n\tif( !urlStatus ){\n\n\t /***********************************************************\n\t\t\tFilenames\n\n\t\t \tif we didn't find a match there we get just the filename\n\t\t \tas sometimes the URL doesn't match perfectly due to\n\t\t \tquerystring parameters\n\t\t **********************************************************/\n\t\t// parse out the filename\n\t\tfilename = url.replace( baseUrl, '');\n\t\tif( filename.indexOf('?') >= 0 ){\n\t\t\tfilename = filename.substring(0,filename.indexOf('?'));\n\t\t}\n\t\turlStatus = findMatch( filename, data.filenames, \"filename\" );\n\n\t}\n\n\t// however we got here we now figure out what to do with this url\n\tswitch( urlStatus ){\n\t\tcase \"allow\":\n\t\t\tcasper.echo( urlResult( 'allowed', 'green', url ) );\n\t\t\tpage.open(url,function(){\n\t\t\t\tcasper.echo(url+' opened');\n\t\t\t});\n\t\t\t/*\n\t\t\tcasper.open(url).then(function() {\n\t\t\t\t// Find links present on this page\n\t\t\t\tvar links = this.evaluate(function() {\n\t\t\t\t\tvar links = [];\n\t\t\t\t\tArray.prototype.forEach.call(__utils__.findAll('a'), function(e) {\n\t\t\t\t\t\tlinks.push(e.getAttribute('href'));\n\t\t\t\t\t});\n\t\t\t\t\treturn links;\n\t\t\t\t});\n\n\t\t\t\tArray.prototype.forEach.call(links, function(link) {\n\t\t\t\t\tvar newUrl = helpers.absoluteUri(baseUrl, link);\n\t\t\t\t\tif ( spiderLinks.indexOf(newUrl) == -1 ) {\n\t\t\t\t\t\tspiderLinks.push(newUrl);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tcasper.echo( spiderLinks );\n\n\t\t\t});\n\t\t\t*/\n\n\t\t\tbreak;\n\t\tcase \"block\":\n\t\t\tcasper.echo(colorizer.format(\"BLOCKED: \", { fg: 'red', bg: 'black', bold: true }) + ' ' + url);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcasper.echo(colorizer.format(\"PENDING: \", { fg: 'magenta', bg: 'black', bold: true }) + ' ' + url);\n\t\t\tdata.urls.push({\"url\":url,\"status\":\"pending\"});\n\t\t\tbreak;\n\t}\n\n\tcasper.echo( spiderLinks.length );\n\n}", "async getPageLinks() {\n const browser = await this.puppeteer.launch({\n ...this.browserConfig,\n ...{ userDataDir: this.users[this.getRandomInt(this.users.length)] }\n });\n const page = await browser.newPage();\n await page.setRequestInterception(true);\n page.on('request', request => {\n // console.log(new URL(request.url()).host);\n if (['image', 'stylesheet', 'font'].indexOf(request.resourceType()) != -1) {\n request.abort();\n }\n else if (this.domainsToExlcude.includes(new URL(request.url()).host)) {\n console.log(\"Blocked: \" + request.url());\n request.abort();\n }\n else {\n request.continue();\n }\n\n });\n await page.goto(this.url);\n var pages = [\n {\n page: \"1\",\n url: this.url\n }\n ];\n var allPages = await page.evaluate(() => {\n return Array.from(document.querySelectorAll(\"a.page-links\")).map((pageLink) => {\n return {\n page: pageLink.innerText.trim(),\n url: pageLink.href\n };\n });\n });\n await browser.close();\n return [...pages, ...allPages];\n }", "function load() {\n cy.visit('https://wordsmith.automatedinsights.com/')\n cy.url()\n .should('include', 'wordsmith.automatedinsights.com')\n}", "function crawler() {\n var _this = this;\n\n this.articles = {\n /**\n * @description Gets all articleUrls from a open news web page\n */\n getUrls: function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(url, articleListSelector) {\n var browser, page, html, $, articles, _articleUrls, i;\n\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n\n console.log(_colors2.default.yellow('> [Crawling] for article Urls ' + url));\n // const browser = await puppeteer.launch({ args: ['--no-sandbox, --disable-setuid-sandbox'], headless: true, ignoreHTTPSErrors: true });\n _context.next = 4;\n return _puppeteer2.default.launch({ headless: true });\n\n case 4:\n browser = _context.sent;\n _context.next = 7;\n return browser.newPage();\n\n case 7:\n page = _context.sent;\n _context.next = 10;\n return page.goto(url, { waitUntil: ['load', 'domcontentloaded', 'networkidle2'], timeout: 60000 });\n\n case 10:\n _context.next = 12;\n return page.content();\n\n case 12:\n html = _context.sent;\n $ = _cheerio2.default.load(html);\n articles = $(articleListSelector);\n _articleUrls = [];\n\n // Push all articles into array\n\n for (i = 0; i < articles.length; i++) {\n _articleUrls.push('' + articles[i].attribs.href);\n }\n\n // Clean articles to remove duplicate links if any\n _articleUrls = (0, _underscore.uniq)(_articleUrls);\n console.log(_colors2.default.green.bold('> Found ' + _articleUrls.length + ' unique article links'));\n _context.next = 21;\n return browser.close();\n\n case 21:\n return _context.abrupt('return', _articleUrls);\n\n case 24:\n _context.prev = 24;\n _context.t0 = _context['catch'](0);\n\n console.log('> Error in crawling for article urls: ', _context.t0.message);\n\n case 27:\n case 'end':\n return _context.stop();\n }\n }\n }, _callee, _this, [[0, 24]]);\n }));\n\n function getUrls(_x, _x2) {\n return _ref.apply(this, arguments);\n }\n\n return getUrls;\n }(),\n /**\n * @description Gets article content from an article web page\n */\n getContent: function () {\n var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(crawlParams) {\n var articleUrls, articlePrependUrl, articleHeaderSelector, articleDateSelector, articleTextSelector, hasWriter, hasHeader, hasDate, siteArticles, browser, i, articleUrl, page, html, $, articleHeader, articleWriter, articleDate, articleText, article;\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n articleUrls = crawlParams.articleUrls, articlePrependUrl = crawlParams.articlePrependUrl, articleHeaderSelector = crawlParams.articleHeaderSelector, articleDateSelector = crawlParams.articleDateSelector, articleTextSelector = crawlParams.articleTextSelector, hasWriter = crawlParams.hasWriter, hasHeader = crawlParams.hasHeader, hasDate = crawlParams.hasDate;\n siteArticles = [];\n _context2.next = 4;\n return _puppeteer2.default.launch({ headless: true });\n\n case 4:\n browser = _context2.sent;\n i = 0;\n\n case 6:\n if (!(i < articleUrls.length)) {\n _context2.next = 33;\n break;\n }\n\n _context2.prev = 7;\n articleUrl = articleUrls[i];\n\n console.log(_colors2.default.bold.green('> [Scraping] article url for content: ' + articlePrependUrl + articleUrl));\n // const browser = await puppeteer.launch({ args: ['--no-sandbox, --disable-setuid-sandbox'], headless: true, ignoreHTTPSErrors: true });\n _context2.next = 12;\n return browser.newPage();\n\n case 12:\n page = _context2.sent;\n _context2.next = 15;\n return page.goto('' + articlePrependUrl + articleUrl, { waitUntil: ['load', 'domcontentloaded', 'networkidle2'], timeout: 60000 });\n\n case 15:\n _context2.next = 17;\n return page.content();\n\n case 17:\n html = _context2.sent;\n $ = _cheerio2.default.load(html);\n articleHeader = hasHeader ? $(articleHeaderSelector).text() : '';\n articleWriter = hasWriter ? $(articleHeaderSelector).text() : '';\n articleDate = hasDate ? $(articleDateSelector).text() : '';\n articleText = $(articleTextSelector).text();\n article = {\n date: articleDate,\n header: articleHeader,\n text: articleText,\n writer: articleWriter,\n url: '' + articlePrependUrl + articleUrl\n // TODO: Do not push all article that are written more than 24 hours ago.\n };\n siteArticles.push(article);\n _context2.next = 30;\n break;\n\n case 27:\n _context2.prev = 27;\n _context2.t0 = _context2['catch'](7);\n\n console.log('Error scraping url: ' + articleUrls[i] + ': \\n ' + _context2.t0.message);\n\n case 30:\n i++;\n _context2.next = 6;\n break;\n\n case 33:\n _context2.next = 35;\n return browser.close();\n\n case 35:\n return _context2.abrupt('return', siteArticles);\n\n case 36:\n case 'end':\n return _context2.stop();\n }\n }\n }, _callee2, _this, [[7, 27]]);\n }));\n\n function getContent(_x3) {\n return _ref2.apply(this, arguments);\n }\n\n return getContent;\n }(),\n /**\n * @description Crawl all article urls from a list of company sites and subsequently crawl all their contents\n */\n getAll: function () {\n var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(companies) {\n var allSitesArticles, i, company, _articleUrls2, _siteArticles, siteArticlesWithInfo;\n\n return regeneratorRuntime.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n allSitesArticles = [];\n i = 0;\n\n case 2:\n if (!(i < companies.length)) {\n _context3.next = 21;\n break;\n }\n\n _context3.prev = 3;\n company = companies[i];\n _context3.next = 7;\n return _this.articles.getUrls(company.url, company.articleListSelector);\n\n case 7:\n _articleUrls2 = _context3.sent;\n _context3.next = 10;\n return _this.articles.getContent({\n articleUrls: _articleUrls2,\n articlePrependUrl: company.articlePrependUrl,\n articleHeaderSelector: company.articleHeaderSelector,\n articleDateSelector: company.articleDateSelector,\n articleTextSelector: company.articleTextSelector,\n hasWriter: company.hasWriter,\n hasHeader: company.hasHeader,\n hasDate: company.hasDate\n });\n\n case 10:\n _siteArticles = _context3.sent;\n siteArticlesWithInfo = {\n siteArticles: _siteArticles,\n name: company.name,\n url: company.url\n };\n\n allSitesArticles.push(siteArticlesWithInfo);\n _context3.next = 18;\n break;\n\n case 15:\n _context3.prev = 15;\n _context3.t0 = _context3['catch'](3);\n\n console.log('> Error in getAll: ', _context3.t0.message);\n\n case 18:\n i++;\n _context3.next = 2;\n break;\n\n case 21:\n return _context3.abrupt('return', allSitesArticles);\n\n case 22:\n case 'end':\n return _context3.stop();\n }\n }\n }, _callee3, _this, [[3, 15]]);\n }));\n\n function getAll(_x4) {\n return _ref3.apply(this, arguments);\n }\n\n return getAll;\n }(),\n /**\n * @description save each article from each\n */\n saveAndSummarizeToDb: function () {\n var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {\n var allSitesArticles, i, siteArticlesWithInfo, _name, _url, _siteArticles2, j;\n\n return regeneratorRuntime.wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n _context5.next = 2;\n return _this.articles.getAll(_constants.COMPANY_SITES);\n\n case 2:\n allSitesArticles = _context5.sent;\n i = 0;\n\n case 4:\n if (!(i < allSitesArticles.length)) {\n _context5.next = 22;\n break;\n }\n\n siteArticlesWithInfo = allSitesArticles[i];\n _name = siteArticlesWithInfo.name, _url = siteArticlesWithInfo.url, _siteArticles2 = siteArticlesWithInfo.siteArticles;\n j = 0;\n\n case 8:\n if (!(j < _siteArticles2.length)) {\n _context5.next = 19;\n break;\n }\n\n _context5.prev = 9;\n return _context5.delegateYield( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {\n var article, originalText, originalHeader, options, _ref5, summary_title, summary_points, summarizedArticle, query;\n\n return regeneratorRuntime.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n article = _siteArticles2[j];\n originalText = article.text;\n originalHeader = article.header;\n options = {\n title: article.header,\n text: article.text,\n summary_length: 10,\n coref: false,\n sort_by_salience: true,\n include_all_sentences: false\n };\n _context4.next = 6;\n return _Agolo2.default.summarizer.summarize(options);\n\n case 6:\n _ref5 = _context4.sent;\n summary_title = _ref5.summary_title;\n summary_points = _ref5.summary_points;\n summarizedArticle = {\n summary_title: summary_title,\n summary_points: summary_points,\n site_name: _name,\n site_url: _url,\n article_url: article.url,\n original_text: originalText,\n original_header: originalHeader,\n summarized: true,\n project: 'IB-III',\n date_written: article.date\n };\n query = { article_url: summarizedArticle.article_url };\n // Only save articles of unique article urls\n\n _context4.next = 13;\n return _article2.default.findOneAndUpdate(query, summarizedArticle, { upsert: true }, function (error) {\n if (error) {\n console.log('> Error saving article:', error.message);\n }\n console.log(_colors2.default.bold.cyan('> [Saving] Summarized Article to Db: ' + summarizedArticle.article_url));\n });\n\n case 13:\n case 'end':\n return _context4.stop();\n }\n }\n }, _callee4, _this);\n })(), 't0', 11);\n\n case 11:\n _context5.next = 16;\n break;\n\n case 13:\n _context5.prev = 13;\n _context5.t1 = _context5['catch'](9);\n\n console.log('Error in summarizing article:: \\n' + _context5.t1.message);\n\n case 16:\n j++;\n _context5.next = 8;\n break;\n\n case 19:\n i++;\n _context5.next = 4;\n break;\n\n case 22:\n case 'end':\n return _context5.stop();\n }\n }\n }, _callee5, _this, [[9, 13]]);\n }));\n\n function saveAndSummarizeToDb() {\n return _ref4.apply(this, arguments);\n }\n\n return saveAndSummarizeToDb;\n }(),\n getPage: function () {\n var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6() {\n var browser, page, url, html;\n return regeneratorRuntime.wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return _puppeteer2.default.launch({ headless: true });\n\n case 2:\n browser = _context6.sent;\n _context6.next = 5;\n return browser.newPage();\n\n case 5:\n page = _context6.sent;\n url = 'http://localhost:3000/';\n _context6.next = 9;\n return page.goto(url, { waitUntil: ['load', 'domcontentloaded', 'networkidle2'], timeout: 60000 });\n\n case 9:\n _context6.next = 11;\n return page.content();\n\n case 11:\n html = _context6.sent;\n _context6.next = 14;\n return browser.close;\n\n case 14:\n return _context6.abrupt('return', html);\n\n case 15:\n case 'end':\n return _context6.stop();\n }\n }\n }, _callee6, _this);\n }));\n\n function getPage() {\n return _ref6.apply(this, arguments);\n }\n\n return getPage;\n }()\n };\n}", "function load_domains() {\n chrome.storage.sync.get({ includedDomainsList: [] }, function (items) {\n // Process the domains\n var includedDomains = document.getElementById('includedDomains');\n for (var i = 0; i < items.includedDomainsList.length; i++) {\n var url = items.includedDomainsList[i];\n var opt = document.createElement('option');\n opt.text = url;\n opt.value = url;\n includedDomains.add(opt);\n }\n });\n chrome.storage.sync.get({ excludedDomainsList: [] }, function (items) {\n // Process the domains\n var excludedDomains = document.getElementById('excludedDomains');\n for (var i = 0; i < items.excludedDomainsList.length; i++) {\n var url = items.excludedDomainsList[i];\n var opt = document.createElement('option');\n opt.text = url;\n opt.value = url;\n excludedDomains.add(opt);\n }\n });\n}", "function first_start() {\n // add sites 1 by 1 in sync\n blackListSite(\"facebook.com\", function() {\n blackListSite(\"youtube.com\", function() {\n blackListSite(\"instagram.com\");\n });\n });\n}", "function preloadUrls() {\n\tgetUrls()\n\n\t// If the queue is empty, bail\n\tif ( queue.length === 0 ) {\n\t\treturn\n\t}\n\n\t// grab the next 10 URLs and get the paths\n\tconst requestUrls = queue.slice( 0, 10 )\n\n\t// hack off the 10 items just placed in requestUrls.\n\tqueue = queue.slice( 10 )\n\n\t// fetch the data\n\tnew Promise( async ( res, rej ) => {\n\t\tconst data = await fetch( {\n\t\t\tpath: `/nicholas/v1/page-info?paths=${requestUrls.map( url => url.pathname )}`,\n\t\t} )\n\n\t\t// Loop through each dataset and set the cache from the request URL\n\t\tdata.forEach( ( datum, key ) => {\n\t\t\tsetTimeout( () => {\n\t\t\t\trequestUrls[key].updateCache( datum )\n\t\t\t}, 100 * key )\n\t\t} )\n\t} )\n}", "function scrapeWebpack(url) {\n\n // test for bad url\n\n var options = {\n uri: url,\n transform: function transform(body) {\n return cheerio.load(body);\n }\n };\n\n var scrapedURLS = rp(options).then(function ($) {\n var result = [];\n\n var elems = $('#wiki>ul li');\n // find the name, desc and URL for every\n elems.each(function (i, elem) {\n var scrapedLoader = {};\n scrapedLoader.desc = $(elem).text();\n scrapedLoader.name = $(elem).children('a').text();\n scrapedLoader.url = $(elem).children('a').attr('href');\n result.push(scrapedLoader);\n });\n return result;\n }).catch(function (err) {\n // crawling failed or cheerio choked\n throw err;\n });\n\n return scrapedURLS;\n}", "async function get_urls() {\n const getUrls = await fetch(\"http://localhost:3000\").then((data) => data.json());\n \n getUrls.urls.map( ({name, url}) => writeUrl({name, url}) ); // Add all URLs.\n}", "function getShirtUrls (url) {\n\tconsole.log('Getting shirt URLs from ' + url);\n\n\t//start the crawler at url\n\turlCrawler.direct({ \n\t\turi: url,\n\t\tskipEventRequest: false,\n\t\tcallback : function (error, response) {\n\t\t\t\n\t\t\t//proceed if no errors\n\t\t\tif (response.statusCode === 200 && !error) {\n\t\t\t\tvar shirtUrls = []; //empty array for storing URLs\n\t\t\t\tvar $ = response.$; //get all HTML in Jquery format\n\t\t\t\t\n\t\t\t\t//find the URLs, and loop thru them\n\t\t\t\t$('.products').find('a').each(function() {\n\t\t\t\t\tshirtUrls.push($(this).attr('href')); //store them in the array\n\t\t\t\t\t\n\t\t\t\t\t//check if we now have all the URLs we need\n\t\t\t\t\tif (shirtUrls.length === shirtsToScrape) { //yes, we do\n\t\t\t\t\t\tconsole.log(\"All shirt URLs collected!\");\n\t\t\t\t\t\tscrapeShirts(shirtUrls); //go to scraping the shirtUrls we've found\n\t\t\t\t\t} //if not, loop will continue\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t\t//there's been an error\n\t\t\telse {\n\t\t\t\thandleError(url, response.statusCode, error); //handle it\n\t\t\t}\n\t\t}\n\t});\n}", "async function runTestOnAllHtmlUrls() {\n\tconst testUrls = [\n\t\t 'http://example.com',\n\t\t /*\n \t 'https://www.theguardian.com/environment/2016/aug/02/environment-climate-change-records-broken-international-report', // https://github.com/hypothesis/client/issues/73\n\t\t 'https://telegra.ph/whatsapp-backdoor-01-16', // https://github.com/hypothesis/client/issues/558\n\t\t 'https://dashboard.wikiedu.org/training/students/wikipedia-essentials/policies-and-guidelines-basic-overview', // https://github.com/hypothesis/product-backlog/issues/493\n\t\t 'https://www.theatlantic.com/magazine/archive/1945/07/as-we-may-think/303881/',\n\t\t 'https://www.poetryfoundation.org/poems/50364/neutral-tones',\n\t\t 'https://hackernoon.com/why-native-app-developers-should-take-a-serious-look-at-flutter-e97361a1c073',\n\t\t 'https://lincolnmullen.com/projects/spatial-workshop/literacy.html',\n\t\t 'https://www.greenpeace.org/usa/reports/click-clean-virginia/',\n\t\t 'https://www.fastcompany.com/28905/brand-called-you',\n\t\t 'https://www.forbes.com/sites/danschawbel/2011/12/21/reviving-work-ethic-in-america/#67ab8458449a',\n\t\t 'http://mmcr.education/courses/pls206-01-W19/readings/marbury_v_madison.html',\n\t\t 'https://www.si.com/vault/2002/03/25/320766/the-real-new-york-giants',\n\t\t 'https://www.nytimes.com/2018/12/08/opinion/college-gpa-career-success.html',\n\t\t 'https://www.dartmouth.edu/~milton/reading_room/pl/book_3/text.shtml',\n\t\t 'http://mikecosgrave.com/annotation/reclaiming-conversation-social-media/',\n\t\t 'https://english.writingpzimmer.net/about/snow-day-billy-collins/',\n\t\t 'https://www.facinghistory.org/resource-library/video/day-learning-2013-binna-kandola-diffusing-bias',\n\t\t 'http://codylindley.com/frontenddevbooks/es2015enlightenment/'\n\t\t */\n\t]\n\tconst omitted = [\n // embeds client, cannot work. note: no highlights at libretexts, they are missing our css\t\t\n\t\t// 'https://human.libretexts.org/Bookshelves/Composition/Book%3A_Successful_College_Composition_(Crowther_et_al.)/3%3A_Rhetorical_Modes_of_Writing/3.1%3A_Narration', \n\t]\n\tlet results = {}\n\tfor (let testUrlIndex = 0; testUrlIndex < testUrls.length; testUrlIndex++) {\n\t\tlet testUrl = testUrls[testUrlIndex]\n\t\tlet result = await runHtmlTest(testUrl) \n\t\twriteResults(testUrlIndex, result, 'html', '0')\n\t\tresults[testUrl] = result\n\t}\n\twriteResults('all', results, 'html')\n}", "function loadWebsites(){\r\n storage.local.get([\"customWebsites\"], function(items){\r\n /* Default websites loading */\r\n\r\n if(items.customWebsites !== undefined){\r\n var customWebsites = items.customWebsites;\r\n var table = document.getElementById(\"customTable\");\r\n table.innerHTML = tableHead;\r\n\r\n for(var index in customWebsites){\r\n var website = customWebsites[index];\r\n var checked = website.on ? \"checked\" : \"\";\r\n var element = fillTemplate(tableElementTemplate, {\"id\": \"custom\"+index, \"el\": website.url, \"checked\": checked});\r\n\r\n table.innerHTML += element;\r\n }\r\n\r\n attachEvents();\r\n }\r\n });\r\n }", "function getBuiltInWhiteList() {\n return news_sites.sites;\n}", "function getMicrositeList( ) {\n return $.getJSON('javascript/microsites.json').pipe(function (data) {\n return data.sites;\n });\n }", "function doTheWork() {\n getUrlsFromPage()\n // .then(urls => {\n // // check in reddis if url exists\n // // return filtered array\n // })\n .then((urls) => {\n urls.forEach(url => {\n //return console.log(url);\n crawl(url).then((car) => {\n printCar(car);\n // send email\n // for later us: client.set(\"string key\", \"string val\", redis.print);\n });\n });\n })\n}", "async function getList (url) {\n const options = {\n uri: url,\n transform: (body) => {\n return cheerio.load(body);\n }\n };\n let list = [];\n await rp(options)\n .then(async ($) => {\n\n // get libraries\n $('.im-title').each((i, element) => {\n const href = $(element.children[1]).attr('href').split('/')[1];\n list.push(href);\n });\n\n // navigate to next page\n const next = $('.search-nav').children().last();\n if (!next.hasClass('current')) {\n const nextPage = next.children().last().attr('href');\n list = list.concat(await getList(repository + nextPage));\n }\n });\n\n return list;\n}", "async function getList (url) {\n const options = {\n uri: url,\n transform: (body) => {\n return cheerio.load(body);\n }\n };\n let list = [];\n await rp(options)\n .then(async ($) => {\n\n // get libraries\n $('.im-title').each((i, element) => {\n const href = $(element.children[1]).attr('href').split('/')[1];\n list.push(href);\n });\n\n // navigate to next page\n const next = $('.search-nav').children().last();\n if (!next.hasClass('current')) {\n const nextPage = next.children().last().attr('href');\n list = list.concat(await getList(repository + nextPage));\n }\n });\n\n return list;\n}", "function crawl(url) {\n this.start().then(function() {\n this.echo('visiting: '+ url, 'COMMENT');\n this.open(url);\n \tchecked.push(url);\n });\n\n // this.then(function(res) {\n // helpers.sendImageToOctopus(this);\n // });\n\n this.then(function() {\n var newUrls = getLinksOnPage.call(this);\n\n // get new urls on the page that needs to be crawled\n links = _.union(links, urlsToScrape(newUrls));\n // this.echo(filteredUrls.length + \" new links found on \" + url);\n });\n}", "function loadAll(url, baseSite) {\n var siteInfo = getSupportedSitesInfo()[baseSite];\n\n // Load spinner and disable button\n $('.spinner').removeClass('hidden');\n $('#depaginateBtn').attr('disabled', true);\n\n // Create a new div that we will insert onto the page\n var fullArticleContainer = $('<div id=\"newArticleBody\"></div>');\n\n // Call the handler for the particular site.\n // (Is it weird to pass siteInfo in? I did it this way because I'm kinda treating these like classes,\n // reluctant to totally give up the approach I used in my first attempt, in which I tried to come up with\n // a set of general methods like getReplaceFormat(), isLastPage(), and so on, and do most of the work here.)\n try {\n var result = siteInfo.loadAll(siteInfo, fullArticleContainer, url); \n }\n catch (ex) {\n displayResult(GENERIC_ERROR, true);\n console.error(ex);\n }\n}", "function loadBlockedSites() {\n\treturn browser.storage.local.get();\n}", "function loadBlockedSites() {\n\treturn browser.storage.local.get();\n}", "getURLs(companies, category, urlsNumber) {\n this.urlsPool = [];\n this.companies = companies;\n this.filtredCompanies = _.filter(companies, comp => comp.source === 'crunchBase');\n this.urlsNumber = urlsNumber || 100;\n\n //setting the query URL depending on the chosen category\n let paramsURL = '';\n let categoryFullName = '';\n if (!category) category = '';\n switch(category.toLowerCase()) {\n case 'it1':\n paramsURL = '%2Cmarkets%3Ab8f58a18453350fb93a9b4f5579318c1';\n categoryFullName = 'it management';\n console.log('scraping IT Management companies');\n break;\n case 'it2':\n paramsURL = '%2Cmarkets%3A2a6133d96f680778b10626703abacfce';\n categoryFullName = 'it and cybersecurity';\n console.log('scraping IT and CyberSecurity companies');\n break;\n case 'retail':\n paramsURL = '%2Cmarkets%3Ab65acba5b299399063908be3e3833a07';\n categoryFullName = 'retail';\n console.log('scraping retail companies');\n break;\n case 'consulting':\n paramsURL = '%2Cmarkets%3Ab9bd65b920bf45cc207db70ac35d5bf4';\n categoryFullName = 'consulting';\n console.log('scraping consulting companies');\n break;\n case 'construction':\n paramsURL = '%2Cmarkets%3Ae4d83fbb33f0a6f01399a68245e8f8ac';\n categoryFullName = 'construction';\n console.log('scraping construction companies');\n break;\n case 'drones':\n paramsURL = '%2Cmarkets%3A1fec33a7163f88a97e5c8967fee59a1e';\n categoryFullName = 'drones';\n console.log('scraping Drones companies');\n break;\n case 'bigdata':\n paramsURL = '%2Cmarkets%3Ac33728a5de33d0da7bce0e3c4383bc99';\n categoryFullName = 'big data';\n console.log('scraping Big Data companies');\n break;\n case 'advertising':\n paramsURL = '%2Cmarkets%3A6cb685372de1b0412ee5451ff81bccab';\n categoryFullName = 'advertising';\n console.log('scraping advertising companies');\n break;\n case 'broadcasting':\n paramsURL = '%2Cmarkets%3A048fa3b0ae537c4ec5b71ae93b6dc303';\n categoryFullName = 'broadcasting';\n console.log('scraping broadcasting companies');\n break;\n default:\n paramsURL = '';\n console.log('scraping all companies');\n }\n\n if (paramsURL !== '') {\n this.filtredCompanies = _.filter(this.filtredCompanies, comp => {\n let catFound = _.find(comp.categories, (cat) => {\n if (cat.toLowerCase() === categoryFullName) return true;\n });\n return (catFound && catFound.length > 0);\n });\n console.log(this.filtredCompanies.length+' '+category+' companies from crunchbase in db');\n }\n\n //setting the page we'll start scraping on, basing on companies array.\n if (this.pageNumber === 0) {\n this.pageNumber = parseInt(this.filtredCompanies.length/100) + 20;\n }\n\n console.log('starting at page :'+this.pageNumber+' - 100 results per page');\n\n return new Promise((resolve) => {\n this._requestAPI(paramsURL, () => {\n console.log(this.urlsPool.length+' url returned');\n resolve(this.urlsPool);\n });\n\n });\n }", "function getScrapeUrls(noOfPages) {\n\n // Initialise array with first results page (from task brief)\n const urls = ['https://www.wegottickets.com/searchresults/all'];\n\n if (noOfPages > 1) {\n\n for (let i=0; i<noOfPages; i++) {\n\n // Push subsequent results pages to urls array\n urls.push(\n `https://www.wegottickets.com/searchresults/page/${i}/all`\n );\n \n }\n\n }\n \n return urls;\n \n}", "function getActiveSites() {\n developer.Api('/plugins/' + FS__API_PLUGIN_ID + '/installs.json', 'GET', [], [], function (sites) {\n // list active sites\n console.log(JSON.parse(sites));\n\n // list just the active site URLs\n JSON.parse(sites).installs.forEach(function(site) {\n console.log(site.url);\n });\n });\n}", "function searchWebpackLoaders(keyword, scrapedList) {\n return scrapedList.filter(function (val) {\n return val.desc.toLowerCase().indexOf(keyword.toLowerCase()) !== -1;\n });\n}", "function crawler() \n{\n\t// There are still links to be Crawled.\n\tif (noneCrawledURLs.length > 0 && allURLsInOrder.length > 0)\n\t{\n\t\t// Then, we need to update \"noneCrawledURLs\" after redirecting a particular URL.\n\t\tvar urlOfInProcessDOM = allURLsInOrder[allURLsInOrder.length - 1];\n\n\t\tvar arrayOfOutGoingLinks = new Array();\n\n\t\t// the array contains all the outgoing links of the 'urlOfInProcessDOM'\n\t\tarrayOfOutGoingLinks = getTheLinksFromCurrentURL(urlOfInProcessDOM);\n\n\t\t// This URL has not been visited yet.\n\t\tif (arrayOfOutGoingLinks != null && arrayOfOutGoingLinks.length > 0 && !alreadyInProcess(arrayOfOutGoingLinks[0]))\n\t\t\treadyForClick(arrayOfOutGoingLinks, urlOfInProcessDOM);\n\t\t\n\t\t// This URL has been visited before.\n\t\telse if (arrayOfOutGoingLinks != null && arrayOfOutGoingLinks.length > 0 && alreadyInProcess(arrayOfOutGoingLinks[0]))\n\t\t{\n\t\t\tarrayOfOutGoingLinks = deleteTheFirstIndex(arrayOfOutGoingLinks);\n\n\t\t\t// update the array of outgoing links for curURL\n\t\t\tupdateTheArrayOfLinks(urlOfInProcessDOM, arrayOfOutGoingLinks);\n\n\t\t\tvar step = false\n\n\t\t\t// Checks if there is still something for this URL to be Crawled.\n\t\t\tif (arrayOfOutGoingLinks.length == 0)\n\t\t\t{\n\t\t\t\tdeleteTheIndex(urlOfInProcessDOM);\n\t\t\t\tcrawledURLs.push(urlOfInProcessDOM);\n\t\t\t\tallURLsInOrder.pop();\n\t\t\t\tstep= true;\n\t\t\t}\n\n\t\t\tif (allURLsInOrder.length > 0)\n\t\t\t\tloadURL(allURLsInOrder[allURLsInOrder.length - 1], step);\n\t\t\telse\n\t\t\t{\n\t\t\t\tcreateXMLFile();\n\t\t\t\tphantom.exit();\n\t\t\t}\n\t\t}\n\n\t\t// There is an URL in 'allURLsInOrder' which does not exist in 'noneCrawledURLs'. This should not happen!\n\t\telse\n\t\t{\n\t\t\tif (noneCrawledURLs.length == 0 || noneCrawledURLs == null || allURLsInOrder.length == 1)\n\t\t\t{\n\t\t\t\tdumpLogsPerStep();\n\t\t\t\tcreateXMLFile();\n\t\t\t\tphantom.exit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tallURLsInOrder.pop();\n\n\t\t\t\tif (allURLsInOrder.length > 0)\n\t\t\t\t\tloadURL(allURLsInOrder[allURLsInOrder.length - 1], true);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcreateXMLFile();\n\t\t\t\t\tphantom.exit();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\tcreateXMLFile();\n\t\tphantom.exit();\n\t}\n}", "function crawlAll() {\n findAllTitlesLowerCase().then(function (titles) {\n // first load existing titles to avoid recrawl\n titlesGlobal = titles;\n //console.log('Title Global onload: ' + titlesGlobal);\n\n\n var rythmsAll = Object.keys(rhythmMap);\n //console.log(' rythmsAll: ' + rythmsAll);\n\n var count = rythmsAll.length;\n\n crawlRecursion(0, count, rythmsAll);\n });\n}", "function letterCrawl() {\n return new Promise((resolve, reject) => {\n const letterCrawler = new Crawler({\n jQuery: false,\n \n callback: function (error, res, done) {\n \n if (error) {\n console.log(error);\n } else {\n \n let dom = new JSDOM(res.body);\n \n dom.window.document.querySelectorAll(\".bc-a\").forEach(path => {\n lastNameURLS.push(`${prodDomain}${path.getAttribute('href')}`);\n });\n \n }\n done();\n }\n });\n\n console.log('Crawl started...');\n\n letterCrawler.queue(letters.map(letter => `${devDomain}/people/${letter}/`));\n letterCrawler.on('drain', resolve);\n });\n}", "crawlerListeners() {\n this.on('crawlstart', () => {\n this.crawlStartTime = Date.now();\n });\n\n this.on('queueadd', (queueItem, responseObject) => {\n this.status.updateTotalResources();\n // this.urlQueue.push(queueItem.url);\n });\n\n this.on('fetchheaders', (queueItem, responseObject) => {\n this.status.updateProcessResources();\n });\n\n this.on('discoverycomplete', (queueItem, resources) => {\n\n if(!this.shouldCombPages()) return;\n\n console.log('start of comb | pages: ', this.pages.length, \" | queue: \", this.queue.length);\n\n this.combPages();\n\n var report = this.getCrawlReport();\n\n this.deleteProcessedPages();\n\n console.log('end of comb | pages: ', this.pages.length, \" | queue: \", this.queue.length);\n this.emit('BrokenLinkCrawller::comb', report);\n });\n\n this.on('complete', () => {\n this.crawlEndTime = Date.now();\n this.crawlDurationInSeconds = capDecimals((this.crawlEndTime - this.crawlStartTime) / 1000, 2);\n var report = this.getCrawlReport();\n\n this.emit('BrokenLinkCrawller::complete', report);\n setTimeout(function() {\n process.kill(process.pid, 'SIGUSR2');\n }, 10000);\n });\n }", "function getUrls(givenUrl, urls) {\n\tvar page = require('webpage').create();\n\n\tpage.onUrlChanged = function(newUrl) {\n\t\turls.push(newUrl);\n\t}\n\n\tpage.open(givenUrl);\n}", "function loadWebinars() {\n $.get('//www.zendesk.com/app/webinar/list')\n .done(function(body) {\n var content = body.map(getWebinarButton);\n var $webinars = $('.available-webinars');\n $webinars.html(content);\n webutils.track('Demo - Lead - Gotowebinar - List shown');\n })\n .fail(function () {\n showError();\n webutils.track('Demo - Lead - Gotowebinar - List failed');\n });\n }", "function getAllLinks(url, links, type){\n request(url, function(error, response, body){ //makes a request for the url\n if(!error){\n var $ = cheerio.load(body); // load cheerio into $\n /*\n get all of the links to products and insert them into \"links\" array\n you can use .each() to do this, once you find where all of the links are stored:\n $('.price a').each(function(i, elem){\n links.push($(this).attr('href'));\n });\n */\n\n if( /* there is another page */){\n getAllLinks( /* get the link */, links, type);\n }\n else{\n //final page so call function that will scrape individual pages\n links.forEach(function(link){\n scrapeProductPage(link, type);\n links = [];\n });\n }\n }\n if(error){\n console.log(\"NOT WORKING!\");\n }\n });\n}", "function fetchRobots() {\n console.log('attempting robot acquisition');\n var acquired = Linkbots.acquire(_num);\n if (acquired.robots.length === _num) {\n _cb(acquired.robots);\n _robots = acquired.robots;\n $interval.cancel(_intervalRef);\n _intervalRef = null;\n return;\n } else if (acquired.robots.length > 0) {\n relinquish(acquired.robots);\n }\n if (_intervalRef === null) {\n _intervalRef = $interval(fetchRobots, 1000);\n }\n }", "makeURLList(){\r\n \r\n this.urls.length = 0;\r\n this.urls.push('https://cors-anywhere.herokuapp.com/http://sandipbgt.com/theastrologer/api/horoscope/' + this.sign.toLowerCase()+'/today/');\r\n this.urls.push('https://cors-anywhere.herokuapp.com/http://horoscope-api.herokuapp.com/horoscope/today/' + this.sign);\r\n this.urls.push('https://cors-anywhere.herokuapp.com/http://widgets.fabulously40.com/horoscope.json?sign=' + this.sign.toLowerCase());\r\n this.urls.push('https://cors-anywhere.herokuapp.com/http://ohmanda.com/api/horoscope/' + this.sign.toLowerCase());\r\n \r\n //calling the search function\r\n this.search();\r\n }", "function getProgramInfo (urlList) {\n var deferred = $q.defer();\n\n // Fire all http calls\n $q.all(urlList.map(function (_url) {\n return $http({method: 'GET', url: _url});\n })).then(function (results) { \n deferred.resolve(results);\n });\n\n return deferred.promise;\n }", "function fetchUrls(urls, callback) {\n\tfor (url of urls) {\n\t\trequest.get(url, (err, res1, body) => {\n\t\t\tif (!res1 || err) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar url = res1.request.uri.href\n\t\t var titleArr = body.match(\"<title>(.*?)</title>\");\n\t\t var title = titleArr && titleArr.length > 1 ? titleArr[1] : url;\n\t\t callback({ title: title, url: url, contents: body })\n\t\t});\n\t}\n}", "function runme() {\n var arr = [\"https://www.restaurantbateau.com/\", \n \"https://www.nueseattle.com/\", \n \"http://www.terraplata.com/\", \n \"https://www.facebook.com/aplushkkitchen/\", \n \"https://catering.gourmondoco.com/index.cfm?fuseaction=order&action=menu-category&category-id=191\", \n \"https://www.ladyjaye.com/\", \n \"https://www.buddhabruddah.com/\", \n \"https://falafelsalam.com/\", \n \"https://www.haymakerseattle.com/\", \n \"http://www.bakerynouveau.com/\", \n \"https://www.islandsoulrestaurant.com/\", \n \"https://www.restauranthomer.com/\", \n \"https://www.eightrow.com/\", \n \"https://facebook.com/Cafe-Munir-117120638400154/\", \n \"https://www.facebook.com/watsonscounter/\", \n \"https://delanceyseattle.com/\", \n \"https://www.eatatporkchop.com/\", \n \"https://www.artofthetable.net/\", \n \"https://www.thewhalewins.com/\", \n \"https://www.kamonegiseattle.com/\", \n \"http://uneedaburger.com/\", \n \"http://elcaminorestaurant.com/\", \n \"https://www.the5pointcafe.com/\", \n \"https://www.agrodolcefremont.com/\", \n \"https://www.instagram.com/alisonscoastalcafe/\", \n \"https://anjuseattle.com/\", \n \"https://www.bangbangseattle.com/cafe\", \n \"https://www.bardelcorso.com/\", \n \"https://benparis.com/\", \n \"https://www.bluestarcafeandpub.com/\", \n \"https://www.buddhabruddah.com/\", \n \"https://burgermaster.biz/\", \n \"https://caffeappassionato.com/\", \n \"https://canlis.com/\", \n \"https://delfinospizza.com\", \n \"https://dintaifungusa.com/locations.html\", \n \"https://duecucina.com/\", \n \"https://elliottbaybrewing.com\", \n \"https://www.elliottbaybrewing.com/\", \n \"https://elliottbaybrewing.com\", \n \"https://frans.com/\", \n \"http://www.harrysfinefoods.com/\", \n \"https://www.birthdaysdontstop.com/\", \n \"http://jadegardenseattle.com/\", \n \"https://javajahn.com/\", \n \"https://jimmysonbroadway.com\", \n \"https://kabulrestaurant.com/\", \n \"http://www.kaukaubbq.com/\", \n \"https://www.kindeeseattle.com/\", \n \"http://www.kneehighstocking.com/\", \n \"https://www.rmdessertbar.com/\", \n \"https://mamnoonrestaurant.com/\", \n \"https://marjorierestaurant.com/\", \n \"https://www.mashikorestaurant.com/\", \n \"http://mirotea.com/\", \n \"http://mrwestcafebar.com/\", \n \"http://mrwestcafebar.com/\", \n \"https://www.oldstove.com/\", \n \"https://www.onsafarifoods.com/online-ordering\", \n \"https://www.paragonseattle.com/\", \n \"https://seattle.piatti.com/\", \n \"https://www.pilgrimcoffeehouse.com/\", \n \"https://plumbistro.com\", \n \"https://rachelsgingerbeer.com/\", \n \"https://rachelsgingerbeer.com/\", \n \"https://www.ristorantemachiavelli.com/\", \n \"http://rocket-taco.com/seattle/\", \n \"https://www.samchoyspoke.com/\", \n \"https://spark.adobe.com/page/fA6c9GFhgTJc3/\", \n \"https://www.taitungrestaurant.com/\", \n \"http://www.tasteofthecaribbeanseattle.com/\", \n \"https://www.marriott.com/hotels/hotel-information/restaurant/seasm-renaissance-seattle-hotel/\", \n \"https://theBridgeSeattle.com\", \n \"http://fremontdock.com/\", \n \"https://www.marriott.com/hotels/hotel-information/restaurant/seasm-renaissance-seattle-hotel/\", \n \"https://matadorrestaurants.com/\", \n \"https://mecca-cafe.com/\", \n \"http://theyardcafe.com/\", \n \"https://www.chefmariahines.com/\", \n \"http://trailbendtaproom.com/\", \n \"https://www.themaplepub.com/\", \n \"https://www.wildginger.net/\", \n \"https://www.facebook.com/burienpress/\", \n \"https://www.facebook.com/moonshotcoffee/\", \n \"https://proletariatpizza.com\", \n \"https://ethanstowellrestaurants.com/order\", \n \"https://togo.famousdaves.com\", \n \"https://ethanstowellrestaurants.com/order\", \n \"https://geraldinescounter.com\", \n \"https://www.copineseattle.com/\", \n \"https://ethanstowellrestaurants.com/order\", \n \"https://jerkshackseattle.com/\", \n \"https://www.boatstreetkitchen.com/\", \n \"https://www.themetropolitangrill.com/\", \n \"https://localpubliceatery.com/neighbourhoods/terry-ave/\", \n \"http://gainsbourglounge.com/\", \n \"https://www.piroshkybakery.com/\", \n \"https://nijosushi.com/\", \n \"http://jacksbbq.com/\", \n \"https://www.norensushi.com\", \n \"https://patagonseattle.com\", \n \"https://www.skylarkcafe.com/\", \n \"https://soicapitolhill.com/\", \n \"https://thedaneseattle.com\", \n \"https://yeslerwayseattlewa.thehalalguys.com\", \n \"https://facebook.com/Viengthong206\", \n \"https://thewingdome.com/\", \n \"http://www.raccoltoseattle.com/\", \n \"https://www.yenworvillagewa.com/\", \n \"https://www.miopostopizza.com/\", \n \"https://www.bangbangseattle.com/\", \n \"https://www.judesoldtown.com/\", \n \"http://www.waywardvegancafe.com/\", \n \"https://www.arthursseattle.com/#arthurscollective\", \n \"https://babarseattle.com/capitol-hill/\", \n \"https://marinationmobile.com\", \n \"https://www.baitongthaistreetcafe.com/\", \n \"https://www.facebook.com/pg/Betsutenjin-Ramen-USA-112504659439834\", \n \"https://cactusrestaurants.com/location/south-lake-union/\", \n \"https://callunaseattle.com/curb-side-pickup/\", \n \"https://southtownpie.com/stp-contact/\", \n \"https://www.yannis-greek-restaurant.com/\", \n \"http://Katyscornercafe.com\", \n \"http://witnessbar.com/\", \n \"https://www.willmottsghost.com/\", \n \"https://www.eatatbetty.com/\", \n \"https://www.tljus.com/\", \n \"https://www.toppotdoughnuts.com\", \n \"https://coppercoinseattle.com/\", \n \"https://cutterscrabhouse.com/\", \n \"http://www.thaithanikitchen.com/SouthLakeUnion.html\", \n \"https://www.elchupacabraseattle.com/\", \n \"https://www.elchupacabraseattle.com/\", \n \"http://www.elfarolseattle.com\", \n \"https://www.seattlemeetsoaxaca.com/el-mezcalito/\", \n \"https://www.seattlemeetsoaxaca.com/la-carta-de-oaxaca/\", \n \"https://evergreens.com/locations/\", \n \"https://evergreens.com/locations/\", \n \"http://www.franksoysterhouse.com/\", \n \"https://tacodelmar.com/\", \n \"https://heritagedistilling.com/\", \n \"https://heritagedistilling.com/\", \n \"http://hurrycurryoftokyo-seattle.com/\", \n \"https://www.lupofremont.com/\", \n \"https://www.specialtys.com/location.aspx?store=se10&utm_source=google&utm_medium=local-listings&utm_campaign=seattle&utm_content=520-terry-ave-n\", \n \"https://www.southpawpizza.com/\", \n \"https://order.habitburger.com/store/a17ff353-018d-e911-822e-02838e5eb552/category/cfcbb04a-c88e-e911-8259-020f3289bcb6\", \n \"https://order.habitburger.com/store/7de7f1ee-c4dc-e811-822e-02eaf1e04748/category/cfcbb04a-c88e-e911-8259-020f3289bcb6\", \n \"http://www.bakerynouveau.com/\", \n \"https://www.chowfoods.com/endolyne-joes\", \n \"https://ezellschicken.com/\", \n \"https://ezellschicken.com/\", \n \"https://www.serendipitycafeandlounge.com\", \n \"https://ezellschicken.com/\", \n \"https://www.mcgilvraspub.com/\", \n \"http://www.samurainoodle.com/location/index.html\", \n \"http://www.samurainoodle.com/location/index.html#\", \n \"http://northstardiner.com/\", \n \"https://www.razzispizza.com/\", \n \"https://www.razzispizza.com/\", \n \"https://www.perihelion.beer/\", \n \"http://www.panwathai.com/index.html\", \n \"https://www.ohanasushigrill.com/\", \n \"https://www.nirmalseattle.com/\", \n \"https://www.modern-seattle.com/\", \n \"http://mezcaleriaoaxaca.com/\", \n \"https://www.meetkoreanbbq.com/\", \n \"https://marinationmobile.com/locations\", \n \"https://www.lecoinseattle.com/\", \n \"https://www.ladyyum.com\", \n \"https://fogonseattle.com/\", \n \"https://www.facebook.com/FeedCoBurgersCentral/\", \n \"https://www.bongosseattle.com/\", \n \"https://www.kizuki.com/\", \n \"https://www.miopostopizza.com/\", \n \"https://www.miopostopizza.com/\", \n \"https://cactusrestaurants.com/location/madison-park/\", \n \"https://www.ddir.com\", \n \"https://www.kiddvalley.com\", \n \"https://www.ethanstowellrestaurants.com/locations/tavolata-capitol-hill/\", \n \"https://www.ethanstowellrestaurants.com/locations/rione-xiii/\", \n \"https://www.ethanstowellrestaurants.com/locations/red-cow/\", \n \"https://www.bluwaterbistro.com/locations/leschi/\", \n \"https://orders.modpizza.com/\", \n \"https://orders.modpizza.com/\", \n \"https://orders.modpizza.com/\", \n \"https://orders.modpizza.com/\", \n \"https://orders.modpizza.com/\", \n \"https://www.othercoastcafe.com/\", \n \"https://www.othercoastcafe.com/\", \n \"https://www.thatsamoreseattle.com/\", \n \"https://www.kizuki.com\", \n \"https://www.coneandsteiner.com/\", \n \"http://lorettasnorthwesterner.com/\", \n \"https://www.cherryst.com\", \n \"https://www.cherryst.com/locations\", \n \"https://www.cherryst.com\", \n \"https://www.plentyofclouds.com/\", \n \"https://www.potbelly.com/stores/23391\", \n \"https://www.potbelly.com/\", \n \"https://www.potbelly.com/\", \n \"https://www.potbelly.com/\", \n \"https://www.specialtys.com/Location.aspx?Store=SE02\", \n \"https://www.specialtys.com/Location.aspx?Store=SE05\", \n \"https://www.specialtys.com/Location.aspx?Store=SE01\", \n \"https://www.specialtys.com/Location.aspx?Store=SE08\", \n \"https://www.cherryst.com\", \n \"https://www.cherryst.com\", \n \"https://www.cherryst.com\", \n \"https://www.cherryst.com\", \n \"http://www.flyingsquirrelpizza.com/about.php\", \n \"http://www.flyingsquirrelpizza.com\", \n \"https://easystreetonline.com/Cafe\", \n \"https://coastlineburgers.com/\", \n \"https://www.seattlefishcompany.com\", \n \"https://www.ayutthayathai.com/\", \n \"http://www.thesushisamurai.com\", \n \"https://www.ravennavarsity.com/\", \n \"https://www.eltana.com/order\", \n \"https://www.eltana.com/order\", \n \"https://www.mightyo.com/ways-to-order/\", \n \"https://www.mightyo.com/ways-to-order/\", \n \"https://www.mightyo.com/ways-to-order/\", \n \"http://crawfishkingwa.com/#/\", \n \"https://www.taprootseattle.com/\", \n \"https://ondaorigins.com/\", \n \"https://www.ivars.com/\", \n \"https://www.ivars.com/all-locations\", \n \"https://www.kiddvalley.com/\", \n \"https://www.kiddvalley.com/\", \n \"https://www.buhowhitecenter.com/\", \n \"https://www.underbellyofseattle.com/\", \n \"http://www.bokabokchicken.com/\", \n \"http://www.bokabokchicken.com/\", \n \"https://www.portagebaycafe.com/\", \n \"https://www.thewestyseattle.com/\", \n \"https://westfive.com/\", \n \"https://lunaparkcafe.com/\", \n \"http://jaksgrill.com/\", \n \"http://bluemoonburgers.com/\", \n \"https://christosonalki.com/\", \n \"https://www.circalove.com/\", \n \"https://www.westseattleswinery.com/\", \n \"https://www.ittostapas.com/\", \n \"https://westofchicagopizzacompany.com/\", \n \"http://www.freshfloursseattle.com/\", \n \"http://www.freshfloursseattle.com/\", \n \"http://www.stoupbrewing.com\", \n \"https://www.junebabyseattle.com/welcome\", \n \"http://www.ravennabrewing.com/\", \n \"http://sunlightcafevegetarian.com/\", \n \"https://www.olmsteadseattle.com/\", \n \"https://www.olympiapizza3.com/\", \n \"http://www.populuxebrewing.com\", \n \"https://belleepicurean.com/\", \n \"https://belleepicurean.com/\", \n \"https://www.vitosseattle.com/#overview\", \n \"https://www.elysianbrewing.com/herewithyou\", \n \"https://www.olympiapizzapasta.com/\", \n \"http://www.soundandfog.com\", \n \"https://www.jimmysonfirst.com\", \n \"https://www.maximilienrestaurant.com/le-meal-bag/\", \n \"http://relishbistroseattle.com\", \n \"https://www.arashiramen.com/\", \n \"https://www.arashiramen.com/\", \n \"https://www.evefremont.com/\", \n \"https://squareup.com/store/stone-way-cafe\", \n \"https://www.seattlechukis.com/\", \n \"https://www.seattlechukis.com/\", \n \"https://www.seattlechukis.com/\", \n \"https://www.seattlechukis.com/\", \n \"http://bottegaitaliana.com/\", \n \"https://cinnamonworks.com/\", \n \"https://www.honestbiscuits.com\", \n \"https://indichocolate.com/\", \n \"https://michoudeli.com/menu/\", \n \"https://www.mrdsgreekdelicacies.com/\", \n \"https://www.pikespit.com/\", \n \"http://seattlebagel.com/\", \n \"https://stories.starbucks.com/stories/2015/store-tour-inside-1912-pike-place-seattle-usa/\", \n \"https://taproomatpikeplace.com/\", \n \"https://threegirlsbakery.com/\", \n \"https://ulisfamoussausage.com/\", \n \"https://www.bestofhandsbarrelhouse.com/home\", \n \"https://phoanlakecity.hrpos.heartland.us/\", \n \"https://www.doughzonedumplinghouse.com/restaurant-locator\", \n \"http://www.2cthai.com/\", \n \"https://www.beyondthebowl.net/\", \n \"https://www.josestaqueria.com/\", \n \"https://www.manousheexpress.com/\", \n \"https://www.thaioneonseattle.com/\", \n \"http://www.saffrongrillseattle.com\", \n \"https://www.blazingbagels.com\", \n \"http://www.brownrigghardcider.com\", \n \"https://www.efeste.com\", \n \"https://madwine.com\", \n \"https://falllinewinery.com\", \n \"https://ghostfish-brewing-order-to-go.square.site\", \n \"https://kerloocellars.com\", \n \"http://Mrbsmeadery.business.site\", \n \"https://www.ethanstowellrestaurants.com/locations/seltzery/\", \n \"http://www.tasteofindiaseattle.com\", \n \"https://www.machinehousebrewery.com/\", \n \"http://www.stellarpizza.com/index.html\", \n \"https://www.smartypantsseattle.com/\", \n \"http://jellyfishbrewing.com/\", \n \"http://georgetownliquorco.com/\", \n \"https://www.fullthrottlebottles.com/\", \n \"https://winesofsubstance.com/\", \n \"http://counterbalancebeer.com/\", \n \"https://www.raizseattle.com\", \n \"https://chuminhtofu.com\", \n \"https://www.hardwokcafeseattle.com/\", \n \"http://www.heydayseattle.com/\", \n \"https://www.lamsseafood.com/\", \n \"https://www.lovinghutseattle.com/\", \n \"https://www.seattlemilacay.com/\", \n \"https://www.thephobac.com/\", \n \"https://phnompenh.hrpos.heartland.us/\", \n \"http://www.saigonvndeli.com/\", \n \"https://peddler-brewing-company.square.site/\", \n \"https://www.sevenstarspepper.com/\", \n \"https://songphangkongseattle.com/\", \n \"https://tamarindtreerestaurant.com/\", \n \"https://thanhviseattle.com/\", \n \"http://tsukushinbo.juisyfood.com/\", \n \"http://amysmerkato.com/menu/\", \n \"https://pestlerock.com/\", \n \"https://www.sennoodlebar.com/\", \n \"https://twodoorsdown.square.site\", \n \"http://www.kaffeeklatschseattle.com/\", \n \"http://www.buddharuksa.com\", \n \"https://www.facebook.com/musashis/\", \n \"http://donluchosinseattle.com/\", \n \"https://www.uptownchinaseattle.com/menu.aspx\", \n \"https://www.georgetownbeer.com/\", \n \"http://www.slimslastchance.com/\", \n \"http://www.bin41wine.com/Site/bin_41_intro.html\", \n \"https://dreamdinners.com/main.php?page=store&id=54\", \n \"https://www.facebook.com/greatamericandinerbar/\", \n \"https://www.flyingapron.com/\", \n \"https://www.tensushiseattle35.com/\", \n \"https://www.tensushiseattle.com/\", \n \"https://www.8ozburgerandco.com\", \n \"https://badjimmysbrewery.com/\", \n \"http://www.ballardbeercompany.com/\", \n \"https://dambrosiogelato.com/\", \n \"https://gatherkitchenandbar.com/menus\", \n \"http://www.graciaseattle.com/\", \n \"https://halesbrewery.com/\", \n \"http://hatties-hat.com\", \n \"https://www.katsuburger.com/copy-of-ballard\", \n \"http://www.kitchen-istanbul.com/\", \n \"http://www.seattleindiabistro.com/Dinner_Menu.html\", \n \"http://www.hotelalbatross.com/\", \n \"https://www.facebook.com/LockandKeel/\", \n \"https://locustcideronline.square.site/\", \n \"http://mabelcoffee.com/\", \n \"https://maritimebrewery.com\", \n \"https://www.mrgyroseattle.com/\", \n \"http://palermoballard.squarespace.com/\", \n \"https://patxispizza.com/location/ballard/\", \n \"https://www.piebarballard.com/\", \n \"http://pinkbeewa.smiledining.com\", \n \"http://poke-square.com/#locations\", \n \"https://reubensbrews.com/\", \n \"https://saltandstraw.com/pages/ballard\", \n \"https://www.saltandsugarcafe.com/\", \n \"https://www.scanspecialties.com/\", \n \"https://thesecretsavory.com\", \n \"https://www.facebook.com/Nikos-Gyros-Beacon-Hill-385414422005563/\", \n \"https://www.sipandship.com/\", \n \"https://www.facebook.com/LittleChengdu/\", \n \"http://www.skalballard.com/\", \n \"https://sushiiballard.com\", \n \"http://themonkeybridge.com\", \n \"https://senormoose.com/\", \n \"https://bananagrillseattle.com/\", \n \"https://thenoblefir.com/\", \n \"https://thecomfortzonesoulfood.com/\", \n \"https://www.rainierrestaurant.com/\", \n \"https://www.facebook.com/cortefino206/\", \n \"https://www.facebook.com/pg/huongduong.sunflower/about/?ref=page_internal\", \n \"http://663bistrotogo.com\", \n \"https://www.facebook.com/Bun-Bo-Hue-Hoang-Lan-170431412980541/\", \n \"http://asibarbqueseattle.com\", \n \"https://www.facebook.com/pages/Othello-Wok-Teriyaki/474889102584360\", \n \"https://www.facebook.com/kaffacoffeeseattle/\", \n \"http://www.bushgarden.net/\", \n \"https://www.facebook.com/Union-bar-and-restaurant-602348090272395/\", \n \"https://www.facebook.com/CongeezBreakfast/\", \n \"http://cafeeastern.com\", \n \"https://www.hotwirecoffee.com/\", \n \"https://www.huskydeli.com/\", \n \"http://www.lulacoffee.com/\", \n \"https://fortunacafeseattle.com\", \n \"https://www.fujisushiseattle.com/\", \n \"http://www.maharajawestseattle.com/\", \n \"http://goldenwheatbakeryseattle.cafecityguide.website\", \n \"http://greenleaftaste.com/#!/home/\", \n \"http://nikkoteriyaki.com/\", \n \"http://www.harborcityrestaurant.com/\", \n \"https://www.hohoseafood.com/\", \n \"https://houseofhongseattle.com/\", \n \"https://pizzeriacredo.com/\", \n \"http://joyaleseafood.com\", \n \"http://puertovallartawestseattle.com/\", \n \"http://www.yummyhousebakery.com/\", \n \"http://www.tacosguaymas.com/\", \n \"https://www.foodbooking.com/ordering/restaurant/menu?company_uid=6f1c2487-f756-4933-a66e-823549618df2&restaurant_uid=a30aab44-6739-4ffd-8722-cd389b1fd106&facebook=true\", \n \"http://newstarseafood.com\", \n \"https://www.oceanstarseattle.com/\", \n \"https://www.seattlefishguys.com\", \n \"http://www.seoul-tofu-house-seattle.com\", \n \"https://www.sizzlingpotking.net/\", \n \"https://bistroboxrestaurant.com/\", \n \"https://theshopclubs.com/derby/\", \n \"http://jacksbbq.com/\", \n \"https://macrinabakery.com/\", \n \"https://ninepiespizza.com/\", \n \"https://www.paseorestaurants.com/\", \n \"https://www.pecospit.com/\", \n \"http://phocyclocafe.com/\", \n \"http://pick-quick.com/\", \n \"http://www.sliceboxpizza.com/\", \n \"https://www.facebook.com/sodochicken\", \n \"http://sodopoke.com/\", \n \"https://crepesandwine.com/\", \n \"https://www.emeraldcitysmoothie.com/\", \n \"https://nilespeacock.com \", \n \"https://www.facebook.com/JavaJiveThru/\", \n \"https://www.opuscorestaurant.com/\", \n \"https://www.facebook.com/elcostenoSODO/\", \n \"https://www.tljus.com/\", \n \"http://www.takismadgreek.com/\", \n \"https://nuflours.com/\", \n \"https://www.seoulbowlco.com/\", \n \"https://www.facebook.com/SAGO-Kitchen-105376394299988/\", \n \"https://www.thewildmountaincafe.com/\", \n \"https://www.anthonys.com/restaurants/detail/little-chinooks/\", \n \"https://athenasfoodtrucks.com/\", \n \"https://www.anthonys.com/restaurants/detail/anthonys-beach-cafe/\", \n \"https://bangbarthai.com/\", \n \"https://beveridgeplacetogo.square.site/\", \n \"https://www.wondersportbar.com/\", \n \"http://www.bossdrivein.com/\", \n \"https://karaagesetsuna.com/\", \n \"https://www.caffeladro.com/locations/west-seattle-caffe-ladro/\", \n \"https://cafeflora.com/\", \n \"https://www.coldcrashbrewing.com/\", \n \"https://www.grillbird.com/\", \n \"http://www.dubseacoffee.com/\", \n \"https://www.duospickup.com/\", \n \"https://banhtown.com/\", \n \"https://www.unionsaloonseattle.com/\", \n \"https://www.sushikudasaiseattle.com/\", \n \"https://macstrianglepub.com/\", \n \"http://www.snoutandco.com\", \n \"https://www.thestonehousecafe.com/\", \n \"http://www.cookweaver.com/\", \n \"https://www.curecocktail.com/\", \n \"https://www.luigisitalianeatery.com/\", \n \"https://www.futureprimitivebeer.com/\", \n \"https://www.pineboxbar.com/\", \n \"https://www.chowfoods.com/tnt-taqueria\", \n \"https://www.galosusa.com/\", \n \"http://www.teriyaki-madness-seattle.com/\", \n \"https://pizza.dominos.com/washington/seattle/2320-n-45th-st/\", \n \"https://www.kisaku.com/\", \n \"https://flyingbike.coop/\", \n \"https://locustcideronline.square.site/\", \n \"https://locustcideronline.square.site/\", \n \"https://www.tacosandbeerseattle.com/\", \n \"https://www.saltoroseattle.com/\", \n \"http://ordersalvadoreanbakery.com/\", \n \"http://www.woodlandspizza.com/contact/\", \n \"https://patrickscafeandbakery.com/\", \n \"https://www.goodweatherinseattle.com/\", \n \"https://www.tippeanddrague.com/\", \n \"https://www.pizzutositalian.com/\", \n \"https://fitbarcafe.com/west-seattle-store-hours\", \n \"https://www.facebook.com/pg/freshyscoffee\", \n \"https://www.greenbridgecafe.com/\", \n \"https://www.indulgedessertsllc.com/\", \n \"https://www.facebook.com/pg/itsbbqtimealki/posts/?ref=page_internal\", \n \"https://locations.papajohns.com/united-states/wa/98105-2436/seattle/5401c-25th-ave-ne\", \n \"https://www.facebook.com/LittlePragueBakery/\", \n \"http://locolseattle.com/#\", \n \"http://westseattle.mylucianos.com/zgrid/proc/site/sitep.jsp\", \n \"https://pecadobueno.com/\", \n \"https://www.menchies.com/locations/frozen-yogurt-admiral-wa/catering\", \n \"https://www.missioncantinaseattle.com/\", \n \"https://pecadobueno.com/\", \n \"https://9th-hennepin-donuts.square.site/\", \n \"https://ounceswestseattle.com\", \n \"http://zippysgiantburgers.com/\", \n \"https://zeekspizza.com/locations-hours/zeeks-pizza-west-seattle/\", \n \"https://www.spicewaala.com/\", \n \"https://youngstowncoffeeco.com/\", \n \"http://wildwoodwestseattle.com/\", \n \"https://www.westseattlegrounds.com/\", \n \"https://westseattlewinecellars.com/\", \n \"http://www.pettirossoseattle.com/\", \n \"https://westseattlebrewing.com/\", \n \"http://www.highlinerpub.net/\", \n \"https://www.yoroshikuseattle.com/\", \n \"https://www.facebook.com/themustardseedcafe/\", \n \"https://www.pecospit.com/west-seattle/\", \n \"https://peelandpressws.com\", \n \"https://pegasuspizza.com/\", \n \"https://www.phoeneciawestseattle.com/\", \n \"https://www.whiteswanpublichouse.com/\", \n \"https://pizzeria22.com/\", \n \"https://order.menudrive.com/mobile/sopranospizzawest#restaurantDetailsPage\", \n \"https://ilovespiros.com/locations/\", \n \"https://www.tangletownpublichouse.com/\", \n \"http://www.thebryantcornercafe.com/\", \n \"https://www.springhousethaikitchenandpho.com/\", \n \"https://www.alkispud.com/\", \n \"http://srivilaithai.com/\", \n \"https://scarlet-rhubarb-shrj.squarespace.com/\", \n \"https://www.ericriveracooks.com/\", \n \"https://www.urbansushikitchen.com/\", \n \"https://www.lulasalads.com/store\", \n \"https://pokefresh.me/\", \n \"https://www.frelardtamales.com/\", \n \"https://www.mainstayprovisions.com/\", \n \"https://www.paseorestaurants.com/\", \n \"http://bountykitchenseattle.com/\", \n \"https://orders.cake.net/11104736\", \n \"https://www.tekutavern.beer/\", \n \"https://cloudburstbrew.com/#\", \n \"https://orders.cake.net/11276538\", \n \"https://www.busstopespresso.com/\", \n \"http://cortonacafe.com/#the-kitchen\", \n \"http://www.thaifusionbistro.com\", \n \"https://geosbarandgrill.com/\", \n \"http://ballardkisscafe.com/\", \n \"https://barcottopizzeria.com/\", \n \"https://www.nielsenspastries.com/\", \n \"http://www.thaithanikitchen.com\", \n \"https://elementalpizza.com/\", \n \"https://thebutcherstable.com/\", \n \"https://www.aokisushiandgrill.com/\", \n \"https://pastaco.com/\", \n \"https://www.frankiesbtownbistro.com/takeout/\", \n \"https://casa-del-mariachi.negocio.site/\", \n \"https://www.beachcomber.com\", \n \"https://www.normseatery.com\", \n \"http://www.madpizza.com/\", \n \"https://www.bottlehouseseattle.com/\", \n \"https://www.byenbakeri.com/\", \n \"https://www.ruthschris.com/restaurant-locations/seattle/\", \n \"https://metropolitandelicafefh.com/\", \n \"https://www.facebook.com/cafezumzumsea/\", \n \"https://www.36stone.com/\", \n \"https://tamnoodlebox.com/\", \n \"https://standardbrew.com/\", \n \"https://g.page/fresh-deli-mart?gm\", \n \"https://www.shiros.com\", \n \"https://www.facebook.com/pages/Bento-World/117781248248063\", \n \"http://www.delimeatsbar.com/#about\", \n \"https://www.trianglefremont.com/\", \n \"http://www.domaniqueenanne.com/\", \n \"http://banhtown.com/\", \n \"https://www.facebook.com/pages/Yume-Sushi/221088681813188\", \n \"https://www.welcomeroadwinery.com/\", \n \"https://www.facebook.com/pages/Wanna-Teriyaki-and-Burger/589778237737368\", \n \"https://www.visconcellars.com/\", \n \"https://chameleon-cinnamon-xjjk.squarespace.com/\", \n \"https://www.facebook.com/unwindcafellc\", \n \"https://www.blazingbagels.com/locations\", \n \"https://www.facebook.com/2fingerssocial/\", \n \"https://toshisgrill.com/toshis-teriyaki-seattle-westwood-village\", \n \"https://thepantryseattle.com/\", \n \"https://www.goodsocietybeer.com/\", \n \"http://www.tacosymariscoseltiburon.club/?utm_source=google&utm_medium=website&utm_campaign=Tacos%20y%20Mariscos%20El%20Tiburon&utm_term=5b735b1d59b86a0001f3746e\", \n \"https://www.supreme.bar/\", \n \"https://www.pickledpreserved.com/\", \n \"http://www.himalayansherpahouse.com/\", \n \"https://ramendanbo.com/\", \n \"http://sawyerseattle.com/\", \n \"https://www.monorailespresso.com/\", \n \"https://www.monorailespresso.com/\", \n \"https://tacodelmar.com/\", \n \"https://www.katespub.com/\", \n \"https://otterbarandburger.com/\", \n \"https://www.snappydragon.com\", \n \"https://www.pungkangnoodle.com/\", \n \"https://nishinorestaurant.com/\", \n \"https://www.matsuseattle.com/\", \n \"https://www.momijiseattle.com/\", \n \"https://www.umisakehouse.com/\", \n \"https://www.fatshack.com/\", \n \"http://www.elliottbaypizzaseattle.com/\", \n \"https://www.bangrakmarket.com/\", \n \"https://www.pastramisandwich.com/petes-fremont-fire-pit\", \n \"https://www.pastramisandwich.com/lets-taco\", \n \"https://zaikaseattle.com/\", \n \"https://motimahalindianseattle.com/8182\", \n \"http://www.tandoorihutseattle.com/\", \n \"http://varlamospizza.com/\", \n \"https://zainafood.com/\", \n \"https://caskandtrotter.com/wp-content/uploads/2019/11/CASK-SEATTLE-2019-food-menu-.pdf\", \n \"https://www.ballardloft.com/\", \n \"https://www.apizzamartuniversity.com/\", \n \"https://www.apizzamartseattle.com/\", \n \"https://www.apizzamartcapitolhill.com/\", \n \"http://www.bocarestobar.com/home.html\", \n \"https://www.facebook.com/Elcatrinmexicanfood/\", \n \"https://www.facebook.com/TheLockspotCafe/\", \n \"http://www.libertybars.com/\", \n \"https://mavenmeals.com/\", \n \"https://www.bisoncreekpizza.com/\", \n \"https://www.cedarbrooklodge.com/copperleaf-restaurant.php\", \n \"https://mojitoseattle.com\", \n \"http://www.marcopolopub.com/\", \n \"http://www.relayrestaurantgroup.com/restaurants/revel/\", \n \"http://saffronspiceseattle.com/\", \n \"http://bigtimebrewery.com/\", \n \"http://thefiddlersinn.com/\", \n \"https://www.amandineseattle.com/\", \n \"https://www.jaksgrill.com\", \n \"https://littlebigburger.com/\", \n \"https://www.dumplingsoffury.com/\", \n \"https://www.squirrelchops.com/\", \n \"https://www.facebook.com/pages/category/Deli/Hans-Deli-Grocery-137591902949441/\", \n \"http://www.morfireseattle.com/\", \n \"http://www.madreskitchen.com/the-menu\", \n \"https://www.roccosseattle.com\", \n \"http://Lookinghomewardcoffee.com\", \n \"https://www.kruaseattle.com/\", \n \"https://centralpizzaseattle.com/\", \n \"https://www.yelp.com/menu/the-dish-cafe-ballard-seattle\", \n \"http://jaesasianbistroandsushi-seattle.com/\", \n \"https://www.marmiteseattle.com/\", \n \"http://WWW.LAEMBURI.COM\", \n \"http://www.chutneysbistro.com/\", \n \"http://www.bamboo-thai.com/\", \n \"https://santouka-usa.com/\", \n \"https://teinei-seattle.com/\", \n \"http://menyamusashi-seattle.us/\", \n \"https://freshudon.com/\", \n \"https://www.wazseattle.com/\", \n \"https://issianjapanesestonegrill.weebly.com\", \n \"https://catering.subway.com/Cart/Menu2.aspx?r=1703428079\", \n \"https://store.luckyenvelopebrewing.com/\", \n \"http://www.chicknfix.com\", \n \"http://seattlegyros.com/\", \n \"https://lapalmamexicanrestaurant.com/\", \n \"http://www.obecbrewing.com\", \n \"https://www.elparchecolombiano.com\", \n \"http://somerandombar.com\", \n \"https://orderhh.com/\", \n \"http://www.yardhouse.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://jimmyjohns.com\", \n \"https://nwtxbbq.com/\", \n \"http://www.theconfectionery.com/\", \n \"https://www.tuttabella.com\", \n \"https://www.tuttabella.com\", \n \"https://www.tuttabella.com\", \n \"https://www.facebook.com/TaurusOxSeattle/\", \n \"https://www.nayascafekent.com\", \n \"https://www.mrsaigonbanhmi.com/\", \n \"https://rosellinis.com/\", \n \"http://www.markethousemeats.co/\", \n \"https://cafe-weekend.square.site\", \n \"http://www.ivars.com\", \n \"http://vincesrestaurants.com/pizzeria-pulcinella\", \n \"https://villaverdipizza-online-ordering.securebrygid.com/zgrid/themes/829/intro/index.jsp\", \n \"http://Estersenoteca.com\", \n \"http://www.veracipizza.com/seattle\", \n \"http://Spudgreenlake.com\", \n \"https://www.grandcentralbakery.com/\", \n \"https://www.grandcentralbakery.com/\", \n \"https://www.grandcentralbakery.com/\", \n \"https://www.unbienseattle.com/\", \n \"https://www.unbienseattle.com/\", \n \"https://palermo-pizza-and-pasta-capitol-hill.securebrygid.com/zgrid/proc/site/sitep.jsp\", \n \"http://www.sullysqueenanne.com\", \n \"https://www.grubhub.com/restaurant/modena-pizza--pasta-8014-lake-city-way-ne-ste-f-seattle/345086\", \n \"https://www.brothersandco.me\", \n \"http://www.thefishbox.net\", \n \"http://www.ufbeer.com\", \n \"http://www.Jebenacafe.com\", \n \"http://irwinsbakeryseattle.com\", \n \"http://www.eathomegrown.com\", \n \"http://www.eathomegrown.com\", \n \"http://www.wann-izakaya.com\", \n \"http://www.liberatedfoods.com\", \n \"http://www.generationswinery.com/\", \n \"http://Malaysatay.com\", \n \"http://www.konvene.coffee\", \n \"https://tacodelmar.com/\", \n \"http://eathomegrown.com\", \n \"http://evvivapizza.com\", \n \"http://www.bucha-belly.com\", \n \"https://www.instagram.com/kfteaseattle/\", \n \"https://us.orderspoon.com/6KRN4SEZQ2Y31\", \n \"http://humblepieseattle.com\", \n \"https://bobaupseattle.com/\", \n \"https://www.instagram.com/dingteaseattle/\", \n \"https://squareup.com/gift/AX208H75RNCKT/order\", \n \"https://theochocolate.com/theo-to-go\", \n \"https://www.instagram.com/yifangwa/\", \n \"https://www.facebook.com/TeaRepublik/\", \n \"http://portagebaycafe.com\", \n \"http://xiannoodles.com\", \n \"http://northlaketavern.com/\", \n \"http://littleduckwa.com\", \n \"http://redpepperusa.com\", \n \"https://www.beyondmenu.com/24537/seattle/china-first-seattle-98105.aspx\", \n \"http://herkimercoffee.com\", \n \"https://seattleallegro.com/\", \n \"http://fatducksdeli.com\", \n \"http://coldplatedessert.com\", \n \"https://www.facebook.com/ohbearcafe/\", \n \"http://www.guanacostacospupuseria.site/?utm_source=google\", \n \"http://jewelofindiacuisine.com\", \n \"https://cedarsseattle.com/\", \n \"https://bbsteriyaki.com/\", \n \"http://www.bahamabreeze.com\", \n \"https://freshudon.com/\", \n \"http://www.urbanluxecafe.com\", \n \"http://aguaverdecafe.com/\", \n \"https://voilabistrot.com/\", \n \"http://www.custombakedcakes.com\", \n \"http://www.yummycaferestaurant.com\", \n \"http://www.seawolfbakers.com\", \n \"http://delishethiopianfood.com/\", \n \"http://varsityinnrestaurant.com/\", \n \"http://www.avivhummusbar.com\", \n \"http://www.ninehatswines.com\", \n \"http://hafremont.com\", \n \"http://www.tamalemylife.com\", \n \"http://retreat-greenlake.com\", \n \"https://revolvefoodwine.com/\", \n \"https://kafeneowoodstonegroup.com/demetris/\", \n \"https://kafeneowoodstonegroup.com/kafe-neo-edmonds/\", \n \"http://macrinabakery.com\", \n \"http://macrinabakery.com\", \n \"http://macrinabakery.com\", \n \"https://kafeneowoodstonegroup.com/tablas-woodstone-taverna/\", \n \"http://macrinabakery.com\", \n \"http://uwkoreanbbq.com\", \n \"https://pagliacci.com\", \n \"https://kafeneowoodstonegroup.com/kafe-neo-mill-creek/\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://uwkoreanrestaurant.com/menu/\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://www.facebook.com/pages/category/Korean-Restaurant/Korean-Tofu-House-120918917959893/\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://www.pagliacci.com/location/sammamish\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://pagliacci.com\", \n \"https://delaurenti.com\", \n \"http://aslanbrewing.com\", \n \"http://Kokucafemarket.com\", \n \"http://www.shawarmakingus.com/#front\", \n \"http://byrekandbaguette.org\", \n \"http://www.juliasseattle.com\", \n \"http://persepolis-grill.com\", \n \"https://www.thirdleafnw.com/\", \n \"http://www.starbroadway.com\", \n \"http://justpoke.com\", \n \"http://www.tacotimenw.com\", \n \"https://www.yelp.com/biz/blue-heron-seattle\", \n \"http://hiroshis.com/\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://cocoabanana.com\", \n \"http://www.mondelloristorante.com/\", \n \"http://meesumpastryseattle.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://henrysseattle.com\", \n \"http://www.sweetnothingsandmore.com\", \n \"http://www.tacotimenw.com\", \n \"https://order.tacotimenw.com/menu/sammamish-plateau?BasketId=beff0850-7418-49dc-b979-929d0219b958\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"https://www.taylorshellfishfarms.com/location/capitol-hill-melrose\", \n \"http://tacotimenw.com\", \n \"https://jai-thai-udub.business.site/\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"https://www.wedgwoodalehouse.com/\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://thaigerroom.com\", \n \"http://www.tacotimenw.com\", \n \"https://www.wedgwoodbroiler.com/\", \n \"https://www.greatstateburger.com/\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"http://raincityburgers.com/\", \n \"http://www.tacotimenw.com\", \n \"http://www.tacotimenw.com\", \n \"https://amazing-thai-cuisine.business.site/\", \n \"http://arayasplace.com\", \n \"http://broadforkcafe.com/\", \n \"http://www.theoliveandgrape.com\", \n \"https://www.facebook.com/ArepaVen/\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"https://www.facebook.com/PhoShizzleVietnameseCuisine\", \n \"https://www.caffeladro.com/locations/fremont-caffe-ladro/\", \n \"https://www.caffeladro.com/locations/capitol-hill-caffe-ladro/\", \n \"http://thanhvi.net/\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"http://thanbrothers.com\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"http://caffeladro.com\", \n \"http://Www.murphysseattle.com\", \n \"http://www.thaiplaceseattle.com/\", \n \"http://www.rachathai.com\", \n \"http://sandpointgrill.com/\", \n \"http://centralcafeseattle.com\", \n \"http://iconiqseattle.net\", \n \"http://www.epulobistro.com\", \n \"http://pagliacci.com\", \n \"http://crumbleandflake.com\", \n \"http://pagliacci.com\", \n \"http://pagliacci.com\", \n \"http://pagliacci.com\", \n \"http://pagliacci.com\", \n \"http://www.zylberschtein.com\", \n \"http://www.elborracho.co\", \n \"http://theshopagora.com\", \n \"http://www.elborracho.co\", \n \"https://pioneersquarede.com/\", \n \"https://tapas-lab.business.site/\", \n \"https://www.carillonkitchen.com/\", \n \"https://www.facebook.com/georgiasgreekrestaurantanddeli/\", \n \"http://www.jeepneycaphill.com\", \n \"https://www.thewingdome.com\", \n \"https://www.steepologie.com/\", \n \"https://lostlakecafe.com/\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.divaespresso.com/pages/cafes\", \n \"https://www.neighborhoodgrills.com\", \n \"http://www.oasisteazone.com\", \n \"http://www.oasisteazone.com\", \n \"https://www.kativeganthai.com\", \n \"https://www.teasomerestaurant.com/\", \n \"http://www.thebarkingdogalehouse.com\", \n \"http://www.oliverstwistseattle.com/\", \n \"http://www.taqueriacantina.com\", \n \"http://www.lucky-chinese-restaurant.com/\", \n \"http://www.pizzagallery.biz\", \n \"https://breezytownpizza.com/order\", \n \"https://www.windycitypie.com/\", \n \"http://MARSEILLEFOODANDWINE.COM\", \n \"http://tengusushi.com\", \n \"http://www.ilovesushiseattle.com\", \n \"http://www.fremontbowl.com\", \n \"http://www.donburistationseattle.com\", \n \"https://www.facebook.com/Mocha-Maddness-123307447733913/\", \n \"https://footprintwine.com\", \n \"http://www.recklessnoodles.com\", \n \"http://www.thaiocean.com/\", \n \"https://gkseattle.com/\", \n \"https://www.fujibakeryinc.com/\", \n \"http://floatingbridgebrewing.com/\", \n \"https://www.fujibakeryinc.com/\", \n \"http://www.laparisienneseattle.com/\", \n \"http://www.littlewatercantina.com/wp-content/uploads/2018/10/LWC-DinnerMenu.pdf\", \n \"http://www.ristorantepicolinos.com/\", \n \"https://www.jbgardenseattle.com\", \n \"http://www.volterrarestaurant.com\", \n \"https://manustacos.com/\", \n \"https://www.facebook.com/Wah-Kue-Cafe-141849926563751\", \n \"http://www.jacksbbq.com/\", \n \"http://www.sthooligans.com/\", \n \"https://www.queenmargheritaseattle.com\", \n \"https://www.facebook.com/twilightonrainier/\", \n \"http://www.jaderestaurant.net/\", \n \"https://www.bluewatertacogrill.com/#locations\", \n \"https://www.arosacafe.com/\", \n \"http://fourgenerals.com\", \n \"https://ballardbrothers.com/\", \n \"https://www.laredosgrill.com/\", \n \"https://www.themoomilkbar.com/\", \n \"https://www.bluewatertacogrill.com/#locations\", \n \"https://mykonosgreenlake.com/\", \n \"https://www.pgaribaldi.com/menu\", \n \"https://www.lowriderbakingco.com/\", \n \"https://909coffeeandwine.com/\", \n \"https://www.downtownromios.com\", \n \"https://www.pinksaltseattle.com/\", \n \"https://www.thegrowlerguys.com/locations/seattle-northeast/\", \n \"https://joliseattle.com/\", \n \"https://voulasoffshore.com/\", \n \"https://silenceheartnest.com/\", \n \"http://sweetalchemyicecreamery.com\", \n \"http://sweetalchemyicecreamery.com\", \n \"https://www.dirtycouchbrewing.com\", \n \"https://www.laspiga.com/\", \n \"https://www.facebook.com/pg/Twilight-Exit-133599351440/about/?ref=page_internal\", \n \"https://plumbistro.com/\", \n \"http://adeyabeba.net/\", \n \"https://www.nuttysquirrel.com/\", \n \"https://www.nuttysquirrel.com\", \n \"https://www.lakeunioncafe.com/take-out-menu/\", \n \"https://www.shakerandspear.com/\", \n \"http://Www.queenannecoffeeco.com\", \n \"https://www.ridgepizzanortheast.com/welcome\", \n \"http://www.streetzeria.com\", \n \"http://www.celinepatisserie.com\", \n \"https://www.meatyjohnsons.com/\", \n \"https://www.postalley.pizza/\", \n \"https://www.outerplanetbrewing.com/\", \n \"https://www.fresheverythyme.com/\", \n \"http://www.sunrisetacosseattle.com/\", \n \"https://www.streettreatswa.com/\", \n \"https://www.facebook.com/pg/Tup-Tim-Thai-111854295516312/posts/?ref=page_internal\", \n \"http://seattlebageloasis.com/index.html\", \n \"http://sugarhillseattle.com/home\", \n \"http://www.loursinseattle.com/\", \n \"http://emeraldcityfishandchips.com\", \n \"https://www.ebbandcompany.com/shop\", \n \"https://cafebesalu.com/\", \n \"http://www.letsgogrub.com/\", \n \"https://www.musangseattle.com/home\", \n \"http://www.littleredhen.com\", \n \"http://www.rookiesseattle.com\", \n \"https://www.pelotonseattle.com/\", \n \"http://bbqpetes.com\", \n \"https://www.delicatusseattle.com/\", \n \"https://store.fairislebrewing.com/\", \n \"https://www.silvercloud.com/university/dining/\", \n \"https://www.bizzarroitaliancafe.com/\", \n \"http://www.lionheadseattle.com/\", \n \"https://www.facebook.com/KrakenBarSeattle/\", \n \"https://www.facebook.com/casapatronseattle/ \", \n \"https://www.lacopacafe.com/\", \n \"http://www.thudsuanthai.com/\", \n \"http://www.sanfermoseattle.com/\", \n \"https://mamnoonstreet.com/\", \n \"http://deluxebarandgrill.com/\", \n \"https://www.take5urbanmarket.com/\", \n \"https://www.jardintea.com/\", \n \"https://performancekitchen.com/our-stores\", \n \"https://www.performancekitchen.com\", \n \"http://Santorinipizza.com\", \n \"http://mokshadining.com\", \n \"https://www.nicksonmadison.com/\", \n \"https://kwanjaithaicuisine.com/\", \n \"https://www.damoorikitchen.com\", \n \"http://quetzalseattle.com/\", \n \"http://www.muraseattle.com\", \n \"https://www.greatstateburger.com/\", \n \"https://www.tubssubs.com/\", \n \"https://rooftopbrewco.com/\", \n \"http://www.ridgecrest.pub/\", \n \"https://www.elranchonmagnolia.com/\", \n \"http://ichiroteriyakirestaurant.com/index.php\", \n \"http://places.singleplatform.com/malenas-taco-shop-2/menu\", \n \"https://www.yumbitseattle.com/\", \n \"http://www.chaiyonorthgate.com/\", \n \"https://zapverr.com/\", \n \"https://www.sisikaythai.com/\", \n \"http://hopvinepub.com/\", \n \"http://Www.resistenciacoffee.com\", \n \"http://www.joebarseattle.com\", \n \"http://le-fournil.com/\", \n \"https://www.larsensbakery.com/\", \n \"https://www.broadcastcoffeeroasters.com/\", \n \"https://www.medmixjackson.com/\", \n \"http://flyinglionbrewing.com\", \n \"http://www.sharpsroasthouse.com\", \n \"https://www.athinagrill.com/\", \n \"https://www.basilicqueenanne.com/\", \n \"https://www.themasonryseattle.com/\", \n \"https://mintandolives.com/\", \n \"https://rotirestaurantseattle.com/\", \n \"https://sugarbakerycafe.com/\", \n \"http://www.ferrynoodlehousethai.com/\", \n \"http://bua9thaicuisineseattle3.cafecityguide.website/\", \n \"https://www.seattle.noithaicuisine.com/\", \n \"http://elsombreroseattle.com/\", \n \"https://www.empireespresso.coffee/\", \n \"https://www.fulltilticecream.com/\", \n \"https://keziracaffe.com/\", \n \"http://www.lamedusaseattle.com\", \n \"https://safari-restaurant.business.site/\", \n \"https://www.rupeeseattle.com\", \n \"http://pitstoptaproom.com\", \n \"https://www.aluelcellars.com\", \n \"https://www.domanicocellars.com/\", \n \"https://www.trubistro.com/\", \n \"http://www.figureheadbrewingcompany.com\", \n \"http://www.veracipizza.com\", \n \"https://www.thestationbh.com/\", \n \"http://carnitasmichoacanseattle2.cafecityguide.website/\", \n \"https://oak-seattle.com/\", \n \"https://www.facebook.com/rainiercoffeecoburien/\", \n \"http://www.sichuan-cuisine.com/\", \n \"https://www.americanoburgers.com/\", \n \"https://bigmariosnewyorkpizza.com\", \n \"https://www.broadcastcoffeeroasters.com/\", \n \"https://www.starbucks.com/\", \n \"https://www.collectiveseattle.com/\", \n \"https://qmenu.us/#/gourmet-noodle-bowl-seattle/menu/menu-1\", \n \"http://www.takuseattle.com\", \n \"https://www.yoshinoteriyaki.com/\", \n \"https://www.tougocoffee.com/\", \n \"https://order.subway.com/en-us/restaurant/26999/menu/?utm_source=yxt-goog&utm_medium=local&utm_term=acq&utm_content=26999&utm_campaign=evergreen-2020\", \n \"http://stockboxgrocers.com/stores/first-hill-grocery/\", \n \"https://206burgercompany.com/\", \n \"https://206burgercompany.com/\", \n \"https://bluewatertacogrill.com/#locations\", \n \"https://www.tomdouglas.com/events/serious-takeout\", \n \"http://georgessausageanddelicatessenseattle.cafecityguide.website\", \n \"http://hilltopdeliseattle.cafecityguide.website/\", \n \"https://www.italianfamilypizzamenu.com/\", \n \"https://www.jimmyjohns.com/\", \n \"https://delivery.panerabread.com/\", \n \"https://delivery.panerabread.com/\", \n \"http://www.hellbentbrewingcompany.com/\", \n \"https://www.littleneontogo.com/\", \n \"https://delivery.panerabread.com/\", \n \"https://delivery.panerabread.com/\", \n \"https://delivery.panerabread.com/\", \n \"https://www.westmanstogo.com/\", \n \"https://www.piroshkirestaurant.com/\", \n \"https://www.edenhillprovisions.com/\", \n \"https://www.redmondbombaygrill.com/\", \n \"https://shop.alexandrianicolecellars.com/Shop/Browse-All-Wines\", \n \"https://www.heartbeethealthy.com/\", \n \"http://lacabanaseattle.com/\", \n \"http://www.pacinnpub.com\", \n \"http://www.szechuan-fish.com/\", \n \"http://sammyspizzatacoma.com/OrderOnline.aspx\", \n \"https://www.facebook.com/ricostacostacoma/?hc_location=ufi\", \n \"https://javasti.com/maple-leaf/\", \n \"https://javasti.com/\", \n \"https://www.youngteaglobal.com/\", \n \"http://www.thai-taste.net/\", \n \"https://www.katsuburger.com/\", \n \"https://www.katsuburger.com/\", \n \"https://www.katsuburger.com/\", \n \"http://dingfelders.com/\", \n \"http://villaescondidaseattle.com\", \n \"http://zhengcafe.com\", \n \"http://www.thatbrowngirl.com/\", \n \"http://thaicurryman.com\", \n \"http://caferacerseattle.com\", \n \"https://www.chuanbbq.com/\", \n \"https://www.malasatayseattle.com/menu\", \n \"http://meskelethiopian.com\", \n \"https://www.yelp.com/biz/shawns-cafe-and-bakery-mercer-island-2\", \n \"http://islandcrustcafe.com/\", \n \"https://www.eddiesp.com\", \n \"https://www.seattlesunshinecoffee.com/\", \n \"https://www.shelterlounge.com/\", \n \"http://www.batchbakingco.com\", \n \"https://www.facebook.com/minerslandingpier57/photos/a.472879502725738/3301236889889971/?type=3&theater\", \n \"https://www.facebook.com/pg/minerslandingpier57/posts/\", \n \"https://www.miopostopizza.com/mercerisland\", \n \"https://www.starbucks.com/store-locator/store/12517/se-27th-76th-mercer-island-7620-se-27th-st-mercer-island-wa-980402805-us\", \n \"https://www.ohchocolate.com/\", \n \"http://mercerisland.relish.com/www.islandtreatsnw.com\", \n \"https://barrelswinebar.com/\", \n \"https://www.toasttab.com/sano-cafe/v3#!/\", \n \"http://eatmopizza.com/zgrid/proc/site/sitep.jsp\", \n \"https://www.menchies.com/yogurt-shop-our-locations\", \n \"https://www.sushijoa.com/\", \n \"https://locations.einsteinbros.com/index.html?q=Mercer+Island%2C+Washington%2C+United+States\", \n \"https://www.baitongrestaurant.com/\", \n \"http://www.baitongrestaurant.com/\", \n \"http://www.thefrenchbakery.com/\", \n \"http://www.thefrenchbakery.com/\", \n \"http://www.eathomegrown.com/menu\", \n \"http://www.eathomegrown.com/\", \n \"https://justpoke.com\", \n \"https://justpoke.com/\", \n \"https://www.kizuki.com/\", \n \"http://www.kizuki.com\", \n \"http://Madrasdosacorner.com\", \n \"http://www.modpizza.com/\", \n \"http://modpizza.com\", \n \"http://Modpizza.com\", \n \"https://modpizza.com/locations/issaquah/\", \n \"https://modpizza.com/locations/sammamish/\", \n \"http://www.oobatooba.com/\", \n \"http://oobatooba.com\", \n \"http://www.pinkabellacupcakes.com/\", \n \"http://www.pinkabellacupcakesissaquah.com\", \n \"http://www.potbelly.com/Shops/ShopLocator.aspx?PotbellyShopId=247\", \n \"http://potbelly.com\", \n \"http://www.redrobin.com/\", \n \"http://redrobin.com\", \n \"http://Www.ristoranteparadiso.com\", \n \"https://www.starbucks.com/store-locator/store/1005562/issaquah-highlands-issaquah-903-ne-park-drive-issaquah-wa-980297424-us\", \n \"http://Www.kirklandtacos.com\", \n \"https://www.toppotdoughnuts.com\", \n \"http://www.toppotdoughnuts.com/index.html\", \n \"http://toppotdoughnuts.com\", \n \"http://tuttabella.com\", \n \"http://tuttabella.com\", \n \"http://www.zeekspizza.com/\", \n \"https://zeekspizza.com/menu/\", \n \"http://www.12thavenuecafe.com\", \n \"http://www.3pigsbarbq.com\", \n \"http://www.5hermanosrestaurant.com/\", \n \"http://www.520barandgrill.com/\", \n \"http://www.thai65cafe.com/\", \n \"http://www.Acropolispizzapasta.com\", \n \"https://agavecocina.com/\", \n \"http://agaverest.com/\", \n \"http://www.ajisushiissaquah.com\", \n \"http://www.alohagrillrenton.com/\", \n \"http://amarorestaurant.com/\", \n \"http://www.andiamobellevue.com\", \n \"https://www.angelosofbellevue.com/\", \n \"http://www.angelosinrenton.net/\", \n \"http://www.arayasplace.com/\", \n \"http://www.ascendprime.com/\", \n \"https://www.facebook.com/EastsideBambu/\", \n \"http://www.bangkok-basil.com/\", \n \"http://www.beardsleeph.com\", \n \"http://www.belldencafe.com/\", \n \"https://www.bellepastry.com\", \n \"http://www.bellevuebrewing.com\", \n \"https://www.bestwokchineserestaurant.com\", \n \"https://www.bevmo.com/stores/issaquah-wa/\", \n \"https://bhojanxpress.com/\", \n \"http://www.bigblockbrewery.com\", \n \"https://www.facebook.com/bigislandpoke/\", \n \"https://thaikitchenbirdpepper.com/\", \n \"http://bisonmain.com/\", \n \"http://www.bjsrestaurants.com/\", \n \"https://www.facebook.com/blackbearcoffeecompany/\", \n \"http://www.blackravenbrewing.com/\", \n \"https://www.blazingbagels.com\", \n \"https://www.blossomrenton.com/\", \n \"http://www.blusardinia.com \", \n \"http://www.Boehms.com\", \n \"http://www.bpgroupusa.com\", \n \"http://www.boonboonacoffee.com/\", \n \"http://www.thebrewmasterstaproom.com/\", \n \"http://www.briatorepizza.com\", \n \"http://thebriefencounter.dinehere.us/?fbclid=IwAR1s4gckkYv3613JHj-3TGLXfW7eay5hK1d7_VlhZllEvYCwCmoUz1YB75E\", \n \"http://www.bukharaissaquah.com\", \n \"http://www.jbbungalow.com\", \n \"https://burgermaster.biz/bellevue\", \n \"http://www.cactusrestaurants.com\", \n \"http://www.cafecesura.com/\", \n \"http://www.mexicanfoodrenton.com/\", \n \"https://www.cafeoriwa.com/\", \n \"https://cafeveloce.com/\", \n \"http://calabriamillcreek.com\", \n \"http://www.newcastlegolf.com\", \n \"http://www.capricellars.com\", \n \"http://www.casaricardos.com\", \n \"https://www.hilton.com/en/hotels/seables-embassy-suites-seattle-bellevue/dining/\", \n \"https://www.caspianbellevue.com\", \n \"https://www.castillarestaurant.com/\", \n \"http://www.cedarriversmokehouse.com/\", \n \"http://centralbar.com/\", \n \"https://www.cepae.com/\", \n \"http://www.chainlinebrew.com\", \n \"http://www.bit.ly/CheesecakeBellevue\", \n \"http://chinoisecafe.com/\", \n \"http://www.chipotle.com\", \n \"https://www.cielobellevue.com/\", \n \"http://www.cloudnineburgers.com\", \n \"http://www.coconutthaiwa.com\", \n \"https://www.comousa.com\", \n \"http://www.cowchipcookies.com/\", \n \"https://www.cypresscoffeecompany.com/\", \n \"http://www.dakshinbistro.com\", \n \"http://www.derumarket.com\", \n \"https://orders.dickeys.com/order?storeNumber=684&categoryId=1\", \n \"http://www.dintaifungusa.com/\", \n \"http://www.pizza.dominos.com/washington/issaquah\", \n \"http://dongtingchun.net/#\", \n \"https://www.doughzonedumplinghouse.com/\", \n \"https://eastsidebeerworks.com/welcome/index\", \n \"https://www.doordash.com/store/el-maestro-del-taco-bellevue-682809/en-US\", \n \"https://www.eltoreador.com\", \n \"http://www.facebook.com/espressodaviso/\", \n \"http://www.facingeastrestaurant.com/\", \n \"https://locations.fatburger.com/united-states/wa/redmond/17181-redmond-way\", \n \"https://postmates.com/merchant/fatburger-6220-e-lake-sammamish-pkwy-se?client=customer.web&version=3.0.0\", \n \"https://www.fernthaionmain.com/\", \n \"http://www.finsbistroissaquah.com\", \n \"https://fitbarcafe.com/\", \n \"https://order.fiveguys.com/menu/commons/\", \n \"http://www.florestaurant.com/\", \n \"http://www.flycasterbrewing.com\", \n \"http://www.flyingpiepizzeria.com\", \n \"https://streetfoodfinder.com/bellevuehilton\", \n \"http://www.forestfairybakery.com\", \n \"http://www.frankies-pizza.com\", \n \"https://www.facebook.com/FreshtheJuiceBar/\", \n \"http://garliccrush.com/order-online-issaquah/\", \n \"http://www.gaslampbarandgrill.com\", \n \"http://www.gilbertsonmain.com/\", \n \"http://www.greatchinawa.com/\", \n \"http://www.greenappleec.com\", \n \"http://www.Gyroworldkirkland.com\", \n \"http://www.gyroshouse.com/\", \n \"http://www.habitburger.com/locations/issaquah/\", \n \"http://www.hectorskirkland.com\", \n \"http://www.hopheads-taproom.com\", \n \"https://issaquahtrike.square.site/\", \n \"http://isushiissaquah.com\", \n \"http://ivars.com\", \n \"http://jjchinesefood.com\", \n \"http://www.jacksbbq.com\", \n \"http://jaksgrill.com\", \n \"http://jamba.com\", \n \"https://www.facebook.com/pages/Japan-Ginger/113453918675900\", \n \"http://www.japonessa.com/\", \n \"http://Jerseymikes.com\", \n \"https://locations.jimmyjohns.com/wa/issaquah/sandwiches-1983.html\", \n \"https://jinya-ramenbar.com/locations/detail/bellevue\", \n \"http://www.joeyrestaurants.com/location/joey-bellevue\", \n \"http://www.johnhowiesteak.com/\", \n \"http://justpoke.com\", \n \"http://www.justtiffins.com/\", \n \"http://www.kanishkaofredmond.com/\", \n \"https://www.facebook.com/KhaoSanThaiCuisine/\", \n \"http://www.kitanda.com/\", \n \"http://krawbar.com\", \n \"http://www.kringlesbakery.com/\", \n \"https://krispykreme.com/shop/order-start\", \n \"http://laislacuisine.com/\", \n \"http://www.rivieramayafoodtruck.com\", \n \"https://www.ladyyum.com\", \n \"http://lasmargaritasrest.com\", \n \"https://www.bistrolegrand.com/\", \n \"http://originallemongrass.com/Lemongrass/Menu.html\", \n \"http://lunchboxlaboratory.com/\", \n \"http://Www.lynnsbistro.com\", \n \"http://mamaskitchenbellevue.com\", \n \"http://mariannaristorante.com/\", \n \"http://masakitchen.com\", \n \"http://www.mccormickandschmicks.com/\", \n \"http://mediterraneankitchens.net\", \n \"https://www.mercurys.com/\", \n \"https://minamotowa.com/\", \n \"http://www.mixpokebar.com/\", \n \"https://www.facebook.com/pages/Momoya-Japanese-Restaurant/111549395550817\", \n \"http://mongacafe.com\", \n \"https://www.facebook.com/montalcinoristorante/\", \n \"http://mustardseedgrill.com\", \n \"http://naanncurry.com\", \n \"https://order.namastheredmond.com/\", \n \"http://newyorkcupcakes.com/\", \n \"http://newzensushi.com/\", \n \"http://nicksgrillkirkland.com\", \n \"http://nicksgreekitalian.com\", \n \"http://Nicolino.net\", \n \"http://facebook.com/OchaThaiRenton/\", \n \"http://ocharissaquahthai.com\", \n \"http://ohanasushigrill.com\", \n \"http://www.orenjisushinoodles.com\", \n \"http://www.pfchangs.com/Locations/LocationDetail.aspx?sid=3700&checked=1\", \n \"http://palacebbq.com\", \n \"https://papamurphys.olo.express/menu/papa-murphys-132nd-ave-ne\", \n \"http://www.pastaco.com/default.htm\", \n \"http://pastayagotcha.com\", \n \"http://www.peonykitchen.com/\", \n \"https://pizzabankrestaurant.com/\", \n \"https://www.plazagarcia.com\", \n \"http://plumdelicious.net/\", \n \"https://www.pomegranatebistro.com/\", \n \"http://postdocbrewing.com/\", \n \"http://www.pressedjuicery.com/\", \n \"http://redmondprime.com/\", \n \"http://qdoba.com\", \n \"http://www.rachathai.com/\", \n \"http://redbamboobistro.com/\", \n \"http://theredtearoom.com/\", \n \"http://redmondsgrill.com/\", \n \"http://resonatebrewery.com\", \n \"http://ricardosfactoria.com\", \n \"http://www.romiosredmond.com/zgrid/proc/site/sitep.jsp\", \n \"http://Www.romiostotemlake.com\", \n \"http://www.royalindiacuisine.com\", \n \"http://www.ruthschris.com/\", \n \"https://local.safeway.com/safeway/wa/issaquah/1451-highlands-dr.html\", \n \"http://Sagesrestaurant.com\", \n \"http://samstavernseattle.com/menu/\", \n \"http://tressandwich.com\", \n \"http://seastarrestaurant.com/\", \n \"http://Seoulhotpot.com\", \n \"http://www.shabushabukyoto.com\", \n \"https://www.1992sharetea.com\", \n \"http://thaifoodforyou.com/\", \n \"http://singtongthai.com/\", \n \"https://www.sipthaibistro.com/\", \n \"https://www.smokeandshine.com\", \n \"http://southgate-garden.com\", \n \"https://www.sparkpizzaredmond.com/\", \n \"http://squarelotus.com\", \n \"http://stansbarbq.com\", \n \"http://www.subway.com/en-us\", \n \"http://sunsetalehouse.com\", \n \"http://Sushiinjoybellevue.com\", \n \"http://sushimebellevue.com\", \n \"http://swiftwatercellarsbellevue.com/\", \n \"https://tacodelmar.com\", \n \"http://tapatiomexicangrill.com\", \n \"http://elrinconsito.com\", \n \"https://temsibbellevue.com/\", \n \"http://TerryskitchenBellevue.com\", \n \"http://thaiginger.com\", \n \"http://thaivpbellevue.com/\", \n \"https://theboxonwheels.com/the-box-burgers-coming-september-2017/\", \n \"https://thecottagebothell.com\", \n \"http://Redmondirishpub.com\", \n \"http://Thegameneighborhoodgrillandbar.com\", \n \"http://thehollywoodtavern.com\", \n \"https://www.thelodgesportsgrille.com\", \n \"http://melrosegrill.com/\", \n \"http://www.thepizzacoop.com\", \n \"http://therollpod.com/online-order\", \n \"http://theslip2.com\", \n \"http://thirstyhop.com/\", \n \"http://www.tiantiannoodles.com/\", \n \"http://www.tipsycowburgerbar.com/\", \n \"http://tokyostopteriyaki.com\", \n \"http://www.topolinopizza.com/\", \n \"http://www.ristorantetropea.com/\", \n \"http://www.victorscelticcoffee.com/\", \n \"http://vincesrestaurants.com/\", \n \"https://www.thewaffler.com/contact-1\", \n \"http://Www.wahluck.com\", \n \"https://2goservices.com/YankeeGrill\", \n \"https://www.zaucer.com/\", \n \"http://www.zeitoongrill.com\", \n \"https://www.zulusgames.com/\", \n \"https://www.ivars.com\", \n \"https://alehousepub.com/\", \n \"https://www.facebook.com/UPStationBarandGrill\", \n \"https://www.facebook.com/springlakecafe\", \n \"https://www.facebook.com/Paos-Donuts-Coffee-Shop-193087870758560/\", \n \"https://cloverleafpizza.com/menu/\", \n \"https://www.icecreambliss.com/\", \n \"https://steamersseafoodcafe.com/\", \n \"https://www.sapporosteakhouse.com/\", \n \"https://www.mariasup.com/\", \n \"http://souperphorestaurant.com/\", \n \"http://www.roundtablepizza.com/\", \n \"https://www.habitburger.com/locations/\", \n \"https://www.oddfellaspubtacoma.com/\", \n \"https://www.joeseppisitalian.com/menu\", \n \"https://www.antiquesandwich.com/\", \n \"https://farrellispizza.com/\", \n \"https://www.katiedowns.com/menu/\", \n \"https://www.anthonys.com/restaurants/best-of-season/\", \n \"https://www.facebook.com/hardwokcafebellevue\", \n \"http://sususeattle.com\", \n \"https://heritagewoodinville.com\", \n \"https://www.sunnyhillseattle.com/\", \n \"https://www.facebook.com/jibeespressobar/\", \n \"http://www.meekongbar.com\", \n \"https://zeekspizza.com\", \n \"https://www.shawarmaniac.com\", \n \"https://www.shakeshack.com/location/kirkland-wa/\", \n \"http://www.eathomegrown.com\", \n \"http://www.kozmokitchen.com\", \n \"https://www.qdoba.com/\", \n \"https://performancekitchen.com/\", \n \"https://www.zomato.com/mercer-island-wa/gourmet-teriyaki-mercer-island/menu\", \n \"https://www.subway.com/en-US\", \n \"http://anisethaicuisine.com/\", \n \"https://www.mcdonalds.com/us/en-us.html\", \n \"https://tigergardentogo.com/#page-top\", \n \"https://tuscanstonepizza.com/\", \n \"https://www.baskinrobbins.com/en\", \n \"http://facebook.com/iceboxgrocery\", \n \"http://www.eathomegrown.com/\", \n \"https://www.lexperienceparis.com/\", \n \"https://phoem.business.site/\", \n \"http://ponproemthai.com/\", \n \"https://www.saharapizzamercerisland.com/\", \n \"https://toshisgrill.com/toshis-teriyaki-mercer-island\", \n \"https://www.rivieramayawa.com/\", \n \"http://lacasita-sammamish.com/\", \n \"http://www.myaugustmoon.com/\", \n \"https://donerboxkebab.com\", \n \"https://www.chansplaces.com/\", \n \"https://order.subway.com/en-us/restaurant/12000/menu/?utm_source=yxt-goog&utm_medium=local&utm_term=acq&utm_content=12000&utm_campaign=evergreen-2020\", \n \"https://order.subway.com/en-us/restaurant/23793/menu/?utm_source=yxt-goog&utm_medium=local&utm_term=acq&utm_content=23793&utm_campaign=evergreen-2020\", \n \"https://locations.jimmyjohns.com/wa/sammamish/sandwiches-1984.html\", \n \"https://www.portofinopizza.com/\", \n \"https://www.fremontbrewing.com \", \n \"http://www.freshfloursseattle.com\", \n \"https://www.curbsidesnofallscandyshoppe.com/\", \n \"http://www.freshfloursseattle.com/\", \n \"http://theloftlounge.com/\", \n \"http://bit.ly/salishtogo\", \n \"http://www.sigillocellars.com \", \n \"https://www.jerseymikes.com/18030/sammamish-wa\", \n \"http://www.arturomexicanrestaurant.com/\", \n \"https://www.mcdonalds.com/us/en-us/location/wa/sammamish/615-228th-ave-ne/11996.html?cid=RF:YXT:GMB::Clicks\", \n \"https://borealisonaurora.com/\", \n \"https://www.adasbooks.com/adas-pop-pie-shop\", \n \"https://m.facebook.com/pages/El-Kiosko/148295225309246\", \n \"http://www.seabendmeat.com/\", \n \"https://lanponi.blogspot.com/\", \n \"https://www.buckleyspubs.com/queenanne/\", \n \"https://thaiginger.com/order-online/\", \n \"http://www.hawaiianstylebbq.net/\", \n \"http://vinason.net/\", \n \"https://thelocal104.com/\", \n \"https://dlasanta.com/\", \n \"http://pinelakealehouse.com/the-food/\", \n \"http://tastythaifactoria.com/\", \n \"https://www.tanoor.com/\", \n \"https://zeekspizza.com/locations-hours/zeeks-pizza-sammamish/\", \n \"https://locations.chipotle.com/wa/sammamish/22704-se-4th-st?utm_source=google&utm_medium=yext&utm_campaign=yext_listings\", \n \"http://copperstonepasta.com\", \n \"http://nasaiteriyakisammamish.com/?utm_source=gmb&utm_medium=referral\", \n \"https://kryptonitebarandpizza.com/\", \n \"https://order.papamurphys.com/menu/papa-murphys-228th-ave-ne\", \n \"https://order.papamurphys.com/menu/papa-murphys-klahanie-drive\", \n \"https://locations.jackinthebox.com/us/wa/sammamish/620-228th-ave-ne\", \n \"https://locations.papajohns.com/united-states/wa/98074-7223/sammamish/721-228th-ave-ne?utm_source=gmb&utm_medium=organic\", \n \"http://pinelakepizza.com/\", \n \"http://mommyskitchen1.com/\", \n \"https://www.dairyqueen.com/us-en/locator/Detail/?localechange=1&store-id=15118&\", \n \"https://www.wmgrassiewines.com/\", \n \"https://www.ubereats.com/seattle/food-delivery/yoko-teriyaki/-8Yhe0v4Qp25-uG2ITAx4Q\", \n \"https://order.subway.com/en-us/restaurant/56349/menu/?utm_source=yxt-goog&utm_medium=local&utm_term=acq&utm_content=56349&utm_campaign=evergreen-2020\", \n \"http://www.elcaporalfallcity.com/\", \n \"https://saharapizza.com/\", \n \"https://fcroadhouse.com/\", \n \"http://places.singleplatform.com/small-fryes/menu?ref=google\", \n \"https://ixtapa-carnation.business.site/\", \n \"http://redpepperpizzeria.com/\", \n \"https://www.samsnoodletown.com/\", \n \"http://restaurants.quiznos.com/wa/duvall/duvallsafewayplaza-98019\", \n \"https://www.ixtaparedmondridge.com/\", \n \"https://tonymaronispizza.com/\", \n \"https://www.doordash.com/store/himitsu-teriyaki-redmond-28388/en-US/?utm_campaign=gpa\", \n \"https://www.orderindiqzeen.com/#menu\", \n \"https://modpizza.com/locations/redmond-ridge/\", \n \"https://www.fallsbrew.com\", \n \"https://www.lazysusanseattle.com/\", \n \"https://www.indiabistroroosevelt.com/\", \n \"https://www.villagepizza.org/\", \n \"https://www.suikaseattle.com\", \n \"https://ethio-emperor-bar-n-restaurant.business.site/\", \n \"http://www.paranormalp.site/\", \n \"https://qeerroo-restaurant.business.site/\", \n \"https://www.limoncelloseattle.com/\", \n \"https://www.trottersfamilyrestaurant.com/\", \n \"http://www.rainbowcafediner.com/\", \n \"http://memosmexicanfood.com/\", \n \"http://leafsdeli.com/\", \n \"https://www.gorgaithai.com/\", \n \"https://www.seamless.com/menu/alive-juice-bar-20226-ballinger-way-ne-shoreline/807903\", \n \"http://sushidowa.com/\", \n \"https://www.zomato.com/shoreline-wa/hae-nam-kalbi-calamari-shoreline/menu\", \n \"https://www.rioblancowa.com/\", \n \"https://www.hillsshoreline.com/\", \n \"https://cielo-restaurant.business.site/\", \n \"http://hibachibuffetauburn.com/\", \n \"http://chinahouseauburn.com/\", \n \"https://www.theredlotusauburn.com/\", \n \"https://www.athenspizzaauburn.com/\", \n \"https://m.facebook.com/pages/Koong-Thong-Thai-Cuisine/116151188410242\", \n \"https://www.lasmargaritasrest.com/\", \n \"https://www.facebook.com/SUSHI-Konami-INC-548447711867916/\", \n \"http://www.twedescafe.com/\", \n \"https://www.oddfellaspubauburn.com/\", \n \"https://www.longhornbarbecue.com/\", \n \"http://www.loscabosmexicanrestaurant.com/home.php\", \n \"https://m.facebook.com/pages/Starting-Gate-Restaurant/117322438285858\", \n \"https://www.sunnyteriyakiauburn.com/\", \n \"http://themazatlanmex.com/\", \n \"https://m.facebook.com/pages/Belen-Pupuseria-Y-Taqueria/103780789767685\", \n \"https://www.therockwfp.com/\", \n \"https://places.singleplatform.com/mediterranean-oasis/menu?ref=Microsoft\", \n \"https://www.thestonehousecafe.com/\", \n \"https://www.johnnyrockets.com/locations/the-outlet-collection-auburn-wa-usa/\", \n \"http://www.pekinghouserestaurant.com/menu.php\", \n \"https://www.facebook.com/Top-Pho-246836315523040/\", \n \"https://www.zomato.com/shoreline-wa/pho-tic-tac-shoreline\", \n \"https://outletcollectionseattle.com/dining/nori-japan\", \n \"https://ilovespiros.com/\", \n \"http://www.elrinconsito.com/\", \n \"https://happy-express.business.site/\", \n \"https://sizzledogs.com/\", \n \"https://www.thaibistro.us/shoreline\", \n \"https://m.facebook.com/pages/Joy-Pho-Terriyaki/235258129911841\", \n \"https://www.sweetricewa.com/\", \n \"https://www.todomexicorestaurants.com/menu\", \n \"https://solamentealpastor.com/\", \n \"http://www.morselseattle.com\", \n \"https://www.spudfishandchips.com\", \n \"https://www.sushizenmillcreek.com\", \n \"https://www.spudfishandchips.com\", \n \"http://www.ixtapalynnwood.com\", \n \"http://www.lombardisitalian.com\", \n \"https://eatonopoke.com\", \n \"http://www.lombardisitalian.com\", \n \"http://www.jamba.com\", \n \"https://www.jamba.com\", \n \"https://bucksamericancafe.com\", \n \"https://www.jamba.com\", \n \"https://WWW.JAMBA.COM\", \n \"http://www.doubleddmeats.com\", \n \"http://Gyrostoppita.com\", \n \"http://Brooklynbros.com\", \n \"http://Gyrostoppita.com\", \n \"http://Brooklynbros.com\", \n \"http://HEAVENSENTFRIEDCHICKEN.COM\", \n \"https://HEAVENSENTFRIEDCHICKEN.COM\", \n \"http://www.hemlockstate.com\", \n \"http://Gyrostoppita.com\", \n \"http://gyrostoppita.com\", \n \"http://gyrostoppita.com\", \n \"https://www.amantepizzaeverett.com/\", \n \"https://Subway.com\", \n \"https://Subway.com\", \n \"https://www.facebook.com/ixtapa.lakestevens/\", \n \"http://www.aversanos.com/\", \n \"https://www.drinkbambu.com/menu/tacoma\", \n \"https://www.blackfleetbrewing.com/\", \n \"http://www.casamiarestaurants.com/restaurants/lakewood-casa-mi/\", \n \"https://doylespublichouse.com/\", \n \"https://locations.pitapitusa.com/ll/US/WA/Tacoma/921-Pacific-Ave\", \n \"https://www.sizzler.com/locations/sizzler-s-tacoma-way\", \n \"https://theswisspub.com/\", \n \"http://acornbeer.com/\", \n \"https://www.oakbrookgolfclub.com/adriatic-at-oakbrook/\", \n \"http://allagorestaurant.com/menu1/\", \n \"https://www.facebook.com/AngleasRestaurant/posts/\", \n \"https://www.asadotacoma.com/\", \n \"http://barbistrotacoma.com/\", \n \"http://www.blackstar.pub/\", \n \"https://www.facebook.com/BlueSteeleCoffee/\", \n \"https://bluebeardcoffee.com/\", \n \"http://www.branksbbq.com/\", \n \"https://brewersrowtacoma.com/\", \n \"https://3uilt.com/main-menu\", \n \"http://www.thecampbar.com/menu/\", \n \"https://www.carneaqui.com/menus/\", \n \"http://www.caskcades.com\", \n \"https://www.facebook.com/CitronEuropeanBistro/\", \n \"https://cookstavern.com/\", \n \"https://www.countryroserestauranttacoma.com/main-menu\", \n \"http://www.craft19coffee.com/\", \n \"http://www.crispgreens.co/\", \n \"https://www.crudoandcotto.com/\", \n \"https://www.dairyqueen.com/us-en/locator/Detail/?localechange=1&&store-id=6113\", \n \"https://www.devotedkisscafe.com/\", \n \"https://elborrachotacoma.hrpos.heartland.us/\", \n \"https://www.elpueblitorestaurant.com/0a04de11-3f5f-404f-89de-ae0e9c9fbfbc\", \n \"http://www.eltorofamily.com/\", \n \"http://www.eltorofamily.com/\", \n \"http://www.eltorofamily.com/\", \n \"http://www.eltorofamily.com/\", \n \"https://www.myelementsnw.com/\", \n \"https://erawanbar.smartonlineorder.com\", \n \"https://www.essenceloungetacoma.com/\", \n \"https://www.facebook.com/farm12news\", \n \"https://www.fatzachspizza.com/\", \n \"https://www.fiestataqueriaandtequilabar.com/menu\", \n \"https://frankies-pizza.com/our-locations/\", \n \"https://www.galluccis.com/onthego/\", \n \"https://www.facebook.com/gayleorthcatering\", \n \"https://www.ginosrestaurants.com/gino-s-at-the-point\", \n \"http://www.goldenteakthai.com/\", \n \"http://www.happybellytacoma.com\", \n \"https://heritagedistilling.com/\", \n \"https://heritagedistilling.com/\", \n \"https://pickup.honeybaked.com/stores/details/2100\", \n \"https://www.inclineciderhouse.com/\", \n \"https://jonzcatering.com/\", \n \"http://jubileeburger.com/\", \n \"http://karmaindiancuisinepuyallup.com/menu/\", \n \"https://lele-east-west-thai-vietnamese-cuisine.business.site/\", \n \"http://eatatlizzielous.com\", \n \"https://www.locustcider.com/taprooms/tacoma/ \", \n \"https://www.facebook.com/LukesDonuts/\", \n \"https://www.dinemarzano.com/takeout-menu\", \n \"https://www.mcnamaraspubandeatery.com/\", \n \"https://www.facebook.com/moshitacoma/\", \n \"https://www.facebook.com/pages/category/Diner/Mrs-Turners-Hometown-Cafe-1432728696990758/\", \n \"https://www.nothingbundtcakes.com/bakery/wa/South-Hill\", \n \"https://www.facebook.com/pages/category/Bakery/Old-Times-Bakery-Deli-1531945310270755/\", \n \"https://www.facebook.com/OSJInternational/\", \n \"https://www.outback.com/locations/wa/tacoma\", \n \"https://overthemooncafe.net/\", \n \"https://www.instagram.com/p/B95ZsVfgzAw/\", \n \"http://Facebook.com/PhoEverPuyallup\", \n \"http://pick-quick.com/locations/\", \n \"https://www.facebook.com/PLAYAAZUL/\", \n \"http://www.pomodoroproctor.com/\", \n \"https://tacomapsp.com/\", \n \"https://www.facebook.com/reynasmexicanrestaurant/\", \n \"http://rosegardenfoods.net/\", \n \"http://www.roundtablepizza.com\", \n \"https://www.route66pizza.com/\", \n \"https://salamonespizzeria.com/menu\", \n \"http://sammyspizzatacoma.com/OrderOnline.aspx\", \n \"https://www.thespartavern.com/\", \n \"https://www.stanleyandseaforts.com/takeout-catering.php\", \n \"https://stephs-pizza-online-ordering.securebrygid.com/zgrid/themes/13035/mobile/pages/specials.jsp\", \n \"https://www.stinktacoma.com/menus\", \n \"https://www.thesummitpub.com/menu#menu=to-go-menu\", \n \"https://www.sushiari.com/menu-1\", \n \"http://sushitamarestaurant.com/\", \n \"https://www.t47.com/\", \n \"https://www.facebook.com/tamisintacoma/?rf=1073826176150049\", \n \"https://www.carlsonblock.com/\", \n \"https://www.facebook.com/thechurchcantina/\", \n \"http://www.EatTheDutch.com\", \n \"https://www.harborgeneral.com/menu-c14aw\", \n \"https://www.themillofmilton.com/\", \n \"https://vaultcatering.com/cuisine-to-you/\", \n \"https://www.tims-kitchen.com/\", \n \"https://www.tims-kitchen.com/\", \n \"https://toscanospuyallup.com/menus/\", \n \"https://www.pizzatrackside.com/online-order.html\", \n \"https://www.pizzatrackside.com/online-order.html\", \n \"https://www.facebook.com/TheTrellisCafeandBoutique/\", \n \"https://urbanelktacoma.com/menu-1\", \n \"https://www.wallysrestaurants.com/wallysdrivein\", \n \"https://www.facebook.com/zogsonfoxisland/\", \n \"https://www.beefysburgers.me/our-menu\", \n \"https://www.facebook.com/Bourbon-Street-Creole-Kitchen-Bar-1381773648744625/\", \n \"https://btthairestaurant.business/\", \n \"https://www.carrsrestaurant.net/\", \n \"http://www.changthaicuisine.com/\", \n \"http://www.changthaiexpress.com/\", \n \"https://www.chick-fil-a.com/locations/wa/fircrest\", \n \"https://www.cfalakewood.com/\", \n \"http://www.cfapuyallup.com\", \n \"https://www.chick-fil-a.com/locations/wa/38th-steele\", \n \"https://www.facebook.com/DLaraMediterraneanGrillBonneyLake/\", \n \"http://davesofmilton.com\", \n \"https://locations.dennys.com/WA/TACOMA/247539\", \n \"http://www.ehouse9.com/restaurant\", \n \"https://www.firehousesubs.com/locations/wa/lakewood-pavilion/\", \n \"https://www.flyingtomatogrillandbar.com/welcome\", \n \"https://www.gardensgourmetsalads.com/\", \n \"https://www.gophillycheesesteaks.com/\", \n \"https://www.gophillycheesesteaks.com/\", \n \"http://www.thehappyteriyaki.com/menu-fife.html\", \n \"http://Happyphotime.com \", \n \"http://www.thehappyteriyaki.com/\", \n \"https://www.i5photacoma.com/#/\", \n \"http://indochinedowntown.com/\", \n \"https://islandlodge.net/home\", \n \"https://www.itsgreektomerestaurant.com/menu\", \n \"https://www.ivars.com\", \n \"https://www.ivars.com\", \n \"https://www.jazzbones.com/\", \n \"https://louiegspizza.com/\", \n \"https://www.facebook.com/mazatlancanyon/\", \n \"https://www.moctezumas.com/#tequila-bars\", \n \"https://www.moctezumas.com/#tequila-bars\", \n \"https://musclemakergrill.com/locations/\", \n \"http://ILoveOPH.com\", \n \"http://iloveoph.com/\", \n \"https://order.papamurphys.com/menu/papa-murphys-point-fosdick\", \n \"https://order.papamurphys.com/menu/papa-murphys-valley-avenue\", \n \"https://order.papamurphys.com/menu/papa-murphys-borgen-blvd\", \n \"http://www.therockwfp.com\", \n \"http://www.therockwfp.com/\", \n \"https://rushbowls.com/lakewood/order-online\", \n \"https://www.samchoyspoke.com/tacoma-menu\", \n \"https://orders.cake.net/11146816\", \n \"https://www.spankyburger.com/menu\", \n \"https://www.thekoitacoma.com/\", \n \"https://www.trapperssushi.com/\", \n \"https://www.trapperssushi.com/\", \n \"https://www.trapperssushi.com/\", \n \"http://onthemenu-tacoma.tripod.com/id2.html\", \n \"https://www.iloveamici.com/menu/\", \n \"https://www.texasbbq2u.com/\", \n \"https://www.bjsrestaurants.com/locations/wa/puyallup\", \n \"https://www.bjsrestaurants.com/locations/wa/tacoma\", \n \"https://corinabakery.com/tacoma/\", \n \"https://www.crockettspublichouse.com/puyallup/\", \n \"https://farrellispizza.com/\", \n \"http://www.farrellispizza.com/\", \n \"https://farrellispizza.com/\", \n \"https://farrellispizza.com/\", \n \"https://farrellispizza.com/\", \n \"http://www.fatzachspizza.com\", \n \"https://www.facebook.com/GabesOldFashionedIceCream\", \n \"https://www.giorgiosgreekcafe.com/\", \n \"https://www.homesteadwa.com/\", \n \"https://www.facebook.com/sumnergals/\", \n \"https://www.facebook.com/hubgigharbor/\", \n \"https://www.facebook.com/HubPuyallup/\", \n \"https://www.facebook.com/Lostamalestacoma/\", \n \"http://luckysparkland.com/\", \n \"https://www.mannysplacetacoma.com/\", \n \"http://www.phoandmoregigharbor.com/\", \n \"http://pizzacasa.com/\", \n \"http://www.pizazzpizza.com/menu.html\", \n \"http://Sanblasmexicanrestaurant.com\", \n \"https://www.facebook.com/uptownkoffee/?hc_location=ufi\", \n \"https://www.facebook.com/Vuelva-A-La-Vida-100118676745013/\", \n \"https://www.warthogbbq.com/menus\", \n \"https://www.warthogbbq.com/menus\", \n \"https://wickedpiepizza.com/\", \n \"https://zeekspizza.com\", \n \"http://Bluburgersandbrew.com\", \n \"http://www.avantipizzalynnwood.com\", \n \"http://www.wildwasabisushi.com\", \n \"https://moosecreekbbq.com\", \n \"http://SolFoodEverett.com\", \n \"http://kelnero.bar\", \n \"http://yummyteriyakiseattle.com\", \n \"https://www.lindastavern.com/\", \n \"http://www.kingsballard.com/\", \n \"http://twistedlimepub.com\", \n \"http://bbpmenu.com\", \n \"http://bucksamericancafe.com\", \n \"http://buzzinnsteakhouse.com\", \n \"http://cafezippy.com\", \n \"http://indigoeverett.com/dining.php\", \n \"http://themazatlanmex.com/everett\", \n \"http://midnightcookieco.com\", \n \"http://thevintagecafe.net\", \n \"http://www.nomnomteriyakinmore.com/\", \n \"http://www.afktavern.com/\", \n \"http://portgardnerbaywinery.com\", \n \"http://starbucks.com\", \n \"https://subway.com\", \n \"http://www.katanasushieverett.com\", \n \"http://cafeuu.net\", \n \"http://valleyorganicdeli.com\", \n \"http://www.royalthaibistro.com/\", \n \"https://www.facebook.com/pokepopco/\", \n \"https://locu.com/places/kaihana-seattle-us/\", \n \"https://www.cubesbaking.com\", \n \"http://www.maonoseattle.com\", \n \"https://www.bothwayscafe.com/\", \n \"https://www.instagram.com/kimchibristroseattle/\", \n \"http://192brewing.com\", \n \"http://www.countrysidecafewa.com/welcome\", \n \"http://kiddvalley.com\", \n \"https://blackbeardiner.com/location/federal-way/\", \n \"https://www.bk.com/\", \n \"http://thehodgepodgecafe.com\", \n \"http://tsriumathaikenmore.com\", \n \"https://www.coldstonecreamery.com/\", \n \"https://ikiikisushi.com/\", \n \"https://www.tastybistroeverett.com\", \n \"https://www.cairnbrewing.com/\", \n \"https://www.umamieverett.com\", \n \"http://www.thelodgesportsgrille.com\", \n \"https://www.ivars.com\", \n \"https://locations.jackinthebox.com/us/wa/federal-way/1610-s-347th-pl\", \n \"https://locations.jackinthebox.com/us/wa/federal-way/2400-sw-336th-st\", \n \"https://locations.jackinthebox.com/us/wa/federal-way/31130-pacific-hwy-s\", \n \"http://jamba.com\", \n \"https://locations.jimmyjohns.com/wa/federalway/sandwiches-1438.html\", \n \"https://www.ivars.com\", \n \"http://www.thelodgesportsgrille.com\", \n \"https://majorleaguepizza.com\", \n \"https://www.graciescuisine.com\", \n \"https://www.everettpizzahouse.com\", \n \"http://www.sportysbeefandbrew.com\", \n \"https://bhupingthaicuisine.com\", \n \"http://deluxebarandgrill.com\", \n \"http://www.airwaysbrewing.com\", \n \"https://www.facebook.com/CCs-20-Espresso-Ice-Creamery-334104710024053/\", \n \"http://www.australianpieco.com/\", \n \"https://theburienfishhouse.com/\", \n \"http://www.elrinconsito.com/\", \n \"https://snack-gyro.business.site/\", \n \"http://vincesrestaurants.com/\", \n \"http://www.ivars.com\", \n \"https://www.taquerialaestacionseattle.com/\", \n \"http://sammamish.cafesinc.com/\", \n \"http://bellalunapizzaandpasta.com/zgrid/themes/13030/intro/index.jsp\", \n \"https://www.facebook.com/TheNewMexicans/\", \n \"http://www.labambakent.com/home.html\", \n \"https://www.facebook.com/pages/category/Chicken-Joint/That-Chicken-Place-563512834051166/\", \n \"http://www.barkadaedmonds.com\", \n \"http://places.singleplatform.com/thai-on-main-street--/menu\", \n \"https://www.westsidepizza.com/\", \n \"https://sawatdythai.com/\", \n \"https://www.hammysburgers.com/\", \n \"https://casa-rojas-express.business.site/\", \n \"https://islabonitarestaurant.com/\", \n \"https://curriesineverett.com\", \n \"https://www.marriott.com\", \n \"https://www.redrocksubs.com\", \n \"https://www.romioseverett.com\", \n \"https://winnyha.wixsite.com/hotironmongolian\", \n \"https://www.elparaisomexicangrill.com\", \n \"https://www.elparaisomexicangrill.com\", \n \"http://boatshed.restaurant/\", \n \"https://www.hellokfresh.com\", \n \"https://www.that1place.net/\", \n \"https://www.coamexicaneatery.com/\", \n \"https://www.thaibistro.us/federalway\", \n \"https://bargreenscoffee.com\", \n \"https://www.thaivalley-restaurant.com\", \n \"http://www.pizzazza.com/\", \n \"https://petitesweetbakery.com\", \n \"https://www.thaimana.com/\", \n \"http://www.kaisushiroll.com/\", \n \"https://www.dickeys.com\", \n \"https://www.alfyspizza.com\", \n \"https://www.alfyspizza.com\", \n \"https://www.tampico-mexicanrestaurant.com\", \n \"http://www.mythaichili.com/\", \n \"https://althascajunspices.com/\", \n \"https://www.mamastortinis.com\", \n \"https://www.facebook.com/pages/Burritos-el-incapaz/162913063762144\", \n \"https://wildwheatbakery.com/\", \n \"https://www.facebook.com/pages/Mexico-Lindo/120617377955112\", \n \"https://www.mamastortinis.com\", \n \"http://www.myegghole.com\", \n \"https://www.mamastortinis.com\", \n \"http://Www.Iwantsomebigboys.Com\", \n \"http://www.trapperssushi.com/kentstation\", \n \"https://www.noodlenationeverett.com\", \n \"http://www.antiguaguatemalarestaurant.com\", \n \"https://www.bluewaterdistilling.com\", \n \"https://capersandolives.com\", \n \"https://www.thecakewalkshop.com\", \n \"https://www.cafewylde.com\", \n \"https://theirishmen.com\", \n \"https://apogeepub.com/\", \n \"https://www.applebees.com/en/restaurants-renton-wa/375-s-grady-way-7520\", \n \"http://www.togos.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.tacotimenw.com\", \n \"https://www.Dickeys.com\", \n \"https://www.ddir.com/kentlocation/\", \n \"https://www.paolositalian.com\", \n \"https://www.facebook.com/SayaJapaneseAndThai/\", \n \"http://kjscakerybakery.com\", \n \"http://www.tastydoux.com\", \n \"https://www.yelp.com/biz/mei-wa-bakery-kent\", \n \"https://happydonut.business.site\", \n \"http://saigonsoulrestaurant.com/\", \n \"https://108-vietnamese-restaurant.business.site/\", \n \"https://sweetthemesbakery.com\", \n \"http://www.Olivegarden.com\", \n \"https://www.thewestyseattle.com/\", \n \"https://www.pizzamartkent.com/\", \n \"https://togoorder.com/web/1550#/\", \n \"https://www.facebook.com/boilingcrawfishkent/\", \n \"https://www.facebook.com/pages/Yummy-Teriyaki/121484877865311\", \n \"https://www.facebook.com/pages/Bucks-Teriyaki/115882655099456\", \n \"https://www.facebook.com/pages/Nikko-Teriyaki/155736057780627\", \n \"https://www.facebook.com/pages/Kings-Teriyaki/117538944939084\", \n \"https://www.facebook.com/pages/Konichs-Teriyaki/120759777938348\", \n \"https://www.facebook.com/pages/category/Asian-Restaurant/Ichi-2-Teriyaki-160109784049840/\", \n \"https://www.facebook.com/pages/Kims-Teriyaki/115791471775119\", \n \"https://www.facebook.com/pages/Ichi-Teriyaki/113506478683997\", \n \"http://www.hungrymungrys.com\", \n \"https://www.facebook.com/Bento-Teriyaki-172111859497362/\", \n \"https://www.facebook.com/pages/Tokyo-Town-Teriyaki/117828944910857\", \n \"https://www.facebook.com/pages/Himitsu-Teriyaki/117588011593179\", \n \"https://www.jackinthebox.com/\", \n \"http://www.bertassalvadorankitchen.com/contact-us/\", \n \"https://desmoinesmandarinkitchen.com/\", \n \"https://www.originvietnamesebistro.com/\", \n \"http://bokabokchicken.com\", \n \"http://places.singleplatform.com/dinos-ice-cream/menu?ref=google\", \n \"https://www.yummychinesemenu.com/\", \n \"https://www.menupix.com/seattle/restaurants/4706491/Manna-Teriyaki-Des-Moines-WA\", \n \"http://kingwha.com\", \n \"https://dragongate.business.site/\", \n \"https://www.subway.com/en-us\", \n \"http://www.jalisco-mex.com/Jalisco/Jalisco_Lake_City.html\", \n \"https://newtokyoteriyaki.com/\", \n \"http://amonosmex.com/\", \n \"http://angelosofburien.com\", \n \"https://the-best-teriyaki-sushi-wa.hub.biz/\", \n \"http://aztecamex.com\", \n \"http://burienpizzeria.com\", \n \"http://burgerbroiler.com\", \n \"https://teacup-bubble-tea-store.business.site/\", \n \"https://www.facebook.com/phodinhrestaurant/\", \n \"https://www.desmoinesthaicuisine.com/\", \n \"https://bigfootjava.com/\", \n \"https://www.restaurantji.com/wa/des-moines/haru-sushi-and-teriyaki-/\", \n \"https://www.bing.com/maps?q=sharetea&form=EDGEAR&qs=LS&cvid=ef666cde4eb5433a861f834c3fce40bb&cc=US&setlang=en-US&plvar=0\", \n \"https://www.facebook.com/CherryValleyWinery/\", \n \"https://www.auntieirenes.com/\", \n \"https://www.gpdoughnuts.com/locations/capitol-hill\", \n \"https://www.quarterdeckdm.com/\", \n \"https://www.gpdoughnuts.com/locations/laurelhurst\", \n \"http://northwestgrocers.com/\", \n \"https://www.bing.com/search?q=homefront+ice+cream+des+moines&form=EDGEAR&qs=AS&cvid=530f5fcc560c44059378035413684897&cc=US&setlang=en-US&plvar=0\", \n \"http://duvallfarmersmarket.org/\", \n \"https://www.minithedough-nut.com/\", \n \"https://restaurants.subway.com/united-states/wa/des-moines/21425-pacific-hwy-south?utm_source=yxt-bing&utm_medium=local&utm_term=acq&utm_content=3524&utm_campaign=evergreen-2020\", \n \"https://www.subway.com/en-us\", \n \"https://www.tjmexicanfood.com\", \n \"https://www.marineviewespresso.net/\", \n \"https://www.facebook.com/Northhillespresso/\", \n \"https://bizzy-bean-espresso.business.site/\", \n \"https://www.facebook.com/riptideroast/\", \n \"http://www.peyrassolcafe.com/\", \n \"http://www.cubesbaking.com/\", \n \"https://www.kentgyrostation.com/\", \n \"https://www.wallysrestaurants.com/wallyschowderhouse\", \n \"https://www.saltys.com/south-seattle/\", \n \"https://www.anthonys.com/restaurants/detail/anthonys-homeport-des-moines\", \n \"https://www.bandemeats.com/\", \n \"https://www.bing.com/maps?&ty=18&q=Viva%20Mexico%20Des%20Moines%20WA&ss=ypid.YN926x15851500&ppois=47.36823272705078_-122.30463409423828_Viva%20Mexico_YN926x15851500~&cp=47.368233~-122.304634&v=2&sV=1\", \n \"https://www.facebook.com/californiaburritobtech195/\", \n \"https://www.bing.com/maps?&ty=18&q=Cemitas%20Tepeaca%202%20Des%20Moines%20WA&ss=ypid.YN873x134793378&ppois=47.40752029418945_-122.2978286743164_Cemitas%20Tepeaca%202_YN873x134793378~&cp=47.40752~-122.297829&v=2&sV=1\", \n \"https://locations.tacobell.com/wa/kent/27001-pacific-hwy-s.html?utm_source=yext&utm_campaign=googlelistings&utm_medium=referral&utm_term=031320&utm_content=website\", \n \"https://www.facebook.com/menuderiamaria/\", \n \"http://www.athenspizzapasta.com/\", \n \"http://vincesrestaurants.com/via-marina\", \n \"https://www.facebook.com/SpyrosGyrosEtc/\", \n \"https://www.hilton.com/en/hotels/sealwes-embassy-suites-seattle-north-lynnwood/dining/\", \n \"https://www.bing.com/maps?q=papa+murphys+des+moines&form=EDGEAR&qs=PF&cvid=11b7bb2085f14d65bae74d741102c02b&cc=US&setlang=en-US&plvar=0\", \n \"https://www.bobalustteahouse.com/\", \n \"https://www.restaurantji.com/wa/des-moines/midway-donuts-and-gyros-/\", \n \"https://locu.com/places/des-moines-dog-house-des-moines-us/\", \n \"https://www.bing.com/maps?&ty=18&q=Jack%27s%20Country%20Restaurant%20Des%20Moines%20WA&ss=ypid.YN926x15851476&ppois=47.40538024902344_-122.32514953613281_Jack%27s%20Country%20Restaurant_YN926x15851476~&cp=47.40538~-122.32515&v=2&sV=1\", \n \"https://order.redrobin.com/menu/red-robin-des-moines\", \n \"https://www.cybercoupons.com/wa/tuscany-at-des-moines-creek-des-moines\", \n \"https://www.jerseymikes.com/18031/kent-wa\", \n \"https://www.jpsbars.com/location/jps-taproom-grill/\", \n \"https://www.bing.com/maps?q=jack+in+the+box+des+moines&form=EDGEAR&qs=PF&cvid=b752ce0903f04b639bb33c5fb8ba5d39&cc=US&setlang=en-US&plvar=0\", \n \"http://www.olivetreemenu.com\", \n \"http://mamasdoughkent.com\", \n \"http://agaverest.com/\", \n \"https://sweetnotescafe.com/\", \n \"https://taste-togo-banhmi.business.site/\", \n \"https://www.habitburger.com/locations/kent/\", \n \"http://drinkbambu.com\", \n \"https://www.alkibakery.com/\", \n \"https://www.facebook.com/pg/DuvallGrill/posts/?ref=page_internal\", \n \"https://locations.jackinthebox.com/us/wa/des-moines/1810-s-272nd-st\", \n \"https://locations.kfc.com/wa/des-moines/25925-pacific-highway-south\", \n \"https://locations.churchs.com/wa/des-moines/23839-pacific-hwy-south\", \n \"https://www.mcdonalds.com/us/en-us/location/wa/des-moines/22644-pacific-hwy-s/5760.html\", \n \"https://www.facebook.com/duvallvodka/\", \n \"https://www.facebook.com/GratefulBreadDuvall/\", \n \"https://www.facebook.com/pages/Happy-At-The-Bay/116442285050382\", \n \"https://www.facebook.com/pages/Blinker-Tavern/121351824546475\", \n \"https://www.facebook.com/hollyhockfarmnw/\", \n \"https://www.ixtapaduvall.com/\", \n \"http://localrootsfarm.com/farm-stand/\", \n \"https://www.facebook.com/LongevityFoods/\", \n \"https://www.terracottaredbistro.com\", \n \"https://www.facebook.com/OxbowCenter/\", \n \"https://order.papamurphys.com/menu/papa-murphys-big-rock\", \n \"https://theorganiccoup.com/\", \n \"https://www.facebook.com/phothailand/\", \n \"http://www.magic-flavors.com\", \n \"https://www.facebook.com/pickletimeduvall/\", \n \"https://www.aesirmeadery.com\", \n \"http://www.mazagrill.co\", \n \"https://atlargebrewing.com\", \n \"https://cruciblebrewing.com\", \n \"https://www.jamesbaydistillers.com/\", \n \"http://restaurants.quiznos.com/wa/duvall\", \n \"https://www.facebook.com/MiddletonBrews/\", \n \"http://redpepperpizzeria.com/\", \n \"https://scuttlebuttbrewing.com\", \n \"https://theindependentbeerbar.com\", \n \"https://www.rusticcabincoffee.com/\", \n \"https://local.safeway.com/safeway/wa/duvall/14020-main-st-ne.html\", \n \"https://orders.ordercoldstone.com/menu/lakewood-gravelly-lake-dr\", \n \"https://www.facebook.com/Ayjaliscos/?rf=939571796120769\", \n \"https://www.bickersonsbrewhouse.com/\", \n \"https://www.facebook.com/Starbucks-155903124420285/\", \n \"https://burgeraddict.com/\", \n \"https://order.subway.com/en-US/restaurant/12116/menu\", \n \"http://www.swiftandsavory.com/\", \n \"http://www.thaiduvall.com/\", \n \"https://www.thegrangeduvall.com/\", \n \"https://ezellschicken.com/\", \n \"https://www.facebook.com/twindragonsportsbar/\", \n \"https://valleyhousebrewing.com/\", \n \"https://www.zazynia.com/\", \n \"https://www.facebook.com/CarriageSquareBar/\", \n \"https://www.ilpaesanoristorante.com/\", \n \"https://theironduckpublichouse.com/food/\", \n \"https://www.carlsjr.com/\", \n \"http://Www.subway.com\", \n \"http://Www.subway.com\", \n \"http://Www.subway.com\", \n \"http://Www.subway.com\", \n \"https://apollogreekfood.com/menu\", \n \"https://arbys.com/\", \n \"https://www.blimpie.com/stores/11227\", \n \"https://locations.bk.com/wa/north-bend/736-sw-mt-si-blvd.html\", \n \"http://chowdercafenb.com/\", \n \"http://www.elcaporalnorthbend.com/\", \n \"https://frankies-pizza.com/our-locations/\", \n \"https://huxdottercoffee.com/\", \n \"https://www.jerseymikes.com/18024/north-bend-wa\", \n \"http://www.littlesirestaurantandlounge.com/\", \n \"http://outandaboutburgers.com/food.htm\", \n \"https://www.facebook.com/antonysfrutasyantojitos/\", \n \"https://therobinhoodpizza.com/\", \n \"https://m.facebook.com/La-Rioja-Mexican-Cuisine-329444801207244/posts/\", \n \"https://www.facebook.com/menchieslakelandtowncenter/\", \n \"https://www.frugalburger.com/\", \n \"http://projectfeast.org/index.html\", \n \"https://locations.chipotle.com/wa/renton/439-rainier-ave-s\", \n \"https://www.facebook.com/chucksdonutrenton/\", \n \"https://dubtownbrewingcompany.com/\", \n \"https://www.safeway.com/\", \n \"http://pickup.pochibubbletea.com\", \n \"https://www.mixpokebar.com/\", \n \"http://www.loscabos-northbend.com\", \n \"https://www.mcdonalds.com/us/en-us/location/wa/north-bend/735-mount-si-blvd/10356.html\", \n \"https://thenorthbendbakery.com/\", \n \"https://order.papamurphys.com/menu/papa-murphys-sw-mt-si\", \n \"https://pioneercoffeeco.com/\", \n \"https://www.riobravomex.com/\", \n \"https://places.singleplatform.com/the-riverbend-cafe/menu?ref=Microsoft\", \n \"https://scottsdairyfreeze.smartonlineorder.com/\", \n \"https://order.subway.com\", \n \"https://order.tacotimenw.com/menu/north-bend\", \n \"https://trapperssushi.com/northbend\", \n \"http://wildflowerwineshop.com/\", \n \"https://www.facebook.com/Al-carbon-mexican-asadero-367335087440770/\", \n \"https://elmcoffeeroasters.com\", \n \"https://elmcoffeeroasters.com\", \n \"https://www.facebook.com/sluggers.seattle/\", \n \"https://abitoftaste.com/\", \n \"https://www.communitylunch.org/#\", \n \"https://www.egganduswa.com/location/the-egg-us-ballard/\", \n \"https://www.aerlumeseattle.com/\", \n \"https://candpcoffee.com/\", \n \"https://www.humblevinewine.com/\", \n \"http://www.shrimpshack.us\", \n \"https://www.facebook.com/thaieaterysnoqualmie/\", \n \"http://ti22belltown.com\", \n \"http://sriumathaikenmore.com/\", \n \"https://kentdogwood.com\", \n \"https://JOULERESTAURANT.COM\", \n \"https://www.theguesthouserestaurant.com/takeout/\", \n \"http://jasperscoffee.com\", \n \"https://www.woodringnorthwest.com\", \n \"https://Www.cathousepizza.com\", \n \"https://www.serafinaseattle.com\", \n \"https://www.cicchettiseattle.com\", \n \"https://www.dickeys.com/\", \n \"https://www.thebinebothell.com/\", \n \"https://www.chontongthaicuisineseatac.com/\", \n \"http://www.eastlake-coffee.com\", \n \"https://applebees.com\", \n \"http://bedlamcoffee.com\", \n \"https://www.einsteinbros.com/\", \n \"https://tintecellars.com/\", \n \"https://www.einsteinbros.com/\", \n \"https://www.tintecellars.com\", \n \"https://www.cafejuanita.com\", \n \"https://order.royceconfectusa.com/\", \n \"https://7615300.wixsite.com/teriyakiplus\", \n \"http://www.harvestbeat.com/\", \n \"http://medzogelatobar.com\", \n \"https://www.lgskitchen.com/\", \n \"https://www.lacostaburien.com\", \n \"http://www.royaleverestburienwa.com\", \n \"https://2121pub.com\", \n \"http://www.pizzastudio.com/\", \n \"https://www.coldstonecreamery.com/\", \n \"https://www.coldstonecreamery.com/\", \n \"https://www.coldstonecreamery.com/\", \n \"http://www.blackstar.pub/\", \n \"https://orders.ordercoldstone.com/menu/woodinville\", \n \"https://orders.ordercoldstone.com/menu/mill-creek-town-center\", \n \"http://kimskitchenseattle.com\", \n \"https://bit.ly/AlohaOrderedOnline\", \n \"http://www.hanumanthai-cafe.com/\", \n \"https://ajisushigrill.com/\", \n \"https://blackbeardiner.com/location/lakewood/\", \n \"http://www.blazingonion.com/\", \n \"https://www.facebook.com/DIYTeaLab/\", \n \"https://www.moshimoshiseattle.com\", \n \"http://vivipizzeria.com\", \n \"https://orders.ordercoldstone.com/menu/lacey\", \n \"https://coldstonecreamery.com\", \n \"https://coldstonecreamery.com\", \n \"http://SubZeroIceCream.com\", \n \"https://www.fondi.com\", \n \"http://Blueagavemexicangrilltequilabar.com\", \n \"https://www.the-sitting-room.com/\", \n \"https://www.mcmenamins.com/queen-anne\", \n \"https://glorybucha.com\", \n \"https://www.itsbrewing.com\", \n \"https://tokyohouse.uwu.ai/\", \n \"https://skookumbrewery.com\", \n \"https://www.localjoeespresso.com\", \n \"https://bluebirdcafei.com\", \n \"https://lahaciendawa.com/\", \n \"https://www.moesespresso.com\", \n \"https://www.playabonita.com\", \n \"http://arlingtonpharmacy.com\", \n \"https://www.sanjuansalsa.com\", \n \"http://www.vashoniq.com\", \n \"https://magnusonbrewery.com/\", \n \"https://www.facebook.com/FiveGuysRentonWA/\", \n \"https://www.facebook.com/jaguarrestaurantrenton/\", \n \"http://www.jayberryscafe.com/\", \n \"https://justpoke.com/\", \n \"http://www.naanncurry.com/\", \n \"https://www.facebook.com/OJBG.renton/\", \n \"https://www.facebook.com/papayalanding/\", \n \"https://mypizzadudes.com/home.php\", \n \"https://www.shopantiques4u.com/heritage-ciders\", \n \"https://www.refuel-cafe.com/\", \n \"https://www.therockwfp.com/\", \n \"https://sansonina-ristorante-italiano.business.site/?m=true\", \n \"https://www.smokingmonkeypizza.com/\", \n \"https://www.facebook.com/Sorrentos-Coffee-Renton-Highlands-105200382966366/\", \n \"https://tacodelmar.com/location/?id=59\", \n \"https://www.toreros-mexicanrestaurants.com/\", \n \"http://www.toshiteriyaki.com/\", \n \"https://www.trencherskitchenandtap.com/\", \n \"https://www.facebook.com/pg/VinoAtTheLanding/posts/?ref=page_internal\", \n \"https://www.wingstop.com/location/wingstop-748-renton-wa-98057/menu\", \n \"https://www.fortuneinnchinese.com/orderonline.aspx\", \n \"https://www.jerseymikes.com/\", \n \"https://jetcity.breakawayiris.com/?location_code=GRE04001\", \n \"https://www.locochonbarandgrill.com/\", \n \"https://orders.ordercoldstone.com/menu/factoria\", \n \"https://modpizza.com\", \n \"https://papamurphys.com\", \n \"https://subway.com\", \n \"http://tuscanstonepizza.com\", \n \"https://yangskitchennewcastle.com\", \n \"https://yeaswok.com\", \n \"https://www.coldstonecreamery.com/stores/21157\", \n \"http://www.maelstrombrewing.com/\", \n \"https://www.TriplehornBrewing.com\", \n \"https://mrkleen.com/cafe/\", \n \"http://belltownpizza.net/\", \n \"https://pho-ever-bellevue.com/\", \n \"https://www.hubbspizza.com\", \n \"https://www.russelllowell.com/\", \n \"https://www.emorys.com\", \n \"http://localjoeespresso.com\", \n \"https://www.facebook.com/roosters.espresso.inc.mlt/\", \n \"https://www.facebook.com/roosters.espresso.inc/\", \n \"http://www.lumpiaworld.com\", \n \"http://www.quinnspubseattle.com\", \n \"http://www.kvltmead.com\", \n \"http://www.purplecafe.com\", \n \"http://www.thecommonscafe.com/\", \n \"http://www.meetthemooncafe.com\", \n \"https://pabloypablo.com\", \n \"https://fiascoseattle.com\", \n \"http://www.barriorestaurant.com\", \n \"https://www.wildfinamericangrill.com/what-a-catch-fishbar/\", \n \"https://www.wildfinamericangrill.com/what-a-catch-fishbar/\", \n \"http://www.zolascafe.com\", \n \"http://sugeesboxlunch.com\", \n \"https://www.zomato.com/bellevue-wa/i-love-teriyaki-bellevue/menu\", \n \"http://regentbakeryandcafe.com/redmond\", \n \"https://m.facebook.com/mackysdimsum/\", \n \"http://www.theblackduckcaskandbottle.com\", \n \"http://www.noodleboat.com\", \n \"https://www.mcdonalds.com\", \n \"https://www.mcdonalds.com\", \n \"http://Www.thefrenchbakery.com\", \n \"https://vivibubbletea.com/about.html\", \n \"http://thexcj.com\", \n \"http://Www.theguilttriprestaurant.com\", \n \"https://www.yelp.com/biz/herfys-burgers-redmond\", \n \"http://Nikoteriyaki.com\", \n \"http://www.stonekorean.com\", \n \"https://www.offthevinecaterers.com/\", \n \"https://hopsndrops.com/\", \n \"https://locations.jimmyjohns.com/wa/kirkland/sandwiches-1074.html\", \n \"https://locations.jimmyjohns.com/wa/bellevue/sandwiches-1519.html\", \n \"https://earls.ca/locations/bellevue\", \n \"https://pearlbellevue.com/\", \n \"https://locations.maggianos.com/washington/bellevue/10455-ne-8th-st./\", \n \"https://www.cocoizakayabellevue.com/\", \n \"https://istanbul-cuisine.square.site/\", \n \"https://fogodechao.com/location/bellevue/\", \n \"https://bamboo-gardens.com/inchins-bamboo-garden-locations##WAWA\", \n \"https://www.bowl-gogi.com/\", \n \"http://www.dolarshop.com/en/Seattlemenu.htm\", \n \"https://order.subway.com/en-us/restaurant/24777/menu/?utm_source=yxt-goog&utm_medium=local&utm_term=acq&utm_content=24777&utm_campaign=evergreen-2020\", \n \"http://www.aztecamex.com/bellevue-azteca/\", \n \"http://www.rockysempanadas.com\", \n \"https://www.yelp.com/biz/nasai-teriyaki-kirkland\", \n \"https://www.couzinscafekirkland.com/\", \n \"http://www.georgeskirkland.com\", \n \"https://coastlineburgers.com/\", \n \"https://www.facebook.com/Divinity-Coffee-Co-343149205759369/\", \n \"http://CafeOrganiqueKirkland.square.site\", \n \"http://www.padriacafe.com/\", \n \"https://www.yelp.com/biz/aa-sushi-kirkland\", \n \"https://www.chipotle.com/\", \n \"https://www.joesburgers.com/\", \n \"http://www.kenzaburosushi.com\", \n \"https://www.macalusositalianrestaurant.com/\", \n \"http://www.europabistro.net/\", \n \"http://www.illucanoristorante.com/\", \n \"https://www.massimobarandgrill.com/\", \n \"https://www.osf.com/location/lynnwood-wa/\", \n \"https://www.osf.com/location/tacoma-wa/\", \n \"https://www.osf.com/location/tukwila-wa/\", \n \"http://onthemenu-tacoma.tripod.com/id1.html\", \n \"https://www.tatankatakeout.com/\", \n \"https://www.facebook.com/MSM-Deli-81746047858/\", \n \"https://www.peaksandpints.com/\", \n \"http://www.viva4life.com/\", \n \"http://www.dirtyoscarsannex.com/\", \n \"https://www.jpsbars.com/\", \n \"http://www.tkirishpub.com/\", \n \"http://topsidebargrill.com/\", \n \"http://www.thebairbistro.com/\", \n \"https://m.facebook.com/pages/Magoos/227313433999721\", \n \"https://www.mcmenamins.com/elks-temple\", \n \"https://bobsburgersandbrew.com/\", \n \"http://instagram.com/BURGERSEOUL\", \n \"https://www.dustyshideaway.com/\", \n \"http://www.lumidessertcafe.com\", \n \"http://www.vivapoquitos.com\", \n \"http://Banhmibites.com\", \n \"https://thewingdome.com/\", \n \"http://www.omabap.com\", \n \"http://thaiwisdomkirkland.com/\", \n \"http://www.gophillycheesesteaks.com \", \n \"https://www.cheesemongerstable.com/\", \n \"https://www.socialgroundscoffee.com/\", \n \"http://stonecreekwfp.com/\", \n \"https://www.ivars.com/\", \n \"https://www.benjerry.com/kirkland\", \n \"https://kirkland.isarnkitchen.com/\", \n \"http://www.jujubeet.com\", \n \"http://primogrilltacoma.com\", \n \"https://www.facebook.com/pages/Thai-Tom/116869645004757\", \n \"http://www.madison-kitchen.com/\", \n \"http://www.juliorestaurant.com\", \n \"https://oishi-yummu.business.site/?utm_medium=referral&utm_source=gmb\", \n \"http://thaifoodtogo.com\", \n \"http://shakeys.com\", \n \"https://watershedpub.com/\", \n \"http://www.planetjavadiner.com/Site/Planet_Java_Diner.html\", \n \"http://bitterrootbbq.com\", \n \"http://mammothseattle.com\", \n \"https://www.ingallina.net/\", \n \"https://www.sodopizza.com/\", \n \"http://www.shikijapaneserestaurant.com/\", \n \"https://rosewoodcafe.com\", \n \"https://monsoonrestaurants.com/seattle/\", \n \"http://gloscafe.com/\", \n \"https://www.facebook.com/cafeosita/\", \n \"https://www.facebook.com/alkibeachpubandeatery/\", \n \"https://bonchon.com/korean-fried-chicken-first-hill-wa/\", \n \"http://www.gelatiamo.com/\", \n \"https://www.siprestaurant.com\", \n \"https://baskinrobbins.com\", \n \"https://baskinrobbins.com\", \n \"http://Piroshkion3rd.com\", \n \"http://www.shikusushi.com\", \n \"https://www.eatwafflestop.com\", \n \"http://www.adasbooks.com\", \n \"http://www.omegaouzeri.com\", \n \"http://www.vioscafe.com\", \n \"http://www.harvestvine.com\", \n \"http://www.eatacadia.com\", \n \"http://snowyriverbelltown.com\", \n \"http://qedcoffee.com\", \n \"http://www.forgeroncellars.com\", \n \"https://www.zeekspizza.com\", \n \"http://Tilikumplacecafe.com\", \n \"https://www.grumpysfoodtruck.com/\", \n \"https://www.ivars.com/locations/acres-of-clams\", \n \"https://www.ivars.com/locations/salmon-house\", \n \"https://www.ivars.com/\", \n \"http://www.cafecampagne.com\", \n \"https://www.bentoyagoemon.com/\", \n \"https://www.izumikirkland.com/\", \n \"http://heartbeethealthy.com/\", \n \"http://www.crawfishhouse206.com/\", \n \"https://www.harrysbeachhouse.com/ea\", \n \"https://www.olympiacoffee.com/\", \n \"https://www.shadowlandwest.com/\", \n \"https://www.starbucks.com/store-locator/store/8771/west-seattle-4101-sw-admiral-way-seattle-wa-981162517-us\", \n \"https://www.whiskywest.com/\", \n \"https://www.evergreens.com/locations\", \n \"https://www.seaplanekitchen.com/\", \n \"https://wickedchopstix.business.site/?utm_source=gmb&utm_medium=referral\", \n \"https://www.listbelltown.com/\", \n \"https://www.cinqueterreseattle.com/\", \n \"http://www.baroloseattle.com\", \n \"https://diamondknot.com\", \n \"https://diamondknot.com\", \n \"https://diamondknot.com/\", \n \"https://www.andaluca.com/to-go-menu/\", \n \"https://www.squareup.com/store/wildrose\", \n \"https://www.moxboardinghouse.com/bellevue/\", \n \"https://www.moxboardinghouse.com/seattle/\", \n \"https://www.ladiveseattle.com\", \n \"https://www.mexicanfoodrenton.com/\", \n \"https://www.facebook.com/sushimakiburien\", \n \"https://bizremix.com/kitchen-remix\", \n \"sushikudasai.com\"];\n var value = arr[Math.floor(Math.random() * arr.length)];\n //alert(\"Going to: \" + value);\n window.location = value;\n}", "function domainUrls() {\r\n return $.ajax({\r\n url: \"domains.js\", \r\n dataType: \"json\", \r\n type: \"get\"\r\n });\r\n }", "function _addKnownUrls( crawler ) {\n return new Promise( function( resolve, reject ) {\n let sql = 'SELECT url FROM cfpb_content';\n db.each( sql, function( err, row ) {\n if ( err ) {\n reject( err );\n } else {\n crawler.queueURL( row.url, undefined, true );\n console.log( 'Added known URL: ' + row.url ); \n }\n } );\n resolve();\n } );\n}", "function wget(urls, fn) {\n var results = [],\n lookup = {},\n complete = 0,\n total = urls.length;\n\n urls.forEach(function(url) {\n var i = lookup[url] = results.length,\n request = new XMLHttpRequest();\n results.push(null);\n request.open('GET', url, true);\n request.onload = function () {\n if (request.status < 200 && request.status > 400) return;\n results[i] = request.responseText;\n complete++;\n if (complete === total) fn.apply(null, results);\n };\n request.send();\n });\n }", "function pagePreload(){\n setWebcrawlerID();\n setChildsAndParents();\n startHTTPStatus();\n pageLoad();\n}", "function getScrapedFiles(scrapePage, scrapeConfig)\n{\n console.log(`getScrapedFiles()`)\n // console.log(`scrape page = ${scrapePage}`)\n logObject(scrapeConfig)\n\n scrapedFiles = []\n\n var $ = c.load(scrapePage);\n\n selectorString = \"a\"\n if ( '' != scrapeConfig.anchorClass)\n {\n selectorString += '.' + scrapeConfig.anchorClass\n }\n var list = $(selectorString);\n console.log(`'${selectorString}' selected ${list.length} elements`)\n\n list.each(function(i, element)\n {\n if ('' != scrapeConfig.hrefRegex)\n {\n if (element.attribs.href.match(scrapeConfig.hrefRegex))\n {\n scrapedFiles.push(element.attribs.href)\n }\n }\n else\n {\n scrapedFiles.push(element.attribs.href)\n }\n })\n\n console.log(`found ${scrapedFiles.length} files`)\n return scrapedFiles\n}", "function crawl() {\n console.log('CRAWLING...');\n //url du site a scroller\n var url = \"http://www.dxcontent.com/SDB_SpellBlock.asp?SDBID=\";\n var crawlResult = new Array();\n\n //on parcourt les pages entre 1 et 1600 \n for (let i = 1; i < 1976; i++) {\n request(url + i, function (error, response, body) {\n if (!error) {\n var $ = cheerio.load(body); //on recupere le body de la page html\n\n //nom du sort\n var name = $('.heading').map(function (i, el) {\n // this === el\n return $(this).text();\n }).get().join(', ');\n console.log(i);\n var spellCarac = $('.SpellDiv p.SPDet').map(function (i, el) {\n // this === el\n return $(this).html();\n }).get().join('\\n');\n\n //level du sort\n var level = spellCarac.match(/\\<b\\>Level\\<\\/b\\>.*/g);\n //classe de personnage pouvant faire le sort\n var dndClass = null;\n var dndClassSQL = null; // en sql il faut que ce soit un String et non un tableau\n var levelint = null;\n if (level) {\n level = level[0].slice(13);\n dndClass = level;\n dndClass = dndClass.slice(0, -1);\n dndClass = dndClass.trim().split(/\\s[0-9],*\\s*/g); //on enleve les chiffres des levels pour ne garder que les classes (wizard etc..)\n dndClassSQL = dndClass.toString();\n var wizard = level.match(/wizard.*/g);\n if (wizard) { //on prend le level du wizard s,il existe\n level = wizard.toString().match(/[0-9]/g)[0];\n }\n else {//sinon on prend n'importe quel level\n level = level.match(/[0-9]/g)[0];\n }\n levelint = parseInt(level); //on veut l'inserer en tant qu'integer dans la bdd\n }\n\n //components du sort\n var components = spellCarac.match(/\\<b\\>Components\\<\\/b\\>.*/g);\n var componentsSQL = null; // en sql il faut que ce soit un String et non un tableau\n\n if (components) {\n components = components[0].slice(18).match(/(M\\/DF)|(F\\/DF)|[VSMF]|(DF)/g); //on récupère seulement les lettres des components : V,S,M,F,DF\n\n\n if (components) {\n componentsSQL = components.toString();\n }\n }\n\n\n var description = $('.SPDesc p').map(function (i, el) {\n // this === el\n return $(this).text();\n }).get().join('\\n');\n\n //spell resistance du sort\n var spellRes = spellCarac.match(/\\<b\\>Spell Resistance\\<\\/b\\>.*/g);\n //in some case Spell res is not defined, \n if (spellRes) {\n spellRes = spellRes[0].slice(24).match(/(yes)|(no)|(none)/gi); //match yes/no/none en n'étant pas sensible a la casse\n if (spellRes) {\n spellRes = spellRes[0];\n } else {\n spellRes = false;\n }\n }\n else {\n spellRes = false;\n }\n\n if (myArgs[0] == \"sql\") {\n //objectSQL\n var SQL = {\n name: name,\n class: dndClassSQL,\n level: levelint,\n components: componentsSQL,\n spell_resistance: spellRes\n };\n console.log(SQL);\n\n crawlResult.push(SQL);\n } else {\n //creation de l'objet Json\n var JSONobj = {\n name: name,\n class: dndClass,\n level: levelint,\n components: components,\n spell_resistance: spellRes,\n description :description\n };\n console.log(JSONobj);\n crawlResult.push(JSONobj);\n\n\n }\n\n\n\n }\n else {\n console.log(\"We’ve encountered an error: \" + error);\n }\n });\n\n }\n\n return crawlResult; //on retourne le tableau\n\n}", "async function getPagesUrls(url) {\n let pages = []\n let links = await fetch(url)\n links = await links.text()\n const dom = new JSDOM(links)\n let linkArray = dom.window.document.querySelectorAll('a')\n for(let i = 0; i < linkArray.length; i++) {\n pages.push(linkArray[i].getAttribute('href'))\n }\n return pages\n}", "function getURLs(str, referer, baseURL) {\n var cleanedURL;\n var urls = [];\n var $ = cheerio.load(str);\n\n $('a, img, script').each(function(i, link) {\n var domLink;\n if($(link).attr('href')) { \n domLink = nodeUrl.parse($(link).attr('href')).href;\n }\n if($(link).attr('src')) {\n domLink = nodeUrl.parse($(link).attr('src')).href;\n }\n\n domLink = cleanLink(domLink);\n cleanedURL = validLink(domLink, referer);\n if(cleanedURL) { \n urls.push(cleanedURL);\n }\n })\n return urls;\n}", "function getAvailableBrowsers(cb){\n var browsers = browsersForPlatform()\n browsers.forEach(function(b){\n b.protocol = 'browser'\n })\n async.filter(browsers, function(browser, cb){\n browser.supported(cb)\n }, function(available){\n cb(available)\n })\n}", "startCrawler() {\n if (this._crawler !== null) return;\n this.crawlerFunc();\n }", "async function getBlockedSitesFormatted() {\n\tconst result = await new Promise((resolve, reject) => {\n\t\tloadBlockedSites()\n\t\t\t.then(sites => {\n\t\t\t\tlet sitesFormatted = [];\n\n\t\t\t\tconst siteKeys = Object.keys(sites);\n\n\t\t\t\tfor(const siteKey of siteKeys) {\n\t\t\t\t\tconst site = sites[siteKey];\n\n\t\t\t\t\tlet a = document.createElement('a');\n\t\t\t\t\ta.href = site.url;\n\n\t\t\t\t\t// if the user is on a break, don't add the intermittent sites to the blocked sites\n\t\t\t\t\tif(site.type === 'intermittent' && breaking) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tsitesFormatted.push(`*://*.${a.host}/*`);\n\t\t\t\t}\n\n\t\t\t\tresolve(sitesFormatted);\n\t\t\t})\n\t})\n\t\n\t// when a request is made, add all of the blocked sites to blocked URLS\n\tbrowser.webRequest.onBeforeRequest.addListener(listener, {urls: result, types: [\"main_frame\"]}, [\"blocking\"])\n\n\treturn result;\n}", "function initUrlList() {\n var urlList = [];\n let requestPath = [\"/userRole/selectUsers\",\"/role/selectAllRole\",\"/userRole/updateUserRole\",\"/role/selectAllResource\",\"/role/verifyRoleName\",\"/role/addRole\",\"/role/selectRoleByLikeRoleName\",\"/role/selectAllResource2TransferGroupData\",\"/role/selectAllResource2TansferData\",\"/role/updateRole\",\"/role/deleteRole\"];\n for(let i = 0; i < requestPath.length; i++) {\n urlList[i] = baseUrl + requestPath[i];\n }\n return urlList;\n}", "async function fillInUrls() {\n try {\n let response = await fetch(\"/local_streaming_sink/current_urls.txt\")\n if (response.status != 200) {\n throw new Error(`Response status: ${response.status}`);\n };\n let fetchedUrls = await response.text(); \n \n let urls;\n try {\n urls = fetchedUrls.split(\"\\n\");\n }\n catch {\n urls=[];\n }\n\n for (let i=0; i<4; i++) {\n let elt = document.querySelector(`li#url_${i}`);\n if (i < urls.length) {\n elt.innerHTML=urls[i];\n elt.style.display=\"\";\n }\n else {\n elt.innerHTML=\"\";\n elt.style.display=\"none\";\n }\n } \n }\n catch (error) {\n log_elt.innerText += `fetch to '/local_streaming_sink/current_urls.txt' failed: ${error}\\n`;\n }\n}", "function getOffersUrl() {\n\n return getOffersPages()\n .then(list_url_pages => {\n var list_url_offers = [];\n var promises = [];\n for (var i = 0; i < list_url_pages.length; i++) {\n promises.push(getHtml(list_url_pages[i])\n .then(res => {\n var doc = cheerio.load(res);\n var list_url_offers_this_page = [];\n doc('li.offerlist-item h3 a').each((i, el) => {\n list_url_offers_this_page.push(new Offer(el.attribs['href']));\n });\n return list_url_offers_this_page;\n })\n );\n }\n return Promise.all(promises).then(list_offers_all_pages => {\n return list_offers_all_pages.reduce((prev, curr) => {\n return curr.concat(prev);\n })\n });\n });\n\n}", "function fetch(crawlCnt){\n $.when($.get(settings.cssPaths[crawlCnt])).done(function(response) {\n combinedResponse += response\n if (crawlCnt === crawlTotal){\n parse()\n }\n else{\n fetch(crawlCnt + 1)\n }\n })\n }", "function checkUrls(data) {\n let pattern = new RegExp('^((http?:)?\\\\/\\\\/)?')\n if (!pattern.test(data)) {\n alert('No valid URLs found.');\n return false;\n } else {\n //gathers address urls from each list as an origin for crawler\n const addressUrls = function(data) {\n let urls = [];\n \n //pulls in data using same order as json object, sets it to objLength for iteration\n const objLength = Object.values(data.pages);\n \n //iteration through address urls, moving data into urls array\n for (let i = 0; i < objLength.length; i++) {\n urls.push(data.pages[i].address)\n }\n return urls\n };\n\n function webCrawler(data) {\n let success = [];\n let skipped = [];\n let errors = [];\n \n //grab starting point from getUrls\n const linkUrls = addressUrls(data);\n \n //iterate through links, pushing links into array if not a duplicate\n for (let i = 0; i < linkUrls.length; i++) {\n const links = data.pages[i].links\n \n //TODO - maybe use sets?\n links.forEach(function(el) {\n if (!success.includes(el) && !success.includes(linkUrls[i])) {\n success.push(linkUrls[i])\n }\n \n if (!linkUrls.includes(el)) {\n errors.push(el)\n } else if (!success.includes(el)) {\n success.push(el)\n } else if (!skipped.includes(el)) {\n skipped.push(el)\n }\n });\n }\n\n console.log('Success:', success);\n console.log('Skipped:', skipped);\n console.log('Error:', errors);\n\n //clears values of arrays for net2 data\n success = [];\n skipped = [];\n errors = [];\n }\n webCrawler(data);\n } \n}", "function check_site(url,testing_cb,down_cb,up_cb) {\n $.getJSON('/list',\n function(list) {\n \tconsole.log(list)\n for (var i = 0; i < list.length; i++) {\n var minion = list[i]\n ex_check_site(url,minion,testing_cb,down_cb,up_cb)\n }\n });\n}", "function addPreloadListFromBlacklist(){\n for(let i in sensitiveWebsites){\n\n //We create the list if it does not exist\n if(!websiteMap.hasOwnProperty(sensitiveWebsites[i])){\n websiteMap[sensitiveWebsites[i]] = {};\n }\n\n //We block all extensions\n for(let j in extensionsList) {\n websiteMap[sensitiveWebsites[i]][extensionsList[j].id] = false;\n }\n }\n}", "function findDynamicSources()\r\n{\r\n var retList = new Array();\r\n\r\n var siteURL = dw.getSiteRoot()\r\n\r\n if (siteURL.length)\r\n {\r\n var bindingsArray = dwscripts.getListValuesFromNote(siteURL, \"URL\");\r\n if (bindingsArray.length > 0)\r\n {\r\n retList.push(new DataSource(MM.LABEL_URL, \r\n URL_FILENAME, \r\n false, \r\n \"URL.htm\"))\r\n }\r\n }\r\n\r\n return retList;\r\n}", "function sites(u) {\n let utl = []\n u.forEach(function (element) {\n utl = [...utl, element.website]\n });\n return utl\n}", "async function loadKeywords(ctx) {\n var results = [];\n if(ctx.isConnected && ctx.dynamicKeywordSources.length > 0) {\n console.debug(\"Extracting keywords from sources...\");\n await Promise.all(\n ctx.dynamicKeywordSources.map( async (src) => {\n var values = await extractKeywords(src);\n results.extend(values);\n })\n );\n }\n if(results.length < 1) // use static data in case of no network connectivity\n {\n console.debug(\"Using static keywords.\");\n results = \"API,API design,API documentation,testing\".split(\",\");\n }\n // truncate to keywords that meet Twitter track/filter requirements\n results = results.unique()\n .filter(function(it) { return it.length <= 60; })\n .slice(0, 400)\n .sort();\n\n return results;\n}", "async getRecords() {\n const sitemap = new sitemapper({\n url: this.sitemapUrl,\n timeout: 120000\n })\n\n const res = await sitemap.fetch();\n\n const excludes = new Set(this.ignoreUrls);\n const fullList = new Set([\n ...res.sites,\n ...this.additionalUrls\n ]).filter(url => !excludes.has(url));\n\n return fullList; \n }", "setRequestUrls(data) {\n return new Promise((resolve) => {\n this.mainPageCheerio(data)\n .then((response) => {\n resolve(response);\n });\n });\n }", "function scrapeHtml(document, robots)\n{\n\tvar link,links,preliminaries,rootNode;\n\t\n\trootNode = findRootNode(document);\n\t\n\tif (rootNode != null)\n\t{\n\t\tpreliminaries = findPreliminaries(rootNode, robots);\n\t\tlinks = [];\n\t\t\n\t\tfindLinks(rootNode, function(node, attrName, url)\n\t\t{\n\t\t\tlink = linkObj(url);\n\n\t\t\tlink.html.attrs = node.attrMap;\n\t\t\tlink.html.attrName = attrName;\n\t\t\tlink.html.base = preliminaries.base;\n\t\t\tlink.html.index = links.length;\n\t\t\tlink.html.selector = getSelector(node);\n\t\t\tlink.html.tag = stringifyNode(node);\n\t\t\tlink.html.tagName = node.nodeName;\n\t\t\tlink.html.text = getText(node);\n\n\t\t\t// If not a \"fake\" (duplicated) element, as a result of adoption\n\t\t\tif (node.__location !== undefined)\n\t\t\t{\n\t\t\t\tlink.html.location = node.__location.attrs[attrName];\n\t\t\t}\n\t\t\t\n\t\t\tlinks.push(link);\n\t\t});\n\t}\n\t\n\treturn links;\n}", "function getClassList(){\n request(classListUrl,processClassList);\n}", "function getSites(force, callback)\n {\n if(force) _cache.sites = null;\n if(_cache.sites != null && _cache.sites != 'undefined')\n {\n callback(this, $.merge([], _cache.sites));\n return;\n }\n\n $.PercServiceUtils.makeJsonRequest(\n $.perc_paths.SITES_ALL + \"/\", $.PercServiceUtils.TYPE_GET, false,\n function(status, result){\n getSitesCallback(status,result,callback);\n }\n ,null, null // abort callback function not needed in this case\n );\n }", "function getSites () {\n $.getJSON(\"../monitoring/getSites\", (sites) => {\n sites.forEach((x) => { sites_list[x.site_code] = x.site_id; });\n });\n}", "function initlinks(){\n if(rwc_ids==null) {\n return;\n }\n var head=document.getElementsByTagName('head').item(0);\n for(i=0;i<rwc_ids.length;i++){\n // called to fetch the current status from the server\n var script=document.createElement('script');\n script.type='text/javascript';\n script.id='myscript'+i;\n script.defer=true;\n script.src=rwc_protocol + '://'+rwc_server+'/status/js?im='+rwc_ids[i];\n head.appendChild(script);\n }\n}", "function loadTrainers() {\n fetch(TRAINERS_URL)\n .then(res => res.json())\n .then(json => json.forEach(trainer => displayTrainer(trainer)))\n}", "function getAllUsedSites(callback) {\n res.eachCollection(\"rss-channels\").then(collections => {\n let promises = collections.map(col => col.find({}).toArray())\n\n Promise.all(promises).then(channels => {\n let allChannels = [].concat.apply([], channels)\n\n callback([].concat.apply([], allChannels.map(ch => ch.sites)).filter((elem, index, $this) => index === $this.indexOf(elem)))\n })\n })\n }", "function getSites ($data) {\n if ($data['mobileSites'].length < 1) {\n $data['mobileSites'] = $data['sites'];\n }\n\n var $sites = isMobileScreen() ? $data['mobileSites'] : $data['sites'];\n var $disabled = $data['disabled'];\n\n if (typeof $sites == 'string') {$sites = $sites.split(',')}\n if (typeof $disabled == 'string') {$disabled = $disabled.split(',')}\n\n if (runningInWeChat()) {\n $disabled.push('wechat');\n }\n\n return $sites.filter(function(v){ return !($disabled.indexOf(v) > -1) });\n }", "async function automateScrapes() {\n const cities = ['ATX', 'SFO', 'NYC', 'LAX', 'CHI'];\n return Promise.all(cities.map(async city => getScrapedArtists(city)));\n}", "async function getAllIndexers() {\n const url = getIndexerUrl();\n const indexerList = await getData({ uri: url });\n return indexerList;\n}", "function getUrls(urls) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var settings = {\n mimeType: options.mimeType || null,\n onBeforeSend: options.onBeforeSend || Function.prototype,\n onSuccess: options.onSuccess || Function.prototype,\n onError: options.onError || Function.prototype,\n onComplete: options.onComplete || Function.prototype\n };\n var urlArray = Array.isArray(urls) ? urls : [ urls ];\n var urlQueue = Array.apply(null, Array(urlArray.length)).map((function(x) {\n return null;\n }));\n function isValidCss() {\n var cssText = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"\";\n var isHTML = cssText.trim().charAt(0) === \"<\";\n return !isHTML;\n }\n function onError(xhr, urlIndex) {\n settings.onError(xhr, urlArray[urlIndex], urlIndex);\n }\n function onSuccess(responseText, urlIndex) {\n var returnVal = settings.onSuccess(responseText, urlArray[urlIndex], urlIndex);\n responseText = returnVal === false ? \"\" : returnVal || responseText;\n urlQueue[urlIndex] = responseText;\n if (urlQueue.indexOf(null) === -1) {\n settings.onComplete(urlQueue);\n }\n }\n var parser = document.createElement(\"a\");\n urlArray.forEach((function(url, i) {\n parser.setAttribute(\"href\", url);\n parser.href = String(parser.href);\n var isIElte9 = Boolean(document.all && !window.atob);\n var isIElte9CORS = isIElte9 && parser.host.split(\":\")[0] !== location.host.split(\":\")[0];\n if (isIElte9CORS) {\n var isSameProtocol = parser.protocol === location.protocol;\n if (isSameProtocol) {\n var xdr = new XDomainRequest;\n xdr.open(\"GET\", url);\n xdr.timeout = 0;\n xdr.onprogress = Function.prototype;\n xdr.ontimeout = Function.prototype;\n xdr.onload = function() {\n if (isValidCss(xdr.responseText)) {\n onSuccess(xdr.responseText, i);\n } else {\n onError(xdr, i);\n }\n };\n xdr.onerror = function(err) {\n onError(xdr, i);\n };\n setTimeout((function() {\n xdr.send();\n }), 0);\n } else {\n console.warn(\"Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (\".concat(url, \")\"));\n onError(null, i);\n }\n } else {\n var xhr = new XMLHttpRequest;\n xhr.open(\"GET\", url);\n if (settings.mimeType && xhr.overrideMimeType) {\n xhr.overrideMimeType(settings.mimeType);\n }\n settings.onBeforeSend(xhr, url, i);\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200 && isValidCss(xhr.responseText)) {\n onSuccess(xhr.responseText, i);\n } else {\n onError(xhr, i);\n }\n }\n };\n xhr.send();\n }\n }));\n}", "function initTargets() {\n for(var i = 0;i<4;i++) {\n $.getJSON(\"http://en.wikipedia.org/w/api.php?action=parse&prop=text&format=json&callback=?\",\n {page:\"Wikipedia:Today's featured article/\"+randomDayString()},\n parseFeaturedArticle\n );\n }\n}", "function getShirtLinks(callback) {\n getRequest(\"http://www.shirts4mike.com/shirts.php\", function (err, body) {\n if (err != null) {\n return callback(err);\n }\n let $ = cheerio.load(body);\n // array to hold all of the shirt URLs\n let shirtURLs = [];\n $('ul.products a').each(function (index, element) {\n let hrefLink = element.attribs.href;\n let url = \"http://www.shirts4mike.com/\" + hrefLink;\n shirtURLs.push(url);\n });\n return callback(null, shirtURLs);\n });\n}", "getSiteScriptFromList(listUrl) {\r\n return __awaiter(this, void 0, void 0, function* () {\r\n return yield this.clone(SiteScripts$1, `GetSiteScriptFromList`)\r\n .execute({ \"listUrl\": listUrl });\r\n });\r\n }", "function crawlURL(url, referer) {\n var linkIndex = _.findIndex(crawled, {url:url});\n if(linkIndex !== -1 ) {\n return;\n }\n\n var lObj = link(url);\n crawled.push(lObj);\n\n var data;\n var brokenStr;\n var checkedStr;\n var index;\n\n var req = request(url) \n .on('response', function(response) {\n if(response.statusCode === 200) {\n checkedStr = 'CHECKED: ' + url + ' - 200 ('+referer+')';\n if(crawler.verbose()) console.log(checkedStr.dim)\n crawler.emit('responseSuccess', {url:url, response: response});\n }else{\n brokenStr = 'BROKEN!! : ' + url + ' - '+response.statusCode+' referer: ('+ referer+ ')';\n broken.push({url: url, referer: referer, statusCode: response.statusCode});\n if(response.statusCode === 404) {\n if(crawler.verbose()) console.log(brokenStr.red);\n index = _.findIndex(crawled, {url:url});\n crawled[index].broken = true;\n crawled[index].referers = crawled[index].referers || [];\n crawled[index].referers.push(referer);\n crawler.emit('response404', {url:url, statusCode:response.statusCode, response: response});\n }else{\n if(crawler.verbose()) console.log(brokenStr.red);\n crawler.emit('responseError', {url:url, statusCode:response.statusCode, response: response});\n }\n }\n })\n .on('data', function(d) {\n data+=d;\n })\n .on('end', function(d) {\n if(url.indexOf(protocol+'://'+host) > -1) {\n getURLs(data.toString(), referer, url).forEach(function(link) {\n //console.log('crawl to ', nodeUrl.parse(link).href)\n crawlURL(link, url)\n })\n }\n })\n .on('crawlError', function(e) {\n console.log('ERROR!!: ', e , ' ', url, ' - ', 'referer: ('+referer+')');\n })\n}", "function getUrls(urls) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var settings = {\n mimeType: options.mimeType || null,\n onBeforeSend: options.onBeforeSend || Function.prototype,\n onSuccess: options.onSuccess || Function.prototype,\n onError: options.onError || Function.prototype,\n onComplete: options.onComplete || Function.prototype\n };\n var urlArray = Array.isArray(urls) ? urls : [ urls ];\n var urlQueue = Array.apply(null, Array(urlArray.length)).map(function(x) {\n return null;\n });\n function isValidCss() {\n var cssText = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"\";\n var isHTML = cssText.trim().charAt(0) === \"<\";\n return !isHTML;\n }\n function onError(xhr, urlIndex) {\n settings.onError(xhr, urlArray[urlIndex], urlIndex);\n }\n function onSuccess(responseText, urlIndex) {\n var returnVal = settings.onSuccess(responseText, urlArray[urlIndex], urlIndex);\n responseText = returnVal === false ? \"\" : returnVal || responseText;\n urlQueue[urlIndex] = responseText;\n if (urlQueue.indexOf(null) === -1) {\n settings.onComplete(urlQueue);\n }\n }\n var parser = document.createElement(\"a\");\n urlArray.forEach(function(url, i) {\n parser.setAttribute(\"href\", url);\n parser.href = String(parser.href);\n var isIElte9 = Boolean(document.all && !window.atob);\n var isIElte9CORS = isIElte9 && parser.host.split(\":\")[0] !== location.host.split(\":\")[0];\n if (isIElte9CORS) {\n var isSameProtocol = parser.protocol === location.protocol;\n if (isSameProtocol) {\n var xdr = new XDomainRequest();\n xdr.open(\"GET\", url);\n xdr.timeout = 0;\n xdr.onprogress = Function.prototype;\n xdr.ontimeout = Function.prototype;\n xdr.onload = function() {\n if (isValidCss(xdr.responseText)) {\n onSuccess(xdr.responseText, i);\n } else {\n onError(xdr, i);\n }\n };\n xdr.onerror = function(err) {\n onError(xdr, i);\n };\n setTimeout(function() {\n xdr.send();\n }, 0);\n } else {\n console.warn(\"Internet Explorer 9 Cross-Origin (CORS) requests must use the same protocol (\".concat(url, \")\"));\n onError(null, i);\n }\n } else {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", url);\n if (settings.mimeType && xhr.overrideMimeType) {\n xhr.overrideMimeType(settings.mimeType);\n }\n settings.onBeforeSend(xhr, url, i);\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200 && isValidCss(xhr.responseText)) {\n onSuccess(xhr.responseText, i);\n } else {\n onError(xhr, i);\n }\n }\n };\n xhr.send();\n }\n });\n}", "function scripts(urls, callback) {\n if (urls.length === 0) {\n callback();\n } else {\n var loaded = 0,\n output = [];\n\n for (var i = 0; i < urls.length; i++) {\n var url = urls[i],\n moduleBuffer = getModuleBuffer(url);\n\n moduleBuffer.buffer(function() {\n loaded++;\n if (loaded === urls.length && typeof callback === \"function\") {\n callback();\n }\n });\n\n output.push(moduleBuffer);\n }\n return output;\n }\n }", "function pageFunction_ForSeason172_oldCrawler(context) {\n // called on every page the crawler visits, use it to extract data from it\n var $ = context.jQuery;\n var result = [];\n var curr_year = '';\n var curr_month = '';\n\n $('table.calendario tr').each( function() {\n if ( $(this).find('th').first().text() !== '' ) {\n curr_year = $(this).find('th').first().text();\n }\n if ( $(this).find('th').last().text() !== '' ) {\n curr_month = $(this).find('th').last().text();\n }\n var days = $(this).find('td').first().text();\n var city = $(this).find('td:nth-child(3)').first().text();\n\n $(this).find('a').each( function() {\n var description = $(this).text();\n var link = $(this).attr('href');\n // Add each link to the result list:\n result.push({\n year: curr_year,\n month: curr_month,\n days: days,\n city: city,\n description : description,\n link : link\n });\n });\n });\n\n return result;\n}", "function loadAllUnitTests(urls)\n{\n let promises = []\n for(let i in urls)\n {\n let def = new $.Deferred();\n promises.push(def.promise());\n\n var link = document.createElement(\"script\");\n link.setAttribute(\"type\", \"text/javascript\");\n link.setAttribute(\"src\", urls[i]+'?r='+Math.random());\n\n link.onload = function(def){\n return function(){\n def.resolve();\n }\n }(def)\n document.getElementsByTagName(\"head\")[0].appendChild(link);\n\n break;\n }\n\n $.when.apply($, promises).done(() => {\n //injectQunit()\n\n if(urls.length == 1)\n {\n return injectQunit()\n }\n urls.splice(0, 1)\n loadAllUnitTests(urls)\n })\n}", "function PopulateCardURLs() {\n\n for (var i = 0; i < cardList.length; i++) {\n var cardPath = mainPath + cardList[i].childNodes[0].getAttribute('href');\n var cardPlusProxyPath = proxyurl + cardPath;\n cardURLS[i] = cardPlusProxyPath;\n }\n\n GetCardHTMLS();\n}", "function getTheLinksFromCurrentURL(urlToSearchFor)\n{\n\tfor (var i=0; i<noneCrawledURLs.length; i++)\n\t{\n\t\tif (noneCrawledURLs[i].URL.toString() == urlToSearchFor.toString())\n\t\t\treturn noneCrawledURLs[i].LINKS;\n\t}\n\treturn null;\n}", "function Fetch(options) {\n options = options || {};\n /**\n * Note you can use the {page} variable in the url and it'll be replaced w/ the page number as we paginate.\n * By default it'll start on page 1 and keep up until it finds no more proxies, however..\n * you can specify the start page by using {page:2} to start from page 2.\n * You can ALSO use {page:0-64} to start on page 0, but increment each page by 64.. this is to handle incloak.com\n * @type {*|Array|string[]}\n */\n this.urls = options.urls || [\n 'http://proxylist.hidemyass.com/search-1292985/{page}',\n 'http://incloak.com/proxy-list/?start={page:0-64}',\n 'https://nordvpn.com/wp-admin/admin-ajax.php?searchParameters%5B0%5D%5Bname%5D=proxy-country&searchParameters%5B0%5D%5Bvalue%5D=&searchParameters%5B1%5D%5Bname%5D=proxy-ports&searchParameters%5B1%5D%5Bvalue%5D=&offset={page:0-1000}&limit=1000&action=getProxies',\n 'http://proxy-list.org/english/index.php?p={page}',\n 'http://www.cool-proxy.net/proxies/http_proxy_list/page:{page}/sort:score/direction:desc',\n 'http://www.samair.ru/proxy/proxy-{page:01}.htm',\n 'http://rosinstrument.com/proxy/l{page}00.xml',\n 'http://www.us-proxy.org/',\n 'http://www.us-proxy.org/uk-proxy.html',\n 'http://list.proxylistplus.com/Fresh-HTTP-Proxy-List-{page}',\n 'POST:http://gatherproxy.com/proxylist/country/?Country=united%20states&PageIdx:{page:1/14}',\n 'POST:http://gatherproxy.com/proxylist/country/?Country=china&PageIdx:{page:1/24}',\n 'POST:http://gatherproxy.com/proxylist/country/?Country=brazil&PageIdx:{page:1/10}',\n 'POST:http://gatherproxy.com/proxylist/country/?Country=russia&PageIdx:{page:1/9}',\n 'POST:http://gatherproxy.com/proxylist/country/?Country=indonesia&PageIdx:{page:1/9}',\n 'POST:http://gatherproxy.com/proxylist/country/?Country=taiwan&PageIdx:{page:1/7}',\n 'POST:http://gatherproxy.com/proxylist/country/?Country=india&PageIdx:{page:1/4}',\n 'POST:http://gatherproxy.com/proxylist/country/?Country=thailand&PageIdx:{page:1/4}',\n 'POST:http://gatherproxy.com/proxylist/country/?Country=france&PageIdx:{page:1/3}',\n 'POST:http://gatherproxy.com/proxylist/country/?Country=united+kingdom&PageIdx:{page:1/2}',\n 'http://www.httptunnel.ge/ProxyListForFree.aspx'\n ];\n // ensure this directory exists\n this.outputFile = options.outputFile || __dirname + \"/proxies/fetched/fetched_proxies_{date}.txt\";\n // show extra debug info\n this.verbose = options.verbose || false;\n this.retry = options.retry || false;\n\n // internal variables\n this._urlIndex = 0;\n this._urlPage = -1;\n this._proxies = [];\n this._startTime = new Date().getTime();\n this._requestTimeout = 5e3;\n\n EventEmitter.call(this);\n}", "function Scrapper(options) {\n\tthis.maxRequestPerSecond = options.maxRequestPerSecond;\n\tthis.timeout = options.timeout;\n\tthis.startUrl = options.startUrl;\n\tthis.queuedUrls = [];\n\tthis.crawledUrls = {};\n}", "function initialSiteCheck(){\n\tchrome.storage.local.get(\"urls\", function(result){\n\t\tresult = result[\"urls\"];\n\t\tresult = (result === undefined ? {} : result);\n\t\t\n\t\t//Prompt if empty\n\t\tif (Object.keys(result).length === 0 && result.constructor === Object){\n\t\t\tpromptUserForSite(false, function(url){\n\t\t\t\t\n\t\t\t\tlet type = getURLType(url);\n\t\t\t\t\n\t\t\t\tif (type == \"pokebeach\"){\n\t\t\t\t\turl = url.substr(0, url.lastIndexOf('/') + 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse if (type == \"qt\"){\n\t\t\t\t\tif (url.indexOf('?') !== -1)\n\t\t\t\t\t\turl = url.substr(0, url.indexOf('?'));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Save url\n\t\t\t\tresult[url] = {url:url, currentPage: null, type: type, version:VERSION};\n\t\t\t\tchrome.storage.local.set({\"urls\" : result}, function() {\n\t\t\t\t\t//Download Posts\n\t\t\t\t\t//alert(\"hello world\");\n\t\t\t\t\tdownloadPosts();\n\t\t\t\t});\n\t\t\t})\n\t\t\t}\n\t\t}\n)\n\t\n}", "function init() {\n websiteService.findAllWebsitesForUser(vm.userId)\n .then(function (websites) {\n vm.websites = websites;\n });\n }", "function crawl(urls) {\n if (urls.length < 2) {\n nm.goto(baseUrl + urls.pop())\n .evaluate(scrape, acc)\n .end()\n .then(function(result) {\n acc = result;\n let parks = { ontarioParks: acc };\n // add feature: if file does not exist then create it\n // when it tries to write it throws an error\n fs.writeFileSync('results/ontarioparks.json', JSON.stringify(parks), 'utf8');\n console.log(`Finished scraping ${acc.length} parks to results/ontarioparks.json`);\n })\n .catch(bail);\n } else {\n nm.goto(baseUrl + urls.pop())\n .evaluate(scrape, acc)\n .then(function(result) {\n acc = result;\n crawl(urls);\n })\n .catch(bail);\n }\n}" ]
[ "0.59339124", "0.59148914", "0.5872807", "0.58536553", "0.5815739", "0.566842", "0.56557167", "0.5648528", "0.56320465", "0.5626788", "0.56198066", "0.56151825", "0.5570971", "0.55442506", "0.54660624", "0.54622036", "0.545772", "0.5441777", "0.5440059", "0.54212856", "0.54100126", "0.540572", "0.5395057", "0.53831756", "0.5378659", "0.53784245", "0.5374922", "0.5374532", "0.5343069", "0.5334735", "0.5334735", "0.53293467", "0.53267735", "0.5290625", "0.5290625", "0.5281868", "0.5274864", "0.5269463", "0.5255972", "0.52531683", "0.52448016", "0.5241165", "0.5239892", "0.52394557", "0.5238175", "0.523547", "0.5228802", "0.5212379", "0.52083266", "0.52078784", "0.5206697", "0.52031386", "0.5201681", "0.51927197", "0.5183394", "0.51829433", "0.5182147", "0.5179517", "0.51789266", "0.51738083", "0.5155988", "0.5132853", "0.5128558", "0.5126896", "0.51129174", "0.5107647", "0.5107465", "0.50918037", "0.5080513", "0.5076644", "0.50725836", "0.50674236", "0.5064221", "0.5057951", "0.50528944", "0.50442576", "0.50403243", "0.5036221", "0.50332034", "0.50273544", "0.5026982", "0.50237304", "0.5023187", "0.5009943", "0.5007532", "0.50015503", "0.50011444", "0.49990514", "0.49989924", "0.4997701", "0.4996591", "0.49896768", "0.4987328", "0.4985554", "0.49777514", "0.49772835", "0.49596208", "0.49554184", "0.49534148", "0.49359888" ]
0.7160564
0
Loads location data depending on selected radio button.
function loadLocations(e) { var country = $('input[name=country]:checked').val(); var datalist = document.getElementById('json-locations'); var input = document.getElementById('location'); var req = new XMLHttpRequest(); var jsonUrl = 'https://raw.githubusercontent.com/David-Haim/CountriesToCitiesJSON/master/countriesToCities.json'; var placeholder = 'Loading options...'; if (country == 'United States') { jsonUrl = 'https://raw.githubusercontent.com/David-Haim/CountriesToCitiesJSON/master/countriesToCities.json'; placeholder = 'e.g. New York'; } else if (country == 'United Kingdom') { jsonUrl = 'https://raw.githubusercontent.com/David-Haim/CountriesToCitiesJSON/master/countriesToCities.json'; placeholder = "e.g. Glasgow"; } else { jsonUrl = ''; placeholder = "Couldn't load datalist options..."; } req.onreadystatechange = function(res) { if (req.readyState === 4) { if (req.status === 200) { var json = JSON.parse(req.responseText); var jsonOptions = json[country]; if (datalist.hasChildNodes()) { while (datalist.firstChild) { datalist.removeChild(datalist.firstChild); } } jsonOptions.forEach(function(item) { var option = document.createElement('option'); option.value = item; datalist.appendChild(option); }); input.placeholder = placeholder; } else { input.placeholder = "Couldn't load datalist options..."; } } }; input.placeholder = "Loading options..."; req.open('GET', jsonUrl, true); req.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLocationTypeFromSelectedButton() {\n var locationTypeValue = $(\"input[name='locationGroup']:checked\").val();\n\n if (locationTypeValue == 'Centered') {\n locationType = objectLocationEnum.Centered;\n }\n else if (locationTypeValue == 'Random') {\n locationType = objectLocationEnum.Random;\n }\n else if (locationTypeValue == 'Point') {\n locationType = objectLocationEnum.Point;\n }\n else if (locationTypeValue == 'Multiline') {\n locationType = objectLocationEnum.Multiline;\n }\n else if (locationTypeValue == 'Rectangle') {\n locationType = objectLocationEnum.Rectangle;\n }\n else if (locationTypeValue == 'Polygon') {\n locationType = objectLocationEnum.Polygon;\n }\n else {\n }\n\n setDescriptionText();\n}", "function getRadio() {\n var radio = document.forms[0].location;\n for(var i=0; i<radio.length; i++){\n if(radio[i].checked){\n locationValue = radio[i].value;\n }\n }\n }", "function InitLocation() {\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentJobLocation.FormView = {};\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentJobLocation.IsFormView = false;\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentJobLocation.buttonText = 'Add New';\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentJobLocation.EditLocation = EditLocation;\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentJobLocation.AddNewLocation = AddNewLocation;\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentJobLocation.DeleteLocation = DeleteLocation;\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentJobLocation.AddToGridLocation = AddToGridLocation;\n oneThreePackingEditModalCtrl.ePage.Masters.ShipmentJobLocation.SelectedGridRow = SelectedGridRow;\n\n GetLocationDetails();\n }", "function locationSelected() {\n\ttempActive = false;\n\tlocationActive = true;\n\tradActive = false;\n\tco2Active = false;\n\tif (graphicActive) {\n\t\tdrawGraphic();\n\t} else if (tableActive) {\n\t\tdrawTable();\n\t}\n}", "function onSelect() {\n // Display correct data for the radio button checked.\n var sel = document.getElementById(\"dropdown\");\n update(mapData, sel.options[sel.selectedIndex].value);\n}", "function loadRentLocation() {\n delRentLocation();\n\tvar region = $(\".street_name\").attr(\"name\");\n var price = $(\".price_name\").text();\n if (price === 'Price') {\n price = '2000_4000'\n } else if (price=== 'Unlimited') {\n price = '600_30000'\n }\n var house_type = $(\".room_name\").text();\n var style;\n var room = '0';\n if (house_type === \"Single Room\") {\n style = '2';\n } else {\n style = '1';\n if (house_type !== \"house\") {\n room = house_type.split(\" \")[2];\n }\n }\n\t$.post('/api/BJ58', {\n 'region': region,\n 'price': price,\n 'style': style,\n 'room': room\n }, function (data) {\n data.result.forEach(function (house) {\n\t\t\taddMarkerByAddress(house);\n\t\t});\n\t});\n}", "async function locationData(e) {\n e.preventDefault();\n if (loc.location === \"\") {\n alert(\"NO LOCATION\");\n } else {\n const data = await fetch(\n `https://cors-anywhere.herokuapp.com/https://www.metaweather.com/api/location/search/?query=${loc.location}`\n )\n .then((res) => res.json())\n .then((data) => data);\n\n setLocData(...locData, data);\n }\n }", "function loadUSArmy()\r\n{\r\n removeTreeMap();\r\n if(document.getElementById(\"CiviliansBtn\").checked == true)\r\n {\r\n d3.json(preFolderString + \"jsonFiles/\" + makeFileName(militaryTag, civilianTag, categoryToColorBy, academyFlag), function(data)\r\n {\r\n myData = data\r\n //console.log(myData);\r\n createTreeMap_Civilians();\r\n });\r\n }\r\n else if(document.getElementById(\"ConsultantsBtn\").checked == true)\r\n {\r\n d3.json(preFolderString + \"jsonFiles/\" + makeFileName(armyTag, consultingTag, categoryToColorBy, academyFlag), function(data)\r\n {\r\n myData = data\r\n //console.log(myData);\r\n createTreeMap_Consultants();\r\n });\r\n }\r\n else\r\n {\r\n console.log(\"fuk\");\r\n }\r\n}", "function takeBus(radio) {\n vehicle = radio.value;\n loadWorkLocation()\n}", "function createRadioControls(mymap,attributes){\r\n $('.form-radio').click(function(){\r\n if(document.getElementById(\"region\").checked){\r\n mymap.eachLayer(function(layer){\r\n if (layer.feature){\r\n mymap.removeLayer(layer);\r\n }\r\n }) \r\n getRegionalData(mymap,0);\r\n }\r\n \r\n if(document.getElementById(\"country\").checked){\r\n mymap.eachLayer(function(layer){\r\n if (layer.feature){\r\n mymap.removeLayer(layer);\r\n }\r\n })\r\n getData(mymap,1);\r\n }\r\n })\r\n}", "function loadUSNavy()\r\n{\r\n removeTreeMap();\r\n if(document.getElementById(\"CiviliansBtn\").checked == true)\r\n {\r\n d3.json(preFolderString + \"jsonFiles/\" + makeFileName(navyTag, civilianTag, categoryToColorBy, academyFlag), function(data)\r\n {\r\n //console.log(makeFileName(navyTag, civilianTag, industryTag, academyFlag));\r\n myData = data\r\n //console.log(myData);\r\n createTreeMap_Civilians();\r\n });\r\n }\r\n else if(document.getElementById(\"ConsultantsBtn\").checked == true)\r\n {\r\n d3.json(preFolderString + \"jsonFiles/\" + makeFileName(navyTag, consultingTag, categoryToColorBy, academyFlag), function(data)\r\n {\r\n myData = data\r\n //console.log(myData);\r\n createTreeMap_Consultants();\r\n });\r\n }\r\n else\r\n {\r\n console.log(\"fuk\");\r\n }\r\n}", "function ReadLocations(source, source_type){\n switch(source_type) {\n case \"file\":\n $.ajax({\n url: source,\n success: function (data) {\n dataModel=JSON.parse(data);\n },\n error: function (data) {\n alert('Application error: could not load '+source+' data file!');\n }\n });\n break;\n case \"variable\":\n dataModel=JSON.parse(source);\n break;\n default:\n alert(\"Application error: data source type not specified!\");\n break;\n }\n}", "function selectLocationButtonHandler() {\n setLocationTypeFromSelectedButton();\n clearDrawLayer();\n points = new Array();\n\n // Centered and Random should allow continue, otherwise disable continue\n if (locationType > objectLocationEnum.Random) {\n disableContinueButton();\n }\n else {\n enableContinueButton();\n }\n\n // Random should show the entire area selected\n if (locationType == objectLocationEnum.Random) {\n setRandomPoints();\n }\n}", "function daLocation() {\n $scope.daLocationDetails = true;\n }", "chooseLoc(event) {\n\t\tevent.preventDefault();\n\t\tthis.showMap = true; // Display the google map component to select a location\n\t}", "function populateLocationDetails(location, allDetails)\n{\n if (location.attributes.name !== undefined)\n $('#locationName').val(location.attributes.name);\n\n $('#propertiesPanel').attr('data-id', location.id);\n $('#envType').text(location.attributes.type);\n $('#characterSummary').text(location.attributes.characters.length);\n $('#itemSummary').text(location.attributes.items.length);\n\n disableLocationEdits();\n\n displayLocationItems(location);\n displayLocationCharacters(location);\n disableLocationItemEdits();\n disableLocationCharacterEdits();\n}", "function loadSelection()\n{\n\tflagIndex = localStorage.getItem(\"chosenFlag\");\n\tcarbodyIndex = localStorage.getItem(\"chosenCarbody\");\n\tcolourIndex = localStorage.getItem(\"chosenColour\");\n\twheelIndex = localStorage.getItem(\"chosenWheel\");\n\n\tonBodyChanged();\n}", "chooseLocation() {\n \n }", "function gotData5(data){\r\n var locationValue = data.val();\r\n if(locationValue == null){console.log(\"wrong trip choise\");}\r\n else{\r\n var locationKeys = Object.keys(locationValue);\r\n currentLat=locationValue[locationKeys[tripIndex]].lat;\r\n currentLng=locationValue[locationKeys[tripIndex]].long;\r\n }\r\n}", "function load() {\n getStore('firstname');\n getStore(\"lastname\");\n getStore(\"age\");\n getStore(\"sex\");\n getRadio(\"faveCandy\"); //radio button is simply storing as \"on\"\n getStore(\"email\");\n getStore(\"phonenum\");\n getStore(\"address\");\n getStore(\"middlename\");\n}", "function loadLocations() {\n// var locations = new Location(0, 0, null);\n var area = new Area(\"University\");\n send(new Arrival(\"area_read\", session, area, true), writeLocations);\n}", "function showLocationsState(data) {\n state = 2; // ambiguous\n locations = data.locations;\n\n app.hidePreloader();\n\n var html = locationsStateCompiled({locations: locations});\n $$('.state-place').html(html);\n }", "function showMapArea(index){\n var elems = $(\"#radio input[type=radio]\");\n\n // create bounds object\n var lat_sw = parseFloat($(elems[index]).data(\"lat-sw\"));\n var lon_sw = parseFloat($(elems[index]).data(\"long-sw\"));\n var lat_ne = parseFloat($(elems[index]).data(\"lat-ne\"));\n var lon_ne = parseFloat($(elems[index]).data(\"long-ne\"));\n var sw = new google.maps.LatLng(lat_sw, lon_sw);\n var ne = new google.maps.LatLng(lat_ne, lon_ne);\n var bounds = new google.maps.LatLngBounds(sw, ne);\n\n // get markers in bound\n var markersInBound = [];\n $.each(markersArray, function (index, marker) {\n if (bounds.contains(marker.getPosition())) {\n markersInBound.push(marker);\n }\n });\n\n // Sort markers according to the course of the river Trave (roughly)\n if (index == 2) {\n markersInBound.sort(markerSortWE);\n } else {\n markersInBound.sort(markerSortNS);\n }\n\n // force unfocus of all elements\n for (var elem in elems) {\n elems.blur();\n }\n\n // there will be no need to programatically click the button\n // representing the provided area if it is already active\n if ($(elems[index]).attr('checked') != \"checked\") {\n $(elems[index]).trigger(\"click\");\n }\n\n return markersInBound;\n}", "function validateLocation (radioChecked){\n \n for (let radio of radioChecked) {\n if (radio.checked) {\n removeError(radioChecked);\n return true;\n }\n }\n setError(radioChecked, errorMessages.location);\n return false;\n}", "function defaultLyr(){\n $(\".satellite\").prop('checked', true);\n Satellite.addTo(map);\n $('.satellite-selection').show()\n $('.osm-selection').hide()\n $('.mapbox-selection').hide()\n $('.water-selection').hide()\n watercolor.remove()\n osm.remove()\n mapBox.remove()\n \n}", "function mapData() {\n var tempPosition = getPosition();\n var lat = tempPosition.lat();\n var lng = tempPosition.lng();\n var fruitType = document.getElementById(\"fruitType\").value;\n var accessibility = document.getElementById(\"accessibility\").value;\n var phoneNum = document.getElementById(\"phoneNum\").value;\n var email = document.getElementById(\"email\").value;\n var instructions = document.getElementById(\"notes\").value;\n var source = document.getElementById(\"source\").value;\n\n //this function will set all the variables into keys\n writeUserData(lat, lng, fruitType, accessibility, phoneNum, email, instructions, source);\n\n var confirm = getConfirmation();\n if(confirm == true){\n //createMarker(lat, lng, fruitType, accessibility, phoneNum, email, instructions, source);\n //readData();\n //window.location.href = 'pick.html';\n }\n}", "function loadUSMarineCorps()\r\n{\r\n removeTreeMap();\r\n if(document.getElementById(\"CiviliansBtn\").checked == true)\r\n {\r\n //theres only 4 things here\r\n loadNoData();\r\n }\r\n else if(document.getElementById(\"ConsultantsBtn\").checked == true)\r\n {\r\n loadNoData();\r\n /*\r\n d3.json(preFolderString + \"jsonFiles/\" + makeFileName(marineCorpsTag, consultingTag, industryTag, academyFlag), function(data)\r\n {\r\n myData = data\r\n console.log(makeFileName(marineCorpsTag, consultingTag, industryTag, academyFlag));\r\n console.log(myData);\r\n createTreeMap_Consultants();\r\n });\r\n */\r\n }\r\n else\r\n {\r\n console.log(\"fuk\");\r\n }\r\n}", "function locload(quad) \n\t{\n\t\tvar loc=document.getElementById(\"loc\");\n\t\tif(document.getElementById(\"quadrant\").value!=\"null\")\n\t\t\tloc.disabled=false;\n\t\telse\n\t\t\tloc.disabled=true;\n\t\tloc.options.length=1;\n\t\tfor(var i=0;i<quad.length;i++)\n\t\t\tloc.options[loc.options.length]= new Option(quad[i][0], quad[i][3], false, false);\n\t}", "function geoRadioBtn(){\n\tsearchbarInput.readOnly = true;\n\tgeolocation = true;\n\tsearchbarInput.style.color = \"black\";\n\tsearchbarInput.style.backgroundColor = \"#ddd\";\n\tgetGeolocation();\n}", "function showLocationOptions(xml) {\n\tlog(\"showLocationOptions()\");\n\t\n\tvar locations = xml.evaluate(\"response/results/result\");\n\tvar locationCount = locations.length;\n\t\n\tif (locationCount < 1) {\n\t\talert(\"No results (problem with search data?)\");\n\t\treturn false;\n\t}\n\t\n\tvar i, location, city, state, country, name, zmw;\n\tvar locationOptions = new Array();\n\tvar locationZmws = new Array();\n\tvar locationCities = new Array();\n\t\n\t// Prepares fetched location data for easier access later on\n\tfor (i = 0; i < locationCount; i++) {\n\t\tlocation = locations.item(i);\n\t\t\n\t\tcity = location.evaluate(\"string(city)\");\n\t\tstate = location.evaluate(\"string(state)\");\n\t\tcountry = location.evaluate(\"string(country)\");\n\t\tzmw = location.evaluate(\"string(zmw)\");\n\t\t\n\t\tname = city;\n\t\tif (state) name += \", \"+state;\n\t\tif (country) name += \", \"+country;\n\t\t\n\t\tlocationOptions.push(name);\n\t\tlocationZmws[name] = zmw;\n\t\tlocationCities[name] = city;\n\t}\n\t\n\t// Displays more than 1 location as a form dialog\n\tif (locationOptions.length > 1) {\t\t \n\t\tvar formFields = new Array();\n\t\t\n\t\tformFields[0] = new FormField();\n\t\tformFields[0].name = 'city_popup';\n\t\tformFields[0].title = 'Location:';\n\t\tformFields[0].type = 'popup';\n\t\tformFields[0].option = new Array();\n\t\t\n\t\tfor (n = 0; n < locationCount; n++) {\n\t\t\tformFields[0].option[n] = locationOptions[n];\n\t\t}\n\t\t\t\n\t\tformFields[0].defaultValue = formFields[0].option[0];\n\t\tformFields[0].description = \"Please choose the city closest to your location.\";\n\t\t\n\t\tformResults = form(formFields, 'Choose a City', 'Choose');\n\t\t\n\t\t// Checks if action was canceled\n\t\tif (formResults == null) {\n\t\t\tpreferences.userLocation.value = oldUserLocation;\n\t\t\tpreferences.cityName.value = oldCityName;\n\t\t}\n\t\telse {\n\t\t\tpreferences.userLocation.value = formResults[0];\n\t\t\tpreferences.cityValPref.value = locationZmws[formResults[0]];\n\t\t\tpreferences.cityName.value = locationCities[formResults[0]];\n\t\t}\n\t}\n\t// Assumes that only 1 location was returned\n\t// Directly assigns the fetched location\n\telse {\n\t\tpreferences.userLocation.value = locationOptions[0];\n\t\tpreferences.cityValPref.value = locationZmws[locationOptions[0]];\n\t\tpreferences.cityName.value = locationCities[locationOptions[0]];\n\t}\n\t\n\tscaleWidget();\n\t\n\t//log(\"preferences.userLocation: \"+preferences.userLocation.value);\n\t//log(\"preferences.cityValPref: \"+preferences.cityValPref.value);\n\t\n\tsavePreferences();\n\tlog(\"Call update() after savePreferences within showLocationOptions\");\n\tupdate();\n}", "function load() {\n\tlet s;\n\t//use HTML5 local storage\n\tif(supports_html5_storage()) {\n\t\ts = parseInt(localStorage[\"step\"]);\n\t\tswitch(s) {\n\t\t\tcase 4:\n\t\t\t\t//final submission - survey should not reopen\n\t\t\t\tfavbook = localStorage[\"favbook\"];\n\t\t\t\tfavcolors = localStorage[\"favcolors\"];\n\t\t\tcase 3:\n\t\t\t\taddress = localStorage[\"address\"];\n\t\t\t\tgender = localStorage[\"gender\"];\n\t\t\tcase 2:\n\t\t\t\tage = localStorage[\"age\"];\n\t\t\t\taboutme = localStorage[\"aboutme\"];\n\t\t\tcase 1:\n\t\t\t\tname = localStorage[\"name\"];\n\t\t\t\temail = localStorage[\"email\"];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//step 0 - no input submitted\n\t\t\t\treturn 0;\n\t\t}\n\t}\n\t//use cookies to load the data\n\telse {\n\t\ts = parseInt(getCookie(\"step\"));\n\t\tswitch(s) {\n\t\t\tcase 4:\n\t\t\t\t//final submission - survey should not reopen\n\t\t\t\tfavbook = getCookie(\"favbook\");\n\t\t\t\tfavcolors = getCookie(\"favcolors\");\n\t\t\tcase 3:\n\t\t\t\taddress = getCookie(\"address\");\n\t\t\t\tgender = getCookie(\"gender\");\n\t\t\tcase 2:\n\t\t\t\tage = getCookie(\"age\");\n\t\t\t\taboutme = getCookie(\"aboutme\");\n\t\t\tcase 1:\n\t\t\t\tname = getCookie(\"name\");\n\t\t\t\temail = getCookie(\"email\");\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//step 0 - no input submitted\n\t\t\t\treturn 0;\n\t\t}\n\t}\n\treturn s;\n}", "function setPlatformType() {\n mymap.eachLayer(function (layer) { \n if (layer.options.backendID == localStorage.currentClickedPlatformId) {\n var radioButtons = document.getElementsByName(\"platform-type-radio\");\n for (var i = 0; i < radioButtons.length; i++){\n if(radioButtons[i].checked) { \n layer.options.platformType = radioButtons[i].value;\n var modals = layer.options.sheetModalsTBD;\n modals.shift();\n layer.options.sheetModalsTBD = modals;\n\n document.getElementById(\"platform-type-radio-1\").checked = false;\n document.getElementById(\"platform-type-radio-2\").checked = false;\n \n\n var points = localStorage.currentCrosswalkPoints;\n points = parseInt(points) + 1;\n localStorage.setItem(\"currentCrosswalkPoints\", points);\n\n app.sheet.close(\".sheet-platform-type\", false);\n app.sheet.open(\".sheet-platform-surface-type\", false);\n return;\n }\n }\n alert(\"Vyberte prosím typ nájezdové plošiny přechodu.\");\n } \n });\n}", "function loadFormData(formData) { \r\n \r\n // convert the text received from the server to JSON \r\n formJSON = JSON.parse(formData); \r\n\t //quizPoints=formJSON;\r\n // load the geoJSON layer \r\n formLayer = L.geoJson(formJSON,{ \r\n\t pointToLayer: function (feature, latlng) \r\n\t {\r\n // in this case, we build an HTML DIV string \r\n // using the values in the data \r\n \r\n\t\t\t var htmlString = \"<DIV id='popup'\" + feature.properties.id + \"><h2>\" + feature.properties.question_title + \"</h2>\";\r\n htmlString = htmlString + \"<h3>\"+feature.properties.question_text + \"</h3><br>\"; \r\n\t\t\t htmlString = htmlString + \"<input type='radio' name='answer' id='\" + feature.properties.id + \" 1'/>\" + feature.properties.answer_1 + \"<br>\";\r\n\t\t\t htmlString = htmlString + \"<input type='radio' name='answer' id='\" + feature.properties.id + \" 2'/>\" + feature.properties.answer_2 + \"<br>\";\r\n\t\t \t htmlString = htmlString + \"<input type='radio' name='answer' id='\" + feature.properties.id + \" 3'/>\" + feature.properties.answer_3 + \"<br>\";\r\n\t\t\t htmlString = htmlString + \"<input type='radio' name='answer' id='\" + feature.properties.id + \" 4'/>\" + feature.properties.answer_4 + \"<br><br />\";\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t htmlString = htmlString + \"<button onclick='checkAnswer(\" + feature.properties.id + \");return false;'>Submit Answer</button>\"; \r\n htmlString = htmlString + \"<div id=answer\" + feature.properties.id + \" hidden>\" +feature.properties.correct_answer+\"</div>\"; \r\n htmlString = htmlString + \"</div>\"; \r\n return L.marker(latlng).bindPopup(htmlString); \r\n }, \r\n } ).addTo(mymap); \r\n mymap.fitBounds(formLayer.getBounds()); \r\n\t \r\n}", "function chooseData() {\n\tcity = $('option[name=cities]:checked').val()\n\t$( change_data_select ).fadeOut(300, function() { $(this).remove(); });\n\t$('body').append( loader );\n\t$('#loader').fadeIn();\n\tgrabDataCity(city);\n}", "function populatefields(loc){\n loader.appendTo(\"#comboinputtoggle\");\n jQuery.ajax({\n type: 'GET',\n url: loc,\n success: function(transport) {\n jQuery(\"#comboinputtoggle\").html(transport);\n }\n });\n return false;\n}", "function setView() {\n places = JSON.parse(localStorage.getItem('places'));\n if (places) {\n for (var p of places) {\n var marker = L.marker(p.lokasi).addTo(mymap).bindPopup(p.sponsor);\n marker.on('click', showLocation);\n }\n }\n}", "function loadLocations(){\n var result = LocationsService.get({param:AuthService.getId()}, function() {\n $scope.locations = result.directions;\n }, function(){\n Loading.showText('No se pudo cargar los taxistas.');\n Loading.hideTimeout();\n });\n }", "function loadLocations(){\n var result = LocationsService.get({param:AuthService.getId()}, function() {\n $scope.locations = result.directions;\n }, function(){\n Loading.showText('No se pudo cargar los taxistas.');\n Loading.hideTimeout();\n });\n }", "function populateMapLocationDetails(location, allDetails)\n{\n var thisCell = locationData.where({\n x: location.attr('data-x'), y:location.attr('data-y')});\n\n populateLocationDetails(thisCell[0], allDetails);\n}", "function loadExistingSegmentValues() {\n\n // header update\n UpdateCurrentLesion();\n\n if ( meCompletedLesions[meCurrentLesion] ) {\n for (var i = 0; i < meIndicateSegmentNumber.length; i++) {\n if( meSegmentsInvolved[i][meCurrentLesion] == 1 ) {\n\tgetById('right', 'dd' + i + 'd' + meCurrentLesion).checked = true;\n\tgetFrame('right').lightUpRow('row_' + i + meCurrentLesion);\n }\n }\n }\n else {\n resetExistingFormGlobalVars();\n resetAnswersForLesion(meCurrentLesion);\n }\n}", "function getLocationInfo() {\n\n var north = document.getElementById(\"countryNorth\").value;\n var south = document.getElementById(\"countrySouth\").value;\n var east = document.getElementById(\"countryEast\").value;\n var west = document.getElementById(\"countryWest\").value;\n\n var curCit = \"north: '\" + String(north) + \"', south:'\" + String(south) + \"', east:'\" + String(east) + \"', west:'\" + String(west) + \"'\";\n twlGeo.getGeoNames('cities', { north: north, south: south, east: east, west: west }, locationInfo)\n twlGeo.getGeoNames('wikipediaBoundingBox', { north: north, south: south, east: east, west: west }, getCountrySummary)\n\n var locBut = document.getElementById(\"locBut\")\n var locButVis = document.getElementById(\"locBut\").style.display\n var citInfo = document.getElementById(\"citiesPanel\")\n\n var e = document.getElementById(\"country\");\n var strCountry = e.options[e.selectedIndex].value;\n\n var strLocation = document.getElementById(\"locations\").value;\n\n if (locButVis == \"block\" || strCountry == \"\") {\n locBut.style.display = \"none\"\n } else {\n locBut.style.display = \"block\"\n\n }\n}", "function GetMap() {\n if (mapSelected == \"Medium\"){\n $.ajax({\n url : \"https://cdn.rawgit.com/TomsCode1234/a0362d425050adc620ec14aba1aa3e39/raw/b315773fe34ef3b20017ded6b07fc9f71da3d05f/world_map_medium.txt\",\n dataType: \"text\",\n success : function (data) {\n mapData = data;\n mapArray();\n }\n }); \n }\n if (mapSelected == \"Small\"){\n $.ajax({\n url : \"https://cdn.rawgit.com/TomsCode1234/0d97cc8504e58c2b53e09e065a45e532/raw/47c4c6e595cdfcc1127736b99251b748600984be/world_map_small.txt\",\n dataType: \"text\",\n success : function (data) {\n mapData = data;\n mapArray();\n }\n }); \n } \n}", "function initDb(type, checked) {\n\tvar fs = require('fs')\n\tvar sql = require('sql.js')\n\tvar bfr = fs.readFileSync('../application/db/QuarryLocations.db')\n\tvar db = new sql.Database(bfr);\n\t//Checks which radio button that's checked, and iteratively displays the markers of the selected\n\tif (type === \"KnownLocations\") {\n\t\tvar countPlottedMarkers = numPlottedMarkers\n\t\tvar alertUser = false;\n\t\tdb.each('SELECT ID as idy, UTMNorth as lat, UTMEast as lng FROM '+type+'', function (row) {\n\t\t\tstr = JSON.stringify(row);\n\t\t\tvar id = row.idy;\n\t\t\tvar xy = toGeographic(row.lng, row.lat);\n\t\t\tvar lat = xy[0];\n\t\t\tvar lng = xy[1];\n\t\t\tvar scr = 1.0\n\t\t\tif(treshholdSelectedByUser < numMarkerTreshhold){\n\t\t\t\tif(countPlottedMarkers < numMarkerTreshhold){\n\t\t\t\t\tplotMarker(type,checked, id,lat,lng,scr.toFixed(1)); //forwards data from row to be plotted\n\t\t\t\t\tcountPlottedMarkers +=1;\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}else{\t\n\t\t\t\tif(!alertUser){\n\t\t\t\t\talert(\"Warning: Threshold contains too many markers to be plotted. \\nPlease choose a % threshold with a lower amount.\");\n\t\t\t\t\talertUser = true;\n\t\t\t\t}else{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}) \n\t} else if (type === \"NewLocations\") {\n\t\t\tvar countPlottedMarkers = numPlottedMarkers\n\t\t\tvar alertUser = false;\n\t\t\tdb.each('SELECT ID as idy, UTMNorth as lat1, UTMSouth as lat2, UTMEast as lng1, UTMWest as lng2, Score as scr FROM '+type+'', function (row) {\n\t\t\tstr = JSON.stringify(row);\n\t\t\tvar id = row.idy;\n\t\t\tvar xy1 = toGeographic(row.lng1, row.lat1);\n\t\t\tvar xy2 = toGeographic(row.lng2, row.lat2);\n\t\t\tvar lat = xy1[0] - (xy1[0]-xy2[0])/2;\n\t\t\tvar lng = xy1[1] - (xy1[1] - xy2[1])/2;\n\t\t\tvar scr = row.scr;\n\t\t\tif(treshholdSelectedByUser < numMarkerTreshhold){\n\t\t\t\tif(countPlottedMarkers < numMarkerTreshhold){\n\t\t\t\t\tplotMarker(type,checked, id,lat,lng, scr); //forwards data from row to be plotted\n\t\t\t\t\tcountPlottedMarkers +=1;\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}else{\t\n\t\t\t\tif(!alertUser){\n\t\t\t\t\talert(\"Warning: Threshold contains too many markers to be plotted. \\nPlease choose a % threshold with a lower amount.\");\n\t\t\t\t\talertUser = true;\n\t\t\t\t}else{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t})\n\t\t} else if (type === \"PossibleLocations\"){\n\t\t\tvar countPlottedMarkers = numPlottedMarkers\n\t\t\tvar alertUser = false;\n\t\t\tdb.each('SELECT ID as idy, UTMNorth as lat1, UTMSouth as lat2, UTMEast as lng1, UTMWest as lng2, Score as scr FROM '+type+' WHERE Score BETWEEN '+lowGlobalThreshold+' AND '+highGlobalThreshold+' ORDER BY Score DESC', function (row) {\n\t\t\tstr = JSON.stringify(row);\n\t\t\tvar id = row.idy;\n\t\t\tvar xy1 = toGeographic(row.lng1, row.lat1);\n\t\t\tvar xy2 = toGeographic(row.lng2, row.lat2);\n\t\t\tvar lat = xy1[0] - (xy1[0]-xy2[0])/2;\n\t\t\tvar lng = xy1[1] - (xy1[1] - xy2[1])/2;\n\t\t\tvar scr = row.scr;\n\t\t\tif(treshholdSelectedByUser < numMarkerTreshhold){\n\t\t\t\tif(countPlottedMarkers < numMarkerTreshhold){\n\t\t\t\t\tplotMarker(type,checked, id,lat,lng, scr); //forwards data from row to be plotted\n\t\t\t\t\tcountPlottedMarkers +=1;\n\t\t\t\t\treturn;\n\t\t\t\t}else{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}else{\t\n\t\t\t\tif(!alertUser){\n\t\t\t\t\talert(\"Warning: Threshold contains too many markers to be plotted. \\nPlease choose a % threshold with a lower amount.\");\n\t\t\t\t\talertUser = true;\n\t\t\t\t}else{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t})\n\t\t}\n\t\t\n\t\tdb.close();\n\n\t}", "function viewLocation(locationName)\n{\n // Save the desired location to local storage\n localStorage.setItem(APP_PREFIX + \"-selectedLocation\", locationName); \n // And load the view location page.\n location.href = 'viewlocation.html';\n}", "function viewLocation(locationName)\n{\n // Save the desired location to local storage\n localStorage.setItem(APP_PREFIX + \"-selectedLocation\", locationName); \n // And load the view location page.\n location.href = 'viewlocation.html';\n}", "function loadQuestionData1(questionData)\r\n{\r\n\tquestionJSON = JSON.parse(questionData);\r\n\ttrackLocation();\r\n\t//navigator.geolocation.getCurrentPosition(getDistanceFromMultiplePoints);\r\n\t//loadQuestionData2();//load in web?\r\n}", "function blockLocation(){\n // Departure Variables\n var depAuck = document.getElementById(\"dep-auck\");\n var depTaup = document.getElementById(\"dep-taup\");\n var depWell = document.getElementById(\"dep-well\");\n\n // Destination Variables\n var destAuck = document.getElementById(\"dest-auck\");\n var destTaup = document.getElementById(\"dest-taup\");\n var destWell = document.getElementById(\"dest-well\");\n\n if (departure.value == depAuck.id){\n // shows available locations\n showLocation();\n destAuck.style.display=\"none\";\n departureLocation = \"Auckland\";\n }\n else if (departure.value == depTaup.id){\n showLocation();\n destTaup.style.display = \"none\";\n departureLocation = \"Taupo\";\n }\n else if (departure.value == depWell.id){\n showLocation();\n destWell.style.display = \"none\";\n departureLocation = \"Wellington\";\n }\n else if (destination.value == destAuck.id){\n showLocation();\n depAuck.style.display = \"none\";\n destinationLocation = destAuck.id;\n }\n else if (destination.value == destTaup.id){\n showLocation();\n depTaup.style.display = \"none\";\n destinationLocation = destTaup.id;\n }\n else if (destination.value == destWell.id){\n showLocation();\n depWell.style.display = \"none\";\n destinationLocation = destWell.id;\n }\n else {\n showLocation();\n }\n //shows location options\n function showLocation(){\n destAuck.style.display=\"block\";\n destTaup.style.display=\"block\";\n destWell.style.display=\"block\";\n depAuck.style.display=\"block\";\n depTaup.style.display=\"block\";\n depWell.style.display=\"block\";\n }\n\n }", "function handleLocation(coords, map) {\n map = map || gState.map;\n showMarker(coords, map);\n var prmDataObj = getLocationData(coords)\n\n prmDataObj.prmName.then(name => {\n document.querySelector('.location-name .name').innerText = name;\n })\n\n prmDataObj.prmWeather.then(weather => renderWeather(weather));\n}", "function dataSetToLoad()\n{\n d3.select('#dataOption').selectAll('label').classed('active', false);\n \n if(document.getElementById(\"treeRadio\").checked) {\n console.log('tree data selected.');\n d3.select('#treeBtn').classed('active', true);\n return \"./data_preprocessed/merged_dilation_fixation_tree.csv\";\n } else {\n console.log('graph data selected.');\n d3.select('#graphBtn').classed('active', true);\n return \"./data_preprocessed/merged_dilation_fixation_graph.csv\";\n }\n}", "'click .btn-selectLoc' (event) {\n\t\tdayIndex = this.dayIndex;\n\t\tlocIndex = this.locIndex;\n\t\tplaceID = this.location;\n\t\tSession.set(\"currentLocation\", { placeID: placeID, row: dayIndex, col: locIndex });\n\t\t//set reactive var pair for locationModalTemplate to render google maps.\n\t\t//open a javascript modal thing\n\t\t//gotten from bootstrap https://getbootstrap.com/docs/4.0/components/modal/?#varying-modal-content\n\t\t//$('#locationModal').one('show.bs.modal', function (event) {\n\n\t\t\t/*not nice implementation. fix with session variable @yuanrong\n\t\t\tvar button = $(event.relatedTarget); // Button that triggered the modal\n\t\t\tvar location = button.data('location'); // Extract info from data-* attributes\n\t\t\t// If necessary, you could initiate an AJAX request here (and then do the updating in a callback).\n\t\t\t// Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.\n\t\t\tvar modal = $(this);\n\t\t\tmodal.find('.modal-body input').val(location);\n\t\t\tconsole.log(modal.data());\n\t\t\t//set row and column for later setting data\n\t\t\tmodal.data(\"row\", dayIndex);\n\t\t\tmodal.data(\"col\", locIndex);*/\n\t\t\t\n\t\t\t//set the session variable \"currentLocation\" to the placeid and row and col, allow the modal to edit.\n\t\t\t\n\t\t//})\n\t}", "function viewLocation(locationName)\n{\n // Save the desired location to local storage\n //localStorage.setItem(APP_PREFIX + \"-selectedLocation\", locationName); \n // And load the view location page.\n location.href = 'viewlocation.html';\n}", "function loadExistingQuestion7(){\n if( Question7Enabled() ){\n\tgetById('right', 'q7').style.display = 'block';\n\tgetRadioInForm('right', 'formq7', 'question7')[meAortoOstialLesion[meCurrentLesion]].checked = true;\n }\n}", "function setLocation(location) {\r\n\t\t\tif(location.city !== undefined && location.city.length > 0){\r\n\t\t\t\t$('<span>' + location.city + '</span>').appendTo(self.bbgCss.jq.location.find('div.city'));\r\n\t\t\t}\r\n\t\t\tif(location.country !== undefined && location.country.length > 0){\r\n\t\t\t\t$('<span>' + location.country + '</span>').appendTo(self.bbgCss.jq.location.find('div.country'));\r\n\t\t\t}\r\n\t\t\tif(location.local !== undefined && location.local.length > 0){\r\n\t\t\t\t$('<span>' + location.local + '</span>').appendTo(self.bbgCss.jq.location.find('div.local'));\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t}", "function elementSelectedLocation(){\r\n\tvar choice = document.form.location1.value;\r\n\tif(choice == \"Any\"){\r\n\t\tlocation1 = \"<Var>Location</Var>\" + \"\\n \";\r\n\t\tenglishLocation = \"any location\";\r\n\t}\r\n\telse {\r\n\t\tlocation1 = \"<Ind>\" + choice + \"</Ind>\" + \"\\n \";\r\n\t\tenglishLocation = choice;\r\n\t}\r\n\tcreateRuleML();\r\n}", "function showPosition(position) {\n $(\".button-fill-coords\").html(\"Success...\");\n //alert(\"Success, longitude and latitude of your present location obtained.\");\n //$(\"#tester\").html(\"Latitude: \" + position.coords.latitude + \"<br>Longitude: \" + position.coords.longitude);\n \n //if else depending on which page we are on, filling input values based on present location\n if (lastPathSegment == 'submission.html') {\n $(\"#submit-lat\").val(position.coords.latitude);\n $(\"#submit-long\").val(position.coords.longitude);\n $(\".button-fill-coords\").html(\"Present Location used for Lat/Long\");\n } else if (lastPathSegment == 'search.php') {\n// if (position.coords.latitude > 43.2 && position.coords.latitude < 43.3 && position.coords.longitude < -79.8 && position.coords.longitude > -79.9) {\n// $(\"#loc-city\").val('Hamilton, Ontario');\n// }\n// else{\n// $(\"#loc-city\").val('Outside of Hamilton');\n// }\n $(\"#input-lat\").val(position.coords.latitude);\n //$(\"#input-lat\").html(position.coords.latitude);\n $(\"#input-lon\").val(position.coords.longitude);\n //$(\"#input-lon\").html(position.coords.latitude);\n $(\".button-fill-coords\").html(\"Present Location used for Lat/Lon\");\n }\n\n \n }", "function SelectLocation(mapLocationControl, selectEnabled)\n{\n\tSetZoomControlInstructions(mapLocationControl, selectEnabled);\n\n\t// Display appropriate row\n\tdocument.getElementById(mapLocationControl+'_headerButtonRow').style.display='none';\n\tdocument.getElementById(mapLocationControl+'_headerTextRow').style.display='';\n\n\t// MapLocationControl\n\tdocument.getElementById(mapLocationControl+'_labelPlanAJourney').style.display='none';\n\tdocument.getElementById(mapLocationControl+'_labelFindInformation').style.display='none';\n\tdocument.getElementById(mapLocationControl+'_labelSelectLocation').style.display='';\n\n\tdocument.getElementById(mapLocationControl+'_labelOptions').style.display='none';\n\tdocument.getElementById(mapLocationControl+'_labelOptions2').style.display='none';\n\n\t// User Control Divs\n\tdocument.getElementById(mapLocationControl+'_mapPlanJourneyLocationControl_mapPlanJourneyLocationControl').style.display='none';\n\tdocument.getElementById(mapLocationControl+'_mapFindInformationLocationControl_mapFindInformationLocationControl').style.display='none';\n\tdocument.getElementById(mapLocationControl+'_mapSelectLocationControl').style.display='';\n\n\t// MapSelectLocationControl\n\tdocument.getElementById(mapLocationControl+'_mapSelectLocationControl_panelResolveLocation').style.display='none';\n\tdocument.getElementById(mapLocationControl+'_mapSelectLocationControl_tableOkCancel').style.display='';\n\tdocument.getElementById(mapLocationControl+'_mapSelectLocationControl_buttonOK').style.display='none';\n\tdocument.getElementById(mapLocationControl+'_mapSelectLocationControl_buttonSelectCancel').style.display='';\n\t\n\tif (selectEnabled==true)\n\t{\n\t\tdocument.getElementById(mapLocationControl+'_mapSelectLocationControl_panelInitial').style.display='';\n\t\tdocument.getElementById(mapLocationControl+'_mapSelectLocationControl_panelZoomLevel').style.display='none';\n\t}\n\telse\n\t{\n\t\tdocument.getElementById(mapLocationControl+'_mapSelectLocationControl_panelInitial').style.display='none';\n\t\tdocument.getElementById(mapLocationControl+'_mapSelectLocationControl_panelZoomLevel').style.display='';\n\t}\n\n\t// Set the JourneyMapState for allignment with server\n\tdocument.getElementById(mapLocationControl+'_hdnJourneyMapState').value='Select';\n\n\treturn false;\n}", "function check() {\n let radio = document.getElementsByName('location');\n let result = false;\n\n for (let i = 0, len = radio.length; i < len; i++) {\n if (radio[i].checked) {\n result = true;\n }\n }\n return result\n}", "function getLocationDetails() {\n\n var e = document.getElementById(\"locations\");\n var strLocation = e.options[e.selectedIndex].value;\n\n document.getElementById(\"locationSummary\").innerHTML = \"Hotels in the area :\";\n\n var latlong = strLocation.split(\"|\");\n var lat = latlong[0]\n var lng = latlong[1]\n\n twlGeo.getGeoNames('findNearbyPlaceName', { lat: lat, lng: lng, radius: 50 }, getLocationSummary)\n\n var myLatlng = new google.maps.LatLng(lat, lng);\n\n var mapOptions = {\n zoom: 4,\n center: myLatlng,\n \n }\n var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\n var marker = new google.maps.Marker({\n position: myLatlng,\n map: map,\n animation: google.maps.Animation.DROP,\n\n });\n}", "function loadCoords() {\n const loadedCoords = localStorage.getItem('coords');\n if (loadedCoords === null) {\n askForCoords();\n } else {\n const parsedCoords = JSON.parse(loadedCoords);\n const latitude = parsedCoords.latitude;\n const longitude = parsedCoords.longitude;\n getWeather(latitude, longitude);\n }\n }", "function loadLSIntoChosenCity() {\n var chosenCityLS = getChosenCityLS();\n if (chosenCityLS) {\n chosenCity.locality = chosenCityLS.locality;\n chosenCity.municipality = chosenCityLS.municipality;\n chosenCity.longitude = chosenCityLS.longitude;\n chosenCity.latitude = chosenCityLS.latitude;\n }\n}", "function checkCityRadio() {\n try {\n if (city_name !== 'undefined') {\n if (city_name == \"Austin\") {\n radiobtn = document.getElementById(\"austin\");\n radiobtn.checked = \"true\";\n } else if (city_name == \"San Francisco\") {\n radiobtn = document.getElementById(\"sf\");\n radiobtn.checked = \"true\";\n } else if (city_name == \"Miami\") {\n radiobtn = document.getElementById(\"miami\");\n radiobtn.checked = \"true\";\n } else if (city_name == \"New York\") {\n radiobtn = document.getElementById(\"nyc\");\n radiobtn.checked = \"true\";\n }\n }\n }\n catch(e){\n if(e instanceof ReferenceError){\n return;\n }\n }\n}", "function questionShow() {\r\n questions = JSON.parse(client.responseText);\r\n question = questions[0]['features'][0]\r\n navigator.geolocation.clearWatch(watcherId);\r\n if (client.readyState == 4) {\r\n // change the DIV to show the question\r\n document.getElementById(\"question\").innerHTML = question[\"properties\"][\"question\"]+\r\n\t\t'\t<br />'+\r\n\t\t'\t<label class=\"mdl-radio mdl-js-radio mdl-js-ripple-effect\" for=\"correctAnswer1\">'+\r\n\t\t' <input type=\"radio\" id=\"correctAnswer1\" class=\"mdl-radio__button\" name=\"options\" value=\"question[\"properties\"][\"answer1\"]\">'+\r\n\t\t'\t\t<span class=\"mdl-radio__label\">'+question[\"properties\"][\"answer1\"]+'</span>'+\r\n\t\t'\t</label>'+\r\n\t\t'\t<br />'+\r\n\t\t'\t<label class=\"mdl-radio mdl-js-radio mdl-js-ripple-effect\" for=\"correctAnswer2\">'+\r\n\t\t'\t <input type=\"radio\" id=\"correctAnswer2\" class=\"mdl-radio__button\" name=\"options\" value=\"question[\"properties\"][\"answer2\"]\">'+\r\n\t\t'\t <span class=\"mdl-radio__label\">'+question[\"properties\"][\"answer2\"]+'</span>'+\r\n\t\t'\t</label>'+\r\n\t\t'\t<br />'+\r\n\t\t'\t<label class=\"mdl-radio mdl-js-radio mdl-js-ripple-effect\" for=\"correctAnswer3\">'+\r\n\t\t'\t <input type=\"radio\" id=\"correctAnswer3\" class=\"mdl-radio__button\" name=\"options\" value=\"question[\"properties\"][\"answer3\"]\">'+\r\n\t\t'\t <span class=\"mdl-radio__label\">'+question[\"properties\"][\"answer3\"]+'</span>'+\r\n\t\t'\t</label>'+\r\n\t\t'\t<br />'+\r\n\t\t'\t<label class=\"mdl-radio mdl-js-radio mdl-js-ripple-effect\" for=\"correctAnswer4\">'+\r\n\t\t'\t <input type=\"radio\" id=\"correctAnswer4\" class=\"mdl-radio__button\" name=\"options\" value=\"question[\"properties\"][\"answer4\"]\">'+\r\n\t\t'\t <span class=\"mdl-radio__label\">'+question[\"properties\"][\"answer4\"]+'</span>'+\r\n\t\t'\t</label>'+\r\n\t\t'\t<br />'+\r\n\t\t'\t\t<div class=\"mdl-card__actions mdl-card--border\">'+\r\n\t\t'\t\t<a onclick=\"startDataUpload()\" class=\"mdl-button mdl-js-button mdl-js-ripple-effect mdl-color-text--blue-grey-500\">Submit Answer</a>'+\r\n '</div>';\r\n\t\t\r\n\t// Show the question location as a marker on the map \r\n\tvar marker = L.marker();\r\n\t// Set the latitude and longitude coordinates to the question latitude and longitude\r\n\tvar latlng = [question['geometry']['coordinates'][1], question['geometry']['coordinates'][0]]; \r\n\tmarker\r\n\t\t.setLatLng(latlng)\r\n\t\t.addTo(mymap);\r\n\tmymap.setView(latlng, 18);\r\n }\r\n}", "function setLocation(mode) {\n toggleLoading(true);\n\n let units = \"metric\";\n if (document.getElementById(\"F\").disabled) {\n units = \"imperial\"; // Fahrenheit\n }\n if (window.navigator.geolocation && !mode) {\n console.log(\"yess\");\n // grab user's geolocation (with permission)\n navigator.geolocation.getCurrentPosition(\n successfullyGrabGeoLocation,\n errorGrabbingGeoLocation,\n geoLocationOptions\n );\n } else {\n let key = \"q=Seattle\"; // default Seattle if no geolocation or input\n // user manually inputted key\n if (mode == \"zip\") {\n let input = document.getElementById(\"get_zip\");\n key = \"zip=\" + input.value;\n } else if (mode == \"city\") {\n let input = document.getElementById(\"get_city\");\n key = \"q=\" + input.value;\n } else if (mode == \"latlon\") {\n let lat = document.getElementById(\"get_lat\");\n let lon = document.getElementById(\"get_lon\");\n key = \"lat=\" + lat.value + \"&lon=\" + lon.value;\n }\n console.log(\"Key to search by: \" + key);\n let url = Base_API + key + \"&units=\" + units + \"&appid=\" + APIKey;\n console.log(\"URL to FETCH: \" + url);\n fetchData(url);\n }\n}", "function updateLocation() {\n var locIx = $(\"#locationSelect\").val() - 1;\n $(\"#latitude\").val(locations[locIx].latitude);\n $(\"#longitude\").val(locations[locIx].longitude);\n $(\"#zoom\").val(locations[locIx].zoom);\n selectedName = locations[locIx].name;\n}", "function storeData(res) {\n $(\"#id\").val(res.id);\n $(\"#input1\").val(res.firstname);\n $(\"#input2\").val(res.lastname);\n res.gender == \"man\" ? $(\"input[id='input3']\").prop('checked', true) : $(\"input[id='input5']\").prop('checked', true);\n $(\"#input4\").val(res.city);\n }", "function loadGPS_locations() \n{\n SetLS(\"Showroom\", 'none'); //old branch place\n changedValues.length = 0;\n\n\n if (GetLS('GPS_lat') != null) {\n lat1 = GetLS('GPS_lat');\n }\n\n if (GetLS('GPS_lon') != null) {\n lon1 = GetLS('GPS_lon');\n }\n\n\n SetLS(\"Default\", 2);\n\n for (i = 0; i < locations.length; i++) \n {\n var lat2 = locations[i][1];\n var lon2 = locations[i][2];\n\n var radlat1 = Math.PI * lat1 / 180;\n var radlat2 = Math.PI * lat2 / 180;\n var radlon1 = Math.PI * lon1 / 180;\n var radlon2 = Math.PI * lon2 / 180;\n var theta = (lon1) - (lon2);\n var unit = 'K';\n var radtheta = Math.PI * theta / 180;\n var dist = Math.sin(radlat1) * Math.sin(radlat2) + Math.cos(radlat1) * Math.cos(radlat2) * Math.cos(radtheta);\n dist = Math.acos(dist);\n dist = dist * 180 / Math.PI;\n dist = dist * 60 * 1.1515;\n if (unit == \"K\") { dist = dist * 1.609344 }\n if (unit == \"N\") { dist = dist * 0.8684 }\n\n var distance_in_KM = (dist / 1.6).toFixed(2);\n if (distance_in_KM <= 20) {\n changedValues.push([locations[i][0], locations[i][1], locations[i][2], distance_in_KM, 1, locations[i][4], locations[i][5], locations[i][6], locations[i][7], locations[i][8]])\n }\n }\n\n changedValues.sort(sortfunc);\n SetLS(\"Showroom\", 'none');\n var html = \"<div class='empty'></div>\";\n html = html + \"<div style='background: #fff;'>\";\n html = html + \"<div style='border-bottom: 1px solid #CCCCCC; height: 25px;margin-top: 25px;'>\";\n html = html + \"<p class='p-contentlist' >\";\n html = html + \"List of Branches</p>\";\n html = html + \"</div>\";\n html = html + \"<div class='innerpopup' style='font-size:12px'>\";\n\n for (var k = 0; k < changedValues.length; k++) {\n var address_split = changedValues[k][5].split(',');\n html = html + \"<div class='popdiv'>\";\n html = html + \"<table class='tableclass'>\";\n html = html + \"<tr style='width:100%;'>\";\n html = html + \" <td style='width:85%;'>\";\n\n html = html + \" <table>\";\n html = html + \"<tr>\";\n html = html + \" <td>\";\n html = html + \"<img src='images/showroom.png' width='20px' height='20px' />\";\n html = html + \"</td>\"\n\n html = html + \" <td>\";\n html = html + \"<span style='color:#304589'>\" + changedValues[k][0] + \"</span>\";\n html = html + \"</td>\"\n html = html + \"</tr>\";\n\n html = html + \"<tr style='width: 220px;'>\";\n html = html + \" <td style='width: 40px'>\";\n html = html + \"<img src='images/address.png' width='20px' height='20px'/>\";\n html = html + \"</td>\"\n\n html = html + \" <td style='width: 220px'>\";\n html = html + \"<span style='color:#304589'>\" + address_split[0] + \"</br>\" + address_split[1] + \"</span><span style='margin-left: 30px; font-weight: bold; color: green;'>\" + changedValues[k][3] + \"&nbsp;mi</span>\";\n html = html + \"</td>\"\n html = html + \" </tr>\"\n html = html + \"</table>\";\n html = html + \"</td>\"\n\n html = html + \" <td style='width:15%;'>\";\n //html = html + \"<span><a onclick='getdirections(\" + k + \",1,2);'><img src='images/getdirections1.png' width='26px' height='26px' style='margin-top:6px;cursor:pointer'/></a></span>\";\n html = html + \"<span><a onclick=checkinventorysearch('\" + changedValues[k][10] + \"','\" + k + \"')><img src='images/checkinventory.png' width='26px' height='26px' style='margin-top:6px;cursor:pointer'/></a><a onclick='getdirections(\" + k + \",1,2);'><img src='images/getdirections1.png' width='26px' height='26px' style='margin-top:6px;cursor:pointer'/></a></span>\";\n html = html + \"</td>\"\n html = html + \" </tr>\"\n html = html + \"</table>\";\n html = html + \"</div>\";\n }\n\n html = html + \"<div class='submitdiv' style='height:5px'></div>\";\n html = html + \"</div>\";\n html = html + \"</div>\";\n\n search_mapinitialize(1); // Load results to map\n\n\n document.getElementById(\"white_contentlistnew1\").innerHTML = html;\n document.getElementById('light').style.display = 'none';\n document.getElementById('white_contentlistnew1').style.display = 'none';\n}", "function handleSelect() {\n //get the value of the user selection on drop down menu\n var location = $('#selectLocation').val();\n var latt;\n var long;\n //handle the cases\n switch (location) {\n case \"australia\":\n latt = -25.363;\n long = 131.044;\n zoom = 4;\n break;\n case \"kyoto\":\n latt = 35.0060799;\n long = 135.6909094;\n zoom = 10;\n break;\n case \"dalian\":\n latt = 38.929772;\n long = 121.4706699;\n zoom = 10;\n break;\n case \"berlin\":\n latt = 52.5072111;\n long = 13.1459624;\n zoom = 8;\n break;\n case \"uw\":\n latt = 47.6553351;\n long = -122.3057086;\n zoom = 12;\n break;\n }\n //create the position variable and update map and marker\n var position = {lat: latt, lng: long};\n //updates the map with the new coordinates and zoom\n map = new google.maps.Map($('#map')[0], {\n center: position,\n zoom: zoom \n });\n //updates the marker with new position\n marker = new google.maps.Marker({\n position: position,\n map: map\n });\n //adds an info window for the marker that shows the coords\n infoWindow = new google.maps.InfoWindow({\n content: \"coordinates: \" + \"(\" + latt + \", \" + long + \")\"\n });\n marker.addListener('click', function() {\n infoWindow.open(map, marker);\n });\n //prevents submission of values to server\n event.preventDefault();\n}", "function setInitialMap() {\n if (window.location.href.includes('search') && localStorage.currLat == undefined && localStorage.state == undefined) {\n showModal();\n console.log('all conditions met')\n } else if (localStorage.currLat !== undefined) { //else if geo data from button exists, use that\n userAddressLat = parseFloat(localStorage.currLat);\n userAddressLng = parseFloat(localStorage.currLong);\n console.log(\"geo location passed through: \" + userAddressLat + userAddressLng)\n window.map = new google.maps.Map(document.getElementById('map'), {\n center: { lat: userAddressLat, lng: userAddressLng },\n zoom: 14,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n })\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(userAddressLat, userAddressLng),\n map: map\n });\n\n } else { //else use user input & populate map\n $.ajax({\n url: `https://maps.googleapis.com/maps/api/geocode/json?address=`+ localStorage.address +`,`+ localStorage.city +`,`+ localStorage.state +`&key=AIzaSyByQ2vFELH2U1syRSBKWtQI_NKo-EBIjDI`,\n method: 'GET',\n dataType: 'json',\n }).then(function(geoCodeResponse){\n userAddressLat = geoCodeResponse.results[\"0\"].geometry.location.lat;\n userAddressLng = geoCodeResponse.results[\"0\"].geometry.location.lng;\n console.log(userAddressLat,userAddressLng)\n window.map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: userAddressLat, lng: userAddressLng},\n zoom: 14,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n })\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(userAddressLat,userAddressLng),\n map: map\n }); \n });\n } \n }", "function selectValues(map) {\n //create \"raw\" and \"normalized\" buttons\n // $('#panel').append('<input type=\"checkbox\" class=\"Cities\" value=\"true\" checked=\"checked\" style=\"-moz-box-shadow: 0px 10px 14px -7px #383838; -webkit-box-shadow: 0px 10px 14px -7px #383838; box-shadow: 0px 10px 14px -7px #383838; background-color:#FFF; -moz-border-radius:8px; -webkit-border-radius:8px; border-radius:8px; display:inline-block; cursor:pointer; color:#000000; font-family:avenir; font-size:4px; font-weight:bold; padding:8px 14px; text-decoration:none;\">Show US Cities</button>');\n // $('#panel').append('<button class=\"Countries\" style=\"-moz-box-shadow: 0px 10px 14px -7px #383838; -webkit-box-shadow: 0px 10px 14px -7px #383838; box-shadow: 0px 10px 14px -7px #383838; background-color:#FFF; -moz-border-radius:8px; -webkit-border-radius:8px; border-radius:8px; display:inline-block; cursor:pointer; color:#000000; font-family:avenir; font-size:14px; font-weight:bold; padding:8px 14px; text-decoration:none;\">Show Global</button>');\n\n // //If normalized button hit, call function\n // $(\".Cities\").change(function () {\n // console.log(\"cities\");\n // if($(this).is(':checked')) {\n // getFellowsData1978(map)\n // getFellowsData1982(map)\n // getFellowsData1983(map)\n // // //getFellowsData1984(map)\n // getFellowsData1985(map)\n // getFellowsData1986(map)\n // getFellowsData1987(map)\n // getFellowsData1988(map)\n // getFellowsData1989(map)\n // getFellowsData1990(map)\n // getFellowsData1991(map)\n // getFellowsData1992(map)\n // getFellowsData1993(map)\n // getFellowsData1994(map)\n // getFellowsData1995(map)\n // getFellowsData1996(map)\n // getFellowsData1997(map)\n // getFellowsData1998(map)\n // getFellowsData1999(map)\n // getFellowsData2000(map)\n // getFellowsData2001(map)\n // getFellowsData2002(map)\n // getFellowsData2003(map)\n // getFellowsData2004(map)\n // getFellowsData2005(map)\n // getFellowsData2006(map)\n // getFellowsData2007(map)\n // getFellowsData2008(map)\n // getFellowsData2009(map)\n // getFellowsData2010(map)\n // getFellowsData2011(map)\n // getFellowsData2012(map)\n // getFellowsData2013(map)\n // getFellowsData2014(map)\n // } else {\n // map.removeLayer(geoJsonLayers.fellows_1978)\n // map.removeLayer(geoJsonLayers.fellows_1982)\n // map.removeLayer(geoJsonLayers.fellows_1983)\n // // map.removeLayer(geoJsonLayers.fellows_1984)\n // map.removeLayer(geoJsonLayers.fellows_1985)\n // map.removeLayer(geoJsonLayers.fellows_1986)\n // map.removeLayer(geoJsonLayers.fellows_1987)\n // map.removeLayer(geoJsonLayers.fellows_1988)\n // map.removeLayer(geoJsonLayers.fellows_1989)\n // map.removeLayer(geoJsonLayers.fellows_1990)\n // map.removeLayer(geoJsonLayers.fellows_1991)\n // map.removeLayer(geoJsonLayers.fellows_1992)\n // map.removeLayer(geoJsonLayers.fellows_1993)\n // map.removeLayer(geoJsonLayers.fellows_1994)\n // map.removeLayer(geoJsonLayers.fellows_1995)\n // map.removeLayer(geoJsonLayers.fellows_1996)\n // map.removeLayer(geoJsonLayers.fellows_1997)\n // map.removeLayer(geoJsonLayers.fellows_1998)\n // map.removeLayer(geoJsonLayers.fellows_1999)\n // map.removeLayer(geoJsonLayers.fellows_2000)\n // map.removeLayer(geoJsonLayers.fellows_2001)\n // map.removeLayer(geoJsonLayers.fellows_2002)\n // map.removeLayer(geoJsonLayers.fellows_2003)\n // map.removeLayer(geoJsonLayers.fellows_2004)\n // map.removeLayer(geoJsonLayers.fellows_2005)\n // map.removeLayer(geoJsonLayers.fellows_2006)\n // map.removeLayer(geoJsonLayers.fellows_2007)\n // map.removeLayer(geoJsonLayers.fellows_2008)\n // map.removeLayer(geoJsonLayers.fellows_2009)\n // map.removeLayer(geoJsonLayers.fellows_2010)\n // map.removeLayer(geoJsonLayers.fellows_2011)\n // map.removeLayer(geoJsonLayers.fellows_2012)\n // map.removeLayer(geoJsonLayers.fellows_2013)\n // map.removeLayer(geoJsonLayers.fellows_2014)\n // }\n //\n //\n //\n // });\n\n $(\".Countries\").click(function () {\n // var index = $('.range-slider').val();\n // //re-set statement\n // normalized = false\n // raw = true\n // if (raw == true) {\n // //take off previous layer\n // map.removeLayer(attributes);\n // //call update prop symbols based on normalized data\n // updatePropSymbols(map, rawAttributes[index], attributes[index]);\n // };\n map.setView(new L.LatLng(41.4, -0), 2);\n if (map.hasLayer(geoJsonLayers.cities)) {\n map.removeLayer(geoJsonLayers.cities);\n map.addLayer(geoJsonLayers.countries);\n map.addLayer(geoJsonLayers.usa)\n }\n });\n }", "setLocationValue() {\n let data = localStorage.getItem('formData');\n // Set location from storage if there was location previously given.\n if (data) {\n data = JSON.parse(data);\n data = Base_Obj.convertDataArrayToObj(data);\n if (data.location) this.$locationInput.val(data.location);\n } else {\n // Looks like new user without data show tips modal.\n setTimeout(() => $('#tipsModal').modal(), 10000);\n }\n }", "function workLocationSelected(e) { \n workAddress = e.poi.name;\n loadWorkLocation();\n}", "function setupPlaces() {\n\t// Do important setup\n\tupkeep();\n\tradioButtonEvent();\n\n\tplace_address.load();\n\n\t$('#skill_next_btn').click(function() {\n\t\tswitch ( GLOBAL_PAGE ) {\n\t\t\n\t\t\tcase 'PLACE_1':\n\t\t\tif ( place_address.save() ) help_min.load(function() {\n\t\t\t\t$('#skill_title').html('<p>Ajout de lieux - Niveau minimal requis</p>');\n\t\t\t});\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_2':\n\t\t\tif ( help_min.save() ) help_skills.load(function() {\n\t\t\t\t$('#skill_title').html('<p>Ajout de lieux - Compétence</p>');\n\t\t\t});\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_3':\n\t\t\tif ( help_skills.save() ) help_object.load(function() {\n\t\t\t\t$('#skill_title').html('<p>Ajout de lieux - Objet</p>');\n\t\t\t});\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_4':\n\t\t\tif ( help_object.save() ) place_confirm.load(createScrollBar);\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'PLACE_2':\n\t\t\t\n\t\t\t\t// PUT DATA INTO DATABASE OR SOMETHING\n\t\t\t\tconsole.log(place_address);\n\t\t\t\tconsole.log(help_min);\n\t\t\t\tconsole.log(help_skills);\n\t\t\t\tconsole.log(help_object);\n\t\t\t\t\n\t\t\tbreak;\n\t\t}\n\t});\n\t\n\t$('#skill_back_btn').click(function() {\n\t\tswitch ( GLOBAL_PAGE ) {\n\t\t\tcase 'HELP_2':\n\t\t\tplace_address.load();\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_3':\n\t\t\thelp_min.load(function() {\n\t\t\t\t$('#skill_title').html('<p>Ajout de lieux - Niveau minimal requis</p>');\n\t\t\t});\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'HELP_4':\n\t\t\thelp_skills.load(function() {\n\t\t\t\t$('#skill_title').html('<p>Ajout de lieux - Compétence</p>');\n\t\t\t});\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'PLACE_2':\n\t\t\thelp_object.load(function() {\n\t\t\t\t$('#skill_title').html('<p>Ajout de lieux - Objet</p>');\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t});\n}", "function selectLocation(location)\n\t{\n\t\tcmbLocation = location;\n\t //if (map == null) return;\n\t// map = new google.maps.Map(document.getElementById('map_canvas'),mapOptions);\n\t\n\tif (map == null)\n\t\tinitialize();\n\t\t\n\t\t\n\t switch (location.selectedIndex)\n\t {\n\t\tcase 1:\n\t\t\tmap.setCenter(new google.maps.LatLng(51.390209,-3.179855), 11);//Cardiff\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tmap.setCenter(new google.maps.LatLng(51.495065,-0.282898), 11);//London\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tmap.setCenter(new google.maps.LatLng(48.767957,2.272797), 11);//Paris\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\tmap.setCenter(new google.maps.LatLng(40.720201,-73.755341), 11);//New York\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\tmap.setCenter(new google.maps.LatLng(34.988941,-110.99556), 11);//Berringer Meteor Crater, Arizona\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\tmap.setCenter(new google.maps.LatLng(19.120841,19.267273), 11);//Aorounga, Chad , Africa\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\tmap.setCenter(new google.maps.LatLng(19.093335,19.242731), 11);//Wolfe Creak, Austrailia\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tmap.setCenter(new google.maps.LatLng(-27.722436,16.369629), 11);//Roter Kamm, Namibia\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\tmap.setCenter(new google.maps.LatLng(55.920354,-63.199539), 11);//Mistastin Lake, Canada\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\tmap.setCenter(new google.maps.LatLng(6.50431,-1.378098), 11);//Bosumtwi, Ghana\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\tmap.setCenter(new google.maps.LatLng(39.03572,73.464203), 12);//Kara-Kul, Tajikstan\n\t\t\tbreak;\n\t }//end switch\n\t}//=========================================================================================", "updateSettings() {\n // **** Radio buttons section 1\n if (this.spotType1.checked) this.spotType = SpotTypeEnum.Camping;\n if (this.spotType2.checked) this.spotType = SpotTypeEnum.Tent;\n if (this.spotType3.checked) this.spotType = SpotTypeEnum.Hut;\n\n // **** Radio buttons section 2\n if (this.campingType1.checked) this.campingType = CampingTypeEnum.Small;\n if (this.campingType2.checked) this.campingType = CampingTypeEnum.Large;\n\n if (this.hutType1.checked) this.hutType = HutTypeEnum.Default;\n if (this.hutType2.checked) this.hutType = HutTypeEnum.Luxury;\n }", "function shrFormSelect() {\n if ($('#shrRadio1').is(\":checked\")) {\n app.SHRFlag = 1;\n window.location.hash = \"#prevailing1\";\n } else if ($('#shrRadio2').is(\":checked\")) {\n app.SHRFlag = 2;\n window.location.hash = \"#eventSpecific\";\n }\n}", "function locationSelected(value) {\n\t\tconsole.log(value);\n\t\tvm.model.selectedLocation = value;\n\t\t/* API call to check available dates */\n\t\tcustApi.checkAvailableDatesInMonth(3, vm.model.fromMonthDate, value.pincodeid, value.zoneid, vm.model.physiotherapyId).\n\t\tsuccess(function (data, status, header, config) {\n\t\t\tconsole.log(\"Available dates retrieved successfully\");\n \n\t\t\tconsole.log(data);\n\t\t\t/* Enabling available dates */\n\t\t\tvar i=0;\n\t\t\tlocalVariables.enableDatesArray = [];\n\t\t\tvar yr='';\n\t\t\tvar month='';\n\t\t\tvar day='';\n\t\t\tvar date='';\n\t\t\tdata.payload.dates.forEach(function(p) {\n\t\t\t\tyr = p.substring(0,4);\n\t\t\t\tmonth = p.substring(4,6);\n\t\t\t\tday = p.substring(6,8);\n\t\t\t\tdate = yr + '/' + month + '/' + day;\n\t\t\t\tlocalVariables.enableDatesArray.push(new Date(date));\n\t\t\t});\t\t\t\t\n\t\t\tif(localVariables.enableDatesArray.length != 0) {\n \t$scope.$parent.cpc.flags.datesNotAvailable = false;\n\t\t\t\t$(\"#dt3\").data(\"DateTimePicker\").enabledDates(localVariables.enableDatesArray);\n\t\t\t} else {\n console.log(\"setting date not available flag to true\");\n \t$scope.$parent.cpc.flags.datesNotAvailable = true;\n \n $timeout(function () { \t$scope.$parent.cpc.flags.datesNotAvailable = false; }, 5000);\n\t\t\t\t$(\"#dt3\").data(\"DateTimePicker\").enabledDates([new Date('1970/1/1')]);\n\t\t\t}\n\t\t\t\n\t\t\t/* For available date retrieve 'available time' slots */\n \tif(vm.model.selectedLocation != 'Choose Location' && ( vm.model.fromDate != '' && vm.model.fromDate != undefined)) {\n \t\tcustApi.fetchAvailableSlotsForDay(vm.model.fromDate, vm.model.selectedLocation.zoneid, vm.model.physiotherapyId, vm.model.selectedLocation.pincodeid).\n \tsuccess(function (data, status, header, config) {\n \t\tconsole.log(\"Available slots retrieved successfully\");\n \t\tconsole.log(\"Slots:\");\n \t\tconsole.log(data);\n \t\tvm.model.timeslotArray = [];\n \t\t/* format time slot into hr:min am/pm */\n \t\tdata.payload.appointmentslots.forEach(function(item) {\n \t\t\tvar hours = item.st.substring(0,2);\n \t\t\tvar mins = item.st.substring(2,4);\n \t\t\tvar period = \"\";\n\t\t\t\t\t\tif(hours > 12) {\n\t\t\t\t\t\t\thours = hours - 12;\n\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t\t/*if(hours.toString().length == 1) {\n\t\t\t\t\t\t\t\thours = \"0\"+hours;\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t} else if(hours < 12) {\n\t\t\t\t\t\t\tperiod = \"AM\";\n\t\t\t\t\t\t} else if(hours == 12) {\n\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t}\n \t\t\tvar timeformat = hours + \":\" + mins + \" \" + period;\n \t\t\tvm.model.timeslotArray.push({starttime: timeformat});\n \t\t});\n \t}).\n \terror(function (data, status, header, config) {\n \t\tconsole.log(\"Error in retrieving available slots\");\n \t});\n \t}\n\t\t}).\n\t\terror(function (data, status, header, config) {\n\t\t\tconsole.log(\"Error in retrieving available dates\");\n\t\t});\n\t}", "constructor (props) {\n super(props)\n this.state = {\n isLoading : true,\n locationData: [],\n selectedValue: ''\n }\n }", "function load(){\n var elements = document.querySelectorAll('[name=' + formName + '] [name]');\n var data = getSavedData();\n\n if(data){\n for(var i in elements){\n var el = elements[i];\n var name = el.name;\n if(data.hasOwnProperty(name)){\n if(el.type === 'checkbox'){\n el.checked = data[name];\n } else if(el.type === 'radio'){\n if(el.value === data[name]){\n el.checked = true;\n }\n } else{\n el.value = data[name];\n }\n }\n }\n }\n}", "function loadSelectedQuestion(question) {\r\n // console.log(question);\r\n showQuery(question);\r\n showResponse(question);\r\n showExplanations(question);\r\n }", "function onLocationButtonTouched(e){\n\t// Only if there is a location\n\tif (media.location) {\n\t\t// Load the tags view\n\t\tvar view = Alloy.createController(\"media/location\", { \n\t\t\t\"id\": media.location.id,\n\t\t\t\"name\": media.location.name,\n\t\t\t\"latitude\": media.location.latitude, \n\t\t\t\"longitude\": media.location.longitude\n\t\t}).getView();\n\t\n\t\taddViewToSections(view);\n\t} else {\n\t\tanimation.shake($.locationButton);\n\t}\n}", "function loadSampleLocations() {\n $.ajax({\n url: \"/api/sample-locations\",\n data: {},\n success: function(data, status) {\n if (status === \"success\") {\n var sampleLocations = data.sampleLocations;\n\n createMarkersForMultiplePlaces(sampleLocations);\n }\n },\n error: function(error, status) {\n if (status === \"error\") {\n displayErrorMessage(\n \"Error: There was an error in retrieving sample locations!\"\n );\n }\n }\n });\n}", "onLocationClicked(){}", "selectProvider4() {\n // console.log(\"click\");\n let temp = {};\n temp.address = this.des_site_five.site_four.Address;\n temp.email = this.des_site_five.site_four.Email;\n temp.phone = this.des_site_five.site_four.Phone;\n temp.website = this.des_site_five.site_four.Website;\n temp.url = this.des_site_five.site_four.URL;\n this.site_location_info = temp;\n console.log(this.site_location_info);\n this.show_site_location_info = true;\n this.initMap(\n this.des_site_five.site_four.Latitude,\n this.des_site_five.site_four.Longitude,\n this.des_site_five.site_four.URL,\n this.des_site_five.site_four.Name\n );\n this.provider_map_name = this.des_site_five.site_four.Name;\n this.provider_map_site = this.des_site_five.site_four.Site_Location;\n this.provider_map_program = this.des_site_five.site_four.Program;\n }", "function populateLocationFromClick(pt){\r\n\trequire([\"esri/geometry/webMercatorUtils\"],function(webMercatorUtils){\r\n\t\tx = pt.x;\r\n\t\ty = pt.y;\r\n\t\tvar coords = $(\"#coords\");\r\n\t\tvar loc = x + \",\" + y;\r\n\t\tif (extentLayer.fullExtent.contains(webMercatorUtils.geographicToWebMercator(pt))){\r\n\t\t\tcoords.val(loc);\r\n\t\t\t$(\"#coords\")[0].disabled = true;\r\n\t\t\t$(\"#mapMarker\")[0].style.color = \"green\";\r\n\t\t\t$(\"#addLocationModal\").modal('show');\r\n\t\t\t//Disable point selection mode so user can interact with the map again\r\n\t\t\tdisablePointSelection();\r\n\r\n\t\t\t//Enable submission\r\n\t\t\t//NOTE: Re-enable this when we go live with submissions again\r\n\t\t\t//$(\"#submitNest\")[0].disabled = false;\r\n\t\t}\r\n\t\telse{\r\n\t\t\talert(\"That point is not on the UWaterloo campus. Please try another point.\");\r\n\t\t}\r\n\t});\r\n}", "function radio_onload() {\n searchItems = new Array();\n for (var siteIndex = 0; siteIndex < window.sitecollection.length; siteIndex++) {\n var index;\n index = jQuery.inArray(window.sitecollection[siteIndex].Name, searchItems);\n if (index == -1) {\n searchItems.push(window.sitecollection[siteIndex].Name);\n }\n if (window.sitecollection[siteIndex].IsNotApplicable == true) {\n window.sitecollection[siteIndex].IsNotApplicable = true;\n window.sitecollection[siteIndex].IsSafeTerritory = false;\n }\n else if (window.sitecollection[siteIndex].IsSafeTerritory == true) {\n window.sitecollection[siteIndex].IsNotApplicable = false;\n window.sitecollection[siteIndex].IsSafeTerritory = true;\n index = jQuery.inArray(window.sitecollection[siteIndex].Name, include);\n if (index == -1) {\n include.push(window.sitecollection[siteIndex].Name);\n }\n }\n else {\n window.sitecollection[siteIndex].IsNotApplicable = true;\n window.sitecollection[siteIndex].IsSafeTerritory = false;\n }\n }\n sortAppendedElements();\n\n //fill the autocomplete texbox values\n $(\"input#autocomplete\").autocomplete({\n source: searchItems, minLength: 3\n });\n}", "selectProvider5() {\n // console.log(\"click\");\n let temp = {};\n temp.address = this.des_site_five.site_five.Address;\n temp.email = this.des_site_five.site_five.Email;\n temp.phone = this.des_site_five.site_five.Phone;\n temp.website = this.des_site_five.site_five.Website;\n temp.url = this.des_site_five.site_five.URL;\n this.site_location_info = temp;\n console.log(this.site_location_info);\n this.show_site_location_info = true;\n this.initMap(\n this.des_site_five.site_five.Latitude,\n this.des_site_five.site_five.Longitude,\n this.des_site_five.site_five.URL,\n this.des_site_five.site_five.Name\n );\n this.provider_map_name = this.des_site_five.site_five.Name;\n this.provider_map_site = this.des_site_five.site_five.Site_Location;\n this.provider_map_program = this.des_site_five.site_five.Program;\n }", "function loadCity() {\n\tvar city = getSelectedCity();\n\tloadWeather(city);\n\tloadNews(city);\n}", "function search_mapinitialize(load) \n{\n if (changedValues.length != 0) \n {\n \n if (changedValues[0][3] <= 0.1) \n {\n loadmap2(load);\n }\n else \n {\n loadmap1(load);\n }\n }\n else {\n\n navigator.notification.alert('No nearest branches found!.Showing all the branches.', null, 'Alert', 'OK');\n SetLS(\"get_gpslocation\", 'notfound');\n mapinitialize();\n }\n\n}", "function onSuccessGetLocation(response) {\n // set response (latitude and longitude) to global variable\n userPosition = response;\n //remove event listener\n geolocationAllowBtn.removeEventListener(\"click\", getUserLocation);\n geolocationDeniedBtn.removeEventListener(\"click\", locationDenied);\n\n // remove element from DOM\n // we successfully get user location, so we not't need question anymore\n var wrapper = document.getElementById('questionWrapper');\n wrapper.remove();\n // and set visible airplanes list\n var airplanesContainer = document.getElementById('airplanes-container');\n airplanesContainer.classList.remove(\"hidden\");\n \n // get data, and set interval to get data every X seconds...\n getData();\n setInterval(getData, config.dataRefreshTime);\n }", "function fill_default() {\n\tvar plantType = $(\"#plant-type\").val();\n\n\tvar checked = $(\"#default-checkbox\").is(\":checked\");\n\tif(checked) {\n\t\tvar plant_info_all = load('plant_info_all');\n\t\tvar plant = plant_info_all[plantType];\n\t\tsaved = {\n\t\t\twater: $(\"#water-amount\").val(),\n\t\t\tsunlight: $(\"#sunlight-amount\").val(),\n\t\t\tplant_during: $(\"#plant-season\").val(),\n\t\t\tblooming_season: $(\"#bloom-season\").val()\n\t\t}\n\n\t\tif(plant !== undefined) {\n\t\t\tfill_default_show(plant);\n\t\t}\n\t} else {\n\t\tfill_default_show(saved);\n\t}\n}", "function select_outlet() { \n\t\t//alert ('asdasf')\n\t\tlocalStorage.latlongSubmit=0;\n\t\tlocalStorage.dataSubmit=0;\n\t\tlocalStorage.fddataSubmit=0;\n\t\tlocalStorage.qpdsdataSubmit=0;\n\t\tlocalStorage.npddataSubmit=0;\n\t\tlocalStorage.giftdataSubmit=0;\n\t\tlocalStorage.shopdataSubmit=0;\n\t\tlocalStorage.placedataSubmit=0;\n\t\tlocalStorage.placeLatLongCount=0\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tlocalStorage.m_new=\"\";\n\t\tlocalStorage.submitted_outlet=\"\";\n\t\t\n\t\tlocalStorage.npdSkip=0;\n\t\tlocalStorage.fdSkip=0;\n\t\tlocalStorage.qpdsSkip=0;\n\t\tlocalStorage.giftSkip=0;\n\t\t\n\t\tlocalStorage.latitude=0;\n\t\tlocalStorage.longitude=0;\n\t\t\n\t\tlocalStorage.fdisplayStringShow=''\n\t\t\t\n\t\tvar selected_outletID_get=($(\"input:radio[name='RadioOutlet']:checked\").val())\t\t\n\t\tvar selected_outletID_list = selected_outletID_get.split('|');\n\t\t\n\t\tvar selected_outletID=selected_outletID_list[0].split('[')[1].replace(']','');\t\n\t\tvar outlet=selected_outletID_list[0];\t\n\t\tvar channel=selected_outletID_list[1];\n\t\t//var selected_date_get=selected_outletID_list[1];\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\t\tlocalStorage.outletChannel=channel\n\t\t\t\t\tlocalStorage.outletNameID=outlet\n\t\t\t\t\t\n\t\t\t\t\tdiv_change();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$(\"#dataerrorOutlet\").html('');\n\t\t\t\t\t$(\"#outletWait\").show();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n//\t\t\t\t \n\t\t\t\t //cancel_outlet();\n\t\t\t\t $(\"#outletCancel\").hide();\n\t\t\t\t var url = \"#outletPage\";\n\t\t\t\t $.mobile.navigate(url);\t\n\t\t\t\t $(url).trigger('create');\n\t\t\t\t location.reload();\n\n}", "function loadStudentLoanValues(){\n\tif(localStorage.loanAmount!='' && localStorage.loanAmount !='undefined')\n\t{\t$('#loan-amount-o').val(localStorage.loanAmount);\n\t\t$('#loan-amount-o').slider('refresh'); }\n\tif(localStorage.noofMonth != 'undefined' && localStorage.noofMonth != '')\n\t{\t$('#monthly-payment').val(localStorage.noofMonth) }\n\tif(localStorage.interestRate != '' && localStorage.interestRate != 'undefined')\n\t{\t$('#interest-rate-o').val(localStorage.interestRate) \n\t\t$('#interest-rate-o').slider('refresh');\t}\n}", "function determineLocation() {\n self._reporterId = reporter._id;\n\n if (!self.state) {\n // Use one of the reporter's last locations\n if (reporter.locationHistory && reporter.locationHistory.length > 0) {\n self.state = STATES.chooseLocation;\n choosePreviousLocation();\n } else {\n // Otherwise, prompt the reporter to tell us where they are \n // reporting from\n self.state = STATES.findLocation;\n interviewForLocation();\n }\n } else if (\n self.state === STATES.chooseLocation ||\n self.state === STATES.chooseFromPastLocations\n ) {\n // Choose a previous location, react to location choice\n choosePreviousLocation();\n } else if (\n self.state === STATES.findLocation ||\n self.state === STATES.choosePossibleLocation ||\n self.state === STATES.parseLocation ||\n self.state === STATES.confirmLocation ||\n self.state === STATES.acceptLocation\n ) {\n // conduct/continue an interview process to get a new location\n interviewForLocation();\n } else {\n // The default next step is to complete the interview\n doSurvey();\n }\n }", "function loadExistingQuestion4() {\n\n // no value present, do nothing\n if( meTotalOcclusion[meCurrentLesion] == '-1' ) {\n return;\n }\n\n // Question 4, id: formq4, only if total occlustion was set to true, not -1 or false\n if( meTotalOcclusion[meCurrentLesion] && meTotalOcclusion[meCurrentLesion] > 0 ) {\n // Total occlustion is present\n getRadioInForm('right', 'formq4', 'totaloc')[meTotalOcclusion[meCurrentLesion]].checked = true;\n\n // sub question 4i, id: formq4i\n getById('right', 'q4i').style.display='block';\n for (var i = 0; i < meIndicateSegmentNumber.length; i++) {\n if( meIndicateSegmentNumber[i][meCurrentLesion] ) {\n getById('right', 'dd' + i).checked = true;\n\n\t\t// since question 4i changed to radiobuttons we can have a max of 1 selected\n\t\tbreak;\n }\n }\n\n // sub question 4ii, id: formq4ii\n getById('right', 'q4ii').style.display='block';\n getRadioInForm('right', 'formq4ii', '3months')[meAgeofTO[meCurrentLesion]].checked = true;\n\n // sub question 4iii, blunt stump\n getById('right', 'q4iii').style.display='block';\n getRadioInForm('right', 'formq4iii', 'bluntstump')[meBluntStump[meCurrentLesion]].checked = true;\n //setFrameUrl('left','diagramblunt.htm');\n\n // sub question 4iv, bridging\n getById('right', 'q4iv').style.display='block';\n getRadioInForm('right', 'formq4iv', 'bridging')[meBridging[meCurrentLesion]].checked = true;\n //setFrameUrl('left','diagrambridging.htm');\n\n // sub question 4v\n // first show table and label, of highest segment (most proximal)\n if( checkIfProximalSegmentGetsQuestion4v() ) {\n // some set to visible for question 4vii\n getById('right', 'q4vitable' + meProximalSegmentNumber[meCurrentLesion]).style.display = 'block';\n getById('right', 'q4vitable').style.display='block';\n\n getById('right', 'q4v').style.display = 'block';\n\t getById('right', translateNumberAndSegmentQuestion4v()).checked = true;\n //setFrameUrl('left','diagramviz.htm');\n }\n\n // sub question 4vi\n getById('right', 'q4vi').style.display='block';\n getRadioInForm('right', 'formq4vi', 'sidebranch')[meSideBranch[meCurrentLesion]].checked = true;\n }\n else if( meTotalOcclusion[meCurrentLesion] == 0 ) {\n getRadioInForm('right', 'formq4', 'totaloc')[meTotalOcclusion[meCurrentLesion]].checked = true;\n }\n}", "function assignIsCheckedPropertyToLocations() {\n\t\t\tfor(var i = 0; i < $scope.locations.length; i++) {\n\t\t\t if(leaderIsAssignedToLocation($scope.locations[i].id)) {\n\t\t\t $scope.locations[i].isChecked = true;\n\t\t\t } else {\n\t\t\t $scope.locations[i].isChecked = false;\n\t\t\t }\n\t\t\t}\n\t\t}", "function startDataUpload() {\r\n\tif (document.getElementById('question').value == \"\" || document.getElementById('answer1').value == \"\" ||\r\n\tdocument.getElementById('answer2').value == \"\"|| document.getElementById('answer3').value == \"\"|| \r\n\tdocument.getElementById('answer4').value == \"\"|| document.getElementById('latitude').value == \"\"|| \r\n\tdocument.getElementById('longitude').value == \"\") {\r\nalert(\"Please Fill All Fields !\");\r\n}\r\nif (isNaN(document.getElementById('latitude').value||document.getElementById('longitude').value )){\r\nalert(\"Please Fill the Latitude and Longitude by reasonable numbers\");\r\n}\r\nif(document.getElementById('ra1').checked==false&&document.getElementById('ra2').checked==false\r\n\t&&document.getElementById('ra3').checked==false&&document.getElementById('ra4').checked==false){\r\nalert(\"Please check one circle button!\");\r\n}else {\r\n\talert (\"start data upload\");\r\n\r\n//****adapted from practical 6 and 7****//\r\n//get the value in text boxes\r\n\tvar question = document.getElementById(\"question\").value;\r\n\tvar answer1 = document.getElementById(\"answer1\").value;\r\n\tvar answer2 = document.getElementById(\"answer2\").value;\r\n var answer3 = document.getElementById(\"answer3\").value;\r\n\tvar answer4 = document.getElementById(\"answer4\").value;\r\n\tvar latitude=document.getElementById(\"latitude\").value;\r\n\tvar longitude=document.getElementById(\"longitude\").value;\r\n\talert(question);\r\n\t\r\n//define poststring so that it can be parameters for the URL to send values to the server\t\t\t\r\n\tvar postString = \"question=\"+question +\"&answer1=\"+answer1+\"&answer2=\"+answer2+\"&answer3=\"+answer3+\"&answer4=\"+answer4;\r\n\tpostString=postString+\"&latitude=\"+latitude+\"&longitude=\"+longitude;\r\n\t\t\r\n\r\n\r\n// now get the radio button values\r\n\tif (document.getElementById(\"ra1\").checked) {\r\n \t\tvar correct_answer=document.getElementById(\"ra1\").value;\r\n\t\tpostString=postString+\"&correct_answer=\"+correct_answer\r\n\t}\r\n\tif (document.getElementById(\"ra2\").checked) {\r\n \t\tvar correct_answer=document.getElementById(\"ra2\").value;\r\n\t\tpostString=postString+\"&correct_answer=\"+correct_answer\r\n\t}\r\n if (document.getElementById(\"ra3\").checked) {\r\n \t\tvar correct_answer=document.getElementById(\"ra3\").value;\r\n\t\tpostString=postString+\"&correct_answer=\"+correct_answer\r\n\t}\r\n\tif (document.getElementById(\"ra4\").checked) {\r\n \t\tvar correct_answer=document.getElementById(\"ra4\").value;\r\n\t\tpostString=postString+\"&correct_answer=\"+correct_answer\r\n\t}\r\n\t\r\n//pass the data to processData function \t\r\n\tprocessData(postString);\r\n}\r\n}", "function handleLocation(){\n navigator.geolocation.getCurrentPosition((position) => {\n\n //Call the function which will do the local weather data\n getWeather(position.coords.latitude, position.coords.longitude);\n setLocation(true) //Report which the local localization is enabled\n })\n }", "function locationSelected(value) {\n\t\tconsole.log(value);\n\t\tvm.model.selectedLocation = value;\n\t\t/* API call to check available dates */\n\t\tcustApi.checkAvailableDatesInMonth(3, vm.model.fromMonthDate, value.pincodeid, value.zoneid, vm.model.physiotherapyId).\n\t\tsuccess(function (data, status, header, config) {\n\t\t\tconsole.log(\"Available dates retrieved successfully\");\n\t\t\tconsole.log(data);\n\t\t\t/* Enabling available dates */\n\t\t\tvar i=0;\n\t\t\tvar enableDatesArray = [];\n\t\t\tvar yr='';\n\t\t\tvar month='';\n\t\t\tvar day='';\n\t\t\tvar date='';\n\t\t\tdata.payload.dates.forEach(function(p) {\n\t\t\t\tyr = p.substring(0,4);\n\t\t\t\tmonth = p.substring(4,6);\n\t\t\t\tday = p.substring(6,8);\n\t\t\t\tdate = yr + '/' + month + '/' + day;\n\t\t\t\tenableDatesArray.push(new Date(date));\n\t\t\t});\t\t\t\t\n\t\t\t/*$(\"#booking1-dt\").data(\"DateTimePicker\").enabledDates(enableDatesArray);*/\n\t\t\tif(enableDatesArray.length != 0) {\n\t\t\t\tvm.flags.datesNotAvailable = false;\n\t\t\t\tvm.flags.bookingErrorContainer = vm.flags.datesNotAvailable;\n\t\t\t\t$(\"#booking1-dt\").data(\"DateTimePicker\").enabledDates(enableDatesArray);\n\t\t\t} else {\n\t\t\t\tvm.flags.datesNotAvailable = true;\n\t\t\t\tvm.flags.bookingErrorContainer = vm.flags.datesNotAvailable;\n\t\t\t\tvm.model.bookingErrorMessageContainer = 'Dates not Available for currently selected Location';\n\t\t\t\t$timeout(function () { vm.flags.bookingErrorContainer = false; vm.flags.datesNotAvailable = false}, 5000);\n\t\t\t\t$(\"#booking1-dt\").data(\"DateTimePicker\").enabledDates([new Date('1970/1/1')]);\n\t\t\t}\n\t\t\t\n\t\t\t/* For available date retrieve 'available time' slots */\n \tif(vm.model.selectedLocation != 'Choose Location' && vm.model.fromDate != undefined) {\n \t\tcustApi.fetchAvailableSlotsForDay(vm.model.fromDate, vm.model.selectedLocation.zoneid, vm.model.physiotherapyId, vm.model.selectedLocation.pincodeid).\n \tsuccess(function (data, status, header, config) {\n \t\tconsole.log(\"Available slots retrieved successfully\");\n \t\tconsole.log(\"Slots:\");\n \t\tconsole.log(data);\n \t\tvm.model.timeslotArray = [];\n \t\t/* format time slot into hr:min am/pm */\n \t\tdata.payload.appointmentslots.forEach(function(item) {\n \t\t\tvar hours = item.st.substring(0,2);\n \t\t\tvar mins = item.st.substring(2,4);\n \t\t\tvar period = \"\";\n\t\t\t\t\t\tif(hours > 12) {\n\t\t\t\t\t\t\thours = hours - 12;\n\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t\t/*if(hours.toString().length == 1) {\n\t\t\t\t\t\t\t\thours = \"0\"+hours;\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t} else if(hours < 12) {\n\t\t\t\t\t\t\tperiod = \"AM\";\n\t\t\t\t\t\t} else if(hours == 12) {\n\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t}\n \t\t\tvar timeformat = hours + \":\" + mins + \" \" + period;\n \t\t\tvm.model.timeslotArray.push({starttime: timeformat});\n \t\t});\n \t}).\n \terror(function (data, status, header, config) {\n \t\tconsole.log(\"Error in retrieving available slots\");\n \t});\n \t}\n\t\t}).\n\t\terror(function (data, status, header, config) {\n\t\t\tconsole.log(\"Error in retrieving available dates\");\n\t\t});\n\n\t\tvm.promoobj.promocode='';\n\t\tvm.promoobj.promocodeid='';\n\t\tvm.promoobj.finalcost='';\n\t\tvm.promoobj.discount='';\n\t\tvm.model.apptCost = localVariables.bookNowobj.apptCost;\n\t\tvm.custInfoFormFields.promocode='';\n\t}", "function loadExistingFormValues() {\n\n // lesion has been found, load data and fill out form\n if( meCompletedLesions[meCurrentLesion] ) {\n\tloadExistingQuestion4();\n\tloadExistingQuestion5();\n\tloadExistingQuestion6();\n\tloadExistingQuestion7();\n\tloadExistingQuestion8();\n\tloadExistingQuestion9();\n\tloadExistingQuestion10();\n loadExistingQuestion11();\n loadExistingComment();\n showSaveButton();\n }\n}", "handlePosToggle(e) {\n\t\tthis.setState({ isLocationBased: true });\n\t\tif ( e.target.checked ) {\n\t\t\tthis.setState({ \n\t\t\t\tisLoading: true \n\t\t\t});\n\n\t\t\tthis.getCurrentPos() \t\n\t\t} else { \n\t\t\tthis.setState({ \n\t\t\t\tcurrentPos: null, \n\t\t\t\tisLocationBased: false \n\t\t\t});\n\t\t}\n\t}" ]
[ "0.64060116", "0.6314692", "0.5714211", "0.56883925", "0.56702596", "0.5663481", "0.5657399", "0.5613464", "0.5580586", "0.55533725", "0.5550602", "0.5527472", "0.5522393", "0.54881865", "0.54725707", "0.5420816", "0.54161906", "0.54078484", "0.5383186", "0.537499", "0.53599536", "0.53577477", "0.5338689", "0.52619916", "0.52447695", "0.5243192", "0.5240183", "0.52363604", "0.5234233", "0.52044743", "0.52030575", "0.519552", "0.51877505", "0.5183197", "0.51683176", "0.5166601", "0.5160115", "0.5160115", "0.5148843", "0.5146541", "0.51263785", "0.511979", "0.5118026", "0.5115983", "0.5115983", "0.511432", "0.5111339", "0.51044965", "0.5099343", "0.50878984", "0.5075354", "0.5068675", "0.5064031", "0.50629514", "0.506213", "0.5059954", "0.5058459", "0.5051543", "0.5051164", "0.5035361", "0.5031883", "0.50286967", "0.5025968", "0.5024984", "0.50204045", "0.50180155", "0.50171024", "0.5013266", "0.5008851", "0.50084245", "0.4990038", "0.498994", "0.49876687", "0.49869317", "0.49854353", "0.49802876", "0.49678436", "0.496579", "0.49603266", "0.4959123", "0.49525642", "0.49406862", "0.4938899", "0.4934133", "0.49292156", "0.49291816", "0.49275717", "0.49236068", "0.49208462", "0.49183437", "0.49176416", "0.4915855", "0.4914437", "0.4913828", "0.4911042", "0.49044803", "0.49033687", "0.489975", "0.48981863", "0.48955533" ]
0.58521175
2
Start scraper function on button click.
function scrapeThis(e) { var categories = $('#category').val().split('\n'); var parameters = { country: $('input[name=country]:checked').val(), location: $('#location').val(), category: '' }; var source = $("#search-results").html(); var dataTemplate = Handlebars.compile(source); results = $('#results') // newAlert("Please Wait!", "We're still scraping..."); for (var i = 0; i < categories.length; i++) { parameters.category = categories[i]; $.get('/searching', parameters, function(data) { if (data instanceof Object) { results.append(dataTemplate({ page: data })); } else { results.append(data); }; showModal(parameters, data.business.length); data.business = filterArray(data.business, filterD121); scrapedData.push(data); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start(){\n\tautoCompleteSearch();\n\tsubmitButton();\n\tsubmitButtonRandom();\n\tnewSearch();\n\trandomChar();\n\thideCarouselNav();\n}", "function initialize() {\n var element = document.getElementById('test_button');\n if (element) {\n element.onclick = getSkyscraper;\n }\n getSkyscraper();\n}", "function initializePage() {\n $('.btn').click(search);\n}", "function ativeBonusRound() {\n document.getElementsByClassName(\"start-button\")[0].click();\n }", "startCrawler() {\n if (this._crawler !== null) return;\n this.crawlerFunc();\n }", "function handleStartButtonClicked() {\n\t$('.js-start').click(event => {\n\t\trenderQuestionPage(0, 0);\n\t});\n}", "function startButton(){\n hunger();\n happy();\n knowledge();\n \n}", "function startpage() {\n $(\"main\").empty();\n $(\"main\").append(\"<button id='start-button'>START!</button>\");\n $(\"#start-button\").on(\"click\", timingQuestion);\n }", "function resultsPageHandler() {\n $('main').on('click', '#restart-button', function() {\n console.log('restart button clicked');\n event.preventDefault();\n currentPage = 'startPage';\n STORE.questionNumber = 0;\n STORE.score = 0;\n render();\n \n });\n}", "function startPage() {\n $('main').html(startScreen());\n startQuizButton();\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 }", "function handleStartPage()\n{\n\t// Listens to submit button\n $( '#searchForm' ).on( 'submit', function( event )\n\t\t{\n\t\t\tevent.preventDefault(); // prevent default form submission behavior\n\t\t\t\n // store the term that the user enters into input search box\n let searchItem = $( event.currentTarget ).find( '#searchInput' ).val();\n\n // Clear search box text\n $( event.currentTarget ).find( '#searchInput' ).val( \"\" );\t\n\n\t\t\t// Store the user's search term for later use in peer request\n orignalSearchComp = searchItem;\n\n // Calls makeRequest to interact with server\n makeRequest( searchItem );\n\t\t} );\n\n // Listens to \"Purchase\" button\n $( '.displayPage' ).on( 'click', '#purchaseBtn', function( event )\n {\n // call brokers function\n displayBrokers();\n $( '.peerPage' ).hide();\n } );\n\n \n // Listens to \"New Search\" button\n $( '.displayPage' ).on( 'click', '#newSearchBtn', function( event )\n {\n // Show search box again\n location.reload();\n } );\n}", "function start() {\r\n if (jQuery('.well').length > 0) {\r\n //-- Specific file(s) result page\r\n singleResult();\r\n } else if (jQuery('.similar').length > 0) {\r\n //-- Search results page with results\r\n searchResults('yesFiles');\r\n } else if (jQuery('.alert.alert-block') > 0) {\r\n //-- Search results page with no results\r\n searchResults('noFiles');\r\n } else {\r\n //-- Home page\r\n homePage();\r\n }\r\n}", "function theClick() {\r\n console.log('inicia')\r\n dataNodes()\r\n dataElements()\r\n backEnd()\r\n}", "function autoClick() {\n //simulate a click of <button id=\"refresh\">Refresh</button>\n \n }", "function clickStart() {\n $('main').on('click', '#start', function (event) {\n STORE.quizStarted = true;\n render();\n });\n }", "function quickSearchButton_click() {\n //Begin Search Animation\n var $quickSearchResultsListWrapper = $(\"#QuickSearchResultsListWrapper_helm\");\n var $quickSearchProgressLoaderWrapper = $(\"#QuickSearchProgressLoaderWrapper_helm\");\n quickSearchResults_show(true);\n showProgressSpinner(true, \"#QuickSearchResultsContentTab_helm\");\n var quickSearch = quickSearchOptions_GetUserDefinedValues(); //Gather the search options specified by user and package them in QuickSearchOptions_helm javascript object\n quickSearch.recentSearches.save.call(quickSearch); //save the quick search in recent quick searches\n //\n helm.xhr.getQuickSearchResults(quickSearch.toJSON()).promise().done(function() {\n showProgressSpinner(false,\"#QuickSearchResultsContentTab_helm\");\n });\n if (Compass.Global.isLoanSelected && helm.DisplayMode !== \"QuickSearchRecentlyViewedOnly\") { //a setting/check for is in iquote mode would be better here.\n helm.showBasicLoanDetailsInPageHeader(true);\n }\n }", "function clickStart() {\n $('.quizApp').on('click', 'button', function(event) {\n event.preventDefault();\n $('.quizApp').html(renderQuestion);\n \n })\n}", "function handleStartOverButtonClicked() {\n $('.page').on('click', '.start-over', function (event) {\n event.preventDefault();\n STORE.view = 'start';\n STORE.quizLength = null;\n STORE.quizCategory = null;\n STORE.currentQuestion = null;\n STORE.button = { class: 'start-button', label: 'Start Quiz' };\n STORE.showFeedback = false;\n STORE.correctAnswerTotal = 0;\n QUESTION_ARRAY = [];\n renderPage();\n }\n );\n}//this instantiates a new ApiCall", "function initializePage() {\n\tconsole.log(\"Javascript connected!\");\n\t$(\".searchButton\").click(function(e) {\n \n\n \n \n });\n}", "function _startScript() {\r\n // Prevent the user from pressing the Start button again.\r\n _setButtonState(false);\r\n\r\n _buildWorkQueue();\r\n }", "waitForButtonClicked() {\n if (this.elements.button) {\n document.querySelector('.' + this.elements.button).addEventListener('click', () => {\n\n // * Get all data from the fields\n var input = this.getInputData();\n\n if (input) {\n var filtered = this.search.searchByFilters(input);\n\n // * Show filtered datasets\n if (filtered) {}\n }\n });\n }\n \n }", "function clickDemarrer() {\n\tif (loading) {\n\t\treturn;\n\t}\n\tdocument.getElementById(\"btnDemarrer\").display = \"none\"; \n\tlancerChapitre(1);\n}", "function startButton() {\n //button.disabled = true;\n\t\t\trecognition.start();\n\t\t}", "function whenClicked()\r\n{\r\n\r\n $('#trackbtn').button('loading');\r\n getUserLocation();\r\n\r\n}", "function startPage() {\n getContainer();\n \n var startButton = document.getElementById(\"startbut\");\n}", "function listenForClick() {\n loopThroughGrid();\n clickTurnBtn();\n }", "function start() {\n console.log(\"start\");\n\n // open.classList.add(\"zoom\");\n\n console.log(\"URL: \" + check);\n\n // landing = check + index;\n // first = check + firstP;\n // scd = url + secondP;\n\n\n\n if (landing) {\n console.log(\"index\");\n landingPage();\n\n } else if (firstP) {\n console.log(\"firstPage\");\n firstPage();\n\n } else if (secondP) {\n console.log(\"secondPage\");\n secondPage();\n\n }\n\n // The page is fully loade\n}", "function handleStartButton() {\n $('.start').on('click','.js-start-btn', function () {\n store.view = 'quiz';\n render();\n });\n}", "function reStart() {\r\n $('main').on('click', '.restart-button', function(event){\r\n event.preventDefault();\r\n location.reload();\r\n });\r\n}", "function startPage(){\n startButton.text(\"Start Quiz\");\n startButton.on(\"click\", function(){\n questionPage(questions[currentQuestion]);\n })\n page.append(startButton);\n }", "function launchAnalysis() {\n\t\t$('#dbwp_loading').show();\n\t\t$('#dbwp_submit').attr('disabled', true);\n\t\t$('#dbwp_result').empty();\n\t\t$('#dbwp_analysisContainer').hide();\n\n\t\tvar data = {\n\t\t\t\taction: 'new_analysis'\n\t\t};\n\n\t\t// Send the post ajax request to launch the analysis \n\t\t$.post(ajaxurl, data, function(response) {\n\t\t\t// if there is an error, print the message \n\t\t\tif ( response.error ) {\n\t\t\t\t$('#dbwp_loading').hide();\n\t\t\t\t$('#dbwp_result').html(response.message);\n\t\t\t\t$('#dbwp_submit').attr('disabled', false);\n\t\t\t\t$('#dbwp_analysisContainer').show();\n\t\t\t\t\n\t\t\t// if the analysis is launch we create an interval to repeatedly (each 2 secondes) call the get report \n\t\t\t} else {\n\t\t\t\t$('#dbwp_result').html(response.message);\n\t\t\t\tvar reportInterval = window.setInterval( function() {\n\t\t\t\t\tvar getReportData = {\n\t\t\t\t\t\t\taction: 'get_report',\n\t\t\t\t\t\t\treportId: response.reportId\n\t\t\t\t\t};\n\t\t\t\t\t\n\t\t\t\t\t$.post(ajaxurl, getReportData, function(response) {\n\t\t\t\t\t\t$('#dbwp_result').html(response.message);\n\t\t\t\t\t\t// if it's ended we remove laoding image and enable analyse button\n\t\t\t\t\t\tif ( response.isEnded ) {\n\t\t\t\t\t\t\t$('#dbwp_loading').hide();\n\t\t\t\t\t\t\t$('#dbwp_submit').attr('disabled', false);\n\t\t\t\t\t\t\tclearInterval(reportInterval);\n\t\t\t\t\t\t}\n\t\t\t\t\t}); \n\t\t\t\t}, 2000);\n\t\t\t}\n\t\t});\t\n\t\t\n\t\treturn false;\n\t}", "function start() {\n $('main').on('click', '.submit-button', event => {\n $('.submit-button').addClass('hidden');\n displayQuestion();\n });\n}", "function startUp() {\n let search = document.getElementById(\"search\");\n search.onclick = searchAll;\n }", "function load_click() {\n\n if ($loadMoreButton.attr('disabled') === 'disabled') {\n return;\n } //don't load if currently loading\n\n if ($loadMoreButton.hasClass('support')) {\n client = 'support';\n $container = $('.' + client + '-result-section .result-items', $context);\n resultTemplate = _.template(globalSearch.myConfig.templateNormal);\n } else if ($loadMoreButton.hasClass('blog')) {\n client = 'blog';\n $container = $('.' + client + '-result-section .result-items', $context);\n resultTemplate = _.template(globalSearch.myConfig.templateNormal);\n } else if ($loadMoreButton.hasClass('more')) {\n client = 'more';\n $container = $('.' + client + '-result-section .result-items', $context);\n resultTemplate = _.template(globalSearch.myConfig.templateNormal);\n } else {\n client = 'video';\n $container = $('.' + client + '-result-section .result-items', $context);\n resultTemplate = _.template(globalSearch.myConfig.templateVideo);\n }\n\n //increment to next page\n queryParam.start += queryParam.num;\n isLoadClick = true;\n loadResults();\n }", "function run() { \n\n moveToNewspaper();\n pickBeeper();\n returnHome();\n\n}", "function listenForStartOverClick () {\n\n $('.startOverBtn').click(function(){\n location.reload();\n });\n\n}", "function listenStartButton() {\n $('body').on('click', '#start', function (event) {\n $('.darkMoneyImg').hide();\n $('.eleanorQuoteImg').hide();\n $('#dark-money').removeClass('black-box');\n $('#dark-money').removeClass('ask-question');\n renderQuestionAndOptions();\n renderScorecard('reset');\n });\n}", "function startQ(){\n $(\"main\").on(\"click\", \".startButton\", event => {\n event.preventDefault();\n submitQuestion();\n submitFeedback();\n store.quizStarted = true;\n renderQuestionView();\n })\n}", "function click() {\n $(\"#search\").on(\"click\", function (e) {\n e.preventDefault();\n console.log(\"You clicked a button!\");\n getCityWeather().then(addToCityList());\n });\n}", "function preload() {\n\t//\"on click launch setup\"\n\t$( 'HTML' ).click( setup );\n}", "function watchForm(){\n $('button').click(function() {\n event.preventDefault();\n $('.js-youtube-results').empty();\n $('.js-news-results').empty();\n const searchTerm = $('.js-search-bar').val();\n const fromPublishedDate = $('#date-from').val();\n const toPublishedDate = $('#date-to').val();\n getNews(searchTerm, fromPublishedDate, toPublishedDate);\n getVideos(searchTerm, fromPublishedDate, toPublishedDate);\n })\n}", "function handleBeginClick() {\n$('main').on(\"click\", '.start-button', event => {\n console.log(\"clicked\")\n store.quizStarted=true\n renderPage()\n})\n}", "function startDownload(){\n\n}", "buttonSetup(){\n const self = this;\n // allow \"Enter\" key to click button\n $('#userID').keypress(function(e){\n if(e.keyCode==13) self.startReading();\n });\n\n $(\"#startButton\").on(\"click\",e=>{\n self.startReading();\n })\n }", "function handleViewResultsButtonClicked() {\n $('.page').on('click', '.view-results', function (event) {\n event.preventDefault();\n STORE.view = 'results';\n STORE.button = { class: 'start-over', label: 'Start Over' };\n STORE.currentQuestion = null;\n STORE.userChoice = null;\n renderPage();\n });\n}", "function clickonStartManager() {\n $('main').on('click', '#start', function(event) {\n console.log('i hear you');\n questionnaire.quizStarted = true;\n render();\n });\n}", "function start(){\n\tquestionOne();\n\t//submitForm();\n\tcheckBrowser();\n} // end start", "function processGenerateReportButton() \n{ \n\t//console.log(\"Entereed generateReport\");\n\t//console.log(currentPage);\n\t\n\tif (currentPage == \"Campus\")\n\t{\n\t\tinitCampusReportGeneration();\n\t}\n\telse\n\t{ \n\t\tinitBuildingReportGeneration(currentPage);\n\t}\n\t\n}", "function main() {\n\n\t$(\"#nav-search-btn\").on(\"click\", function(e) {\n\t\te.preventDefault();\n\t\tif ($(\"#ex1\").val()) {\n\t\t\t$(\".search\").empty();\n\t\t\t$(\".search\").show();\n\t\t\t$(\".notSearch\").hide();\n\t\t\tlet userQuery = $(\"#ex1\").val().toLowerCase();\n\t\t\tsearchEndPoint(userQuery);\n\t\t}\n\t});\n\n\t$(\"#reportSearch\").on(\"click\", function(e) {\n\t\tconsole.log(\"Reportar\");\n\t\tlet reported = $('.rightSearch').attr('id');\n\t\tgetReported(reported);\n\t});\n\n\t$(\".searches-container\").on(\"click\", function(e) {\t\t\n\t\twindow.scroll({\n\t\t\ttop: 0, \n\t\t\tleft: 0, \n\t\t\tbehavior: 'smooth'\n\t\t});\n\t\tdisplaySearch(e.target.id);\n\t});\n}", "function main() {\n $('.generator-options-item').click(toggleDropdownButton);\n $('.generator-optimizer-item').click(selectOptimizerButton);\n $('#generator-nutr-button').click(updateNutrOptions);\n $('#generator-opt-button').click(updateOptimizeId);\n $('#add-ingredient').click(addIngredient);\n $('#cancel-recipe-input').click(clearRecipeInputs);\n $('#add-recipe-form').submit(checkInputs);\n $('#edit-profile-form').submit(checkEditProfileInputs);\n $('#generator-form').submit(checkGeneratorInputs);\n}", "startOnboarding () {\n sessionStorage.setItem(REGISTRATION_IN_PROGRESS, true)\n this._openDownloadPage()\n this._openForwarder()\n }", "function start() {\n console.log(\"start\");\n\n document.querySelector(\"#generate\").addEventListener(\"click\", generate);\n}", "function onclickForTab_Discover()\n{\n //console.log('click on discover tab');\n \n if(!global_pagesLoaded.discover)\n {\n firstLoadForTab_Discover();\n }\n \n //each time setup to go here\n}", "function onStartClick() {\n startCatWalk();\n}", "function clickButton() {\n location.href = \"index.html\";\n }", "function start(){\n if(!started){\n started = true;\n Timer = setInterval(checkTextBox, 1000);\n for(let i = 0; i < pages[0].length;i++){\n loadDoc(parse,\"pages\\\\\"+pages[0][i]+\".inc.html\",i,1);\n }\n }\n let show = document.querySelector(\".search #dropdown\");\n show.style.display = \"none\";\n}", "function ClickStart()\n{\n if(Btn_Start.Exists)\n {\n Btn_Start.ClickButton()\n Log.Message(\"Clicked on Start Button on Quick CMC\")\n return true\n }\n else\n {\n Log.Message(\"Button Start doesn't exists\")\n return false\n }\n}", "function startPageHandler() {\n $('main').on('click', '#begin-button', function() {\n event.preventDefault();\n console.log('begin button clicked');\n currentPage = 'questionPage';\n STORE.questionNumber = 1;\n console.log(STORE.questionNumber);\n render();\n });\n \n \n console.log('`startPageHandler function` ran');\n}", "function btnR1AStart_onclick(btn){\n\n\t\t// ----------------------------------------------------------------------- //\n\n\t\tlet _resolve = function(result){\n\t\t\twindow.console.pb.log.resolve(result.id);\n\t\t\t//tools.enableBtns(btn);\n\t\t\ttext('Resolved', '#44CD5A');\n\t\t}\n\n\t\tlet _reject = function(result){\n\t\t\twindow.console.pb.log.reject(result.id);\n\t\t\t//tools.enableBtns(btn);\t\t\n\t\t\ttext('Rejected', 'red');\n\t\t}\n\n\t\t// ----------------------------------------------------------------------- //\n\t\t\n\t\tdebugger;\n\t\t\n\t\tconsole.clear();\n\t\t//tools.disableBtns(btn);\n\t\t\n\t\ttext('Started: pending', '#cccccc');\n\t\t\n\t\tpb.start(\n\t\t\t_resolve, \n\t\t\t_reject\n\t\t);\t\n\t}", "function run() {\n\t// Clean Appbrain\n\tif (location.href.indexOf('www.appbrain.com') > -1) {\n\t\t// Remove paywall\n\t\tdocument\n\t\t\t.querySelector('.paywall-overlay')\n\t\t\t.parentElement.removeChild(document.querySelector('.paywall-overlay'));\n\t\t// Remove the blur\n\t\tdocument.querySelector('.blurred').classList.remove('blurred');\n\t} else {\n\t\t// Save the current page url\n\t\tlet current_app_url = location.href;\n\t\t// Check if the current id not the same\n\t\tif (document.getElementById('aso-data') == null && !processing) {\n\t\t\tprocessing = true;\n\t\t\tgenerateASO();\n\t\t}\n\t\tsetInterval(function() {\n\t\t\tif (current_app_url != location.href) {\n\t\t\t\tlocation.reload();\n\t\t\t}\n\t\t}, INTERVAL_TIMER_CHECKER);\n\t}\n}", "function scrapeWebsite(url) {\n // Have Update button for doing a new scrape of the mark and updating\n // it with newer data\n\n return fetch('/scrape_url/', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/x-www-form-urlencoded', // Important\n },\n body: JSON.stringify({\n url: url,\n })\n })\n .then((response) => {\n return response.json()\n })\n .then((data) => {\n return data\n })\n}", "function runQuizApp() {\r\n startButton();\r\n questionDisplay();\r\n submit();\r\n next();\r\n \r\n}", "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}", "function startBtn () {\n $(\"#wrapper\").hide();\n $(\"#newGameBtn\").hide();\n $(\"#startBtn\").on(\"click\", function (){\n newQA();\n $(\"#startBtn\").hide();\n $(\"#wrapper\").show();\n }); \n}", "function startBtn() {\n\t\t// console.log(shuffledQuestions);\n\t\t$(\"#startArea\").html(heartsArea);\n\t\t$(\"#startArea\").append(questionArea);\n\t\tcountHearts();\n\t\t// console.log(randAnswers);\n\t\t$(\"#startArea\").append(answerArea);\n\t\taddAnswerBtns();\n\t\t// console.log(\"The correct answer is: \" + correctAnswer);\n\t\t$(\"#startArea\").on(\"click\", \".answerBtn\", guess);\n\t\tquestionsAsked++;\n\t\trun();\n\t}", "_start() {\n this._loadPage();\n this._sayHello();\n }", "function main() {\r\n jQ('.vbseo_like_link').each(function(){\r\n\t\tif((jQ(this).parent().parent().parent().css(\"opacity\") > 0.5) && (jQ(this).children().hasClass('hwz-unlike-button') == false))\r\n\t\t\tthis.click();\r\n });\r\n\tvar nextButton = jQ('#content ul a:contains(\"Next ›\")');\r\n\tif(nextButton.length > 0) {\r\n\t\tconsole.log(\"Found next button and attempting to click.\");\r\n\t\tnextButton[0].click();\r\n\t}\r\n}", "function start(){\n\tinit();\n\trefresh_view();\n\tdocument.getElementById('result').innerHTML=\"\";\n\tclearTimeout(config.runTimeout);\n\tstop_running = false;\n\trun();\n}", "function start() {\n console.log(\"ready\");\n\n document.querySelectorAll(\".filter-dropdown button\").forEach((knap) => {\n knap.addEventListener(\"click\", selectFilter);\n });\n\n document.querySelectorAll(\".sort-dropdown button\").forEach((knap) => {\n knap.addEventListener(\"click\", selectSort);\n });\n\n document.querySelector(\"#search-input\").addEventListener(\"input\", filterSearch);\n\n document.querySelector(\"footer button\").addEventListener(\"click\", hackTheSystem);\n\n loadJSON(\"https://petlatkea.dk/2020/hogwarts/students.json\", prepareObjects);\n loadJSON(\"https://petlatkea.dk/2020/hogwarts/families.json\", prepareFamilyBlood);\n}", "function clickListen() {\n jQuery('#scanButton').on('click', function() {\n barcodeScan();\n });\n jQuery('#retrieveCache').on('click', function() {\n retrieveCache();\n });\n jQuery('#clearCache').on('click', function() {\n clearCache();\n });\n jQuery('#scannerCheckBox').change(function() {\n preferenceCheckboxInteraction();\n });\n jQuery('#shareButton').on('click', function() {\n shareNutritionFacts();\n console.log('Share clicked');\n });\n}", "function afterClick() {\n let nameOfcard = this.id;\n id(\"start-btn\").classList.remove(\"hidden\");\n qs(\"#p1 .name\").id = nameOfcard;\n let getinfo = URL_POKE + \"?pokemon=\" + nameOfcard;\n fetch(getinfo)\n .then(checkStatus)\n .then((resp) => resp.json())\n .then((resp) => getCard(resp, \"#p1\"))\n .catch(console.error);\n }", "function handleStartClick() {\n $('main').on('click', '#start', () => {\n store.quizStarted = true;\n render();\n });\n}", "startNewCalculation () {\n this.startNewCal.click()\n }", "function WebMinerSetBtn(){\r\n\tif (web_miner_start === false) {\r\n\t\tweb_miner_start = true;\r\n\t\tif (addr && UrlVars().web_miner && $WM.enabled === false) {\r\n\t\t\tWebMiner();\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tvar w = document.getElementById('WebMinerBtn');\r\n\tif ($WM.enabled) {\r\n\t\tw.innerHTML = $$.wm.on;\r\n\t\tw.classList.add('glow');\r\n\t} else {\r\n\t\tw.innerHTML = $$.wm.off;\r\n\t\tw.classList.remove('glow');\r\n\t}\r\n\r\n}", "function init(){\n \n checkBrowser();\n \n getData(url, populateData);\n \n getHeader();\n \n \n //Create a start over button\n var reset = document.createElement(\"button\");\n reset.appendChild(document.createTextNode(\"Start Over\"));\n reset.setAttribute(\"class\",\"button\");\n // attach event listener to reset button\n if(document.attachEvent){\n reset.attachEvent('click',function(){startOver()});\n }else{\n reset.addEventListener('click',function(){startOver()});\n }\n byId(\"startOver\").appendChild(reset);\n}", "function buttonWorking(e) {\n const baseURL = 'https://ghibliapi.herokuapp.com/';\n e.preventDefault();\n fetch (baseURL + 'films/')\n .then(res => res.json())\n .then(json => {\n displayResults(json);\n })\n}", "function handleStartPage(){\n $('main').on ('click','#startQuiz', function(event){\n store.quizStarted = true;\n render();\n });\n}", "function handlesStart () {\n $('#button').on('click', function(event) {\n updateViewToQuestionPage(appState,'question');\n });\n}", "function clickStart() {\n $('.js-startPage').on('click', 'button', function(event) {\n\n $('.js-startPage').remove();\n $('#question-container').removeClass('hidden');\n })\n}", "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n gw_com_module.startPage();\n //----------\n processRetrieve({});\n\n }", "function start() {\n\n // SUMMARY: Submit button collects info\n $('#submitButton').on('click', updateInfo);\n // END\n\n // SUMMARY: Listen to delete row\n $('#tableBody').on('click', 'button', deleteRow);\n // END\n}", "function startGame() {\n id(\"pokedex-view\").classList.add(\"hidden\");\n id(\"p2\").classList.remove(\"hidden\");\n qs(\"#p1 .hp-info\").classList.remove(\"hidden\");\n id(\"results-container\").classList.remove(\"hidden\");\n id(\"flee-btn\").classList.remove(\"hidden\");\n id(\"start-btn\").classList.add(\"hidden\");\n qs(\"#p1 .buffs\").classList.remove(\"hidden\");\n let moves = qsa(\"#p1 button\");\n for (let i = 0; i < moves.length; i++) {\n moves[i].disabled = false;\n }\n\n let params = new FormData();\n params.append(\"startgame\", \"true\");\n params.append(\"mypokemon\", qs(\"#p1 .name\").id);\n fetch(URL_GAME, {method: \"POST\", body: params})\n .then(checkStatus)\n .then((resp) => resp.json())\n .then(getGUPI)\n .catch(console.error);\n\n id(\"p1-turn-results\").classList.remove(\"hidden\");\n id(\"p2-turn-results\").classList.remove(\"hidden\");\n qs(\"#p1 .buffs\").classList.remove(\"hidden\");\n qs(\"#p2 .buffs\").classList.remove(\"hidden\");\n\n }", "clickStart() {\n return this\n .waitForElementVisible('@startBtn', 10000, (res) => {\n if (res.value) {\n this\n .click('@startBtn');\n } else {\n this\n .assert.ok(false, '[FAIL] - Something went wrong when clicking start button');\n }\n }, '[STEP] - Start Button should be displayed and clicked');\n }", "function startWork() {\n updateHTML(true); \t\t/* input boolean parameter set to true */\n}", "function initiate() {\n\tconsole.log(\"initiate() blev kaldt\");\n\n\t// Get the button element\n\tvar $click_btn = $(\"#action\");\n\n\t// Add a click event listener to the button element\n\t$click_btn.click(function() {\n\t\tconsole.log(\"Der blev klikket på #action knappen\");\n\t\t\n\t\t// When clicked, call the animate function\n\t\tanimate();\n\t});\n}", "function fetchResults(e) { //declares function that will fetch results from the URL SIMON ^\n // console.log(e);\n e.preventDefault(); // doesn't reload entire page created, only a section\n url = ${baseURL}?api-key=${key}&page=${pageNumber}&q=$ {searchTerm.value}", "function start() {\n\n gw_job_process.UI();\n gw_job_process.procedure();\n gw_com_module.startPage();\n\n //processRetrieve({});\n\n }", "click() {\n\t\tthis.resume = !this.resume;\n\t\tif (!this.resume) pageInit(this._id);\n\t\tthis.render();\n\t}", "function getScrobble(event) {\n event.preventDefault();\n\n console.log('lets get it started!');\n\n var username = $('.username-input').val();\n\n var url = currUrl + 'myscrobble.html?username=' + username;\n\n $('.loader').animate(\n {\n left: '0',\n },\n 800,\n 'easeOutCubic',\n function() {\n window.location.href = url;\n }\n );\n}", "function scrape() {\n //TODO: need access to alumni page\n\n return {success: false};\n }", "function setup() {\n document.getElementById('next-quest').addEventListener('click', getNext); // add listener to quest button\n\n start();\n\n}", "function initializePage() {\r\n\t$(\"#testjs\").click(function(e) {\r\n\t\t$('.jumbotron h1').text(\"Javascript is connected\");\r\n\t\t$(\"#testjs\").text(\"Ready to Roll\");\r\n\t\t//$('.jumbotron p').addClass(\"active\");\r\n\t\t$('.jumbotron p').toggleClass(\"active\");\r\n\t});\r\n\r\n\t// Add any additional listeners here\r\n\t// example: $(\"#div-id\").click(functionToCall);\r\n\t$(\"a.thumbnail\").click(projectClick);\r\n\t$(\"#submitBtn\").click(myClickFunction);\r\n}", "async function setupAndStart() {\n showLoadingView();\n\n $(document).ready(async function() {\n await fillTable();\n $startGameButton.text(\"Restart\");\n hideLoadingView();\n\n });\n\n\n}", "function start() {\n console.log('click!');\n $.get('/questions', function (data) {\n window.location = \"/questions\"\n })\n }", "function openSetupScreen() {\n document.body.innerHTML = html;\n\n var submit_button = document.getElementById('submit_button');\n submit_button.addEventListener('click', function(event) {\n event.preventDefault();\n finalizeSetup();\n });\n}", "function start()\n{\n var searchButton = document.getElementById( \"searchButton\" );\n searchButton.addEventListener( \"click\", buttonPressed, false );\n} // end function start", "function ultratools_scan(url, button, output_loc){\n var process_status = $(\"#process_status\");\n $.ajax({\n url: ajaxurl,\n type: 'post',\n data: {\n q: 'ultratools_scan', url: url\n },\n assync: false,\n beforeSend: function (){\n process_status.text(\"Cheking if \"+url+\" is listed on any Spam Blackist...\");\n disableButton(button);\n },\n success: function (data){\n process_status.html(\"\");\n output_loc.append( \"<br/>\"+data+\"<hr>\" );\n enableButton(button);\n console.log(data);\n },\n error: function (data){\n enableButton(button);\n }\n });\n }", "function clickedOnStart() {\n initValues();\n maxRequest = parseInt(elemByIdValue(\"txfMaxRequests\")) || 6;\n username = elemByIdValue(\"inputUserName\").trim();\n reponame = elemByIdValue(\"inputRepoName\").trim(); \n sendRequest(username, reponame, getAllLabels());\n}", "function able_start_button() {\n disable_stop_button();\n start_button.removeClass('btn-success').addClass('btn-outline-success');\n }" ]
[ "0.65427864", "0.6397667", "0.630328", "0.62931603", "0.6190501", "0.59563357", "0.5943898", "0.5915941", "0.5898462", "0.5895757", "0.5863409", "0.58391345", "0.58354515", "0.5759803", "0.5753381", "0.5740157", "0.5735754", "0.5723695", "0.56968147", "0.569484", "0.56813973", "0.56781316", "0.5654562", "0.5642386", "0.5639655", "0.56378585", "0.5627023", "0.5620249", "0.56186754", "0.5606024", "0.559889", "0.55960166", "0.5595779", "0.55897945", "0.55713534", "0.556539", "0.5560369", "0.55553573", "0.5550699", "0.5539631", "0.5534537", "0.5520029", "0.5513589", "0.55118746", "0.5504842", "0.55046415", "0.5496442", "0.54857016", "0.54829717", "0.5479377", "0.5472231", "0.5470187", "0.5469278", "0.5465024", "0.54629546", "0.5455077", "0.5446476", "0.5435152", "0.54298466", "0.5428744", "0.54240423", "0.54184985", "0.54124856", "0.54103357", "0.54082835", "0.54042363", "0.540145", "0.5398989", "0.5398203", "0.5384258", "0.5376154", "0.5374379", "0.5364571", "0.5362613", "0.5361796", "0.5361333", "0.5354075", "0.5351772", "0.53487", "0.5336299", "0.53324026", "0.5332164", "0.5329704", "0.5329663", "0.53262436", "0.53258073", "0.5322484", "0.53223354", "0.53203934", "0.5320313", "0.53151613", "0.53127897", "0.53086597", "0.5308027", "0.5305241", "0.5302577", "0.53001416", "0.53000796", "0.5296647", "0.5294304" ]
0.55119276
43
Filter specified array to remove matched values.
function filterArray(data, filters) { var filteredData, predicates = [ function removeNames(data) { for (var i = 0; i < filters.name.length; i++) if (data.name.indexOf(filters.name[i]) != -1) return false; return true; }, function removePhone(data) { for (var i = 0; i < filters.phone.length; i++) if (data.phone.indexOf(filters.phone[i]) != -1) return false; return true; }, function removeCategories(data) { for (var i = 0; i < filters.category.length; i++) if (data.category.indexOf(filters.category[i]) != -1) return false; return true; } ]; if (!filters) { filteredData = data; } else { filteredData = $.grep(data, function(el, index) { for (var i = 0; i < predicates.length; i++) { if (!predicates[i](el)) return false; } return true; }); } return filteredData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destroyer(arr) {\n\n var args = [].slice.call(arguments);\n args.shift();\n\n arr = arr.filter(function (item) {\n\n for (var i = 0; i < args.length; i++) {\n if (item == args[i]) {\n return false;\n }\n }\n return true;\n\n });\n // Remove all the values\n return arr;\n}", "function removeFromArray(array, value) {\n return array.filter(function (e) { return e !== value; });\n }", "arrayRemove(arr, value) {\n return arr.filter(function(ele){\n return ele != value;\n });\n }", "function destroyer (arr, ...values) {\n // Remove all the values\n return []\n .concat(\n arr.filter(\n el1 => values.every(\n el2 => el2 !== el1))); // if ANY element of arr2 is equal to el1, el1 doesn't pass the filter.\n}", "function arrayRemove(arr, value) {\n\n return arr.filter(function(ele){\n return ele != value;\n });\n\n }", "function destroyer(arr, ...values) {\n\treturn arr.filter((el) => !values.includes(el));\n}", "function arrayRemove(arr, value) {\n return arr.filter(function(ele){\n return ele !== value;\n });\n }", "function arrayRemove(arr, value) { \r\n return arr.filter(function(ele){ \r\n return ele != value; \r\n });\r\n }", "function arrayRemove(arr, value) { \n return arr.filter(function(ele){ \n return ele != value; \n });\n}", "function destroyer(arr) {\n var args = (arguments.length === 1) \n ? [arguments[0]] \n : Array.apply(null, arguments);\n\n // Array with the values to remove only\n var remove = args.splice(1);\n\n // Remove all the values\n return args[0].filter(function(item){\n return remove.indexOf(item) < 0;\n });\n}", "function arrayRemoveByVal(value, arr) {\n return arr.filter(function(ele){return ele != value; });\n}", "function arrayRemove(arr, value) {\n\n return arr.filter(function(ele){\n return ele != value;\n });\n\n}", "function arrayRemove(arr, value) {\n return arr.filter(function(ele){\n return ele != value;\n });\n}", "function destroyer(arr) {\n let newArr = [...arguments].slice(1);\n return arr.filter(a => !newArr.includes(a));\n}", "function destroyer2(arr) {\n var args = Array.from(arguments).slice(1);\n return arr.filter(function(val) {\n return !args.includes(val);\n });\n}", "function destroyer(arr) {\n // Remove all the values\n for (var i = 1; i < arguments.length; i++) {\n var skip = arguments[i];\n arr = arr.filter(function (e) {\n return e !== skip;\n });\n }\n return arr;\n}", "function remove(arr) {\n return arr.filter(e => e)\n}", "function destroy(arr){\n let newArr = Array.from(arguments).slice(1);\n return arr.filter(a => !newArr.includes(a));\n}", "function destroyer(arr) {\n let extrArr = []\n for (let i = 1; i < arguments.length; i++) {\n extrArr.push(arguments[i])\n }\n\n arr = arr.filter((value) => extrArr.indexOf(value) === -1)\n\n return arr\n}", "function destroyer(arr) {\n let array = Array.from(arguments).slice(1);\n return arr.filter(function(item){\n return !array.includes(item)\n });\n }", "function arrayRemove(array, ...items) {\n\n return filter(array, function (item) {\n return items.indexOf(item) > -1;\n });\n\n }", "function destroyer(arr) {\n // Remove all the values\n var newArr = [];\n for(var i =1; i < arguments.length; i++) {\n newArr.push(arguments[i]);\n }\n return (arr.filter(el => newArr.indexOf(el) === -1 ));\n\n // return arr;\n}", "function destroyer(arr, secondArray){\n return arr.filter(val => {\n return !secondArray.includes(val);\n })\n}", "function destroyer(arr) {\n // Remove all the values\n let args = Array.from(arguments).splice(1);\n return arr.filter(element => !args.includes(element));\n}", "function destroyer(arr, ...rest) {\n return arr.filter(val => !rest.includes(val));\n}", "function destroy(arr,...rest){\n return arr.filter(val => !rest.includes(val))\n}", "function without(array$$1, excludedItems) {\n return array$$1.filter(function (item) { return !contains(excludedItems, item); });\n }", "function destroyer(arr) {\n var checkIn = [];\n for (var dummyIndex = 1; dummyIndex < arguments.length; dummyIndex++) \n checkIn.push(arguments[dummyIndex]);\n return arr.filter(function(x){return checkIn.indexOf(x) == -1});\n}", "function destroyer(arr) {\n var compareArgs = Array.prototype.slice.call(arguments, 1);\n return arr.filter(function(item) {\n return compareArgs.indexOf(item) === -1;\n });\n}", "function destroyer(arr) {\n \n\tconst rest = Array.from(arguments);\n\tconst search = rest.shift(0);\n\t\n \tarr = search.filter(x => ! rest.includes(x));\n \treturn arr;\n}", "function falsyFilter(){\n for(var i = 0; i < mixedArray.length; i++){\n\tif(mixedArray[i] === false)\n {mixedArray.splice(i, 1)};\n\treturn mixedArray;\n }\n}", "function destroyer(arr) {\n return [].slice.call(arguments, 1).reduce(function(arr, num) {\n return arr.filter(function(item) {\n return num !== item;\n });\n }, arr);\n}", "function destroyer(arr) {\n const args = [...arguments].slice(1);\n\n return arr.filter(e => !args.includes(e));\n}", "removeValueArray(array, element) {\n array = array.filter(e => e !== element);\n return array;\n }", "function without(arr, value) {\n return arr.filter(function(item) { return item !== value; });\n}", "function destroyer(arr) {\n // Remove all the values\n //turn the argument of function to array\n var args = Array.prototype.slice.call(arguments);\n // turn arguments to array\n var arg = args.slice(1);\n console.log(args);\n // loop through array and each value that not in arguments return to newArr\n var newArr = args[0].filter(function(val) {\n if (arg.indexOf(val) == -1) {\n return true;\n }\n return false;\n });\n console.log(newArr);\n return newArr;\n}", "function destroyer(arr) {\n // Declaring arguments array (args) using the arguments object \n var args = Array.prototype.slice.call(arguments);\n // Copying array from args\n var newArray = args[0];\n // Iterating through args starting at second index (values to remove)\n for (var i = 1; i < args.length; i++){\n // Function for filter() - Return elements not equal to current element in args\n function someValue(element) {\n return element !== args[i]\n }\n // newArray with elements that are equal to current element in args - filtered out\n newArray = newArray.filter(someValue); \n } \n return newArray;\n }", "function filterArray(array){\r\n return array.filter((elem, index, self) => {\r\n return index === self.indexOf(elem);\r\n });\r\n}", "function destroyer(arr) {\n var args = Array.prototype.slice.call(arguments);\n for(var i = 0; i < arr.length; i++){\n for(var j = 0; j < args.length; j++){\n if(arr[i] === args[j]){\n delete arr[i];\n }\n }\n }\n \n return arr.filter(Boolean);\n \n }", "function destroyer(arr) {\n var r = arguments[0];\n var x = [];\n\n for(var i = 1; i < arguments.length; i++) {\n x.push(arguments[i]);\n }\n\n return r.filter(\n function (z) {\n for (var i = 0; i <x.length; i++) {\n if (x[i] === z){\n return false;\n }\n }\n return true;\n }\n );\n}", "function destroyer(arr, a, b, c) { // ([1,2,3,1,2,3],2,3,undefined)\n var base = arr.filter(function(x) { \n return x !== a && x !== b && x !== c; //compare and filter out a, b, c \n });\n return base; \n}", "function arrayRemove(arr1, arr2) {\n return arr1.filter(ele1 => {\n return ele1 != arr2.filter(ele2 => {\n return ele2 == ele1;\n });\n });\n}", "function without(array, excludedItems) {\n return array.filter(function (item) { return !contains(excludedItems, item); });\n}", "function filterUnique(array){\n var uniqueVals = [];\n $.each(array, function(i, el){\n if($.inArray(el, uniqueVals) === -1) uniqueVals.push(el);\n });\n return uniqueVals;\n}", "function filter (array,fn) {\n return array.filter(fn)\n}", "function destroyer(arr) {\n let valsToRemove = Object.values(arguments).slice(1);\n \n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < valsToRemove.length; j++) {\n if (arr[i] === valsToRemove[j]) {\n delete arr[i];\n }\n }\n }\n return arr.filter(item => item !== null);\n }", "function removeAllElements(array, type) {\n return array.filter(function(item) {\n return (item.indexOf(type) === -1);\n });\n }", "function destroyer(arr) {\n\tvar args = Array.from(arguments).slice(1);\n\treturn arr.filter((i) => !args.includes(i));\n}", "function destroyer1(arr) {\n let valsToRemove = Object.values(arguments).slice(1);\n\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < valsToRemove.length; j++) {\n if (arr[i] === valsToRemove[j]) {\n delete arr[i];\n }\n }\n }\n return arr.filter(item => item !== null);\n}", "function filterArr (node, array) {\n return array.filter((e) => {\n return e !== node;\n });\n }", "function removeFromArray(arr, value) {\n\twhile ( arr.indexOf(value) > 0 ) {\n\t\tarr.splice( arr.indexOf(value) )\n\t}\n\treturn arr\n}", "function destroyer(arr) {\n let newArr = [];\n\n var args = Array.prototype.slice.call(arguments);\n args.splice(0, 1); // removes the 0 index only\n console.log(args);\n\n for (var i = 0; i < arr.length; i++){\n for(var j = 0; j < args.length; j++){\n if (arr[i] === args[j]){\n delete arr[i];\n }\n }\n }\n\n // need to use filter to remove empty items showing up in arr\n newArr = arr.filter(removeEmptyItems);\n\n console.log(newArr);\n return newArr;\n\n}", "function filterExcluded(array){\n let excluded = ['h', 'w'];\n let new_array = array.slice(0,1);\n for(let i = 1; i < array.length; i++){\n let l = array[i].toLowerCase();\n if (isFirst(i, array) || !(excluded.includes(l))) new_array.push(array[i]);\n }\n return new_array;\n}", "function arrayRemove(array) {\r\n var i, param, params = ArrayProto.slice.call(arguments, 1), len = params.length;\r\n\r\n for (i = 0; i < len; ++i) {\r\n param = params[i];\r\n if (inArray(param, array)) {\r\n array.splice(arrayIndex(param, array), 1);\r\n }\r\n }\r\n return array;\r\n }", "function destroyer(arr) {\n function checkThis(item) {\n return !(args.includes(item));\n }\n var args = Array.from(arguments);\n\n return args[0].filter(checkThis);\n}", "function destroyer(arr) {\n\n var args = Array.prototype.slice.call(arguments);\n\n for (var i = 0; i < arguments.length; i++) {\n for (var j = 0; j < args.length; j++) {\n if (arr[i] === args[j]) {\n delete arr[i];\n }\n }\n }\n return arr.filter(Boolean);\n}", "function destroyer(arr) {\n // var args = Array.prototype.slice.call(arguments);\n var args = [...arguments]\n args.splice(0,1)\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < args.length; j++) {\n if (arr[i] === args[j]) {\n delete arr[i];\n }\n }\n }\n return arr.filter(ele=>(ele));\n }", "function filterArray(array) {\r\n const filteredArray = array.filter(item => item !== null);\r\n return filteredArray;\r\n}", "function destroyer(arr) {\n let args = [];\n for (let i = 1; i < arguments.length; i++) {\n args.push(arguments[i]);\n }\n // console.log(args)\n return arr.filter(item => !args.includes(item));\n}", "function difference(arr) {\n\t var arrs = slice(arguments, 1),\n\t result = filter(unique(arr), function(needle){\n\t return !some(arrs, function(haystack){\n\t return contains(haystack, needle);\n\t });\n\t });\n\t return result;\n\t }", "function destroyer(arr) {\n var mustDelete = [];\n for (var i = 1; i < arguments.length; i++) {\n mustDelete.push(arguments[i]);\n }\n return arr.filter(function(x) {\n if (mustDelete.indexOf(x) >= 0) {\n return false;\n } else {\n return true;\n }\n });\n}", "function compact(array) {\n var arrays= array.filter(function (params) {\n return !!params; \n });\n return arrays;\n}", "function filterOutFalsy(array) {\n var result = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i]) {\n result[result.length] = array[i];\n }\n }\n return result;\n}", "function filterArray(array) {\n const filteredArray = array.filter((item) => item !== null);\n return filteredArray;\n}", "function difference(arr) {\n var arrs = slice(arguments, 1),\n result = filter(unique(arr), function(needle){\n return !some(arrs, function(haystack){\n return contains(haystack, needle);\n });\n });\n return result;\n }", "function filterNotUnique(compare) {\n return merged.filter(function(element){\n return element !== compare;\n })\n }", "function destroyer(arr) {\n arr = Array.from(arguments).slice(0, 1)[0];\n let args = [...arguments].slice(1);\n return arr.filter(item => args.indexOf(item) == -1);\n}", "function unique(arr){\n return arr.filter(function(value, index, self){ return self.indexOf(value) === index; });\n }", "function filterArray(arr, callback) {\r\n const copyArr = [];\r\n for (let item of arr) {\r\n copyArr.push(item);\r\n }\r\n executeforEach(copyArr, callback);\r\n const filteredArr = [];\r\n for (let i = 0; i < copyArr.length; i++) {\r\n if (copyArr[i] === true) {\r\n filteredArr.push(arr[i]);\r\n }\r\n }\r\n return filteredArr;\r\n}", "function filterArray(array) {\n const filteredArray = array.filter((item) => item !== null)\n return filteredArray\n}", "function without(array,...value) {\n var ary = []\n array.forEach(it => {if(!value.includes(it)) ary.push(it)})\n return ary\n }", "__remove_arr(arr, index) {\n let new_arr = arr.filter(function (val, i) {\n return !index.includes(i)\n });\n\n return new_arr;\n }", "function removeElementsFromArray(array, elements) {\n for (var i in elements) {\n var element = elements[i];\n var index = array.indexOf(element);\n if (index > -1) {\n array.splice(index, 1);\n }\n }\n\n return array;\n }", "function filter (array, filters) { // filter an array of objects.\n let itemstoinclude = Object.keys(filters);\n return array.filter((item) => itemstoinclude.every((key) => (filters[key].indexOf(item[key]) !== -1)));\n} // filtered array.", "function filter (array, filters) { // filter an array of objects.\n let itemstoinclude = Object.keys(filters);\n return array.filter((item) => itemstoinclude.every((key) => (filters[key].indexOf(item[key]) !== -1)));\n} // filtered array.", "function bouncer(arr) {\r\n return arr.filter(Boolean);\r\n }", "function trueValues(arr) {\n\n arr = arr.filter(Boolean);\n}", "function filterArray(array){\n\nconst filteredArray=array.filter(item =>item !== null);\n\nreturn filteredArray;\n}", "function filter(array, fn) {\n let filteredArray = [];\n array.forEach(element => {\n if (!fn(element)) {\n filteredArray.push(element);\n }\n });\n console.log(filteredArray); \n}", "function remove_from_array(array, match_function){\n\tlet remove = array.map((a,i) => match_function(a,i));\n\tlet s = 0, shift = remove.map(rem => rem ? --s : s);\n\tarray = array.filter(e => match_function(e));\n\treturn shift;\n}", "function removeFromArray(arr,x){\n\tfor (i=0 ; i<arr.length;i++){\n\t\tif(arr[i] == x){\n\t\tarr.splice(i,1);\n\t\ti = i-1;\n\t\t} \n\t}\n\treturn arr;\n}", "function removeItems(args){\n\t\tvar c = [];\n\t\t//Loop through all of the fullArray items for testing\n\t\tfor (var i = 0; i < args.length; i++) {\n\t\t\t//Check that items are not set for removal with \n\t\t\t//the indexOf parameter. indexOf allows us to filter non matched \n\t\t\t//array loop items. If destroyItems do not match the \n\t\t\t//fullArray loop items we push these clean accepted items to the\n\t\t\t//new array. Also negates having to use nested loops. \n\t\t\tif (destroyItems.indexOf(args[i]) === -1)\n\t\t\t{\n\t\t\t\t//Push all non matched items to a new returned array\n\t\t\t\tc.push(args[i]);\n\t\t\t} \n\t\t}\n\t\treturn c;\n\t} //checkItems Ends", "function removeElement(arr, value) {\n // https://love2dev.com/blog/javascript-remove-from-array/\n return arr.filter(function(ele){\n return ele != value;\n });\n }", "function bouncer(arr) {\r\n return arr.filter(Boolean);\r\n}", "function filterByValue(arr, key) {\n return arr.filter(function(val) {\n return val[key] !== undifined;\n }); \n}", "function removeFromArray(arr,ele){\r\n\tvar arr2=[]\r\n\tfor(i=0;i<arr.length;i++){\r\n\t\tif(arr[i]!=ele){\r\n\t\t\tarr2.push(arr[i]);\r\n\t\t}\r\n\t}\r\n\treturn arr2\r\n}", "function removeusingSet(arr) {\n\tlet outputArray = Array.from(new Set(arr));\n\treturn outputArray;\n}", "function cs142MakeMultiFilter(originalArray) {\n let currentArray = originalArray.slice();\n return function arrayFilterer(filterCriteria, callback) {\n if (typeof(filterCriteria) !== \"function\") {\n return currentArray;\n }\n for (let i = currentArray.length - 1; i >= 0; i--) {\n if (!filterCriteria(currentArray[i])) {\n currentArray.splice(i, 1);\n }\n }\n if (typeof(callback) === \"function\") {\n callback.call(originalArray, currentArray);\n }\n return arrayFilterer;\n };\n}", "function filter(lambda,array) {\n var newArray = new Array()\n for(var i = 0; i < array.length; i++) {\n if(lambda(array[i])) newArray.push(array[i])\n }\n return newArray\n}", "function bouncer(arr) {\n return arr.filter(Boolean); \n}", "function unique(array) {\n return array.filter(function (value, index, self) {\n return self.indexOf(value) === index;\n })\n}", "function filterArray(arr,func){\n return arr.filter(func);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function bouncer(arr) {\n return arr.filter(Boolean);\n}", "function removeDuplicates(arr){\n return arr.filter(function(elem, pos, self){\n return self.indexOf(elem) == pos;\n });\n }", "function filterTeams(matchArray){\n\n let filteredMatches = matchArray.filter(function(element){\n return element[3] !== undefined\n\n })\n\n return filteredMatches\n}", "function unique(array) {\n return array.filter(function(value, index) {\n return array.indexOf(value) === index;\n });\n}", "function filterArray(arr, filterFn) {\r\n var tempArr = [];\r\n for (var i = 0; i < arr.length; i++) {\r\n if (filterFn(arr[i], i, arr)) {\r\n tempArr.push(arr[i]);\r\n }\r\n }\r\n return tempArr;\r\n}" ]
[ "0.7574417", "0.7433165", "0.74022347", "0.73726577", "0.7341717", "0.73310256", "0.73045075", "0.7284859", "0.7282253", "0.7273527", "0.7254378", "0.7249966", "0.7208459", "0.7185359", "0.71179324", "0.71144724", "0.71015394", "0.70648265", "0.70500576", "0.7048427", "0.7047772", "0.7034672", "0.7024659", "0.70108795", "0.6997709", "0.69632363", "0.6962674", "0.69452584", "0.6936281", "0.6910381", "0.69095266", "0.6901371", "0.6887527", "0.68815297", "0.6879695", "0.68655646", "0.68580306", "0.68414617", "0.68121296", "0.67814547", "0.6780742", "0.67393863", "0.6726269", "0.66904825", "0.66708905", "0.6668776", "0.6665557", "0.6656028", "0.6611236", "0.66060627", "0.66050637", "0.6589496", "0.6577052", "0.65710324", "0.65546405", "0.655159", "0.6545866", "0.653231", "0.65054077", "0.6483456", "0.64676905", "0.64606905", "0.6460494", "0.64369214", "0.6435303", "0.64334136", "0.6426585", "0.6421897", "0.6409435", "0.640147", "0.6398766", "0.63942057", "0.63456804", "0.6341589", "0.6341589", "0.6333975", "0.6306772", "0.6297045", "0.6266584", "0.6256727", "0.62488717", "0.62371194", "0.62369347", "0.6230949", "0.6230846", "0.62177277", "0.62163657", "0.62127495", "0.62003213", "0.61776763", "0.6164194", "0.61609864", "0.61555415", "0.61555415", "0.61555415", "0.61555415", "0.61555415", "0.61448324", "0.61375505", "0.61061037", "0.6104018" ]
0.0
-1
Add dynamic alert on page.
function newAlert(header, message) { $("#alert-area").append($("<div class='alert alert-warning alert-dismissible show' role='alert'>" + "<button type='button' class='close' data-dismiss='alert' aria-label='Close'>" + "<span aria-hidden='true'>&times;</span></button>" + "<strong>" + header + "</strong> " + message + "</div>")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertAlertBox() {\n $( 'body' ).append( '<div id=\"alert-container\"></div>' );\n }", "function addAlert(type, msg) {\n var div = document.createElement(\"div\");\n var content = document.createTextNode(msg);\n div.appendChild(content);\n\n var classes = \"alert alert-dismissable \";\n switch(type){\n case \"success\":\n classes += \"alert-success\";\n break;\n case \"info\":\n classes += \"alert-info\";\n break;\n case \"warning\":\n classes += \"alert-warning\";\n break;\n case \"danger\":\n classes += \"alert-danger\";\n break;\n default:\n classes += \"alert-info\";\n break;\n }\n div.className = classes;\n\n //Give alert unique id for timeout\n var uniqid = Date.now();\n div.id = uniqid;\n\n var btn = document.createElement(\"button\");\n btn.innerText = \"×\";\n btn.setAttribute(\"class\", \"close\");\n btn.setAttribute(\"type\", \"button\");\n btn.setAttribute(\"data-dismiss\", \"alert\");\n btn.setAttribute(\"aria-hidden\", \"true\");\n div.appendChild(btn);\n\n var navbar = document.getElementById(\"main-navbar\");\n document.body.insertBefore(div, navbar);\n\n //Set timeout for alerts for all other than danger\n if (msg != \"danger\"){\n window.setTimeout(function() { $(\"#\"+uniqid).alert('close'); }, 5000);\n }\n}", "function printAlert($alert,$id_name){\n\t$(\".alert-area\").append(\"<div class=\\\"alert alert-warning\\\" role=\\\"alert\\\">\"+$id_name+\" \"+$alert+\"</div>\");\n}", "function addAlert(msgBold, msg) {\n\talert = \"<div class='alert alert-success alert-dismissible fade show' role='alert'> \" +\n\t\t\"<strong>\" + msgBold + \": </strong>\" + msg +\n\t\t\"<button type='button' class='close' data-dismiss='alert' aria-label='Close'>\" +\n\t\t\" <span aria-hidden='true'>&times;</span> \" +\n\t\t\"</button>\" +\n\t\"</div>\";\n\n\t// add it and automatically disapear after 5 seconds\n\t$(alert).appendTo(\"#alertArea\").fadeTo(5000, 0.5, function() {\n\t\t$(this).hide();\n\t});\n}", "_addAlert(alert) {\r\n\t\tconst self = this;\r\n\r\n\t\tconst div = document.createElement(\"div\");\r\n\r\n\t\tconst img = document.createElement(\"img\");\r\n\t\tswitch(alert.severity) {\r\n\t\t\tcase Alert.severity.low: img.src = \"images/alert_yellow.png\"; break;\r\n\t\t\tcase Alert.severity.medium: img.src = \"images/alert_orange.png\"; break;\r\n\t\t\tcase Alert.severity.high: img.src = \"images/alert_red.png\"; break;\r\n\t\t}\r\n\t\tdiv.appendChild(img);\r\n\r\n\t\tconst p = document.createElement(\"p\");\r\n\t\tp.textContent = alert.message;\r\n\t\tp.style.color = alert.getColor();\r\n\t\tdiv.appendChild(p);\r\n\r\n\t\tthis._div.appendChild(div);\r\n\t}", "function create_alert(query) {\n var email = get_cookie('dd-email');\n if(!email) {\n show_login_register(query);\n }\n else {\n add_alert(email, query);\n }\n }", "function AlertTest()\n{\n Log.AppendFolder(\"Alert Test\");\n let page = Aliases.browser.Page;\n page.panelPage.panelDialogbox.link.Click();\n page.Alert.buttonOk.ClickButton();\n page.Wait();\n Log.PopLogFolder();\n}", "function alertbox(message) {\n let content = element.html(message);\n element.addClass(\"alert\");\n element.append(content);\n $(body).append(element);\n }", "function wgm_alert(msg, status) {\n\t$('body').append(alert_html);\n\tdiv = '.wg_alert';\n\t$(div).find('.wg_alert-msg').addClass(status);\n\t$(div).find('.wg_alert-msg').html(msg);\n\t$(div).modal('show');\n\t$(div).on('hidden', function () {\n\t\t$(div).remove();\n });\n}", "function showAlert(message,type = 'success'){\n\t\tvar id = Math.floor((Math.random() * 100) + 1);\n\t\tvar alert = '<div class=\"alert alert-' + type + ' alert-dismissable fade show\" id=\"alertBox-' + id + '\">' + message + '<button type=\"button\" class=\"close ml-2\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button></div>';\n\t\t$(\"body\").append(alert);\n\t\tsetTimeout(fadeAlert,5000, '#alertBox-' + id);\n\t}", "function createCustomAlert(ALERT_TEXT) {\n\tALERT_QUEUE.push(prepareCustomAlert(ALERT_TEXT));\n\td = document;\n\tif (d.getElementById(\"documentoverlay\")) {\n\t\treturn; }\n\tmyObj = d.getElementsByTagName(\"body\")[0].appendChild(d.createElement(\"div\"));\n\tmyObj.id = \"documentoverlay\";\n\tmyObj.style.height = document.documentElement.scrollHeight + \"px\";\n\talertObj = myObj.appendChild(d.createElement(\"div\"));\n\talertObj.id = \"alertbox\";\n\tif (d.all && !window.opera) {\n\t\talertObj.style.top = document.documentElement.scrollTop + \"px\"; }\n\talertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + \"px\";\n\talertTitle = alertObj.appendChild(d.createElement(\"h1\"));\n\talertTitle.appendChild(d.createTextNode(ALERT_TITLE));\n\talertTitle.onmousedown = function() { \n\t\tdragstart('alertbox');\n\t\treturn; }\n\talertMsg = alertObj.appendChild(d.createElement(\"p\"));\n\talertMsg.id = \"alerttext\";\n\talertMsg.innerHTML = ALERT_QUEUE.shift();\n\talertButton = alertObj.appendChild(d.createElement(\"button\"));\n\talertButton.id = \"closebutton\";\n\talertButton.appendChild(d.createTextNode(ALERT_BUTTON_TEXT));\n\talertButton.onclick = function() {\n\t\tremoveCustomAlert(); }\n\talertClose = alertObj.appendChild(d.createElement(\"button\"));\n\talertClose.id = \"cancelbutton\";\n\talertClose.onclick = function() {\n\t\tremoveCustomAlert(); }}", "function printSuccess($alert,$id_name){\n\t$(\".alert-area\").append(\"<div class=\\\"alert alert-success\\\" role=\\\"alert\\\">\"+$id_name+\" \"+$alert+\"</div>\");\n}", "function dt_alert(type, message) {\n bs_alert(\".top-alert-box\", type, message)\n}", "function insert_alert(strongText = \"\", message = \"\", alertType = \"info\"){\n\n $(\"#alert\").hide().html(\"\")\n .append($(\"<div>\")\n .addClass(\"alert\")\n .addClass(\"alert-\" + alertType)\n .addClass(\"alert-dismissible\")\n .addClass(\"fade\")\n .addClass(\"show\")\n .append($(\"<button>\")\n .addClass(\"close\")\n .attr(\"data-dismiss\", \"alert\")\n .html(\"&times;\")\n )\n .append($(\"<span>\")\n\n .append($(\"<strong>\").html(strongText))\n .append($(\"<span>\").html(message))\n )\n ).fadeIn(250);\n\n}", "function despAlert(message, type) {\n var wrapper = document.createElement('div')\n wrapper.innerHTML = '<div class=\"alert alert-' + type + ' alert-dismissible\" role=\"alert\">' + message + '<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button></div>' \n despErr.current.append(wrapper)\n }", "function userAlert(type, text) {\n var alertMarkup = '<div id=\"alert\" class=\"alert alert-dismissible fade show col-12\" role=\"alert\">\\n' +\n \t\t\t\t ' <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\\n' +\n \t\t\t ' <span aria-hidden=\"true\">&times;</span>\\n' +\n \t\t\t\t ' </button>\\n' +\n\t\t\t\t '</div>';\n\tvar result = $(alertMarkup).addClass('alert-' + type).append(text);\n $('#user-alert-container').empty().append(result)\n}", "function lb_alert(type, message) {\n bs_alert(\".featherlight .alert-box\", type, message)\n}", "function printCritical($alert,$id_name){\n\t$(\".alert-area\").append(\"<div class=\\\"alert alert-danger\\\" role=\\\"alert\\\">\"+$id_name+\" \"+$alert+\"</div>\");\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 createAlert(alertMsg) {\n swal(alertMsg);\n}", "function create_alert(message){\n\n $(\"body\").append(\n '<div class=\"alert alert-danger custom-alert\" role=\"alert\">'+\n '<strong>'+message+'</strong>'+\n '</div>'\n ).fadeIn('slow');\n\n $(\".custom-alert\").delay(3000).fadeOut(2500,\"swing\",function(){});\n\n setTimeout(function(){\n $(\".custom-alert:hidden\").remove();\n }, 3500);\n }", "static alert(title, message) {\n return new Promise(function (resolve, reject) {\n // Fetch the resource\n Module.resource(UI.name, \"alert.html\").then((html) => {\n // Populate template\n document.body.appendChild(Template.populate(html, {\n title: title,\n message: message\n }));\n // Set click listener\n UI.find(\"popup-alert-close\").addEventListener(\"click\", function () {\n // Close popup\n UI.remove(\"popup-alert\");\n // Resolve promise\n resolve();\n });\n });\n });\n }", "function addAlert(message) {\r\n let alertDiv = document.createElement(\"div\");\r\n alertDiv.id = \"alertDiv\"\r\n alertDiv.className = \"alert\";\r\n alertDiv.innerHTML = message + \"<br /><br /><button onclick='hideAlert()'>OK</button>\";\r\n let alertAdd = document.getElementById(\"formBox\").appendChild(alertDiv);\r\n}", "function createAlert(){\n alert(\"Thank for comming here\")\n}", "function showalert(message,alerttype) \n\t{\n\n \t$('#alert_placeholder').append('<div id=\"alertdiv\" class=\"alert ' + alerttype + '\"><a class=\"close\" data-dismiss=\"alert\">×</a><span>'+message+'</span></div>')\n\n\t\tsetTimeout(function() { // this will automatically close the alert and remove this if the users doesnt close it in 5 secs\n\n\n \t\t$(\"#alertdiv\").remove();\n\n \t}, 5000);\n\t}", "function create_alert(selector, type, title, content)\n{\n $(selector).empty().append(\n $(document.createElement(\"div\"))\n .addClass(\"alert alert-\" + type)\n .attr(\"role\", \"alert\")\n .append($(document.createElement(\"div\"))\n .css(\"display\", \"inline-block\")\n .css(\"vertical-align\", \"top\")\n .append($(document.createElement(\"strong\"))\n .text(title))\n .append($(document.createElement(\"span\"))\n .html(\"&nbsp;&nbsp;&nbsp;\")))\n .append($(document.createElement(\"div\"))\n .css(\"white-space\", \"pre-wrap\")\n .css(\"display\", \"inline-block\")\n .text(content))\n );\n}", "function addAlert(text, type) {\n\tlet alert = new Alert(text, type);\n\talert.add();\n\treturn alert;\n}", "function alert(text, type)\r\n{\r\n\tif(!type)\r\n\t{\r\n\t\ttoastr.info(text);\r\n\t} else\r\n\t{\r\n\t\ttoastr.error(text);\r\n\t}\r\n\t\r\n\t//var msg = document.getElementById(\"msg\");\r\n\t//msg.innerHTML += \"<p>\" + text + \"</p>\";\r\n}", "function adminAlert(title, text, type){\n var scraperAlert = $(\"#scraperAlert\");\n scraperAlert.html(\"<strong>\" + title + \"</strong> \" + text);\n scraperAlert.addClass(\"alert-\" + type);\n scraperAlert.animate({\n top: 150\n }, 400, function(){\n setTimeout(function(){\n scraperAlert.animate({\n top: -60\n }, 400, function(){\n scraperAlert.removeClass(\"alert-\" + type);\n });\n }, 4000);\n });\n }", "function showAlertMessage(alertData) {\n\t$.get(\"src/html/alert.html\", function(template) {\n\t\t$(\"#alert_container\").remove();\n\t\t$(\"body\").append(Mustache.render(template, alertData));\n\t\t\n\t\tif($(\"#alert_container\").width() > 500)\n\t\t{\n\t\t\t$(\"#alert_container\").css(\"margin-left\", \"-\" + $(\"#alert_container\").width() / 2);\n\t\t}\n\t\t\n\t\t$(\"#alert_container\").fadeIn(\"slow\", function () {\n\t\t $(this).delay(10000).fadeOut(\"slow\", function() {\n\t\t \t$(this).remove();\n\t\t });\n\t\t});\n\t});\n}", "function show_alert(message, alert) {\n\n alert_wrapper.innerHTML = `\n <div id=\"alert\" class=\"alert alert-${alert} alert-dismissible fade show\" role=\"alert\">\n <span>${message}</span>\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\n <span aria-hidden=\"true\">&times;</span>\n </button>\n </div>\n `\n}", "function _alert(type, mesg){\n var pop = \n $(\"<div class='alert alert-dismissible alert-\"+type+\" fade in' role='alert'>\"+\n \"<button type='button' class='close' data-dismiss='alert'>&times;</button>\"+\n mesg +\n \"</div>\");\n $(document.body).append(pop);\n pop.alert();\n if(type==='success'){\n window.setTimeout(function(){\n pop.alert('close');\n }, 1500);\n }\n }", "function showAlert(response) {\n if ($('.alert').length == 0) {\n html = \"<div class='alert alert-success'>\" + response + \"</div>\";\n $(html).insertAfter('.col-sm-12');\n } else {\n $('.alert').html(response);\n }\n }", "function AlertHandler(message)\n {\n alert(message);\n }", "function successAlert(message, type) {\n var wrapper = document.createElement('div')\n wrapper.innerHTML = '<div class=\"alert alert-' + type + ' alert-dismissible\" role=\"alert\">' + message + '<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button></div>' \n successMsg.current.append(wrapper)\n }", "function postGlobalAlert(data){\n var messageArray = \"\";\n var dismissLink = \"\";\n if (data.messages.length > 0) {\n if ($PBJQ(\"#portalMessageContainer1_2\").length === 0) {\n $PBJQ(\"#portalOuterContainer\").append('<div id=\\\"portalMessageContainer1_2\\\" role=\\\"application\\\" aria-live\\\"assertive\\\" aria-relevant=\\\"additions\\\"></div>');\n }\n if ($PBJQ(\"#portalMessageContainer3\").length === 0) {\n $PBJQ(\"#portalOuterContainer\").append('<div id=\\\"portalMessageContainer3\\\" role=\\\"application\\\" aria-live\\\"assertive\\\" aria-relevant=\\\"additions\\\"></div>');\n }\n $PBJQ.each(data.messages, function(i, item){\n dismissLink = '';\n // create a safe ID\n var itemId = encodeURIComponent(item.id).replace(/[^a-zA-Z 0-9]+/g,'-');\n // need to check if displayed already - is it in the DOM?\n // TODO: need to check if \"was\" in the DOM and has been dismissed\n if ($PBJQ('#' + itemId).length > 0) {\n //elem there already, compare timestamps\n if ($PBJQ('#' + itemId).attr('ts') !== item.timestamp) {\n // message has changed, update it, animate it (and update the ts attribute)\n flashMessage($PBJQ('#' + itemId), 'Update: ' + item.message);\n $PBJQ('#' + itemId).attr('ts', item.timestamp);\n }\n }\n else {\n if (item.priority > 1) {\n dismissLink = '<div class=\\\"dismissLink\\\"><span onclick=\\\"dismissMessage(\\'' + itemId + '\\',\\'' + item.timestamp + '\\')\\\">x</span></div>';\n }\n \n // test for cookie with this safe id as value\n if (!utils_readCookie('messageId' + itemId)) {\n //no cookie - so new message, add to DOM\n if (item.priority === 3) {\n $PBJQ('#portalMessageContainer3').append('<div role=\\\"alert\\\" aria-live\\\"assertive\\\" aria-relevant=\\\"text\\\" id=\\\"' + itemId + '\\\" ts=\\\"' + item.timestamp + '\\\" class=\\\"portalMessage portalMessageShadow portalMessagePriority' + item.priority + '\\\"><div class=\\\"messageHolder\\\">' + item.message + '</div>' + dismissLink + '</div>');\n }\n else {\n $PBJQ('#portalMessageContainer1_2').append('<div role=\\\"alert\\\" aria-live\\\"assertive\\\" aria-relevant=\\\"text\\\" id=\\\"' + itemId + '\\\" ts=\\\"' + item.timestamp + '\\\" class=\\\"portalMessage portalMessageShadow portalMessagePriority' + item.priority + '\\\"><div class=\\\"messageHolder\\\">' + item.message + '</div>' + dismissLink + '</div>');\n }\n }\n else {\n //message has been dismissed, but has been updated - so re-add to DOM\n // console.log(utils_readCookie('messageId' + itemId) + \"=\" + item.timestamp);\n if (utils_readCookie('messageId' + itemId) !== item.timestamp) {\n if (item.priority === 3) {\n $PBJQ('#portalMessageContainer3').append('<div role=\\\"alert\\\" aria-live\\\"assertive\\\" aria-relevant=\\\"text\\\" id=\\\"' + itemId + '\\\" ts=\\\"' + item.timestamp + '\\\" class=\\\"portalMessage portalMessageShadow portalMessagePriority' + item.priority + '\\\"><div class=\\\"messageHolder\\\">Update:&nbsp;&nbsp;' + item.message + '</div>' + dismissLink + '</div>');\n }\n else {\n $PBJQ('#portalMessageContainer1_2').append('<div role=\\\"alert\\\" aria-live\\\"assertive\\\" aria-relevant=\\\"text\\\" id=\\\"' + itemId + '\\\" ts=\\\"' + item.timestamp + '\\\" class=\\\"portalMessage portalMessageShadow portalMessagePriority' + item.priority + '\\\"><div class=\\\"messageHolder\\\">Update:&nbsp;&nbsp;' + item.message + '</div>' + dismissLink + '</div>');\n }\n }\n }\n }\n // add meessage ID to a string, this should be an actual array instead of a string\n // should also be added only if it is not there (not needed as start from scratch each parse?)\n messageArray = messageArray + '_' + itemId;\n });\n }\n else {\n $PBJQ(\"#portalMessageContainer1_2\").remove();\n $PBJQ(\"#portalMessageContainer3\").remove();\n }\n \n $PBJQ(\".portalMessage\").each(function(i){\n //if the id of this elem is not in the message bundle just processed, remove it from the DOM \n if (messageArray.indexOf($PBJQ(this).attr('id')) === -1) {\n $PBJQ(this).fadeOut(2000, function(){\n $PBJQ(this).remove();\n });\n }\n });\n $PBJQ(\".portalMessage\").removeClass('lastPortalMessage').removeClass('firstPortalMessage');\n $PBJQ(\"#portalMessageContainer1_2 .portalMessage:last\").addClass('lastPortalMessage');\n $PBJQ(\"#portalMessageContainer3 .portalMessage:first\").addClass('firstPortalMessage');\n \n function flashMessage(elem, message){\n $PBJQ(elem).removeClass('portalMessageShadow');\n $PBJQ(elem).fadeOut(2000, function(){\n $PBJQ(this).children('.messageHolder').empty();\n $PBJQ(this).children('.messageHolder').append('<div>' + message + '</div>');\n $PBJQ(this).fadeIn(2000, function(){\n $PBJQ(this).addClass('portalMessageShadow');\n });\n });\n }\n}", "function showAlert(message, alerttype, target) {\n\n $('#'+target).append('<div id=\"alertdiv\" class=\"alert ' + alerttype + '\"><a class=\"close\" data-dismiss=\"alert\">×</a><span>'+message+'</span></div>')\n\n setTimeout(function() { // this will automatically close the alert and remove this if the users doesnt close it in 5 secs\n $(\"#alertdiv\").remove();\n }, 5000);\n}", "function showAlert(){\n $(\"#addAlert\").show();\n}", "static alert(message, bootstarpAlertClass) {\n // create a div element to append\n const alertNode = document.createElement('div')\n // add a bootstarp attributes to the div-element\n alertNode.setAttribute('role', 'alert')\n alertNode.setAttribute('class', `alert ${bootstarpAlertClass}`)\n alertNode.setAttribute('id', 'alert')\n // add a text-message to the div-element\n alertNode.innerText = message\n\n // replace the empty-div with the new-created div-element\n document.getElementById('alert').replaceWith(alertNode)\n // finally setTimeOut to remove the alert after 3 seconds\n setTimeout(() => {\n // create empty div-element \n const emptyDiv = document.createElement('div')\n // set the id attribute for later-use\n emptyDiv.setAttribute('id', 'alert')\n // replace the alert-div with an empty-div\n document.getElementById('alert').replaceWith(emptyDiv)\n // lastlly we relaod the page to reassign the new updated keys for each book and update the screen-UI\n location.reload()\n }, 3000)\n }", "function alertBox(message){\n\t\t$(\"#infoDiv\").append(\n\t\t\t\"<div class = 'alert alert-warning alert-info' role='alert' id=alertBox>\" +\n\t\t\t\"<button type='button' class='close' data-dismiss='alert' aria-label='Close'>\" +\n\t\t\t\"<span aria-hidden='true'>&times;</span></button><p>\" +\n\t\t\t\tmessage +\n\t\t\t\"</p></div>\"\n\t\t)\n\t\tdisappear(\"#alertBox\");\n\t}", "testAlert() {\n sweetalert2__WEBPACK_IMPORTED_MODULE_13___default.a.fire({\n icon: 'warning',\n title: 'Sin Datos de RMUV',\n text: 'Al parecer no existen datos de la Remuneracion Unificada Vigente, por favor, Ingresarlos antes de continuar',\n // footer: `<a [routerLink]=\"['/inicio']\" target=\"blank\">Ingresar Ahora!!<a>`\n footer: '<a href=\"/\" target=\"blank\">Ingresar Ahora!!<a>',\n showConfirmButton: true,\n timer: null,\n backdrop: null,\n position: 'top-end',\n grow: 'row',\n toast: true\n });\n }", "function bs_alert(selector, type, message) {\n var copy = $(\".alert-template\").clone();\n copy.addClass(\"alert-\" + type).append(message);\n copy.appendTo(selector).show();\n}", "function alerting(){\n alert('ERROR: Please overwrite existing text before saving!');\n location.reload();\n }", "function inlineAlert(text) {\n if(wgCanonicalSpecialPageName == 'Chat') {\n mainRoom.model.chats.add(new models.InlineAlert( {text:(text)} ));\n }\n}", "alertWarning(content) {\n alert(\"warning\", content)\n }", "function showMsg(id,title,text,type)\n { \n $('#alert_content').html('<div class=\"alert alert-'+type+'\" role=\"alert\">'+text+\"</div>\");\n $('#alert_title').html(title);\n $('#'+id).modal('show');\n if (type=='info') {\n AlertSound();\n }; \n }", "function add_alert(aid,mid,view){\n\t// if m2m lable ist 123456789 and alarm is 1010 then we should get this:\n\t// <div id=\"alert_123456789_1010\">\n\t// \t<img id=\"alert_123456789_1010_img\"> -> id changes to set_alert_123456789_1010_img</img>\n\t//\t<div id=\"alert_123456789_101_side>\n\t//\t \t<div id=\"alert_123456789_1010_txt\">Loading -> Movement detected at: 8.6.2015 21:51</div>\n\t//\t\t<a id=\"alert_123456789_1010_ack\">button></a>\n\t//\t</div>\n\t//\t<div id=\"alert_123456789_1010_slider\">\n\t//\t\t<ul...><li></li></ul>\n\t//\t</div>\n\t// </div>\n\t\t\t\n\t// root \n\tvar alert=$(\"<div></div>\");\n\talert.attr({\n\t\t\"id\":\"alert_\"+mid+\"_\"+aid,\n\t});\n\talert.addClass(\"inline_block\");\n\tview.append(alert);\n\n\t// img container\n\tvar img_container=$(\"<div></div>\");\n\tvar width=$(\"#\"+mid+\"_alarms\").width()*0.5; // 50% of the width of the alert box\n\timg_container.attr({\n\t\t\"style\":\"width: \"+width+\"px; \"+\n\t\t\"height:\"+(width/1280*720+20)+\"px;\"\n\t});\n\timg_container.addClass(\"float_left\");\n\talert.append(img_container);\n\n\t// preview image\n\tvar img=$(\"<img></img>\");\n\timg.attr({\n\t\t\"src\" : host+\"images/support-loading.gif\",\n\t\t\"id\":\"alert_\"+mid+\"_\"+aid+\"_img\",\n\t\t\"width\":32,\n\t\t\"height\":32\n\t});\n\timg.addClass(\"alert_preview\");\n\timg.addClass(\"center\");\n\timg_container.append(img);\n\n\t// side block\n\tvar side=$(\"<div></div>\");\n\tside.attr(\"id\",\"alert_\"+mid+\"_\"+aid+\"_side\");\t\n\tside.addClass(\"alert_side\");\n\talert.append(side);\n\n\t// text field\n\tvar txt=$(\"<div></div>\");\n\ttxt.attr({\n\t\t\"id\":\"alert_\"+mid+\"_\"+aid+\"_date\"\n\t});\n\ttxt.html(\"Loading ...\");\n\tside.append(txt);\n\n\t// status button\n\tvar status=$(\"<a></a>\");\n\tstatus.attr({\n\t\t\"id\":\"alert_\"+mid+\"_\"+aid+\"_status\",\n\t\t\"style\":\"cursor:pointer\",\n\t});\n\tstatus.addClass(\"m2m_text\");\n\tstatus.text(\"System Status\");\n\tstatus.hide();\n\tside.append(status);\n\n\t// ack status\n\ttxt=$(\"<div></div>\");\n\ttxt.attr({\n\t\t\"id\":\"alert_\"+mid+\"_\"+aid+\"_ack_status\"\n\t});\n\ttxt.html(\"Loading ...\");\n\ttxt.hide();\n\tside.append(txt);\n\n\n\t// ack button\n\tvar ack=$(\"<i></i>\");\n\tack.attr({\n\t\t\"id\":\"alert_\"+mid+\"_\"+aid+\"_ack\",\n\t\t\"class\":\"button\"\n\t});\n\tack.addClass(\"material-icons\");\n\tack.addClass(\"icons_activ\");\n\tack.addClass(\"icons\");\n\tack.text(\"assignment_turned_in\");\n\tack.click(function(){\n\t\tvar id_int=aid;\n\t\tvar mid_int=mid;\n\t\treturn function(){\n\t\t\tack_alert(id_int,mid_int);\n\t\t\tget_alarms(mid_int);\n\t\t};\n\t}());\n\tack.hide();\n\tside.append(ack);\n\n\t// del button\n\tvar del=$(\"<i></i>\");\n\tdel.attr({\n\t\t\"id\":\"alert_\"+mid+\"_\"+aid+\"_del\",\n\t\t\"class\":\"material-icons\"\n\t});\n\tdel.addClass(\"icons\");\n\tdel.text(\"delete\");\n\tdel.click(function(){\n\t\tvar id_int=aid;\n\t\tvar mid_int=mid;\n\t\treturn function(){\n\t\t\tdel_alert(id_int,mid_int);\n\t\t\tget_alarms(mid_int);\n\t\t};\n\t}());\n\tdel.hide();\n\tside.append(del);\n\n\t// send button\n\tvar send=$(\"<i></i>\");\n\tsend.attr({\n\t\t\"id\":\"alert_\"+mid+\"_\"+aid+\"_send\",\n\t\t\"class\":\"material-icons\"\n\t});\n\tsend.addClass(\"icons\");\n\tsend.text(\"email\");\n\tsend.click(function(){\n\t\tvar id_int=aid;\n\t\tvar mid_int=mid;\n\t\treturn function(){\n\t\t\tsend_alert(id_int,mid_int);\n\t\t};\n\t}());\n\tsend.hide();\n\tside.append(send);\n\n\t// slider\n\tvar slider=$(\"<div></div>\");\n\tslider.attr({\n\t\t\"id\":\"alert_\"+mid+\"_\"+aid+\"_slider\"\n\t});\n\tslider.hide();\n\talert.append(slider);\n}", "function alertMessage(type,str){\n\talertHide();\n\t// type is a success ,info, warning ,error\n\t$('body').append('<div id=\"alertMessage\" class=\"alertMessage '+type+'\">');\n\t$.alertbox=$('#alertMessage').html(str);\n\t$.alertbox.show().animate({ opacity:1,right: '10' },500);\n\tsetInterval(function(){\n\t\t$.alertbox.animate({ opacity: 0,right: '30'}, 500,function(){ $(this).remove(); });\n\t}, 3000);\n}", "function simpleAlert(data){\n\t\t\tvar app = new Alert();\n\t\t\tif(!app.exist()){\n\t\t\t\tif(app.checkObj(data)){\n\t\t\t\t\tapp.load(data);\n\t\t\t\t\tapp.show();\n\t\t\t\t}else{\n\t\t\t\t\tconsole.log(\"Aconteceu algo :/\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tapp.close();\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tif(app.checkObj(data)){\n\t\t\t\t\t\tapp.load(data);\n\t\t\t\t\t\tapp.show();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tconsole.log(\"Aconteceu algo :/\");\n\t\t\t\t\t}\n\t\t\t\t},500);\n\t\t\t}\n\t\t}", "function createInfoAlert() {\n viewFactory.createErrorAlert('Information', infoMessage);\n}", "function successMessage(){\n window.alert(\"Success: Deadline Sent to Deadline Dashboard\");\n}", "function displayAlert(alert, type, message) {\n $('.alertdiv').html('<div class=\"alert alert-dismissable alert-fixed alert-' + alert + '\" role=\"alert\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><i class=\"pi pi-ios-close-empty\"></i></button><span class=\"mar-right-md\">' + type + '</span>' + message + '</div>');\n setTimeout(function() {\n $('.alertdiv').html('');\n }, 5000);\n}", "function newAlert(type, message) {\n $(\"#alert_area\").append($(\"<div class='alert-message \" + type + \" fade in' data-alert><p> \" + message + \" </p></div>\"));\n $(\".alert-message\").delay(2000).fadeOut(\"slow\", function () { $(this).remove(); });\n}", "function notify(newAlert){\n\t\t// change the alert message\n\t\tdocument.getElementById(\"alert-content\").innerHTML = newAlert;\n\t\t// alert animations\n\t\tvar box = document.getElementById(\"alert-wrapper\");\n\t\tbox.className = \"visible\";\n\t\tsetTimeout(function(){ box.className = \"hidden\" }, 2500);\n\t}", "function showAlert(message, type) {\n var container = $('alert-container');\n clear(container);\n container.appendChild(newAlert(message, type));\n setTimeout(() => clear(container), 3000);\n}", "function alert( title, message, type, tag, unescaped ) {\n var element = $( \"#alert\" ).clone();\n\n element.prop( \"id\", \"\" );\n if ( unescaped ) {\n element.find( \".error-title\" ).html( title );\n element.find( \".error-text\" ).html( message );\n } else {\n element.find( \".error-title\" ).text( title );\n element.find( \".error-text\" ).text( message );\n }\n\n if ( typeof( tag ) !== \"undefined\" ) element.addClass( tag );\n element.addClass( \"alert-\" + type );\n element.removeClass( \"hidden\" );\n $( \"#alert\" ).before( element );\n }", "alert(data) {\n let { title, msg, date, type } = data;\n let config = this.options[type];\n if (!config)\n return;\n let { id, token } = config;\n if (!id || !token)\n return;\n this.eris.executeWebhook(id, token, {\n embeds: [\n {\n description: msg,\n footer: { text: this.instanceID },\n timestamp: date.toString(),\n title,\n },\n ],\n });\n return Promise.resolve();\n }", "alertInfo(content) {\n alert(\"info\", content)\n }", "function addNewAlert(data, id, user){\n\t//prepend to #ae-list\n\t$('#ae-list').prepend($('<div class=\"ae-container\">')\n\t\t.append($('<div class=\"ae-container-content\">').text(data.content))\n\t\t.append($('<textarea class=\"ae-container-content-edit\" maxlength=\"175\">'))\n\t\t.append($('<div class=\"ae-container-header\">')\n\t\t\t.append($('<a href=\"#\" class=\"ae-container-edit-button\">').text(\"Edit\")))\n\t\t.append($('<div class=\"ae-container-edits\">')\n\t\t\t.append($('<div>')\n\t\t\t\t.append($('<span>').text(\"Start Date\"))\n\t\t\t\t.append($('<input type=\"date\" class=\"ae-edit-start\">')))\n\t\t\t.append($('<div>')\n\t\t\t\t.append($('<span>').text(\"End Date\"))\n\t\t\t\t.append($('<input type=\"date\" class=\"ae-edit-end\">')))\n\t\t\t.append($('<div>')\n\t\t\t\t.append($('<span>').text(\"Your Name\"))\n\t\t\t\t.append($('<input type=\"text\" class=\"ae-edit-author\">'))))\n\t\t.append($('<div class=\"ae-edit-buttons\">')\n\t\t\t.append($('<button type=\"button\" class=\"ae-edit-cancel\">').text(\"Cancel\"))\n\t\t\t.append($('<button type=\"button\" class=\"ae-edit-submit\">').text(\"Submit\")))\n\t\t.append($('<div style=\"display:none;\" class=\"ae-hidden-id\">').text(id))\n\t\t.append($('<div style=\"display:none;\" class=\"ae-hidden-start\">').text(data.start_date))\n\t\t.append($('<div style=\"display:none;\" class=\"ae-hidden-end\">').text(data.end_date))\n\t\t.append($('<div style=\"display:none;\" class=\"ae-hidden-author\">').text(data.author)));\n}", "static alert(message,className){\n const div=document.createElement('div');\n div.className = `alert alert-${className}`;\n div.appendChild(document.createTextNode(message));\n const container=document.querySelector('.container');\n const form = document.querySelector('#book-form');\n container.insertBefore(div,form);\n //Setting the timeout so that the alert disappears in 2sec\n setTimeout(() => document.querySelector('.alert').remove(), 2000);\n }", "alertError(content) {\n alert(\"danger\", content)\n }", "function alertas() {\r\n var aletas = document.getElementById(\"alerta\");\r\n alertas.innerHTML = \"<div class='alert alert-danger alert-dismissible'>\" +\r\n \"<button type='button' class='close' data-dismiss='alert'>\" + \"&times;\" + \"</button>\" +\r\n \"<strong>\" + \"Danger!\" + \"</strong>\" + \"This alert box could indicate a dangerous or potentially negative action.\" +\r\n \"</div>\";\r\n\r\n}", "function errorAdPop(message){\r\n\t\t$(\"#popUp1\").html(\"<h2>Alert!</h2><p style='color:red; text-align: center;'><b>\"+message+\"</b></p>\"+\r\n\t\t'<a href=\"#add-new\" data-rel=\"back\" class=\"ui-btn ui-btn-right ui-btn-inline ui-icon-delete ui-btn-icon-notext ui-btn-a\"></a>').popup(\"open\"); \r\n\t\tsetTimeout(function(){ $(\"#popUp1\").popup(\"close\"); }, 5000);\r\n\t}", "function CustomAlert() {\n this.render = function (dialog) {\n var winW = window.innerWidth;\n var winH = window.innerHeight;\n var dialogoverlay = document.getElementById('dialogoverlay');\n var dialogbox = document.getElementById('dialogbox');\n dialogoverlay.style.display = \"block\";\n dialogoverlay.style.height = winH + \"px\";\n dialogbox.style.left = (winW / 2) - (550 * .5) + \"px\";\n dialogbox.style.top = \"100px\";\n dialogbox.style.display = \"block\";\n document.getElementById('dialogboxhead').innerHTML = \" Alert !\";\n document.getElementById('dialogboxbody').innerHTML = dialog;\n document.getElementById('dialogboxfoot').innerHTML = '<input type=\"button\" class=\"btn btn-danger\" onclick=\"Alert.ok()\" value=\"OK\"/>';\n }\n this.ok = function () {\n document.getElementById('dialogbox').style.display = \"none\";\n document.getElementById('dialogoverlay').style.display = \"none\";\n }\n}", "function show_window_alerts(){\r\n\thide_alert();\r\n\tconst url = new URL(window.location.href);\r\n\tif ( url.searchParams.get(\"alert\") ){\r\n\t\tlet msg ='';\r\n\r\n\t\tswitch( url.searchParams.get(\"alert\") ){\r\n\t\t\tcase '0':\r\n\t\t\t\tmsg = \"הרשומה נוספה בהצלחה! מספר מזהה: \"+url.searchParams.get(\"id\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase '1':\r\n\t\t\t\tmsg = \"הפרטים עודכנו בהצלחה!\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '2':\r\n\t\t\t\tmsg = \"תלמיד מס' \"+url.searchParams.get(\"id\") +\"נמחק בהצלחה!\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase '3':\r\n\t\t\t\tmsg = \"לא ניתן למחוק !\" +url.searchParams.get(\"err\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase '4':\r\n\t\t\t\tmsg = url.searchParams.get(\"err\");\r\n\t\t\t\tbreak;\r\n\t\t\tcase '5':\r\n\t\t\t\tmsg = \"משתמש לא קיים!\";\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tshow_alert( msg );\r\n\t};\r\n}", "function issue_called(text_for_alert){\n window.alert(text_for_alert);\n}", "function showAlert() {\n alert (\"Hello world!\");\n }", "function showAlertMessage(mensaje) {\r\n\talert (mensaje);\r\n}", "function showAlert(alertType)\n {\n let alertTag = $('.alert');\n alertTag.html(alertType);\n alertTag.fadeIn();\n setTimeout(function(){\n alertTag.fadeOut();\n }, 3600);\n }", "function showAlert(alertMessage){\n $(\"#myAlert\").css(\"display\",\"block\").html(\"<b>\"+alertMessage+\"</b>\");\n}", "function tempAlert(msg,duration)\r\n\t\t {\r\n\t\t var el = document.createElement(\"div\");\r\n\t\t el.setAttribute(\"style\",\"display: block;position: fixed;border: 2px solid black;border-radius:25px;margin: 5% 20%;width: 60%;background-color:silver;padding:10px;z-index:2\");\r\n\t\t el.innerHTML = \"<h3 align='center'>\"+msg+\"<\\h3>\";\r\n\t\t setTimeout(function(){\r\n\t\t el.parentNode.removeChild(el);\r\n\t\t },duration);\r\n\t\t document.body.appendChild(el);\r\n\t\t }", "function updateMessaageAlert(msg)\n{\n\t//Defining basicConf parameter for alert\n\tvar basicConf = {message:msg ,alertType: constants.ALERT_TYPE_INFO};\n\t//Defining pspConf parameter for alert\n\tvar pspConf = {};\n\t//Alert definition\n\tvar infoAlert = kony.ui.Alert(basicConf,pspConf);\n}", "function presentAlert() {\n const alert = document.createElement('ion-alert');\n alert.header = 'Alert';\n alert.subHeader = 'Input';\n alert.message = 'Input invalid please correct an try again.';\n alert.buttons = ['OK'];\n \n document.body.appendChild(alert);\n return alert.present();\n\n }", "function showAlert(alert_id) {\n hideAlerts();\n $('#' + alert_id).show();\n }", "function showAlert(alert_id) {\n hideAlerts();\n $('#' + alert_id).show();\n }", "function addSuccessAlert() {\n $scope.alerts.push({\n type: 'success',\n msg : $filter('translate')('pages.sm.service.SERVICE_MGMT_ALERTS.SERVICE_MGMT_ALERT_SERVICE_ADD_SUCCESSFUL')\n });\n }", "function popup(){\n window.alert(\"Thank you for your purchase!\")\n}", "static alert(type){\r\n\r\n if(type==\"good\"){\r\n\r\n popup.className=\"alert alert-success text-center mt-3\";\r\n popup.innerText=\"Bookmark Added Succesfully!\"\r\n \r\n setTimeout(() => {\r\n popup.className=\"hide\";\r\n popup.innerText=\"\";\r\n }, 2000);\r\n }\r\n\r\n else if(type==\"bad\"){\r\n\r\n popup.className=\"alert alert-danger text-center mt-3\";\r\n popup.innerText=\"Bookmark Already Exists!\"\r\n \r\n \r\n setTimeout(() => {\r\n popup.className=\"hide\";\r\n popup.innerText=\"\";\r\n }, 2000);\r\n }\r\n else if(type==\"empty\"){\r\n\r\n popup.className=\"alert alert-danger text-center mt-3\";\r\n popup.innerText=\"Fill Out All The Fields!\"\r\n\r\n setTimeout(() => {\r\n popup.className=\"hide\";\r\n popup.innerText=\"\";\r\n }, 2000);\r\n }\r\n \r\n else if(type==\"badurl\"){\r\n\r\n\r\n popup.className=\"alert alert-danger text-center mt-3\";\r\n popup.innerText=\"Invalid URL Entered!\"\r\n \r\n setTimeout(() => {\r\n popup.className=\"hide\";\r\n popup.innerText=\"\";\r\n }, 2000);\r\n \r\n }\r\n\r\n\r\n\r\n }", "function errorEdAdPop(message){\r\n\t\t$(\"#editPop\").html(\"<h2>Alert!</h2><p style='color:red; text-align: center;'><b>\"+message+\"</b></p>\"+\r\n\t\t'<a href=\"#add-new\" data-rel=\"back\" class=\"ui-btn ui-btn-right ui-btn-inline ui-icon-delete ui-btn-icon-notext ui-btn-a\"></a>').popup(\"open\"); \r\n\t\tsetTimeout(function(){ $(\"#editPop\").popup(\"close\"); }, 5000);\r\n\t}", "function swagAlert (text) {\n\tvar alertText = text;\n\tnew SwagIt(\n\t\t'Alert!', \t\t\t\t\t\n\t\talertText,\t\t\t\t\t\t\t\t\n\t\t'Ok',\n\t\t'https://cdn2.iconfinder.com/data/icons/windows-8-metro-style/128/bell.png', \n\t\t'#7793C1'\t\n\t);\n}", "function __alert($msg) {\r\n __message({type:1, message:$msg, autoclose:3});\r\n}", "function displayAlert(title, message){\n Alert.alert(title,message);\n}", "function message(msg) {\n\tdocument.getElementById('alert-box').innerHTML = msg;\n}", "function show_alert(type, title, content) {\n\tconst icon = type == 'red' ? 'fa fa-warning' : 'fa fa-check';\n\n\t$.alert({\n\t\t\"type\": type,\n\t\t\"title\": title,\n\t\t\"content\": content,\n\t\t\"icon\": icon,\n\t\t\"backgroundDismiss\": true\n\t})\n}", "function add_alert_details(msg_dec){\n\tvar img=msg_dec[\"img\"];\n\tvar mid=msg_dec[\"mid\"];\n\tvar rm=msg_dec[\"rm_string\"];\n\t// fill element with details\n\n\t// show text info\n\tvar date_txt=$(\"#alert_\"+mid+\"_\"+msg_dec[\"id\"]+\"_date\");\n\tif(!date_txt.length){\n\t\tconsole.log(\"get_alarm_details view not found\");\n\t} else {\n\t\tvar a = new Date(parseFloat(msg_dec[\"f_ts\"])*1000);\n\t\tvar min = a.getMinutes() < 10 ? '0' + a.getMinutes() : a.getMinutes();\n\t\tvar hour = a.getHours();\n\t\tdate_txt.text(\"\"+a.getDate()+\".\"+(a.getMonth()+1)+\".\"+a.getFullYear()+\" \"+hour+\":\"+min);\n\t\tdate_txt.addClass(\"m2m_text\");\n\t}\t\t\n\n\t// show status button\n\tvar status_button=$(\"#alert_\"+mid+\"_\"+msg_dec[\"id\"]+\"_status\");\n\tstatus_button.click(function(){\n\t\tvar txt=rm;\n\t\treturn function(){\n\t\t\ttxt2fb(format_rm_status(txt));\n\t\t};\n\t}());\n\tstatus_button.show();\n\n\t// show ack status\n\tvar ack_status=$(\"#alert_\"+mid+\"_\"+msg_dec[\"id\"]+\"_ack_status\");\n\tif(msg_dec[\"ack\"]==0){\n\t\tack_status.text(\"Not acknowledged\");\n\t} else {\n\t\tvar a = new Date(parseFloat(msg_dec[\"ack_ts\"])*1000);\n\t\tvar min = a.getMinutes() < 10 ? '0' + a.getMinutes() : a.getMinutes();\n\t\tvar hour = a.getHours();\n\t\tack_status.html(\"Checked by '\"+msg_dec[\"ack_by\"]+\"'<br> at \"+hour+\":\"+min+\" \"+a.getDate()+\".\"+(a.getMonth()+1)+\".\"+a.getFullYear());\n\t};\n\tack_status.addClass(\"m2m_text\");\n\tack_status.show();\n\n\t// show ack button\n\tif(msg_dec[\"ack\"]==0){\n\t\tvar ack_button=$(\"#alert_\"+mid+\"_\"+msg_dec[\"id\"]+\"_ack\");\n\t\tack_button.show();\n\t};\n\n\t// show del button\n\tif(msg_dec[\"ack\"]!=0){\n\t\tvar del_button=$(\"#alert_\"+mid+\"_\"+msg_dec[\"id\"]+\"_del\");\n\t\tdel_button.show();\n\t};\n\n\t// show send button\n\tvar send_button=$(\"#alert_\"+mid+\"_\"+msg_dec[\"id\"]+\"_send\");\n\tsend_button.show();\n\t\n\n\t// add new placeholder image\n\tif(img.length>0){\n\t\t// this is picture nr 1 the title picture\n\t\tvar pic=$(\"#alert_\"+mid+\"_\"+msg_dec[\"id\"]+\"_img\");\t\t\n\t\tpic.attr({\n\t\t\t\"id\":img[0][\"path\"],\n\t\t\t\"style\":\"cursor:pointer\"\n\t\t});\n\t\tpic.click(function(){\n\t\t\tvar img_int=img; \t\t\t\t\t\t\t\t// list of all pictures for this alarm\n\t\t\tvar mid_int=mid;\t \t\t\t\t\t\t\t// mid for this alarm\n\t\t\tvar slider_id=\"#alert_\"+mid_int+\"_\"+msg_dec[\"id\"]+\"_slider\";\t\t\t// id for the div in which the slider should\n\t\t\tvar core_int=img[0][\"path\"].substr(0,img[0][\"path\"].indexOf(\".\"));\t\t// slider itself must have an unique id without \".\"\n\t\t\treturn function(){\n\t\t\t\tshow_pic_slider(img_int,mid_int,core_int,slider_id);\n\t\t\t}\n\t\t}());\n\t\t\n\t\t// request picture from server\n\t\tvar path=img[0][\"path\"];\n\t\tvar width=$(\"#\"+mid+\"_alarms\").width()*0.5; // 50% of the width of the alert box\n\t\tvar cmd_data = { \"cmd\":\"get_img\", \"path\":path, \"width\":width, \"height\":width*720/1280};\n\t\tcon.send(JSON.stringify(cmd_data));\n\t} // end of if img \n}", "function showSuccessAlert(ev) {\n customSetting.color = '#000000';\n customSetting.bgColor = '#90ee90';\n customAlert('This operation was successful!', customSetting);\n}", "function getSuccessAlertHTML(text) {\n return $('<div class=\"alert alert-success\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' + text +'</div>');\n}", "function CustomAlert() {\n this.render = function(dialog) {\n\n var winWidth = window.innerWidth;\n var winHeight = window.innerHeight;\n var overlay = document.getElementById('overlay');\n var box = document.getElementById('box')\n\n //display box in center\n box.style.display = 'block';\n overlay.style.height = winHeight + 'px'\n box.style.left = (winWidth / 2) - (550 * .5) + 'px';\n box.style.top = '175px';\n box.style.display = 'block'\n\n //add content\n document.getElementById('head').innerHTML = \"World Record Status\"\n document.getElementById('body').innerHTML = dialog;\n document.getElementById('foot').innerHTML = '<button id=\"ok-btn\" onclick= \"Alert.ok()\"> OK </button>'\n }\n this.ok = function() {\n document.getElementById('box').style.display = 'none';\n document.getElementById('overlay').style.display = 'none';\n }\n}", "function alert(_msg) {\n $('#md-alert p').html(_msg);\n $('#md-alert').modal('show');\n}", "function executeOnFailure() {\n alert(\"Error loading page\")\n }", "function executeOnFailure() {\n alert(\"Error loading page\")\n }", "function alert_success(message) {\n $.gritter.add({\n title: 'Success!',\n text: message,\n image: 'static/img/pirate-logo.png',\n time: 3000\n });\n}", "function fancyAlert(msg) {\n $.fancybox({'content': \"<div style=\\\"margin:20px;width:240px;font-weight:bold;\\\">\" + msg + \"</div>\"});\n}", "function titleAlert(message, type) {\n var wrapper = document.createElement('div')\n wrapper.innerHTML = '<div class=\"alert alert-' + type + ' alert-dismissible\" role=\"alert\">' + message + '<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"alert\" aria-label=\"Close\"></button></div>'\n titleErr.current.append(wrapper)\n }", "function showAlert() {\n alert = $mdDialog.alert({\n title: 'Attention',\n textContent: 'This is an example of how easy dialogs can be!',\n ok: 'Close'\n });\n\n $mdDialog\n .show(alert)\n .finally(function () {\n alert = undefined;\n });\n }", "function createAlert() {\n $('#create_tweet_btn').click(function() {\n alert(\"Hello Joe, you tweeted!\")\n });\n}", "function AlertSuccess(msg) {\n $(\"#alertSuccess\").css('display', 'block');\n var success = \"<div class='alert alert-success'><button type='button' class='close' data-dismiss='alert'>&times;</button><span>\" + msg + \"</span></div>\";\n $(\"#alertSuccess\").html(success);\n}", "function addMonitoringAlertEventHandler() {\n $(\"#Add_MonitoringAlertEventHandler_Register\").modal(); \n}", "function showAlert() {\n navigator.notification.alert(\n 'temp16percent:'+temp16percent+' topForecastSpace:'+topForecastSpace+' timeTextSpace:'+timeTextSpace+' bottomForecastSpace:'+bottomForecastSpace+' topSunChart:'+topSunChart+' sunChartBottom:'+sunChartBottom+' columnWidth:'+columnWidth+' calc(temp16percent*5+topForecastSpace):'+(temp16percent*5+topForecastSpace), // message\n alertDismissed, // callback\n 'bebug', // title\n 'Done' // buttonName\n );\n }", "function bsAlert(){return _callWithEmphasis(this, oj.div, 'alert', 'info', arguments)}" ]
[ "0.7186714", "0.6650776", "0.6647169", "0.66401476", "0.6581142", "0.65043974", "0.64429706", "0.64120877", "0.6397162", "0.6377098", "0.63721734", "0.63676316", "0.63612646", "0.63413566", "0.63305", "0.6327843", "0.6325178", "0.6295787", "0.62591", "0.6252838", "0.6231003", "0.62102926", "0.6192545", "0.6183758", "0.6182986", "0.61765605", "0.61438525", "0.6141593", "0.61360085", "0.6097241", "0.6095125", "0.6090391", "0.60804427", "0.60577583", "0.605754", "0.6054364", "0.60473335", "0.6038972", "0.6035692", "0.6017628", "0.6009222", "0.59988123", "0.59767514", "0.5952479", "0.5952452", "0.59448457", "0.5942337", "0.59391576", "0.59324044", "0.5927783", "0.5908786", "0.59063387", "0.5899877", "0.5896385", "0.58950424", "0.5887686", "0.5879348", "0.5874057", "0.58692014", "0.58690655", "0.5865353", "0.5844507", "0.58269966", "0.5815582", "0.58115804", "0.5809823", "0.58093625", "0.58044255", "0.58037573", "0.58025205", "0.57970273", "0.57915765", "0.57896924", "0.5776781", "0.5776781", "0.57719266", "0.57715833", "0.57659197", "0.57574934", "0.575386", "0.5752668", "0.5745268", "0.5744678", "0.57346135", "0.5732059", "0.5722902", "0.57212424", "0.57165825", "0.57106096", "0.5706343", "0.5706343", "0.5694414", "0.569125", "0.56870663", "0.56852347", "0.56832045", "0.5681617", "0.5679567", "0.5676814", "0.5675714" ]
0.6415643
7
Show modal with results.
function showModal(parameters, count) { var msg = "Scraped " + count + " " + parameters.category + " from " + parameters.location + "."; $('#scraperModal').modal('show'); $('.modal-msg').text(msg); $(".alert").delay(3000).fadeOut("slow", function() { $(this).first().remove(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showResults(results) {\n resultHead.innerHTML = results[0];\n resultDesc.innerHTML = results[1];\n\n body.classList.add('animated');\n modal.classList.add(results[2]);\n modal.classList.remove('hidden');\n modal.classList.add('slideInLeft');\n}", "function showResults () {\n $('#results').fadeIn();\n }", "function modalResult() {\n\tlet href = \"#modal-result\";\n\twindow.open(href, \"_self\");\n}", "function show_results() {\n\t\t$('#mc_btns').hide();\n\t\t$('#progress-box').hide();\n\t\t$('#result-btns').show();\n\t\t$('#page-title').html('Results').hide().fadeIn(500);\n\t}", "function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\") .text(data.name)\n $(\".modal-li-1\") .text(\"Accuracy: \" + data.accuracy)\n $(\".modal-li-2\").text(\"PP: \" + data.pp)\n $(\".modal-li-3\").text(\"Power: \" + data.power)\n $(\".modal-li-4\").text(\"Type: \" + data.type.name)\n $(\".modal-li-5\").text(\"Priority: \" + data.priority)\n \n }", "function showResults() {\n $(\"#results\").show();\n $(\"#correctanswers\").html(\"<h3> Correct Answers: \"+correctAnswers+\"</h3>\");\n $(\"#incorrectanswers\").html(\"<h3> Incorrect Answers: \"+incorrectAnswers+\"</h3>\");\n $(\"#unansweredquestions\").html(\"<h3> Unanswered Questions: \"+unansweredQuestions+\"</h3>\");\n }", "function showModal () {\n $modal = $('<div class=\"modal-test\"><h1>Your result:</h1></div>');\n $overlay = $('<div class=\"modal-overlay\" title=\"Close results!\"></div>');\n $body.append($overlay);\n $body.append($modal);\n $modal.animate({ top: \"50%\" }, 800);\n }", "function displayModal() {\n\t\t\t\t$(\"#user-name\").text(newPerson.name);\n\t\t\t\t$(\"#match-name\").text(matchName);\n\t\t\t\t$(\"#match-img\").attr(\"src\", matchImage);\n\t\t\t\t$(\"#myModal\").modal();\n\t\t\t}", "function displayResults() {\n modalMoves.innerHTML = movesCounter.innerHTML;\n modalTime.innerHTML = timerDisplay.innerHTML;\n modal.style.display = 'block';\n}", "function showLastRunDetails() {\n $('#modal-container').html(last_run_details_template(runResults))\n $('#modal-container').modal()\n}", "function showData() {\n GetUser().then((res) => {\n for (const key in res) {\n addModalBox(res[key]);\n }\n });\n}", "async show() {\n return this._showModal();\n }", "function displayResults() {\n\n $('.btn').focus();\n $('#top-result').fadeIn();\n $('.container__outside--output').fadeIn();\n $('#map').html('<img src=' + mapUrl + '>');\n $('#result').text(venue.name);\n $('#location').text(venue.address);\n $('#url').html('<a href=\"' + venue.url + '\" target=\"_blank\">Vist website</a>');\n $('#category').html('<img src=\"' + venue.icon + '64.png\">');\n \n }", "function showResults(numberOfMoves, numberOfStars) {\n document.querySelector('.modal-wrapper').classList.remove('is-hidden');\n document.querySelector('.time-difference').innerHTML = timeDiff(startTime, new Date());\n document.querySelector('.display_num_moves').innerHTML = numberOfMoves;\n document.querySelector('.display_num_stars').innerHTML = numberOfStars;\n}", "function showResults(){\n \n $('#correct-result').show();\n $('#correct-result').html('You got ' + correct + ' questions right');\n $('#incorrect-result').show();\n $('#incorrect-result').html('You got ' + incorrect + ' questions wrong');\n $('#unanswered-result').show();\n $('#unanswered-result').html('You did not answer ' + unanswered + ' questions');\n $('#restart-result').show();\n $('#restart-result').html('Select the start button below to restart the game.');\n }", "function modalSearch(){\n\t$('#lbl_title').text('Search Data Infaq');\n\t$('#m_search').modal('show');\n}", "function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\").text(data.name)\n $(\".modal-li-1\").text(\"Generation: \" + data.generation.name)\n $(\".modal-li-2\").text(\"Effect: \" + data.effect_changes[0].effect_entries[1].effect)\n $(\".modal-li-3\").text(\"Chance: \" + data.effect_entries[1].effect)\n $(\".modal-li-4\").text(\"Bonus Effect: \" + data.flavor_text_entries[0].flavor_text)\n }", "function showResult() {\n $('main').html(resultTemplate());\n}", "function showResults(results){\n\t\n}", "function show_modal_response( data ){\n //debugger\n if(data){\n j('#response').html( S(data) );\n j('#fancybox_trigger').trigger('click');\n }\n }", "function modalDisplay(chosenRest) {\n // in case no restaurant fits the criteria\n if (chosenRest === undefined) {\n $(\"#no-results-modal\").removeClass(\"modal_hidden\");\n $(\"#load\").addClass(\"hidden\");\n return;\n }\n $(\"#res-name\").text(chosenRest.name);\n $(\"#res-icon\").attr(\"src\", chosenRest.icon);\n $(\"#address\").text(chosenRest.vicinity);\n $(\"#res-rate\").text(\"Rating: \" + chosenRest.rating);\n\n $(\"#res-modal\").removeClass(\"modal_hidden\");\n }", "function show() {\n loadingModal.show();\n }", "function runModal() {\r\n $(\"#myModal\").modal(\"show\");\r\n }", "function results() {\n\t//hide modal if the user just finished the survey\n\tlet active_modal = document.getElementById(\"modal\"+step);\n\tif(active_modal != null) active_modal.style.display = 'none';\n\t//generate the results\n\tdocument.body.innerHTML += results_html;\n\tlet table = getEl('results').getElementsByTagName('th');\n\ttable[0].innerHTML = 'Name';\n\ttable[1].innerHTML = name;\n\ttable[2].innerHTML = 'E-mail';\n\ttable[3].innerHTML = email;\n\ttable[4].innerHTML = 'Age';\n\ttable[5].innerHTML = age;\n\ttable[6].innerHTML = 'About me';\n\ttable[7].innerHTML = aboutme;\n\ttable[8].innerHTML = 'Address';\n\ttable[9].innerHTML = address;\n\ttable[10].innerHTML = 'Gender';\n\ttable[11].innerHTML = gender;\n\ttable[12].innerHTML = 'Favourite book';\n\ttable[13].innerHTML = favbook;\n\ttable[14].innerHTML = 'Favourite colours';\n\ttable[15].innerHTML = favcolors;\n}", "function DisplayResults(){\n console.log(\"inscoreboard\");\n $(\"#results\").show();\n $(\"#startOverBtn\").show();\n $('#timeLeft').empty();\n $('#message').empty();\n $('#correctedAnswer').empty(); \n $('#finalMessage').html(messages.finished);\n $('#correctAnswers').html(\"Correct Answers: \" + correctAnswer);\n $('#wrongAnswers').html(\"Incorrect Answers: \" + incorrectAnswer);\n $('#unanswered').html(\"Unanswered: \" + unanswered);\n //$('#startOverBtn').addClass('reset');\n //$('#startOverBtn').show();\n //$('#startOverBtn').html('Start Over?');\n }", "function openModal() {\n getRecipeDetails();\n handleShow();\n }", "function showResults(){\n $('.resultsPopUp').fadeIn('slow');\n $('.placeholder').hide();\n\n}", "function response_in_modal(response) {\n $(\".modal-title\").html(response);\n $(\"#empModal\").modal(\"show\");\n}", "function _showResults(response){\r\n\t\r\n\t\r\n\t$('#sql-query').text(response.data.qberesult.query);\r\n\tvar resultColumns = response.data.qberesult.values;\r\n\r\n\tif(resultColumns.length > 1){\r\n\t\tvar htmlString = '<table class=\"table table-bordered caption-bottom\"><thead><tr>';\r\n\t\tfor(var i in resultColumns[0]){\r\n\t\t\thtmlString += '<th>'+resultColumns[0][i] + '</th>';\r\n\t\t}\r\n\t\thtmlString += '</thead><tbody>';\r\n\t\tfor(i=1;i<resultColumns.length;i++){\r\n\t\t\thtmlString += '<tr>';\r\n\t\t\tfor(var j in resultColumns[i]){\r\n\t\t\t\thtmlString += '<td>' + resultColumns[i][j] + '</td>';\r\n\t\t\t}\r\n\t\t\thtmlString += '</tr>';\r\n\t\t}\r\n\t\thtmlString += '</tbody></table>';\r\n\t\t$('#results').html(htmlString);\r\n\t}\r\n\telse{\r\n\t\t$('#results').html(\"No results found.\");\r\n\t}\r\n\t\r\n\t\r\n\t$('#qbe-result').show();\r\n\t\r\n $('html, body').animate({\r\n scrollTop: $(\"#qbe-result\").offset().top\r\n }, 2000);\r\n\r\n\r\n}", "function showModal() {\n $(\"#exampleModal\").modal();\n }", "function showModal() {\n\tdocument.querySelector('.backdrop').style.display = 'block';\n\tdocument.querySelector('.modal').style.display = 'block';\n\tdocument.querySelector('.total').textContent = moves;\n\tdocument.querySelector('.time-taken').textContent = totalTimeString();\n\tdocument.querySelector('.star-rating').innerHTML = checkStarRating();\n}", "async showResults() {\r\n document.getElementById('scenario').hidden = true;\r\n document.getElementById('results').hidden = false;\r\n\r\n const game = await this.api.getResult(this.answers);\r\n document.getElementById('game-title').innerText = game.title;\r\n document.getElementById('game-background').setAttribute('src', game.backgroundImage);\r\n document.getElementById('game-rating').innerText = game.avgRating;\r\n }", "function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\").text(data.name)\n $(\".modal-img\").attr('src', data.sprites.other['official-artwork'].front_default);\n $(\".modal-li-1\").text(\"Type: \" + data.types[0].type.name)\n $(\".modal-li-2\").text(\"Abilities: \" + data.abilities[0].ability.name + \"/\" + data.abilities[1].ability.name)\n $(\".modal-li-3\").text(\"Stats: \" + \"HP: \" + data.stats[0].base_stat + \" ATK: \" + data.stats[1].base_stat + \" DEF: \" + data.stats[2].base_stat + \" SP. ATK: \" + data.stats[3].base_stat + \" SP. DEF: \" + data.stats[4].base_stat + \" SPD: \" + data.stats[5].base_stat)\n $(\".modal-li-4\").text(\"Base XP: \" + data.base_experience);\n $(\".modal-li-5\").text(\"Height: \" + data.height + \" ft \" + \"Weight: \" + data.weight + \" lbs\")\n }", "function displayResults() {\n var res = \"\";\n if (sStatement.length > 0 ) {\n res += \"Successfully posted: \" + sStatement + \"\\n\";\n }\n if (fStatement.length > 0 ) {\n res += \"Unsuccessfully posted: \" + fStatement;\n }\n\n nDlg.show($scope, res)\n .then(function() {\n $state.go(\"term-edit\", {id : $scope.termID});\n });\n }", "function show_modal() {\n \t$('#promoModal').modal();\n }", "function show() {\n $$invalidate('modalIsVisible', modalIsVisible = true);\n }", "displayResults(type) {\n const data = new Data();\n const portfolioResultsContainer = document.querySelector('#portfolioResultsContainer');\n\n\n data.fetchProjects(type)\n .then(data => {\n let html = ``;\n\n /* Loops then prepends newly fetched projects so that new projects stays in the top */\n data.forEach(project => {\n if(project.type_slug == type){\n html = `${this.UI.makeProjectCards(project)} ${html}`;\n }\n });\n\n portfolioResultsContainer.innerHTML = html;\n\n /* Bind a click to each info buttons */\n const viewButtons = document.querySelectorAll('.viewButton');\n\n /* Loops over info buttons */\n viewButtons.forEach(button => {\n button.addEventListener('click', (e) => {\n e.preventDefault();\n const projectId = e.target.id;\n\n /* Fetches one project only */\n /* Checks if Modal type is info */\n const singleProject = data.find(element => element.id === projectId);\n this.modal.openModalInfo(singleProject);\n\n\n });\n });\n \n\n })\n .catch(err => console.log(err));\n\n }", "function displayResults() {\n\n $(\"#resultsPage\").show();\n $('#questionPage').hide();\n setTimeout(reset, 1000 * 10);\n }", "function modalCheque()\n{\n $('#agregar_cheque').modal('show');\n}", "show(){\n\t\tthis.modalShadow.show();\n\t\tthis.modalBody.show();\n\t}", "async showModalProduct() {\n const self = this;\n self.jquery(\".modalProductToogler\").on(\"click\", async function (event) {\n event.preventDefault();\n const itemDetails = await self.getItemDetails(\n event.target.dataset.productid\n );\n\n self.updateItemDetails(itemDetails);\n self.updateItemSteps(itemDetails);\n self.updateAvailableActions(itemDetails, self.currentAddress);\n self.makeAction(itemDetails);\n\n var myModal = new bootstrap.Modal(\n document.getElementById(\"productDetails\"),\n {\n keyboard: false,\n }\n );\n myModal.show();\n });\n }", "function showModal(title, body) {\n updateModal(title, body)\n $(modal).modal('show')\n}", "function showPopupFormular() {\r\n $(\"#\" + global.Element.PopupFormular).modal(\"show\");\r\n }", "function displayModal(message) {\n $('#modal-message').html(message);\n $('#modal1').modal('open');\n}", "function showModal() {\n settings.showMap = true;\n var searchInputEl = UI.modal.find('.omniva-search input');\n if (searchInputEl.val() !== UI.search.val()) {\n searchInputEl.val(UI.search.val());\n UI.modal.find('.omniva-search button').trigger('click');\n }\n if (selected != false) {\n zoomTo(selected.pos, selected.id);\n }\n UI.modal.show();\n\n var event;\n if (typeof (Event) === 'function') {\n event = new Event('resize');\n } else {\n event = document.createEvent('Event');\n event.initEvent('resize', true, true);\n }\n window.dispatchEvent(event);\n }", "function show () {\n modal.style.display = \"block\";\n}", "function displayResults(){\n\t\t//Clear the Options section\n\t\t$(\"#options\").empty();\n\n\t\t//Display Text Results in various sections\n\t\t$(\"#questionResponse\").text(\"Here is your tally!\");\n\n\t\t$(\"#options\").append(\"<p>Correct Answers: \" + correctCount + \" </p>\");\n\t\t$(\"#options\").append(\"<p>Incorrect Answers: \" + incorrectCount + \" </p>\");\n\t\t$(\"#options\").append(\"<p>Unanswered: \" + unansweredCount + \" </p>\");\n\n\t\t//Display Start Over Button\n\t\t$(\"#startOver\").show();\n\t}", "function renderResult() {\n\t$('section.questions-page').on('click', '.button', function(event){\n\t\t$('section.modal-page').removeClass('hidden');\n\t\t$('section.questions-page').addClass('modal-render');\n\t\tconst answerPicked = $(this).siblings('span').html();\n\t\tconst question1 = currentQuest();\n\t\tif (answerCheck(answerPicked)) {\n\t\t\t$('section.modal-page').html(`\n\t\t\t\t<header role=\"heading\" class=\"modal-page-header\">Correct</header>\n \t\t\t\t<img role=\"img\" src=\"https://media.giphy.com/media/xT0xeHxJS9SNIXw568/giphy.gif\" alt=\"gif of thousand ants making a 3 pointer\" class=\"img\">\n \t\t\t\t<button role=\"checkbox\" class=\"modal-page button\">Continue</button>\n\t\t\t`);\n\t\t\tcurrentStreak ++;\n\t\t\tcurrentCorrect ++;\n\t\t\tcurrentQuestion ++;\n\t\t}\n\t\t\n\t\telse {\n\t\t\t$('section.modal-page').html(`\n\t\t\t\t<header role=\"heading\" class=\"modal-page-header\">Incorrect</header>\n \t\t\t\t<img role=\"img\" src=\"https://media.giphy.com/media/xT0xekPgV0OgNfcbuw/giphy.gif\" alt=\"gif of morty scratching his head saying aww jezz okay\">\n \t\t\t\t<p role=\"status\"class=\"modal-page-para\">The correct answer was ${question1.correctAnswer}</p>\n \t\t\t\t<button role=\"checkbox\" class=\"modal-page button\">Continue</button>\n\t\t\t`);\n\t\t\tcurrentStreak = 0;\n\t\t\tcurrentQuestion ++;\n\t\t}\n\t});\n}", "function showModal(url) {\n $(\"body\").prepend('<div id = \"invite-modal-wrapper\" class = \"border-box display-table\">'+\n\t '<div class = \"border-box display-table-cell full-width-height\">'+\n\t\t'<div id = \"invite-modal\" class = \"center\">'+\n\t\t 'Please invite your friends to use the application!<br/>'+\n\t\t '<input type = \"search\" results = \"5\" id = \"invite-search\">'+\n\t\t '<div id = \"invite-friends-section\">'+\n\t\t\t'<ul id = \"invite-friends-list\" class = \"list-style-none display-inline left\">'+\n\t\t\t'</ul>'+\n\t\t '</div>'+\n\t\t'</div>'+\n\t '</div>'+\n\t'</div>');\n\n $(\"#invite-modal\").append(\"<input type = 'button' class = 'custom-button clickable' id = 'invite-button' value = 'Invite!' />\");\n}", "function showResults(search) {\n\t//show loading icon in btn\n\tvar btn = $('#search');\n\t\tbtn.addClass('searching');\n\t$.ajax(\n\t{\n\t\turl: 'php_scripts/actions.php',\n\t\ttype: 'POST',\n\t\tdata: 'action=search&search='+search,\n\t\tdataType: 'JSON',\n\t\tsuccess: function(data) {\n\t\t\t// console.log(data.length);\n\t\t\t// console.log(typeof data[0] !== 'object');\n\t\t\t// var result = JSON.parse(data);\n\t\t\tappendResultToDom(data);\n\t\t\t//remove loading from search btn\n\t\t\tbtn.removeClass('searching');\n\t\t},\n\t\terror: function(response) {\n\t\t\t//log js errors\n\t\t\tshortTimeMesg('Alert! Search failed!', 'short-time-msg-failure');\n\t\t\t//remove loading from search btn\n\t\t\tbtn.removeClass('searching');\n\t\t}\n\t}\n\t);\n}", "function showResults( results ) {\n\n var html = '';\n $.each(results, function( index, value ) {\n html += \"<iframe src='http://www.youtube.com/embed/\" + value.id.videoId + \"' frameborder='0' allowfullscreen></iframe><br>\";\n });\n $(\"#search-results\").append(html);\n }", "function showItemAdditionScreen(){\n $('#itemAdditionScreen').modal('show');\n}", "function resultModal(x) {\n let message;\n switch (x) {\n case 10:\n message = scores[0].message;\n break;\n case 7:\n message = scores[1].message;\n break;\n case 5:\n message = scores[2].message;\n break;\n case 0:\n message = scores[3].message;\n }\n\n modal.setAttribute('id', 'modal');\n modal.innerHTML = `<div class=\"modal-text\">\n <span class=\"modal-close\" onclick=\"removeModal();\">&times;</span>\n <h2>${message}</h2>\n </div>\n\t`;\n let body = document.getElementsByTagName('body');\n body[0].appendChild(modal);\n}", "function showResults() {\n resultHeaderBefore.style.display = 'none';\n resultHeaderAfter.style.display = 'block';\n nav.style.display = 'flex';\n list.innerHTML = songsData.data\n .map(\n ({ artist, title }) =>\n `<li class=\"list-item\">\n <p class=\"list-item--text\">\n <span class=\"artist\">${artist.name}</span> - ${title}\n </p>\n <button class=\"list-item--btn\"\n data-artist=\"${artist.name}\" data-title=\"${title}\">Get the Lyrics</button>\n </li>`\n )\n .join('');\n}", "function showResults() {\n\n\t\t//var results = \"<p>Wins: \" + wins + \"</p>\" + \"<p>Losses: \" + losses + \"</p>\" + \"<p>Guesses Left: \" + guessesLeft + \"</p>\" + \"<p>Your Guesses So Far: \" + guessesMade + \"</p>\";\n\n\t\tdocument.querySelector(\"#wins\").innerHTML= wins;\n\t\tdocument.querySelector(\"#losses\").innerHTML= losses;\n\t\tdocument.querySelector(\"#left\").innerHTML= \" \" + guessesLeft;\n\t\tdocument.querySelector(\"#guesses\").innerHTML= guessesMade;\n\t\t\n\n\t}// END showResults()", "function showResults() {\n\n\t$(\"#resultstab\").removeClass('hide');\n\t$(\"#results\").removeClass('hide');\n\t$(\"#web100varstab\").removeClass('hide');\n\t$(\"#web100varsmessages\").removeClass('hide');\n\n\tinterpretResults();\n\n\t$('#ndtTab a[href=\"#results\"]').tab('show');\n\n\tdocument.getElementById(\"avgrtttext\").innerHTML = clientResults.avgrtt;\n\tsetGaugeValue(\"download\", clientResults.clientDerivedDownloadSpd);\n\tsetGaugeValue(\"upload\", clientResults.serverDerivedUploadSpd);\n\n\t// Printing property names and values using Array.forEach\n\tObject.getOwnPropertyNames(clientResults).forEach(function(val, idx, array) {\n\t\tif (clientResults[val] !== null && clientResults[val].length !== undefined && clientResults[val].length > 0 && clientResults[val].indexOf(\"function\") == -1) {\n\t\t\twriteToScreen((val + ': ' + clientResults[val]), 'web100vars');\n\t\t}\n\t});\n\n}", "function AbrirModalnuevo(){\n $(\"#nuevo\").modal('show');\n}", "function showDialog() {\r\n\t// $('#myModal').modal('hide');\r\n\tq = $(\"#asset_search_term\").val();\r\n\r\n\tif (q.length == 0) {\r\n\t\t$(\"#search_result\").html('Please enter search term');\r\n\t\treturn;\r\n\t}\r\n\r\n\t$(\"#search_result\").html('Searching.....');\r\n\r\n\t// $(\"#dialog\").html('Please wait ...');\r\n\t$\r\n\t\t\t.ajax({\r\n\t\t\t\turl : \"/inventory/search/asset?json=1&query=\" + q,\r\n\r\n\t\t\t\tsuccess : function(text) {\r\n\t\t\t\t\tvar obj = eval(text);\r\n\t\t\t\t\tvar n_hits = obj.length;\r\n\t\t\t\t\t// alert(n_hits);\r\n\t\t\t\t\t// var html = \"No asset found\"\r\n\t\t\t\t\tvar s;\r\n\t\t\t\t\tvar i;\r\n\t\t\t\t\ts = n_hits + ' Result(s) for \"' + q + '\"';\r\n\t\t\t\t\tif (n_hits > 0) {\r\n\t\t\t\t\t\ts = s\r\n\t\t\t\t\t\t\t\t+ '<table class=\"table table-striped table-bordered\"><thead><tr style=\"font-weight: bold;\"><td>ID</td><td>NAME</td><td>TAG</td><td>ACTION</td><td>DETAIL</td><td>SHOW CONSUMPTION</td></thead></tr>';\r\n\t\t\t\t\t\tfor (i = 0; i < n_hits; i++) {\r\n\t\t\t\t\t\t\ts = s + \"<tr>\"\r\n\t\t\t\t\t\t\tvar id = obj[i][\"id\"];\r\n\t\t\t\t\t\t\tvar name = obj[i][\"name\"];\r\n\t\t\t\t\t\t\tvar tag = obj[i][\"tag\"];\r\n\t\t\t\t\t\t\ts = s + '<td>' + i + '</td>';\r\n\t\t\t\t\t\t\ts = s + '<td>' + name + '</td>';\r\n\t\t\t\t\t\t\ts = s + '<td>' + tag + '</td>';\r\n\t\t\t\t\t\t\ts = s\r\n\t\t\t\t\t\t\t\t\t+ '<td><a href=\"javascript:;\" onclick=\"selectAsset(\\''\r\n\t\t\t\t\t\t\t\t\t+ id + '\\',\\'' + name + '\\',\\'' + tag\r\n\t\t\t\t\t\t\t\t\t+ '\\')\"> Select </a></td>';\r\n\r\n\t\t\t\t\t\t\ts = s + '<td><a href=\"/inventory/asset/show?id='\r\n\t\t\t\t\t\t\t\t\t+ id\r\n\t\t\t\t\t\t\t\t\t+ '\" target=\"_blank\"> Detail </a></td>';\r\n\r\n\t\t\t\t\t\t\ts = s\r\n\t\t\t\t\t\t\t\t\t+ '<td><a href=\"/inventory/spareparts/consumption?asset_id='\r\n\t\t\t\t\t\t\t\t\t+ id\r\n\t\t\t\t\t\t\t\t\t+ '\" target=\"_blank\">show consumption </a></td>';\r\n\t\t\t\t\t\t\ts = s + \"</tr>\";\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ts = s + \"</table>\";\r\n\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\ts = s + \" <p> No asset found!</p>\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// alert(s);\r\n\r\n\t\t\t\t\t$(\"#search_result\").html(s);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t// $( \"#dialog\" ).text(t);\r\n\r\n}", "function results(){\n totalMoves = moves.innerHTML;\n totalTime = timerDiv.innerHTML;\n\n let modalStars = document.querySelector('.total-stars');\n let modalTimer = document.querySelector('.total-time');\n let modalMoves = document.querySelector('.total-moves');\n\n modalMoves.innerHTML = totalMoves;\n modalTimer.innerHTML = totalTime;\n modalStars.innerHTML = `Stars remaining: ${totalStars}`\n}", "function showModal(pokemon) {\n pokemonRepository.loadDetails(pokemon).then(function() {\n let modalTitle = $('.modal-title');\n let modalBody = $('.modal-body');\n\n modalTitle.empty();\n modalBody.empty();\n\n let namePokemon = $('<h1>' + pokemon.name + '</h1>');\n let imagePokemonFront = $('<img class=\"modal-img\" style=\"width:20%\">');\n imagePokemonFront.attr('src', pokemon.imageUrlFront);\n let imagePokemonBack = $('<img class=\"modal-img\" style=\"width:20%\">');\n imagePokemonBack.attr('src', pokemon.imageUrlBack);\n let heightPokemon = $('<p>' + 'Height: ' + pokemon.height + '</p>');\n let weightPokemon = $('<p>' + 'Weight: ' + pokemon.weight + '</p>');\n let typesPokemon = $('<p>' + 'Type: ' + pokemon.types + '</p>');\n let abilitiesPokemon = $('<p>' + 'Abilities: ' + pokemon.abilities + '</p>');\n\n modalTitle.append(namePokemon);\n modalBody.append(imagePokemonFront);\n modalBody.append(imagePokemonBack);\n modalBody.append(heightPokemon);\n modalBody.append(weightPokemon);\n modalBody.append(typesPokemon);\n modalBody.append(abilitiesPokemon);\n\n $('#pokemonModal').modal('toggle');\n });\n }", "function showModal() {\n $('#modal-container').show(\"fold\", 1000);\n}", "function Results ({ results, openPopup }) {\n\treturn (\n\t\t<section className=\"results\">\n\t\t\t{results.map(result => (\n\t\t\t\t<Result key={result.imdbID} result={result} openPopup={openPopup} />\n\t\t\t))}\n\t\t</section>\n\t)\n}", "function showModal() {\n\tvar btnShowModal = $('.button-show-modal');\n\tif (btnShowModal.length > 0) {\n\t\tbtnShowModal.bind('click', function(e) {\n\t\t\te.preventDefault();\n\t\t\tvar modalTarget = $(this).data('target-modal');\n\t\t\tvar package = $(this).data('option');\n\n\t\t\tif (modalTarget.length > 0) {\n\t\t\t\t$(modalTarget).addClass('show');\n\n\t\t\t\tif ($(modalTarget).hasClass('show')) {\n\t\t\t\t\tchangeValueOptionInForm(package);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function showReserveMultipleBooks() {\n $('#reserveMultiple').modal('show');\n}", "function showResultsDiv() {\n \"use strict\";\n document.getElementById('results').style.display = 'block';\n}", "function toggleModal() {\n\t$('.modal-results').toggleClass('show-modal');\n}", "function showResults(results) {\n\t\tvar ul = document.getElementById(\"matchResultsList\");\n\t\tclearResultsList(ul);\n\t\tvar frag = document.createDocumentFragment();\n\t\tfor (var i = 0; i < results.length; i++) {\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\tli.innerHTML = results[i];\n\t\t\tfrag.appendChild(li);\n\t\t}\n\t\tul.appendChild(frag);\n\t}", "function showResultContent(result) {\r\n\tif (result.openfda.brand_name) $('#query-modal-label').html(result.openfda.brand_name);\r\n\r\n\tif (result.purpose) {\r\n\t\tvar purposeStrList = result.purpose[0].split(' ');\r\n\t\tif (purposeStrList[0].toLowerCase() == 'purpose') {\r\n\t\t\tpurposeStrList[0] = '';\r\n\t\t\tpurposeStrList[1] = purposeStrList[1].charAt(0).toUpperCase() + purposeStrList[1].slice(1);\r\n\t\t}\r\n\t\t$('#query-result-purpose').html('<b>Purpose: </b>' + purposeStrList.join(' '));\r\n\t}\r\n\r\n\tif (result.indications_and_usage) {\r\n\t\tvar usageStrList = result.indications_and_usage[0].split(' ');\r\n\t\tif (usageStrList[0].toLowerCase() == 'uses') {\r\n\t\t\tusageStrList[0] = '';\r\n\t\t\tusageStrList[1] = usageStrList[1].charAt(0).toUpperCase() + usageStrList[1].slice(1);\r\n\t\t}\r\n\t\t$('#query-result-usage').html('<b>Usage: </b>' + usageStrList.join(' '));\r\n\t}\r\n\r\n\tif (result.openfda.manufacturer_name) $('#query-result-manufacturer').html('<b>Manufacturer: </b>' + result.openfda.manufacturer_name);\r\n\tif (result.openfda.substance_name) $('#query-result-substance').html('<b>Substance: </b>' + result.openfda.substance_name);\r\n\tif (result.openfda.manufacturer_name) $('#query-result-manufacturer').html('<b>Manufacturer: </b>' + result.openfda.manufacturer_name);\r\n\r\n\tif (result.openfda.product_type) $('#query-result-type').html('<b>Product Type: </b>' + result.openfda.product_type);\r\n\tif (result.openfda.route) $('#query-result-route').html('<b>Route: </b>' + result.openfda.route);\r\n\tif (result.openfda.product_ndc) $('#query-result-prodndc').html('<b>Product NDC: </b>' + result.openfda.product_ndc);\r\n}", "function showPopupElementFormular() {\r\n $(\"#\" + global.Element.PopupElementFormular).modal(\"show\");\r\n }", "function showResults(results){\n var result = \"\";\n // got through each array and get the value of the Title only\n $.each(results, function(index,value){\n result += '<p>' + value.Title + '</p>';\n });\n // append the information into search-results div.\n $('#search-results').append(result);\n }", "function modalWindow() {\n $(\"#modal\").css('display', 'block');\n }", "function AbrirModalConsulta(){\n $(\"#modal_consultas\").modal({ backdrop: 'static', keyboard: false })\n $(\"#modal_consultas\").modal('show');\n listar_consulta_historial() ;\n}", "function showResults() {\n $(\".win-lose\").removeClass(\"hidden\");\n $(\".win-lose\").addClass(\"show\");\n $(\".main-container\").addClass(\"opacity\");\n $(\".box\").addClass(\"disableClick\");\n $(\"#player-name\").html( $(\"#nameInput\").val() )\n $(\"#player-tries\").html(tries)\n $(\"#triesSpan\").html(tries)\n}", "function showResults() {\n countdown = 5;\n clearInterval(timer);\n clearContent();\n }", "function outputModal(data){\n var deferred = Q.defer();\n\n require([\"hbs!../templates/modalDetails\"], function(template){\n $(\"#modalDetailsOutput\").html(template(data));\n deferred.resolve();\n });\n\n return deferred.promise;\n }", "function showDetails(pokemon) {\n loadDetails(pokemon).then(function () {\n showModal(pokemon); //another function is called to run the modal in the browser\n });\n }", "function showDetails(item) {\n loadDetails(item).then(function () {\n // call function to display items in modal\n populateModal(item);\n });\n }", "function showModalTopic() {\n\t// Show the modal pop up\n\t$(\"#modal-topic\").modal(\"show\");\n\t$(\"#topic-sound\")[0].play();\n\t$(\"#topic-title\").text(\"You got: \" + displayTopics[result][0] + \"!\");\n\n\t// Display the complete content to the modal\n\t$(\".topic-explanation\").text(\"You’ll get 10 questions related to \" + displayTopics[result][0] + \". For each question you answered correctly, you’ll get between 100 - 250 points. But watch out for the timer! You only have 20 seconds to answer each question.\");\n\t$(\".topic-explanation\").append(\"<p>Are you ready?</p>\");\n\n\t// Empty the div (delete the image from previous spin), then add the new image according to the topic\n\t$(\".topic-image\").empty();\n\t$(\".topic-image\").append('<img src=\"' + displayTopics[result][1] + '\">');\n\t$(\".topic-image\").children(\"img\").addClass(\"img-fluid\");\n}", "function showModal() {\n\t\t \tvar action = $(\"#myModal\").attr(\"action\");\n\t\t \n\t\t \tif (action == 'update' || action == 'create') {\n\t\t \t\t$(\"#myModal\").modal(\"show\");\n\t\t \t}\n\t\t \t\n\t\t \tshowContractEndDateSelect();\n\t\t \tshowHidePassword();\n\t\t \tshowHideConfirmPassword();\n\t\t }", "function showResultsPanel () {\n\tconst $calculatorResultsPanel = document.getElementById('calculator-results');\n\n\t// Only show animation the first time the 'Calculate' button is clicked, and if\n\t// mobile media query applies.\n\tif (window.matchMedia('screen and (max-width: 920px)').matches &&\n\t\t$calculatorResultsPanel.classList.contains('hide-results')) {\n\t\t$calculatorResultsPanel.classList.add('show-calculator-results');\n\t}\n\n\t$calculatorResultsPanel.classList.remove('hide-results');\n}", "function mostrarFechasResultantes (infoFechaInmunidad, infoFechaRevacunacion){\n //levanto el modal donde están las cajas de mensaje donde\n //cargo la información de las fechas\n $('#modalInfo').modal();\n //asigno la información de las fechas a las cajas de texto\n const infoFechaInmune = document.getElementById(\"fInmune\");\n infoFechaInmune.innerHTML = `${infoFechaInmunidad}`;\n const infoFechaRevacunar = document.getElementById(\"fRevacunacion\");\n infoFechaRevacunar.innerHTML = `${infoFechaRevacunacion}`;\n\n\n}", "async function showMovie(id) {\n const searchForASpecificMovie = await fetch(`https://www.omdbapi.com/?apikey=${apikey}&i=${id}`);\n const data = await searchForASpecificMovie.json();\n $('#modal').modal('show');\n showModal(data);\n console.log(data);\n }", "function displayResults() {\n loader.style.display = \"none\";\n resultsDiv.style.display = \"block\";\n}", "async show() {\n \n }", "function showSearchResults(response) {\n let searchArray = response.results;\n searchArray.forEach(function(planet) {\n let name = planet.name;\n let matchIndex = planetArray.findIndex(function(planet) {\n return planet.name == name;\n });\n let planetNum = matchIndex;\n $('.list-group').append(\n `<button type=\"button\" data-index=${planetNum} class=\"btn btn-info btn-block\" id=\"char-button\" data-toggle=\"modal\" data-target=\".bs-example-modal-lg\"><img src=\"\" width=\"50%\" height=\"auto\"><br />${name}</button>`);\n });\n }", "function showSearch() {\n showModal('searchmenu.html');\n}", "function showModal() {\n\t\tcurrent_username = this.textContent;\n\t\tno_of_friends = this.getAttribute(\"data-friends\");\n\t\tcurrent_modal = document.getElementsByClassName(\"modal\")[0];\n\t\tdocument.getElementsByClassName(\"modal__title\")[0].textContent = current_username;\n\t\tdocument.getElementsByClassName(\"modal__body\")[0].textContent = \"Number of friends: \" + no_of_friends;\n\t\tcurrent_modal.style.display = \"block\";\n\t\tcurrent_modal.nextElementSibling.style.display = \"block\";\n\t\tdocument.getElementsByClassName(\"modal__close\")[0].childNodes[0].addEventListener(\"click\", hideModalButton);\n\t\tdocument.getElementsByClassName(\"modal\")[0].addEventListener(\"click\", hideModalScreen);\n\t}", "function openModal() {\n modal.style.display = 'block';\n }", "function openModal() {\n modal.style.display = 'block';\n }", "function displayResults(data) {\n console.log('Results that will be displayed in HTML looks like this first:', data);\n $('#results').append(resultsHTML(data));\n }", "function showModal(modalForWin) {\n var elModal = document.querySelector(\".modal\");\n elModal.style.display = 'block'\n var resString = (modalForWin) ? `Well Done ` : 'Try again..'\n elModal.innerHTML = `${resString} <button onclick=\"init()\">Play again</button>`\n}", "function openModal () {\n\t\tmodalMoves.innerHTML = moves;\n\t\tmodalSecs.innerHTML = pad(totalTime%60);\n\t\tmodalMins.innerHTML = pad(parseInt(totalTime/60));\n\t\tmodal.style.display = 'block';\n}", "function openModal() {\n const el = document.querySelector(SELECTORS.modal);\n\n return Analytics.getStatWeightings()\n .then((weights) => {\n el.innerHTML = `\n <div class=\"modal-content\">\n <h2 class=\"title\">Weightings</h2>\n <div class=\"content\">\n ${buildWeights(weights)}\n <p>Invert = smaller number is better (ie. Losses)</p>\n </div>\n `;\n\n document.querySelector(SELECTORS.modal).classList.add(SELECTORS.modalOpen);\n });\n}", "function getResults(data, search, selectBoxValue) {\n\n searchInput.textContent = search;\n\n var listResult = document.createElement(\"div\");\n var resultBody = document.createElement(\"div\");\n\n listResult.append(resultBody);\n\n var resultTitle = document.createElement(\"h1\");\n var bodyInfo = document.createElement(\"p\");\n var bodyInfo2 = document.createElement(\"p\");\n var bodyInfo3 = document.createElement(\"p\");\n var resultBtn = document.createElement(\"button\");\n resultBtn.setAttribute(\"class\", \"infoBtn\")\n\n resultBtn.textContent = \"Click for more info.\";\n\n\n if (selectBoxValue === \"pokemon\") {\n\n //trigger modal on click to display pokemon species info\n function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\").text(data.name)\n $(\".modal-img\").attr('src', data.sprites.other['official-artwork'].front_default);\n $(\".modal-li-1\").text(\"Type: \" + data.types[0].type.name)\n $(\".modal-li-2\").text(\"Abilities: \" + data.abilities[0].ability.name + \"/\" + data.abilities[1].ability.name)\n $(\".modal-li-3\").text(\"Stats: \" + \"HP: \" + data.stats[0].base_stat + \" ATK: \" + data.stats[1].base_stat + \" DEF: \" + data.stats[2].base_stat + \" SP. ATK: \" + data.stats[3].base_stat + \" SP. DEF: \" + data.stats[4].base_stat + \" SPD: \" + data.stats[5].base_stat)\n $(\".modal-li-4\").text(\"Base XP: \" + data.base_experience);\n $(\".modal-li-5\").text(\"Height: \" + data.height + \" ft \" + \"Weight: \" + data.weight + \" lbs\")\n }\n\n //display info on search\n var pokeImg = document.createElement(\"img\");\n pokeImg.src = data.sprites.other['official-artwork'].front_default;\n resultTitle.textContent = \"Name: \" + data.name;\n bodyInfo.textContent = \"Type: \" + data.types[0].type.name;\n bodyInfo2.textContent = \"Height: \" + data.height + \" ft\"\n bodyInfo3.textContent = \"Weight: \" + data.weight + \" lbs\"\n\n //if the pokemon has more than one type, display this data\n if (data.types[1]) {\n bodyInfo.textContent = \"Type: \" + data.types[0].type.name + \"/ \" + data.types[1].type.name;\n }\n \n //append info to html container\n resultsContainer.append(pokeImg);\n\n } else if (selectBoxValue === \"type\") {\n\n resultTitle.textContent = data.name;\n \n //for loop to create data for each pokemon displayed\n for (var i = 0; i < data.pokemon.length; i++) {\n\n var typeH2 = document.createElement(\"h2\")\n typeH2.textContent = data.pokemon[i].pokemon.name;\n bodyInfo.append(typeH2);\n typeH2.setAttribute(\"class\", \"type-header\");\n }\n\n } else if (selectBoxValue === \"move\") {\n\n //show modal on click for pokemon move info\n function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\") .text(data.name)\n $(\".modal-li-1\") .text(\"Accuracy: \" + data.accuracy)\n $(\".modal-li-2\").text(\"PP: \" + data.pp)\n $(\".modal-li-3\").text(\"Power: \" + data.power)\n $(\".modal-li-4\").text(\"Type: \" + data.type.name)\n $(\".modal-li-5\").text(\"Priority: \" + data.priority)\n \n }\n \n resultTitle.textContent = data.name\n \n //for loop to create data for each pokemon displayed\n for (var i = 0; i < data.learned_by_pokemon.length; i++) {\n\n var moveH2 = document.createElement(\"h2\")\n moveH2.textContent = data.learned_by_pokemon[i].name;\n bodyInfo.append(moveH2);\n moveH2.setAttribute(\"class\", \"type-header\");\n }\n\n\n } else if (selectBoxValue === \"ability\") {\n\n //show modal on click to display pokemon ability info\n function showModal() {\n\n $('#myModal').modal(\"show\");\n $(\".modal-title\").text(data.name)\n $(\".modal-li-1\").text(\"Generation: \" + data.generation.name)\n $(\".modal-li-2\").text(\"Effect: \" + data.effect_changes[0].effect_entries[1].effect)\n $(\".modal-li-3\").text(\"Chance: \" + data.effect_entries[1].effect)\n $(\".modal-li-4\").text(\"Bonus Effect: \" + data.flavor_text_entries[0].flavor_text)\n }\n \n resultTitle.textContent = data.name\n\n //for loop to create data for each pokemon displayed\n for (var i = 0; i < data.pokemon.length; i++) {\n\n var abilityH2 = document.createElement('h2')\n abilityH2.textContent = data.pokemon[i].pokemon.name;\n bodyInfo.append(abilityH2);\n abilityH2.setAttribute(\"class\", \"type-header\");\n }\n }\n\n //append to container, then append to html\n resultBody.append(resultTitle, bodyInfo, bodyInfo2, bodyInfo3, resultBtn);\n resultsContainer.append(listResult);\n\n resultBtn.addEventListener(\"click\", showModal);\n}", "function showCompanyInfo(results) {\n $('#address').show();\n $('#website').show();\n $('#notes').show();\n $('#edit-fields').hide();\n $('#activeJobs').show();\n $('#archivedJobs').show();\n $('#companyContacts').show();\n $('#companyStreetAddress').html(results.street);\n $('#companyCity').html(results.city);\n $('#companyState').html(results.state);\n $('#companyZip').html(results.zipcode);\n $('#companyWebsite').html(results.website);\n $('#companyNotes').html(results.notes);\n}", "function showResult(event) {\n event.preventDefault();\n const fullName = getFullName();\n const email = getEmail();\n const house = getHouse();\n const family = getFamily();\n const content = getContent();\n const rate = getRate();\n const comment = getComment();\n deleteFormContent();\n const form = document.getElementById('evaluation-form');\n form.innerHTML = `${fullName}${email}${house}${family}${content}${rate}${comment}`;\n}", "function showResultUi(data) {\n result.innerHTML = '';\n data === null ? result.innerHTML = `\n <div class=\"col-md-12 text-center\">\n <p>There is no search result, try agin!</p>\n </div>\n ` :\n data.forEach(meal => {\n result.innerHTML += `\n <div class=\"col-md-2 m-0 p-1\">\n <div class=\"meal\">\n <img src=\"${meal.strMealThumb}\" alt=\"${meal.strMeal}\">\n <div id=\"${meal.idMeal}\" class=\"meal-info\">\n <p id=\"${meal.idMeal}\">${meal.strMeal}</p>\n </div>\n </div>\n </div>\n `;\n });\n}", "function showSearchBookingsModal() {\n $.ajax({\n url: \"/Booking/SearchModal/\",\n cache: false,\n type: \"Post\",\n success: function (html) {\n $(\"#modalPlaceholder\").html(html);\n $('#searchModal').modal('show');\n\n applyStyles();\n }\n });\n}", "function displayResult(result) {\n // put result on the page\n // console.log(result);\n $(\"#result\").html(result);\n\n\n // console.log(result);\n }", "function __BRE__show_modal(modal_id){$('#'+modal_id).modal('show');}" ]
[ "0.749011", "0.71826243", "0.71291447", "0.70521724", "0.6952331", "0.6876237", "0.6872094", "0.6848317", "0.68167204", "0.67512393", "0.67352414", "0.67282534", "0.6716301", "0.66508466", "0.663857", "0.65957177", "0.65520453", "0.6546719", "0.6540798", "0.6518099", "0.6495068", "0.64787376", "0.63970935", "0.63788515", "0.63549817", "0.6344399", "0.63397145", "0.633558", "0.63143116", "0.6264819", "0.626195", "0.6259463", "0.6257863", "0.6254948", "0.62394744", "0.62387604", "0.62153053", "0.6198732", "0.61897045", "0.6186532", "0.61715794", "0.6170526", "0.61376715", "0.60924804", "0.60829616", "0.6074821", "0.60686594", "0.60616356", "0.6059011", "0.60572433", "0.6053384", "0.60503024", "0.60487866", "0.6042035", "0.60357416", "0.6034754", "0.6033034", "0.6031163", "0.60281724", "0.6020267", "0.5997488", "0.5991847", "0.5991679", "0.59893095", "0.59886456", "0.59885967", "0.5983328", "0.5981596", "0.5973807", "0.59725636", "0.59659064", "0.5964324", "0.59569955", "0.59537995", "0.59526896", "0.5951777", "0.5936876", "0.5936669", "0.5930767", "0.5915266", "0.590131", "0.5901078", "0.5898289", "0.5893384", "0.5890336", "0.5884677", "0.58753186", "0.5872534", "0.5872534", "0.5864359", "0.5864254", "0.58636147", "0.5860567", "0.5859697", "0.5857444", "0.5840858", "0.583849", "0.58363897", "0.58336836", "0.5830014" ]
0.65969133
15
Clase principal de servidores, aqui nos armara la estructura principal de la vista servidores
function Conexiones() { const [modalShow, setModalShow] = React.useState(false); return ( <div className="Container" id="divServidores"> <Col xs="12"> <Col xs="10"> <h1 className="text-center">CONEXIONES</h1> </Col> <Col xs="12"> <Col xs="2"> <label></label> </Col> <Col xs="8"> <Col xs="8"> <DataTableConexiones/> </Col> <Col xs="4"> <Col xs="6" className="controller-crud"> <ButtonToolbar> <Button className="buttons boutton-crud Agregar" onClick={() => setModalShow(true)}> Agregar </Button> <FuncModalWizard show={modalShow} onHide={() => setModalShow(false)} /> <Button className="buttons boutton-crud Eliminar" id="Eliminar" disabled="disabled" onClick={() => setModalShow(true)}> Eliminar </Button> {/*<FuncModalAgregar show={modalShow} onHide={() => setModalShow(false)} />*/} </ButtonToolbar> </Col> </Col> </Col> <Col xs="2"> <label></label> </Col> </Col> </Col> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serVivo(especie) {\n //this.especie = especie;\n this.especie = especie;\n }", "function Servicio(nombre, precio, caracteristica,imagen){\n\tthis.nombre = nombre\n\tthis.precio = precio\n\tthis.caracteristica = caracteristica\n\tthis.imagen = imagen\n}", "constructor(servico, codigoRastreamento) {\n this.servico = servico;\n this.codigoRastreamento = codigoRastreamento;\n }", "function Transporte() { \n this.id;\n this.tipo; \n this.tempo;\n this.capacidade_maxima;\n this.capacidade_atual;\n this.capacidade_confortavel;\n this.conforto;\n this.posicao_inicial;\n this.posicao_final; \n this.passageiros = new Array(); \n}", "function HistoriaClinica() { //-------------------------------------------Class HistoriaClinica()\n\n this.a = [];\n\n HistoriaClinica.prototype.cargarData = function (data) {\n this.a = data;\n this.a.Adjuntos = [];\n // // this.a.II;\n // this.a.II_BD = 0;//estado inicial, se puede ir al servidor a buscar la informacion.\n }\n\n} //-------------------------------------------Class HistoriaClinica()", "function Orologio(){\n const ora = new Date();\n this.giorno = ora.getDate(); \n //il metodo getDate() ritorna il giorno del mese (da 1 a 31) esempoio 20.08.2021\n //il metodo getDay() ritorna il giorno della settimana, il formato americano parte da domenica, quindi domenica ha index 0\n this.mese = ora.getMonth();\n this.anno = ora.getFullYear();\n\n this.aggiornaMese = function(){\n //array contenente il nome dei mesi\n const mesi = ['Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre'];\n return mesi[this.mese - 1]; //nel metodo getMonth() uscirà il numero del mese corrente, che corrisponderà poi al nome nel mio array di stringhe coi nomi\n }\n this.aggiornaOra = function(){\n return ora.getHours();\n }\n this.aggiornaMinuti = function(){\n return ora.getMinutes();\n }\n this.aggiornaSecondi = function(){\n return ora.getSeconds();\n }\n}", "function constroiEventos(){}", "sacar(valor) {\n\n let taxa = 1.1;\n return super._sacar(valor, taxa); // chamar um método privado só é permitido se ele o estiver herdando da class pai, isso o torna protegido\n\n }", "function tipoServicios(servicio) {\n if (servicio == 1) {\n return 'Venta';\n } else {\n return 'Renta';\n }\n}", "constructor() {\n this.inicializar();\n this.generarSecuencia();\n this.siguienteNivel(); \n }", "function Segment(opciones)\n{\n // Define default opciones for segmentos, most are null so that the global defaults for the wheel\n // are used if the values for a particular segment are not specifically set.\n let opcionesDefecto = {\n 'size' : null, // Leave null for automatic. Valid values are degrees 0-360. Use percentToDegrees function if needed to convert.\n 'text' : '', // Default is blank.\n 'rellenoStyle' : null, // If null for the rest the global default will be used.\n 'golpeStyle' : null,\n 'lineaAncho' : null,\n 'textoFuenteFamilia' : null,\n 'textoFuenteTamano' : null,\n 'textoFuenteAncho' : null,\n 'textoOrientacion' : null,\n 'textoAlineacion' : null,\n 'textoDireccion' : null,\n 'textoMargen' : null,\n 'textoRellenoStyle' : null,\n 'textoGolpeStyle' : null,\n 'textoLineaAncho' : null,\n 'imagen' : null, // Name/path to the imagen\n 'imagenDireccion' : null, // Direction of the imagen, can be set globally for the whole wheel.\n 'imgData' : null // Image object created here and loaded with imagen data.\n };\n\n // Now loop through the default opciones and create properties of this class set to the value for\n // the option passed in if a value was, or if not then set the value of the default.\n for (let llave in opcionesDefecto) {\n if ((opciones != null) && (typeof(opciones[llave]) !== 'undefined')) {\n this[llave] = opciones[llave];\n } else {\n this[llave] = opcionesDefecto[llave];\n }\n }\n\n // Also loop though the passed in opciones and add anything specified not part of the class in to it as a property.\n // This allows the developer to easily add properties to segmentos at construction time.\n if (opciones != null) {\n for (let llave in opciones) {\n if (typeof(this[llave]) === 'undefined') {\n this[llave] = opciones[llave];\n }\n }\n }\n\n // There are 2 additional properties which are set by the code, so need to define them here.\n // They are not in the default opciones because they are not something that should be set by the user,\n // the values are updated every time the actualizarSegmentosTamano() function is called.\n this.startAngle = 0;\n this.endAngle = 0;\n}", "function setCajasServidor() {\n for (var i = 0; i < self.datosProyecto.businesModel.length; i++) {\n var businesModel = self.datosProyecto.businesModel[i];\n for (var x = 0; x < businesModel.cajas.length; x++) {\n var caja = businesModel.cajas[x];\n for (var j = 0; j < cajasServidor.length; j++) {\n if (caja.id == cajasServidor[j].id) {\n caja.titulo = cajasServidor[j].titulo;\n caja.descripcion = cajasServidor[j].descripcion;\n caja.color = cajasServidor[j].color;\n caja.textoCheck = cajasServidor[j].textoCheck;\n }\n }\n }\n }\n}", "function datos(numero1, numero2, secuencia) {\r\n this.numero_1 = numero1;\r\n this.numero_2 = numero2;\r\n this.secuencia = secuencia;\r\n}", "constructor(dato, sig) {\n this.dato = dato;\n this.sig = sig;\n this.peso = null; // solo se utiliza para cuando el nodo pertenece a la \n //lista de adyacencia del vertice\n this.color = null;\n this.nivel = null;\n this.padre = null;\n this.distancia = null;\n }", "function cliente2(nombre, sueldo){\n this.nombre = nombre;\n this.sueldo = sueldo\n}", "function IA_Actualizador() {\n IA.call(this);\n\n //\n this.actualizacion = function() {\n\n // Mientras la serpiente este viva el juego seguira.\n if(!victoria) clearInterval(jugando);\n\n Tablero.prototype.limpiar(tablero);\n muros.dibujarTodo();\n\n // Dibujo la serpiente.\n for(var i=0; i<serpiente.obtenerCant();i++) {\n if(i==0) {\n\n if(!serpiente.obtenerPos(0).giro) serpiente.obtenerPos(i).movimiento();\n\n // Verificamos la nueva posicion.\n var puntoi = serpiente.obtenerPos(0).obtenerPI();\n var pos_actual = esc.obtenerPos(puntoi.obtenerX()/esc.multiplicador, puntoi.obtenerY()/esc.multiplicador);\n\n if(victoria && pos_actual.obtenerPared()) victoria=false;\n else if(victoria && pos_actual.obtenerManzana()) {\n // Removemos la posicion actual de la manzana.\n var pos = pos_actual.obtenerObjManzana();\n pos_actual.desactivarManzana();\n pos_actual.establecerManzana(null);\n manzanas.obtenerPos(pos).posAleatoria();\n\n serpiente.extender(serpiente);\n\n // Agregamos la nueva posicion.\n var x = manzanas.obtenerPos(pos).obtenerCentro().obtenerX();\n var y = manzanas.obtenerPos(pos).obtenerCentro().obtenerY();\n esc.obtenerPos(x/esc.multiplicador, y/esc.multiplicador).activarManzana();\n esc.obtenerPos(x/esc.multiplicador, y/esc.multiplicador).establecerManzana(pos);\n }\n }\n else {\n\n var puntoi = serpiente.obtenerPos(i-1).obtenerPF().clone();\n var puntof = serpiente.obtenerPos(i).obtenerPI().clone();\n\n serpiente.obtenerPos(i).establecerPI(puntoi);\n serpiente.obtenerPos(i).establecerPF(puntof);\n }\n serpiente.obtenerPos(i).dibujar();\n }\n\n // Verficamos que la cabeza de la serpiente no coma su propio cuerpo.\n var puntoi = serpiente.obtenerPos(0).obtenerPI();\n var j=1;\n while(j<serpiente.obtenerCant() && victoria) {\n if(serpiente.obtenerPos(j).obtenerPF().equals(puntoi)) victoria=false;\n j++;\n }\n\n\n serpiente.obtenerPos(0).giro = false;\n\n // Dibujo de manzanas.\n for(var i=0; i<manzanas.obtenerCant(); i++) {\n manzanas.obtenerPos(i).dibujar();\n }\n\n }\n}", "function servicosPrestados(pet, servico) {\n servico(pet)\n}", "constructor(ojos, boca, extremidades, duenio) {\n super(ojos, boca, extremidades);\n this.duenio = duenio;\n this.estaDomesticado = true;\n }", "function RdatosLogistica(Material, Partidas, Destinos, Tiempo) {\n return { Material,Partidas, Destinos, Tiempo };\n}", "function Estado() {\n this.estado_corrente = null;\n this.estado_anterior = null;\n}", "function inicializacaoClasseProduto() {\r\n VETORDEPRODUTOSCLASSEPRODUTO = [];\r\n VETORDEINGREDIENTESCLASSEPRODUTO = [];\r\n VETORDECATEGORIASCLASSEPRODUTO = [];\r\n}", "constructor() {\n super();\n this.mutation = AGREGAR_SERVICIO_MUTATION;\n if (!NuevoServicioOrden.instance) NuevoServicioOrden.instance = this;\n }", "function Estado(nombre,final,estado_to){\n this.nombre = nombre\n this.final = final // true or false\n this.estado_to = estado_to\n}", "function servicios(servicio) {\n //creo el contenedor que va a alojar a los div de cada servicio que ofresco\n let contenedor = document.createElement(\"div\");\n contenedor.id = prefijo + servicio.id;\n contenedor.classList.add(\"col-mb-2\", \"mb-4\");\n contenedor.innerHTML = `<div class=\"card\">\n <img src=\"${servicio.imagen}\" class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${servicio.nombre}</h5>\n <p class=\"card-text\">$${servicio.precio}</p>\n <button id=\"${servicio.id}\" class = \"botonComprar\">COMPRAR</button>\n </div>`;\n //genero un nodo hijo por cada servicio que agrego (un div por cada servicio, al div que va a contener a todos)\n contenedorServicios.appendChild(contenedor);\n}", "function ControladorDeEscenas(){\n //contiene el controlador de elementos visuales\n var controladorHospitales;\n\n this.iniciaControl = function(_controladorHospitales){\n controladorHospitales = _controladorHospitales;\n }\n\n\n this.setEscena1 = function(){\n \n //pon los hospitales en grid\n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaGrid(0,0,generalWidth, generalHeight,80,150, hospitalesids));\n \n //define el diametro de los hexagonos\n //y el radio de los circulos\n controladorHospitales.controladorDeHexCharts.setDiameter(80);\n controladorHospitales.controladorDeHexCharts.setRadius(2);\n //pon las lineas Contadoras de un lado \n controladorHospitales.controladorDeLineasContadoras.movePosicionLineasContadoras(75,90);\n controladorHospitales.controladorDeLineasContadoras.setLargoLinea(50);\n }\n\n //en la escena dos ser ordenan los hospitales por delegacion o por tipo de hospital\n this.setEscena2 = function(){\n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaClustersDePosicionesPorTipo(100,100,600,600,80,150,mapHospitalesPorTipo,50));\n }\n\n //en la escena tres se muestran los datos acumulando por mes.\n this.setEscena3 = function(){\n var circulos = d3.selectAll(\"#vivo\");\n\n circulos.transition().duration(1000).attr(\"transform\", function(d) { \n return \"translate(\" + 0 + \",\" + 0 + \")\"; });\n }\n\n}", "function jchart_serie_std(){\n\t\tvar _serie = {\n\t\t\tlabel: 'Serie',\n\t\t\tcolor: '#aa0000',\n\t\t\tareacolor: '#00aa00',\n\t\t\tlinecolor: '#0000aa',\n\t\t\ttype: 'line',\n\t\t\tlinewidth: 1,\n\t\t\tshadow: 1,\n\t\t\tsdraw: 1\n\t\t};\n\t\treturn _serie;\n\t}", "constructor (nombre, apellido,sueldo, cargo){ //solicitio los parametros incluidos los que vincule\n super(nombre,apellido) // con super selecciono los parametros que pide la clase vinculada\n this.sueldo= sueldo;\n this.cargo=cargo;\n }", "reiniciarConteo() {\n this.ultimo = 0;\n this.tickets = [];\n this.grabarArchivo();\n this.ultimos4 = []\n console.log('Se ha inicializado el sistema');\n \n }", "probarFechaNacimiento(){\n //lectura del atributo fecha\n console.log(this.fecha.getFecha())\n\n //escritura del atributo\n console.log(this.fecha.setFecha(new Date(2000, 4, 6)))\n console.log(this.fecha.getFormatoLargo())\n console.log(this.fecha.setFecha(new Date(2000, 4, 6)))\n console.log(this.fecha.getFormatoLargo())\n\n //acceso a los metodos\n console.log(this.fecha.getFormatoCorto())\n console.log(this.fecha.getFormatoLargo())\n console.log(this.fecha.getEdad())\n \n }", "function VersolicitudComponent(\r\n // private _TransporteService: TransporteService,\r\n _solicitudService, _loginService, _router, _route) {\r\n this._solicitudService = _solicitudService;\r\n this._loginService = _loginService;\r\n this._router = _router;\r\n this._route = _route;\r\n this.titulo = \"Ver Solicitud\";\r\n }", "constructor(nombre, precio, marca, fechaCompra, operativo) {\n this._nombre = nombre;\n this._precio = precio;\n this._marca = marca;\n this._fechaCompra = fechaCompra;\n this._ultActualizacion = new Date();\n this._operativo = operativo;\n }", "function Estudante() {\n\n this.despedida = function () {\n console.log('Tchau! Sou da Classe Estudante');\n }\n}", "constructor(color, velocidad, ruedas, motor, marca) {\n this.tipo = 'auto';\n this.color = color;\n this.velocidad = velocidad;\n this.ruedas = ruedas;\n this.motor = motor;\n this.vendido = true;\n this.marca = marca || 'Honda';\n }", "constructor(nombre,urgencia){\n this.nombre = nombre //Se agrega this. para saber a que instancia pertenece\n this.urgencia = urgencia\n }", "function solicitarServ()\n{\n var estilo = document.getElementById(\"solicitud\").className;\n if (estilo == \"hidden\")\n {\n document.getElementById(\"solicitud\").className = \"show\";\n document.getElementById(\"solicitados\").className = \"show\"; \n }\n else \n {\n document.getElementById(\"solicitud\").className = \"hidden\";\n }\n}", "_servicioChanged(e) {\n const { selectedItem: servicio } = e.target;\n if (!servicio) return;\n\n const { tarifas: [{ valor, coopago }] } = servicio;\n this.set('formData.valor', valor);\n this.set('formData.coopago', coopago);\n }", "constructor(nombreObjeto, apellido,altura){\n //Atributos\n this.nombre = nombreObjeto\n this.apellido = apellido\n this.altura = altura\n }", "function Carro(marca) {\n this.marca = marca;\n this.numPuertas;\n //method set num puertas\n this.setPuertas = function(numPuert) {\n this.numPuertas = numPuert;\n };\n this.getDescrip = function() {\n return \"Este es un carro: \" + this.marca + \" que tiene \" + this.numPuertas + \" Puertas!\";\n };\n}", "nombreCompleeto(){\n //return this._nombre+ ' '+this._apellido+ ', '+this._departamento;\n //super es par aceder metodo padre\n return super.nombreCompleeto()+ ', '+this._departamento;\n }", "function nombreObjeto (par1, par2, parN) {\r\n\tthis.propiedad1 = valorPropiedad1;\r\n\tthis.propiedad2 = valorPropiedad2;\r\n}", "function getTeclas(){\n\tvar teclas = getData('teclas', teclado, 'default');\n\tfor(var t in teclas) teclado[t] = teclas[t];\n\treturn teclado;\n}", "function Apuesta(){\n\tvar valor;//declaracion variable private\n\tvar tipo;\n\tvar casillero;\n\t//declaracion variable static para contar instancias del objeto\n\tif ( typeof Apuesta.nApuestas == 'undefined' ) {\n Apuesta.nApuestas = 0;\n }\n ++Apuesta.nApuestas;\n\n\tApuesta.prototype.getNapuestas = function(){\n\t\t\treturn Apuesta.nApuestas;\n\t}\n\tApuesta.prototype.getValor = function(){\n\t\t\treturn valor;\n\t}\n\tApuesta.prototype.setValor = function(n){\n\t\t//validacion\n\t\t\tvalor = n;\n\t}\n}", "function Mascota(nombre, especie, raza='')//no importa el orden de los datos\n//se pone comillas en la raza para que no te salga undefined por si no lo sabemos\n\n{\n this.nombre = nombre\n this.especie = especie\n this.raza = raza//los parametros de una funcion constructora son parametros y pueden tener valores por defecto\n\n}", "function TarjetaFiltros() {\n\n this.$id_elaborador = $(\"#id_elaborador\")\n this.$id_autorizador = $(\"#id_autorizador\")\n this.$id_aprobador = $(\"#id_aprobador\")\n this.$boton_colapsible = $(\"#boton_colapsible\")\n this.$id_estado = $(\"#id_estado\")\n this.$id_fecha_inicial_final_programada = $(\"#id_fecha_inicial_final_programada\")\n this.$id_fecha_inicial_final_real = $(\"#id_fecha_inicial_final_real\")\n this.$id_compania_auditada = $(\"#id_compania_auditada\")\n this.$boton_buscar = $('#boton_buscar')\n this.$boton_limpiar = $('#boton_limpiar')\n this.init_Components()\n this.init_Events()\n}", "constructor(objeto) {\n\t\tthis.posicionamento = new posicionamento(objeto.linha, objeto.coluna);\n\t\tthis.sujo = objeto.sujo;\n\t\tthis.visitado = objeto.visitado;\n\t\tthis.listado = objeto.listado;\n\t}", "function Serveur() {\n\n\t// Récuperation de l'IP fournis par l'utilisateur\n\t//\n\tvar local = new MyLocalStorage();\n\tvar user = local.getUser();\n\tif(user.getIp() != \"\") {\n\t\tthis.IP = user.getIp();\n\t} else {\n\t\t// Adresse IP par défault\n\t\t//\n\t\tthis.IP = \"172.19.250.105\";\n\t}\n\t\n\t// Constantes des URLS avec le serveur\n\t//\n\tthis.prefix = \"http://\";\n\tthis.PORT = \"8080\";\n\t\n\tthis.URL_maladies = this.prefix + this.IP + \":\" + this.PORT + \"/RadioServer/webresources/disease/\";\n\tthis.URL_get_symptomes = this.prefix + this.IP + \":\" + this.PORT + \"/RadioServer/webresources/symptom/\";\n\tthis.URL_get_professions = this.prefix + this.IP + \":\" + this.PORT + \"/RadioServer/webresources/profession/\";\n\tthis.URL_get_symptome_maladie = this.prefix + this.IP + \":\" + this.PORT + \"/RadioServer/webresources/symptom/byDisease/\";\n\tthis.URL_brief = this.prefix + this.IP + \":\" + this.PORT + \"/RadioServer/webresources/brief/\";\n\n\t// Recuperation des maladies\n\t// Positionnement dans le local storage\n\t//\n\tServeur.prototype.getMaladie = function() {\n\t\t$.getJSON(this.URL_maladies, function(data) {\n\t\t\tmylocalStorage = new MyLocalStorage();\n\n\t\t\t// Mettre les données dans le localStorage\n\t\t\t//\n\t\t\tmylocalStorage.putListMaladie(data);\n\t\t});\n\t}\n\t// Recupération des symtômes\n\t// Positionnement dans le local storage\n\t//\n\tServeur.prototype.getSymptomes = function() {\n\t\t$.getJSON(this.URL_get_symptomes, function(data) {\n\t\t\tmylocalStorage = new MyLocalStorage();\n\t\t\t\n\t\t\t// Mettre les données dans le localStorage\n\t\t\t//\n\t\t\tmylocalStorage.putListSymptome(data);\n\t\t});\n\t}\n\t// Recupération des professions\n\t// Positionnement dans le local storage\n\t//\n\tServeur.prototype.getProfessions = function() {\n\t\t$.getJSON(this.URL_get_professions, function(data) {\n\t\t\tvar local = new MyLocalStorage();\n\t\t\t\n\t\t\t// Positionnement des données dans le localStorage\n\t\t\t//\n\t\t\tlocal.putListProfession(data);\n\t\t});\n\t}\n\t/*** Méthodes de communication avec le serveur ***/\n\t/*************************************************/\n\n\t// Envoyer un brief au serveur\n\t//\n\tServeur.prototype.sendBrief = function(brief) {\n\t\t$.ajax({\n\t\t\ttype : \"POST\",\n\t\t\turl : this.URL_brief,\n\t\t\tdata : JSON.stringify(brief),\n\t\t\tdatatype : \"json\",\n\t\t\tcontentType : \"application/json\",\n\t\t\tsuccess : OnSuccessCallMaladie,\n\t\t\terror : OnErrorCallMaladie\n\t\t});\n\n\t\t// Envoi du brief en ligne\n\t\t//\n\t\tfunction OnSuccessCallMaladie(data, status, jqXHR) {\n\t\t\tnotif(\"success\", \"Brief envoyé avec <strong>succès</strong> !\");\n\t\t}\n\n\t\t// Savegarde du brief en local\n\t\t//\n\t\tfunction OnErrorCallMaladie(jqXHR, status) {\n\t\t\tbrief.save();\n\t\t\tnotif(\"warning\", \"Brief sauvegardé avec <strong>succès</strong> !\");\n\n\t\t}\n\t}\n\t// Récuperer les symptomes d'une certaine maladie\n\t//\n\tServeur.prototype.getSymptomeDeMaladie = function(maladies) {\n\t\tvar url_get_symptom_by_id_disease = this.URL_get_symptome_maladie + maladies.getId();\n\t\n\t\t$.getJSON(url_get_symptom_by_id_disease, function(data) {\n\t\t\tvar tableSymtp = getSymtomesFromJSON(data);\n\t\t\tvar view = new View();\n\t\t\tview.setListSymptome(tableSymtp);\n\t\t});\n\t}\n\t\n\t// savoir si le serveur répond\n\t//\n\tServeur.prototype.isReachable = function(ip) {\n\t\t$.ajax({\n\t\t\ttype : \"GET\",\n\t\t\turl: this.URL_maladies,\n\t\t\tdatatype : \"json\",\n\t\t\tcontentType : \"application/json\",\n\t\t\tsuccess : OnSuccessCallMaladie,\n\t\t\terror : OnErrorCallMaladie\n\t\t});\n\n\t\t// Envoi du brief en ligne\n\t\t//\n\t\tfunction OnSuccessCallMaladie(data, status, jqXHR) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// Savegarde du brief en local\n\t\t//\n\t\tfunction OnErrorCallMaladie(jqXHR, status) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\t// Récupération des tous les briefs\n\t//\n\tServeur.prototype.getBrief = function() {\n\t\t$.getJSON(this.URL_brief, function(data) {\n\t\t\tconsole.log(data);\n\t\t});\n\t}\n\t\n\t// Récupération des tous les briefs\n\t//\n\tServeur.prototype.putMaladie = function(maladie) {\n\t\t$.ajax({\n\t\t\ttype : \"POST\",\n\t\t\turl : this.URL_maladies,\n\t\t\tdata : JSON.stringify(maladie),\n\t\t\tdatatype : \"json\",\n\t\t\tcontentType : \"application/json\",\n\t\t\tsuccess : OnSuccessCallMaladie,\n\t\t\terror : OnErrorCallMaladie\n\t\t});\n\n\t\t// Envoi du brief en ligne\n\t\t//\n\t\tfunction OnSuccessCallMaladie(data, status, jqXHR) {\n\t\t}\n\n\t\t// Savegarde du brief en local\n\t\t//\n\t\tfunction OnErrorCallMaladie(jqXHR, status) {\n\t\t}\n\t}\n}", "function vxlSilo(mode){\n this._mode = mode;\n this._actors = [];\n this.data = {};\n this.cached = {};\n this.added = {};\n this.prepare();\n}", "function Estudiante(primerNombre, asignatura) {\n // Llamamos al constructor padre, nos aseguramos (utilizando Function#call) que \"this\" se\n // ha establecido correctamente durante la llamada\n Persona.call(this, primerNombre);\n\n //Inicializamos las propiedades específicas de Estudiante\n this.asignatura = asignatura;\n}", "constructor() {\n // class (etiqueta html) (web-component)\n // Instanciar a la clase\n // Clase esta lista\n // Clase se destruye\n this.ancho = 200;\n this.cambioSueldo = new EventEmitter(); // evento\n this.mostrarResultados = new EventEmitter();\n this.suma = 0;\n this.resta = 0;\n this.multiplicacion = 0;\n this.division = 0;\n console.log('instanciando');\n }", "function getSitios() {\n sitioService.getSitios().then(function(resp){\n pasajeVm.sitios = resp;\n });\n }", "procesarControles(){\n\n }", "function Estudiante(primerNombre, asignatura) {\n // Llamamos al constructor padre, nos aseguramos (utilizando Function#call) que \"this\" se\n // ha establecido correctamente durante la llamada\n Persona.call(this, primerNombre);\n \n //Inicializamos las propiedades específicas de Estudiante\n this.asignatura = asignatura;\n }", "function Pessoa(nome, sobrenome){\n\n // atributos privados\n const ID = 123123;\n const metodos = function(){\n \n }\n\n\n //atributos ou metodos publicos\n this.Pessoa = nome;\n this.sobrenome = sobrenome;\n\n this.metodo = function(){\n console.log(\"Oi sou o Metodo\");\n }\n }", "nuevoCiclo() {\n let suma = 0;\n for (let i = 0; i < this.vecinos.length; i++) {\n if (this.vecinos[i].estado === 1) {\n suma++;\n }\n }\n\n // Aplicamos las normas\n this.estadoProx = this.estado; // Por defecto queda igual\n\n // Vida: tiene 3 vecinos\n if (this.estado === 0 && suma === 3) {\n this.estadoProx = 1;\n }\n\n // Muerte: menos de 2(soledad) o mas de 3 (inanicion)\n if (this.estado == 1 && (suma < 2 || suma > 3)) {\n this.estadoProx = 0;\n }\n }", "function ControladorDeEscenas(){\n //contiene el controlador de elementos visuales\n var controladorHospitales;\n var currentCategoria;\n\n this.iniciaControl = function(_controladorHospitales,_controaldorGrupoHospitales,_controladorLineChart,_controladorC3linechart,_controladorParallelChart){\n controladorHospitales = _controladorHospitales;\n controladorGrupoHospitales = _controaldorGrupoHospitales;\n controladorLineChart = _controladorLineChart;\n controladorC3linechart = _controladorC3linechart;\n controladorParallelChart = _controladorParallelChart;\n }\n\n\n this.setEscena1 = function(){\n \n //esconde line charts\n //controladorGrupoHospitales.hideLineCharts(); \n //controladorGrupoHospitales.resetPosicionDeDOMSGrupos();\n \n //define el diametro de los hexagonos\n //y el radio de los circulos\n controladorHospitales.controladorDeHexCharts.setDiameter(80);\n controladorHospitales.controladorDeHexCharts.setRadius(2);\n //pon las lineas Contadoras de un lado \n controladorHospitales.controladorDeLineasContadoras.movePosicionLineasContadoras(75,90);\n controladorHospitales.controladorDeLineasContadoras.setLargoLinea(50);\n controladorHospitales.controladorDeLineasContadoras.hideLineasContadoras();\n\n \n //inserta los hospitales al wrapper-all-hospitals\n //el contador es para darle tiempo a que los otros \n //g contenedores de hospitales regresen a la posición (0,0)\n //y no se vea un brinco.\n setTimeout(function(){\n controladorHospitales.insertHospitalesToWrapper();\n }, 1000); \n \n\n //pon los hospitales en grid\n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaPanal(40,300,150,hospitalesids));\n controladorGrupoHospitales.setPosicionToAllDOMSGrupos(0,0);\n controladorHospitales.resetListeners();\n controladorHospitales.resetHospitalUI();\n //controladorHospitales.addTooltipListeners();\n controladorC3linechart.hideDom();\n }\n\n //en la escena dos se ordenan los hospitales por delegacion o por tipo de hospital\n this.setEscena2 = function(categoria,anio){\n currentCategoria = categoria;\n\n var hospitalesPorTipo = categoria==\"Tipo\" ? mapHospitalesPorTipo : mapHospitalesPorZona; \n \n //controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaClustersDePosicionesPorTipo(0,0,800,400,80,150,arregloPorTipo,50));\n var arreglo_hospitalesPorTipo = createObjectToArray(hospitalesPorTipo);\n controladorGrupoHospitales.createGrupoDoms(categoria,arreglo_hospitalesPorTipo,anio);\n controladorGrupoHospitales.insertHospitalesToGroupWrapper(arreglo_hospitalesPorTipo);\n controladorGrupoHospitales.hideLineCharts();\n controladorGrupoHospitales.setPosicionToAllDOMSGrupos(450,0);\n //controladorGrupoHospitales.showLineCharts(categoria);\n \n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaPanalPorTipo(categoria,hospitalesPorTipo));\n\n controladorHospitales.addChangeOpacityListeners(categoria);\n controladorHospitales.addSelectGroupListeners(categoria);\n\n controladorC3linechart.loadDataAllHospitales(anio,categoria);\n controladorC3linechart.showDom();\n\n controladorParallelChart.hideDOM();\n }\n\n\n //en la escena tres se muestra un parallel chart comparando totales anuales\n this.setEscena3 = function(){\n controladorHospitales.resetListeners();\n controladorHospitales.addChangeOpacityListeners(currentCategoria);\n\n controladorC3linechart.loadParallelLinesAllHospitalsData(currentCategoria);\n }\n}", "function mostrarResumen(){\n const resumen = document.querySelector('.contenido-resumen');\n //Destructuring al objeto\n const {nombre,fecha,hora,servicios} = cita;\n //Limpiar el contenido de resumen \n while(resumen.firstChild){\n resumen.removeChild(resumen.firstChild);\n } \n if( Object.values(cita).includes('') || cita.servicios.length === 0){ \n mostrarAlerta('Faltan datos de servicios, fecha u hora','error','.contenido-resumen',false);\n return;\n }\n //Creamos el heading\n \n const headingCita = document.createElement('H2');\n headingCita.textContent = 'Resumen cita';\n resumen.appendChild(headingCita); \n //Añadimos en el orden que deseamos que aparezcan los datos.\n const nombreCliente = document.createElement('P');\n nombreCliente.innerHTML = `<span>Nombre : </span>${nombre}`;\n resumen.appendChild(nombreCliente);\n fechaFormateada = formatearFecha(fecha);\n const fechaCita = document.createElement('P');\n fechaCita.innerHTML = `<span>Fecha : </span>${fechaFormateada}`;\n resumen.appendChild(fechaCita);\n const horaCita = document.createElement('P');\n horaCita.innerHTML = `<span>Hora : </span>${hora}`;\n resumen.appendChild(horaCita); \n //Variable para calcular el precio total \n let precioTotal = 0;\n servicios.forEach(servicio =>{ \n //Destructuring al objeto \n const {id, precio, nombre} = servicio;\n //Sumatorio del precio total \n precioTotal += parseInt( precio); \n\n const contenedorServicio = document.createElement('DIV');\n contenedorServicio.classList.add('contenedor-servicio');\n const textoServicio = document.createElement('P');\n textoServicio.textContent = nombre; \n const precioServicio = document.createElement('DIV');\n precioServicio.innerHTML = `<span> Precio: </span> ${precio} €`;\n contenedorServicio.appendChild(textoServicio);\n contenedorServicio.appendChild(precioServicio);\n resumen.appendChild(contenedorServicio);\n });\n \n const totalTexto = document.createElement('H2');\n totalTexto.innerHTML = `<span> Total: </span> ${precioTotal} €`;\n resumen.appendChild(totalTexto); \n\n //Crear boton\n \n const botonReservar = document.createElement('BUTTON');\n botonReservar.classList.add('boton');\n botonReservar.textContent = \"Reservar cita\";\n botonReservar.onclick = reservarCita;\n \n resumen.appendChild(botonReservar); \n}", "constructor() {\n //vamos a poner un setTimeout para que no arranque ni bien el usuario pulsa el boton\n this.inicializar();\n this.generarSecuencia();\n setTimeout(this.siguienteNivel,500);\n }", "function Sarissa(){}", "function Sarissa(){}", "function Sarissa(){}", "constructor(data) {\n this.id = data.id\n this.nombre = data.nombre.toUpperCase();\n this.precio = parseFloat(data.precio);\n this.vendido = false;\n }", "function Liste() {\r\n this.elenco = [];\r\n\r\n this.inizializza =\r\n function(y) {\r\n for (var i = 0; i < y.length; i++) {\r\n var lista = new Lista();\r\n lista.inizializza(y[i]);\r\n this.elenco.push(lista);\r\n };\r\n }\r\n\r\n //scorre tutte le Scuole e creo un array associativo con le opzioni scuole\r\n this.creaSelectScuola =\r\n function() {\r\n var scuole = {};\r\n for (var i = 0; i < this.elenco.length; i++) {\r\n scuole[this.elenco[i].scuola] = true;\r\n }\r\n var selectDiv = \"<option value='null'>scegli una scuola</option>\";\r\n for (var i in scuole) {\r\n selectDiv += '<option value=\"' + i + '\">' + i + '</option>';\r\n }\r\n return selectDiv;\r\n }\r\n\r\n //scorre i maestri in base alla scuola e creo un array associativo relativo \r\n this.creaSelectMaestro =\r\n function(scuola) {\r\n var maestri = {};\r\n for (var i = 0; i < this.elenco.length; i++) {\r\n if (this.elenco[i].scuola == scuola) {\r\n maestri[this.elenco[i].maestro] = true;\r\n }\r\n }\r\n var selectDiv = \"<option value='null'>scegli un maestro</option>\";\r\n for (var i in maestri) {\r\n selectDiv += '<option value=\"' + i + '\">' + i + '</option>';\r\n }\r\n return selectDiv;\r\n }\r\n\r\n //cerca la lista in base alla scuola e al maestro scelti\r\n this.cercaMaestro =\r\n function(maestro, scuola) {\r\n var z = [];\r\n for (var i = 0; i < this.elenco.length; i++) {\r\n if (this.elenco[i].scuola == scuola && this.elenco[i].maestro == maestro) {\r\n z.push(this.elenco[i]);\r\n }\r\n }\r\n return z;\r\n }\r\n}", "function Fruta(nombre){\n//para poner cosas\n\n this.setNombre = function(valor){\n\n nombre=valor;\n };\n this.getNombre = function(){\n return nombre;\n };\n\n\n\n\n\n}", "function Computador(id, marca, procesador, ram, ssd) {\n this.id = id;\n this.marca = marca;\n this.procesador = procesador;\n this.ram = ram;\n this.ssd = ssd;\n}", "constructor(nombre, ruido) { \n this.nombre = nombre;\n this.ruido = ruido;\n }", "function Filtros () {\n this.$tipo_equipo = $('#id_tipo_equipo')\n this.$equipo = $('#id_equipo')\n this.$equipo_texto = $('#equipo_texto')\n this.$equipo_id = $('#equipo_id')\n this.$fecha_inicio = $('#id_fecha_inicio')\n this.$fecha_fin = $('#id_fecha_fin')\n this.$tipo = $('#id_tipo')\n this.$boton_limpiar = $('#boton_limpiar')\n this.$boton_buscar = $('#boton_buscar')\n this.init()\n}", "mostrarPagina(nombrePagina, id_escuderia) {\n this.paginaVacia();\n this.barraNavegacion();\n\n if (nombrePagina == \"CLASIFICACION CONSTRUCTORES\") {\n rellenarTablaClasificacionEscuderias();\n crearTablaClasificacionEscuderias();\n\n } else if (nombrePagina == \"CLASIFICACION PILOTOS\") {\n rellenarTablaClasificacionPilotos();\n crearTablaClasificacionPiloto();\n\n } else if (nombrePagina == \"HOME\") {\n paginaHome();\n\n } else if (nombrePagina == \"ESCUDERIAS\") {\n mostrarEscuderias();\n\n } else if (nombrePagina == \"CIRCUITOS\") {\n mostrarCircuits();\n\n } else if (nombrePagina == \"LOGOUT\") { //Login\n this.logout();\n this.mostrarBarraNavegacion(false);\n paginaLogin();\n\n } else if (nombrePagina == \"Login\") { //Login\n this.mostrarBarraNavegacion(false);\n paginaLogin();\n\n //SUB PAGiNES\n } else if (nombrePagina == \"ESCUDERIA-2\") { //Mostrar els pilotos\n mostrarPilotosDeXEscuderia(id_escuderia);\n \n } else if (nombrePagina == \"NUEVO CIRCUITO\") { //Añadir nou circuit\n formularioCircuito();\n\n } else if (nombrePagina == \"NUEVO PILOTO\") { //Añadir nou piloto\n formularioPiloto();\n \n } else if (nombrePagina == \"SIMULAR CARRERA\") { //Simular carrera\n simularCarrera();\n crearSimulacioClasificacionPiloto();\n }\n\n\n\n this.piePagina();\n\n console.log(nombrePagina);\n }", "function Producto(nombre, precio){ //Producto(\"parametros\")\n this.nombre = nombre; //Acceder a los parametros por medio del this\n this.precio = precio; \n}", "function Pessoa(nome, sobrenome) {\n // Atributos ou metodos publicos\n const ID;\n const metodoInterno = function () {\n \n }\n\n // Atributos ou metodos publicos\n this.nome = nome;\n this.sobrenome = sobrenome;\n\n this.metodo = function () {\n console.log(this.nome + ' Sou um metodo');\n }\n\n}", "function Produto(nome,preco){\n this.nome = nome;\n this.preco = preco;\n\n}", "function carritoUsr(clickUsr) {\n let opcionUsr = clickUsr.target.id;\n let servicioUsr = new Servicio(DATOS.find(objeto => objeto.id == opcionUsr));\n console.log(opcionUsr);\n serviciosSeleccionados.push(servicioUsr);\n //llamo a la funcion para guardar en el localstorage\n guardarLocalStorage (\"serviciosStorage\",serviciosSeleccionados);\n \n //recupero los elementos del localstorage y genero los elementos del dom\n recuperarLocalStorage (\"serviciosStorage\");\n\n\n pagoTotal();\n imprimirTotal(montoTotal); \n console.log(montoTotal); \n carritoFinal(seleccionadosStorage);\n\n}", "transport() {\n // Går gjennom varene og setter statusen på bestillingen til \"transporteres\" og varene til \"transporteres\"\n for (var i = 0; i < this.varer.length; i++) {\n s_statuser.Transport(this.varer[i].v_id, this.b_id);\n }\n this.mounted();\n this.hent();\n }", "esconder(){\n console.log(`${this._nombre} corre a ${this._velocidad}m/s y da un salto de ${this._salto}m y se esconde`)\n }", "function Cliente(cedula,nombre,apellido){\n this.cedula = cedula;\n this.nombre = nombre;\n this.apellido = apellido;\n //this.direccion = {}; //valido\n this.direccion = new Object(); //valido\n this.genero = \"\";\n this.toString = function(){\n var cadena= \"\";\n for(atributo in this){\n if(!(this[atributo] instanceof Function)){\n cadena+=atributo+ \": \" + this[atributo]+\" \"; //imprime atributos y metodos\n } \n }\n return cadena; \n /*return \"cedula: \"+this.cedula+\n \" nombre: \"+this.nombre+\n \" apellido: \"+this.apellido+\n \" genero: \"+this.genero+\n \" direccion: \"+this.direccion;*/\n }\n \n this.direccion.toString = function(){\n var cadena= \"\";\n for(atributo in this){\n if(!(this[atributo] instanceof Function)){\n cadena+=atributo+ \": \" + this[atributo]+\" \"; //imprime atributos y metodos\n } \n }\n return cadena; \n }\n \n \n \n}", "constructor(saldoInicial, cliente, agencia) {\n if(this.constructor == Conta){\n throw new Error (\"Você não deveria instanciar diretamente dessa classe\")\n }\n this._saldo = saldoInicial;\n this._cliente = cliente;\n this._agencia = agencia;\n }", "presupuesto_restante() {\n //console.log(cantidad_presupuesto);\n\n const restante_span = document.querySelector('span#restante');\n restante_span.innerHTML = `${cantidad_presupuesto.restante}`;\n this.comprobar_presupuesto();\n\n\n }", "function inventario(nombre){\n var _nombre=nombre\n var _articulos={}\n\n function add(articulo,cantidad){\n _articulos[articulo]=cantidad\n }\n function del(articulo){\n delete _articulos[articulo]\n }\n function get(articulo){\n return _articulos[articulo]\n }\n function getNombre(){\n return _nombre\n }\n\n return {\n add: add,\n del: del,\n get: get,\n getNombre: getNombre\n }\n}", "function tarea(nombre,urgencia){\n this.nombre = nombre;\n this.urgencia=urgencia;\n}", "function inicializarEmpleados() {\n\tmonitor = new Monitor(\"Pedro\", \"123A\", \"678\", \"Zumba - Yoga\", 10, 20);\n\taniadirEmpleadoTabla(monitor);\n\tvectorEmpleados.push(monitor);\n\n\tfisio = new Fisioterapeuta(\"Marina\", \"123B\", \"692\", 8);\n\taniadirEmpleadoTabla(fisio);\n\tvectorEmpleados.push(fisio);\n}", "function mostrarVentanaInicio(){\n\t//verificar el rol\n\tif (datosUsuario[0][\"idRol\"] == 3) {\n\t\tmostrarVentanaChef1(datosUsuario[0][\"nombre\"]);\t// Invoca la ventana de Cocina y envia nombre del empleado\n\t}\n\telse if(datosUsuario[0][\"idRol\"] == 2) {\n\t\tmostrarVentanaCajero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Cajero y envia nombre del empleado\n\t}\n\telse{\n\t\tmostrarVentanaMesero(datosUsuario[0][\"nombre\"]);\t//Invoca la ventana de Mesero y envia nombre del empleado\n\t}\n\n}", "function datosVenta() {\n let total = 0;\n let iva = 0;\n for (let i = 0; i < listaProductos.length; i++) {\n total += listaProductos[i].precio * listaProductos[i].cantidad;\n iva += ((listaProductos[i].precio * listaProductos[i].cantidad) * 0.16);\n }\n puntoVenta.registrarVenta(iva, total, listaProductos);\n}", "obterNegociacaoDaSemana() {\n\n //retorna uma promise \n return new Promise((resolve, reject) => {\n //fazendo requisição ajax\n\n this.http.get('negociacoes/semana').then(negociacoes => {\n resolve(negociacoes.map(objeto => new Negociacao(new Date(objeto.data), objeto.quantidade, objeto.valor)))\n })\n .catch(error => {\n console.log(erro);\n reject('Nao foi possivel obter as negociacoes da semana')\n });\n })\n }", "function Pelicula (id, titulo) {\n\n\tthis.id = id;\n\tthis.titulo = titulo;\n\n}", "function _AtualizaClasseArmaduraEstilo(nome_estilo, span_classe_armadura) {\n var usar_escudo = (nome_estilo == 'arma_escudo');\n RemoveFilhos(span_classe_armadura);\n var tem_esquiva = PersonagemPossuiTalento('esquiva');\n // AC normal.\n var span_ca_normal = CriaSpan();\n var array_exclusao = usar_escudo ? [] : ['escudo', 'escudo_melhoria'];\n ImprimeNaoSinalizado(\n 10 + gPersonagem.ca.bonus.Total(array_exclusao),\n span_ca_normal);\n Titulo(gPersonagem.ca.bonus.Exporta(array_exclusao), span_ca_normal);\n span_classe_armadura.appendChild(span_ca_normal);\n if (tem_esquiva) {\n var dom_falso = { textContent: '' };\n array_exclusao.push('esquiva');\n ImprimeNaoSinalizado(\n 10 + gPersonagem.ca.bonus.Total(array_exclusao),\n dom_falso);\n span_ca_normal.textContent += ' (' + Traduz('sem esquiva') + ': ' + dom_falso.textContent + ')';\n }\n span_ca_normal.textContent += ', ';\n // AC toque.\n var span_ca_toque = CriaSpan();\n array_exclusao =\n ['armadura', 'escudo', 'armadura_melhoria', 'escudo_melhoria', 'armadura_natural'];\n ImprimeNaoSinalizado(\n 10 + gPersonagem.ca.bonus.Total(array_exclusao),\n span_ca_toque);\n Titulo(\n gPersonagem.ca.bonus.Exporta(array_exclusao),\n span_ca_toque);\n span_ca_toque.textContent = Traduz('Toque') + ': ' + span_ca_toque.textContent;\n if (tem_esquiva) {\n var dom_falso = { textContent: '' };\n array_exclusao.push('esquiva');\n ImprimeNaoSinalizado(\n 10 + gPersonagem.ca.bonus.Total(array_exclusao),\n dom_falso);\n span_ca_toque.textContent += ' (' + Traduz('sem esquiva') + ': ' + dom_falso.textContent + ')';\n }\n span_classe_armadura.appendChild(span_ca_toque);\n // CA surpreso.\n var span_ca_surpreso = CriaSpan();\n array_exclusao = ArrayExclusaoSurpresa(gPersonagem.ca.bonus, PersonagemPossuiHabilidadeEspecial('esquiva_sobrenatural'), usar_escudo);\n ImprimeNaoSinalizado(\n 10 + gPersonagem.ca.bonus.Total(array_exclusao),\n span_ca_surpreso);\n Titulo(gPersonagem.ca.bonus.Exporta(array_exclusao), span_ca_surpreso);\n span_classe_armadura.appendChild(span_ca_surpreso);\n span_ca_surpreso.textContent = ', ' + Traduz('Surpresa') + ': ' + span_ca_surpreso.textContent;\n}", "constructor(id, name, lastName, userName, password, email, suscripcion, tipo, nombre, banco, numero, codDeSeg, fechaDeVencimiento ){\n this.id = id;\n this.name = name;\n this.lastName = lastName;\n this.userName = userName;\n this.password = password;\n this.email = email;\n this.suscripcion = suscripcion;\n this.tarjeta = {\n tipo: tipo,\n nombre: nombre,\n banco: banco,\n numero: numero,\n codDeSeg : codDeSeg,\n fechaDeVencimiento : fechaDeVencimiento,\n }\n \n }", "function Studentas(v, p, m) {\n Zmogus.call(this, v, p);\n this.m = m;\n}", "getBuscaProfundidade(verticeEscolhido) {\n\t\tif(this.trep == 1) {\n\t\t\tlet lista = this.getRepresentacao()\n\t\t\tlet quantVertice = this.getQNos()\n\t\t\tlet principal = verticeEscolhido\n\t\t\tlet backtracking = [];\n\t\t\tlet buscaProf = [];\n\t\t\tlet arrayVertices = [];\n\t\t\tlet tempo = 0;\n\n\t\t //Criação de uma lista de array contendo todos os vertices diferentes do\n\t\t //vertice escolhido pelo usuário\n\t\t for(let i = 0; i < quantVertice; i++) {\n\t\t \tif(verticeEscolhido != i) arrayVertices.push(i);\n\t\t }\n\t\t /*Estrutura auxiliar de array bidimensional contendo na primeira posição da\n\t\t segunda dimensão um objeto tendo cor, tempo da primeira passagem,\n\t\t tempo da segunda passagem e antecessor. Na segunda posição da mesma dimensão a grafo*/\n\t\t for(let i = 0; i < quantVertice; i++){\n\t\t \tbuscaProf[i] = {\n\t\t \t\tcor: \"branco\",\n\t\t \t\ttempoInicial: \"indef\",\n\t\t \t\ttempoFinal: \"indef\",\n\t\t \t\tantecessor: \"indef\",\n\t\t \t\tadj: lista[i]\n\t\t \t}\n\t\t }\n while(arrayVertices.length > 0){\n\n\t\t \tif(buscaProf[verticeEscolhido].cor == \"branco\"){\n\n\t\t \t\tbuscaProf[verticeEscolhido].cor = \"cinza\"\n\t\t \t\tbuscaProf[verticeEscolhido].tempoInicial = ++tempo\n\t\t \t\tbuscaProf[verticeEscolhido].antecessor = null\n\n\t\t \t\tbacktracking.push(verticeEscolhido);\n\n\t\t \t\tvar verticeSecundario\n\n\t\t \t\twhile(backtracking.length > 0){\n\n\t\t \t\t\tif(buscaProf[verticeEscolhido].adj.length > 0){\n\n\t\t \t\t\t\tverticeSecundario = buscaProf[verticeEscolhido].adj.shift().vertice;\n\n\t\t \t\t\t\tif(buscaProf[verticeSecundario].cor == \"branco\"){\n\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].cor = \"cinza\"\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].tempoInicial = ++tempo\n\t\t \t\t\t\t\tbuscaProf[verticeSecundario].antecessor = verticeEscolhido\n\t\t \t\t\t\t\tbacktracking.push(verticeEscolhido)\n\t\t \t\t\t\t\tverticeEscolhido = verticeSecundario\n\t\t \t\t\t\t}\n\n\n\t\t \t\t\t}\n\t\t \t\t\telse{\n\t\t \t\t\t\tbuscaProf[verticeEscolhido].cor = \"preto\"\n\t\t \t\t\t\tbuscaProf[verticeEscolhido].tempoFinal = ++tempo\n\t\t \t\t\t\tverticeEscolhido = backtracking.pop()\n\n\t\t \t\t\t}\n\t\t \t\t}\n\n\t\t \t}\n\t\t \tverticeEscolhido = arrayVertices.shift();\n\t\t }\n\n\t\t buscaProf[principal].antecessor = null\n\n\t\t return buscaProf;\n\t\t}\n\t\telse {\n\t\t\tlet matriz = this.getRepresentacao()\n\t\t\tlet quantVertice = this.getQNos()\n\t\t\tlet principal = verticeEscolhido\n\t\t\tlet backtracking = []\n\t\t\tlet buscaProf = []\n\t\t\tlet arrayVertices = []\n\t\t\tlet tempo = 0\n\n\t\t\tfor(let i = 0; i < quantVertice; i++) {\n\t\t\t\tif(verticeEscolhido != i) arrayVertices.push(i);\n\t\t\t}\n\n\t\t\tfor(let j = 0; j < quantVertice; j++){\n\t\t\t\tvar obj = {\n\t\t\t\t\tcor: \"branco\",\n\t\t\t\t\ttempoInicial: \"indef\",\n\t\t\t\t\ttempoFinal: \"indef\",\n\t\t\t\t\tantecessor: \"indef\"\n\t\t\t\t}\n\t\t\t\tbuscaProf[j] = obj\n\t\t\t}\n //contador de vertices, recebe a quantidade de vértices - 1, para ir até o penúltimo na busca\n\t\t\tlet contVert = quantVertice - 1\n\n\t\t\twhile(contVert > 0){\n\t\t\t\tif(buscaProf[verticeEscolhido].cor == \"branco\"){\n\t\t\t\t\tbuscaProf[verticeEscolhido].cor = \"cinza\"\n\t\t\t\t\tbuscaProf[verticeEscolhido].tempoInicial = ++tempo\n\t\t\t\t\tbuscaProf[verticeEscolhido].antecessor = null\n\n\t\t\t\t\tbacktracking.push(verticeEscolhido)\n\n\t\t\t\t\tvar verticeSecundario\n\n\n\t\t\t\t\twhile(backtracking.length > 0){\n\n\t\t\t\t\t\tfor(verticeSecundario = 0; verticeSecundario < quantVertice; verticeSecundario++){\n\t\t\t\t\t\t\tif(matriz[verticeEscolhido][verticeSecundario] != \"inf\"){\n\t\t\t\t\t\t\t\tif(buscaProf[verticeSecundario].cor == \"branco\"){\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].cor = \"cinza\"\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].tempoInicial = ++tempo\n\t\t\t\t\t\t\t\t\tbuscaProf[verticeSecundario].antecessor = verticeEscolhido\n\n\t\t\t\t\t\t\t\t\tbacktracking.push(verticeEscolhido)\n\t\t\t\t\t\t\t\t\tverticeEscolhido = verticeSecundario\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(verticeSecundario == quantVertice){\n\t\t\t\t\t\t\tbuscaProf[verticeEscolhido].cor = \"preto\"\n\t\t\t\t\t\t\tbuscaProf[verticeEscolhido].tempoFinal = ++tempo\n\t\t\t\t\t\t\tverticeEscolhido = backtracking.pop()\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tverticeEscolhido = arrayVertices.shift();\n\t\t\t\tcontVert--\n\t\t\t}\n\n\t\t\tbuscaProf[principal].antecessor = null\n\t\t\treturn buscaProf\n\t\t}\n }", "function Indicadores () {\n\n this.$organizaciones = $('#id_organizaciones')\n this.$spark1 = $('#spark1')\n this.$spark2 = $('#spark2')\n this.$spark3 = $('#spark3')\n this.$contenedor_graficas = $('#contenedor_graficas')\n\n this.buscar_Empleados()\n this.init_Components()\n this.init_Events()\n}", "function TarjetaFiltros(){\n\n this.$organizaciones = $('#id_organizaciones')\n this.$empresas = $('#id_empresas')\n this.$contenedor = $('#content-data')\n\n this.init_Components()\n this.init_Events()\n}", "constructor () {\n this.#data = {} // Objeto vazio\n this.#tail = -1 // Pilha vazia\n }", "constructor(nombre, ruido) {\n this.nombre = nombre;\n this.ruido = ruido;\n }", "function escolhasUtilizador(tempoRestante, valor) {\n const valorDiario = arredondarValor(valor, tempoRestante.diasRestantes)\n const valorSemanal = arredondarValor(valor, tempoRestante.semanasRestantes)\n const valorMensal = arredondarValor(valor, tempoRestante.mesesRestantes)\n\n if (tempoRestante.mesesRestantes === 0 && tempoRestante.semanasRestantes === 0 && tempoRestante.diasRestantes > 0) {\n return { valorDiario: valorDiario, dias: tempoRestante.diasRestantes }\n } else if (tempoRestante.mesesRestantes === 0) {\n return { valorSemanal: valorSemanal, semanas: tempoRestante.semanasRestantes, valorDiario: valorDiario, dias: tempoRestante.diasRestantes }\n } else return { valorMensal: valorMensal, meses: tempoRestante.mesesRestantes, valorSemanal: valorSemanal, semanas: tempoRestante.semanasRestantes, valorDiario: valorDiario, dias: tempoRestante.diasRestantes }\n}", "function Featurescars (marca, transmision, precio, color, year, modelo, motor){\n this.brand = marca;\n this.transmision = transmision;\n this.precio = precio;\n this.color_car = color;\n this.year = year;\n this.modelo = modelo;\n this.engine = motor;\n this.getPriceTon = function(){\n return (this.precio + ' ' + this.transmision)\n }\n}", "constructor(name, type, evolutions){\n //This hace referencia al elemento que está por dentro.\n this.#name = name;\n this.#type = type;\n this.#evolutions = evolutions;\n }", "function Pessoas () {\n\n\tthis.idade = 0;\n\n\tsetInterval(function() {\n\n\t\tthis.idade++;\n\t\tconsole.log(this.idade);\n\n\t}.bind(this)/*Para fazer referência do this, usa-se o bind*/, 1000); // Delay, é a demora na execusão, 1000 milisegundo que vale a 1s\n}", "function produtosVendidos() {\n var produtos = document.querySelectorAll(\".Produ\");\n let prodVendidos = Array();\n // Percorrer a lista de produtos\n for (var i = 0; i < produtos.length; i++) {\n\n // Recupera o produto no indice i da lista de produtos\n var produto = produtos[i];\n\n // pegando id\n var id = produto.querySelector(\".id\").textContent;\n\n // pegando quantidade\n var qtd = produto.querySelector(\".qtd\").textContent;\n\n let prod = {\n cdg: id,\n QTDProd: qtd\n }\n\n prodVendidos.push(prod)\n }\n return prodVendidos;\n }", "function EscuelaDigital(nombre) {\n this.cursos = [];\n this.nombre = nombre;\n }", "siguienteNivel() {\n this.subnivel = 0\n this.iluminar()\n this.agregarSecuencia()\n }", "function ConverteEntradasParaPersonagem() {\n // Limpa tudo antes de comecar.\n PersonagemLimpaGeral();\n\n gPersonagem.modo_mestre = gEntradas.modo_mestre;\n gPersonagem.modo_visao = gEntradas.modo_visao;\n gPersonagem.nome = gEntradas.nome;\n gPersonagem.raca = gEntradas.raca;\n gPersonagem.template = gEntradas.template || '';\n _ConverteTamanho();\n\n gPersonagem.alinhamento = gEntradas.alinhamento;\n gPersonagem.divindade = gEntradas.divindade;\n gEntradas.classes.forEach(function(classe_entrada) {\n gPersonagem.classes.push({ classe: classe_entrada.classe, nivel: classe_entrada.nivel || 0 });\n });\n gPersonagem.dominios = PersonagemNivelClasse('clerigo') > 0 && gEntradas.dominios && gEntradas.dominios.slice(0) || [];\n _ConverteFamiliar();\n _ConverteCompanheiroAnimal();\n gPersonagem.niveis_negativos = gEntradas.niveis_negativos || 0;\n\n gPersonagem.experiencia = gEntradas.experiencia;\n\n // Equipamentos podem afetar todo o resto.\n _ConverteEquipamentos();\n\n // Dados de vida afetam quase tudo.\n _ConverteDadosVida();\n\n // Atributos dependem dos dados de vida (incrementos).\n _ConverteAtributos();\n\n // Talentos dependem dos dados de vida.\n _ConverteTalentos();\n\n _ConvertePontosVida();\n\n // Tem que ser depois de conferir pre requisitos.\n _ConvertePericias();\n\n _ConverteListaArmas();\n _ConverteListaArmaduras();\n\n // Estilos tem que vir apos a atualizacao das armas do gPersonagem, talentos e lista de armas.\n _ConverteEstilos();\n\n _ConverteHabilidadesEspeciais();\n\n // Feiticos.\n _ConverteFeiticos();\n\n gPersonagem.notas = gEntradas.notas;\n}", "function costruttoreDatiVenditori(array) {\n var objIntermedio = {};\n var labelsPC = [];\n var dataPC = [];\n for (var i = 0; i < array.length; i++) {\n var oggettoSingolo = array[i];\n var venditore = oggettoSingolo.salesman;\n if (objIntermedio[venditore] === undefined) {\n objIntermedio[venditore] = 0;\n }\n objIntermedio[venditore] += parseInt(oggettoSingolo.amount);\n }\n for (var key in objIntermedio) {\n labelsPC.push(key);\n dataPC.push(objIntermedio[key]);\n }\n return {\n data: dataPC,\n labels: labelsPC\n }\n}", "function _ConverteFeiticos() {\n _ConverteEscolasProibidas();\n _ConverteFeiticosConhecidos();\n _ConverteFeiticosSlots();\n}" ]
[ "0.6683689", "0.6656582", "0.589316", "0.5799897", "0.5788539", "0.57455665", "0.56433046", "0.56360793", "0.56105834", "0.558008", "0.54947966", "0.5478322", "0.54645425", "0.54297626", "0.54112715", "0.53648216", "0.53526634", "0.5309353", "0.530708", "0.530462", "0.5290143", "0.5271661", "0.5263061", "0.52576166", "0.52480596", "0.5236193", "0.52353483", "0.5214323", "0.5209634", "0.51918185", "0.517342", "0.5171853", "0.5169622", "0.5157467", "0.51560587", "0.5145934", "0.51409", "0.5133298", "0.5130814", "0.51293993", "0.5128577", "0.51181823", "0.51175684", "0.51165086", "0.51108134", "0.51019794", "0.51007813", "0.5089925", "0.5082484", "0.5071047", "0.5064505", "0.5052405", "0.50509346", "0.50507134", "0.5041227", "0.5032408", "0.5030791", "0.5021461", "0.5021461", "0.5021461", "0.5016733", "0.5015978", "0.5008672", "0.50059175", "0.5000863", "0.49983183", "0.49904028", "0.49728194", "0.49616128", "0.49546123", "0.49536338", "0.49515614", "0.49469262", "0.493609", "0.49345255", "0.4934342", "0.4925178", "0.49242687", "0.49153033", "0.49125507", "0.49105638", "0.49102634", "0.49087325", "0.49081448", "0.49012992", "0.4900037", "0.4899727", "0.4899169", "0.48961318", "0.48906967", "0.4878583", "0.48776343", "0.48772782", "0.48753184", "0.48739758", "0.48692968", "0.48678052", "0.48637497", "0.4863293", "0.48556802", "0.48505074" ]
0.0
-1
funcThatReturnsPromise('foo', 1000) .then(foo => console.log(foo)) .catch(err => console.error(error))
async function someFunc() { try { const arr = [ funcThatReturnsPromise('some other shit', 1000), funcThatReturnsPromise('some other shit', 1000), funcThatReturnsPromise('some other shit', 1000) ]; const res = await Promise.all(arr); console.log(res); } catch (error) { console.error(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DoSomething() {\n return new Promise((resolve) => {\n throw new Error('boom');\n }).catch(console.log);\n}", "function showPromise(error){\n console.log(error);\n}", "function myFn() {\n return Promise.resolve(\"Hello\");\n}", "async function executeMpromise(){\n \n try{\n const val=await myPromiseFunc(10);\n console.log(val);\n }\n catch(error){\n console.log(\"Error\",err);\n }\n}", "function logToConsole(somePromise) {\n somePromise.then(value => console.log(value))\n}", "async function myPromise (){\n return \"This is my promise\"\n}", "function showPromiseError(error) {\r\n\tconsole.log(error);\r\n}", "resolvePromise(a) {\n return delay(100).then( ()=> a + ' dog');\n }", "set p(promise) {\n promise.then(function (r) {\n return console.log(r);\n });\n }", "function promiseLog(message) {\n return value => {\n console.log(message);\n return value;\n }\n}", "function myFunc (num){\r\n\r\n if(num>10){\r\n return Promise.resolve(num)\r\n }\r\n else{\r\n return Promise.reject(num)\r\n }\r\n\r\n}", "function promiseFunctionWithFailure(a,b){\n let c = a * b;\n let success = Math.random() > 0.5;\n return new Promise(\n function(resolve,reject){\n success ? resolve(c) : reject(\"ERROR!\")\n }\n )\n}", "function foo(x) {\n // start doing something that could take a while..\n\n // construct and return a promise\n return new Promise( function(resolve,reject){\n // eventually, call `resolve(..)` or `reject(..)`, which are resolution callbacks,\n // for fulfillment and rejection respectively, for the promise.\n } );\n}", "function foo() {\n return Promise.reject(25);\n}", "function printDataPromise() {\n let p = promiseFunction();\n p.then(function(beta){\n console.log(beta);\n });\n}", "function job() {\n return new Promise(function(resolve, reject) {\n setTimeout(reject, 500, 'Error happened');\n });\n}", "function doStuffSync() {\n return Promise.resolve('foo')\n // return Promise.reject('nok')\n}", "function setTimeoutPromiseFunction () {\n\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n // console.log('hello')\n // resolve('goodbye')\n // reject('Oh no!')\n }, 0);\n })\n}", "function promiseTask() {\n return Promise.resolve(\"the value is ignored\");\n}", "function SPromise(func){\n\t\t// simple/super/speedy/synchronous promise\n\t\tvar retVal, stage=0, thenFuncs = null, catchFuncs = null, finallies = null, retObj = new SPromise_construct(\n\t\t\tfunction(tFunc, cFunc){\n\t\t\t\tif (DEBUGMODE){\n\t\t\t\t\tif (tFunc != undefined && typeof tFunc !== \"function\"){\n\t\t\t\t\t\tconsole.warn(Object.prototype.toString.call(tFunc) + \" is not a valid function to be called after a successful promise\");\n\t\t\t\t\t}\n\t\t\t\t\tif (cFunc != undefined && typeof cFunc !== \"function\"){\n\t\t\t\t\t\tconsole.warn(Object.prototype.toString.call(cFunc) + \" is not a valid function to be called after a rejected promise\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stage === 0){\n\t\t\t\t\t// promise has not yet completed...\n\t\t\t\t\treturn _NOCHECK_SPromise(function(accept, reject){\n\t\t\t\t\t\tvar finalAcceptor = typeof tFunc === \"function\" ? function(){accept(tFunc(retVal));} : accept;\n\t\t\t\t\t\tvar finalRejector = typeof cFunc === \"function\" ? function(){reject(cFunc(retVal));} : reject;\n\n\t\t\t\t\t\tif (thenFuncs !== null) {\n\t\t\t\t\t\t\tif (typeof thenFuncs === \"function\") {\n\t\t\t\t\t\t\t\tthenFuncs = [ thenFuncs, finalAcceptor ];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthenFuncs.push(finalAcceptor);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else thenFuncs = finalAcceptor;\n\n\t\t\t\t\t\tif (catchFuncs !== null) {\n\t\t\t\t\t\t\tif (typeof catchFuncs === \"function\") {\n\t\t\t\t\t\t\t\tcatchFuncs = [ catchFuncs, finalRejector ];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcatchFuncs.push(finalRejector);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else catchFuncs = finalRejector;\n\t\t\t\t\t});\n\t\t\t\t} else try {\n\t\t\t\t\treturn stage === 2 ? (\n\t\t\t\t\t\ttypeof tFunc === \"function\" ? _NOCHECK_resolve( tFunc(retVal) ) : undefinedResolve\n\t\t\t\t\t) : (\n\t\t\t\t\t\ttypeof cFunc === \"function\" ? _NOCHECK_reject( cFunc(retVal) ) : undefinedResolve\n\t\t\t\t\t);\n\t\t\t\t} catch(e) {return _NOCHECK_reject(e);}\n\t\t\t},\n\t\t\tfunction(cFunc){\n\t\t\t\tif (DEBUGMODE){\n\t\t\t\t\tif (cFunc != undefined && typeof cFunc !== \"function\"){\n\t\t\t\t\t\tconsole.warn(Object.prototype.toString.call(cFunc) + \" is not a valid function to be called after a rejected promise\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stage === 0){\n\t\t\t\t\t// promise has not yet completed...\n\t\t\t\t\treturn _NOCHECK_SPromise(function(accept){\n\t\t\t\t\t\tif (catchFuncs !== null) {\n\t\t\t\t\t\t\tif (typeof catchFuncs === \"function\") {\n\t\t\t\t\t\t\t\tcatchFuncs = [ catchFuncs, function(){accept(cFunc(retVal));} ];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcatchFuncs.push(function(){accept(cFunc(retVal));});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else catchFuncs = function(){accept(cFunc(retVal));};\n\t\t\t\t\t\tif (thenFuncs !== null) {\n\t\t\t\t\t\t\tif (typeof thenFuncs === \"function\") {\n\t\t\t\t\t\t\t\tthenFuncs = [ thenFuncs, accept ];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthenFuncs.push(accept);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else thenFuncs = accept;\n\t\t\t\t\t});\n\t\t\t\t} else if (stage === 2) { // if success, then merely propagate the response transparently\n\t\t\t\t\treturn _NOCHECK_resolve(retVal);\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn typeof cFunc === \"function\" ? _NOCHECK_resolve( cFunc(retVal) ) : undefinedResolve;\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\treturn _NOCHECK_reject(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tfunction(fFunc){\n\t\t\t\tif (DEBUGMODE){\n\t\t\t\t\tif (fFunc != undefined && typeof fFunc !== \"function\"){\n\t\t\t\t\t\tconsole.warn(Object.prototype.toString.call(fFunc) + \" is not a valid function to be called 'finally' after promise\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stage === 0) {\n\t\t\t\t\tif (finallies !== null) {\n\t\t\t\t\t\tif (typeof finallies === \"function\") {\n\t\t\t\t\t\t\tfinallies = [ finallies, fFunc ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfinallies.push(fFunc);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else finallies = fFunc;\n\t\t\t\t} else try {\n\t\t\t\t\tfFunc();\n\t\t\t\t} catch(e) {\n\t\t\t\t\treturn _NOCHECK_reject(e);\n\t\t\t\t}\n\t\t\t\treturn retObj;\n\t\t\t}\n\t\t);\n\t\t// stage undefined = unfulfilled\n\t\t// stage true = accepted\n\t\t// stage false = rejected\n\n\t\tfunction acceptP(x){\n\t\t\t// This specific order should allow for max GZip compression\n\t\t\tif (stage === 0) {\n\t\t\t\tif (isPromise(x)) {\n\t\t\t\t\tx.then(acceptP, rejectP); // wait for further commitment before resolving. [FYI: this takes a non-compliant shortcut]\n\t\t\t\t} else {\n\t\t\t\t\tretVal = x;\n\t\t\t\t\tstage = 2;\n\t\t\t\t\tif (thenFuncs !== null)\t{\n\t\t\t\t\t\tif (typeof thenFuncs === \"function\") {\n\t\t\t\t\t\t\tthenFuncs(x);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthenFuncs.forEach(proxy, x);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthenFuncs = null;\n\t\t\t\t\t}\n\t\t\t\t\tcatchFuncs = null;\n\t\t\t\t\tif (finallies !== null)\t{\n\t\t\t\t\t\tif (typeof finallies === \"function\") {\n\t\t\t\t\t\t\tfinallies();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfinallies.forEach(exec);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinallies = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfunction rejectP(x){\n\t\t\tif (stage === 0) {\n\t\t\t\tretVal = x;\n\t\t\t\tstage = 1;\n\t\t\t\tif (catchFuncs !== null)\t{\n\t\t\t\t\tif (typeof catchFuncs === \"function\") {\n\t\t\t\t\t\tcatchFuncs(x);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcatchFuncs.forEach(proxy, x);\n\t\t\t\t\t}\n\t\t\t\t\tcatchFuncs = null;\n\t\t\t\t}\n\t\t\t\tthenFuncs = null;\n\t\t\t\tif (finallies !== null)\t{\n\t\t\t\t\tif (typeof finallies === \"function\") {\n\t\t\t\t\t\tfinallies();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfinallies.forEach(exec);\n\t\t\t\t\t}\n\t\t\t\t\tfinallies = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// synchonously defered stacking allows for super performance\n\t\tif (isInsidePromise === true) {\n\t\t\tpersuadoStack.push(\n\t\t\t\tfunction(){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfunc(acceptP, rejectP);\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\trejectP(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\tpStackLength = pStackLength + 1|0;//+= 3;\n\t\t} else {\n\t\t\tpromiseLevel = promiseLevel + 1|0;\n\t\t\tif (isInsidePromise = promiseLevel === promiseBufferLvl){\n\t\t\t\ttry {\n\t\t\t\t\tfunc(acceptP, rejectP);\n\t\t\t\t} catch(e) {\n\t\t\t\t\trejectP(e);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tfunc(acceptP, rejectP);\n\t\t\t\t} catch(e) {\n\t\t\t\t\trejectP(e);\n\t\t\t\t}\n\t\t\t\tif (isInsidePromise === true && promiseLevel === 1) { // if this is the outermost promise\n\t\t\t\t\tresolvePends();\n\t\t\t\t}\n\t\t\t}\n\t\t\tpromiseLevel = promiseLevel - 1|0;\n\t\t}\n\t\treturn retObj;\n\t}", "function printDataPromise() {\npromiseFunction().then(data => {\n console.log(data);\n});\n}", "function promise(func, res){\nsetTimeout(function(){func.then(dt => {res(dt)})},5000)\n}", "function promiseMaker() {\n //promise is a object which takes 2 callbacks, resolve and reject\n return new Promise(function(resolve, reject) {\n setTimeout(() => {\n var error = true;\n if (!error) {\n console.log('Promise has been resolved');\n //if the promise is kept then resolve will be called\n resolve();\n } else {\n console.log('Sorry i could not fulfill the promise');\n //if promise not kept then reject will be called;\n reject('Sorry not fulfilled');\n }\n }, 2000);\n });\n}", "async function callWithPromise() {\n const name = await call.withPromise('This is', 'asynchronism');\n console.log(name);\n}", "function wrapInPromise(func){\r\n var promise = new Promise((resolve, reject) => {\r\n resolve(func);\r\n });\r\n return promise;\r\n}", "function promise(fn) {\n return new Promise(fn);\n }", "function resolvedPromise(){\n return new Promise(((resolve) => {\n setTimeout(function(){\n let success = {message: 'delayed success'};\n resolve(success);\n }, 500);\n }));\n}", "static catchError(promise:Promise, onError:Function):Promise {\n return promise.catch(onError);\n }", "function foo() {\n prepare().then( result => console.log(result))\n console.log(\"Then the milk!!!\")\n}", "function fullPromise(param) {\n\t//PLACE YOUR CODE HERE:\n}", "function myPromise() {\n // todo make this \"done/fulfilled\" after 5 seconds\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(\"The promise is done\");\n }, 5000);\n });\n}", "function test () {\n return new Promise(() => {})\n}", "function primjer5() {\n Promise.resolve()\n .then(() => {\n // Makes .then() return a rejected promise\n throw 'Oh no!';\n })\n .then(() => {\n console.log('Not called.');\n }, reason => {\n console.error('onRejected function called: ' + reason);\n });\n}", "function testPromiseFunction(a,b){\n return new Promise((resolve,reject)=>{\n if(a<10||b<10){\n reject(\"numbers must be greater then 10\");\n }\n else{\n resolve(a*b);\n }\n });\n }", "function nativePromiseVersion() {\n // we use two functions which return promises: returnsFirstPromise() and returnsSecondPromise().\n returnsFirstPromise() // returnsFirstPromise() and ensure that the first promise resolved by using .then().\n .then((firstValue) => {\n // we log the resolved value of the first promise, firstValue, and then return returnsSecondPromise(firstValue).\n console.log(firstValue);\n return returnsSecondPromise(firstValue);\n })\n // We use another .then() to print the second promise’s resolved value to the console.\n .then((secondValue) => {\n console.log(secondValue);\n });\n }", "function helpMe() {\n return new Promise(resolve => { setTimeout(() => { \n console.log('promise');\n resolve('ok')\n }, 3000)})\n \n}", "async function noAwait() {\n let value = myPromise();\n console.log(value);\n}", "function nativePromiseVersion() {\n returnsFirstPromise()\n .then((firstValue) => {\n console.log(firstValue);\n return returnsSecondPromise(firstValue);\n })\n .then((secondValue) => {\n console.log(secondValue);\n });\n}", "function parallelPromise() {\r\n console.log('==PARALLEL with Promise.then==')\r\n resolveAfter2Seconds().then((message)=>console.log(message))\r\n resolveAfter1Second().then((message)=>console.log(message))\r\n}", "function Promise() {\n}", "function localPromiseFun(prevResult) {\n return new Promise((resolve, reject) => {\n console.log(prevResult);\n return setTimeout(() => {\n return resolve(prevResult + 1);\n }, 1000);\n });\n}", "async function waitForMyPromise() {\n const promise = new Promise((resolve) => {\n setTimeout(() => {\n resolve('done!!!');\n }, 1000)\n });\n\n const result = await promise;\n console.log('my promise is', result);\n}", "function delayWithPromise() {\n return new Promise(function (resolve, reject) {\n // Your solution here\n setTimeout(() => resolve('FULFILLED!'), 300);\n });\n\n}", "function asPromise(func, path, data, options, errMsg = \"\", processOut = arg => arg, processErr = processOut) {\n\treturn new Promise((resolve, reject) => {\n\t\tlet callback = (err, stdout, stderr) => {\n\t\t\tif (err != null) {\n\t\t\t\tconsole.log(errMsg);\n\t\t\t\treject(processErr(stderr));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresolve(processOut(stdout));\n\t\t\t}\n\t\t};\n\n\t\tlet args = (data == null) ? [path, options, callback] : [path, data, options, callback];\n\n\t\tfunc(...args);\n\t});\n}", "function wrapPromise(promise) {\n let status = \"pending\";\n let result;\n let suspender = promise.then(\n r => {\n status = \"success\";\n result = r;\n },\n e => {\n status = \"error\";\n result = e;\n }\n );\n console.log('fetch')\n return {\n read() {\n if (status === \"pending\") {\n throw suspender;\n } else if (status === \"error\") {\n throw result;\n } else if (status === \"success\") {\n return result;\n }\n }\n };\n }", "async function myFunc() {\n const promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve('Hello'), 1000);\n });\n\n const res = await promise; // Wait until the promise is resolved\n\n return res;\n}", "function wrapPromise(promise) {\n let status = \"pending\";\n let result;\n let suspender = promise.then(\n res => {\n status = \"success\";\n result = res;\n },\n error => {\n status = \"error\";\n result = error;\n }\n );\n return {\n read() {\n if (status === \"pending\") {\n throw suspender;\n } else if (status === \"error\") {\n throw result;\n } else if (status === \"success\") {\n return result;\n }\n }\n };\n}", "function error(error) {\n // The error parameter is from Promise.reject ()\n console.log(\"Error : \" + error);\n}", "function wrapPromise(promise) {\n let status = \"pending\";\n let result;\n let suspender = promise.then(\n (r) => {\n status = \"success\";\n result = r;\n },\n (e) => {\n status = \"error\";\n result = e;\n }\n );\n return {\n read() {\n if (status === \"pending\") {\n throw suspender;\n } else if (status === \"error\") {\n throw result;\n } else if (status === \"success\") {\n return result;\n }\n },\n };\n}", "function primjer8() {\n function resolveLater(resolve, reject) {\n setTimeout(function () {\n resolve(10);\n }, 1000);\n }\n function rejectLater(resolve, reject) {\n setTimeout(function () {\n reject(20);\n }, 1000);\n }\n\n var p1 = Promise.resolve('foo');\n var p2 = p1.then(function () {\n // Return promise here, that will be resolved to 10 after 1 second\n return new Promise(resolveLater);\n });\n p2.then(function (v) {\n console.log('resolved', v); // \"resolved\", 10\n }, function (e) {\n // not called\n console.log('rejected', e);\n });\n\n var p3 = p1.then(function () {\n // Return promise here, that will be rejected with 20 after 1 second\n return new Promise(rejectLater);\n });\n p3.then(function (v) {\n // not called\n console.log('resolved', v);\n }, function (e) {\n console.log('rejected', e); // \"rejected\", 20\n });\n}", "function tryMe(config) {\n\n\n const myPromise = new Promise((resolve, reject) => {\n console.log(\"Promise initialized\")\n if (config.simError) {\n // Below two ways are equivalent, difference being the messaging: `throw` prepends \"Error: \"\n //reject(\"Simulating an error\")\n throw new Error(\"Simulating an error\")\n }\n\n if (config.resolveCorrectly) {\n console.log(\"Resolving by returning the output of the resolve() function\")\n /*\n * Initially I was doing `return resolve(\"...\")`. Having `return` does not cause errors, but\n * I guess it does not make sense either. Also I **must** call resolve() (or reject() if\n * the operation fails), else the callbacks passed to any subsequent `then()` will\n * have `undefined` argument passed to them.\n */\n resolve(\"crap\")\n } else if (config.semiCorrect) {\n /*\n * This does not work to resolve the promise. Inside Promise constructor, must invoke `resolve()`\n * function argument that the JavaScript engine passes to this executor (or `reject()` if the \n * operation failed), see comment above.\n */\n console.log(\"Resolving by returning a string\")\n return \"half-ass\"\n }\n })//.catch(reason => console.log(\"Failure reason is \" + reason))\n\n // \n const whatIsThis = myPromise.then()\n\n // Racy read of Promise returned by myPromise defined above, most likely will give\n // Promise { <pending> } (impossible to deterministically get its state when invoked this way)\n console.log(\"whatIsThis (racy read) is: \")\n console.log(whatIsThis)\n //console.log(Promise.prototype)\n\n /*\n * This `then()` will always get executed. Why? Because above we caught one of the two only\n * possible outcomes of the Promise, namely \"resolved\" or \"rejected\".\n */\n let andWtfIsThis = whatIsThis.then(function (x) {\n console.log(\"Was promise properly resolved? \" + config.resolveCorrectly)\n /*\n * This read on the other hand is not racy because the \"whatIsThis\" promise\n * has already ben \"resolved\". We know that because this function, as per the Promise.then()\n * contract, is executed as a callback once the Promise has successfully resolved\n */\n console.log(\"First `then()`, Inside a callback that gets invoked after the Promise has been succcessfull\"\n + \" resolved. Resolved value is \" + x + \", and the promise object itself is:\")\n console.log(whatIsThis)\n return \"first `then()` success value\"\n }, (err) => console.log(\"Inside first `then()`, something bad happened: \" + err)).then(function (y) {\n /*\n * Because the previous `then()` ommitted the arguments, as per the MDN docs [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then), \n * this then() received the Promise in the same settled state as before that then().\n */\n console.log(\"Really? Called `then()` a second time, here's returned value of previous promise \" \n + \"(if any): \" + y\n + \", and the promise object itself is:\")\n //console.log(this)\n return y\n }, (err) => console.log(\"Second `then()` reject handler says: \" + err)).then((z) => {\n console.log(\"Really, again? Called `then()` a third time, value passed to success handler is \" + z)\n console.log(whatIsThis)\n })\n\n // This call goes into JavaScript's main event loop, meaning that it's executed synchronously\n console.log(\"andWtfIsThis is \" + andWtfIsThis)\n\n andWtfIsThis.then((w) => {\n console.log(\"Inside the andWtfIsThis.then()\")\n console.log(\"andWtfIsThis done right is \" + andWtfIsThis)\n console.log(\"andWtfIsThis' resolved value is \" + w)\n })\n\n //Promise.resolve.\n}", "function promiseGenerator(value) {\n return new Promise((resolve) => {\n console.log(value)\n resolve(value)\n })\n}", "function asyncThing(value) {\n return new Promise((resolve, reject) => {\n setTimeout(() => resolve(value), 100)\n })\n}", "async function doSomething() {\n // resolve is callback function\n //reject is a callback\n\n logger.log('2: function is called');\n return new Promise((resolve, reject) => {\n\n\n // read from the database.. example\n // the following timeout function is asynchronus block of code\n setTimeout(function () {\n // anonymous function that simulates reading from the database\n resolve(\"3:reading from the database\")\n\n\n // error scenarios\n // var error= new Error(\" connection failed with the database\")\n // reject(error);\n }, 3000);\n });\n\n\n\n}", "_promiseTry(fn) {\n try {\n return this.Promise.resolve(fn());\n } catch (e) {\n return this.Promise.reject(e);\n }\n }", "function primjer2() {\n // using a resolved promise, the 'then' block will be triggered instantly, \n // but its handlers will be triggered asynchronously as demonstrated by the console.logs\n const resolvedProm = Promise.resolve(33);\n\n let thenProm = resolvedProm.then((value) => {\n console.log(\"this gets called after the end of the main stack. the value received and returned is: \" + value);\n return value;\n });\n // instantly logging the value of thenProm\n console.log(thenProm);\n\n // using setTimeout we can postpone the execution of a function to the moment the stack is empty\n setTimeout(() => {\n console.log(thenProm);\n });\n\n\n // logs, in order:\n // Promise {[[PromiseStatus]]: \"pending\", [[PromiseValue]]: undefined}\n // \"this gets called after the end of the main stack. the value received and returned is: 33\"\n // Promise {[[PromiseStatus]]: \"resolved\", [[PromiseValue]]: 33}\n}", "function r(t){try{return Promise.resolve(t())}catch(t){return Promise.reject(t)}}", "function primjer3() {\n Promise.resolve('foo')\n // 1. Receive \"foo\", concatenate \"bar\" to it, and resolve that to the next then\n .then(function (string) {\n return new Promise(function (resolve, reject) {\n setTimeout(function () {\n string += 'bar';\n resolve(string);\n }, 1);\n });\n })\n // 2. receive \"foobar\", register a callback function to work on that string\n // and print it to the console, but not before returning the unworked on\n // string to the next then\n .then(function (string) {\n setTimeout(function () {\n string += 'baz';\n console.log(string);\n }, 1)\n return string;\n })\n // 3. print helpful messages about how the code in this section will be run\n // before the string is actually processed by the mocked asynchronous code in the\n // previous then block. \n .then(function (string) {\n console.log(\"Last Then: oops... didn't bother to instantiate and return \" +\n \"a promise in the prior then so the sequence may be a bit \" +\n \"surprising\");\n\n // Note that `string` will not have the 'baz' bit of it at this point. This \n // is because we mocked that to happen asynchronously with a setTimeout function\n console.log(string);\n });\n\n // logs, in order:\n // Last Then: oops... didn't bother to instantiate and return a promise in the \n // prior then so the sequence may be a bit surprising\n\n // foobar\n // foobarbaz\n}", "function primjer7() {\n Promise.resolve()\n .then(() => {\n // Makes .then() return a rejected promise\n throw 'Oh no!';\n })\n .catch(reason => {\n console.error('onRejected function called: ' + reason);\n })\n .then(() => {\n console.log(\"I am always called even if the prior then's promise rejects\");\n });\n}", "function catchPromiseError(promise) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n try {\n return [undefined, yield promise];\n }\n catch (e) {\n return [e, undefined];\n }\n });\n}", "function promiseFunction(value) {\n return sleepPromise.then(() => value);\n }", "function wait(seconds){\n seconds = seconds * 1000;\n return new Promise(resolve => {\n setTimeout(()=> {\n if(seconds > 1000){\n console.log(\"You\\'ll see this after \" + seconds/1000 + \" seconds\");\n } else{\n console.log(\"You\\'ll see this after \" + seconds/1000 + \" second\");\n }\n }, seconds)\n\n });\n\n}", "function myFunction2 () {\n return Promise.resolve('Hello')\n}", "function timeoutPromise() {\n let interval=getRandomInt(1,10);\n //console.log(\"interval:\"+interval);\n return new Promise((resolve, reject) => {\n setTimeout(function(){\n resolve(\"successful\");\n }, interval*1000);\n });\n}", "async function p(fn, ...args) {\n return new Promise((resolve, reject) => {\n fn(...args, result => {\n if (chrome.runtime.lastError) {\n reject(chrome.runtime.lastError);\n } else {\n resolve(result);\n }\n });\n });\n}", "function test() {\n return new Promise((resolve, reject) => {\n promise1()\n .then((ret1) => {\n console.log(ret1);\n promise2()\n .then((ret2) => {\n console.log(ret2)\n promise3()\n .then((ret3) => {\n console.log(ret3);\n })\n .catch((err) => {\n console.error(`Error in promise3`);\n reject(err);\n });\n promise4()\n .then((ret4) => {\n console.log(ret4);\n })\n .catch((err) => {\n console.error(`Error in promise4`);\n reject(err);\n });\n resolve('success!');\n })\n .catch((err) => {\n console.error(`Error in promise2`);\n reject(err);\n });\n })\n .catch((err) => {\n console.error(`Error in promise1`);\n reject(err);\n });\n });\n}", "function usingLongTimeWork() {\n longTimeWork(true, \"test\") // try true/false\n .then(function (e) {\n console.log(e);\n })\n .catch(function (e) {\n console.log(e);\n })\n}", "function waitFor(seconds) {\n return new Promise((resolve) => {\n setTimeout(() => {\n console.log(\"resolved\");\n resolve();\n }, seconds);\n });\n}", "function hola(nombre) {\n return new Promise((resolve, reject) => {\n setTimeout(function () {\n console.log(\"Hola \" + nombre);\n resolve(nombre);\n }, 1000);\n });\n}", "function exceptionPromise(){\n \n return new Promise((resolve, reject)=>{\n setTimeout(function(){\n try{\n console.log(\"in setTimeout\");\n // reject(\"error!\");\n throw new Error(\"error!\");\n //resolve(\"ok\");\n } catch (e) {\n reject(e);\n } \n }, 1500);\n });\n}", "function error(error) {\n // error Parameter from Promise.reject()\n console.log(\"Error : \" + error);\n}", "function r(e,t,a,i){return new(a||(a=Promise))(function(n,r){function s(e){try{l(i.next(e))}catch(t){r(t)}}function o(e){try{l(i[\"throw\"](e))}catch(t){r(t)}}function l(e){e.done?n(e.value):new a(function(t){t(e.value)}).then(s,o)}l((i=i.apply(e,t||[])).next())})}", "async function f() {\n return Promise.resolve(1);\n}", "function sc_makePromise(proc) {\n var isResultReady = false;\n var result = undefined;\n return function() {\n\tif (!isResultReady) {\n\t var tmp = proc();\n\t if (!isResultReady) {\n\t\tisResultReady = true;\n\t\tresult = tmp;\n\t }\n\t}\n\treturn result;\n };\n}", "function s(e,t,n,a){return new(n||(n=Promise))((function(r,i){function o(e){try{l(a.next(e))}catch(e){i(e)}}function s(e){try{l(a.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}l((a=a.apply(e,t||[])).next())}))}", "async function asyncFuncExample(){\n let resolvedValue = await myPromise();\n console.log(resolvedValue);\n }", "function promiseErrorChaining(promise, resolutionHandler, rejectionHandler) {}", "function microCreatesMacro()\n{\n Promise.resolve().then(() => \n {\n setTimeout(() => console.log(\"timeout\"), 0);\n }).then(() => \n {\n console.log(\"promise\");\n });\n}", "function asPromised(fn) {\n const promiseWrappedHandler = Promise.method(fn);\n return function (msg, cb) {\n return promiseWrappedHandler.call(this, msg).catch(function (err) {\n console.error('io call error for msg=' + msg + ':\\n\\t' + (err.stack ? err.stack : err));\n return Promise.reject(err instanceof Error ? err.message : err);\n }).asCallback(cb);\n };\n}", "function asyncWorkSimple(param) {\n console.log('doing work...', param);\n return new Promise((resolve, reject) => work(100) ? resolve('Succ') : reject('Err'));\n}", "function testNum(num) {\n return new Promise((resolve, reject) => {\n resolve(num > 10);\n });\n}", "function makePromise(val) {\r\n return new Promise((resolve, reject) => {\r\n setTimeout(function () {\r\n resolve(val);\r\n }, Math.random() * 1000);\r\n setTimeout(function () {\r\n reject('rejected!');\r\n }, Math.random() * 2000);\r\n });\r\n}", "async function myfunc() {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve(\"okk\"), 2000);\n });\n\n const result = await promise;\n // await makes it wait till the promise resolves and after the promise is resolved\n // after that it assigns the data returned from the promise to result\n return result;\n}", "function g(){\n return Promise.resolve(3);\n}", "async function getResult() {\n try {\n const result = await addWithPromise(2)\n console.log(\"Using promise with async and await:\", result);\n }\n catch (err) {\n console.log(err)\n }\n}", "function failed(err) {\n //console.log(\"Promise failed with error: \" + err);\n logger.error(err);\n}", "function initiateRequest() {\n loaderDiv.classList.toggle('animate');\n let result = new Promise((resolve, reject) => {\n setTimeout(() => {\n console.log(\"Inside promise\");\n resolve(\"API call has got the response\");\n // reject(\"Error while getting data from the API\");\n }, 2000);\n });\n\n result\n .then((res) => {\n console.log(\"After Promise call \", res);\n })\n .then(_ => {\n console.log('Inside second then ');\n })\n .then(_ => {\n console.log('Inside Third then');\n // throw new Error('hey error');\n })\n .catch((err) => {\n console.log(err);\n })\n .finally(_ => {\n loaderDiv.classList.toggle('animate');\n })\n}", "function s(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(e){i(e)}}function c(t){try{u(r[\"throw\"](t))}catch(e){i(e)}}function u(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(a,c)}u((r=r.apply(t,e||[])).next())}))}", "throwError() {\n return new Promise((resolve, reject) =>{\n setTimeout(() => reject(new Error('Intentional Error')), 200)\n })\n }", "function promiseFn() {\n return Promise.reject(value);\n }", "function sleep_for(ms) {\r\n return new Promise(function (resolve) {\r\n setTimeout(resolve, ms);\r\n });\r\n}", "function nativePromiseDinner() {\n brainstormDinner().then((meal) => {\n console.log(`I'm going to make ${meal} for dinner.`);\n })\n}", "function getResponse() {\n return new Promise(function (resolve, reject) {\n setTimeout(function () {\n resolve(\"Executed after 3 seconds\");\n }, 3000);\n });\n}", "function getDataAndDoSomethingAsync() {\n getDataAsync()\n .then((data) => {\n doSomethingHere(data);\n })\n .catch((error) => {\n throw error;\n });\n}", "async function simpleReturn() {\n return 1;\n}", "function QuerablePromise(promise) {\n\n var isPending = true;\n var result = promise.then(\n () => { isPending = false }\n )\n result.isPending = function () { return isPending }\n return result;\n}", "function t(e,t,l,i){return new(l||(l=Promise))((function(n,o){function c(e){try{a(i.next(e))}catch(e){o(e)}}function s(e){try{a(i.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?n(e.value):(t=e.value,t instanceof l?t:new l((function(e){e(t)}))).then(c,s)}a((i=i.apply(e,t||[])).next())}))}", "function cuadradoPromiseV1(value) {\n if (typeof value !== 'number') {\n return Promise.reject(`Error, ${value} no es un número`);\n }\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve({\n value,\n result: value * value\n });\n }, Math.random() * 1000)\n })\n}", "function generalPromise(f, ...params){\n return new Promise( function(resolve, reject){\n let fnc = params.length > 0 ? f.bind(f, params, resolve) : f.bind(f, resolve);\n fnc();\n }).then(function(text=\"\"){\n return text;\n });\n}", "function getPromise(\n url, // full api path\n timeout, // After that, fail.\n verb, // GET, PUT, DELETE, POST, etc\n happyCode, // if met, resolve, otherwise fail.\n data = null, // payload, when needed (PUT, POST...)\n show = true, // Show the traffic [true]|false\n headers = null) { // Array of { name: '', value: '' }\n\n if (show === true) {\n document.body.style.cursor = 'wait';\n }\n\n if (DEBUG) {\n console.log(\">>> Promise\", verb, url);\n }\n\n let promise = new Promise((resolve, reject) => {\n let xhr = new XMLHttpRequest();\n let TIMEOUT = timeout;\n\n let req = verb + \" \" + url;\n if (data !== undefined && data !== null) {\n req += (\"\\n\" + JSON.stringify(data, null, 2));\n }\n\n xhr.open(verb, url, true);\n if (headers === null) {\n xhr.setRequestHeader(\"Content-type\", \"application/json\");\n } else {\n headers.forEach(header => xhr.setRequestHeader(header.name, header.value));\n }\n try {\n if (data === undefined || data === null) {\n xhr.send();\n } else {\n xhr.send(JSON.stringify(data));\n }\n } catch (err) {\n console.log(\"Send Error \", err);\n }\n\n let requestTimer = setTimeout(() => {\n xhr.abort();\n let mess = {code: 408, message: 'Timeout'};\n reject(mess);\n }, TIMEOUT);\n\n xhr.onload = () => {\n clearTimeout(requestTimer);\n if (xhr.status === happyCode) {\n resolve(xhr.response);\n } else {\n reject({code: xhr.status, message: xhr.response});\n }\n };\n });\n return promise;\n}" ]
[ "0.70482194", "0.6861789", "0.683348", "0.68021506", "0.678471", "0.66927874", "0.65978503", "0.65958655", "0.6539224", "0.6511096", "0.6489543", "0.6472888", "0.6464713", "0.6403899", "0.6394366", "0.63557816", "0.63242114", "0.6312535", "0.629118", "0.62504953", "0.62149304", "0.620716", "0.61998206", "0.61717224", "0.61704385", "0.6158901", "0.6157304", "0.6155433", "0.6153411", "0.61267626", "0.6117698", "0.61174107", "0.60913765", "0.6089912", "0.6076709", "0.6052236", "0.60465926", "0.60444885", "0.6042153", "0.60381866", "0.60349494", "0.6034552", "0.6034123", "0.60336715", "0.60320204", "0.60303533", "0.60153705", "0.60063475", "0.6001999", "0.5986508", "0.5984831", "0.5979536", "0.5962545", "0.5951011", "0.5949349", "0.5949185", "0.5946664", "0.59277046", "0.59231454", "0.59206694", "0.5910843", "0.58984673", "0.589597", "0.5889382", "0.5889077", "0.58764064", "0.5876165", "0.58729625", "0.586716", "0.58670336", "0.5866343", "0.5862562", "0.5861824", "0.5861258", "0.5855314", "0.58526504", "0.5842035", "0.58272284", "0.5819031", "0.5816361", "0.5802402", "0.57995003", "0.5799294", "0.5785484", "0.577658", "0.57678175", "0.5758587", "0.57525015", "0.57485825", "0.57416594", "0.57395196", "0.57381225", "0.57298636", "0.57257664", "0.572063", "0.5719183", "0.5714574", "0.5714437", "0.57051975", "0.570472" ]
0.5747561
89
Initializes JSDOM environment for the application run
async function _initJSDom() { const content = await _getIMAResponseContent(); // SPA jsdom interpreter const jsdom = new JSDOM(content, { pretendToBeVisual: true, url: `${config.protocol}//${config.host}/`, }); // Setup node environment to work with jsdom window const { window } = jsdom; global.window = window; global.jsdom = jsdom; global.document = window.document; // Extend node global with created window vars Object.defineProperties(global, { ...Object.getOwnPropertyDescriptors(window), ...Object.getOwnPropertyDescriptors(global), }); // set debug before IMA env debug global.$Debug = true; // Mock dictionary global.$IMA.i18n = generateDictionary(imaConfig.languages, config.locale); // Mock scroll for ClientWindow.scrollTo for ima/core page routing scroll global.window.scrollTo = () => {}; // Replace window fetch by node fetch global.window.fetch = global.fetch; // Required for JSDOM XPath selectors global.console.assert = assert; // eslint-disable-line no-console // Call all page scripts (jsdom build-in runScript creates new V8 context, unable to mix with node context) const pageScripts = jsdom.window.document.getElementsByTagName('script'); if (typeof config.pageScriptEvalFn === 'function') { for (const script of pageScripts) { config.pageScriptEvalFn(script); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _initJSDom() {\n const jsdom = new JSDOM(\n `<!doctype html><html id=\"main-html\"><body><div id=\"${config.masterElementId}\"></div></body></html>`\n );\n const { window } = jsdom;\n\n global.window = window;\n global.document = window.document;\n global.navigator = {\n userAgent: 'node.js'\n };\n global.jsdom = jsdom;\n global.$IMA = global.$IMA || {};\n global.window.$IMA = global.$IMA;\n global.window.$Debug = global.$Debug;\n global.window.scrollTo = () => {};\n global.window.fetch = require('node-fetch');\n global.sessionStorage = {\n setItem: () => {},\n removeItem: () => {}\n };\n\n // To skip protocol/host not same as server's error (ima/main.js)\n jsdom.reconfigure({\n url: `${config.protocol}//${config.host}/`\n });\n\n global.$IMA.$Protocol = config.protocol;\n global.$IMA.$Host = config.host;\n global.$IMA.$Env = config.environment;\n global.$IMA.$App = {};\n\n // To skip Image is not defined error\n global.Image = global.window.Image;\n // To skip CustomEvent is not defined error\n global.CustomEvent = global.window.CustomEvent;\n }", "function setUpDomEnvironment() {\n const { JSDOM } = jsdom;\n const dom = new JSDOM('<!doctype html><html lang=\"en\"><body> </body></html>', { url: 'http://localhost/' });\n const { window } = dom;\n\n global.shallow = shallow;\n global.render = render;\n global.mount = mount;\n global.window = window;\n global.document = window.document;\n global.navigator = {\n userAgent: 'node.js',\n };\n copyProps(window, global);\n}", "function initJsdom() {\n var jsdom = require('jsdom').jsdom;\n\n global.document = jsdom('');\n global.window = document.defaultView;\n global['XMLHttpRequest'] = document.defaultView['XMLHttpRequest'];\n}", "function init() {\n\t\tcacheDOM();\n\t\tbindEvents();\n\t}", "function init() {\n initializeVariables();\n initializeHtmlElements();\n}", "init() {\n this.initDOMListeners();\n }", "function init() { \n SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs('domTools.js');\n }", "function init() {\n setDomEvents();\n }", "function init() {\n populateDOMElementVariables();\n setUpInputBindings();\n return;\n}", "function initOnDomReady() {}", "init() {\n this.initDomListeners()\n }", "function initEnv() {\n var found = false;\n var env;\n var dig = [ // main\n [\"fs-person-page\", \"fs-tree-person-sources\", \"fs-source-list\",\n \"fs-source-list-container\", \"fs-source\"],\n // main, edit\n [\"fs-person-page\", \"fs-tree-person-sources\", \"fs-tree-collapsable-card\", \"fs-source-list\",\n \"fs-source-list-container\", \"fs-source\"],\n // marriage, parent-child\n [\"fs-person-page\", \"fs-tree-person-details\", \"fs-tree-person-family\",\n \"fs-family-members\", \"fs-relationship\", \"fs-source-list\",\n \"fs-source-list-container\", \"fs-source\"]];\n // Dig through Shadow DOM\n for (var j = 0; j < dig.length && !found; j++) {\n env = document.body;\n for (var i = 0; i < dig[j].length && env; i++) {\n env = env.querySelector(dig[j][i]);\n // Environment must be in active tab.\n if (i == 1 && env && !env.classList.contains(\"iron-selected\")) env = 0;\n if (env && dig[j][i] === \"fs-source\" && env.parentNode.style.display === \"none\") {\n env = env.parentNode.querySelectorAll(\"fs-source\")[1];\n }\n if (!env) break;\n env = env.shadowRoot;\n }\n found = !!env;\n }\n return env;\n}", "function init(){\n\t\t//Add load listener\n\t\twindow.addEventListener('DOMContentLoaded',\tfunction() {\n\t\t\tfindElements();\n\t\t\taddScrollListeners();\n\t\t\tscrollInit();\n\n\t\t\tdocument.head.appendChild(animStyle);\n\n\t\t\t//Create a mutation observer to monitor changes in attributes and new values to make sure new/changed elements are animated properly\n\t\t\tobserver = new MutationObserver(domChanged);\n\t\t\tobserver.observe(document, { attributes: true, childList: true, subtree: true });\n\n\t\t\tconsole.log(\"JSA v. \" + version + \" initialized. Visit https://github.com/CamSOlson/jsa for documentation\");\n\n\t\t});\n\t}", "function init(){\n\t\t/*\n\t\t\tLet's sort out those settings\n\t\t*/\n\t\tif(options) settingsMerge(settings, options);\n\n\t\thtml\t= document.documentElement.outerHTML;\n\n\t\tif(html.match(/<\\/html>/gi)) {\n\t\t\twindow.stop();\n\t\t}\n\n\t\t/*\n\t\t\tInitialize test and run doScript as\n\t\t\tthe complete callback.\n\t\t*/\n\t\tdoTest(function() {\n\t\t\tdoScript();\n\t\t});\n\n\t}", "function init() {\n\twindow.addEventListener(\"error\", errorHandler)\n\twindow.addEventListener(\"unhandledrejection\", errorHandler)\n\tif (document.readyState !== \"loading\")\n\t\tdocument.addEventListener(\"DOMContentLoaded\", app)\n\telse\n\t\tapp()\n}", "function preInit() {\n setupDom();\n\n if (Enabler.isInitialized()) {\n init();\n } else {\n Enabler.addEventListener(\n studio.events.StudioEvent.INIT,\n init\n );\n }\n}", "function setupDom() {\n creative.dom = {};\n creative.dom.mainContainer = document.getElementById('main-container');\n // creative.dom.expandedExit = document.getElementById('expanded-exit');\n creative.dom.expandedContent = document.getElementById('expanded-content');\n creative.dom.expandMain = document.getElementById('expand-main');\n creative.dom.collapsedContent = document.getElementById('collapsed-content');\n creative.dom.collapseButton = document.getElementById('collapseButton');\n creative.dom.expandButton = document.getElementById('expandButton');\n // creative.dom.closeButton = document.getElementById('close-button');\n}", "init() {\n this._cacheDOM()\n this._createObserver()\n this._observeFaders()\n }", "async function init() {\n\n await injectAllScripts();\n\n if(isElectron()) {\n launch(launchProd);\n } else {\n launch(launchDev);\n }\n\n}", "function initDocument (document, window) {\n const html = document.childNodes.find(el => el.tagName === 'HTML');\n const documentElement = html || (document.childNodes.length > 0 ? document.childNodes[0] : null);\n const head = html ? html.childNodes.find(el => el.tagName === 'HEAD') : new window.HTMLHeadElement();\n const body = html ? html.childNodes.find(el => el.tagName === 'BODY') : new window.HTMLBodyElement();\n\n document.documentElement = documentElement;\n document.readyState = 'loading';\n document.head = head;\n document.body = body;\n document.location = window.location;\n document.URL = window.location.href;\n document.cookie = '';\n document.referrer = '';\n document.createElement = (tagName, options = {}) => {\n tagName = tagName.toUpperCase();\n const HTMLElementTemplate = window[symbols.htmlTagsSymbol][tagName];\n const element = HTMLElementTemplate ? new HTMLElementTemplate() : new window.HTMLElement(tagName);\n options.is && element.setAttribute('is', options.is);\n return element;\n };\n document.createElementNS = (namespace, tagName, options) => document.createElement(tagName, options);\n document.createDocumentFragment = () => new window.DocumentFragment();\n document.createTextNode = text => new window.Text(text);\n document.createComment = comment => new window.Comment(comment);\n document.createEvent = type => {\n switch (type) {\n case 'KeyboardEvent':\n case 'KeyboardEvents':\n return new KeyboardEvent();\n case 'MouseEvent':\n case 'MouseEvents':\n return new MouseEvent();\n case 'Event':\n case 'Events':\n case 'HTMLEvents':\n return new Event();\n default:\n throw new Error('invalid createEvent type: ' + type);\n }\n };\n document.createRange = () => new Range(window);\n document.importNode = (el, deep) => el.cloneNode(deep);\n document.scripts = utils._makeHtmlCollectionProxy(document.documentElement, 'script');\n document.styleSheets = [];\n document.implementation = new DOMImplementation(window);\n document.resources = new GlobalContext.Resources(); // non-standard\n document.activeElement = body;\n document.open = () => {\n document.innerHTML = '';\n };\n document.close = () => {};\n document.write = htmlString => {\n const childNodes = parse5.parseFragment(htmlString, {\n locationInfo: true,\n }).childNodes.map(childNode => _fromAST(childNode, window, document.body, document, true));\n for (let i = 0; i < childNodes.length; i++) {\n document.body.appendChild(childNodes[i]);\n }\n };\n document.execCommand = command => {\n if (command === 'copy') {\n // nothing\n } else if (command === 'paste') {\n document.dispatchEvent(new Event('paste'));\n }\n };\n document.queryCommandSupported = s => ['copy', 'paste'].includes(s);\n document[symbols.pointerLockElementSymbol] = null;\n document[symbols.fullscreenElementSymbol] = null;\n\n const runElQueue = [];\n const _addRun = fn => {\n (async () => {\n if (!document[symbols.runningSymbol]) {\n document[symbols.runningSymbol] = true;\n\n try {\n await fn();\n } catch(err) {\n console.warn(err.stack);\n }\n\n document[symbols.runningSymbol] = false;\n if (runElQueue.length > 0) {\n _addRun(runElQueue.shift());\n } else {\n document.emit('flush');\n }\n } else {\n runElQueue.push(fn);\n }\n })();\n };\n document[symbols.runningSymbol] = false;\n document[symbols.addRunSymbol] = _addRun;\n\n if (window.top === window) {\n document.addEventListener('pointerlockchange', () => {\n const pointerLockElement = document[symbols.pointerLockElementSymbol];\n \n for (let i = 0; i < GlobalContext.contexts.length; i++) {\n const context = GlobalContext.contexts[i];\n nativeBindings.nativeWindow.setCursorMode(context.getWindowHandle(), !pointerLockElement);\n }\n\n /* const iframes = document.getElementsByTagName('iframe');\n for (let i = 0; i < iframes.length; i++) {\n const iframe = iframes[i];\n if (iframe.contentDocument) {\n // iframe.contentDocument._emit('pointerlockchange'); // XXX send this down\n }\n } */\n });\n document.addEventListener('fullscreenchange', () => {\n const fullscreenElement = document[symbols.fullscreenElementSymbol];\n \n for (let i = 0; i < GlobalContext.contexts.length; i++) {\n const context = GlobalContext.contexts[i];\n nativeBindings.nativeWindow.setFullscreen(context.getWindowHandle(), !!fullscreenElement);\n }\n \n /* const iframes = document.getElementsByTagName('iframe');\n for (let i = 0; i < iframes.length; i++) {\n const iframe = iframes[i];\n if (iframe.contentDocument) {\n // iframe.contentDocument._emit('pointerlockchange'); // XXX send this down\n iframe.contentDocument._emit('fullscreenchange');\n }\n } */\n });\n }\n\n process.nextTick(async () => {\n if (body) {\n const bodyChildNodes = body.childNodes;\n body.childNodes = new window.NodeList();\n\n try {\n await GlobalContext._runHtml(document.head, window);\n } catch(err) {\n console.warn(err);\n }\n\n body.childNodes = bodyChildNodes;\n body._emit('children', Array.from(bodyChildNodes), [], null, null);\n\n try {\n await GlobalContext._runHtml(document.body, window);\n } catch(err) {\n console.warn(err);\n }\n\n document.readyState = 'interactive';\n document.dispatchEvent(new Event('readystatechange', {target: document}));\n\n document.dispatchEvent(new Event('DOMContentLoaded', {\n target: document,\n bubbles: true,\n }));\n } else {\n try {\n await GlobalContext._runHtml(document, window);\n } catch(err) {\n console.warn(err);\n }\n\n document.readyState = 'interactive';\n document.dispatchEvent(new Event('readystatechange', {target: document}));\n\n document.dispatchEvent(new Event('DOMContentLoaded', {\n target: document,\n bubbles: true,\n }));\n }\n\n document.readyState = 'complete';\n document.dispatchEvent(new Event('readystatechange', {target: document}));\n\n document.dispatchEvent(new Event('load', {target: document}));\n window.dispatchEvent(new Event('load', {target: window}));\n });\n\n return document;\n}", "async function init() {\n const html = await fetchHtml();\n const tempElm = document.createElement('html');\n tempElm.innerHTML= html.replace(/href=\"./g, `href=\"${packageUrl}/build`).replace(/src=\"./g, `src=\"${packageUrl}/build`);\n \n const scripts = tempElm.querySelectorAll('script');\n const styles = tempElm.querySelectorAll('link[rel=stylesheet]');\n\n // Create root element if not exists\n createRootElm();\n\n // Load RESTool (most recent) styles\n loadStyles(styles);\n\n // Load RESTool (most recent) scripts\n loadScriptsRecursively(Array.apply(null, scripts));\n }", "function bootstrapDOM(dom) {\n document = dom.jsdom(\"<html><body></body></html>\", dom.level(3, \"core\"));\n \n window = document.createWindow();\n\n document.title = 'Worker';\n }", "function init() {\n documentReady(documentLoaded);\n}", "function onDOMReady() {\n // Make sure that the DOM is not already loaded\n if (isReady) return;\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\n if (!document.body) return setTimeout(onDOMReady, 0);\n // Remember that the DOM is ready\n isReady = true;\n // Make sure this is always async and then finishin init\n setTimeout(function() {\n app._finishInit();\n }, 0);\n }", "init() {\n\t\tglobalApplication.events.document();\n\t\tglobalApplication.events.header();\n\t}", "Init()\n {\n this.my_state_machine = new StateMachine();\n this.overlay_manager_inst = new OverlayManager();\n this.level_viewer = null;\n this.information_log = document.getElementById(\"informationLog\");\n this.level_object_manager = new LevelObjectManager();\n this.level_complete = document.getElementById(\"complete\");\n this.stats_manager = new StatManager();\n this.AI_bridge = new AIBridge();\n this.memento = new Memento();\n this.toolbar_manager = new ToolbarManager();\n }", "function onInit() {\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\n }", "constructor() {\n let ready = new Promise(resolve => {\n if (document.readyState != \"loading\") return resolve();\n document.addEventListener(\"DOMContentLoaded\", () => resolve());\n });\n ready.then(this.init.bind(this));\n }", "initDOMElements() {\n this.DOMElement = this.app.el.querySelector('#homepage');\n\n this.characterSelector = this.DOMElement.querySelector('#character-selector');\n\n this.charactersList = this.characterSelector.querySelectorAll('.character');\n \n this.buttonStartGame = this.DOMElement.querySelector('#start-game');\n\n this.character_01 = this.characterSelector.querySelectorAll('.character_01'); \n this.character_02 = this.characterSelector.querySelectorAll('.character_02');\n this.character_03 = this.characterSelector.querySelectorAll('.character_03');\n this.character_04 = this.characterSelector.querySelectorAll('.character_04');\n\n this.character_vs_01 = this.DOMElement.querySelector('#character_vs_01');\n this.character_vs_02 = this.DOMElement.querySelector('#character_vs_02');\n }", "function preInit() {\r\n\tsetupDom();\r\n\tif (Enabler.isInitialized()) {\r\n\t\tinit();\r\n\t} else {\r\n\t\tEnabler.addEventListener(studio.events.StudioEvent.INIT, init);\r\n\t}\r\n}", "function onInit() {\r\n\r\n Event.onDOMReady(onDOMReady, this.cfg.getProperty(\"container\"), this);\r\n\r\n }", "function init() {\n\t\t//console.log(\"app.init()\");\n\t\tif(initDone) {\n\t\t\t//console.log(\"init already done.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tinitDone = true;\n\t\t}\n\n\t\t// Init HTML layout and from there the GUI/UI with interaction.\n\t\tlayout.init();\n\t\tscene.init();\n\t\t//ui.init();\n\t\t// Proceed directly to startup of the loop.\n\t\t//start();\n\t}", "function init() {\n StoredTagsMngr.checkForTagsNotBeingUsed();\n initStorage();\n createTagsInStarsPage();\n initDOM();\n}", "function initConfig() {\n\tupdateDOM();\t\n}", "function init() {\n setupCamera(); // get the camera happening\n makeScene(); // lights, textures, materials, objects\n setupRenderer(); // the main renderer\n addToWebPage(renderer); // add the WebGL to the web page\n\n\twindow.addEventListener( 'resize', onWindowResize, false );\n document.addEventListener( 'mousedown', onDocumentMouseDown, false );\n document.addEventListener('keypress', onDocumentKeyPressed, false); \n}", "function _Initialise(){\r\n\t\t\r\n\t\tfunction __ready(){\r\n\t\t\t_PrecompileTemplates();\r\n\t\t\t_DefineJqueryPlugins();\r\n\t\t\t_CallReadyList();\r\n\t\t};\r\n\r\n\t\t_jQueryDetected = typeof window.jQuery === \"function\";\r\n\r\n\t\tif(_jQueryDetected){\r\n\t\t\tjQuery(document).ready(__ready);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdocument.addEventListener(\"DOMContentLoaded\", __ready, false);\r\n\t\t}\r\n\t\t\r\n\t}", "onDOMReady() {\n\n\t\t\t// resize the canvas to fill browser window dynamically\n\t\t\twindow.addEventListener('resize', _onWindowResize, false);\n\t\t\t_onWindowResize();\n\t\t\t\n\t\t\t// Stop generic mouse events from propagating up to the document\n\t\t\tlet windows = document.querySelectorAll('.ui-window');\n\t\t\tfor(let i = 0, len = windows.length; i < len; i++) {\n\t\t\t\tlet element = windows[i];\n\t\t\t\telement.addEventListener('mousedown', event => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t});\n\t\t\t\telement.addEventListener('wheel', event => {\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Initialize the starting windows\n\t\t\t_windows = {\n\t\t\t\t'newsfeed': new NewsfeedWindow('#window-Newsfeed')\n\t\t\t};\n\t\t\t_windows.newsfeed.clearNews(LogicM.getUniverseClock());\n\n\t\t\t// this.addNews(\"Welcome back, Emperor.\", null, LogicM.getUniverseClock(), 'self', false);\n\t\t}", "_init() {\n this.location = getDOM().getLocation();\n this._history = getDOM().getHistory();\n }", "_init() {\n this.location = getDOM().getLocation();\n this._history = getDOM().getHistory();\n }", "_init() {\n this.location = getDOM().getLocation();\n this._history = getDOM().getHistory();\n }", "_init() {\n this.location = getDOM().getLocation();\n this._history = getDOM().getHistory();\n }", "_init() {\n this.location = getDOM().getLocation();\n this._history = getDOM().getHistory();\n }", "initialize() {\n this.settings = {};\n this.scripts = [];\n }", "function init()\r\n{\r\n\t//Initialize globals\r\n\tstyleExplorer = new StyleExplorerApplication();\r\n\tstyleExplorer.setCanvas(document.getElementById(\"canvasStyleExplorer\"));\r\n}", "init() {\n this.loadModules();\n this.cacheDOM();\n this.attachEvents();\n this.stickFooterToBottom();\n }", "function init(){\n console.log(\"Page loaded and DOM is ready\");\n}", "function initPage()\n\t{\n\t\tinitGlobalVars();\n\t\tinitDOM();\n\t\tinitEvents();\n\t}", "function init() {\n //called when document is fully loaded; your \"main method\"\n}", "initializeElements () {\n this.$els = {\n window,\n body: document.body\n }\n }", "function init() { }", "function init() { }", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function formal_body_onload_init() {\n // add server side elements with buttons, actions, etc\n formal_adorn_server_side_elements();\n}", "function init() {\n if (!ready) {\n ready = true;\n initElements();\n }\n }", "function init() {\n this.$ = require(\"jquery/dist/jquery\");\n this.jQuery = this.$;\n\n require(\"svg4everybody/dist/svg4everybody\")();\n require(\"retinajs/dist/retina\");\n\n require(\"bootstrap/dist/js/bootstrap.bundle\");\n\n\n\n $(document).ready(function () {\n require(\"./components/interractionObserver\")();\n });\n}", "function init(){\n console.debug('Document Load and Ready');\n console.trace('init');\n initGallery();\n \n pintarLista( );\n pintarNoticias();\n limpiarSelectores();\n resetBotones();\n \n}", "init() {\n document.addEventListener('DOMContentLoaded', this.loadContent);\n }", "function init() {\n loadDependencies();\n attachEventHandlers();\n}", "initExpressJS() {\n this.app = express();\n this.setSecurity();\n this.setBodyParser();\n this.setHeaders();\n this.setRouter();\n }", "async initialize() {\n const { headless } = this.options\n const { log } = this\n try {\n // load script content from `script` folder\n this.scriptContent = await genScriptContent()\n // Launch the browser\n this.browser = await puppeteer.launch({ headless })\n } catch (err) {\n log(err)\n }\n }", "_init() {\r\n app.whenReady().then(() => {\r\n this.setLoadingWindow();\r\n this.setWindowMain();\r\n });\r\n this.beforeCloseFunctions();\r\n }", "init() {\n this.addAdditionnalScripts();\n }", "function init(){\t\t// om het app te initializeren.\n console.log('1 Initialize the application');\n console.log('1.1 Create a GetAPerson object');\n _getAPerson = new GetAPerson();\n console.log('1.2 Chache the active DOM-elements');\n _aPersonElement = document.querySelector('.container');\n _aYayElement = document.querySelector('.yayContainer');\n _btnYay = document.querySelector('.yay');\n _btnNay = document.querySelector('.nay');\n console.log('1.3 Load the parking states via _parkingStatesService object');\n loadRandomPersonData();\n}", "addToDOM() {\n /*\n DOM INDEX\n * wrap: class=\"_DebuggerAppWrap\": div wrapper containing all elements for this application\n * app_header: class=\"_DebuggerAppHeader\": div container app Header (app UUID);\n * children: class=\"_DebuggerAppChildren\": div wrapper containing all elements of the child windows\n * children_header: class=\"_DebuggerAppChildrenHeader\": div containing child area Header (\"Windows\");\n * button.*: class=\"_DebuggerAppButton\": Button elements for various actions\n\n */\n\n this.DOM.CSS.wrap = \"_DebuggerAppWrap\";\n this.DOM.CSS.appHeader = \"_DebuggerAppHeader\";\n this.DOM.CSS.children = \"_DebuggerAppChildren\";\n this.DOM.CSS.childrenHeader = \"_DebuggerAppChildrenHeader\";\n this.DOM.CSS.button = \"_DebuggerAppButton\";\n\n this.DOM.wrap = $(`<div></div>`).addClass(this.DOM.CSS.wrap);\n\n this.DOM.app_header = $(`<div>${this.uuid}</div>`).addClass(this.DOM.CSS.appHeader);\n\n this.DOM.children = $(`<div></div>`).addClass(this.DOM.CSS.children);\n this.DOM.children_header = $(`<div>Windows</div>`).addClass(this.DOM.CSS.childrenHeader);\n\n $(this.DOM.children).append(this.DOM.children_header);\n\n this.DOM.button.devTools = $(`<button>Dev Tools</button>`)\n .addClass(this.DOM.CSS.button)\n .click(() => {\n fin.desktop.System.showDeveloperTools(this.uuid, this.name, () => { }, (e) => { console.log(e) });\n });\n\n this.DOM.button.restart = $(`<button>Restart</button>`)\n .addClass(this.DOM.CSS.button)\n .click(() => {\n this.app.restart();\n });\n\n $(this.DOM.wrap).append(this.DOM.app_header);\n $(this.DOM.wrap).append(this.DOM.button.devTools);\n $(this.DOM.wrap).append(this.DOM.button.restart);\n $(this.DOM.wrap).append(this.DOM.children);\n\n $(\"#_DebuggerApps\").append(this.DOM.wrap);\n }", "function initDOMObjects() {\n\n\tprojectSelectLabel = document.getElementById('projectSelectLabel');\n\tprojectSelectGroup = document.getElementById('projectSelectGroup');\n\tprojectSelect = document.getElementById('projectSelect');\n\tgoProjectButton = document.getElementById('goProjectButton');\n\n}", "function elementInit() {\r\n\t\troot \t\t\t\t\t= $('root');\r\n\t\twindowSettings \t\t\t= $('window_settings');\r\n\t\twindowImport \t\t\t= $('window_import');\r\n\t\twindowShare = $('window_share');\r\n\t\twindowEditor = $('window_editor');\r\n\t\t\r\n\t\tformEditor \t\t\t\t= $('form_editor');\r\n\t\tbuttonSave \t\t\t\t= $('button_save');\r\n\t\tbuttonEditorSubmit\t\t= $('button_editor_submit');\r\n\t\tfieldSearch\t\t\t\t= $('field_search');\r\n\t\tfieldSearch.tooltip\t\t= $('tooltip_field_search');\r\n\t\t\r\n\t\tcodeboxShareHTML = $('codebox_share_html');\r\n\t\tcodeboxShareBBCode = $('codebox_share_bbcode');\r\n\t\tcodeboxShareReddit = $('codebox_share_reddit');\r\n\t}", "function init() {\n easy.console.log(MODULE, 'initialization');\n\n scopeWindow = window.jasmine ? window.jasmine.window : window;\n\n easy.events.on(site.events.PRODUCT_PAGE_VIEW, _handleProductPage);\n easy.events.on(site.events.SUPER_PAGE_VIEW, _handleSuperPage);\n }", "initialise(){\n this._initialise(this._body)\n this._initEvents()\n this._dispatchOnInit()\n }", "function init() {\n homeBtns.forEach(btn => btn.addEventListener('click', loadHome))\n gsBtns.forEach(btn => btn.addEventListener('click', loadGs))\n docsBtns.forEach(btn => btn.addEventListener('click', loadDocs))\n\n downloadBtn.addEventListener('click', () => {\n window.location = `https://github.com/KucingKode/quick.js/releases/download/${VERSION}/quick.js`\n })\n githubBtn.addEventListener('click', () => {\n window.location = 'https://github.com/KucingKode/quick.js'\n })\n \n sideToggle.addEventListener('click', () => {\n sideToggle.classList.toggle('active')\n sidebar.classList.toggle('active')\n })\n loadSidebar('home')\n}", "function init() {\n\n\t\t// Bind the editor elements to variables\n\t\tbindElements();\n\n\t\t// Create event listeners for keyup, mouseup, etc.\n\t\tcreateEventBindings();\n\t}", "init() {\n if (document.body) {\n const { body } = document;\n const controller = body.getAttribute('data-controller');\n const action = body.getAttribute('data-action');\n\n if (controller) {\n this.execAction(controller, 'init');\n this.execAction(controller, action);\n }\n }\n }", "function init() {\n const observer = new MutationObserver((mutationsList, observer) => {\n observer.disconnect();\n mutationsList\n .flatMap(x => Array.from(x.addedNodes))\n .forEach(process);\n observer.observe(document.body, config);\n });\n\n const config = {\n subtree: true,\n childList: true,\n characterData: true\n };\n\n process(document.body);\n process(document.body);\n observer.observe(document.body, config);\n }", "function init() {\n\t//TODO\n}", "function init()\n\t{\n\t\tvar scripts = document.getElementsByTagName('script');\n\t\tfor(var i = 0; i < scripts.length; ++i)\n\t\t{\n\t\t\tif(scripts[i].hasAttribute('main'))\n\t\t\t{\n\t\t\t\tif(scripts[i].hasAttribute('root'))\n\t\t\t\t{\n\t\t\t\t\tPoof.importRoot = scripts[i].getAttribute('root');\n\t\t\t\t}\n\n\t\t\t\tif(scripts[i].hasAttribute('suffix'))\n\t\t\t\t{\n\t\t\t\t\tPoof.importSuffix = scripts[i].getAttribute('suffix');\n\t\t\t\t}\n\n\t\t\t\tif(scripts[i].hasAttribute('concatenated'))\n\t\t\t\t{\n\t\t\t\t\tPoof.concatenated = scripts[i].getAttribute('concatenated');\n\t\t\t\t}\n\n\t\t\t\tif(scripts[i].hasAttribute('debug'))\n\t\t\t\t{\n\t\t\t\t\tPoof.debug = scripts[i].getAttribute('debug') === 'true';\n\t\t\t\t}\n\n\t\t\t\tcompatibilityFixes.applyAll();\n\t\t\t\tImport(scripts[i].getAttribute('main')).execute(onMainClassRady);\n\t\t\t}\n\t\t}\n\t}", "_ready() {\n this.tabs = new Tabs(this.app)\n }", "async _onReady() {\n // Make the editor \"complex.\" This \"fluffs\" out the DOM and makes the\n // salient controller objects.\n this._editorComplex =\n new EditorComplex(this._sessionKey, this._window, this._editorNode);\n\n await this._editorComplex.whenReady();\n this._recoverySetup();\n }", "function globalsInitialization()\n{\n html = document.getElementById(\"html\");\n}", "function init() {\n console.log(\"Document Ready\");\n\n createPets();\n totalNumPets();\n totalPrice();\n petsByType();\n displayPets();\n displayOfficeInfo();\n}", "async _onReady() {\n // Make the editor \"complex.\" This \"fluffs\" out the DOM and makes the\n // salient controller objects.\n this._editorComplex =\n new EditorComplex(this._sessionInfo, this._window, this._editorNode);\n\n await this._editorComplex.whenReady();\n this._recoverySetup();\n }", "function init () {\n}", "function init() {\n\tconst params = getUrlParameters() // valuable information is encoded in the URL\n\tconst dataPromise = loadData(params) // start loading the data\n\tconst callback = () => app(params, dataPromise)\n\n\t// set error handlers\n\twindow.addEventListener(\"error\", errorHandler)\n\twindow.addEventListener(\"unhandledrejection\", errorHandler)\n\n\tif (document.readyState !== \"loading\")\n\t\tdocument.addEventListener(\"DOMContentLoaded\", callback)\n\telse\n\t\tcallback()\n}", "function init() {\n\n\tinitEnvironment();\n\tinitSpheres();\n\tinitSkeleton();\n\tinitKinectron();\n\n\twindow.addEventListener( 'resize', onWindowResize, false );\n}", "function init(){}", "function init() {\n // Load and style highCharts library. https://www.highCharts.com/docs.\n highchartsExport( Highcharts );\n applyThemeTo( Highcharts );\n\n _containerDom = document.querySelector( '#chart-section' );\n _resultAlertDom = _containerDom.querySelector( '#chart-result-alert' );\n _failAlertDom = _containerDom.querySelector( '#chart-fail-alert' );\n _chartDom = _containerDom.querySelector( '#chart' );\n _dataLoadedDom = _containerDom.querySelector( '.data-enabled' );\n\n startLoading();\n }", "function setupDOM() {\n\n // Cache references to key DOM elements\n dom.theme = document.querySelector('#theme');\n dom.wrapper = document.querySelector('.reveal');\n dom.slides = document.querySelector('.reveal .slides');\n\n // Background element\n if (!document.querySelector('.reveal .backgrounds')) {\n dom.background = document.createElement('div');\n dom.background.classList.add('backgrounds');\n dom.wrapper.appendChild(dom.background);\n }\n\n // Progress bar\n if (!dom.wrapper.querySelector('.progress')) {\n var progressElement = document.createElement('div');\n progressElement.classList.add('progress');\n progressElement.innerHTML = '<span></span>';\n dom.wrapper.appendChild(progressElement);\n }\n\n // Arrow controls\n if (!dom.wrapper.querySelector('.controls')) {\n var controlsElement = document.createElement('aside');\n controlsElement.classList.add('controls');\n controlsElement.innerHTML = '<div class=\"navigate-left\"></div>' +\n '<div class=\"navigate-right\"></div>' +\n '<div class=\"navigate-up\"></div>' +\n '<div class=\"navigate-down\"></div>';\n dom.wrapper.appendChild(controlsElement);\n }\n\n // State background element [DEPRECATED]\n if (!dom.wrapper.querySelector('.state-background')) {\n var stateBackgroundElement = document.createElement('div');\n stateBackgroundElement.classList.add('state-background');\n dom.wrapper.appendChild(stateBackgroundElement);\n }\n\n // Overlay graphic which is displayed during the paused mode\n if (!dom.wrapper.querySelector('.pause-overlay')) {\n var pausedElement = document.createElement('div');\n pausedElement.classList.add('pause-overlay');\n dom.wrapper.appendChild(pausedElement);\n }\n\n // Cache references to elements\n dom.progress = document.querySelector('.reveal .progress');\n dom.progressbar = document.querySelector('.reveal .progress span');\n\n if (config.controls) {\n dom.controls = document.querySelector('.reveal .controls');\n\n // There can be multiple instances of controls throughout the page\n dom.controlsLeft = toArray(document.querySelectorAll('.navigate-left'));\n dom.controlsRight = toArray(document.querySelectorAll('.navigate-right'));\n dom.controlsUp = toArray(document.querySelectorAll('.navigate-up'));\n dom.controlsDown = toArray(document.querySelectorAll('.navigate-down'));\n dom.controlsPrev = toArray(document.querySelectorAll('.navigate-prev'));\n dom.controlsNext = toArray(document.querySelectorAll('.navigate-next'));\n }\n\n }", "function init() {\n cacheDom();\n getQuote();\n }", "function init() {\n loadTheme();\n loadBorderRadius();\n loadSearchEngine();\n loadHomePage();\n loadStartPage();\n loadBookmarksBar();\n loadWelcome();\n\n ipcRenderer.send('request-set-about');\n\n document.onkeydown = keyDown;\n}", "init() {\n // Action to execute on load of the app\n }", "initialise () {}", "function init() {\n\n }", "init(domNode) {\n this.initIcons();\n this.initStore();\n this.initAppDOM(domNode);\n this.initPreferences();\n this.initSoho();\n this.initToasts();\n this.initPing();\n this.initServices(); // TODO: Remove\n this.initConnects();\n this._startupConnections();\n this.initModules();\n this.initToolbars();\n this.initHash();\n this.initModal();\n this.initScene();\n this.initServiceWorker();\n this.updateSoho();\n }" ]
[ "0.7300619", "0.7234803", "0.71088403", "0.6857795", "0.6655088", "0.66008264", "0.6544503", "0.6498687", "0.6404788", "0.6388635", "0.6317405", "0.6258173", "0.6236334", "0.62126374", "0.6196394", "0.6183878", "0.61270326", "0.6125514", "0.6119928", "0.6117193", "0.61096746", "0.6104389", "0.6103636", "0.60851437", "0.6074403", "0.6072187", "0.6044451", "0.6013004", "0.6010079", "0.6009353", "0.6002822", "0.59704006", "0.59680074", "0.59471333", "0.5928532", "0.5910375", "0.59068644", "0.5905663", "0.5905663", "0.5905663", "0.5905663", "0.5905663", "0.58981067", "0.5889384", "0.5883242", "0.587518", "0.58722705", "0.5870343", "0.5861784", "0.5858081", "0.5858081", "0.58491683", "0.58491683", "0.58491683", "0.58491683", "0.58491683", "0.58491683", "0.58491683", "0.58491683", "0.58491683", "0.58491683", "0.5842609", "0.58301663", "0.5816934", "0.5815154", "0.58147883", "0.5813838", "0.5800955", "0.57883835", "0.57871026", "0.57847106", "0.5781081", "0.5771517", "0.5767396", "0.57671183", "0.5763151", "0.575754", "0.57567704", "0.5753609", "0.5746823", "0.5746131", "0.5746051", "0.57455295", "0.57345647", "0.57275456", "0.57165927", "0.57019985", "0.57002854", "0.569555", "0.5690696", "0.5689736", "0.5688762", "0.5680701", "0.5675462", "0.5664309", "0.56607383", "0.565648", "0.5651756", "0.56476545", "0.56465983" ]
0.7142691
2
Wraps the global timer methods to collect their return values, which can be later cleared in clearImaApp function
function _installTimerWrappers() { global.setInterval = (...args) => { let timer = setIntervalNative(...args); timers.push({ timer, clear: () => global.clearInterval(timer) }); return timer; }; global.setTimeout = (...args) => { let timer = setTimeoutNative(...args); timers.push({ timer, clear: () => global.clearTimeout(timer) }); return timer; }; global.setImmediate = (...args) => { let timer = setImmediateNative(...args); timers.push({ timer, clear: () => global.clearImmediate(timer) }); return timer; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timerWrapper () {}", "function Timer() {}", "clearAllTimers() {\n for (let status of ROUND_TIMED_STATUSES) {\n this.clearFlag(status);\n }\n }", "function xTimerMgr()\r\n{\r\n this.tmr = null;\r\n this.timers = new Array();\r\n}", "function checkTimers(){\n createTimerCallback(amatriadata.sleepTimes)\n console.log( Date(Date.now()) + 'Checking Timers')\n}", "stopExtantTimers() {\n gExtantTimers.clear()\n }", "function resetTimer() {\n app.second = 0;\n app.minute = 0;\n app.hour = 0;\n clearInterval(app.interval);\n app.timer.innerHTML = \"0:00\";\n}", "function Timer(){\n}", "function Timer() {\n /* class that has a method to replace window.setTimeout */\n this.lastid = 0;\n this.functions = {};\n \n this.registerFunction = function(object, func, timeout) {\n /* register a function to be called with a timeout\n\n args: \n func - the function\n timeout - timeout in millisecs\n \n all other args will be passed 1:1 to the function when called\n */\n var args = new Array();\n for (var i=0; i < arguments.length - 3; i++) {\n args.push(arguments[i + 3]);\n }\n var id = this._createUniqueId();\n this.functions[id] = new Array(object, func, args);\n setTimeout(\"timer_instance._handleFunction(\" + id + \")\", timeout);\n };\n\n this._handleFunction = function(id) {\n /* private method that does the actual function call */\n var obj = this.functions[id][0];\n var func = this.functions[id][1];\n var args = this.functions[id][2];\n this.functions[id] = null;\n func.apply(obj, args);\n };\n\n this._createUniqueId = function() {\n /* create a unique id to store the function by */\n while (this.lastid in this.functions && this.functions[this.lastid]) {\n this.lastid++;\n if (this.lastid > 100000) {\n this.lastid = 0;\n }\n }\n return this.lastid;\n };\n}", "function resetTimer () {\n window.clearInterval(timerIntervalId);\n timerIntervalId = null;\n window.clearInterval(pageTitleIntervallId);\n pageTitleIntervallId = null;\n timerStartFinishTimestamp = null;\n timerPauseTimestamp = null;\n timeobject = {\n hours: '00',\n minutes: '00',\n seconds: '00',\n milliseconds: '00'\n };\n printTimedisplayFromTimestamp(0);\n startPauseButton.innerHTML = 'Start';\n if (getActiveMode() == 'countdown') {\n startPauseButton.setAttribute('onclick', 'startCountdown();');\n dialpad.classList.remove('hide');\n updatePageTitle('Countdown');\n } else if (getActiveMode() == 'stopwatch') {\n startPauseButton.setAttribute('onclick', 'startStopwatch();');\n lapContainer.classList.add('hide');\n updatePageTitle('Stopwatch');\n lapLog.innerHTML = \"\";\n };\n}", "function mytick() {\n\t//console.log(\"from timer tick: \"+new Date() + \", and current count: \"+appTimer.currentCount);\n\tmyTime = moment().format(\"hh:mm:ss A\");\n\tmyDate = moment().format(\"dddd, MMMM DD, YYYY\");\n\n\tdocument.getElementById(\"timeDiv\").innerHTML = myTime;\n\tdocument.getElementById(\"dateDiv\").innerHTML = myDate;\n\tdocument.getElementById(\"timeLeft\").innerHTML = \"Seconds left until next refresh: \" + (secondsToNextRefresh--);\n\t//console.log(myDate+\" \"+myTime+\" timer current count: \"+appTimer.currentCount);\n\tif (appTimer.currentCount == dataRefreshInterval_seconds) {\n\n\t\t//refresh the MIM data\n\t\t//console.log('refreshing data');\n\t\t//proxy.getSegmentsMedianTravelTimes(\"00:15:00\", new Async(travelTimeDataSuccess, travelTimeDataError));\n\n\t\tgetTranscomLinkData();\n\t\tgetWifiLinkData();\n\n\t\t//reset the timer so the current count resets as well\n\t\tappTimer.Reset();\n\t\tdocument.getElementById(\"disclaimerDateTime\").innerHTML = moment().format('MMMM Do YYYY, h:mm:ss a');\n\t\tsecondsToNextRefresh = dataRefreshInterval_seconds;\n\t}\n\n}", "eventTimer() {throw new Error('Must declare the function')}", "function setTimer() {\n // get the shortRest\n // get the largeRest\n }", "function Clearup() {\n App.Timer.ClearTime();\n }", "function setupTimeoutTimer() {\n updateTimeoutInfo(undefined);\n }", "function clearTimer() {\n\t\t\tif (sys.timer) {\n\t\t\t\twindow.clearTimeout(sys.timer);\n\t\t\t}\n\t\t\tsys.timer = null;\n\t\t}", "function resetMainTimer(seconds) {\n changeFavicon('red');\n timer.pause();\n timer = new CountdownTimer(seconds); \n timer.onTick(setTimeOnAllDisplays);\n }", "function startTimer (){\n clear = setInterval(timer, 1000)\n }", "function util_fun(){\r\n gametime = document.getElementById(\"timer\");\r\n\t\tgametime.innerHTML=\"0\";\r\n\t\tgame_secs=0;\r\n\t\tgame_mins=0;\r\n totalsecscount = 0;\r\n setInterval(setInfoTandR, 1000);\r\n}", "function resetTimer() {\n inactiveTime = 0;\n}", "runTimers() {\n\t\tfor (var timer in this.Vars._Timers) {\n\t\t\tif (this.Vars._timerMod % this.Vars._Timers[timer].freq === 0) {\n\t\t\t\tthis.Vars._Timers[timer].func.call()\n\t\t\t}\n\t\t}\n\t\tthis.Vars._timerMod++\n\t}", "function startTime() {\n setTimer();\n}", "handleTimer() {\n this.setTimerInterrupt(true);\n }", "function coreTimer()\n{\n\t// If the document.hidden property doesn't work, this timer doesn't function\n\tif(typeof(document.hidden) != \"undefined\")\n\t{\n\t\tif(document.hidden != true)\n\t\t{\n\t\t\tcoreTimeCount++;\n\t\t}\n\t}\n\t\n\t// If you're logged in, run the user's update handlers\n\tif(typeof(JSUser) == \"string\")\n\t{\n\t\t// Notifications Updater\n\t\tif(coreTimeCount >= timers.notifications.next)\n\t\t{\n\t\t\ttimers.notifications.next = coreTimeCount + timers.notifications.interval;\n\t\t\trunNotifications();\n\t\t}\n\t\t\n\t\t// Friend Updater\n\t\tif(coreTimeCount >= timers.friends.next)\n\t\t{\n\t\t\ttimers.friends.next = coreTimeCount + timers.friends.interval;\n\t\t\trunFriendList();\n\t\t}\n\t\t\n\t\t// User Chat Updater\n\t\tif(coreTimeCount >= timers.userchat.next)\n\t\t{\n\t\t\ttimers.userchat.next = coreTimeCount + timers.userchat.interval;\n\t\t\trunUserChat();\n\t\t}\n\t}\n\t\n\t// Chat Updater\n\tif(coreTimeCount >= timers.chat.next)\n\t{\n\t\ttimers.chat.next = coreTimeCount + timers.chat.interval;\n\t\trunChatUpdate();\n\t}\n}", "function initTimers(){\n Timers = [\n {\n tag: \"Work\",\n time: 25,\n seconds:0,\n defaultSound: true,\n soundType: \"ding\", \n volume: 80,\n index: 0\n },\n {\n tag: \"Short Break\",\n time: 5,\n seconds:0,\n defaultSound: false,\n soundType: \"elevator\", \n volume: 50,\n index: 1\n },\n {\n tag: \"Long Break\",\n time: 10,\n seconds:0,\n defaultSound: true,\n soundType: \"tone\", \n volume: 100,\n index: 2\n },\n {\n tag: \"Custom 1\",\n time: 25,\n seconds:0,\n defaultSound: true,\n soundType: \"bell\", \n volume: 100,\n index: 3,\n on: false\n },\n {\n tag: \"Custom 2\",\n time: 25,\n seconds:0,\n defaultSound: true,\n soundType: \"jingle\", \n volume: 100,\n index: 4,\n on: false\n }\n ]\n}", "function clearAllTimers() {\n\tfor (var i = 1; i < 9999; i++)\n\t\twindow.clearTimer(i);\n}", "function startTimer(){\n setTimeout(setIntervals, 300);\n setTimeout(rail_lights, 3000);\n setTimeout(getAudio, 3300);\n setTimeout(empty_window, 9000);\n}", "bindTimerFunction() {\n this.sweepCaches = this.sweepCaches.bind(this);\n this.sweepOldUpdates = this.sweepOldUpdates.bind(this);\n this.processGatewayQueue = this.processGatewayQueue.bind(this);\n }", "function timer () {\n const start = Date.now()\n\n return function stopTimer () {\n return Date.now() - start\n }\n}", "function clearAllTimers(flag)\n{\n\tif (flag & TIMER_CPULOAD) {\n\t\tfor (i = 0; i < timeout_cpuload.length; i++) {\n\t\t\tclearTimeout(timeout_cpuload[i]);\n\t\t}\n\t\ttimeout_cpuload = [];\n\t}\n}", "function refreshTimer () {\n\n if (variables.timeOutId) {\n elements.timer.className = ''\n window.clearTimeout(variables.timeOutId)\n }\n startTimer()\n}", "static time_callbacks(timer){\n console.info(\"time_callbacks #\" + timer + \"s\")\n //Purge current class \"time_current\"\n let elements = document.getElementsByClassName(\"time_current\")\n for (var i = 0; i < elements.length; i++) {\n elements[i].classList.remove('time_current');\n }\n\n //Add class time_current where it's needed\n elements = document.getElementsByClassName(\"t\"+timer)\n for (var i = 0; i < elements.length; i++) {\n elements[i].classList.add('time_current');\n }\n }", "function setTimers()\n{\n\ttimeID = window.setTimeout( \"updateAll()\", refreshRate );\n}", "function runTimer(){\r\n\t\tcallAjax(createAppointments, \"appointments\", \"get\");\r\n\t}", "function getTimerState() {\n return {\n allTimers: TimerStore.getAll()\n };\n}", "function resetTimers() {\n startTime = new Date;\n startTime.setHours(0);\n startTime.setMinutes(0);\n startTime.setSeconds(0);\n startTime.setMilliseconds(0);\n \n stopTime = new Date;\n stopTime.setHours(config.timer.hour);\n stopTime.setMinutes(config.timer.minute);\n stopTime.setSeconds(0);\n stopTime.setMilliseconds(0);\n }", "function resetTimer () {\n timerRunning = false;\n clearInterval(clockInterval);\n clearInterval(wpmInterval);\n}", "function initializeAllTimers(){\n $('.timer-container').each((i, el) => {\n const timerId = $(el).attr('data-timer-id');\n initializeTimer(timerId);\n });\n}", "function timer() {\n footballCrowd();\n timerId = setInterval(() => {\n time--;\n $timer.html(time);\n\n if(time === 0) {\n restart();\n lastPage();\n }\n }, 1000);\n highlightTiles();\n }", "function funTimerAll() {\n try {\n // Increment Counter\n global.intCounter += 1;\n\n\n // Check Exit Program?\n if (global.bolGlobalError) {\n process.exit();\n }\n\n\n\n // First Time Read of all data from Redis\n if (global.intStep <= global.intStepToStart && !global.bolWorkingOnStep && !global.bolDoItOnce) {\n global.bolWorkingOnStep = true;\n // Read intStep from Redis, \n // First Time Read should be 1\n // After Main Program Clear Redis, should be 2\n // After Main Program Read from DB and save to Redis, should be 3\n mRU.redisHGetAll(\"AllProgram:Main\", true, function(err, res) {\n if (err == \"0000\") {\n // Got intStep of Main Program from Redis\n global.intStep = parseInt(res['intStep']);\n if (global.intStep >= 2) {\n // Main Program / Master Process Get Data from DB and save them to Redis for other processes\n if (global.bolMainProgram && global.bolMasterProcess && global.intStep == 2 && !global.bolDoItOnce_2) {\n // Set Do it Once\n global.bolDoItOnce_2 = true;\n\n // Get aryGameList from DB and save to Redis\n mGR.funGetGameListFromDB(function(err, result) {\n if (err.code == \"0000\") {\n // Set Do it Once\n global.bolDoItOnce_21 = true;\n global.bolDoItOnce_22 = true;\n\n // Check All Step 2 Finished\n if (global.bolDoItOnce_21 && global.bolDoItOnce_22) {\n // Set intStep = 3 to Redis\n mRU.redisHmSet('AllProgram:Main', [\"intProcessID\", process.pid, \"intLastHB\", Date.now(), \"intStep\", 3], true, function(err2, res2) {\n // Nothing to do\n // mUT.funUpdateConsole('Set intStep OK?', false);\n // mUT.funUpdateConsole(err2, false);\n // mUT.funUpdateConsole(res2, false);\n });\n }\n } else {\n // GlobalError already = 1, so exit!\n mUT.funUpdateConsole('err.code: ', err.code);\n }\n });\n\n // TODO: Get Others from DB and save them to Redis\n global.bolDoItOnce_22 = true;\n }\n\n\n\n // Get Data from Redis After Main Program store everying to Redis\n if (global.intStep >= 3 && !global.bolDoItOnce_3) {\n // Set bolDoItOnce\n global.bolDoItOnce_3 = true;\n\n // Get aryGameList\n mRU.redisGet('aryGameList', function(err2, res2) {\n // Check Exist\n if (res2 == null) {\n mUT.funUpdateConsole(\"aryGameList Not Found in Redis, but intStep = 2, Impossible! Quit\", false);\n global.bolGlobalError = true;\n } else {\n global.aryGameList = JSON.parse(res2);\n \n // Set global.intStep to start all programs\n global.bolDoItOnce_31 = true;\n\n // Check All Step3 Finished\n if (global.bolDoItOnce_31 && global.bolDoItOnce_32) {\n global.intStep = global.intStepToStart + 1;\n global.bolDoItOnce = true;\n }\n\n // for Each element, init Game Result Last Update Date & Time\n for (let i=0;i<global.aryGameList.length;i++) {\n global.aryGameResultLastUpdateDT.push(0);\n global.aryGameResultLastUpdateWorking.push(false);\n global.aryGameResultNotGetWaitSecond.push(config.caryGameResultApi[0][global.aryGameList[i][\"gli_id\"]][0].intNotGetWaitSecond);\n global.aryGameResultFirstLoad.push(false);\n }\n }\n });\n\n // Get Other\n global.bolDoItOnce_32 = true;\n }\n }\n }\n global.bolWorkingOnStep = false;\n })\n }\n\n\n\n // If Main Program and Master Process,\n if (global.bolMainProgram && global.bolMasterProcess && global.intStep >= global.intStepToStart) {\n // Loop for aryGameList, and Check if need to get New Game Results\n for (let i=0; i<global.aryGameList.length; i++) {\n if (global.aryGameList[i][\"gli_status\"] == \"E\") {\n // This Game is Enabled in mysql, should check to get new game result\n\n // Check Currect Time > (Last Record Real Open Time Time + Duration + intNotGetWaitSecond)\n // AND, Check Time within this game Day Start & End Time\n if ((Date.now() > global.aryGameResultLastUpdateDT[i] + (global.aryGameList[i][\"gli_duration\"] + global.aryGameResultNotGetWaitSecond[i]) * 1000 &&\n !global.aryGameResultLastUpdateWorking[i] && mGR.funIsGameWithinTime(i)) \n || !global.aryGameResultFirstLoad[i]) {\n // Must Load Once\n global.aryGameResultFirstLoad[i] = true;\n\n // Wait Long Enough, should get new Game Result\n // mUT.funUpdateConsole(\"i: \" + i + \" | Date.now: \" + Date.now() + \" | LastUpdate DT + (duration + WaitSecond) * 1000: \" + (global.aryGameResultLastUpdateDT[i] + (global.aryGameList[i][\"gli_duration\"] + global.aryGameResultNotGetWaitSecond[i]) * 1000), false);\n\n // Set Working Flag\n global.aryGameResultLastUpdateWorking[i] = true;\n\n // Set Host and Path\n let strPathTemp = \"\";\n if (config.caryGameResultApi[0][global.aryGameList[i][\"gli_id\"]][0].intType == 0) {\n // Type 0:\n strPathTemp = config.caryGameResultApi[0][global.aryGameList[i][\"gli_id\"]][0].strPath +\n config.caryGameResultApi[0][global.aryGameList[i][\"gli_id\"]][0].strGameIDVar +\n config.caryGameResultApi[0][global.aryGameList[i][\"gli_id\"]][0].strGameID +\n config.caryGameResultApi[0][global.aryGameList[i][\"gli_id\"]][0].strCountVar +\n \"1\"\n } else {\n // Type 1:\n strPathTemp = config.caryGameResultApi[0][global.aryGameList[i][\"gli_id\"]][0].strPath +\n config.caryGameResultApi[0][global.aryGameList[i][\"gli_id\"]][0].strGameIDVar +\n config.caryGameResultApi[0][global.aryGameList[i][\"gli_id\"]][0].strGameID\n }\n let options = {\n host: config.caryGameResultApi[0][global.aryGameList[i][\"gli_id\"]][0].strHost, \n path: strPathTemp,\n // Without the headers, the api won't work in some urls\n headers: {'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36'}\n };\n mGR.funGetHtml(options, function(res) {\n try {\n // The Try here avoid problems in JSON.parse\n let objTempResult = JSON.parse(res)[\"result\"];\n mGR.funSaveGameResult(i, objTempResult, function(err) {\n global.aryGameResultLastUpdateWorking[i] = false;\n if (err.code == \"0000\") {\n mRU.funUpdateServerMonitor(\"Game Result Save to DB and Redis\");\n } else {\n mRU.funUpdateServerMonitor(\"Game Result Save to DB and Redis Error: \" + err.code);\n }\n });\n } catch (err) {\n global.aryGameResultLastUpdateWorking[i] = false;\n mUT.funUpdateConsole(\"Error Should Not Happen: \" + err, false);\n }\n });\n \n } else {\n // Do Nothing, Wait Another One Second\n }\n }\n }\n }\n\n\n\n // Global Counter Testing\n if (global.intCounter == 10) {\n mRU.funUpdateServerMonitor(\"Program Name: \" + global.strServerName + \n \" | Is Master: \" + global.bolMasterProcess + \n \" | Process ID: \" + process.pid, false);\n }\n } catch (err) {\n //\n }\n\n // Check Every 1 second\n setTimeout(funTimerAll, 1000);\n}", "function Simulator_NotifyInterpreterPanelResize_ClearTimer()\n{\n\t//has active timer?\n\tif (__SIMULATOR.NotifyInterpreterPanelResizeDelayed_Timer)\n\t{\n\t\t//clear it\n\t\t__EVENTS_QUEUE.RemoveEvent(__SIMULATOR.NotifyInterpreterPanelResizeDelayed_Timer);\n\t\t//make sure the timer is cleared\n\t\t__SIMULATOR.NotifyInterpreterPanelResizeDelayed_Timer = null;\n\t}\n}", "function TimerManager() {\n this.timers = {}; // Maps name: Timer\n this.runningTimers = {}; // Maps name: timerid\n}", "_autologinTimerExpired() {\n\t\twindow.autologin_timer_expired = () => {\n\t\t\tthis.startAuthentication();\n\t\t};\n\t}", "function timeReset() {\n setTimeout(resetAll, 2000);\n}", "function resetTimer(){\n\n time = 31;\n }", "function apDefer() {\n if (!apStub) global_timer.setHours( global_timer.getHours() + 1);\n}", "function initializeTimer() {\n //stopWatch = new DS.Utility.timer.Stopwatch(autoCompleteOnKeyPressDelay, onTimerCallBack, false);\n }", "function setTimers(){\r\n\t\t// Calcula cada cuantos segundos debe actualizar cada contador de recursos restantes para\r\n\t\t// aprovechar el temporizador del resto de relojes\r\n\t\tvar frecuencia = new Array(4);\r\n\t\tfor (var i = 0; i < 4; i++){\r\n\t\t\tfrecuencia[i] = (1 / produccion[i]) * 1000;\r\n\t\t\tif (!isFinite(frecuencia[i]) || frecuencia[i] < 0) frecuencia[i] = Number.POSITIVE_INFINITY;\r\n\t\t\t\t\t\tif (total[i] - actual[i] == 0) frecuencia[i] = Number.POSITIVE_INFINITY;\r\n\t\t\tsetInterval(crearTemporizadorRecurso(i), Math.floor(frecuencia[i]));\r\n\t\t}\r\n\r\n\t\tsetInterval(function () {\r\n\t\t\t/*\r\n\t\t\t * Se distinguen dos tipos de temporizadores, timeout y timeouta. Solo los primeros\r\n\t\t\t * provocan que la pagina se actualice al llegar a 0.\r\n\t\t\t */\r\n\t\t\tvar relojes = find(\"//*[@id='timeout' or @id='timeouta']\", XPList);\r\n\t\t\tfor (var i = 0; i < relojes.snapshotLength; i++){\r\n\t\t\t\tvar tiempo = calcular_segundos(relojes.snapshotItem(i).innerHTML) - 1;\r\n\t\t\t\tif (tiempo >= 0) relojes.snapshotItem(i).innerHTML = formatear_tiempo(tiempo);\r\n//\t\t\t\telse if (relojes.snapshotItem(i).id == 'timeout') document.location.reload();\r\n\t\t\t\telse if (relojes.snapshotItem(i).id == 'timeout' && relojes.snapshotItem(i).getAttribute('noreload') != 1) document.location.reload();\r\n\t\t\t}\r\n\t\t},1000);\r\n\r\n\t}", "function testTimer() {\n toast({text: \"Testing Timer\", duration: 3, type: \"success\"});\n\n var time = 46;\n setInterval(() => {\n\n time -= 1;\n NetworkTables.putValue(\"/robot/time\", time);\n\n if (time < -5) time = 126;\n\n }, 1000);\n}", "static reset() {\n updateTimeouts.forEach(clearTimeout);\n updateTimeouts = [];\n improvedTimestampsInitted = false;\n improvedTimestamps = [];\n }", "function timer()\r\n {\r\n console.log(\"running...\");\r\n }", "timer(key, cb, timing) {\n // always clear dupes\n if (timers[key]) {\n clearTimeout(timers[key]);\n delete timers[key];\n }\n\n if (!cb) {\n return null;\n }\n\n if (timing) {\n timers[key] = setTimeout(cb, timing);\n }\n\n return timers[key];\n }", "function clearAllWbdTimers(flag)\n{\n\tif (flag & TIMER_MASTERINFO) {\n\t\tfor (i = 0; i < g_wbdMasterInfoTimeout.length; i++) {\n\t\t\tclearTimeout(g_wbdMasterInfoTimeout[i]);\n\t\t}\n\t\tg_wbdMasterInfoTimeout = [];\n\t}\n\n\tif (flag & TIMER_MASTERLOGS) {\n\t\tfor (i = 0; i < g_wbdMasterLogsTimeout.length; i++) {\n\t\t\tclearTimeout(g_wbdMasterLogsTimeout[i]);\n\t\t}\n\t\tg_wbdMasterLogsTimeout = [];\n\t}\n}", "function breakTimer() {}", "function startTimer() {\n site.stTime = new Date().getTime();\n}", "function clearTimer() {\r\n clearInterval(timer);\r\n}", "function set_action_timer() {\n action_timer = action_timer_time;\n}", "startABRTimer_() {\n this.stopABRTimer_();\n this.abrTimer_ = window.setInterval(() => this.checkABR_(), 250);\n }", "function resetPTimer() {\n sessionStorage.setItem(\"pTimeVal\", 0);\n sessionStorage.setItem(\"pTimeValSecs\", 0);\n}", "function clearIntervalTimers() {\n\tif(intervalForServiceFee) {\n\t\tclearIntervalApp(intervalForServiceFee);\n\t\tintervalForServiceFee = '';\n\t}\n\tif(submitBtnCreateProfCountdown){\n\t\tclearIntervalApp(submitBtnCreateProfCountdown);\n\t\tsubmitBtnCreateProfCountdown = '';\n\t}\n\tif(submitBtnCreateProfDetailCountdown){\n\t\tclearIntervalApp(submitBtnCreateProfDetailCountdown);\n\t\tsubmitBtnCreateProfDetailCountdown = '';\n\t}\n}", "function Clearup() {\n App.Timer.ClearTime();\n EventLogout();\n //TO DO:\n }", "function doTimer() {\r\n if (!timerOnP) {\r\n timerOnP = true;\r\n return timedCount();\r\n };\r\n}", "registerEnvGlobalPackedFuncs() {\n // Register the timer function to enable the time_evaluator.\n const perf = compact.getPeformance();\n // Helper function to time the finvoke\n const timeExecution = (finvoke, ctx, nstep, repeat, minRepeatMs) => __awaiter(this, void 0, void 0, function* () {\n finvoke(this.scalar(1, \"int32\"));\n yield ctx.sync();\n const result = [];\n let setupNumber = nstep;\n for (let i = 0; i < repeat; ++i) {\n let durationMs = 0.0;\n do {\n if (durationMs > 0.0) {\n setupNumber = Math.floor(Math.max(minRepeatMs / (durationMs / nstep) + 1, nstep * 1.618));\n }\n const tstart = perf.now();\n finvoke(this.scalar(setupNumber, \"int32\"));\n yield ctx.sync();\n const tend = perf.now();\n durationMs = tend - tstart;\n } while (durationMs < minRepeatMs);\n const speed = durationMs / setupNumber / 1000;\n result.push(speed);\n }\n const ret = new Float64Array(result.length);\n ret.set(result);\n return new Uint8Array(ret.buffer);\n });\n const addOne = (x) => __awaiter(this, void 0, void 0, function* () {\n yield new Promise(resolve => setTimeout(resolve, 100));\n return x + 1;\n });\n this.registerAsyncServerFunc(\"wasm.TimeExecution\", timeExecution);\n this.registerAsyncServerFunc(\"testing.asyncAddOne\", addOne);\n }", "function resetTimer() {\r\n stopTimer();\r\n resetUI();\r\n timerTime = 0;\r\n seconds.innerText = '00';\r\n minutes.innerText = '00';\r\n}", "function onTimerCallBack() {\n populateResults();\n }", "function timerSetup() {\n // MINIGAME 1: 35sec\n if (minigame1) {\n timer = 35;\n }\n // MINIGAME 2: 5sec\n else if (minigame2) {\n timer = 5;\n }\n}", "_resetTimer() {\n const playTimer = Utils.getRandomFloat(this._playInterval / 4, this._playInterval * 2);\n const onFinish = () => {\n this.playRandomAnimation(this._playCallbacks.onError);\n }\n this._promises.timer = Utils.wait(playTimer, {onFinish});\n }", "function setTimers(){\n\t\t// Calcula cada cuantos segundos debe actualizar cada contador de recursos restantes para \n\t\t// aprovechar el temporizador del resto de relojes\n\t\tvar frecuencia = new Array(4);\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tfrecuencia[i] = (1 / produccion[i]) * 1000;\n\t\t\tif (!isFinite(frecuencia[i]) || frecuencia[i] < 0) frecuencia[i] = Number.POSITIVE_INFINITY;\n if (total[i] - actual[i] == 0) frecuencia[i] = Number.POSITIVE_INFINITY;\n\t\t\tsetInterval(crearTemporizadorRecurso(i), Math.floor(frecuencia[i]));\n\t\t}\n\n\t\tsetInterval(function () {\n\t\t\t/*\n\t\t\t * Se distinguen dos tipos de temporizadores, timeout y timeouta. Solo los primeros \n\t\t\t * provocan que la pagina se actualice al llegar a 0.\n\t\t\t */\n\t\t\tvar relojes = find(\"//*[@id='timeout' or @id='timeouta']\", XPList);\n\t\t\tfor (var i = 0; i < relojes.snapshotLength; i++){\n\t\t\t\tvar tiempo = calcular_segundos(relojes.snapshotItem(i).innerHTML) - 1;\n\t\t\t\tif (tiempo >= 0) relojes.snapshotItem(i).innerHTML = formatear_tiempo(tiempo);\n\t\t\t\telse if (relojes.snapshotItem(i).id == 'timeout') document.location.reload();\n\t\t\t}\n\t\t},1000);\n\n\t}", "_clearTimer() {\n\t\tconst timer = this.get('_timer');\n\n\t\tif (timer) {\n\t\t\tcancel(timer);\n\n\t\t\tthis.set('_timer');\n\t\t}\n\n\t\tthis.set('_nextDelay');\n\t\tthis.set('_times', 0);\n\t\tthis.set('_timestamp');\n\t}", "function domTimer() {\n $(`.timer`).text(`Timer: ${totalMinutes}:${totalSeconds}`);\n }", "function clearAll() {\n _.each(timers, (timer) => {\n // We don't know whether it's a setTimeout or a setInterval, but it doesn't really matter. If the id doesn't\n // exist nothing bad happens.\n clearTimeout(timer);\n clearInterval(timer);\n });\n}", "function initTimer() {\n Consts.stockTime = 0;\n Consts.currStatus = Status.init;\n initRefresh = setInterval(refreshClock, 1);\n}", "function clearTimer() {\n debug(\"clearTimer\");\n let timer = document.querySelector('.timer');\n\n stopTime();\n timer.remove();\n }", "function Stopwatch() {}", "function initSetTimerListeners() {\n\t$(\"#breakLength .fa-minus\").on(\"click\", function() {\n\t\tif(!running\t&& !$(\"#clock-container\").hasClass(\"paused\")) {\n\t\t\tif(breakTime > 1) {\n\t\t\t\tbreakTime -= 1;\n\t\t\t\t$(\"#break\").text(breakTime);\n\t\t\t}\n\t\t}\n\t});\t\n\n\t$(\"#breakLength .fa-plus\").on(\"click\", function() {\n\t\tif(!running\t&& !$(\"#clock-container\").hasClass(\"paused\")) {\n\t\t\tif(breakTime < 60) {\n\t\t\t\tbreakTime += 1;\n\t\t\t\t$(\"#break\").text(breakTime);\t\t\n\t\t\t}\n\t\t}\n\t});\t\n\t$(\"#sessionLength .fa-minus\").on(\"click\", function() {\n\t\tif(!running\t&& !$(\"#clock-container\").hasClass(\"paused\")) {\n\t\t\tif(sessionTime > 1) {\n\t\t\t\tsessionTime -= 1;\n\t\t\t\t$(\"#session\").text(sessionTime);\n\t\t\t}\n\t\t}\n\t});\t\n\t$(\"#sessionLength .fa-plus\").on(\"click\", function() {\n\t\tif(!running\t&& !$(\"#clock-container\").hasClass(\"paused\")) {\n\t\t\tif(sessionTime < 60) {\n\t\t\t\tsessionTime += 1;\n\t\t\t\t$(\"#session\").text(sessionTime);\n\t\t\t}\t\n\t\t}\n\t});\n}", "function runTimer() {\n let currentTimer = leadingZero(iniTimer[0]) + \":\" + leadingZero(iniTimer[1]) + \":\" + leadingZero(iniTimer[2]);\n timer.innerHTML = currentTimer;\n iniTimer[3]++;\n\n iniTimer[0] = Math.floor((iniTimer[3]/100)/60);\n iniTimer[1] = Math.floor((iniTimer[3]/100) - (iniTimer[0] * 60));\n iniTimer[2] = Math.floor(iniTimer[3] - (iniTimer[1] *100) - (iniTimer[0] * 6000));\n\n}", "resetTimer_() {\n clearTimeout(this.timer);\n this.timer = 0;\n }", "function adjustTimer() {\r\n\tif (timerLength < 10) duration.innerText = '0' + timerLength;\r\n\telse duration.innerText = timerLength;\r\n\t//adjusts display for time (minutes) when app is static\r\n\tif (running === false) { minutes.innerText = timerLength; }\r\n}", "function runTimer() {\n var displayText = runCounters(true)\n document.getElementById('timer-window').innerHTML = displayText\n}", "function Simulator_OnTimerEvent()\n{\n\t//has onTimer event?\n\tif (__SIMULATOR.OnTimerEventTimer)\n\t{\n\t\t//clear it\n\t\t__EVENTS_QUEUE.RemoveEvent(__SIMULATOR.OnTimerEventTimer);\n\t}\n\t//reset the timer\n\t__SIMULATOR.OnTimerEventTimer = null;\n\t//are we busy?\n\tif (__GESTURES.IsBusy() || __WAIT_MANAGER.IsWaiting())\n\t{\n\t\t//timeout on it\n\t\t__SIMULATOR.OnTimerEventTimer = __EVENTS_QUEUE.AddEvent(Simulator_OnTimerEvent, 100);\n\t}\n\telse\n\t{\n\t\t//get current default action\n\t\tvar defaultPath = __SIMULATOR.StateManager.CurrentState.ListOfPaths[0];\n\t\t//trigger an ontimer event\n\t\t__SIMULATOR.ProcessEvent(new Event_Event(__SIMULATOR.Interpreter.LoadedObjects[defaultPath.InterpreterObjectId], defaultPath.Event, defaultPath.Data));\n\t}\n}", "resetTimer() {\n this.stopTimer();\n console.log(\"resetTimer() called, timer instance restarts from 0.\");\n this.mElapsedTime = 0;\n this.notifyTimerObservers(this.mElapsedTime);\n const handler = function () {\n this.mElapsedTime++;\n this.notifyTimerObservers(this.mElapsedTime);\n }\n this.mElapsedTime = 0;\n mTimerIntervalId = window.setInterval(handler.bind(this), 1000);\n }", "function timer () {\n \n timerId = setInterval(triviaCount, 1000);\n function triviaCount () {\n if (timerCounter === 0) {\n clearInterval(timerId);\n timeRunsOut();\n }\n else {\n $(\".timer-number\").html(timerCounter);\n timerCounter--;\n }\n\n }\n // console.log(timer);\n \n }", "function CReiryokuTimer(_category, _num){\n\n\n /* =================================================================== */\n // member \n /* =================================================================== */\n this.category = _category;\n this.num = _num;\n this.state = \"stop\"; //\"stop\" \"ready\" \"run\" \"end\"\n this.readyCnt = 0;\n this.td_clickCnt = 0;\n\n this.reiryoku = new Array(40, 40); // ---/--- \n this.time = new Array(0, 0); // --:-- \n this.endTime = null;\n this.refillInterval = new Array(5, 0); // 霊力が1回復する時間 [0]:Minute, [1]:second\n\n this.bShowTimeLeftForComplete = false; // 完全回復までの残り時間を表示するかどうか\n this.timeDisplayType = 1; // 1:回復までを表示 2:全快までを表示\n \n // elements\n this.reiryokuElemants = document.getElementsByName(\"reiryoku_val\"); \n this.reiryokuRemainStr = document.getElementsByName(\"reiryoku_remain_str\");\n this.timeElements = document.getElementsByName(\"reiryoku_time\");\n this.slashElement = document.getElementsByName(\"reiryoku_slash\");\n this.resetButtonElement = document.getElementsByName(\"reiryoku_button\");\n this.tdElement = document.getElementsByName(\"reiryoku_td\");\n \n // notification\n this.notificationId = _category;\n \n\n\n /* =================================================================== */\n // method \n /* =================================================================== */\n\n CReiryokuTimer.prototype.getClickIncValue = function(){\n var value = 10;\n if(localStorage.getItem(\"opt_timerAd_re_clickIncValue\")){\n value = localStorage.getItem(\"opt_timerAd_re_clickIncValue\");\n }\n return Number(value);\n }\n\n CReiryokuTimer.prototype.loadRefillInterval = function(){\n if(localStorage.getItem(\"opt_timerAd_re_rcvTime_m\")){\n this.refillInterval[0] = Number( localStorage.getItem(\"opt_timerAd_re_rcvTime_m\") );\n }\n if(localStorage.getItem(\"opt_timerAd_re_rcvTime_s\")){\n this.refillInterval[1] = Number( localStorage.getItem(\"opt_timerAd_re_rcvTime_s\") );\n }\n }\n\n CReiryokuTimer.prototype.resetRefillTime = function(){\n this.loadRefillInterval();\n this.time[0] = this.refillInterval[0];\n this.time[1] = this.refillInterval[1];\n }\n\n /* ---------------------------------------------------- */\n // 描画\n /* ---------------------------------------------------- */\n CReiryokuTimer.prototype.drawReiryoku = function(){\n for (var i = 0; i < this.reiryoku.length; ++i) {\n this.reiryokuElemants[i].innerText = this.reiryoku[i];\n }\n }\n \n \n CReiryokuTimer.prototype.drawTimeText = function(){\n if(this.timeDisplayType == 1){\n // 回復までを表示\n this.reiryokuRemainStr[0].innerText = \"回復まで \";\n for(var i=0;i<2;i++){\n if(this.state == \"stop\"){\n this.timeElements[i].innerText = \"--\"; \n }\n else{\n this.timeElements[i].innerText = this.time[i]<10 ? \"0\"+this.time[i] : this.time[i];\n }\n }\n }\n else{\n // 全快までを表示\n this.reiryokuRemainStr[0].innerText = \"全快まで \"; \n for(var i=0;i<2;i++){\n if(this.state == \"stop\"){\n this.timeElements[i].innerText = \"--\"; \n }\n else{\n var reiryokuToFull = this.reiryoku[1] - this.reiryoku[0] - 1;\n var totalSec = reiryokuToFull * this.refillInterval[0] * 60 + reiryokuToFull * this.refillInterval[1];\n totalSec += this.time[0] * 60 + this.time[1];\n var hour = Math.floor( totalSec / 3600 );\n var min = Math.floor( (totalSec % 3600) / 60);\n if(totalSec <= 0){\n this.timeElements[0].innerText = \"00\";\n this.timeElements[1].innerText = \"00\";\n }\n else{\n this.timeElements[0].innerText = hour<10 ? \"0\"+hour : hour;\n this.timeElements[1].innerText = min<10 ? \"0\"+min : min;\n }\n }\n }\n }\n }\n \n /* ---------------------------------------------------- */\n // カウントダウン処理\n /* ---------------------------------------------------- */\n CReiryokuTimer.prototype.ready = function(){\n this.state = \"ready\";\n this.updateTextColor();\n this.readyCnt = 0;\n this.drawReiryoku();\n this.drawTimeText();\n if(!hSetInterval){\n hSetInterval = setInterval(countDownAll, 1000);\n }\n }\n \n CReiryokuTimer.prototype.countDown = function(currentTime){\n switch(this.state){\n case \"stop\":\n break;\n case \"ready\":\n this.readyCnt += 1;\n if(this.readyCnt >= 3){\n if(this.reiryoku[0] >= this.reiryoku[1]){ \n this.stop(); \n break;\n }\n \n // prepare\n saveTimerPos();\n this.state = \"run\";\n this.updateTextColor();\n this.readyCnt = 0;\n this.td_clickCnt = 0;\n localStorage.setItem(\"timer_re_prevReiryokuBeforeCount\", this.reiryoku[0]);\n localStorage.setItem(\"timer_re_maxReiryoku\", this.reiryoku[1]);\n this.loadRefillInterval();\n\n // set endTime\n var refillInterval_sec = this.refillInterval[0] * 60 + this.refillInterval[1];\n var timeRequired = (this.reiryoku[1] - this.reiryoku[0] -1) * refillInterval_sec\n + this.time[0] * 60 + this.time[1]; \n var dt = new Date();\n dt.setSeconds(dt.getSeconds() + timeRequired);\n this.endtime = dt.getTime();\n this.drawReiryoku();\n }\n break;\n case \"run\":\n var timeLeft = Math.round( (this.endtime - currentTime) / 1000 ) // millisecond to second\n if(timeLeft <= 0){\n this.time = [0, 0];\n this.reiryoku[0] = this.reiryoku[1];\n this.state = \"end\"; \n this.updateTextColor();\n }\n else{\n var refillInterval_sec = this.refillInterval[0] * 60 + this.refillInterval[1];\n var reiryokuLeft = Math.ceil( timeLeft / refillInterval_sec );\n this.reiryoku[0] = this.reiryoku[1] - reiryokuLeft;\n this.time[0] = Math.floor( (timeLeft % refillInterval_sec) / 60 );\n this.time[1] = timeLeft % refillInterval_sec % 60;\n }\n\n //draw\n this.drawTimeText();\n this.drawReiryoku();\n break;\n case \"end\":\n this.state = \"stop\";\n // this.stop();\n //通知 \n this.notice();\n tryToClearInterval();\n break;\n default:\n break;\n }\n }\n \n CReiryokuTimer.prototype.stop = function(){\n for(var i=0;i<2;i++){\n this.time[i]=0;\n }\n this.state = \"stop\";\n this.updateTextColor();\n this.drawTimeText();\n this.drawReiryoku();\n this.td_clickCnt = 0;\n tryToClearInterval();\n }\n\n\n /* ---------------------------------------------------- */\n // 各種更新\n /* ---------------------------------------------------- */\n CReiryokuTimer.prototype.updateTextColor = function(){\n switch(this.state){\n case \"ready\":\n this.tdElement[0].style.color = fontColor_ready;\n this.tdElement[1].style.color = fontColor_ready;\n this.reiryokuRemainStr[0].style.color = fontColor_ready; \n break;\n case \"run\":\n this.tdElement[0].style.color = fontColor_run;\n this.tdElement[1].style.color = fontColor_run;\n this.reiryokuRemainStr[0].style.color = fontColor_run; \n break;\n case \"stop\":\n this.tdElement[0].style.color = fontColor_stop;\n this.tdElement[1].style.color = fontColor_stop;\n this.reiryokuRemainStr[0].style.color = fontColor_stop; \n break;\n case \"end\":\n this.tdElement[0].style.color = fontColor_end;\n this.tdElement[1].style.color = fontColor_end;\n this.reiryokuRemainStr[0].style.color = fontColor_end; \n break;\n default:\n break;\n }\n }\n \n\n /* ---------------------------------------------------- */\n // 通知\n /* ---------------------------------------------------- */\n CReiryokuTimer.prototype.notice = function(){\n var opt = {\n type: 'basic',\n priority: 0\n };\n var mes = \"\";\n var soundEnable = false;\n var soundUrl = \"\";\n //通知の有無、message, sound\n if(localStorage.getItem(\"opt_timer_alertSettingReiryoku\")? JSON.parse(localStorage.getItem(\"opt_timer_alertSettingReiryoku\")):true)\n {\n opt.message = localStorage.getItem(\"opt_timer_message_r\")?localStorage.getItem(\"opt_timer_message_r\"):\"霊力が回復しました!\";\n soundEnable = localStorage.getItem(\"opt_timer_soundEnable_r\")? JSON.parse(localStorage.getItem(\"opt_timer_soundEnable_r\")):true;\n soundUrl = localStorage.getItem(\"opt_timer_soundFile_r\")?JSON.parse(localStorage.getItem(\"opt_timer_soundFile_r\") ).url:\"taiko02.mp3\";\n }\n else{return;}\n\n //icon\n if(localStorage.getItem(\"opt_timer_imageFile_all\")){\n opt.iconUrl = JSON.parse(localStorage.getItem(\"opt_timer_imageFile_all\")).url;\n }else{\n opt.iconUrl = \"../images/ShiroproLauncher_48.png\";\n }\n //title\n opt.title = localStorage.getItem(\"opt_timer_notificationTitle\")?localStorage.getItem(\"opt_timer_notificationTitle\"):\"御城プロジェクト 通知\";\n \n //notification\n chrome.notifications.clear(this.notificationId, function(id){});\n chrome.notifications.create(this.notificationId, opt, function(id) {});\n \n //sound\n if(soundEnable){\n var notificationSound = new Audio(soundUrl);\n //volume\n var vol = localStorage.getItem(\"opt_timer_soundVolume\") ? \n Number(localStorage.getItem(\"opt_timer_soundVolume\")) : 5;\n //play\n notificationSound.volume = vol / 10;\n notificationSound.play();\n }\n }\n \n \n /* ---------------------------------------------------- */\n // マウスホイールイベント\n /* ---------------------------------------------------- */\n CReiryokuTimer.prototype.mouseWheelEventListenerRegist_time = function(i){\n var timer = this;\n return function(e){\n if(timer.timeDisplayType == 2){ return; }\n if(timer.state != \"ready\"){ return; }\n\n // 霊力1の回復時間の取得\n timer.loadRefillInterval();\n\n if(e.wheelDelta > 0){\n if(timer.time[0] == timer.refillInterval[0] && timer.time[1] == timer.refillInterval[1]){\n // ピッタリ5:00でホイールアップした時は、0に\n timer.time[0] = timer.time[1] = 0;\n timer.time[1] = 0;\n }\n else {timer.time[i] +=1;}\n }\n if(e.wheelDelta < 0){timer.time[i] -=1;};\n\n if(i==0){\n // 分表示部分\n if(timer.time[i] > timer.refillInterval[0]){\n timer.time[0] = timer.refillInterval[0];\n timer.time[1] = timer.refillInterval[1];\n }\n else if(timer.time[i] == timer.refillInterval[0]){\n if(timer.time[1] >= timer.refillInterval[1]){\n timer.time[0] = timer.refillInterval[0];\n timer.time[1] = timer.refillInterval[1];\n }\n }\n else if(timer.time[i] < 0){ \n timer.time[0] = timer.refillInterval[0]; \n timer.time[1] = timer.refillInterval[1];\n }\n }else{\n // 秒表示部分\n if(timer.time[i] > 59){\n // timer.time[0] += 1;\n timer.time[i] = 0;\n }\n else if(timer.time[i] < 0){\n if(timer.time[0] == timer.refillInterval[0]){timer.time[0] -= 1;}\n if(timer.time[0] < 0){\n timer.time[0] = timer.refillInterval[0]; \n timer.time[1] = timer.refillInterval[1]; \n }\n else{timer.time[i] = 59;}\n }\n }\n timer.ready();\n }\n }\n\n CReiryokuTimer.prototype.mouseWheelEventListenerRegist_reiryoku = function(){\n var timer = this;\n return function(e){\n if(timer.state == \"run\"){return;}\n\n // クリックしたX座標を取得して、reiryoku[0], reiryoku[1]の判断\n var clickPos_x = event.offsetX;\n el = timer.slashElement;\n var slashPosxMiddle = Math.floor( el[0].offsetLeft + el[0].offsetWidth/2 ) -1;\n if(clickPos_x < slashPosxMiddle){\n // 霊力現在値をマウスホイール\n if(e.wheelDelta > 0){timer.reiryoku[0] +=1;};\n if(e.wheelDelta < 0){timer.reiryoku[0] -=1;};\n\n if(timer.reiryoku[0] > timer.reiryoku[1]){ \n timer.reiryoku[0] = 0;\n }\n if(timer.reiryoku[0] < 0){ \n timer.reiryoku[0] = timer.reiryoku[1];\n }\n }else{\n // 霊力最大値をマウスホイール\n if(e.wheelDelta > 0){timer.reiryoku[1] +=1;};\n if(e.wheelDelta < 0){timer.reiryoku[1] -=1;};\n\n if(timer.reiryoku[1] > 9999){ \n timer.reiryoku[1] = 9999;\n }\n if(timer.reiryoku[1] < timer.reiryoku[0]){ \n timer.reiryoku[1] = timer.reiryoku[0];\n }\n\n }\n // リカバリータイムをリセット\n timer.resetRefillTime();\n\n // カウントダウン準備\n if(timer.state == \"ready\"){\n timer.ready();\n }\n else if(timer.reiryoku[0] < timer.reiryoku[1] && clickPos_x < slashPosxMiddle){\n // stop状態の時\n timer.resetRefillTime();\n timer.ready();\n }\n else{\n // stop状態で、最大値を変更してる時\n timer.stop();\n }\n\n }\n }\n \n /* ---------------------------------------------------- */\n // リセットボタンクリックイベント\n /* ---------------------------------------------------- */\n CReiryokuTimer.prototype.buttonClickEventRegist = function(){\n var timer = this;\n return function(){\n if(timer.state == \"stop\"){\n if(localStorage.getItem(\"timer_re_prevReiryokuBeforeCount\")){\n timer.reiryoku[0] = Number( localStorage.getItem(\"timer_re_prevReiryokuBeforeCount\") );\n if(timer.reiryoku[0] > timer.reiryoku[1]){ \n timer.reiryoku[0] = timer.reiryoku[1];\n }\n timer.resetRefillTime();\n timer.ready();\n }\n }\n else{\n timer.stop();\n }\n }\n }\n \n /* ---------------------------------------------------- */\n // タイマークリックイベント\n /* ---------------------------------------------------- */\n CReiryokuTimer.prototype.tdClickEventRegist_time = function(){\n var timer = this;\n return function(){\n switch (timer.state) {\n case \"stop\":\n\n break;\n case \"ready\":\n timer.ready();\n break;\n case \"run\":\n\n break;\n case \"end\":\n \n break;\n }\n }\n }\n\n CReiryokuTimer.prototype.tdClickEventRegist_remainStr = function(){\n var timer = this;\n return function(){\n if(timer.timeDisplayType == 1){ timer.timeDisplayType = 2; }\n else{ timer.timeDisplayType = 1; }\n timer.drawTimeText();\n }\n }\n\n CReiryokuTimer.prototype.tdClickEventRegist_reiryoku = function(){\n var timer = this;\n return function(){\n switch (timer.state) {\n case \"stop\":\n timer.resetRefillTime();\n timer.ready();\n break;\n case \"ready\":\n // クリックしたX座標を取得して、reiryoku[0], reiryoku[1]の判断\n var clickPos_x = event.offsetX;\n el = timer.slashElement;\n var slashPosxMiddle = Math.floor( el[0].offsetLeft + el[0].offsetWidth/2 ) -1;\n if(clickPos_x < slashPosxMiddle){\n // 霊力現在値をクリック\n if(timer.reiryoku[0] == timer.reiryoku[1]){\n timer.reiryoku[0] += timer.getClickIncValue();\n if(timer.reiryoku[0] > timer.reiryoku[1]){\n timer.reiryoku[0] = 0;\n }\n }\n else { \n timer.reiryoku[0] += timer.getClickIncValue();\n if(timer.reiryoku[0] > timer.reiryoku[1]){\n timer.reiryoku[0] = timer.reiryoku[1];\n }\n }\n \n if(timer.reiryoku[0] < 0){ \n timer.reiryoku[0] = timer.reiryoku[1];\n }\n }else{\n // 霊力最大値をクリック\n timer.reiryoku[1] += timer.getClickIncValue();\n if(timer.reiryoku[1] > 9999){ \n timer.reiryoku[1] = 9999;\n }\n if(timer.reiryoku[1] < timer.reiryoku[0]){ \n timer.reiryoku[1] = timer.reiryoku[0];\n }\n\n }\n timer.resetRefillTime();\n timer.ready();\n break;\n case \"run\":\n timer.ready();\n // timer.state = \"ready\";\n break;\n case \"end\":\n \n break;\n }\n }\n }\n /* ---------------------------------------------------- */\n // イベントリスナーの登録\n /* ---------------------------------------------------- */\n //mouseWheel event(reiryoku)\n this.tdElement[0].addEventListener(\"wheel\", this.mouseWheelEventListenerRegist_reiryoku() );\n\n //mouseWheel event(time)\n for(var i=0; i<this.timeElements.length ;i++){\n this.timeElements[i].addEventListener(\"wheel\", this.mouseWheelEventListenerRegist_time(i) );\n }\n this.tdElement[1].addEventListener(\"wheel\", () => { } );\n\n //button click event\n this.resetButtonElement[0].addEventListener(\"click\", this.buttonClickEventRegist());\n\n //table data click event\n this.tdElement[0].addEventListener(\"click\", this.tdClickEventRegist_reiryoku());\n this.tdElement[1].addEventListener(\"click\", this.tdClickEventRegist_time());\n this.reiryokuRemainStr[0].addEventListener(\"click\", this.tdClickEventRegist_remainStr());\n \n}", "function timerOff() {\n alert.stop();\n $(\"#timer\").text(\"\");\n $(\"#message\").text(\"\");\n activeTask = false;\n $(\"title\").text(\"Clocky\");\n\n timerOn = false;\n timerHours = timerMinutes = timerSeconds = 0;\n}", "function Clearup(){\n //TO DO:\n EventLogout();\n App.Timer.ClearTime();\n }", "function clearTimer() {\n clearInterval(clock);\n}", "function clearTimer() {\nclearInterval(timer);\n}", "function timerIncrement()\n {\n idleTime++;\n if (idleTime > 6)\n {\n hideTopbarOut();\n }\n }", "function Timers() {\n\n this.timers = {};\n this.idCounter = 0;\n\n}", "resetTimer() {\n this.timeSelected = 0;\n this.completeElapsed = 0;\n this.complete = false;\n }", "function Timer(){\n this.ArrayTime = [];\n}", "function processAlarms(){\n \n}", "function TIMER($item) {\n /**\n * STORE TIMER IN DATA\n */\n var that = this, vData = window.rt00VA.data;\n that.id = null;\n that.rubyID = null;\n /**\n * STORE ID ON SYSTEM\n */\n that.save = function () {\n vData[that.rubyID].id = that.id;\n };\n /**\n * REMOVE TIMER OF OBJECT\n */\n that.clear = function () {\n that.id = vData[that.rubyID].id;\n clearTimeout(that.id);\n clearInterval(that.id);\n vData[that.rubyID].id = that.id = null;\n };\n /**\n * FUNCTION CONTRUCTOR\n * + Remove timer of object at first\n */\n var __contruct = function () {\n that.rubyID = DB.GetRubyID($item);\n that.clear();\n }();\n }", "function inc_timer(){\n timer++;\n}", "restartRechargeTimers(){\n this._units.forEach((unit) => {\n unit.restartRechargeTimer();\n });\n this._rechargedUnitsMap.clear();\n }", "function AppMonitor() {\n}", "function resetTimer() {\r\n \r\n if(!timerControl) {\r\n initTime = 0;\r\n stopTime = 0;\r\n totalPassedTime = 0;\r\n lapInitialTimer = 0;\r\n stopwatch.innerText = formatTimer(totalPassedTime);\r\n resetLapsHistory();\r\n \r\n // clear local storage\r\n localStorage.clear();\r\n }\r\n}", "function startTimer() {\n app.interval = setInterval(function () {\n app.timer.innerHTML = app.minute + ':' + app.second;\n app.second++;\n if (app.second == 60) {\n app.minute++;\n app.second = 0;\n }\n if (app.minute == 60) {\n app.hour++;\n app.minute = 0;\n }\n if (app.second < 10) {\n app.second = '0' + app.second;\n }\n }, 1000);\n}", "function resetUpdateTrustTimer() {\n chrome.storage.local.get(null, function(items) {\n\n //clear old timer\n chrome.alarms.clear('updateTrustTimer');\n\n //setup new timer\n chrome.alarms.create('updateTrustTimer', {\n periodInMinutes: Number(items.intervalMin)\n });\n });\n}", "function TimerManager() {\r\n this.timers = [];\r\n this._timersToDelete = [];\r\n this._last = 0;\r\n }" ]
[ "0.7024895", "0.6216643", "0.6178682", "0.6061379", "0.6042539", "0.60242134", "0.6019928", "0.59608024", "0.59482926", "0.593258", "0.59140414", "0.5906312", "0.5891599", "0.58909", "0.588722", "0.58843887", "0.5851347", "0.5840052", "0.5838455", "0.57992816", "0.57936734", "0.5790353", "0.5761593", "0.5731722", "0.5730334", "0.5729955", "0.5724675", "0.571764", "0.57097626", "0.5695559", "0.5695078", "0.56898606", "0.56757635", "0.563685", "0.56302226", "0.56214416", "0.5618775", "0.56126386", "0.5605772", "0.56049216", "0.56020504", "0.55839723", "0.5581129", "0.55806273", "0.55688983", "0.55686665", "0.5565042", "0.5561762", "0.5560851", "0.55587214", "0.5553612", "0.55480444", "0.55449283", "0.55417573", "0.55319643", "0.5514498", "0.5514263", "0.55100226", "0.5509143", "0.55090857", "0.55021024", "0.5501851", "0.54856634", "0.548068", "0.5478581", "0.5476613", "0.5475085", "0.5474044", "0.5471987", "0.5469457", "0.5469195", "0.54688156", "0.5467195", "0.54660153", "0.5457291", "0.54547524", "0.5451609", "0.5449806", "0.54497653", "0.54440457", "0.5442196", "0.54362965", "0.5435199", "0.5434864", "0.54281884", "0.54275775", "0.5423946", "0.54218936", "0.54192436", "0.5418704", "0.5412629", "0.5412427", "0.54107714", "0.54001313", "0.5399226", "0.53964823", "0.53931594", "0.5389738", "0.53854376", "0.5379423" ]
0.681154
1
Alert the server validation messages
function _returnServerMsgs(response, postdata) { var response_txt = response.responseText; if (response_txt) { var aor = $.parseJSON(response_txt); return [aor.success, aor.message, aor.new_id]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showValidationNotification() {\n //TODO: We need to make the validation UI much better, there's a lot of inconsistencies in v8 including colors, issues with the property groups and validation errors between variants\n\n //need to show a notification else it's not clear there was an error.\n localizationService.localizeMany([\n \"speechBubbles_validationFailedHeader\",\n \"speechBubbles_validationFailedMessage\"\n ]\n ).then(function (data) {\n notificationsService.error(data[0], data[1]);\n });\n }", "function showValidationNotification() {\n //TODO: We need to make the validation UI much better, there's a lot of inconsistencies in v8 including colors, issues with the property groups and validation errors between variants\n\n //need to show a notification else it's not clear there was an error.\n localizationService.localizeMany([\n \"speechBubbles_validationFailedHeader\",\n \"speechBubbles_validationFailedMessage\"\n ]\n ).then(function (data) {\n notificationsService.error(data[0], data[1]);\n });\n }", "function showValidationAlert(message) {\r\n showModalAlert(message);\r\n}", "function showFormValidationAlert() {\n\tformIsValid()\n\t\t? null\n\t\t: alert('Please complete the order form and try again.')\n}", "function alertValidationMessage(message) {\n alert(message);\n}", "showInvalidFormValidation() {\n this.showErrorToast({\n msg: \"The given data was invalid. Please check your form again!\",\n dt: 3800\n });\n }", "showErrorMessage() {}", "function serverValidation() {\r\n\t$('#password, #userid, #challengeAns, #newPassword, #verifyPassword').addClass('error');\r\n\t$('#challengeAnsError, .icon.la-Error, .icon.la-Warning, .error').addClass('show');\r\n}", "onValidationRequest() {\n\n\t\t\t// Simple validation - check if there are any inputs with errors\n\t\t\tvar errors = $(\".sapMInputBaseContentWrapperError\").length,\n\t\t\t\tresult = errors === 0;\n\n\t\t\t// Raise the response event back to the consumer\n\t\t\tsap.ui.getCore().getEventBus().publish(\"codan.zUrgentBoard\", \"validationResult\", {\n\t\t\t\tresult: result\n\t\t\t});\n\t\t}", "validate() {\n this.errorMessage = \"Dit is geen text\";\n super.validate();\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 showValidation(feedback) {\n feedback.errors.forEach(function (error) {\n console.log('ERROR: ' + error);\n });\n feedback.warnings.forEach(function (warning) {\n console.log('WARNING: ' + warning);\n });\n console.log(\"Validator finished with \" + feedback.warnings.length + \" warnings and \" + feedback.errors.length + \" errors.\");\n process.exit(feedback.errors.length > 0 ? 2 : 0);\n}", "function validate(){\n var name = document.getElementById('name').value;\n var email = document.getElementById('email').value;\n var number = document.getElementById('phnum').value;\n var msg = document.getElementById('msg').value;\n\n if(name==''){\n document.getElementById('nameError').innerHTML = \"You can't leave this field empty\"\n }else{\n document.getElementById('nameError').innerHTML = \"\"}\n if(email == ''){\n document.getElementById('emailError').innerHTML = \"Please enter your Email address\"\n }else{\n document.getElementById('emailError').innerHTML = \"\"}\n if(number == ''){\n document.getElementById('phoneError').innerHTML = \"Please enter your phone number\"\n }else{\n document.getElementById('phoneError').innerHTML = \"\"}\n if(msg == ''){\n document.getElementById('msgError').innerHTML = \"You have to write a message!\"\n }else{\n document.getElementById('msgError').innerHTML = \"\"}\n\tif(name!='' && email!='' && number!='' && msg!=''){\n\t\tswal({\n\t\ttitle:\"Thank you\",\n\t\ttext:\"Your Message has been sent successfully\",\n\t\tallowOutsideClick:\"true\",\n\t\ttype:\"success\"\n\t});\n\t}\n}", "validate() {\n // Als NIET (!) valide, dan error weergeven\n if (!this.isValid()) {\n this.showError();\n console.log(\"niet valide\");\n }\n else\n this.hideError();\n }", "function okAlertDialog () {\n\terrorspan\n\t}", "onInvalid(errors) {\n console.log(errors);\n }", "function addRuleErrorMsg() {\n $(\"#addrule-error\").text(\"Invalid Request\");\n}", "function submitErrorHandler (errMessage){\n alertDialog(errMessage);\n }", "function notValidAlert () {\n alert('That is not a valid command, please try again.')\n}", "function validation() {\r\n\t\t\r\n\t}", "requiredFieldMsg() {\n try {\n alert('Please fill out all required fields');\n // window.location.reload();\n } catch (error) {\n alert('There seems to be a problem!');\n }\n }", "async function throwAllert() {\n await AllertCtl.componentOnReady();\n\n const alert = await AllertCtl.create({\n header: \"Alert\",\n subHeader: \"Invalid Input\",\n message: \"Please check yout inputs\",\n buttons: [\"OK\"]\n });\n return await alert.present();\n}", "function showErrorMessage(msg) { }", "function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}", "function solo_admin()\r\n{\r\n\t'domready', Sexy = new SexyAlertBox();\r\n\tSexy.error('<h1>Error</h1><p>Esta operacion solo puede ser realizada por el administrador de la aplicación.</p>')\r\n}", "function error(){\n alert('invalid info')\n}", "submitError(){\n\t\tif(!this.isValid()){\n\t\t\tthis.showErrorMessage();\n\t\t}\n\t}", "function errorDialog(status){\n window.alert(\"Chyba pri načítaní údajov zo servera.\\nStatus= \"+status);\n}", "function detectAndAlertError(serverResponse) {\n if (!serverResponse.success) {\n var error = \"There was a problem with this step.\";\n if (serverResponse.message) {\n error += \" The server said: \" + serverResponse.message;\n }\n \n window.alert(error);\n enableAccountInputs();\n return true;\n }\n \n return false;\n }", "function errorDialog(status){\n window.alert(\"Chyba pri naÄŤĂ­tanĂ­ Ăşdajov zo servera.\\nStatus= \"+status);\n}", "function validate() {\n\t\t$('#loanForm').validate({\n\t\t\tinvalidHandler: function(form, validator) {\n\t\t\t\t// If Errors Are Present, Alert User with a Dailog //\n\t\t\t\t$.mobile.changePage( \"#dialogAlert\", {\n\t\t\t\t transition: \"pop\",\n\t\t\t\t reverse: true,\n\t\t\t\t changeHash: true\n\t\t\t\t});\n\n\t\t\t\t// When #alertDialog Loads, Target ID, Clear the Div and Append the Following Error Alert //\n\t\t\t\t// In A listview //\n\t\t\t\t$('#alert').empty();\n\t\t\t\t$('#alert').append($('<li>').append($('<img src=\"error.png\" class=\"iconImg\" />' +\n\t\t\t\t\t'<h4>OOPS!</h4>' +\n\t\t\t\t\t'<p>Please fill out all required fields before saving.</p>')\n\t\t\t\t));\n\t\t\t\t// Refresh The Dialog listview to Ensure Proper View //\n\t\t\t\t$('#alert').listview(\"refresh\");\n\t\t\t},\n\t\t\tsubmitHandler: function() {\n\t\t\t\tsaveData();\n\t\t\t}\n\t\t})\n\t}", "function errorDialog(status)\n{\n window.alert(\"Error when reading server data.\\nStatus= \"+status);\n}", "function validator() {\n\t\tif ( $smsCheck.is(':checked') && $smsInfo.val() ) {\n\t\t\tsendMessage( $smsInfo.val().replace(/[^A-Z0-9]/ig, \"\") + \n\t\t\t\t\t\t getServiceEmail( $smsCarrier.prop('value') ));\n\t\t\tconsole.log(\"sms email sent\");\n\t\t\t$smsInfo.slideUp();\n\t\t\t$smsCarrier.slideUp();\n\t\t}\n\t\tif ( $emailCheck.is(':checked') && $emailInfo.val() ) {\n\t\t\tsendMessage( $emailInfo.val() );\n\t\t\tconsole.log(\"regular email Sent...\");\n\t\t\t$emailInfo.slideUp();\n\t\t}\n\n\t\t// clear inputs\n\t\t$inputs.val(\"\");\n\t\t$message.val(\"\");\n\t\t// uncheck checkboxes\n\t\t$smsCheck.prop('checked', false); \n\t\t$emailCheck.prop('checked', false); \n\n\t}", "function checkValidity() {\n if (invalidWidgetIds.length > 0) {\n msgService.showInfoRight(localization.getString('emailbuilder.error.unfilledrequiredproperties'));\n } else {\n msgService.hideInfoRight();\n }\n }", "function msg() {\n document.getElementById('l5').style.display = 'block';\n document.getElementById('l5').value = 'User is invalid';\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function messageBox()\r\n{\r\n\tUIATarget.onAlert = function onAlert(alert) {\r\nvar title = alert.name();\r\n//UIALogger.logWarning(\"Alert with title '\" + title + \"' encountered.\");\r\n\t\tdelay(1);\r\nif (title == \"Error\"){\r\n\tdelay(2);\r\nif(alert.staticTexts()[\"Please check your details and relogin\"].isValid())\r\n\t{\r\n\t\talert.buttons()[\"OK\"].tap();\r\n\t\tUIALogger.logPass(\"Error message box is displayed\");\r\n\t}\r\n\telse\r\n\t{\r\n\t\tUIALogger.logFail(\"Error message box is not displayed\");\r\n\t}\r\n\t\r\n\treturn true;\r\n}\r\n\t\telse\r\n\t\t{\r\n\t\t\tUIALogger.logFail(\"Unable to find the ERROR message box\");\r\n\t\t\t//\talert.buttons()[\"OK\"].tap();\r\n\t\t}\r\n// return false to use the default handler\r\n\treturn false;\r\n}\r\n}", "checkValidationWarnings () {\n\t\tif (\n\t\t\tthis.model.validationWarnings instanceof Array &&\n\t\t\tthis.api\n\t\t) {\n\t\t\tthis.api.warn(`Validation warnings: \\n${this.model.validationWarnings.join('\\n')}`);\n\t\t}\n\t}", "function successMessage(){\n window.alert(\"Success: Deadline Sent to Deadline Dashboard\");\n}", "function WARNING$static_(){ValidationState.WARNING=( new ValidationState(\"warning\"));}", "function showErrorMessages() {\n\tparent.showErrorMessages();\n}", "function showErrorMessages() {\n\tparent.showErrorMessages();\n}", "function validate() {\n if (validateEmail(email)) {\n $error.fadeOut();\n } else {\n $error.fadeIn();\n $error.text(email + \" E-mail не корректен\");\n }\n }", "sendErrors(connection) {\r\n Object.keys(this._messages).forEach(message => {\r\n connection.window.showErrorMessage(message);\r\n });\r\n }", "sendErrors(connection) {\r\n Object.keys(this._messages).forEach(message => {\r\n connection.window.showErrorMessage(message);\r\n });\r\n }", "function posterror() { alert( \"There was an error. TODO: Prompt to resubmit here.\" ); }", "function updateUiError() {\n showElements(statusMessage);\n statusMessage.textContent =\n \"Sorry you have entered invalid value, please try again!\";\n statusMessage.classList.remove(\"success\");\n statusMessage.classList.add(\"error\");\n}", "function showValidationError(fields) {\n\t\t\t$ionicPopup.alert({\n\t\t\t\ttitle: vm.formatValidationError(fields),\n\t\t\t\tokText: 'Ok',\n\t\t\t\tokType: 'button-energized'\n\t\t\t});\n\t\t}", "function showErrorMessage() {\n\t$(\"#flash-message\").html(\"<br>Something went wrong. Please refresh the page and try again.<br>\");\n\t$(\"#flash-message\").show();\n}", "function validate()\r\n{\r\n \r\n alert( \"Values entered successfully\" );\r\n}", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function testValidFields() {\n\t// fill in the form values\n\tF(\"#messageSender\").type(VALID_SENDER);\n\tF(\"#messageReceiver\").type(VALID_RECEIVER);\n\tF(\"#kMessage\").type(TEST_MESSAGE);\n\n\t// click the button once all the fields are filled in\n\tF(\"#messageSubmit\").click();\n\n\t// in forms, we want to assert the form worked as expected\n\t// here, we assert we got the success message from the AJAX call\n\tF(\".alert-info\").visible(function() {\n\t\t// create a regular expression that evaluates the successful text\n\t\tvar successRegex = /Successful Insertion of new message/;\n\n\n\t\t// the ok() function from qunit is equivalent to SimpleTest's assertTrue()\n\t\tok(F(this).hasClass(\"alert alert-info\"), \"Alert Info\");\n\t\tok(successRegex.test(F(this).html()), F(this).html().valueOf('#mError'));\n\n\t});\n}", "function catchFail() {\n alert(\"Something went wrong on the server-side. Please try again!\");\n }", "function errorDialog(status){\n window.alert(\"Chyba pri načítaní údajov zo servera.\\nError reading data from the server.\\nStatus= \"+status);\n}", "function updateRelationErrorMsg() {\n relationErrorMsg.innerHTML = relationInput.validationMessage;\n}", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function validateUserRegistrationForm() {\n\tconsole.log(`# validating recipient registration...`);\n}", "function showMessage(res) {\n\t\tvar target = document.getElementById(\"invalid-container\");\n\t\tif (res == 'fail') {\n\t\t\tif($('#invalid-container').children().length == 0) {\n\t\t\t\tvar div = document.createElement('div');\n\t\t\t\tdiv.textContent = 'Invalid username or password';\n\t\t\t\tdiv.setAttribute('id', 'invalid');\n\t\t\t\ttarget.appendChild(div);\n\t\t\t}\n\t\t} else {\n\t\t\twindow.location='http://www.hsd-studio.com/';\n\t\t}\n\t}", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function showAlert() {\n alert = $mdDialog.alert({\n title: 'Attention',\n textContent: 'Incorrect username and/or password. Please enter information again.',\n ok: 'Close'\n });\n $mdDialog\n .show( alert )\n .finally(function() {\n alert = undefined;\n });\n }", "function validateVarDefs() {\n $.ajax({\n url: serverDefsRequest,\n error: function() {\n popupTitle = 'Failed to load database';\n popupContents = 'Your database did not load correctly. There may be a ' +\n 'typo in your url, or your database file may be corrupt. Please ' +\n 'check your database and refresh this page';\n popupButtons =\n '<a href=\"javascript:void(0)\" class=\"button standard finishDraw\"' +\n 'onclick=\"closeAllPopups()\">Cancel</a>';\n gees.tools.toggleNotification(popupTitle, popupContents, popupButtons);\n }\n });\n}", "validate() {\n\t\tconst msg = this.validator ? this.validator(this.value) : '';\n\t\tthis.error = msg;\n\t}", "static messageSaveError() {\n saveErrorMessage.style.display = 'block';\n }", "alertError(content) {\n alert(\"danger\", content)\n }", "function showErrorAlert(msg) {\n $(\"#errorAlertMessage\").html(msg);\n $(\".alert\").hide();\n $(\"#errorAlert\").show();\n\n showAlert(msg);\n}", "function validation() {\t\t\t\t\t\r\n\t\t\t\t\tvar frmvalidator = new Validator(\"app2Form\");\r\n\t\t\t\t\tfrmvalidator.EnableOnPageErrorDisplay();\r\n\t\t\t\t\tfrmvalidator.EnableMsgsTogether();\r\n\r\n\t\t\t\t\tif (document.getElementById('reasonForVisit').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitPatientReason\",\"req\",\"Please enter your reason For Visit\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitPatientReason_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (document.getElementById('visitYes').checked==false){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitNewpatient\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\tif (document.getElementById('visitNo').checked==false){\r\n\t\t\t\t\t\t\tfrmvalidator.addValidation(\"visitNewpatient\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitNewpatient_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('visitPrDocYes').checked==false){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"hasPhysian\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\tif (document.getElementById('visitPrDocNo').checked==false){\r\n\t\t\t\t\t\t\tfrmvalidator.addValidation(\"hasPhysian\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_hasPhysian_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('emailAddress').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitEmail\",\"req\", \"Email is required\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitEmail\",\"email\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitEmail_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('patientFirstName').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientFirstName\",\"req\",\"Please enter your First Name\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientFirstName_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('patientLastName').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientLastName\",\"req\",\"Please enter your Last Name\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientLastName_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('pdob').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"pdob\",\"\",\"DOB is required\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_pdob_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('phoneNumber').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientPhoneNumber\",\"req\",\"Phone Number is required\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientPhoneNumber\",\"numeric\",\"numbers only\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientPhoneNumber\",\"minlen=10\",\"not enough numbers\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientPhoneNumber_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('visitGender').value==\"0\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitGender\",\"dontselect=0\",\"Please select an option 'Male or Female'\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitGender_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('patientZipCode').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientZipCode\",\"numeric\",\"numbers only\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientZipCode\",\"minlen=5\",\"not a valid zipcode\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientZipCode\",\"req\",\"zip code is required\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientZipCode_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('visit_terms_911').checked==false){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"agreeTerms\",\"selmin=2\",\"please check all boxes to continue\");\r\n\t\t\t\t\t\tif (document.getElementById('visit_custom_terms').checked==false){\r\n\t\t\t\t\t\t\tfrmvalidator.addValidation(\"agreeTerms\",\"selmin=2\",\"please check all boxes to continue\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_agreeTerms_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n \r\n}", "validate() {}", "function checkFormSubmit() {\n var errCode = getURLVar(\"error\");\n if (errCode !== false) {\n if (errCode == \"0\") {\n $('#errorMSG').css(\"color\", \"green\");\n $('#errorMSG').html('Success! Thanks for contacting us.');\n } else if (errCode == \"1\") {\n $('#errorMSG').css(\"color\", \"red\");\n $('#errorMSG').html('Please complete all fields.');\n } else if (errCode == \"2\") {\n $('#errorMSG').css(\"color\", \"red\");\n $('#errorMSG').html('Please enter a valid email address.');\n }\n }\n }", "function validation(e) {\n $(selectors.error).remove();\n if (validName && validContact && validMail) {\n $(selectors.successMsg).removeClass('hide').addClass('show');\n $(selectors.name).val('');\n $(selectors.contactNo).val('');\n $(selectors.email).val('');\n validName = false;\n validContact = false;\n validMail = false;\n } else {\n $(selectors.name).after('<span class=\"error\">Name is required</span>');\n $(selectors.contactNo).after('<span class=\"error\">Contact No is required.</span>');\n $(selectors.email).after('<span class=\"error\">Email is required.</span>');\n }\n }", "alertError(message) {\n this.$root.alert.type = 'error';\n this.$root.alert.message = message;\n this.$root.alert.show = true;\n }", "function onFail(message) {\n alert('Failed because: ' + message);\n }", "function fail() {\n\n //vise feilmelding\n BootstrapAlert($('#alert-container'), \"danger\", \"Det gikk noe galt med registrering\");\n}", "function error(msg) {\n inputEl.classList.add('invalid');\n M.toast({\n html: msg,\n displayLength: 4000\n })\n }", "validate() { }", "function onFail(msg){ \n console.log(msg); alert(msg); \n }", "function validateInputFields() {\n var msg = \"\";\n if ($(\"#txtAlertName\").val() === \"\") {\n msg += \"O campo 'Nome' é obrigatório.\";\n }\n if ($(\"#txtAlertDescription\").val() === \"\") {\n if (msg.length > 0) { msg += \"<br>\"; }\n msg += \"O campo 'Descrição' é obrigatório.\";\n }\n if ($(\"#txtAlertDueDate\").data(\"DateTimePicker\").date() === null) {\n if (msg.length > 0) { msg += \"<br>\"; }\n msg += \"O campo 'Data' é obrigatório.\";\n }\n if (msg.length > 0) {\n MessageBox.info(msg, { Div: \"#divAlertModalMessage\" });\n return false;\n }\n MessageBox.clear({ Div: \"#divAlertModalMessage\" });\n return true;\n }", "function alertErrorMsg(s){ errorAlert.html('<i class=\"fa fa-warning\"></i> ' + s).show(); }", "function validateCustom(data) {\n setHidden(\"customLoading\");\n if (data[\"ok\"]) {\n presentAlert(\"alert-success\", \"<strong>Success:</strong> Alert created!\");\n } else {\n presentAlert(\"alert-danger\", \"<strong>Error creating alert:</strong> \" + data[\"error\"]);\n }\n}", "function onFail(message) {\n alert('Se ha producido un error: ' + message);\n}", "function onFail(mesage) {\n alert('Failed because: ' + message);\n}", "userExists(){\n // set Status for previous view in case server validation failed \n this.displayMode = 'none';\n this.isAgreed = false;\n // add xhr message into form error validation message object - will be shown on screen\n for(let i in this.messageService.xhr.warn){\n this.addform.emailid.$setValidity(i, !this.messageService.xhr.warn[i]);\n }\n\n this.abortForm = true;\n }", "function returnErrorMessage() {\n $('.result-line').text(\"That is not a valid response\");\n }", "function osAlert() {\r\n\t var mySpd = document.getElementById('osSPD');\r\n\t if (mySpd.checkValidity() === false) {\r\n\t //alert('Enter Own Ship Speed in Knots from 0 to 45.');\r\n\t mySpd.style.background = \"rgba(255,0,0,0.5)\";\r\n\t } else {\r\n\t mySpd.style.background = \"white\";\r\n\t }\r\n\t}", "function validateFields(xhr, status, args, dlg) {\n\tif(args.validationFailed) {\n\t\tPF(dlg).jq.effect(\"shake\", {times:5}, 100);\n\t\tPF(dlg).show();\n\t}\n\telse {\n\t\tPF(dlg).hide();\n\t}\n}", "validateForm () {\n const form = this.panelEl.querySelector('.panel-content');\n if (!form.checkValidity()) {\n this.fail('Please correct errors navmesh configuration.');\n }\n }", "function checkMessage(e){\n resetInnerHTML('errMessage');\n document.getElementById('message').removeAttribute('class');\n var message = document.getElementById('message').value.trim();\n var errorMsg = \"\";\n\n if(message.length > 1000){\n errorMsg += '* Message should be shorter than 1000 chars';\n }\n\n if(errorMsg.length > 0){\n if(e){\n e.preventDefault();\n }\n document.getElementById('errMessage').innerHTML = errorMsg;\n setAttribute('message', 'class', 'errorBorder');\n }\n}", "function formValidation() {\n //* If validation of email fails, add the warning class to email input and set the display of warning message to inline.\n if (!validation.isEmailValid(email.value)) {\n email.classList.add(\"warning\");\n email.nextElementSibling.style.display = \"inline\";\n }\n //* If validation of name fails, add the warning class to name input and set the display of warning message to inline.\n if (!validation.isNameValid(name.value)) {\n name.classList.add(\"warning\");\n name.nextElementSibling.style.display = \"inline\";\n }\n /*\n * If validation of message fails, add the warning class to message text area and set the display of warning\n * message to inline\n */\n if (!validation.isMessageValid(message.value)) {\n message.classList.add(\"warning\");\n message.nextElementSibling.style.display = \"inline\";\n }\n /*\n *If validation of title fails, add the warning class to title input and set the display of warning\n *message to inline\n */\n\n if (!validation.isTitleValid(title.value)) {\n title.classList.add(\"warning\");\n title.nextElementSibling.style.display = \"inline\";\n }\n if (\n validation.isEmailValid(email.value) &&\n validation.isNameValid(name.value) &&\n validation.isTitleValid(title.valid) &&\n validation.isMessageValid(message.value)\n ) {\n return true;\n } else return false;\n}", "function alertMessage(errorMessage) {\n $('#alertMessage').html(errorMessage)\n $('#alertMessage').show();\n}", "function validbutton()\n{\nalert(\"Thankyou for registering for blood donation. Have a healthy life!\");\n}", "function appValidation() {\n if ($(\"#registerForm\").length > 0)\n registerFormValid();\n if ($(\"#loginForm\").length > 0)\n loginFormValid();\n if ($(\"#checkForm\").length > 0)\n checkFormValid();\n if ($('#saleForm').length > 0)\n saleFormValid();\n }", "function errorGoogle() {\r\n\t\twindow.alert('Your API is NOT Valid. Please check again');\r\n}", "function do_error(message) {\n $('#approveButton').prop('disabled', false);\n $('#statusDiv').html('');\n\n $('#error-box').show();\n $('#error-box').html('<p>Failed. Reload page and try again or contact support.</p> ');\n if (message) {\n console.log('server: '+message);\n $('#error-box').append('<p>System response: '+message+'</p>');\n }\n}", "function popErrorBox(message) {\n alert(\"something has gone wrong\");\n }", "function onFail(message) {\n // alert('Failed because: ' + message);\n}", "function validate_clientsms(){\n\tif(document.frmModule.ClientName.value == ''){\n\t\tdocument.getElementById('lblClientName').innerHTML = 'This field is required';\n\t\tdocument.frmModule.ClientName.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lblClientName').innerHTML = '';\n\t}\n\tif(document.frmModule.txtSubject.value == ''){\n\t\tdocument.getElementById('lbltxtSubject').innerHTML = 'This field is required';\n\t\tdocument.frmModule.txtSubject.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lbltxtSubject').innerHTML = '';\n\t}\n\tif(document.frmModule.txaMessage.value == ''){\n\t\tdocument.getElementById('lbltxaMessage').innerHTML = 'This field is required';\n\t\tdocument.frmModule.txaMessage.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lbltxaMessage').innerHTML = '';\n\t}\n\tif(document.frmModule.txaMessage.value.length >160){\n\t\tdocument.getElementById('lbltxaMessage').innerHTML = 'Message should be within 160 chars';\n\t\tdocument.frmModule.txaMessage.focus();\n\t\treturn false;\n\t}else{\n\t\tdocument.getElementById('lbltxaMessage').innerHTML = '';\n\t}\n}" ]
[ "0.69753385", "0.69753385", "0.6909447", "0.68662524", "0.6840733", "0.6718147", "0.6549251", "0.64947903", "0.6448691", "0.6434383", "0.6373157", "0.6369466", "0.6366853", "0.63605", "0.62822455", "0.6277431", "0.62709796", "0.62673295", "0.62484187", "0.62299794", "0.62116885", "0.6211575", "0.62032604", "0.6184642", "0.61753577", "0.6141807", "0.6138807", "0.6125183", "0.6103871", "0.61026824", "0.6099627", "0.6089728", "0.60800207", "0.60766745", "0.6070826", "0.60664666", "0.60464936", "0.6045993", "0.60437334", "0.6028706", "0.60255843", "0.60255843", "0.6017034", "0.60108477", "0.60108477", "0.60068434", "0.6005655", "0.6003941", "0.59743357", "0.5969082", "0.59564894", "0.5954175", "0.5945415", "0.59313625", "0.5925949", "0.592089", "0.5918767", "0.5917987", "0.5913557", "0.5913557", "0.5913557", "0.5913557", "0.5913557", "0.5913557", "0.5913557", "0.59115916", "0.5910784", "0.58986026", "0.58966035", "0.5889366", "0.58715653", "0.5869012", "0.58682793", "0.58620393", "0.58463264", "0.58396626", "0.5834413", "0.58339334", "0.5818469", "0.5814061", "0.58136237", "0.58120507", "0.58110553", "0.58032644", "0.5801576", "0.5797398", "0.5797167", "0.5783777", "0.57796353", "0.5772929", "0.57716584", "0.5768329", "0.5763184", "0.5762032", "0.57603866", "0.5759968", "0.57498384", "0.5747298", "0.57457554", "0.5744117", "0.57424694" ]
0.0
-1
custom destroyAll watcher TODO: check this has been merged then use native destroyAll method see:
destroyAllWatchers(){ let watchers = scrollMonitor.watchers, eventTypes = scrollMonitor.eventTypes; for (var w = 0, x = watchers.length; w < x; w++) { for (var i = 0, j = eventTypes.length; i < j; i++) { watchers[w].callbacks[eventTypes[i]].length = 0; } } watchers.length = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "beforeDestroy () {\n unwatchAll(this);\n }", "removeAll() {\n this.listeners.forEach(listener => listener.destroy());\n this.listeners = [];\n }", "removeAllEvents() {\n this.destroy();\n }", "destroyAll(...data) {\n return Promise.resolve().then(() => {\n const _destroyPlugin = (i = this.plugins.length - 1) => {\n return -1 < i ? Promise.resolve().then(() => {\n const pluginName = this.plugins[i].name;\n // emit event\n return this.plugins[i].destroy().then(() => {\n this.emit(\"destroyed\", pluginName, ...data);\n return Promise.resolve();\n // loop\n }).then(() => {\n return _destroyPlugin(i - 1);\n });\n }) : Promise.resolve();\n };\n return _destroyPlugin();\n // end\n }).then(() => {\n this.plugins = [];\n this.emit(\"alldestroyed\", ...data);\n return Promise.resolve();\n // remove all external resources\n }).then(() => {\n return (0, rmdirp_1.default)(this.externalRessourcesDirectory);\n });\n }", "doDestroy() {\n this.trigger('destroy');\n this.removeAllListeners();\n super.doDestroy();\n }", "cleanUpEvents() {\n for (let idx in this.eventsToClean) {\n this.eventsToClean[idx].removeCleanupListeners();\n }\n }", "beforeDestroy () {\n if (watchers) { // unwatch the model\n watchers.forEach((unwatch) => unwatch());\n watchers = [];\n }\n }", "beforeDestroy () {\n if (watchers) { // unwatch the model\n watchers.forEach((unwatch) => unwatch());\n watchers = [];\n }\n }", "destroy() {\n let i;\n for (let type in this._listeners) {\n let arr = this._listeners[type];\n for (i = 0; i < arr.length; i += 1) {\n arr[i] = null;\n }\n }\n }", "destroy(cb) {\n this.removeAll(cb);\n }", "destroy(all = false) {\n this.removeEventListeners();\n this.removeAllEvents();\n if (all) {\n this.teardown();\n }\n }", "destroy() {\n if (Object.values(this.events).length) {\n for (let event in this.events) {\n window.removeEventListener(event.name, event.fn);\n }\n }\n }", "static destroyAll() {\n applications.forEach(proc => {\n try {\n proc.destroy(false);\n } catch (e) {\n logger.warn('Exception on destroyAll', e);\n }\n });\n\n applications.splice(0, applications.length);\n }", "doDestroy() {\n const me = this;\n\n me.trigger('destroy');\n if (me.listeners && me.listeners.detacher) {\n me.listeners.detacher();\n }\n me.removeAllListeners();\n\n super.doDestroy();\n }", "destroy() {\n if (!this.destroyed) {\n this.onResize.removeAll();\n this.onResize = null;\n this.onUpdate.removeAll();\n this.onUpdate = null;\n this.destroyed = true;\n this.dispose();\n }\n }", "function destroyAll(t) {\n every(t, (obj) => {\n destroy(obj);\n });\n }", "destroy () {\n this.eventListeners = null;\n }", "destroy() {\n this.removeDomListeners()\n // 238-4\n this.unsubscribers.forEach(unsub => unsub())\n }", "destroy() {\n this.listeners = null;\n }", "destroy() {\n this.removeDOMListeners();\n this.unsubscribers.forEach((unsub) => unsub());\n }", "destroy() {\n const deleteList = Object.keys(this.workers).map((worker) => new Worker(worker));\n\n deleteList.forEach((worker) => {\n this.deleteWorker(worker, true);\n })\n }", "destroy() {\n this.eventTracker.removeAll();\n }", "destroy () {\n\n this.particles.forEach((particle) => {\n\n this.emit('particle.destroy', particle)\n })\n\n this.recycleBin = []\n this.particles = []\n }", "teardown () {\n if (this.active) {\n // remove self from vm's watcher list\n // this is a somewhat expensive operation so we skip it\n // if the vm is being destroyed.\n if (!this.vm._isBeingDestroyed) {\n remove(this.vm._watchers, this);\n }\n var i = this.deps.length;\n while (i--) {\n this.deps[i].removeSub(this);\n }\n this.active = false;\n }\n }", "Destroy() {\n for (const key in this.plugins) {\n if (this.plugins.hasOwnProperty(key)) {\n const plugin = this.plugins[key];\n if(plugin.destroy){\n plugin.destroy();\n }\n }\n }\n }", "function DestroyAllViewers()\n{\n if (rmxfViewers != null)\n for (var i = 0; i < rmxfViewers.length; i++)\n if (rmxfViewers[i] != null)\n rmxfViewers[i].Destroy();\n rmxfViewers = null;\n}", "destroyAllBugs(){\n this.bugs = this.chort.getBugs()\n this.bugs.clear(true) // not working?!\n //tell chort\n this.chort.setBugs(this.bugs)\n }", "removeAllListeners() {\n const listeners = this.eventListeners;\n let i, thisObj;\n\n for (const event in listeners) {\n const bucket = listeners[event]; // We iterate backwards since we call removeListener which will splice out of\n // this array as we go...\n\n for (i = bucket.length; i-- > 0;)\n /* empty */\n {\n const cfg = bucket[i];\n this.removeListener(event, cfg);\n thisObj = cfg.thisObj;\n\n if (thisObj && thisObj.untrackDetachers) {\n thisObj.untrackDetachers(this);\n }\n }\n }\n }", "destroy() {\n this.emit('destroy');\n this.removeAllListeners();\n }", "destroy () {\n this.subscribers.forEach(subscriber => subscriber.unsubscribe());\n }", "willDestroy() {\n this._super(...arguments);\n\n // clean up object holding onto old references\n let oldDidUpdateAttrsValues = this.get('_oldDidUpdateAttrsValues') || {};\n Object.keys(oldDidUpdateAttrsValues).forEach(key => {\n delete oldDidUpdateAttrsValues[key].callback;\n delete oldDidUpdateAttrsValues[key].triggerOnValue;\n delete oldDidUpdateAttrsValues[key].value;\n delete oldDidUpdateAttrsValues[key];\n });\n this.set('_oldDidUpdateAttrsValues', null);\n }", "destroy() {\n\t\tthis.roots.map( root => root.destroy() );\n\t\tthis.stopListening();\n\t}", "$onDestroy() {\n this.$unwatchData();\n this.$unwatchUser();\n\n if (this.data && this.data.$destroy) {\n this.data.$destroy();\n }\n\n if (this.$disableRefresh) {\n this.$timeout.cancel(this.$disableRefresh);\n this.$disableRefresh = undefined;\n }\n }", "destroy() {\n\t\tfor ( const command of this.commands() ) {\n\t\t\tcommand.destroy();\n\t\t}\n\t}", "destroy() {\n this.activeSubsets.forEach(subset => {\n subset.destroy();\n });\n this.call('hermes_destroy_mqtt_protocol_handler', this.protocolHandler);\n }", "onDestroy() {\n this.rotAnimations.forEach((anim) => {\n anim.complete();\n });\n if (this.timeouts[0]) clearTimeout(this.timeouts[0]);\n if (this.timeouts[1]) clearTimeout(this.timeouts[1]);\n this.rotatable1.destroy();\n this.rotatable2.destroy();\n if (this.followers[0]) this.followers[0].forEach((f) => f.destroy());\n if (this.followers[1]) this.followers[1].forEach((f) => f.destroy());\n this.followers = [];\n if ( this.paths[0]) this.paths[0].destroy();\n if ( this.paths[1]) this.paths[1].destroy();\n this.paths = [];\n this.toprg.destroy();\n this.botrg.destroy();\n if (this.emitters) {\n this.emitters.forEach((emitter) => {\n emitter.killAll();\n emitter.stop();\n });\n }\n\n }", "destroy() {\n this.meshes.forEach(mesh => {\n mesh.destroy();\n });\n this.meshes.clear();\n this.lights.clear();\n this.__deleted = true;\n }", "destroyEvents() {\n this.arena.player.config.destroyEvents();\n this.arena.player.sprite.remove();\n\n for (let creature in this.arena.monsters) {\n this.arena.monsters[creature].config.destroyEvents();\n this.arena.monsters[creature].sprite.remove();\n }\n }", "destroy() {\n this.feedList.forEach((feed) => feed.destroy());\n delete this.feedList;\n this.feedList = [];\n }", "destroy() {\n this.subscribers = null;\n }", "destroyEvents() {\n this._stopAttacking();\n this.controller.destroyEvents();\n this.healthBar.destroy()\n this.mechanics.collisionBox.destroy()\n }", "destroy() {\n this.notify('destroy', {});\n super.destroy();\n }", "destroy() {\n this.notify('destroy', {});\n super.destroy();\n }", "destroy() {\n this.notify('destroy', {});\n super.destroy();\n }", "destroy() {\n this.emitter.removeAllListeners();\n }", "destroy() {\n\t\tfor(const [event, listener] of this.listeners) this.client.removeListener(event, listener);\n\t\tthis.listeners.clear();\n\t}", "function destroy(all){\n setAutoScrolling(false, 'internal');\n setAllowScrolling(true);\n setMouseHijack(false);\n setKeyboardScrolling(false);\n addClass(container, DESTROYED);\n\n [\n afterSlideLoadsId, \n afterSectionLoadsId,\n resizeId,\n scrollId,\n scrollId2,\n g_doubleCheckHeightId,\n resizeHandlerId\n ].forEach(function(timeoutId){\n clearTimeout(timeoutId);\n });\n\n window.removeEventListener('scroll', scrollHandler);\n window.removeEventListener('hashchange', hashChangeHandler);\n window.removeEventListener('resize', resizeHandler);\n\n document.removeEventListener('keydown', keydownHandler);\n document.removeEventListener('keyup', keyUpHandler);\n\n ['click', 'touchstart'].forEach(function(eventName){\n document.removeEventListener(eventName, delegatedEvents);\n });\n\n ['mouseenter', 'touchstart', 'mouseleave', 'touchend'].forEach(function(eventName){\n document.removeEventListener(eventName, onMouseEnterOrLeave, true); //true is required!\n });\n\n //lets make a mess!\n if(all){\n destroyStructure();\n }\n }", "function destroy(all){\n setAutoScrolling(false, 'internal');\n setAllowScrolling(true);\n setMouseHijack(false);\n setKeyboardScrolling(false);\n addClass(container, DESTROYED);\n\n [\n afterSlideLoadsId, \n afterSectionLoadsId,\n resizeId,\n scrollId,\n scrollId2,\n g_doubleCheckHeightId,\n resizeHandlerId,\n g_transitionLapseId\n ].forEach(function(timeoutId){\n clearTimeout(timeoutId);\n });\n\n window.removeEventListener('scroll', scrollHandler);\n window.removeEventListener('hashchange', hashChangeHandler);\n window.removeEventListener('resize', resizeHandler);\n\n document.removeEventListener('keydown', keydownHandler);\n document.removeEventListener('keyup', keyUpHandler);\n\n ['click', 'touchstart'].forEach(function(eventName){\n document.removeEventListener(eventName, delegatedEvents);\n });\n\n ['mouseenter', 'touchstart', 'mouseleave', 'touchend'].forEach(function(eventName){\n document.removeEventListener(eventName, onMouseEnterOrLeave, true); //true is required!\n });\n\n //lets make a mess!\n if(all){\n destroyStructure();\n }\n }", "function destroy(all){\n setAutoScrolling(false, 'internal');\n setAllowScrolling(true);\n setMouseHijack(false);\n setKeyboardScrolling(false);\n addClass(container, DESTROYED);\n\n [\n afterSlideLoadsId, \n afterSectionLoadsId,\n resizeId,\n scrollId,\n scrollId2,\n g_doubleCheckHeightId,\n resizeHandlerId,\n g_transitionLapseId\n ].forEach(function(timeoutId){\n clearTimeout(timeoutId);\n });\n\n window.removeEventListener('scroll', scrollHandler);\n window.removeEventListener('hashchange', hashChangeHandler);\n window.removeEventListener('resize', resizeHandler);\n\n document.removeEventListener('keydown', keydownHandler);\n document.removeEventListener('keyup', keyUpHandler);\n\n ['click', 'touchstart'].forEach(function(eventName){\n document.removeEventListener(eventName, delegatedEvents);\n });\n\n ['mouseenter', 'touchstart', 'mouseleave', 'touchend'].forEach(function(eventName){\n document.removeEventListener(eventName, onMouseEnterOrLeave, true); //true is required!\n });\n\n //lets make a mess!\n if(all){\n destroyStructure();\n }\n }", "function destroyEverything() {\n }", "destroy() {\n window.removeEventListener('resize', this.handleWindowResize);\n this.freeAreaCollection.removeAllListeners();\n this.keepoutAreaCollection.removeAllListeners();\n this.canvasElement.removeEventListener('wheel', this.handleZoom);\n this.scope.project.remove();\n }", "unsubscribeAll() {\n this._observers = [];\n }", "destroy() {\n this.assertNotDestroyed();\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this._destroyed = true;\n try {\n // Call all the lifecycle hooks.\n this.onDestroy.forEach(service => service.ngOnDestroy());\n }\n finally {\n // Release all references.\n this.records.clear();\n this.onDestroy.clear();\n this.injectorDefTypes.clear();\n }\n }", "destroy() {\n this.assertNotDestroyed();\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this._destroyed = true;\n try {\n // Call all the lifecycle hooks.\n this.onDestroy.forEach(service => service.ngOnDestroy());\n }\n finally {\n // Release all references.\n this.records.clear();\n this.onDestroy.clear();\n this.injectorDefTypes.clear();\n }\n }", "destroy() {\n this.assertNotDestroyed();\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this._destroyed = true;\n try {\n // Call all the lifecycle hooks.\n this.onDestroy.forEach(service => service.ngOnDestroy());\n }\n finally {\n // Release all references.\n this.records.clear();\n this.onDestroy.clear();\n this.injectorDefTypes.clear();\n }\n }", "destroy() {\n this.assertNotDestroyed();\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this._destroyed = true;\n try {\n // Call all the lifecycle hooks.\n this.onDestroy.forEach(service => service.ngOnDestroy());\n }\n finally {\n // Release all references.\n this.records.clear();\n this.onDestroy.clear();\n this.injectorDefTypes.clear();\n }\n }", "destroy() {\n this.assertNotDestroyed();\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this._destroyed = true;\n try {\n // Call all the lifecycle hooks.\n this.onDestroy.forEach(service => service.ngOnDestroy());\n }\n finally {\n // Release all references.\n this.records.clear();\n this.onDestroy.clear();\n this.injectorDefTypes.clear();\n }\n }", "destroy() {\n this.assertNotDestroyed();\n // Set destroyed = true first, in case lifecycle hooks re-enter destroy().\n this._destroyed = true;\n try {\n // Call all the lifecycle hooks.\n this.onDestroy.forEach(service => service.ngOnDestroy());\n }\n finally {\n // Release all references.\n this.records.clear();\n this.onDestroy.clear();\n this.injectorDefTypes.clear();\n }\n }", "detachAllEvents() {\n this.handledEvents.forEach((value, key) => {\n this.offEvent(key, value.target, value.options);\n });\n }", "function cleanup(){destroyed=true;angular.element($window).off('resize',handleWindowResize);}// Change handlers", "destroy() {\n this._emiter.removeAllListeners();\n this._emiter = null;\n mEmitter.instance = null;\n }", "destroy () {\n this.tasks = []\n this.collectors = []\n }", "function multiRemove () {\n\t\t this.inserted = false\n\t\t var self = this\n\t\t var shouldCallRemove = _.inDoc(this.node)\n\t\t self.callHook(destroyChild)\n\t\t _.removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n\t\t if (shouldCallRemove) {\n\t\t self.callHook(detach)\n\t\t }\n\t\t self.destroy()\n\t\t })\n\t\t}", "unAll() {\n this.handlers = null;\n }", "function destroy(all){\r\n setAutoScrolling(false, 'internal');\r\n setAllowScrolling(true);\r\n setMouseHijack(false);\r\n setKeyboardScrolling(false);\r\n addClass(container, DESTROYED);\r\n\r\n [\r\n afterSlideLoadsId, \r\n afterSectionLoadsId,\r\n resizeId,\r\n scrollId,\r\n scrollId2,\r\n g_doubleCheckHeightId,\r\n resizeHandlerId,\r\n g_transitionLapseId\r\n ].forEach(function(timeoutId){\r\n clearTimeout(timeoutId);\r\n });\r\n\r\n window.removeEventListener('scroll', scrollHandler);\r\n window.removeEventListener('hashchange', hashChangeHandler);\r\n window.removeEventListener('resize', resizeHandler);\r\n\r\n document.removeEventListener('keydown', keydownHandler);\r\n document.removeEventListener('keyup', keyUpHandler);\r\n\r\n ['click', 'touchstart'].forEach(function(eventName){\r\n document.removeEventListener(eventName, delegatedEvents);\r\n });\r\n\r\n ['mouseenter', 'touchstart', 'mouseleave', 'touchend'].forEach(function(eventName){\r\n document.removeEventListener(eventName, onMouseEnterOrLeave, true); //true is required!\r\n });\r\n\r\n //lets make a mess!\r\n if(all){\r\n destroyStructure();\r\n }\r\n }", "doDestroy() {\n const me = this;\n me.eventStoreDetacher && me.eventStoreDetacher();\n me.resourceStoreDetacher && me.resourceStoreDetacher();\n super.doDestroy();\n }", "destroy() {\n this._pauseEvents();\n this.$watched.css('height', 'auto');\n\n Foundation.unregisterPlugin(this);\n }", "destroy () {\n\t\tthis.disposables.dispose()\n\t\tthis.classRanges.clear()\n\t\tthis.methodRanges.clear()\n\t\tthis.classMapping.clear()\n\t\tthis.methodMapping.clear()\n\t}", "destroy() {\n super.destroy();\n this.weapons.forEach(weapon => {\n weapon.destroy();\n });\n }", "destroy() {\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.plugins = [];\n this.inputState.destroy();\n this.dom.remove();\n this.observer.destroy();\n if (this.measureScheduled > -1)\n this.win.cancelAnimationFrame(this.measureScheduled);\n this.destroyed = true;\n }", "function destroy() {\n\t\t\t// Iterate over each matching element.\n\t\t\t$el.each(function() {\n\t\t\t\tvar el = this;\n\t\t\t\tvar $el = $(this);\n\n\t\t\t\t// Destroy completely the element and remove event listeners\n\t\t\t\t$(window).off('resize.timeliny');\n\t\t\t\t$el.find('.' + options.className + '-timeblock:not(.inactive) .' + options.className + '-dot').off('click');\n\t\t\t\t$(document).off('mousemove.timeliny');\n\t\t\t\t$(document).off('mouseup.timeliny');\n\t\t\t\t$el.first().off('mousedown');\n\t\t\t\t$el.remove();\n\t\t\t\thook('onDestroy');\n\n\t\t\t\t// Remove Plugin instance from the element.\n\t\t\t\t$el.removeData('plugin_timeliny');\n\t\t\t});\n\t\t}", "function destroy(all) {\n setAutoScrolling(false, 'internal');\n setAllowScrolling(true);\n setMouseHijack(false);\n setKeyboardScrolling(false);\n addClass(container, DESTROYED);\n [afterSlideLoadsId, afterSectionLoadsId, resizeId, scrollId, scrollId2, g_doubleCheckHeightId, resizeHandlerId].forEach(function (timeoutId) {\n clearTimeout(timeoutId);\n });\n window.removeEventListener('scroll', scrollHandler);\n window.removeEventListener('hashchange', hashChangeHandler);\n window.removeEventListener('resize', resizeHandler);\n document.removeEventListener('keydown', keydownHandler);\n document.removeEventListener('keyup', keyUpHandler);\n ['click', 'touchstart'].forEach(function (eventName) {\n document.removeEventListener(eventName, delegatedEvents);\n });\n ['mouseenter', 'touchstart', 'mouseleave', 'touchend'].forEach(function (eventName) {\n document.removeEventListener(eventName, onMouseEnterOrLeave, true); //true is required!\n }); //lets make a mess!\n\n if (all) {\n destroyStructure();\n }\n }", "doDestroy() {\n const me = this;\n me.filterTip && me.filterTip.destroy();\n me.filterEditorPopup && me.filterEditorPopup.destroy();\n me.store.un({\n sort: me.onStoreFilter\n }, me);\n super.doDestroy();\n }", "destroy() {\n\t\tthis.runFinalReadReport()\n\t\tthis.stopObservation()\n\t\tthis.currentlyObservedElements = new Set()\n\t\tthis.visibleElements = new Set()\n\t}", "unbindEvents() {\n this.toggleListeners.forEach(toggleListener => toggleListener.destroy());\n this.openListeners.forEach(openListener => openListener.destroy());\n this.closeListeners.forEach(closeListener => closeListener.destroy());\n this.radioOpenListeners.forEach(radioOpenListener => radioOpenListener.destroy());\n this.radioCloseListeners.forEach(radioCloseListener => radioCloseListener.destroy());\n this.inputOpenListeners.forEach(inputOpenListener => inputOpenListener.destroy());\n }", "destroy() {\n this.end();\n for (const container of this._dispatchers.values()) {\n for (const dispatcher of container.values()) {\n dispatcher.destroy('end', 'broadcast ended');\n }\n }\n }", "destroy() {\n this.end();\n for (const container of this._dispatchers.values()) {\n for (const dispatcher of container.values()) {\n dispatcher.destroy('end', 'broadcast ended');\n }\n }\n }", "destroy() {\n window.removeEventListener('resize', this._updateBoundingRect);\n this.$el.removeEventListener('touchstart', this._handleTouchStart);\n this.$el.removeEventListener('touchmove', this._handleTouchMove);\n this.$el.removeEventListener('touchend', this._handleTouchEnd);\n this.$el.removeEventListener('touchcancel', this._handleTouchEnd);\n // delete pointers\n this.$el = null;\n this.listeners = null;\n }", "function executeOnDestroys(tView, lView) {\n var destroyHooks;\n\n if (tView != null && (destroyHooks = tView.destroyHooks) != null) {\n for (var i = 0; i < destroyHooks.length; i += 2) {\n var context = lView[destroyHooks[i]]; // Only call the destroy hook if the context has been requested.\n\n if (!(context instanceof NodeInjectorFactory)) {\n var toCall = destroyHooks[i + 1];\n\n if (Array.isArray(toCall)) {\n for (var j = 0; j < toCall.length; j += 2) {\n toCall[j + 1].call(context[toCall[j]]);\n }\n } else {\n toCall.call(context);\n }\n }\n }\n }\n }", "destroy() {\n if (this.destroyed) {\n return\n }\n\n this.markerDestroyDisposable?.dispose?.()\n this.destroyed = true\n this.emitter.emit(\"did-destroy\")\n this.emitter.dispose()\n }", "destroy() {\n this.off();\n super.destroy();\n }", "destroy() {\n this.fireEvent('destroy', this);\n\n this.removeListeners();\n }", "destroy() {\n this._destroyed = true;\n\n if (typeof this.freeFromPool === 'function') {\n this.freeFromPool();\n }\n\n if (this.currentMap) {\n this.currentMap.removeObject(this);\n } else if (this.currentScene) {\n this.currentScene.removeObject(this);\n }\n\n this.children.forEach((child) => {\n child.destroy();\n });\n\n // triggers the wave end\n if (this.wave) {\n this.wave.remove(this);\n }\n }", "removeAllEvents() {\n return this.each(el => el.removeAllEvents());\n }", "detached() {\n this.watchers.forEach((unwatch) => unwatch());\n\n // exit when no pond defined\n if (!this._pond) return;\n\n // bye bye pond\n this._pond.destroy();\n\n // remove from instances\n const index = instances.indexOf(this._pond);\n if (index >= 0) {\n instances.splice(index, 1);\n }\n\n // clear reference\n this._pond = null;\n }", "unsubAll () {\n this._subscribers.clear()\n }", "function queueDestroyHooks(def,tView,i){if(def.onDestroy!=null){(tView.destroyHooks||(tView.destroyHooks=[])).push(i,def.onDestroy);}}", "destroy() {\n //this.unobserve(this.slider.selector);\n this.unobserve(window);\n const tx = document.documentElement;\n tx.removeEventListener(\"pointermove\", this.onpointermove);\n tx.removeEventListener(\"mousemove\", this.mousemoveUpdater);\n /*this.slider.selector.removeEventListener(\"touchend\", this.mtimerUpdater);\n this.slider.selector.removeEventListener(\"mouseup\", this.mtimerUpdater);\n this.slider.selector.removeEventListener(\"mousedown\", this.mtimerUpdater);\n this.slider.selector.removeEventListener(\"mousemove\", this.mousemoveHandler);*/\n\n this.coordinator = null;\n }", "purge() {\n // the object vector is not purged right away, because if this method is called\n // from an 'advanceTime' call, this would make the loop crash. Instead, the\n // vector is filled with 'null' values. They will be cleaned up on the next call\n // to 'advanceTime'.\n\n const { _objects, _objectIDs } = this\n\n for (let i = _objects.length - 1; i >= 0; --i) {\n const object = _objects[i]\n const dispatcher = object\n if (dispatcher)\n dispatcher.removeEventListener(Event.REMOVE_FROM_JUGGLER, this.onRemove)\n _objects[i] = null\n _objectIDs.delete(object)\n }\n }", "destroy() {\n this.wt.destroy();\n this.eventManager.destroy();\n }", "function $onDestroy(){\n removeEventListeners();\n }", "function destroy() {\n // Iterate over each matching element.\n $el.each(function() {\n var el = this;\n var $el = $(this);\n \n // Add code to restore the element to its original state...\n \n hook('onDestroy');\n // Remove Plugin instance from the element.\n $el.removeData('plugin_' + pluginName);\n });\n }", "destroy () {\n this.emit('destroyed', [true]);\n super.destroy();\n }", "destroy () {\n this.emit('destroyed', [true]);\n super.destroy();\n }", "destroy() {\n this._clearListeners();\n this._pending = [];\n this._target = undefined;\n }", "function destroy(all){\r\n setAutoScrolling(false, 'internal');\r\n setAllowScrolling(false);\r\n setKeyboardScrolling(false);\r\n addClass(container, DESTROYED);\r\n\r\n clearTimeout(afterSlideLoadsId);\r\n clearTimeout(afterSectionLoadsId);\r\n clearTimeout(resizeId);\r\n clearTimeout(scrollId);\r\n clearTimeout(scrollId2);\r\n\r\n\r\n window.removeEventListener('scroll', scrollHandler);\r\n window.removeEventListener('hashchange', hashChangeHandler);\r\n window.removeEventListener('resize', resizeHandler);\r\n\r\n document.removeEventListener('keydown', keydownHandler);\r\n document.removeEventListener('keyup', keyUpHandler);\r\n\r\n var clickTouchEvents = [sectionBulletHandler, tooltipTextHandler, slideArrowHandler, slideBulletHandler];\r\n ['click', 'touchstart'].forEach(function(eventName){\r\n clickTouchEvents.forEach(function(foo){\r\n document.removeEventListener(eventName, foo);\r\n });\r\n });\r\n\r\n ['mouseenter', 'touchstart', 'mouseleave', 'touchend'].forEach(function(eventName){\r\n document.removeEventListener(eventName, onMouseEnterOrLeave, true); //true is required!\r\n });\r\n\r\n clearTimeout(afterSlideLoadsId);\r\n clearTimeout(afterSectionLoadsId);\r\n\r\n //lets make a mess!\r\n if(all){\r\n destroyStructure();\r\n }\r\n }", "destroy() {\r\n this.off();\r\n }", "destroy() {\n this._pluginsManager.beforeAppDestroy(this);\n for (let module of this._modulesOrder) {\n module.destroy();\n }\n }", "function multiRemove() {\n\t this.inserted = false;\n\t var self = this;\n\t var shouldCallRemove = inDoc(this.node);\n\t self.callHook(destroyChild);\n\t removeNodeRange(this.node, this.end, this.vm, this.frag, function () {\n\t if (shouldCallRemove) {\n\t self.callHook(detach);\n\t }\n\t self.destroy();\n\t });\n\t}", "destroy() {\n\t\t/**\n\t\t * @event Resource.destroy\n\t\t * Called whenever the resource is about to be destroyed\n\t\t */\n\t\tthis.emit(\"destroy\");\n\t\tthis.removeAllListeners();\n\t}" ]
[ "0.76400393", "0.6712945", "0.6694455", "0.6648352", "0.66223437", "0.6534911", "0.65277785", "0.65277785", "0.6472088", "0.64587104", "0.64398474", "0.64390737", "0.64331716", "0.64135945", "0.6378474", "0.6375794", "0.63658154", "0.6304516", "0.628469", "0.62536114", "0.62522095", "0.62521654", "0.62224036", "0.62207615", "0.6220072", "0.6208112", "0.61995995", "0.6189896", "0.6179659", "0.6166776", "0.61647433", "0.6148969", "0.6140023", "0.6120963", "0.6102599", "0.6080968", "0.6077379", "0.60741526", "0.60674083", "0.60622543", "0.6053572", "0.60376614", "0.60376614", "0.60376614", "0.6034854", "0.60192585", "0.59827983", "0.5982767", "0.5982767", "0.5982577", "0.5980356", "0.5966745", "0.59629", "0.59629", "0.59629", "0.59629", "0.59629", "0.59629", "0.5955405", "0.5953507", "0.5951052", "0.5948937", "0.5948473", "0.5946354", "0.59430593", "0.59410113", "0.59395444", "0.5937795", "0.59319025", "0.592904", "0.5928366", "0.5923093", "0.59181124", "0.59175014", "0.59098965", "0.5904443", "0.5904443", "0.5902983", "0.5895917", "0.5891075", "0.5888898", "0.58737326", "0.5873395", "0.5872758", "0.58653086", "0.58627486", "0.58559763", "0.58557725", "0.58334166", "0.58332086", "0.5824073", "0.58235335", "0.5816782", "0.5816782", "0.5813402", "0.5798691", "0.5794013", "0.5790222", "0.57849467", "0.578467" ]
0.69550574
1
L.control.navbar().addTo(map); get color depending on confirmed cases value
function getColor(d) { return d > 30 ? '#cc0000': d > 25 ? '#e60000': d > 20 ? '#ff0000': d > 15 ? '#ff4000' : d > 10 ? '#ff8000' : d > 5 ? '#ffbf00' : d >= 1 ? '#ffff00 ': 'green'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colour_map(data){\n\n map.selectAll(\".marker\")\n .style(\"background-color\", function(d){\n if (d == data)\n {\n return \"red\"\n }\n else if (d.searched_house == true)\n {\n return \"yellow\"\n }\n else if (barchart_data.indexOf(d) !== -1)\n {\n return \"steelblue\"\n }\n })\n}", "function colors() {\n \n\tmap.getLayer('countylayer').style('fill', function(data) {\n\t\tvar ddi = parseFloat(data.ddi);\n\t\tif (ddi <= 38.12357875) { //1st quartile\n\t\t\treturn \"#fef0d9\";\n\t\t} else if (ddi <= 50.8602104) {\n\t\t\treturn \"#fdcc8a\";\n\t\t} else if (ddi <= 64.03133336 ) {\n\t\t\treturn \"#fc8d59\";\n\t\t} else { //4th quartile\n\t\t\treturn \"#d7301f\";\n\t\t}\n\t});\n}", "function mapLegend() {\n let legend = L.control({position: 'bottomright'});\n\n legend.onAdd = function(map) {\n\n var div = L.DomUtil.create('div', 'info legend');\n var mags = [0, 1, 2, 3, 4, 5];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < mags.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(mags[i]) + '\"></i> ' +\n mags[i] + (mags[i + 1] ? '&ndash;' + mags[i + 1] + '<br>' : '+');\n }\n\n return div;\n };\n return legend;\n}", "function addEarthquakeColorLegend(map) {\n\n // Legend object (bottom right)\n var legend = L.control({\n position: \"bottomright\"\n });\n\n // Add div for legend\n legend.onAdd = function() { \n var div = L.DomUtil.create(\"div\", \"colorlegend\");\n return div;\n }\n \n // return legend\n map.addControl(legend);\n\n}", "teamifyIcon(){\r\n if(this.color == \"red\"){\r\n L.DomUtil.addClass(this.#icon._icon, 'eastIcon');\r\n } else\r\n if(this.color == \"blue\"){\r\n L.DomUtil.addClass(this.#icon._icon, 'westIcon');\r\n } else\r\n if(this.color == \"green\"){\r\n L.DomUtil.addClass(this.#icon._icon, 'centralIcon');\r\n }else \r\n if(this.color == \"purple\"){\r\n L.DomUtil.addClass(this.#icon._icon, 'gallifrayIcon');\r\n }\r\n }", "function chooseColor(NAMELSAD) {\n switch (NAMELSAD) {\n case \"Tulare County\":\n return \"red\";\n case \"Calaveras County\":\n return \"orange\";\n case \"Merced County\":\n return \"red\";\n case \"San Luis Obispo County\":\n return \"orange\";\n case \"Sonoma County\":\n return \"orange\";\n case \"Marin County\":\n return \"orange\";\n case \"Humboldt County\":\n return \"orange\";\n case \"Mono County\":\n return \"yellow\";\n case \"Del Norte County\":\n return \"red\";\n case \"Colusa County\":\n return \"orange\";\n case \"Alameda County\":\n return \"orange\";\n case \"El Dorado County\":\n return \"orange\";\n case \"Sutter County\":\n return \"orange\";\n case \"Kings County\":\n return \"orange\";\n case \"Sierra County\":\n return \"yellow\";\n case \"Lassen County\":\n return \"yellow\";\n case \"Lake County\":\n return \"orange\";\n case \"Tehama County\":\n return \"red\";\n case \"San Francisco County\":\n return \"orange\";\n case \"Alpine County\":\n return \"yellow\";\n case \"Madera County\":\n return \"orange\";\n case \"Sacramento County\":\n return \"red\";\n case \"Santa Barbara County\":\n return \"orange\";\n case \"Plumas County\":\n return \"orange\";\n case \"Modoc County\":\n return \"orange\";\n case \"Solano County\":\n return \"red\";\n case \"Ventura County\":\n return \"orange\";\n case \"Santa Cruz County\":\n return \"orange\";\n case \"Yuba County\":\n return \"red\";\n case \"Tuolumne County\":\n return \"orange\";\n case \"Napa County\":\n return \"orange\";\n case \"Siskiyou County\":\n return \"orange\";\n case \"Placer County\":\n return \"red\";\n case \"Glenn County\":\n return \"orange\";\n case \"Trinity County\":\n return \"yellow\";\n case \"Inyo County\":\n return \"orange\";\n case \"San Benito County\":\n return \"orange\";\n case \"Monterey County\":\n return \"orange\";\n case \"San Diego County\":\n return \"orange\";\n case \"Mariposa County\":\n return \"orange\";\n case \"Nevada County\":\n return \"red\";\n case \"Mendocino County\":\n return \"yellow\";\n case \"Yolo County\":\n return \"orange\";\n case \"Imperial County\":\n return \"orange\";\n case \"Stanislaus County\":\n return \"red\";\n case \"Kern County\":\n return \"orange\";\n case \"Contra Costa County\":\n return \"orange\";\n case \"Fresno County\":\n return \"orange\";\n case \"Santa Clara County\":\n return \"orange\";\n case \"San Mateo County\":\n return \"yellow\";\n case \"Butte County\":\n return \"orange\";\n case \"San Joaquin County\":\n return \"red\";\n case \"Amador County\":\n return \"orange\";\n case \"Shasta County\":\n return \"red\";\n case \"Riverside County\":\n return \"orange\";\n case \"Los Angeles County\":\n return \"yellow\";\n case \"Orange County\":\n return \"orange\";\n case \"San Bernardino County\":\n return \"orange\";\n default:\n return \"black\";\n }\n}", "mapStatusToColor(status){\n if (status === 'A')\n return \"green\";\n if (status === 'R')\n return \"red\";\n if (status === 'W' || status === 'P')\n return \"blue\";\n if (status === 'N')\n return \"yellow\";\n }", "function color() {\n var map = {\n \"black\" : [ 0/255,0/255,0/255 ],\n \"silver\": [ 192/255,192/255,192/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"maroon\": [ 128/255,0/255,0/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"purple\": [ 128/255,0/255,128/255 ],\n \"fuchsia\": [ 255/255,0/255,255/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"yellow\": [ 255/255,255/255,0/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aliceblue\" : [ 240/255,248/255,255/255 ],\n \"antiquewhite\" : [ 250/255,235/255,215/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aquamarine\" : [ 127/255,255/255,212/255 ],\n \"azure\" : [ 240/255,255/255,255/255 ],\n \"beige\" : [ 245/255,245/255,220/255 ],\n \"bisque\" : [ 255/255,228/255,196/255 ],\n \"black\" : [ 0/255,0/255,0/255 ],\n \"blanchedalmond\" : [ 255/255,235/255,205/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"blueviolet\" : [ 138/255,43/255,226/255 ],\n \"brown\" : [ 165/255,42/255,42/255 ],\n \"burlywood\" : [ 222/255,184/255,135/255 ],\n \"cadetblue\" : [ 95/255,158/255,160/255 ],\n \"chartreuse\" : [ 127/255,255/255,0/255 ],\n \"chocolate\" : [ 210/255,105/255,30/255 ],\n \"coral\" : [ 255/255,127/255,80/255 ],\n \"cornflowerblue\" : [ 100/255,149/255,237/255 ],\n \"cornsilk\" : [ 255/255,248/255,220/255 ],\n \"crimson\" : [ 220/255,20/255,60/255 ],\n \"cyan\" : [ 0/255,255/255,255/255 ],\n \"darkblue\" : [ 0/255,0/255,139/255 ],\n \"darkcyan\" : [ 0/255,139/255,139/255 ],\n \"darkgoldenrod\" : [ 184/255,134/255,11/255 ],\n \"darkgray\" : [ 169/255,169/255,169/255 ],\n \"darkgreen\" : [ 0/255,100/255,0/255 ],\n \"darkgrey\" : [ 169/255,169/255,169/255 ],\n \"darkkhaki\" : [ 189/255,183/255,107/255 ],\n \"darkmagenta\" : [ 139/255,0/255,139/255 ],\n \"darkolivegreen\" : [ 85/255,107/255,47/255 ],\n \"darkorange\" : [ 255/255,140/255,0/255 ],\n \"darkorchid\" : [ 153/255,50/255,204/255 ],\n \"darkred\" : [ 139/255,0/255,0/255 ],\n \"darksalmon\" : [ 233/255,150/255,122/255 ],\n \"darkseagreen\" : [ 143/255,188/255,143/255 ],\n \"darkslateblue\" : [ 72/255,61/255,139/255 ],\n \"darkslategray\" : [ 47/255,79/255,79/255 ],\n \"darkslategrey\" : [ 47/255,79/255,79/255 ],\n \"darkturquoise\" : [ 0/255,206/255,209/255 ],\n \"darkviolet\" : [ 148/255,0/255,211/255 ],\n \"deeppink\" : [ 255/255,20/255,147/255 ],\n \"deepskyblue\" : [ 0/255,191/255,255/255 ],\n \"dimgray\" : [ 105/255,105/255,105/255 ],\n \"dimgrey\" : [ 105/255,105/255,105/255 ],\n \"dodgerblue\" : [ 30/255,144/255,255/255 ],\n \"firebrick\" : [ 178/255,34/255,34/255 ],\n \"floralwhite\" : [ 255/255,250/255,240/255 ],\n \"forestgreen\" : [ 34/255,139/255,34/255 ],\n \"fuchsia\" : [ 255/255,0/255,255/255 ],\n \"gainsboro\" : [ 220/255,220/255,220/255 ],\n \"ghostwhite\" : [ 248/255,248/255,255/255 ],\n \"gold\" : [ 255/255,215/255,0/255 ],\n \"goldenrod\" : [ 218/255,165/255,32/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"greenyellow\" : [ 173/255,255/255,47/255 ],\n \"grey\" : [ 128/255,128/255,128/255 ],\n \"honeydew\" : [ 240/255,255/255,240/255 ],\n \"hotpink\" : [ 255/255,105/255,180/255 ],\n \"indianred\" : [ 205/255,92/255,92/255 ],\n \"indigo\" : [ 75/255,0/255,130/255 ],\n \"ivory\" : [ 255/255,255/255,240/255 ],\n \"khaki\" : [ 240/255,230/255,140/255 ],\n \"lavender\" : [ 230/255,230/255,250/255 ],\n \"lavenderblush\" : [ 255/255,240/255,245/255 ],\n \"lawngreen\" : [ 124/255,252/255,0/255 ],\n \"lemonchiffon\" : [ 255/255,250/255,205/255 ],\n \"lightblue\" : [ 173/255,216/255,230/255 ],\n \"lightcoral\" : [ 240/255,128/255,128/255 ],\n \"lightcyan\" : [ 224/255,255/255,255/255 ],\n \"lightgoldenrodyellow\" : [ 250/255,250/255,210/255 ],\n \"lightgray\" : [ 211/255,211/255,211/255 ],\n \"lightgreen\" : [ 144/255,238/255,144/255 ],\n \"lightgrey\" : [ 211/255,211/255,211/255 ],\n \"lightpink\" : [ 255/255,182/255,193/255 ],\n \"lightsalmon\" : [ 255/255,160/255,122/255 ],\n \"lightseagreen\" : [ 32/255,178/255,170/255 ],\n \"lightskyblue\" : [ 135/255,206/255,250/255 ],\n \"lightslategray\" : [ 119/255,136/255,153/255 ],\n \"lightslategrey\" : [ 119/255,136/255,153/255 ],\n \"lightsteelblue\" : [ 176/255,196/255,222/255 ],\n \"lightyellow\" : [ 255/255,255/255,224/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"limegreen\" : [ 50/255,205/255,50/255 ],\n \"linen\" : [ 250/255,240/255,230/255 ],\n \"magenta\" : [ 255/255,0/255,255/255 ],\n \"maroon\" : [ 128/255,0/255,0/255 ],\n \"mediumaquamarine\" : [ 102/255,205/255,170/255 ],\n \"mediumblue\" : [ 0/255,0/255,205/255 ],\n \"mediumorchid\" : [ 186/255,85/255,211/255 ],\n \"mediumpurple\" : [ 147/255,112/255,219/255 ],\n \"mediumseagreen\" : [ 60/255,179/255,113/255 ],\n \"mediumslateblue\" : [ 123/255,104/255,238/255 ],\n \"mediumspringgreen\" : [ 0/255,250/255,154/255 ],\n \"mediumturquoise\" : [ 72/255,209/255,204/255 ],\n \"mediumvioletred\" : [ 199/255,21/255,133/255 ],\n \"midnightblue\" : [ 25/255,25/255,112/255 ],\n \"mintcream\" : [ 245/255,255/255,250/255 ],\n \"mistyrose\" : [ 255/255,228/255,225/255 ],\n \"moccasin\" : [ 255/255,228/255,181/255 ],\n \"navajowhite\" : [ 255/255,222/255,173/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"oldlace\" : [ 253/255,245/255,230/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"olivedrab\" : [ 107/255,142/255,35/255 ],\n \"orange\" : [ 255/255,165/255,0/255 ],\n \"orangered\" : [ 255/255,69/255,0/255 ],\n \"orchid\" : [ 218/255,112/255,214/255 ],\n \"palegoldenrod\" : [ 238/255,232/255,170/255 ],\n \"palegreen\" : [ 152/255,251/255,152/255 ],\n \"paleturquoise\" : [ 175/255,238/255,238/255 ],\n \"palevioletred\" : [ 219/255,112/255,147/255 ],\n \"papayawhip\" : [ 255/255,239/255,213/255 ],\n \"peachpuff\" : [ 255/255,218/255,185/255 ],\n \"peru\" : [ 205/255,133/255,63/255 ],\n \"pink\" : [ 255/255,192/255,203/255 ],\n \"plum\" : [ 221/255,160/255,221/255 ],\n \"powderblue\" : [ 176/255,224/255,230/255 ],\n \"purple\" : [ 128/255,0/255,128/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"rosybrown\" : [ 188/255,143/255,143/255 ],\n \"royalblue\" : [ 65/255,105/255,225/255 ],\n \"saddlebrown\" : [ 139/255,69/255,19/255 ],\n \"salmon\" : [ 250/255,128/255,114/255 ],\n \"sandybrown\" : [ 244/255,164/255,96/255 ],\n \"seagreen\" : [ 46/255,139/255,87/255 ],\n \"seashell\" : [ 255/255,245/255,238/255 ],\n \"sienna\" : [ 160/255,82/255,45/255 ],\n \"silver\" : [ 192/255,192/255,192/255 ],\n \"skyblue\" : [ 135/255,206/255,235/255 ],\n \"slateblue\" : [ 106/255,90/255,205/255 ],\n \"slategray\" : [ 112/255,128/255,144/255 ],\n \"slategrey\" : [ 112/255,128/255,144/255 ],\n \"snow\" : [ 255/255,250/255,250/255 ],\n \"springgreen\" : [ 0/255,255/255,127/255 ],\n \"steelblue\" : [ 70/255,130/255,180/255 ],\n \"tan\" : [ 210/255,180/255,140/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"thistle\" : [ 216/255,191/255,216/255 ],\n \"tomato\" : [ 255/255,99/255,71/255 ],\n \"turquoise\" : [ 64/255,224/255,208/255 ],\n \"violet\" : [ 238/255,130/255,238/255 ],\n \"wheat\" : [ 245/255,222/255,179/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"whitesmoke\" : [ 245/255,245/255,245/255 ],\n \"yellow\" : [ 255/255,255/255,0/255 ],\n \"yellowgreen\" : [ 154/255,205/255,50/255 ] };\n\n var o, i = 1, a = arguments, c = a[0], alpha;\n\n if(a[0].length<4 && (a[i]*1-0)==a[i]) { alpha = a[i++]; } // first argument rgb (no a), and next one is numeric?\n if(a[i].length) { a = a[i], i = 0; } // next arg an array, make it our main array to walk through\n if(typeof c == 'string')\n c = map[c.toLowerCase()];\n if(alpha!==undefined)\n c = c.concat(alpha);\n for(o=a[i++]; i<a.length; i++) {\n o = o.union(a[i]);\n }\n return o.setColor(c);\n}", "function legend(){\r\n var legend = L.control({position: is_mobile ? 'topleft' : 'topright'});\r\n\r\n legend.onAdd = function (map) {\r\n\r\n var div = L.DomUtil.create('div', 'infos legend'),\r\n grades = [\"Buona\", \"Discreta\", \"Mediocre\", \"Scadente\", \"Pessima\"];\r\n\r\n div.innerHTML = is_mobile ? \"\" : \"<p style='margin-top: 0;'><strong>Qualit\" + \"&agrave;\" +\" dell'aria</strong></p>\";\r\n for (var i = 0; i < grades.length; i++) {\r\n div.innerHTML += (is_mobile ?\r\n \"<img style='position: relative; top: -4px;' src=\" + markerPath[i] + \" width='12px' height='20px' align='middle'> \" + grades[i] + \"<br>\"\r\n :\r\n \"<p style='margin-top: 0;\" + ((i == grades.length-1) ? \"margin-bottom: 0px;\" : \"margin-bottom: 6px;\") +\"'><img style='position: relative; top: -4px;' src=\" + markerPath[i] + \" width='15px' height='25px' align='middle'>\" + grades[i] + \"</p>\" ) ;\r\n }\r\n return div;\r\n };\r\n\r\n legend.addTo(map1);\r\n}", "function addLegend() {\n // Create a legend for the map\n var legend = L.control({ position: 'bottomleft' });\n // Legend will be called once map is displayed\n legend.onAdd = function () {\n\n var div = L.DomUtil.create('div', 'info legend');\n\n var legendInfo = \"<p>GDP per capita (Int$)</p>\";\n\n div.innerHTML = legendInfo;\n\n // setup the depth \n var limits = [0, 2000, 5000, 10000, 20000, 35000, 50000];\n // Loop through our magnitude intervals and generate a label with a colored square for each interval\n for (var i = 0; i < limits.length; i++) {\n var newHtml = `<i style=\"background: ${getColorValue(limits[i])}\"></i>`;\n newHtml += limits[i] + (limits[i + 1] ? '&ndash;' + limits[i + 1] + '<br>' : '+');\n div.innerHTML += newHtml;\n }\n\n return div;\n };\n // Add the legend to the map\n return legend;\n}", "colorsPieGenders() {\n if(this.label[0]===\"m\"){\n this.colorArray=[\"rgb(2,117,216)\", \"rgb(129,4,120)\"];\n this.label[0]=\"Homem\"\n this.label[1]=\"Mulher\"\n }\n else{\n this.colorArray=[\"rgb(129,4,120)\", \"rgb(2,117,216)\"];\n this.label[1]=\"Homem\"\n this.label[0]=\"Mulher\"\n }\n }", "function createMap(earthquake, faultLine){\n var baseMaps = {\n \"Outdoor Map\": streetmap,\n \"Grayscale Map\": lightMap,\n \"Satelite Map\": satelliteMap\n };\n// overlay toggle on and off\n var overlayMaps = {\n \"Earthquakes\": earthquake,\n \"Fault Lines\": faultLine\n \n };\n// create mymap\n var mymap = L.map('map', {\n // center: [40.7128, -74.0060], //nyc coordinate\n maxzoom: 0,\n minZoom: 0,\n layers: [lightMap, faultLine, earthquake],\n scrollWheelZoom: false //diable scroll and zoom in the map\n }); \n mymap.setView([40.7128, -74.0060], 3); //nyc coordinates, zoom level 3\n\n// create legend for circle marker colors\n var legend = L.control({position: 'bottomright'});\n\n legend.onAdd = function (mymap) {\n\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 1, 2, 3, 4, 5], \n labels = [];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n\n return div;\n};\n\nlegend.addTo(mymap);\n//add layer control to map\nL.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(mymap);\n}", "function buildLegend(colors, assoColors) {\n var elemStr = '<h4><a href=\"#\" id=\"map-legend-close\" class=\"text-info\"><i class=\"material-icons md-28 align-middle\">keyboard_arrow_right</i><span class=\"align-middle\">Sensors</span></a></h4>';\n for (var k = 0; k < assoColors.length; k++) {\n\n if (assoColors[k] != null) {\n\n // Currently, we want to display human-friendly names on the front-end. This is a hack\n if (assoColors[k] == \"luftdaten\") {\n (kilolima = \"Luftdaten\")\n }\n else if (assoColors[k] == \"smart-citizen-kits\") {\n (kilolima = \"Smart Citizen Kit\")\n }\n else if (assoColors[k] == \"automatic-urban-and-rural-network-aurn\") {\n kilolima = \"DEFRA AURN\";\n }\n else if (assoColors[k] == \"air-quality-data-continuous\") {\n kilolima = \"Bristol Air Quality Continuous\";\n }\n\n else if (assoColors[k] == \"air-quality-no2-diffusion-tube-data\") {\n kilolima = \"Bristol NO2 Diffusion Tubes\";\n }\n\n else {\n kilolima = assoColors[k]\n }\n }\n if (k !== colors.length) {\n if (kilolima != null) {\n elemStr += '<div><span style=\"background-color: ' + colors[k] + '\"></span>' + kilolima + '</div>';\n\n } else {\n elemStr += '<div><span style=\"background-color: ' + colors[k] + '\"></span>' + assoColors[k] + '</div>';\n }\n }\n\n }\n if (window.location.href.indexOf(\"datalocation\") > -1) {\n elemStr += '<div><span style=\"background-color: #97CBFF\"></span>Chosen location</div>';\n }\n $(\"#map-legend\").html(elemStr);\n}", "function remove_colour_map(data){\n map.selectAll(\".marker\")\n .style(\"background-color\", function(d){\n if (d.searched_house == true)\n {\n return \"yellow\"\n }\n else if (barchart_data.indexOf(d) !== -1)\n {\n return \"steelblue\"\n }\n })\n}", "function setupSightingsLegend(){\n let legend = L.control({position: 'bottomleft'});\n legend.onAdd = function (map) {\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [-100, -50, 0, 50, 100, 150, 200],\n labels = [\"-100%\",\"-50%\",\"0\",\"+50%\",\"+100%\",\"+150%\", \"+200%\"];\n div.innerHTML += '<p>Sichtungen im Vergleich zum Vormonat</p><br>'\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + sigthingsColorScale(grades[i]) + '; border: 0.2px solid black\"></i> ' +\n labels[i] + '<br>';\n }\n return div;\n };\n return legend.addTo(map); \n}", "function mapColor(id,type) {\n var arrColors = guiData.colorPalette;\n var resColor = \"hsl(195, 100%, 35%)\";\n //console.log(emailDomains);\n //console.log(id);\n if (id != -1) {\n if (id < arrColors.length - 1) {\n resColor = arrColors[id];\n }else{\n resColor = arrColors[arrColors.length - 1];\n }\n }else{\n switch (type) {\n case 'node': resColor = arrColors[0]; break;\n case 'edge': resColor = arrColors[0];\n //\"rgba(0, 134, 179,0.5)\";\n //\"rgba(59, 124, 171, 0.42)\";\n break;\n }\n }\n return resColor;\n }", "changeColor(color){\n this.panel.data[0].color = color;\n this.panel.hData[0].color = color;\n this.panel.dataPlus[0].color = color;\n this.panel.pieData[0].color = color;\n this.panel.options.series.gauges.threshold.values.forEach(function(value){\n value.color = color;\n })\n this.render();\n }", "function style(data, callback){\n L.geoJson(data, {style: callback}).addTo(map);\n}", "function VectorColorMap(lower, upper) {\n this.lower =(lower === undefined) ? 0.5: lower;\n this.upper =(upper === undefined) ? 1: upper;\n}", "function colorMapRed () {\n if (freeRooms.length + busyRooms.length === 23) {\n for (let i = 0; i < svgAll.length; i++ ) {\n let currentSVG = svgAll[i];\n let style = currentSVG.style.fill;\n //change style here if changes were made on the change date pls\n if (style === \"none\") {\n currentSVG.style.fill = \"red\";\n currentSVG.style.fillOpacity = \"0.3\";\n redColor = 1\n makeHoverRed(currentSVG)\n }\n }\n }\n}", "function createMap(quakeLayer, faultLayer){\n var baseMaps = {\n \"Outdoor Map\": outdoorsMap,\n \"Grayscale Map\": lightMap,\n \"Satelite Map\": satelliteMap\n };\n\nvar overlayMaps = {\n \"Earthquakes\": quakeLayer,\n \"Fault Lines\": faultLayer\n \n };\nvar mymap = L.map('mapid', {\n center: [42.877742, -97.380979],\n zoom: 2.5,\n minZoom: 2.5,\n layers: [lightMap, faultLayer, quakeLayer],\n maxBounds: L.latLngBounds([90, -180], [-90, 180]),\n maxBoundsViscosity: 1,\n scrollWheelZoom: false\n \n}); \n\nvar legend = L.control({position: 'bottomright'});\n\nlegend.onAdd = function (mymap) {\n\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [0, 1, 2, 3, 4, 5],\n labels = [];\n\n div.innerHTML += '<p><u>Magnitude</u></p>'\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(grades[i] + 1) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n\n return div;\n};\n\nlegend.addTo(mymap);\n\nL.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(mymap);\n}", "function updateMode(c){\n //get color value from the mode\n var valueStr = scope.modeList[c][\"color\"];\n var values = valueStr.split(\",\");\n\n //change color of map\n d3.selectAll('.stateZone')\n .style(\"fill\", function(d){\n var streams = d3.select(this).attr(\"ts\");\n var customers = d3.select(this).attr(\"tc\");\n var population = d3.select(this).attr(\"pop\");\n\n var saturation = streams / 30000000 * 100;\n return \"hsl(\"+ values[0] +\", \" + saturation + \"%, \" + values[2]*100 + \"%)\";\n })\n ;\n }", "function colourType(){\n if (type.indexOf(\"normal\") >= 0) { mapColor = color(169, 168, 120) }\n if (type.indexOf(\"fire\") >= 0) { mapColor = color(240, 127, 47) }\n if (type.indexOf(\"water\") >= 0) { mapColor = color(104, 144, 240) }\n if (type.indexOf(\"grass\") >= 0) { mapColor = color(120, 200, 79) }\n if (type.indexOf(\"electric\") >= 0) { mapColor = color(248, 208, 48) }\n if (type.indexOf(\"poison\") >= 0) { mapColor = color(160, 64, 161) }\n if (type.indexOf(\"ice\") >= 0) { mapColor = color(152, 216, 216) }\n if (type.indexOf(\"fighting\") >= 0) { mapColor = color(192, 48, 40) }\n if (type.indexOf(\"ground\") >= 0) { mapColor = color(224, 192, 105) }\n if (type.indexOf(\"flying\") >= 0) { mapColor = color(168, 144, 240) }\n if (type.indexOf(\"rock\") >= 0) { mapColor = color(183, 160, 56) }\n if (type.indexOf(\"dark\") >= 0) { mapColor = color(111, 88, 72) }\n if (type.indexOf(\"psychic\") >= 0) { mapColor = color(248, 88, 136) }\n if (type.indexOf(\"ghost\") >= 0) { mapColor = color(112, 87, 152) }\n if (type.indexOf(\"steel\") >= 0) { mapColor = color(184, 184, 208) }\n if (type.indexOf(\"bug\") >= 0) { mapColor = color(168, 184, 33) }\n if (type.indexOf(\"dragon\") >= 0) { mapColor = color(112, 56, 249) }\n if (type.indexOf(\"fairy\") >= 0) { mapColor = color(255, 163, 177) }\n}", "function makeLegend() {\n let legend = L.control({position: 'bottomright'});\n\n legend.onAdd = function(map) {\n\n let div = L.DomUtil.create('div', 'info legend');\n let grades = [0, 1, 2, 3, 4, 5];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(grades[i]) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n\n return div;\n };\n\n return legend;\n}", "function highlight(concept) {\n var the_map = {\n opinions:\"chartreuse\",\n life:\"yellow\",\n }\n return the_map[concept]\n}", "function setupMap(){\n // LEAFLET CODE - \"L\" means the leaflet - L.map('mapid') or L.circle([lat, long]) \n mymap = L.map('quake-map', {\n center: [37.08195496473745, -121.81099891662599], // mymap.getCenter() -> Will return the current center of the moved map\n zoom: 6 //Zoom level - Only integer\n });\n L.tileLayer('https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.{ext}', {\n subdomains: 'abcd',\n minZoom: 0,\n maxZoom: 20,\n ext: 'png'\n }).addTo(mymap);\n mymap.addControl(new L.Control.Fullscreen()); //Add fullscreen control to an existing map: \n //Find out where you are \n mymap.on('click', onClick);\n function onClick(loc) {\n console.log(\"The clicked location is \" + loc.latlng);\n }\n //*** Info & Legend: Reference: https://leafletjs.com/examples/choropleth/\n //Basic Info \n let info = L.control();\n info.onAdd = function (mymap) {\n this._div = L.DomUtil.create('div', 'info'); // create a div with a class \"info\"\n this.update();\n return this._div;\n };\n // method that we will use to update the control based on feature properties passed\n info.update = function (props) {\n this._div.innerHTML = '<h4>Seismic Effects in California, 2019</h4>';\n };\n info.addTo(mymap);\n\n //legend - Magnitude\n let legend = L.control({position: 'bottomleft'});\n legend.onAdd = function (mymap) {\n let legendDiv = L.DomUtil.create('div', 'info legend'),\n grades = [-1, 0, 1, 2, 3, 4, 5], //Magnitude levels;\n labels = [];\n // loop through our magnitudes and generate a label with a colored circle for each interval\n legendDiv.innerHTML = \"Magnitude\"+ '<br><br>';\n for (let i = 0; i < grades.length; i++) {\n legendDiv.innerHTML +=\n '<i style=\"background:' + magScale(grades[i]).hex() + '\"></i> ' +\n grades[i] + '<br>';\n }\n return legendDiv;\n };\n legend.addTo(mymap);\n}", "function markerColor(magnitude){\n switch (true) {\n case magnitude > 5:\n //Burgundy color\n return \"#581845\";\n case magnitude > 4:\n //Dark pink\n return \"#900C3F\";\n case magnitude > 3:\n //Red\n return \"#C70039\";\n case magnitude > 2:\n //Reddish orange\n return \"#FF5733\";\n case magnitude > 1:\n //Orange yellow\n return \"#FFC300\";\n default:\n //Yellow green or lime\n return \"#DAF7A6\";\n }\n}", "initMap() {\n let self = this;\n \tlet styles = [\n {\n \"featureType\": \"all\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"hue\": \"#ff00d8\"\n },\n {\n \"saturation\": \"0\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#f9b8ea\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"color\": \"#ff0000\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#4e113b\"\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n },\n {\n \"color\": \"#ca2992\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#2e093b\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"color\": \"#9e1010\"\n },\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#ff0000\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural.landcover\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#58176e\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural.landcover\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.business\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"saturation\": -100\n },\n {\n \"lightness\": 45\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#a02aca\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#d180ee\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#a02aca\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n },\n {\n \"color\": \"#ff0000\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"color\": \"#a02aca\"\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#cc81e7\"\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"hue\": \"#f200ff\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#882375\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#e36cd9\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#b7918f\"\n },\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#280b33\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#ca2994\"\n }\n ]\n }\n]\n\n let mapview = document.getElementById('map');\n mapview.style.height = window.innerHeight + \"px\";\n let map = new window.google.maps.Map(mapview, {\n center: {lat: 38.961914, lng:-101.004839},\n zoom: 5,\n mapTypeControl: false,\n styles:styles\n });\n\n let InfoWindow = new window.google.maps.InfoWindow({});\n\n window.google.maps.event.addListener(InfoWindow, 'closeclick', function () {\n self.closeInfoWindow();\n });\n\n this.setState({\n 'map': map,\n 'infowindow': InfoWindow\n });\n\n window.google.maps.event.addDomListener(window, \"resize\", function () {\n let center = map.getCenter();\n window.google.maps.event.trigger(map, \"resize\");\n self.state.map.setCenter(center);\n });\n\n window.google.maps.event.addListener(map, 'click', function () {\n self.closeInfoWindow();\n });\n\n let ourLocations = [];\n this.state.ourLocations.forEach(function (location) {\n let longName = location.name + ' - ' + location.type;\n let marker = new window.google.maps.Marker({\n position: new window.google.maps.LatLng(location.latitude, location.longitude),\n animation: window.google.maps.Animation.BOUNCE,\n map: map,\n title: location.significance,\n \ticon: heart\n });\n\n marker.addListener('click', function () {\n self.openInfoWindow(marker, longName);\n });\n\n location.longName = longName;\n location.marker = marker;\n location.display = true;\n ourLocations.push(location);\n });\n this.setState({\n 'ourLocations': ourLocations\n });\n }", "statusColor(status) {\n switch(status) {\n case 2:\n return \"titleGreen\";\n case 1:\n return \"titleOrange\"; \n case 3:\n return \"titleRed\";\n default:\n return \"titleOrange\";\n }\n }", "function initMap() {\n\n var uluru = { lat: 40.674, lng: -73.945 };\n // Styles a map in night mode.\n\n var main_color = '#0E2646', //Main color\n saturation_value = -1, //saturation\n brightness_value = 1; //brightness\n\n //Style for elements on map\n var style = [{\n //Saturation of notation on the map\n elementType: \"labels\",\n stylers: [\n { saturation: saturation_value }\n ]\n },\n { //We hide the signs of metro stations, stations, airports and other transport links on the map\n featureType: \"poi\",\n elementType: \"labels\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide the road designation on the map\n featureType: 'road.highway',\n elementType: 'labels',\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide the designation of local roads\n featureType: \"road.local\",\n elementType: \"labels.icon\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide the designation of the highway on the map\n featureType: \"road.arterial\",\n elementType: \"labels.icon\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide road signs on the map\n featureType: \"road\",\n elementType: \"geometry.stroke\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n //Styles for different elements on the map\n {\n featureType: \"transit\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.government\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.sport_complex\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.attraction\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.business\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"transit\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"transit.station\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"landscape\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n\n },\n {\n featureType: \"road\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"road.highway\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"water\",\n elementType: \"geometry\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n }\n ];\n\n // Options map\n var map = new google.maps.Map(document.getElementById('google-map'), {\n center: uluru,\n scrollwheel: false,\n zoom: 15,\n styles: style\n });\n\n // Set marker on map\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n}", "function getColor(cases) {\n switch (true) {\n case (cases > 20):\n return '#e31a1c';\n case (cases > 10):\n return '#fd8d3c';\n case (cases > 5):\n return '#fecc5c'\n default:\n return '#ffffb2';\n }\n}", "function coloredScaleAltitudeMap(noiseval) {\n let result;\n\n // // Snow Mountain\n // if (noiseval <= 0.3) {\n // result = '#F0F8FF';\n // }\n // // Mountain\n // else if (noiseval > 0.3 && noiseval <= 0.5) {\n // result = '#696969';\n // }\n // // Forest\n // else if (noiseval > 0.5 && noiseval <= 0.75) {\n // result = '#228B22';\n // }\n // // Plains\n // else if (noiseval > 0.75 && noiseval <= 0.9) {\n // result = '#00FF00';\n // }\n // // Sand \n // else if (noiseval > 0.9 && noiseval <= 1) {\n // result = '#FFFF00';\n // }\n // // Water\n // else if (noiseval > 1 && noiseval <= 1.1) {\n // result = '#1E90FF';\n // } \n // // Deep water\n // else {\n // result = '#0000ff';\n // }\n\n // Mountain\n if (noiseval <= 0.5) {\n result = '#F0F8FF';\n }\n // Land\n else if (noiseval > 0.5 && noiseval <= 1) {\n result = '#939393';\n }\n // Shallow Water\n else if (noiseval > 1 && noiseval <= 1.1) {\n result = '#3f3f3f';\n }\n // Deep water\n else {\n result = '#000000';\n }\n\n // Debug\n if (noiseval == 15) {\n result = '#ff0000';\n }\n\n return result;\n }", "function setRegionColor() {\n var hexColor = $('#fillColorPicker').val();\n var red = parseInt( hexColor.substring(1,3), 16 );\n var green = parseInt( hexColor.substring(3,5), 16 );\n var blue = parseInt( hexColor.substring(5,7), 16 );\n var alpha = $('#alphaSlider').val() / 100;\n annotationColorLabel.alpha = alpha;\n // update region tag\n $(\".region-tag#\" + annotationColorLabel.uid + \">.region-color\").css('background-color','rgba('+red+','+green+','+blue+','+alpha+')');\n $('#colorSelector').css('display', 'none');\n}", "function ChangeColor(color){\n var col = \"\";\n switch (color) {\n case \"black\": col = \"#000000\"; break;\n case \"darkgray\": col = \"#696969\"; break;\n case \"gray\": col = \"#808080\"; break;\n case \"lightgray\": col = \"#D3D3D3\"; break;\n case \"white\": col = \"#ffffff\"; break;\n\n case \"red\": col = \"#ff1100\"; break;\n case \"orange\": col = \"#FFA500\"; break;\n case \"yellow\": col = \"#FFFF00\"; break;\n\n case \"purple\": col = \"#800080\"; break;\n case \"darkblue\": col = \"#000080\"; break;\n case \"blue\": col = \"#0000ff\"; break;\n case \"lightblue\": col = \"#00BFFF\"; break;\n\n case \"darkpink\": col = \"#C71585\"; break;\n case \"pink\": col = \"#FF69B4\"; break;\n case \"lightpink\": col = \"#FFC0CB\"; break;\n\n case \"darkgreen\": col = \"#006400\"; break;\n case \"green\": col = \"#00b400\"; break;\n case \"lightgreen\": col = \"#7CFC00\"; break;\n\t\n case \"darkbrown\": col = \"#8B4513\"; break;\n case \"brown\": col = \"#b4522d\"; break;\n case \"gold\": col = \"#FFD700\"; break;\n \n case \"turquoise\": col = \"#40E0D0\"; break;\n\n }\n\n Graphics.strokeStyle = col;\n Graphics.fillStyle = col;\n label1.style.backgroundColor = col;\n label2.style.backgroundColor = col;\n\n}", "function myStyleDistPoly(feature) {\n switch (feature.properties.agency) {\n case 0:\n return {\n color: \"#fdfe00\",\n fillColor: \"#fdfe00\"\n };\n break;\n case 1:\n return {\n color: \"#54ff01\",\n fillColor: \"#54ff01\"\n };\n break;\n case 2:\n return {\n color: \"#005de8\",\n fillColor: \"#005de8\"\n };\n break;\n case 3:\n return {\n color: \"#8600ac\",\n fillColor: \"#8600ac\"\n };\n break;\n }\n}", "function mapOptions() {\n var mapStyles = [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#8ec3b9\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1a3646\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#4b6878\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#64779e\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.neighborhood\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#4b6878\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#334e87\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#283d6a\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#6f9ba5\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#3C7680\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#304a7d\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#98a5be\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#2c6675\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#255763\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#b0d5ce\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#98a5be\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#283d6a\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#3a4762\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#0e1626\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#4e6d70\"\n }\n ]\n }\n ],\n mapOptions = {\n center: {\n lat: officeLatCoord,\n lng: officeLonCoord\n },\n disableDefaultUI: true,\n mapTypeId: 'roadmap',\n scrollwheel: false,\n styles: mapStyles\n },\n directionsOptions = {\n suppressMarkers: true,\n polylineOptions: {\n strokeColor: mapStroke,\n strokeOpacity: mapStrokeOpacity,\n strokeWeight: mapStrokeWeight\n }\n };\n\n buildMap(mapOptions, directionsOptions);\n}", "function set_chart_color() {\n if (neighborhood == \"Downtown\") {\n chart_color = \"#3D2B56\";\n pie_colors = ['#3D2B56','#A26769', '#D5B9B2', '#ECE2D0', '#CEBEBE', 'rgb(102, 102, 102)','rgb(76, 76, 76)','rgb(153, 153, 153)','rgb(204, 204, 204)','rgb(229, 229, 229)'];\n bg_color =\"#dcd2e9\";\n }\n else if (neighborhood == \"Beacon Hill\") {\n chart_color = \"#F26419\";\n pie_colors = ['#F26419','#FFB800', '#2F4858', '#86BBD8', '#33658A', 'rgb(102, 102, 102)','rgb(76, 76, 76)','rgb(153, 153, 153)','rgb(204, 204, 204)','rgb(229, 229, 229)'];\n bg_color = \"#fce0d1\";\n }\n else if (neighborhood == \"Central Area\") {\n chart_color = \"#6B8F71\";\n pie_colors = ['#6B8F71','#9DBF9E', '#D0D6B5', '#F9B5AC', '#EE7674', 'rgb(102, 102, 102)','rgb(76, 76, 76)','rgb(153, 153, 153)','rgb(204, 204, 204)','rgb(229, 229, 229)'];\n bg_color = \"#dae4da\";\n }\n else if (neighborhood == \"Queen Anne\") {\n chart_color = \"#6F1A07\";\n pie_colors = ['#6F1A07','#C32F27', '#D8572A', '#DB7C26', '#F7B538', 'rgb(102, 102, 102)','rgb(76, 76, 76)','rgb(153, 153, 153)','rgb(204, 204, 204)','rgb(229, 229, 229)'];\n bg_color = \"#fac2b5\";\n }\n}", "function Start()\n{\n//\tmapName.renderer.material.color = Color(1,1,0,1);\n}", "function colorBackgroundMap(){\n var div = document.getElementsByClassName(\"jvectormap-container\");\n for(var i=0 ; i < div.length ; i++){\n div[i].setAttribute(\"style\",\"background-color : rgb(255,255,255);\")\n }\n}", "function generateLandColor(arg) {\n if (arg.land_type === 'forest' && arg.discovered) {\n return '#005000'\n }\n else if (arg.land_type === 'plains' && arg.discovered) {\n return '#779e27'\n }\n else if (arg.land_type === 'mountains' && arg.discovered) {\n return '#8694a1'\n }\n else if (arg.land_type === 'desert' && arg.discovered) {\n return '#ffe0ae'\n }\n else if (arg.discovered !== true && arg.home !== true) {\n return 'rgba(0,0,0,.75)'\n }\n else {\n return 'darkred'\n }\n}", "function getcolor(c) {\n if(c == \"naranja\") return '#FCAF00'; else\n if (c == \"tradicional\") return '#3FDAD6';\n\tif (c == \"aliado\") return '#FE52D4';\n }", "function createMapLegend() {\n\n}", "function markerColor(mag){\n if (mag < 1) return \"green\";\n else if (mag < 2) return \"#A0E500\";\n else if (mag < 3) return \"#E1E000\";\n else if (mag < 4) return \"#DD9A00\";\n else if (mag < 5) return \"#D95600\";\n else return \"#D51400\";\n}", "function markerColor(magnitude) {\n switch (true) {\n case magnitude > 5:\n return \"red\";\n case magnitude > 4:\n return \"orangered\";\n case magnitude > 3:\n return \"orange\";\n case magnitude > 2:\n return \"yellow\";\n case magnitude > 1:\n return \"lime\";\n default:\n return \"green\";\n }\n }", "function markerColor(magnitude) {\n if (magnitude < 1) {\n return \"lightgreen\";\n }\n else if (magnitude < 2) {\n return \"greenyellow\";\n }\n else if (magnitude < 3) {\n return \"yellow\";\n }\n else if (magnitude < 4) {\n return \"orange\";\n }\n else if (magnitude < 5) {\n return \"salmon\";\n }\n else {\n return \"crimson\";\n }\n}", "function createMap(classificationStatus) {\n\n // Create the tile layer that will be the background of our map\n var lightmap = L.tileLayer(\"https://api.mapbox.com/styles/v1/mapbox/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"light-v10\",\n accessToken: API_KEY\n });\n \n // Create a baseMaps object to hold the lightmap layer\n var baseMaps = {\n \"Light Map\": lightmap\n };\n \n // Create an overlayMaps object to hold the classification layer\n var overlayMaps = {\n \"Classification\": classificationStatus\n };\n \n // Initialize the layerGroups\n var layers = {\n Improved: new L.LayerGroup(),\n Eutrophic: new L.LayerGroup(),\n Hypoxic: new L.LayerGroup()\n \n };\n \n \n // Create the map object with layers\n var map = L.map(\"map-id\", {\n center: [40.73, -74.0059],\n zoom: 4,\n layers: [\n layers.Improved,\n layers.Eutrophic,\n layers.Hypoxic\n ]\n });\n\n // Add our 'lightmap' tile layer to the map\n lightmap.addTo(map);\n\n // Create an overlays object to add to the layer control\n var overlays = {\n \"Improved\": layers.Improved,\n \"Eutrophic\": layers.Eutrophic,\n \"Hypoxic\": layers.Hypoxic,\n \n };\n\n\n \n // Create a layer control, pass in the baseMaps and overlayMaps. Add the layer control to the map\n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(map);\n\n // Create a legend to display information about our map\n var info = L.control({\n position: \"topright\"\n });\n\n // When the layer control is added, insert a div with the class of \"legend\"\n info.onAdd = function() {\n var div = L.DomUtil.create(\"div\", \"legend\");\n return div;\n };\n // Add the info legend to the map\n info.addTo(map);\n }", "function createMap(earthquakes) {\n\n // set up darkmap layer\n var darkmap = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: 'Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"https://www.mapbox.com/\">Mapbox</a>',\n maxZoom: 18,\n id: 'mapbox/dark-v10',\n accessToken: \"pk.eyJ1IjoiYWx4cHJ5IiwiYSI6ImNrYW9saHZjNDA0Z3ozMG82cHZpcm0xbm8ifQ.yM3ZhZhGelQpcJBz0wtaiw\"\n });\n\n // set up baseMaps to store darkmap layer\n var baseMaps = {\n \"Dark Map\": darkmap\n };\n\n // set up overlayMaps \n var overlayMaps = {\n Earthquakes: earthquakes\n };\n\n // set variable to store map where formatting is held\n var myMap = L.map(\"map\", {\n center:[\n 40.09, -110.71\n ],\n zoom: 5,\n layers: [darkmap, earthquakes]\n });\n \n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(myMap);\n\n // set up the legend\n var legend = L.control({ position: \"bottomleft\" });\n \n // add legend capabilities where color scole of the earthquake magnitude is shown \n legend.onAdd = function() {\n var div = L.DomUtil.create(\"div\", \"info legend\");\n var magScale = [0, 1, 2, 3, 4, 5]\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < magScale.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + markerColor(magScale[i]) + '\"></i> ' +\n magScale[i] + (magScale[i + 1] ? '&ndash;' + magScale[i + 1] + '<br>' : '+');\n }\n return div;\n};\n\n // add legend to the map\n legend.addTo(myMap);\n\n }", "getAreaColor(feature){\n\t\tconsole.log(feature)\n\t\t switch (feature.properties.Name){\n\t\t\tcase 'Area One' : return 'blue' ;\n\t\t case 'Area Two' : return 'yellow' ;\n\t\t\t break;\n\t\t}\n\t }", "function initMap() {\n const pos = { lat: 40.694449, lng: -73.8978617 };\n const opt = {\n center: pos,\n zoom: 13,\n disableDefaultUI: true,\n styles: [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#f5f5f5\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#bdbdbd\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#757575\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#dadada\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#616161\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#e5e5e5\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#eeeeee\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#c9c9c9\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#9e9e9e\"\n }\n ]\n }\n ]\n }\n const myMap = new google.maps.Map(document.getElementById(\"map\"), opt);\n const marker = new google.maps.Marker({\n position: pos,\n map: myMap,\n title: \"91 Nolan Extensions Suite 670\",\n icon: 'img/Pin.png',\n animation: google.maps.Animation.BOUNCE,\n });\n\n const infowindow = new google.maps.InfoWindow({\n content: 'From 07:05AM to 19:30PM'\n });\n\n google.maps.event.addListener(marker, 'click', function () {\n console.log('click');\n infowindow.open(myMap, marker);\n });\n\n\n}", "get title_color() {\n return `${this.map.map.name} &7${this.map.map.version.replace(/([.])/, '&8$1&7')}`\n }", "function maps(valuetype) {\n // Erase the container if it is filled\n var container = L.DomUtil.get('map');\n if(container != null){\n container._leaflet_id = null;\n };\n\n // Add map functionality\n var myMap = L.map(\"map\", {\n center: [45.8283, -108.5795],\n zoom: 3,\n dragging: true\n });\n\n // Add Background map \n L.tileLayer(\n \"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}\",\n {\n tileSize: 512,\n maxZoom: 19,\n zoomOffset: -1,\n id: \"mapbox/dark-v10\",\n accessToken: API_KEY\n }\n ).addTo(myMap);\n\n // Calculate the quartiles for the State values\n var values=[];\n for (var state in state_heatmap) {\n values=values.concat([state_heatmap[state][valuetype]]);\n };\n // Find the bounds for green, yellow and red. Current set to 10th percentile for g, 50th for y and 90th for r\n statelow=get_percentile(10,values);\n statemid=get_percentile(50,values);\n stateup=get_percentile(90,values);\n\n // Calculate the quartiles for the County values\n var valuescounty=[];\n for (var county in county_heatmap) {\n valuescounty=valuescounty.concat([county_heatmap[county][valuetype]]);\n };\n // Find the bounds for green, yellow and red. Current set to 10th percentile for g, 50th for y and 90th for r\n countylow=get_percentile(10,valuescounty);\n countymid=get_percentile(50,valuescounty);\n countyup=get_percentile(90,valuescounty);\n \n // Add County Map\n var countymap = L.geoJson.ajax(countylink, {\n style: function (feature) {\n return {\n color: \"white\",\n fillOpacity: 0.5,\n fillColor: chooseColorCounty(feature.properties.STATE, feature.properties.COUNTY),\n weight: 1.5\n };\n },\n\n onEachFeature: function (feature, layer) {\n layer.on({\n mouseover: function (event) {\n event.target.setStyle({\n fillOpacity: 0.9,\n });\n },\n mouseout: function (event) {\n event.target.setStyle({\n fillOpacity: 0.5,\n });\n },\n });\n layer.bindPopup(\n `<h1>${hoverOverCounty(feature.properties.STATE, feature.properties.COUNTY)}</h1>`,\n popupOptions\n );\n },\n });\n\n // Add State Map\n var statemap = L.geoJson.ajax(statelink, {\n style: function (feature) {\n return {\n color: \"white\",\n fillOpacity: 0.5,\n fillColor: chooseColorState(feature.properties.NAME),\n weight: 1.5,\n };\n },\n onEachFeature: function (feature, layer) {\n layer.on({\n click: function (event) {\n myMap.fitBounds(event.target.getBounds());\n // Fill start Chart when clicked\n stateChart(feature.properties.NAME)\n },\n mouseover: function (event) {\n layer.openPopup();\n event.target.setStyle({\n fillOpacity: 0.9,\n });\n },\n mouseout: function (event) {\n event.target.setStyle({\n fillOpacity: 0.5,\n });\n },\n });\n layer.bindPopup(\n `<h1>${hoverOverState(feature.properties.NAME)}</h1>`,\n popupOptions\n );\n },\n });\n\n // State Borders for the County Outlines\n var stateoutlinemap = L.geoJson.ajax(statelink, {\n style: function (feature) {\n return {\n\n color: '#000000',\n fill: false,\n weight: 10,\n opacity: 1,\n };\n },\n });\n\n // Zoom threshold is set to 5\n // on zoom in add county and state outlines, remove state\n myMap.on('zoomend', function () {\n if (myMap.getZoom() >= 5) {\n myMap.removeLayer(statemap);\n stateoutlinemap.addTo(myMap);\n countymap.addTo(myMap);\n }\n });\n\n // on zoom out add state, remove state outlines and county\n myMap.on('zoomend', function () {\n if (myMap.getZoom() < 5) {\n myMap.removeLayer(countymap);\n myMap.removeLayer(stateoutlinemap);\n statemap.addTo(myMap);\n }\n });\n\n // Add state map and return the map value itself\n statemap.addTo(myMap);\n return myMap;\n}", "function chooseColor(county) {\n switch (county) {\n case \"Alameda\":\n return \"yellow\";\n case \"Contra Costa\":\n return \"red\";\n case \"Marin\":\n return \"orange\";\n case \"Napa\":\n return \"green\";\n case \"San Francisco\":\n return \"purple\";\n case \"San Mateo\":\n return \"pink\";\n case \"Santa Clara\":\n return \"blue\";\n case \"Solano\":\n return \"pink\";\n case \"Sonoma\":\n return \"pink\";\n default:\n return \"black\";\n }\n }", "function genomeColor(genomeCode){\n switch (genomeCode) {\n case 'C':\n return 'lightblue';\n case 'G':\n return 'orange';\n case 'T':\n return 'lightgreen';\n case 'A':\n return 'red';\n default:\n return 'white';\n }\n}", "function markerColor(mag) {\n if (mag <= 1) {\n return \"lightgreen\";\n }\n else if ((mag>1) && (mag<=2)) {\n return \"green\";\n }\n else if ((mag>2) && (mag<=3)) {\n return \"yellow\";\n }\n else if ((mag>3) && (mag<=4)) {\n return \"orange\";\n }\n else if ((mag>4) && (mag<=5)) {\n return \"red\";\n }\n else if (mag>5) {\n return \"darkred\";\n }\n}", "function style(feature) {\n if (map.getZoom() > 9) {\n return {\n \"color\": \"blue\",\n \"weight\" : \"0\",\n \"fillOpacity\": \"0\"\n }\n } else {\n return {\n \"color\": \"blue\",\n \"fillOpacity\": \"0\"\n }\n }\n }", "setColor (color) {\n let levels = Object.keys(LEVELS);\n for (let severity of levels) {\n if (severity === 'level') continue;\n this.levels[severity].setColor(color);\n }\n }", "function myStyleRestoPoly(feature) {\n switch (feature.properties.agency) {\n case 0:\n return {\n color: \"#fdfe00\"\n };\n break;\n case 1:\n return {\n color: \"#54ff01\"\n };\n break;\n case 2:\n return {\n color: \"#005de8\"\n };\n break;\n case 3:\n return {\n color: \"#8600ac\"\n };\n break;\n }\n}", "function selecionadorCor(pref) {\r\n let color;\r\n if (pref == 'mat')\r\n color = \"#caeaf5\"\r\n else if (pref == 'port')\r\n color = \"#0e91bd\"\r\n else if (pref == 'hist')\r\n color = \"#9a55b6\"\r\n else if (pref == 'geo')\r\n color = \"#e6e22e\"\r\n else if (pref == 'bio')\r\n color = \"#20b2aa\"\r\n else if (pref == 'fis')\r\n color = \"#eeb958\"\r\n else if (pref == 'qui')\r\n color = \"#e47263\"\r\n else if (pref == 'ing')\r\n color = \"#f5deb3\"\r\n\r\n return (color);\r\n}", "function colorForCurrent(){\n\n}", "getColor() {\n if (this.type == 'home' || this.type == 'goal') {\n return ['#B5FEB4', '#B5FEB4'];\n }\n\n else if (this.type == 'board') {\n return ['#F7F7FF', '#E6E6FF'];\n }\n\n else if (this.type == 'back'){\n return ['#B4B5FE', '#B4B5FE'];\n }\n }", "function getLabelColors () {\n return SidewalkColorScheme();\n}", "function setAssistLabelColor(i) {\r\n\r\n\tswitch(i) {\r\n\t\r\n\t\tcase 0:\r\n\t\t(assistsFilter[i] == true) ? (steerAssistLabel.style.color = 'lightgreen') : (assistsFilter[i] == false) ? (steerAssistLabel.style.color = 'pink') : (assistsFilter[i] == 'both') ? (steerAssistLabel.style.color = 'lightblue') : alert('setAssistLabelColor error (case0)');\r\n\t\tbreak;\r\n\t\t\t\r\n\t\tcase 1:\r\n\t\t(assistsFilter[i] == true) ? (brakeAssistLabel.style.color = 'lightgreen') : (assistsFilter[i] == false) ? (brakeAssistLabel.style.color = 'pink') : (assistsFilter[i] == 'both') ? (brakeAssistLabel.style.color = 'lightblue') : alert('setAssistLabelColor error (case0)');\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 2:\r\n\t\t(assistsFilter[i] == true) ? (ABS_label.style.color = 'lightgreen') : (assistsFilter[i] == false) ? (ABS_label.style.color = 'pink') : (assistsFilter[i] == 'both') ? (ABS_label.style.color = 'lightblue') : alert('setAssistLabelColor error (case0)');\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 3:\r\n\t\t(assistsFilter[i] == true) ? (TC_label.style.color = 'lightgreen') : (assistsFilter[i] == false) ? (TC_label.style.color = 'pink') : (assistsFilter[i] == 'both') ? (TC_label.style.color = 'lightblue') : alert('setAssistLabelColor error (case0)');\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 4:\r\n\t\t(assistsFilter[i] == true) ? (SC_label.style.color = 'lightgreen') : (assistsFilter[i] == false) ? (SC_label.style.color = 'pink') : (assistsFilter[i] == 'both') ? (SC_label.style.color = 'lightblue') : alert('setAssistLabelColor error (case0)');\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 5:\r\n\t\t(assistsFilter[i] == true) ? (damageLabel.style.color = 'lightgreen') : (assistsFilter[i] == false) ? (damageLabel.style.color = 'pink') : (assistsFilter[i] == 'both') ? (damageLabel.style.color = 'lightblue') : alert('setAssistLabelColor error (case0)');\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 6:\r\n\t\t(assistsFilter[i] == true) ? (gearLabel.style.color = 'lightgreen') : (assistsFilter[i] == false) ? (gearLabel.style.color = 'pink') : (assistsFilter[i] == 'both') ? (gearLabel.style.color = 'lightblue') : alert('setAssistLabelColor error (case0)');\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 7:\r\n\t\t(assistsFilter[i] == true) ? (clutchLabel.style.color = 'lightgreen') : (assistsFilter[i] == false) ? (clutchLabel.style.color = 'pink') : (assistsFilter[i] == 'both') ? (clutchLabel.style.color = 'lightblue') : alert('setAssistLabelColor error (case0)');\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 8:\r\n\t\t(assistsFilter[i] == true) ? (lineLabel.style.color = 'lightgreen') : (assistsFilter[i] == false) ? (lineLabel.style.color = 'pink') : (assistsFilter[i] == 'both') ? (lineLabel.style.color = 'lightblue') : alert('setAssistLabelColor error (case0)');\r\n\t\tbreak;\r\n\t\t\r\n\t\tdefault:\r\n\t\talert('Error in setAssistLabelColor');\r\n\t\tbreak;\r\n\t}\r\n}", "function choropleth (props, colorScale){\n //make sure attribute value is a number\n var val = parseFloat(props[expressed]);\n //if attribute value exists, assign it a color, otherwise grey\n if (typeof val == 'number' && !isNaN(val)){\n return colorScale (val);\n } else {\n return \"#ffffff\";\n };\n}", "function chooseMap(ilmakuva) {\n // Set the label to the aerial imagery name\n map.setLayoutProperty(currentLayer, 'visibility', 'none');\n currentLayer = toggleableLayers[0]['layers'][ilmakuva];\n map.setLayoutProperty(currentLayer, 'visibility', 'visible');\n document.getElementById('slider-label').textContent = currentLayer;\n }", "function createLegend(mymap) {\n var legend = L.control({ position: 'bottomleft' });\n legend.onAdd = function (map) {\n var div = L.DomUtil.create(\"div\", \"legend\");\n div.style.backgroundColor = 'WHITE';\n\n div.innerHTML += '<p>Number of Links<b>: XX</b></p>';\n div.innerHTML += '<p>xxxx xxxx xxxx<b>: XX</b></p>';\n\n return div;\n };\n\n legend.addTo(mymap);\n}", "function createLegend(mymap) {\n var legend = L.control({ position: 'bottomleft' });\n legend.onAdd = function (map) {\n var div = L.DomUtil.create(\"div\", \"legend\");\n div.style.backgroundColor = 'WHITE';\n\n div.innerHTML += '<p>Number of Links<b>: XX</b></p>';\n div.innerHTML += '<p>xxxx xxxx xxxx<b>: XX</b></p>';\n\n return div;\n };\n\n legend.addTo(mymap);\n}", "function getColor(d) {\n return d >= legend5 ? color_map[5] :\n d >= legend4 ? color_map[4] :\n d >= legend3 ? color_map[3] :\n d >= legend2 ? color_map[2] :\n d >= legend1 ? color_map[1] :\n d >= legend0 ? color_map[0] :\n 'grey';\n }", "function geojsonMarkerColor(depth) {\n\n switch (true) {\n case (depth < 10):\n return \"green\";\n\n case (depth >= 10 && depth < 30):\n return \"yellow\";\n\n case (depth >= 30 && depth < 50):\n return \"orange\";\n\n case (depth >= 50 && depth < 70):\n return \"brown\";\n\n case (depth >= 70 && depth < 90):\n return \"purple\";\n\n case (depth >= 90):\n return \"red\";\n }\n}", "function choropleth(props, colorScale){\n var value = parseFloat(props[expressed]);\n\n if(isNaN(value)){\n return \"grey\";//no value\n } else if (value==0){\n return \"lightgrey\";//for case of Political_Filtering with a score of 0\n } else{\n return colorScale(value);\n }\n }", "function Mapa() {\r\n let location = new google.maps.LatLng(41.366858, -8.738309);\r\n\r\n // Posicionar o mapa\r\n let map = new google.maps.Map(document.getElementById('map'), {\r\n center: location,\r\n zoom: 14,\r\n styles: [\r\n {\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#1d2c4d\"\r\n }\r\n ]\r\n },\r\n {\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#8ec3b9\"\r\n }\r\n ]\r\n },\r\n {\r\n \"elementType\": \"labels.text.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#1a3646\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative.country\",\r\n \"elementType\": \"geometry.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#4b6878\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative.land_parcel\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#64779e\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"administrative.province\",\r\n \"elementType\": \"geometry.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#4b6878\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"landscape.man_made\",\r\n \"elementType\": \"geometry.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#334e87\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"landscape.natural\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#023e58\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#283d6a\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#6f9ba5\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi\",\r\n \"elementType\": \"labels.text.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#1d2c4d\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi.park\",\r\n \"elementType\": \"geometry.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#023e58\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"poi.park\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#3C7680\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#304a7d\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#98a5be\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road\",\r\n \"elementType\": \"labels.text.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#1d2c4d\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#2c6675\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"geometry.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#255763\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#b0d5ce\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"road.highway\",\r\n \"elementType\": \"labels.text.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#023e58\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"transit\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#98a5be\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"transit\",\r\n \"elementType\": \"labels.text.stroke\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#1d2c4d\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"transit.line\",\r\n \"elementType\": \"geometry.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#283d6a\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"transit.station\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#3a4762\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"geometry\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#0e1626\"\r\n }\r\n ]\r\n },\r\n {\r\n \"featureType\": \"water\",\r\n \"elementType\": \"labels.text.fill\",\r\n \"stylers\": [\r\n {\r\n \"color\": \"#4e6d70\"\r\n }\r\n ]\r\n }\r\n ]\r\n });\r\n\r\n // Ponto no mapa....\r\n let mark = new google.maps.Marker({\r\n position: location,\r\n map: map\r\n });\r\n\r\n\r\n\r\n\r\n //var map = new google.maps.Map(document.getElementById(\"mapa\"), mapProp);\r\n}", "function createMap(){\n\n var black = L.tileLayer('https://cartodb-basemaps-{s}.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png', {maxZoom: 19}),\n satelite = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {\n attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'\n });\n\n var leafletMap = L.map('map',{\n center: [6.45, -9.5],\n zoom: 8,\n layers: [black,satelite]\n});\n\n var baseMaps = {\n \"Satelite\": satelite,\n \"Black\": black\n};\n \n\n L.control.layers(baseMaps).addTo(leafletMap);\n\n\n ////////////////////////////////////////////////////// Counties JSON\n\n // waCountiesJSON = L.geoJson(waCounties, {\n // style: lowStyle,\n // onEachFeature: onEachLowFeature\n // }).addTo(leafletMap); \n\n // slCountiesJSON = L.geoJson(slCounties, {\n // style: style,\n // onEachFeature: onEachFeature\n // }).addTo(leafletMap); \n\n // ginCountiesJSON = L.geoJson(ginCounties, {\n // style: style,\n // onEachFeature: onEachFeature\n // }).addTo(leafletMap); \n\n libCountiesJSON = L.geoJson(libCounties, {\n style: style,\n onEachFeature: onEachFeature\n }).addTo(leafletMap); \n\n ////////////////////////////////////////////////////////// Country JSON\n\n libOutline = L.geoJson(libCountry, {\n style: countryStyle,\n }).addTo(leafletMap); \n\n\n\n//////////////////////////////////////////////////////////// Roads\n\n libRoadJSON = L.geoJson(libROADS, {\n style: roadStyle,\n \n }).addTo(leafletMap); \n\n//////////////////////////////////////////////////// ETU JSON Files\n \n libJSON = L.geoJson(libETUData, {\n style: ETUstyle,\n pointToLayer : pointToLayer,\n onEachFeature: onEachETU\n}).addTo(leafletMap); \n\n// slJSON = L.geoJson(slETUData, {\n// style: ETUstyle,\n// pointToLayer : pointToLayer,\n// onEachFeature: onEachETU\n// }).addTo(leafletMap); \n\n// ginJSON = L.geoJson(ginETUData, {\n// style: ETUstyle,\n// pointToLayer : pointToLayer,\n// onEachFeature: onEachETU \n// }).addTo(leafletMap); \n\n CCCJSON = L.geoJson(CCCData, {\n style: ETUstyle,\n pointToLayer : pointToLayer,\n onEachFeature: onEachETU \n}).addTo(leafletMap); \n\n\n//////////////////////////////////////////////////////////// health centers \n\n// ginHealthJSON = L.geoJson(ginHealth, {\n// style: ETUstyle,\n// pointToLayer : HpointToLayer,\n// onEachFeature: onEachETU\n// }).addTo(leafletMap); \n\n libHealthJSON = L.geoJson(libHealth, {\n style: healthStyle,\n pointToLayer : HpointToLayer,\n onEachFeature: onEachHealth\n}).addTo(leafletMap); \n\n// slHealthJSON = L.geoJson(slHealth, {\n// style: ETUstyle,\n// pointToLayer : HpointToLayer,\n// onEachFeature: onEachETU \n// }).addTo(leafletMap); \n}", "function colorChart(house)\n{\n \n if (house == \"Adams House\")\n {\n house = \"adams\";\n return house;\n }\n else if (house == \"Cabot House\")\n {\n house = \"cabot\";\n return house;\n }\n else if (house == \"Currier House\")\n {\n house = \"currier\";\n return house;\n }\n else if (house == \"Dunster House\")\n {\n house = \"dunster\";\n return house;\n }\n else if (house == \"Eliot House\")\n {\n house = \"eliot\";\n return house;\n }\n else if (house == \"Kirkland House\")\n {\n house = \"kirkland\";\n return house;\n }\n else if (house == \"Leverett House\")\n {\n house = \"leverett\";\n return house;\n }\n else if (house == \"Lowell House\")\n {\n house = \"lowell\";\n return house;\n }\n else if (house == \"Mather House\")\n {\n house = \"mather\";\n return house;\n }\n else if (house == \"Pforzheimer House\")\n {\n house = \"pforzheimer\";\n return house;\n }\n else if (house == \"Quincy House\")\n {\n house = \"quincy\";\n return house;\n } \n else if (house == \"Winthrop House\")\n {\n house = \"winthrop\";\n return house;\n }\n}", "function getColor(name) {\n\n\t\t//find the covid data for that county\n\t\t//covid_cases = ;\n\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: \"/shading/\",\n\t\t\tdata: {data: name}\n\t\t }).done(function( o ) {\n\t\t\t//were done;\n\t\t });\n\t\t\n\t\t /*\n\t\tvar order = document.getElementById({county_cases}).value;\n\t\t\n\t\tconsole.log();\n\t\t */\n\t\treturn covid_cases > 30000 ? 'red' :\n\t\t\t\tcovid_cases > 10000 ? '#BD0026' :\n\t\t\t\tcovid_cases > 5000 ? '#E31A1C' :\n\t\t\t\tcovid_cases > 1000 ? '#FC4E2A' :\n\t\t\t\tcovid_cases > 500 ? '#FD8D3C' :\n\t\t\t\tcovid_cases > 100 ? '#FEB24C' :\n\t\t\t\tcovid_cases > 10 ? '#FED976' :\n\t\t\t\t\t\t\t\t\t\t 'white';\n\t}", "function costBarColor(num) {\r\n\t var color;\r\n\t switch (true) {\r\n\t case (num <= 551000):\r\n\t color = \"#b200ff\";\r\n\t break;\r\n\t case ((num > 551000) &&(num <= 552000)):\r\n\t color = \"#4800ff\";\r\n\t break;\r\n\t case ((num > 552000) &&(num <= 553000)):\r\n\t color = \"#0026ff\";\r\n\t break;\r\n\t case ((num > 553000) &&(num <= 554000)):\r\n\t color = \"#0045ff\";\r\n\t break;\r\n\t case ((num > 554000) &&(num <= 555000)):\r\n\t color = \"#0094ff\";\r\n\t break;\r\n\t case ((num > 555000) &&(num <= 556000)):\r\n\t color = \"#00ffff\";\r\n\t break;\r\n\t case ((num > 556000) &&(num <= 1000000)):\r\n\t color = \"#00ff90\";\r\n\t break;\r\n\t }\r\n\t return color;\r\n\r\n\t }", "function setAllTractColors(data) {\n\t\t//\tconsole.log(\"setAllTractColors()\",data);\n\n\n\t\t// update the color scale for the map\n\n\t}", "setColorMapType(colorMapType) {\n if (this.colorMapType !== colorMapType) {\n this.colorMapType = colorMapType;\n this.drawRegionList();\n }\n }", "function colorPoints(d) {\n if (d.League == \"NHL\") \n return \"#c2e487\";\n else if (d.League == \"NBA\")\n return \"#ebb980\";\n else if (d.League == \"MLB\")\n return \"#ebbbb5\"; \n else //NFL\n return \"#95b8d1\";\n }", "function change_map_layer(el) {\n if (el.value === \"lock\") {\n conf_layer.remove();\n conf_num_group.remove();\n lock_layer.addTo(map);\n toggle_map_legend(0);\n\n let layers = document.querySelectorAll(\".layer-switch-area > .wrap\");\n for (let i = 0; i < layers.length; ++i) {\n layers[i].classList.remove(\"active\");\n }\n el.parentNode.classList.add(\"active\");\n } else if (el.value === \"conf\") {\n lock_layer.remove();\n conf_layer.addTo(map);\n conf_num_group.addTo(map);\n toggle_map_legend(1);\n\n let layers = document.querySelectorAll(\".layer-switch-area > .wrap\");\n for (let i = 0; i < layers.length; ++i) {\n layers[i].classList.remove(\"active\");\n }\n el.parentNode.classList.add(\"active\");\n }\n}", "function colorMarker (depth) {\n if (depth > 90 ) {\n return \"#3AB341\"\n }\n if (depth > 70) {\n return \"#00eede\"\n }\n if (depth > 50) {\n return \"#0073ee\"\n }\n if (depth > 30) {\n return \"#ee9c00\"\n }\n if (depth > 10) {\n return \"#d600ee\"\n }\n else {\n return \"#ea782c\"\n }\n}", "displayLegend() {\n let colorChangeCounter = -1;\n const marginYChange = margin.top;\n const marginYChangeText = margin.top+10;\n let marginYMultiplier = -1;\n\n return this.state.cases.map( help => {\n colorChangeCounter++;\n marginYMultiplier++;\n return (<g><rect x={margin.left+25} y={marginYChange+(marginYMultiplier*15)} width=\"10\" height=\"10\" fill={this.state.color(colorChangeCounter)}></rect>\n <text y={marginYChangeText+(marginYMultiplier*15)} x={margin.left+36}>{this.state.counties[marginYMultiplier]}</text></g>);\n marginYChange+=10;\n });\n }", "function chooseColor(district) {\n switch (district) {\n case 1:\n return \"teal\";\n case 2:\n return \"blue\";\n case 3:\n return \"green\";\n case 4:\n return \"orange\";\n case 5:\n return \"purple\";\n case 6:\n return \"brown\";\n case 7:\n return \"yellow\";\n case 8:\n return \"red\";\n case 9:\n return \"magenta\";\n default:\n return \"black\";\n }\n}", "function fireLegendStyle(feature) {\r\n if (feature.get('Fire') < 55) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fef0d9' // yellow \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n else if (feature.get('Fire') < 110) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fdcc8a' // light orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Fire') < 165) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fc8d59' // orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Fire') < 220) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#e34a33' // red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n // else if ...\r\n else {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#b30000' //dark red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n}", "function chooseColor(value) {\n switch (true) {\n case value > 90:\n return \"red\";\n case value > 69:\n return \"orangered\";\n case value > 49:\n return \"orange\";\n case value > 29:\n return \"yellow\";\n case value > 9:\n return \"yellowgreen\";\n default:\n return \"green\";\n }\n}", "function style(feature) {\n\t if (feature.properties.ELEV != \"\" && feature.properties.ELEV != \"<Null>\" && feature.properties.ELEV != null) {\n\t /* if (feature.properties.ELEV == \"1000\") {\n\t return {\n\t color: \"green\",\n\t weight: 4,\n\t opacity: 0.9\n\t }\n\t } else if (feature.properties.ELEV == \"2000\") {\n\t return {\n\t color: \"blue\",\n\t weight: 4,\n\t opacity: 0.9\n\t }\n\n\t } else {\n\t return {\n\t color: \"red\",\n\t weight: 2,\n\t opacity: 0.9\n\t }\n\t }\n\t */\n\t } else {\n\t return {\n\t color: \"magenta\",\n\t weight: x.lwd,\n\t opacity: x.opacity\n\t }\n\t }\n\t }", "function updateMap() {\n // Make a Turf collection for analysis\n collection = turf.featurecollection(counties.features);\n\n // Basic UI for select Jenks or Quantile classification\n if (type == \"jenks\") {\n breaks = turf.jenks(collection, \"pop_density\", 8);\n } else {\n breaks = turf.quantile(collection, \"pop_density\", [25, 50, 75, 99]);\n }\n // Get the color when adding to the map\n var layer = L.geoJson(counties, { style: getStyle })\n layer.addTo(map);\n // Fit to map to counties and set the legend\n map.fitBounds(layer.getBounds());\n updateLegend();\n \n function getStyle(feature) {\n var pop = feature.properties.POP;\n var pop_density = feature.properties.pop_density;\n return {\n fillColor: getColor(pop_density),\n fillOpacity: 0.7,\n weight: 1,\n opacity: 0.2,\n color: 'black'\n }\n }\n \n function updateLegend() {\n $(\".breaks\").html();\n for(var i = 0; i < breaks.length; i++) {\n var density = Math.round(breaks[i] * 100) / 100;\n var background = scale(i / (breaks.length));\n $(\".breaks\").append(\"<p><div class='icon' style='background: \" + background + \"'></div><span> \" + density + \" <span class='sub'>pop / mi<sup>2</sup></span></span></p>\");\n }\n }\n}", "function init(){\n var lon = 5;\n var lat = 15;\n var zoom = 2;\n\n var context = {\n getColour: function(feature) {\n return feature.attributes[\"colour\"];\n }\n };\n\n var template = {\n\t\tfillOpacity: 0.9,\n strokeColor: \"#555555\",\n strokeWidth: 0,\n\t\tstrokeOpacity : 0,\n fillColor: \"${getColour}\"\n\t};\n\t\n\tvar templateFondCarte = {\n\t\tstrokeColor: \"#333333\",\n\t\tstrokeWidth: 1,\n\t\tfillOpacity: 0\n\t};\n\t\n\n style = new OpenLayers.Style(template, {context: context});\n\tstyleFondCarte = new OpenLayers.Style(templateFondCarte);\n styleMap = new OpenLayers.StyleMap({'default': style});\n\tstyleMapFondCarte = new OpenLayers.StyleMap({'default': styleFondCarte});\n\tvar options = {\n numZoomLevels: 5,\n controls: [] // Remove all controls\n };\n\n // Create a new map with options defined above\n map = new OpenLayers.Map( 'olmap', options );\n\n // Create polygon layer as vector features\n // http://dev.openlayers.org/docs/files/OpenLayers/Layer/Vector-js.html\n fondCarte = new OpenLayers.Layer.GML( \"Fond de Carte\", \"data/fond_carte.json\", //\"data/choropleth.json\",\n { format: OpenLayers.Format.GeoJSON,\n styleMap: styleMapFondCarte,\n isBaseLayer: true,\n projection: new OpenLayers.Projection(\"EPSG:4326\"),\n attribution: \"ADN Techno\" } );\n map.addLayer(fondCarte);\n map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);\n\n // Add map controls: http://dev.openlayers.org/docs/files/OpenLayers/Control-js.html\n map.addControl(new OpenLayers.Control.LayerSwitcher());\n map.addControl(new OpenLayers.Control.MousePosition());\n map.addControl(new OpenLayers.Control.MouseDefaults());\n map.addControl(new OpenLayers.Control.PanZoomBar());\n\t\n\t// Bind l'évènement de changement de dataLayer\n\t$('#var').change(function() {\n\t\tvar selVar = $('#selVar').val();\n\t\tif (selVar == '-1') {map.removeLayer('dataLayer'); return true;}\n\t\tloadLayer(selVar);\n\t});\n}", "function googlemap() {\n \n // Custom Map Skin\n var customstyle = [{\n \"featureType\": \"all\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#1F2041\"\n }]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#2E4057\"\n }, {\n \"lightness\": -20\n }]\n }, {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#1F2041\"\n }]\n }, {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"color\": \"#1F2041\"\n }, {\n \"lightness\": 5\n }]\n }, {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#E0D3DE\"\n }]\n }, {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"administrative\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }, {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#782347\"\n }, {\n \"visibility\": \"on\"\n }]\n }, {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#782347\"\n }, {\n \"visibility\": \"on\"\n }]\n }, {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#782347\"\n }, {\n \"visibility\": \"on\"\n }]\n }, {\n \"featureType\": \"administrative.neighborhood\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#782347\"\n }, {\n \"visibility\": \"on\"\n }]\n }, {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n }];\n \n // Coordinates\n var latlng = new google.maps.LatLng(settings.latitute, settings.longitude);\n \n // Map Options\n var myMapOptions = {\n zoom: settings.zoom,\n scrollwheel: false,\n disableDefaultUI: true,\n mapTypeControl: settings.maptypecntrl,\n zoomControl: settings.zoomcntrl,\n zoomControlOptions: {\n style: google.maps.ZoomControlStyle.MEDIUM,\n position: google.maps.ControlPosition.LEFT_TOP\n },\n center: latlng\n };\n \n // Map Selector\n var map = new google.maps.Map(document.getElementById(settings.container), myMapOptions);\n\n // Activate Custom Map Skin If It Is Enabled\n if (settings.dvcustom === true) {\n var mapType = new google.maps.StyledMapType(customstyle);\n map.mapTypes.set('custommap', mapType);\n map.setMapTypeId('custommap');\n }\n\n // Define The Custom Map Marker\n var marker = new MarkerWithLabel({\n position: latlng,\n icon: {\n path: google.maps.SymbolPath.CIRCLE,\n scale: 0,\n },\n map: map,\n draggable: false,\n labelAnchor: new google.maps.Point(latlng),\n labelClass: \"isg-pin\", // the CSS class for the label\n });\n\n // Add Custom Map Marker\n map.addListener('idle', function () {\n if (!selector.find(\".isg-pin > div\").hasClass(\"isg-pulse\")) {\n jQuery(\".isg-pin\", selector).append(\"<div class='isg-pulse'></div>\");\n }\n });\n }", "function bioLegendStyle(feature) {\r\n if (feature.get('Biological') < 3) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fef0d9' // yellow \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n else if (feature.get('Biological') < 6) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fdcc8a' // light orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Biological') < 9) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fc8d59' // orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Biological') < 12) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#e34a33' // red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n // else if ...\r\n else {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#b30000' //dark red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n}", "function drawMap (selectedIndustry){\n console.log(\"industry map\");\n console.log(selectedIndustry);\n\n //1) color based on selection\n svg.selectAll(\".counties\")\n .style(\"fill\", function(){return industryColor(selectedIndustry)});\n //data based on selection\n\n if (selectedIndustry==\"ind2\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind2\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n\n if (selectedIndustry==\"ind3\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind3\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n if (selectedIndustry==\"ind4\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind4\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n\n if (selectedIndustry==\"ind5\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind5\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n if (selectedIndustry==\"ind6\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind6\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n\n if (selectedIndustry==\"ind7\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind7\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n if (selectedIndustry==\"ind8\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind8\n if (value) {\n return colorIntensity(value);\n } else {return colorIntensity(0);\n \n }\n console.log(value);\n });//End of fill opacity command\n };\n\n if (selectedIndustry==\"ind9\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind9\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n if (selectedIndustry==\"ind10\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind10\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n\n if (selectedIndustry==\"ind11\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind11\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n if (selectedIndustry==\"ind12\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind12\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n\n if (selectedIndustry==\"ind13\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind13\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n if (selectedIndustry==\"ind14\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.ind14\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n\n if (selectedIndustry==\"unemp\"){\n svg.selectAll(\".counties\")\n .style(\"fill-opacity\", function(d){ \n var value = d.properties.unemp\n if (value) {\n return colorIntensity(value);\n } else {\n return colorIntensity(0);\n }\n console.log(value);\n });//End of fill opacity command\n };\n\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: {\n lat: 19.0276,\n lng: 72.8662\n },\n zoom: 12,\n styles: [{\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#523735\"\n }]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#c9b2a6\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#dcd2be\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#ae9e90\"\n }]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#93817c\"\n }]\n },\n {\n \"featureType\": \"poi.business\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#a5b076\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#447530\"\n }]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#fdfcf8\"\n }]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f8c967\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#e9bc62\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#e98d58\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#db8555\"\n }]\n },\n {\n \"featureType\": \"road.local\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#806b63\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#8f7d77\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#b9d3c2\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#92998d\"\n }]\n }\n ]\n });\n // Instead of using multiple infowindows we can just use one since it is unncessary in this situation.\n infowindow = new google.maps.InfoWindow();\n ko.applyBindings(viewModel);\n}", "function changeColor(tmp_stage,tmp_arr){\n tmp_arr.forEach(function (item) {\n tmp_stage.find(\"#\" + item[0]).fill(DICT_COLORS[item[1]]);\n tmp_stage.find(\"#main_l\").draw();\n });\n}", "function getColor(d) {\n // return d > 50000 ? '#FF0000' :\n // d > 25000 ? '#FF3300' :\n // d > 20000 ? '#ff6600' :\n // d > 10000 ? '#ff9900' :\n // d > 8000 ? '#FFCC00' :\n // d > 5000 ? '#7FFF00' :\n // d > 2500 ? '#ccff00' :\n // d > 1000 ? '#99ff00' :\n // d > 500 ? '#66ff00' :\n // // '#33ff00'; // put countries that don't appear as white\n // '#FFFFFF'; // put countries that don't appear as white\n return d > 50000 ? '#66ff00' :\n d > 25000 ? '#99ff00' :\n d > 20000 ? '#ccff00' :\n d > 10000 ? '#7FFF00' :\n d > 8000 ? '#FFCC00' :\n d > 5000 ? '#ff9900' :\n d > 2500 ? '#ff6600' :\n d > 1000 ? '#FF3300' :\n d > 500 ? '#FF0000' :\n // '#33ff00'; // put countries that don't appear as white\n '#FFFFFF'; // put countries that don't appear as white\n\n }", "function markerColor(b){\n let color = b ? \"#FC7143\" : \"#fc4353\";\n return color;\n}", "function style(feature) {\n\t if (feature.properties.ELEV != \"\" && feature.properties.ELEV != \"<Null>\" && feature.properties.ELEV != null) {\n\t /* if (feature.properties.ELEV == \"1000\") {\n\t return {\n\t color: \"green\",\n\t weight: 4,\n\t opacity: 0.9\n\t }\n\t } else if (feature.properties.ELEV == \"2000\") {\n\t return {\n\t color: \"blue\",\n\t weight: 4,\n\t opacity: 0.9\n\t }\n\n\t } else {\n\t return {\n\t color: \"red\",\n\t weight: 2,\n\t opacity: 0.9\n\t }\n\t }\n\t */\n\t } else {\n\t return {\n\t color: color,\n\t weight: lnWidth,\n\t opacity: opacity\n\t }\n\t }\n\t }", "updateLayer(allValues) {\n let circleColor = getMapBoxCaseColors(\n cm.getCaseColorPositive(0.01).setAlpha(0.05),\n cm.getCaseColorPositive(1.0),\n cm.getCaseColorPositive(0),\n cm.getCaseColorMax(),\n cm.getCaseColorNegative(0.01).setAlpha(0.05),\n cm.getCaseColorNegative(1.0),\n allValues, [0.0, 0.25, 0.75, 0.90, 0.95], 1\n );\n\n console.log(JSON.stringify(circleColor));\n\n this.map.setPaintProperty(\n this.uniqueId + 'fillpoly', 'fill-color', [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 13.0, circleColor,\n 15.0, \"rgba(0, 0, 0, 0)\"\n ]\n );\n\n this.__shown = true;\n }", "get_place_color(d, colorscale) {\n //Get data value\n if (d.munip_votes) {\n var value = d.munip_votes;\n }\n else {\n var value = 0;\n }\n if (value ) {\n //If value exists…\n if(value == -1){\n return '#B7E1F3';\n }\n else{\n return this.colorscale(value/26);\n }\n\n } else {\n //If value is undefined…\n return \"#99999F\";\n }\n }", "function color(d) \n{\n return d.name === \"Home\" ? LEVEL_1_COLOR : d.children ? LEVEL_2_COLOR : LEVEL_3_COLOR;\n}", "function createGeojsonOverlay(data, overlay, outlineColor)\n{\n L.geoJson(data, \n {\n // Style each feature \n style: function(feature) \n {\n if (feature.properties.STATE != \"27\")\n {\n console.log(feature);\n return {\n color: \"clear\",\n fillOpacity: 0.0,\n weight: 1.0\n };\n }\n else return {\n color: outlineColor,\n fillOpacity: 0.0,\n weight: 1.0\n };\n }\n }).addTo(overlay);\n}", "function myStyleLines(feature) {\n switch (feature.properties.agency) {\n case 0:\n return {\n color: \"#fdfe00\",\n weight: 3,\n opacity: 1\n };\n break;\n case 1:\n return {\n color: \"#54ff01\",\n weight: 3,\n opacity: 1\n };\n break;\n case 2:\n return {\n color: \"#005de8\",\n weight: 3,\n opacity: 1\n };\n break;\n case 3:\n return {\n color: \"#8600ac\",\n weight: 3,\n opacity: 1\n };\n break;\n }\n}", "function controlLayers(map){\n var overlayMaps = {\n \"Population\": newLayer\n };\n//toggle population points on and off\n L.control.layers(null, overlayMaps).addTo(map);\n}", "function colores(color){\r\n\tif(color===\"rojo\"){\r\n\t\treturn \tfill(255, 0, 0);\r\n\t}\r\n\telse if(color === \"azul\"){\r\n\t\treturn \tfill(0, 0, 255);\r\n\t}else if(color===\"verde\"){\r\n\t\treturn \tfill(0, 255, 0);\r\n\t}\r\n\telse if(color===\"morado\"){\r\n\t\treturn \tfill(90, 25, 100);\r\n\t}\r\n}" ]
[ "0.64145184", "0.6322334", "0.62599945", "0.6129551", "0.60858077", "0.6075484", "0.6028389", "0.60264945", "0.60257953", "0.59919906", "0.59911585", "0.59821683", "0.59800786", "0.5961653", "0.5956643", "0.5930514", "0.5917089", "0.58963925", "0.5892792", "0.5885355", "0.58812684", "0.5874056", "0.58606553", "0.58478606", "0.5797778", "0.5797687", "0.5793673", "0.57866025", "0.5786193", "0.5782504", "0.57788473", "0.5769221", "0.57558143", "0.5748982", "0.5745291", "0.57394975", "0.57296574", "0.5725419", "0.57174504", "0.5717051", "0.5700523", "0.56910956", "0.5669946", "0.5664723", "0.56574774", "0.5645101", "0.56425166", "0.56286716", "0.56279945", "0.562774", "0.56268173", "0.5625811", "0.56216305", "0.562154", "0.56154007", "0.56071514", "0.55983067", "0.5585743", "0.55849767", "0.55734736", "0.55617243", "0.55428773", "0.5539459", "0.5535293", "0.55321103", "0.55321103", "0.55301344", "0.55260897", "0.55241096", "0.5523292", "0.5515483", "0.5513635", "0.55011", "0.54997927", "0.54981947", "0.5494354", "0.54889286", "0.54880255", "0.5486815", "0.54825824", "0.54824793", "0.54807156", "0.54795027", "0.54761815", "0.547467", "0.54746217", "0.5474317", "0.5472538", "0.5472205", "0.5470707", "0.54673076", "0.5466725", "0.54665256", "0.5466464", "0.54633534", "0.54582864", "0.545698", "0.545687", "0.54511285", "0.5447422", "0.5444393" ]
0.0
-1
Areas Under GCQ and ECQ
function highlightFeature_GCQ(e) { var layer = e.target; layer.setStyle({ weight: 1.0, color: 'black', fillOpacity: 0.1 }); if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { layer.bringToFront(); } info.update(layer.feature.properties); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_$getArea() {\n return null;\n }", "function getAreas() {\n\tlet scalingFactor = Math.min(clientWidth / 1200, clientHeight / 1000);\n\t// Change the blocks' size according to the input surface area\n\tlet size1 = Math.min(48, 5 + Math.sqrt(area1) * scalingFactor * 8) + \"px\";\n\tlet size2 = Math.min(48, 5 + Math.sqrt(area2) * scalingFactor * 8) + \"px\";\n\t$(\".sit1block\").css({\n\t\theight: size1,\n\t\twidth: size1,\n\t\tbottom: \"51%\"\n\t});\n\n\t$(\".sit2block\").css({\n\t\theight: size2,\n\t\twidth: size2,\n\t\tbottom: \"51%\"\n\t});\n\t\n}", "function addSurveyedAreas(){\n\tareaMap.forEach(function(key, value, map){\n\t\tdrawArea(key).addTo(mymap);\n\t});\n}", "constructor(area) {\n this.area = area\n }", "function Area() {\n}", "function Area(name, desc, E, W, S, N)\n{\n this.name = name;\n this.desc = desc;\n this.E = E;\n this.W = W;\n this.S = S;\n this.N = N;\n \n}", "function addGuideAreas(dataArray){\n JL(\"mylogger\").info(\"--------visualizeData()--------\");\n let scene = document.querySelector('a-scene');\n\n dataArray.forEach((place) => {\n let latitude = place.lat;\n let longitude = place.lon;\n\n // add geometry for guide area\n let icon = document.createElement('a-torus');\n\t\ticon.setAttribute('position', '0 -5 0');\n\t\ticon.setAttribute('gps-entity-place', `latitude: ` + latitude + `; longitude: `+ longitude + `;`);\n icon.setAttribute('name', place.name);\n icon.setAttribute('color', place.color);\n icon.setAttribute('rotation', '-90 0 0');\n icon.setAttribute('radius', '1');\n icon.setAttribute('radius-tubular', '0.05');\n\t\ticon.setAttribute('material', 'opacity: 0.6');\n\n // for debug purposes, just show in a bigger scale, otherwise I have to personally go on places...\n icon.setAttribute('scale', '5 5 5');\n\n icon.addEventListener('loaded', () => window.dispatchEvent(new CustomEvent('gps-entity-place-loaded')));\n scene.appendChild(icon);\n });\n}", "function avoidAreasError(errorous) {\n\t\t\tui.showAvoidAreasError(errorous);\n\t\t}", "placesWithinArea(area) {\n let results = turf.collect(area, this.fbData,\n 'typeNum', 'placeTypes')\n return results\n }", "constructor() {\n /**\n * These are the bounds for the service areas so we can try to obtain more precise geocoding on addresses\n */\n this.AREAS = [ /* eslint no-multi-spaces: off */\n {id: 'TEST', bounds: {sw: {lat: 59.65330271, lng: -151.8705092}, ne: {lat: 61.25310536, lng: -149.8731469}}},\n {id: 'APFSA', bounds: {sw: {lat: 59.70365140, lng: -151.8705092}, ne: {lat: 59.95370723, lng: -151.5705850}}},\n {id: 'CES', bounds: {sw: {lat: 60.21213251, lng: -151.4253571}, ne: {lat: 60.81998024, lng: -149.8731469}}},\n {id: 'KESA', bounds: {sw: {lat: 59.65330271, lng: -151.7881408}, ne: {lat: 59.93944592, lng: -150.8635843}}},\n {id: 'KFD', bounds: {sw: {lat: 60.51649993, lng: -151.3357507}, ne: {lat: 60.60361148, lng: -151.0731701}}},\n {id: 'NFSA', bounds: {sw: {lat: 60.58171538, lng: -151.4264242}, ne: {lat: 61.25310536, lng: -150.0042887}}},\n ];\n }", "static area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n }", "function initMapAreas()/*:void*/ {var this$=this;\n var currentIdSuffixes/*:Array*/ = [];\n\n this.structValueExpression$AoGC.loadValue(function (struct/*:StructRemoteBeanImpl*/)/*:void*/ {\n if (struct) {\n struct.removeValueChangeListener(AS3.bind(this$,\"imageMapChangeHandler$AoGC\"));\n struct.addValueChangeListener(AS3.bind(this$,\"imageMapChangeHandler$AoGC\"));\n }\n\n struct.load(function()/*:void*/ {\n //noinspection JSMismatchedCollectionQueryUpdate\n var imageMapAreas/*:Array*/ = struct.get(com.coremedia.cms.studio.im.ImageMapEditorConstants.IMAGEMAP_STRUCT_NAME);\n if (imageMapAreas) {\n imageMapAreas.forEach(function (areaStruct/*:Struct*/)/*:void*/ {\n this$.canvasMgr$AoGC.addArea(areaStruct.toObject ? areaStruct.toObject() : areaStruct);\n currentIdSuffixes.push(parseInt(areaStruct.get(com.coremedia.cms.studio.im.ImageMapEditorConstants.AREA_ID).split(com.coremedia.cms.studio.im.ImageMapEditorConstants.AREA_ID_PREFIX)[1]));\n });\n }\n // Use re-route via .apply() to pass currentIdSuffixes array as 'arguments' array for .max()\n this$.areaIdSuffixCounter$AoGC = currentIdSuffixes.length > 0 ? Math.max.apply(null, currentIdSuffixes) + 1 : 0;\n });\n });\n\n // init with no selection\n this.canvasMgr$AoGC.clearSelection();\n }", "function enterArea(location){\n area(location, \"encounter\");\n}", "function add_bounding_area(uid, a,b,c,d) {\n var group=addAreaLayerGroup(a,b,c,d);\n var tmp={\"uid\":uid,\"latlngs\":[{\"lat\":a,\"lon\":b},{\"lat\":c,\"lon\":d}]};\n ucvm_area_list.push(tmp);\n load_a_layergroup(uid, AREA_ENUM, group, EYE_NORMAL);\n}", "removeRegionsInArea(area) {\n area.normalize();\n // this is temporary solution. There will be previews\n for (var i = this.imageInfo.regions.length - 1; i >= 0; i--) {\n var region = this.imageInfo.regions[i];\n if (region.source === RegionInfoSourceEnum.MANUAL) {\n var intersected = region.checkIntersectionRegion(this.selectionRegionInfo);\n if (intersected) {\n this.imageInfo.regions.splice(i, 1);\n }\n }\n }\n }", "function request_all_areas(){\n\tvar cmd_data = { \"cmd\":\"get_areas\"};\n\tcon.send(JSON.stringify(cmd_data));\n\tg_areas=[];\n}", "getArea() {\n return this.transform.getGraphArea();\n }", "function area(p1, p2) {\n const colliding = {};\n const overlapping = {};\n\n return {\n id: \"area\",\n\n area: {\n p1: p1,\n p2: p2,\n },\n\n areaWidth() {\n const { p1, p2 } = this._worldArea();\n return p2.x - p1.x;\n },\n\n areaHeight() {\n const { p1, p2 } = this._worldArea();\n return p2.y - p1.y;\n },\n\n isClicked() {\n return app.mouseClicked() && this.isHovered();\n },\n\n isHovered() {\n if (app.isTouch) {\n return app.mouseDown() && this.hasPt(mousePos(this.layer));\n } else {\n return this.hasPt(mousePos(this.layer));\n }\n },\n\n isCollided(other) {\n if (!other.area) {\n return false;\n }\n\n if (!isSameLayer(this, other)) {\n return false;\n }\n\n const a1 = this._worldArea();\n const a2 = other._worldArea();\n\n return colRectRect(a1, a2);\n },\n\n isOverlapped(other) {\n if (!other.area) {\n return false;\n }\n\n if (!isSameLayer(this, other)) {\n return false;\n }\n\n const a1 = this._worldArea();\n const a2 = other._worldArea();\n\n return overlapRectRect(a1, a2);\n },\n\n clicks(f) {\n this.action(() => {\n if (this.isClicked()) {\n f();\n }\n });\n },\n\n hovers(f) {\n this.action(() => {\n if (this.isHovered()) {\n f();\n }\n });\n },\n\n collides(tag, f) {\n this.action(() => {\n this._checkCollisions(tag, f);\n });\n },\n\n overlaps(tag, f) {\n this.action(() => {\n this._checkOverlaps(tag, f);\n });\n },\n\n hasPt(pt) {\n const a = this._worldArea();\n return colRectPt(\n {\n p1: a.p1,\n p2: a.p2,\n },\n pt\n );\n },\n\n // TODO: make overlap events still trigger\n // push an obj out of another if they're overlapped\n pushOut(obj) {\n if (obj === this) {\n return null;\n }\n\n if (!obj.area) {\n return null;\n }\n\n if (!isSameLayer(this, obj)) {\n return null;\n }\n\n const a1 = this._worldArea();\n const a2 = obj._worldArea();\n\n if (!colRectRect(a1, a2)) {\n return null;\n }\n\n const disLeft = a1.p2.x - a2.p1.x;\n const disRight = a2.p2.x - a1.p1.x;\n const disTop = a1.p2.y - a2.p1.y;\n const disBottom = a2.p2.y - a1.p1.y;\n const min = Math.min(disLeft, disRight, disTop, disBottom);\n\n // eslint-disable-next-line default-case\n switch (min) {\n case disLeft:\n this.pos.x -= disLeft;\n return {\n obj: obj,\n side: \"right\",\n dis: -disLeft,\n };\n case disRight:\n this.pos.x += disRight;\n return {\n obj: obj,\n side: \"left\",\n dis: disRight,\n };\n case disTop:\n this.pos.y -= disTop;\n return {\n obj: obj,\n side: \"bottom\",\n dis: -disTop,\n };\n case disBottom:\n this.pos.y += disBottom;\n return {\n obj: obj,\n side: \"top\",\n dis: disBottom,\n };\n }\n\n return null;\n },\n\n // push object out of other solid objects\n pushOutAll() {\n return every((other) =>\n other.solid ? this.pushOut(other) : null\n ).filter((res) => res != null);\n },\n\n _checkCollisions(tag, f) {\n every(tag, (obj) => {\n if (this === obj) {\n return;\n }\n if (colliding[obj._id]) {\n return;\n }\n if (this.isCollided(obj)) {\n f(obj);\n colliding[obj._id] = obj;\n }\n });\n\n for (const id in colliding) {\n const obj = colliding[id];\n if (!this.isCollided(obj)) {\n delete colliding[id];\n }\n }\n },\n\n // TODO: repetitive with collides\n _checkOverlaps(tag, f) {\n every(tag, (obj) => {\n if (this === obj) {\n return;\n }\n if (overlapping[obj._id]) {\n return;\n }\n if (this.isOverlapped(obj)) {\n f(obj);\n overlapping[obj._id] = obj;\n }\n });\n\n for (const id in overlapping) {\n const obj = overlapping[id];\n if (!this.isOverlapped(obj)) {\n delete overlapping[id];\n }\n }\n },\n\n // TODO: cache\n // TODO: use matrix mult for more accuracy and rotation?\n _worldArea() {\n const a = this.area;\n const pos = this.pos || vec2(0);\n const scale = this.scale || vec2(1);\n const p1 = pos.add(a.p1.scale(scale));\n const p2 = pos.add(a.p2.scale(scale));\n\n const area = {\n p1: vec2(Math.min(p1.x, p2.x), Math.min(p1.y, p2.y)),\n p2: vec2(Math.max(p1.x, p2.x), Math.max(p1.y, p2.y)),\n };\n\n return area;\n },\n };\n }", "get area() {\n return __classPrivateFieldGet(this, _ancho) * this.alto;\n }", "function drawAreas(data) {\n allAreas = data.object;\n if (allAreas.length == 1) {\n // todo ???\n }\n else {\n for (var i = 0; i < allAreas.length; i++) {\n var id = allAreas[i].ID;\n if (id == \"universe\" || id == \"University\") {\n // don't do anything --> University isn't been drawn\n }\n else {\n var x = allAreas[i].topLeftX;\n var y = allAreas[i].topLeftY;\n var width = allAreas[i].width;\n var height = allAreas[i].height;\n\n\n var div = document.getElementById(\"map_png_div\");\n var clickedArea = \"\";\n clickedArea += '<div id=\"' + id + '\" onClick=\"clickOnArea(' + id + ')\" style=\" cursor:pointer; background-color: #990099; border: 2px solid black; opacity: .5; filter: alpha(opacity=50); position:absolute; margin-top:' + (+y + +2) + 'px; margin-left: ' + (+x + +2) + 'px; width: ' + (+width - +4) + 'px; height: ' + (+height - +4) + 'px;\"></div>';\n div.innerHTML = div.innerHTML + clickedArea;\t//#C2DFFF\n }\n } // for end\n }\n}", "getArea() {\n\t\tconst from = {\n\t\t\tx: this.parcelMap['A'].lat,\n\t\t\ty: this.parcelMap['A'].lon,\n\t\t}\n\n\t\tconst to = {\n\t\t\tx: this.parcelMap['I'].lat + 1,\n\t\t\ty: this.parcelMap['I'].lon + 1,\n\t\t}\n\t\treturn [new Point(from.x, from.y), new Point(to.x, to.y)]\n\t}", "get bounds() {}", "function getAreasMapped(buildingTitle){\n return areasMapped;\n}", "function camAreaEvent(label, code)\n{\n\tvar eventName = \"eventArea\" + label;\n\tcamMarkTiles(label);\n\t__camPreHookEvent(eventName, function(droid)\n\t{\n\t\tif (camDef(droid))\n\t\t{\n\t\t\tcamTrace(\"Player\", droid.player, \"enters\", label);\n\t\t}\n\t\tcamUnmarkTiles(label);\n\t\tcode(droid);\n\t});\n}", "function area(p, q, r) {\n\t return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n\t}", "function area(p, q, r) {\n\t return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n\t}", "function area(p, q, r) {\n\t return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n\t}", "function area(p, q, r) {\n\t return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n\t}", "function area(p, q, r) {\n\t return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n\t}", "viewAllAreas (baseUrl,username,spacename){\n browser.get(baseUrl + username + \"/\" + spacename +\"/areas\");\n }", "get area() {\n return this._width * this._height;\n }", "get area() {\n return this.width * this.height\n }", "function ce(a){this.ga=a;this.Ja=null;this.se=new de(a,!0,!0);this.Re=new de(a,!1,!0);this.ge=L(\"rect\",{height:Q,width:Q,style:\"fill: #fff\"},null);ee(this.ge,a.Xd)}", "function isComplete(area) {\n\tif (area.expert === undefined) area.expert = 0;\n\tif (area.advanced === undefined) area.advanced = 0;\n\tif (area.yearlySnowfall === undefined ) area.yearlySnowfall = 0;\n\treturn ( area.state && area.vertical && area.skiableAcres );\n}", "function area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}", "function area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}", "function area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}", "function area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}", "function area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}", "function area( p, q, r ) {\n\n\t\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n\t}", "function area( p, q, r ) {\n\n\t\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n\t}", "function area( p, q, r ) {\n\n\t\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n\t}", "function area( p, q, r ) {\n\n\t\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n\t}", "function ChangeArea(area)\n {\n // console.log(area);\n //TODO add var testing so unexpected strings don't make it through\n vm.castleArea = area;\n }", "_drawAreas() {\n let layout = this._chartLayout;\n\n // plot area\n this._setColor(\"#ffa500\");\n this._context.fillRect(\n layout.plotAreaRect.left + layout.canvasXOffset, layout.plotAreaRect.top + layout.canvasYOffset,\n layout.plotAreaRect.width, layout.plotAreaRect.height);\n\n // X-axis area\n this._setColor(\"#008000\");\n this._context.fillRect(\n layout.xAxisLayout.areaRect.left + layout.canvasXOffset, layout.xAxisLayout.areaRect.top + layout.canvasYOffset,\n layout.xAxisLayout.areaRect.width, layout.xAxisLayout.areaRect.height);\n\n // legend area\n this._setColor(\"#ff00ff\");\n this._context.fillRect(\n layout.legendAreaRect.left + layout.canvasXOffset, layout.legendAreaRect.top + layout.canvasYOffset,\n layout.legendAreaRect.width, layout.legendAreaRect.height);\n\n // Y-axis areas\n let n = 0;\n for (let yAxisRect of layout.yAxisAreaRects) {\n this._setColor(++n % 2 ? \"#0000ff\" : \"#00ffff\");\n this._context.fillRect(\n yAxisRect.left + layout.canvasXOffset, yAxisRect.top + layout.canvasYOffset,\n yAxisRect.width, yAxisRect.height);\n }\n }", "function e(e){switch(e){case\"above-along\":case\"below-along\":case\"center-along\":case\"esriServerLinePlacementAboveAlong\":case\"esriServerLinePlacementBelowAlong\":case\"esriServerLinePlacementCenterAlong\":return!0;default:return!1}}", "function area(p, q, r) {\n\n\treturn (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function setStateToAreas() {\n dos_target_area_ru.innerHTML = state.stateRU;\n dos_target_area_ua.innerHTML = state.stateUA;\n }", "function CB_AreaControl(params) {\r\n\tthis.TYPE = \"AREA_CONTROL\";\r\n\tthis.setting(params);\r\n\r\n}", "get area() {\n return this.calcArea();\n }", "function test2() {\n world.fillArea([2, 2, 3], [5, 5, 5], FILL_ADD);\n world.fillArea([3, 3, 6], [4, 4, 6], FILL_ADD);\n world.fillArea([2, 3, 3], [5, 4, 4], FILL_REMOVE);\n world.fillArea([3, 2, 3], [4, 5, 4], FILL_REMOVE);\n world.fillArea([2, 2, 4], [5, 5, 6], FILL_TOGGLE);\n }", "getBounds() {}", "function gv(){var t=this;ci()(this,{$geometry:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&uu()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$geometryContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.geometryContainer}}})}", "function getBoundaries(areaNameOrCode) {\n callOpenGeog(opengep1 + areaNameOrCode + opengep2);\n }", "area() {\n return 4 * (3.14) * (this.radius**2)\n }", "function showAreaOnMap()\n{\n fillPoly(areaIDData,pointArray);\n}", "function bounds() {\n return {\n start: conductor.displayStart(),\n end: conductor.displayEnd(),\n domain: conductor.domain().key\n };\n }", "function callback(response) \n {\n \n // get boundaries\n console.log( response.results[0] );\n console.log( \"got \" + response.results[0].attributes.CTYUA13NM);\n //console.log( response.results[0].attributes.CTYUA13NM );\n /// console.log( response.results[0].attributes.CTYUA13NM+\": \" + parseInt( response.results[0].attributes[\"Shape.STArea()\"],10)/1000000 );\n //capture area\n areaMeasures[response.results[0].attributes.CTYUA13NM] = parseInt(response.results[0].attributes[\"Shape.STArea()\"],10)/1000000;\n\n areaObj[response.results[0].attributes.CTYUA13NM].area = parseInt(response.results[0].attributes[\"Shape.STArea()\"],10)/1000000;\n\n\n if (response.results.length > 0) \n {\n // document.getElementById(\"foundward\").value = response.results[0].attributes.WD11NM;\n\n var ens = new Array();\n //alert(response.results[0].geometry.rings.length);\n for (var k = 0; k < response.results[0].geometry.rings.length; k++) {\n ens[k] = response.results[0].geometry.rings[k];\n }\n\n // approximate datum correction, good enough for this demo\n \n var latmeters = 50;\n var lonmeters = -100;\n\n var minlat = 360.0;\n var maxlat = -360.0;\n var minlon = 360.0;\n var maxlon = -360.0;\n\n // create array of points converted to lat/lon (from easting/northing) and capture mins and maxes\n for (var j = 0; j < ens.length; j++) {\n //alert('j = ' + j);\n latlons[j] = new Array();\n for (var i = 0; i < ens[j].length; i++) {\n var testpoint = ens[j][i];\n var grid = new OsGridRef(testpoint[0] + lonmeters, testpoint[1] + latmeters);\n var latlon = OsGridRef.osGridToLatLong(grid);\n if (latlon.lon < minlon) {\n minlon = latlon.lon;\n }\n if (latlon.lon > maxlon) {\n maxlon = latlon.lon;\n }\n if (latlon.lat < minlat) {\n minlat = latlon.lat;\n }\n if (latlon.lat > maxlat) {\n maxlat = latlon.lat;\n }\n latlons[j][i] = latlon;\n }\n }\n\n // calculate zoom level\n var zoomLevel = getZoom(minlon, maxlon, minlat, maxlat, 512, 512);\n\n // calculate centroid\n var centroid = getCentroid(minlon, maxlon, minlat, maxlat);\n //initialize(centroid.lat, centroid.lon, zoomLevel, latlons);\n drawArea(latlons, response.results[0].value);\n } else {\n alert(\"No matching ward found\");\n }\n }", "get area() {\n return this.height * this.width;\n }", "function testArea() {\n return scope1;\n}", "function isArea1(element) {\r\n\treturn element.xArea == \"1\";\r\n}", "show(){\n noFill();\n rect(this.boundary.x, this.boundary.y, this.boundary.w, this.boundary.h);\n if(this.isParent){\n this.northeast.show();\n this.northwest.show();\n this.southeast.show();\n this.southwest.show();\n }\n }", "_calculateBounds() {\n // FILL IN//\n }", "getRegionsInView()\n {\n var bottomLeftPos = this.screenToWorldPos(0, window.innerHeight);\n var bottomLeftRegion = WORLD.getRegionPositionFromWorldPosition(bottomLeftPos.x, bottomLeftPos.y);\n\n var xRegionMax = Math.floor(((bottomLeftRegion.x + window.innerWidth) / REGION_WIDTH) / this.zoom.x) + 2;\n var yRegionMax = Math.floor(((bottomLeftRegion.y + window.innerHeight) / REGION_HEIGHT) / this.zoom.y) + 2;\n\n var regionPosList = [];\n for(var x = bottomLeftRegion.x; x < bottomLeftRegion.x + xRegionMax; x++)\n {\n for(var y = bottomLeftRegion.y; y < bottomLeftRegion.y + yRegionMax; y++)\n {\n regionPosList.push({x:x, y:y});\n }\n }\n //console.log(count);\n return regionPosList;\n }", "get Area() { return this.Width * this.Height; }", "get Area() { return this.Width * this.Height; }", "function loadGuideAreas(dataArray) {\n addGuideAreas(dataArray);\n x.registerListener(function(val) {\n checkForGuideArea(dataArray,val);\n }, \"guide-areas\");\n if (x.currentPosition) {\n x.callListeners(x.currentPosition);\n }\n}", "calcolaArea() {\n\n return (this.base * this.altezza) / 2; \n }", "function getAreaPoints() {\n funcionPoints.map(function (point) {\n if (point.y > 0) {\n y_to = point.y > y_to ? point.y : y_to;\n } else {\n y_from = point.y < y_from ? point.y : y_from;\n }\n });\n\n areaPoints.push({ x: x_from, y: y_from });\n areaPoints.push({ x: x_to, y: y_from });\n areaPoints.push({ x: x_to, y: y_to });\n areaPoints.push({ x: x_from, y: y_to });\n areaPoints.push({ x: x_from, y: y_from });\n }", "function addAreas(){\n //draws the areas\n areaMap.forEach(function(item, key, mapObj){\n polyArea = drawArea(item);\n polyArea.addTo(areaLayer);\n })\n}", "calcArea(){\n return this._width * this._height;\n }", "setFilterArea(area){\n this.set('filterCriteriaArea', area);\n this.send('filterObjectives');\n }", "function selectArea() {\n\n\t// ordered by min_score ascending\n\tvar sortValues = [];\n\tsortValues.push( {\n\t\tfieldName : 'waste_areas.site_id',\n\t\tsortOrder : 1\n\t});\n\tsortValues.push( {\n\t\tfieldName : 'waste_areas.area_type',\n\t\tsortOrder : 2\n\t});\n\tsortValues.push( {\n\t\tfieldName : 'waste_areas.storage_location',\n\t\tsortOrder : 3\n\t});\n\tView.selectValue({\n\t\tformId: 'abWasteTrackGenWasteForm',\n\t\ttitle: getMessage(\"areaTitle\"),\n\t\tfieldNames: [ 'waste_out.storage_location','waste_out.site_id' ],\n\t\tselectTableName: 'waste_areas',\n\t\tselectFieldNames: ['waste_areas.storage_location', 'waste_areas.site_id' ],\n\t\tvisibleFields: [\n\t\t {fieldName: 'waste_areas.storage_location', title: getMessage('areaTitle')},\n\t\t {fieldName: 'waste_areas.area_type'},\n\t\t {fieldName: 'waste_areas.site_id' }\n\t\t ],\n\t\t showIndex: false,\n\t\t selectValueType: 'grid',\n\t\t sortValues: toJSON(sortValues)\n\t});\n}", "loadAreas() {\n var that = this;\n\n base('Areas').select({\n view: \"Main View\",\n sort: [{field: \"Name\", direction: \"asc\"}]\n }).eachPage(function page(records, fetchNextPage) {\n records.forEach(function(record) {\n if (record.get('Name')) {\n\n // // DEBUG\n // console.log( record.getId(), record.get('Name') );\n\n // that.data.areas[record.getId()] = {\n // id: record.getId(),\n // name: record.get('Name'),\n // ownersId: record.get('Owners'),\n // communitiesId: record.get('Communities'),\n // countMembers: record.get('CountMembers')\n // };\n\n that.data.areas.push({\n id: record.getId(),\n name: record.get('Name'),\n ownersId: record.get('Owners'),\n communitiesId: record.get('Communities'),\n countMembers: record.get('CountMembers')\n });\n\n }\n });\n fetchNextPage();\n\n }, function done(error) {\n\n that.data.loaded.areas = true;\n\n // Possible only once the areas have been loaded so we get their names\n that.onAreaIsSet();\n\n if (error) {\n that.throwError(error);\n }\n });\n }", "constructor(viewOf, qmin, qmax) {\n super(viewOf, (field, colLabel, colSchema, colData, df) =>\n _clipAnnoMatrix(field, colLabel, colSchema, colData, df, qmin, qmax)\n );\n this.isClipped = true;\n this.clipRange = [qmin, qmax];\n Object.seal(this);\n }", "get area() {\n return this.calcArea();\n }", "function A_(areaDescrs, forceEvaluation) {\n if (areaDescrs === undefined) {\n gDebugObjMgr.drawFrame(false);\n return [];\n }\n\n if (forceEvaluation === undefined) {\n forceEvaluation = globalTaskQueue.pendingTasks.isEmpty();\n if (!forceEvaluation) {\n console.warn(\"not forcing evaluation of inactive expressions\");\n }\n }\n\n resetDebugObjCache();\n gDebugObjMgr.init();\n\n if (gDebugObjMgr.constraints.violationMessageList.length > 0) {\n console.groupCollapsed('%c%d constraint violations',\n 'font-weight: 500;',\n gDebugObjMgr.constraints.violationMessageList.length);\n for (var i = 0; i < gDebugObjMgr.constraints.violationMessageList.length; i++) {\n console.log(gDebugObjMgr.constraints.violationMessageList[i]);\n }\n console.groupEnd();\n }\n\n function getAndHighlightArea(areaId, highlight) {\n\n if (areaId === \"p1\") {\n var pDescr = shallowCopy(gDomEvent.pointerObj);\n pDescr.constraints = gDebugObjMgr.constraints.getConstraintOfArea(\"p1\");\n return pDescr;\n }\n\n var area = allAreaMonitor.getAreaById(areaId);\n if (!area) {\n if (areaId) {\n mMessage(\"no such area: '\" + areaId + \"'\");\n }\n return undefined;\n }\n\n var debugObjArea = gDebugObjMgr.getArea(areaId, forceEvaluation);\n if (highlight) {\n var itsPos = debugObjAbsAreaPosition(area);\n gDebugObjMgr.drawFrame(true, areaId, debugObjArea.classes, itsPos);\n }\n return debugObjArea;\n }\n\n var cdlInterpreted = false;\n\n if (!(areaDescrs instanceof Array)) {\n areaDescrs = [areaDescrs];\n }\n else if (!areaDescrs.every(function(d) {\n return typeof(d) === \"string\" || typeof(d) === \"number\";\n })) {\n areaDescrs = ensureOS(I(areaDescrs));\n cdlInterpreted = true;\n }\n var res = [];\n for (var i = 0; i < areaDescrs.length; i++) {\n var areaDescr = areaDescrs[i];\n switch (typeof(areaDescr)) {\n case \"string\":\n var areaId = undefined;\n if (areaDescr.match(/^@[0-9]+:[0-9]+$/)) {\n res.push(getAndHighlightArea(areaDescr.slice(1), false));\n } else if (!cdlInterpreted && areaDescr.match(/^[0-9]+:[0-9]+$/)) {\n res.push(getAndHighlightArea(areaDescr, true));\n } else if (areaDescr === \"p1\") {\n res.push(getAndHighlightArea(areaDescr, true));\n }\n break;\n }\n }\n return res.length === 0? undefined: res.length === 1? res[0]: res;\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}", "function loadAreas() {\n send(new Arrival(\"area_read\", session, new Area(), true), writeAreas);\n}", "function evaluateOsteophyte(border){\n return area(border);\n}", "function test_service_catalog_orchestration_global_region() {}", "static WorldPointToSizedRect() {}" ]
[ "0.60596704", "0.58371097", "0.56422263", "0.5617519", "0.55617994", "0.55419743", "0.55101913", "0.54888785", "0.53994966", "0.53806525", "0.5378721", "0.5356613", "0.5294486", "0.52935606", "0.5276249", "0.52520597", "0.52451074", "0.52410257", "0.52273333", "0.5223333", "0.52202344", "0.51973486", "0.5181123", "0.5164965", "0.51611805", "0.51611805", "0.51611805", "0.51611805", "0.51611805", "0.5155216", "0.5147636", "0.51390344", "0.5138492", "0.5136441", "0.51363987", "0.51363987", "0.51363987", "0.51363987", "0.51363987", "0.5130099", "0.5130099", "0.5130099", "0.5130099", "0.5127196", "0.5112841", "0.5097025", "0.50917834", "0.5087442", "0.508724", "0.5084655", "0.5082923", "0.5080936", "0.5078453", "0.5072722", "0.5072392", "0.50678855", "0.5065861", "0.50658494", "0.5064313", "0.5062836", "0.5057856", "0.5055775", "0.505274", "0.50526655", "0.5044316", "0.5044316", "0.5036275", "0.50348556", "0.5031128", "0.50261635", "0.5003261", "0.50016737", "0.49983552", "0.49949437", "0.49867544", "0.49846417", "0.49830693", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49786666", "0.49771354", "0.49761993", "0.49710408", "0.49699786" ]
0.0
-1
Barangay with Extreme Enchanced Community Quarantine
function highlightFeature_eecq(e) { var layer = e.target; layer.setStyle({ weight: 1.0, color: 'black', fillOpacity: 0.1 }); if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) { layer.bringToFront(); } info.update(layer.feature.properties); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOtherThanBRA(state) {\r\n let isBra = state.case.charges.map(charge =>\r\n charge.isBRAFelony ? true : false\r\n );\r\n let braArr = [];\r\n state.case.charges.forEach(charge => {\r\n if (charge.isBRAFelony) {\r\n braArr.push(charge);\r\n }\r\n });\r\n if (!braArr[0]) {\r\n isAConviction(state);\r\n } else {\r\n let conArr = braArr.map(charge => (charge.isConvicted ? true : false));\r\n\r\n conArr.includes(true)\r\n ? printResult(\r\n \"eligible\",\r\n \"the 16- 803 analysis for eligible misdemeanors\"\r\n )\r\n : printResult(\r\n \"NOT ELIGIBLE\",\r\n \"use the 16-803 analysis for ineligible misdemeanors\"\r\n );\r\n }\r\n}", "function getBrakeEngAlert(vid){\n var returnstr = \"\";\n if (trucks[vid].symptoms.brakeeng == true){\n returnstr = 'P-BRAKE ENGAGED';\n }\n return returnstr\n}", "function IndicadorAntiguedad () {}", "function getAveGymQual() {\n\tvar totalB=0\n\tvar totalb=0\n\tfor (var i=0; i<gymQuant.length; i++) {\n\t\tif (gymQuant[i]===1) {\n\t\t\ttotalb=totalb+1\n\t\t\ttotalB=totalB+gymQual[i]\n\t\t}\n\t}\n\taveGymQual=Math.round((totalB/totalb)*10)/10\n\t$(\"#aveGymQual\").html(aveGymQual)\n}", "function displayBCEString (a) {\n\n var bceBoolean=speechesArray[a].yearIsBCE;\n\n if(bceBoolean === true){\n document.getElementById('ConsoleDisplay').innerHTML += 'This speech took place before the common era.<br>';\n }else{\n document.getElementById('ConsoleDisplay').innerHTML += 'This speech took place during the common era.<br>';\n }\n}", "function countriesBarChart() {\n stopHandlers();\n BarchartHandler.startBC({ \"type\": \"countries\", \"properties\": [\"game1owners\"] });\n}", "function buyBarq() {\r\n if(player.gold.num >= player.barquentine.price && player.influence >= player.barquentine.infMin) {\r\n player.barquentine.num++;\r\n player.gold.num -= player.barquentine.price;\r\n player.influence += player.barquentine.influence;\r\n player.barquentine.income = player.barquentine.num * player.barquentine.gain;\r\n gameLog('A handsome vessel, perfect for bein\\' \"civil\".');\r\n } else {\r\n gameLog('Keep an eye on yer resources, Cap\\'n!')\r\n };\r\n player.barquentine.price = Math.floor(12550 * Math.pow(1.13, player.barquentine.num));\r\n document.getElementById('barqCost').innerHTML = player.barquentine.price;\r\n document.getElementById('barqNum').innerHTML = player.barquentine.num;\r\n document.getElementById('barqGain').innerHTML = player.barquentine.income;\r\n document.getElementById('barqInf').innerHTML = player.barquentine.influence;\r\n document.getElementById('gold').innerHTML = player.gold.num;\r\n document.getElementById('influence').innerHTML = player.influence;\r\n}", "function haveFullPlatinumBonus() {\n return getPlatinum() >= 30;\n}", "function avancer_boule3(c) {\n\tif (cercles[c][3] == 0) {\n\t\tcreer_cercle(c);\t\t\t\t/* si la boule a été attrapée */\n\t} else {\n\t\tif (cercles[c][0] > 1000) {\n\t\t\tif (cercles[c][5] == 1) {\t\t/* si une boule bleue arrive au bout*/\n\t\t\t\tcontinuer = false;\n\t\t\t} else {\n\t\t\t\tcreer_cercle(c);\t\t/* si une boule d'une autre couleur arrive au bout */\n\t\t\t}\n\t\t} else {\n\t\tcercles[c][0] = cercles[c][0]+cercles[c][4];\t/* abscisse = abscisse + vitesse */\n\t\t}\n\t}\n}", "function hitungKembalian(bayar, harga) {\n //your code here\n var result = {}\n var pecahan = [100000,50000,20000,10000,5000]\n var kembailan = bayar - harga\n var totalPecahan = 0\n var pembatas = 5\n\n if (kembailan < 0) {\n return 'Uang tidak cukup'\n }\n\n for (var i = 0; i < pecahan.length; i++) {\n \n if (kembailan - pecahan[i] >= 0) {\n kembailan -= pecahan[i]\n totalPecahan += 1\n result[pecahan[i]] = totalPecahan\n i -= 1\n if (totalPecahan === pembatas) {\n totalPecahan = 0\n i += 1\n }\n } else {\n totalPecahan = 0\n }\n\n if (result[pecahan[pecahan.length - 1]] === pembatas) {\n pembatas += 5\n i = -1\n }\n }\n return result\n}", "function Binance(){\n var Full_Binance_Balance = [];\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceSpot());\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceEarn());\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceCrossMargin());\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceIsolatedMargin());\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceFutures());\n Full_Binance_Balance=AddBalance(Full_Binance_Balance, BinanceCollateral());\n return Full_Binance_Balance;\n}", "function paidToMuch(bounceBackAccount) {\n if (Number(loanAmount.innerText) <= 0) {\n bounceBackAccount.innerText = Number(bounceBackAccount.innerText) + (Number(loanAmount.innerText) * -1);\n loanAmount.innerText = 0;\n hasActiveLoan = false;\n loanDownPayment.style.display = 'none';\n downPaymentButton.style.display = 'none';\n }\n}", "function bandages() {\n var addon = selectAddOn(\"Bandages\", [\"Add 6 charges to medkit.\"], \"Common\", \"Add 6 charges to medkit.\", \"IconAddon_bandages.png\", \"First Aid Kit\", [\"extra\"]);\n return addon;\n}", "async cmd_ad_bank(params) {\n return this.query({\n url: \"/user/watchadviewed/\",\n body: {\n bank_extra_gold: 1,\n },\n })\n }", "function nameBaris(b){\n\tswitch(b){\n\t\tcase \"aritmetik\" : return \"Barisan Aritmetika biasa.\"; break;\n\t\tcase \"geometrik\" : return \"Barisan Geometri biasa.\"; break;\n\t\tcase \"aritgeo\" : return \"Pola bilangan dijumlah/dikurangi, kemudian dikali/dibagi\"; break;\n\t\tcase \"geoarit\" : return \"Pola bilangan dikali/dibagi, kemudian dijumlah/dikurangi\"; break;\n\t\tcase \"aritmetiksarang\": return \"Barisan aritmetika bertingkat.\"; break;\n\t\tcase \"geometriksarang\": return \"Barisan geometri bertingkat.\"; break;\n\t\tcase \"aritgeosarang\" : return \"Barisan aritmetika yang bedanya merupakan barisan geometri.\"; break;\n\t\tcase \"geoaritsarang\" : return \"Barisan geometri yang rasionya merupakan barisan aritmetika.\"; break;\n\t\tcase \"slangslingaa\" : return \"Pola selang-seling dua barisan aritmetika biasa.\"; break;\n\t\tcase \"slangslinggg\" : return \"Pola selang-seling dua barisan geometri biasa.\"; break;\n\t\tcase \"slangslingga\" : return \"Pola selang-seling barisan geometri biasa dan aritmetika biasa.\"; break;\n\t\tcase \"fibonacci\" : return \"Barisan Fibonacci biasa.\"; break;\n\t\tcase \"fibonaccix\" : return \"Seperti barisan Fibonacci, tapi berupa perkalian.\"; break;\n\t\tcase \"kuadrat\" : return \"Barisan bilangan kuadrat.\"; break;\n\t\tdefault\t\t\t\t : return \"Error. Barisan tak dikenali.\"; break;\n\t}\n}", "function find_BarbossaShare(goldCoin,X,Y){\n j=goldCoin*(X/100.0);\n b1=goldCoin-j;\n b2=parseFloat(Y/100.0);\n b=b1*b2;\n return b;\n}", "function IndicadorGradoAcademico () {}", "function haveFullBronzeBonus() {\n return getBronze() >= 196;\n}", "function findBand(expense) {\n return expense.type === 'Band';\n}", "function MaidQuartersBecomMaid() {\n\tInventoryAdd(Player, \"MaidOutfit1\", \"Cloth\");\n\tInventoryAdd(Player, \"MaidHairband1\", \"Hat\");\n\tInventoryWear(Player, \"MaidOutfit1\", \"Cloth\", \"Default\");\n\tInventoryWear(Player, \"MaidHairband1\", \"Hat\", \"Default\");\n\tCharacterAppearanceValidate(Player);\n\tLogAdd(\"JoinedSorority\", \"Maid\");\n\tReputationProgress(\"Dominant\", MaidQuartersDominantRep);\n\tMaidQuartersCanBecomeMaid = false;\n\tMaidQuartersIsMaid = true;\n}", "function BusinessIntelligenceCheck(){}", "function Bevy() {}", "get(bet_param) {\n const _this = this;\n const t = this.t;\n bet_param = this.processBarrier(bet_param);\n const contract_map = {\n ASIANU: (param) => {\n return t.translate('[currency] [amount] payout if the last tick of [underlying] is strictly higher than the average of the [tick_count] ticks.', param);\n },\n ASIAND: (param) => {\n return t.translate('[currency] [amount] payout if the last tick of [underlying] is strictly lower than the average of the [tick_count] ticks.', param);\n },\n CALL: (param) => {\n if (param.tick_expiry === 1) { // Tick trade\n return t.translate('[currency] [amount] payout if [underlying] after [tick_count] ticks is strictly higher than [entry_spot].', param)\n }\n\n if (param.is_forward_starting === 1) {\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n param.date_start = _this.getDateTime(param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [duration] after [date_start].', param)\n }\n\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n // Daily normal constracts.\n param.date_expiry = 'close on ' + _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [date_expiry].', param)\n }\n\n if (param.fixed_expiry === 1) { //Fixed expiry\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [date_expiry].', param)\n }\n // Intraday normal contracts having duration in minutes, seconds, or hours.\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly higher than [entry_spot] at [duration] after contract start time.', param)\n },\n DIGITDIFF: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is not [barrier] after [tick_count] ticks.', param);\n },\n DIGITEVEN: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is even after [tick_count] ticks.', param);\n },\n DIGITMATCH: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is [barrier] after [tick_count] ticks.', param);\n },\n DIGITODD: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is odd after [tick_count] ticks.', param);\n },\n DIGITOVER: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is higher than [barrier] after [tick_count] ticks.', param);\n },\n DIGITUNDER: (param) => {\n return t.translate('[currency] [amount] payout if last digit of [underlying] is lower than [barrier] after [tick_count] ticks.', param);\n },\n EXPIRYMISS: (param) => {\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends outside [low_barrier_str] to [high_barrier_str] at close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends outside [low_barrier_str] to [high_barrier_str] at [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] ends outside [low_barrier_str] to [high_barrier_str] at [duration] after contract start time.', param);\n },\n EXPIRYRANGE: (param) => {\n\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends strictly between [low_barrier_str] to [high_barrier_str] at close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] ends strictly between [low_barrier_str] to [high_barrier_str] at [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] ends strictly between [low_barrier_str] to [high_barrier_str] at [duration] after contract start time.', param);\n },\n NOTOUCH: (param) => {\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] does not touch [entry_spot] through close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] does not touch [entry_spot] through [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] does not touch [entry_spot] through [duration] after contract start time.', param);\n },\n ONETOUCH: (param) => {\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n param.date_expiry = _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] touches [entry_spot] through close on [date_expiry].', param);\n }\n\n if (param.fixed_expiry === 1) {\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] touches [entry_spot] through [date_expiry].', param);\n }\n\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] touches [entry_spot] through [duration] after contract start time.', param);\n },\n PUT: (param) => {\n if (param.tick_expiry === 1) { // Tick trade\n return t.translate('[currency] [amount] payout if [underlying] after [tick_count] ticks is strictly lower than [entry_spot].', param)\n }\n\n if (param.is_forward_starting === 1) {\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n param.date_start = _this.getDateTime(param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [duration] after [date_start].', param)\n }\n\n if (_this.isDaily(param.date_expiry - param.date_start)) {\n // Daily normal constracts.\n param.date_expiry = 'close on ' + _this.getDate(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [date_expiry].', param)\n }\n\n if (param.fixed_expiry === 1) { //Fixed expiry\n param.date_expiry = _this.getDateTime(param.date_expiry);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [date_expiry].', param)\n }\n // Intraday normal contracts having duration in minutes, seconds, or hours.\n param.duration = _this.getDuration(param.date_expiry - param.date_start);\n return t.translate('[currency] [amount] payout if [underlying] is strictly lower than [entry_spot] at [duration] after contract start time.', param)\n },\n SPREAD: () => {\n return t.translate('Legacy contract. No further information is available.');\n }\n };\n if(typeof contract_map[bet_param.bet_type] === 'undefined'){\n return 'Invalid short code.';\n }\n return contract_map[bet_param.bet_type](bet_param);\n }", "transactionInspection(item, amount, player) {\n if (!player || !this.faction.isContraband(item, player))\n return true;\n // the relative level of severity of trading in this item\n const contraband = data_1.default.resources[item].contraband || 0;\n // FastMath.abs() is used because amount is negative when selling to market,\n // positive when buying from market. Fine is per unit of contraband.\n const fine = FastMath.abs(contraband * amount * this.inspectionFine(player));\n const rate = this.inspectionRate(player);\n for (let i = 0; i < contraband; ++i) {\n if (util.chance(rate)) {\n const totalFine = Math.min(player.money, fine);\n const csnFine = util.csn(totalFine);\n const csnAmt = util.csn(amount);\n // fine the player\n player.debit(totalFine);\n // decrease standing\n player.decStanding(this.faction.abbrev, contraband);\n // confiscate contraband\n let verb;\n if (amount < 0) {\n player.ship.cargo.set(item, 0);\n verb = 'selling';\n }\n else {\n this.stock.dec(item, amount);\n verb = 'buying';\n }\n // trigger notification\n const msg = `Busted! ${this.faction.abbrev} agents were tracking your movements and observed you ${verb} ${csnAmt} units of ${item}. `\n + `You have been fined ${csnFine} credits and your standing wtih this faction has decreased by ${contraband}.`;\n window.game.notify(msg, true);\n return false;\n }\n }\n return true;\n }", "function bonAppetit(bill, k, b) {\n let totalBill = bill.reduce((acc, curr) => acc + curr)\n let uneatenFood = bill[k]\n let amountDue = (totalBill - uneatenFood) / 2\n return amountDue === b ? console.log(\"Bon Appetit\") : console.log(b - amountDue)\n}", "function concertThis(bandName) {\n\tconsole.log(\"concert-this\");\n\tvar queryUrl = \"https://rest.bandsintown.com/artists/\" + bandName + \"/events?app_id=codecademy\";\n\taxios.get(queryUrl).then((response) => {\n\t\t// console.log('response.data', response.data);\n\n\t\tconst bandNames = response.data.map(function(band) {\n\t\t\treturn band.lineup.join(\", \");\n\t\t});\n\t\tconsole.log(\"bandNames\", bandNames);\n\n\t\t//console.log('Name', Name);\n\t\t//console.log('City', City);\n\t\t// console.log('Date', Date);\n\t\t// console.log('Country', Country);\n\n\t\t//command 3 movie this\n\t\t// run a movie to the OMDB API with the movie specified\n\t});\n}", "_confirm_trade(event) {\n const trade = event.detail;\n trade.taking_order.price = trade.making_orders[0].price; // show trade price for both\n const all_orders = trade.making_orders.concat([trade.taking_order]);\n for (let order of all_orders) {\n if (order.pcode == this.pcode) {\n const type = order.is_bid ? 'bid' : 'ask';\n // this.$.log.info(`You ${order.is_bid ? 'bought' : 'sold'} for $${order.price}`, type);\n this.$.log.info(`${order.is_bid ? '-' : '+'} $${parseFloat((order.price/100).toFixed(1))}`, type);\n }\n // this.$.log.info(`You ${order.is_bid ? 'bought' : 'sold'} ${order.traded_volume} ${order.traded_volume == 1 ? 'unit' : 'units'}`);\n }\n // assign color code for trade list\n let type = 'other';\n if (this.trades[0].taking_order.pcode === this.pcode)\n type = this.trades[0].taking_order.is_bid ? 'bid' : 'ask';\n else if (this.trades[0].making_orders[0].pcode === this.pcode)\n type = this.trades[0].making_orders[0].is_bid ? 'bid' : 'ask';\n this.$.trades.setColor(0, type);\n }", "function IndicadorRangoEdad () {}", "function getAd () {\n\nlet ad = {}\n\n// get some data from javascript object \"BelenConf\"\n let cat1 = null,\n cat2 = null,\n cat3 = null,\n cat1Name = null,\n cat2Name = null,\n cat3Name = null,\n id = null\n\nif (typeof BelenConf == \"object\") {\n\n\t// get categories\n\tcat1 = BelenConf.universalAnalyticsOpts.dimensions.dimension2\n\tcat2 = BelenConf.universalAnalyticsOpts.dimensions.dimension3\n\tcat3 = BelenConf.universalAnalyticsOpts.dimensions.dimension4\n\tcat1Name = BelenConf.universalAnalyticsOpts.dimensions.dimension90\n\tcat2Name = BelenConf.universalAnalyticsOpts.dimensions.dimension91\n\tcat3Name = BelenConf.universalAnalyticsOpts.dimensions.dimension92\n\tid = BelenConf.universalAnalyticsOpts.dimensions.dimension30\n\n\tif (id != null) ad.id = id\n\n\tlet catCombo = \"\"\n\tif (cat1 != null && cat1 != \"\" && cat2 != null && cat2 != \"\" ) catCombo = cat1 + \"/\" + cat2\n\tif (cat3 != null && cat3 != \"\")\tcatCombo = catCombo + \"/\" + cat3 \n\tad.caturl = \"https://www.ebay-kleinanzeigen.de/p-kategorie-aendern.html#?path=\" + catCombo + \"&isParent=false\"\n\n\t// get Versand\n\tad.shipping_type = \"NONE\"\n\tif (cat2Name != null & cat2Name != \"\") {\n\t\tlet selector = document.querySelector(\"#\" + cat2Name.toLowerCase() + \"\\\\.versand_s\")\n\t\tif (selector != null && selector.options.selectedIndex == 1 ) ad.shipping_type = \"SHIPPING\"\n\t\tif (selector != null && selector.options.selectedIndex == 2 ) ad.shipping_type = \"PICKUP\"\n\t}\n}\n\nad.date_published = new Date().toISOString()\nad.enabled = \"1\"\n\n\nlet adType1 = document.querySelector(\"#adType1\")\nlet adType2 = document.querySelector(\"#adType2\")\nad.type = \"OFFER\" // my Preset\n\nif (adType1.checked) ad.type = adType1.value // \"OFFER\"\nif (adType2.checked) ad.type = adType2.value // \"WANTED\"\n\n\nad.title = document.querySelector(\"#postad-title\").value\nad.desc = document.querySelector(\"#pstad-descrptn\").value\nad.price = document.querySelector(\"#pstad-price\").value \n\nlet priceType1 = document.querySelector(\"#priceType1\")\nlet priceType2 = document.querySelector(\"#priceType2\")\nlet priceType3 = document.querySelector(\"#priceType3\")\n\n\nad.price_type = \"FIXED\" // my Preset\nif (priceType1.checked) ad.price_type = priceType1.value // \"FIXED\"\nif (priceType2.checked) ad.price_type = priceType2.value // \"NEGOTIABLE\"\nif (priceType3.checked) ad.price_type = priceType3.value // \"GIVE_AWAY\"\n\nlet imgUsed = []\ndocument.querySelectorAll(\".pictureupload-thumbnails img\").forEach((img) => { \n\tlet bigImg = img.src.replace(/\\$_\\d{1,3}\\./, \"$_57.\") // change the img link to the link for the largest image fromat from server (1600x1600 px, if original was such big)\n\timgUsed.push(bigImg)\n})\nif (imgUsed.length > 0) ad.imgUsed = imgUsed;\n\n\nad.zipCode = document.querySelector(\"#pstad-zip\").value\n\nlet posterTypePrivate = document.querySelector(\"#posterType-private\")\nlet posterTypeCommercial = document.querySelector(\"#posterType-commercial\")\n\nif (posterTypePrivate.checked) ad.posterType = posterTypePrivate.value // \"PRIVATE\"\nif (posterTypeCommercial.checked) {\n\tad.posterType = posterTypeCommercial.value // \"COMMERCIAL\"\n\t// ad.imprint = document.querySelector(\"#pstad-imprnt-inpt\").value\n}\n\n\n// Additional Attributes\n\nlet additional_category_options = {}\nlet count = 0\nlet attr = document.querySelectorAll(\"div.formgroup.pstad-attrs select, div.formgroup.pstad-attrs input\")\nif (attr != null) for (let i = 0; i < attr.length; i++ ) {\n\tif (attr[i].tagName == \"INPUT\") {\n\t\tif (attr[i].type == \"text\") {\n\t\t\t//console.log(\"INPUT text\", attr[i].id, attr[i].value)\n \t\tif (attr[i].value != \"\") { // Add only items, which were filled with a value\n \t\t\tadditional_category_options[attr[i].id] = attr[i].value\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif (attr[i].type == \"checkbox\") {\n\t\t\t//console.log(\"INPUT checkbox\", attr[i].id, attr[i].checked)\n \t\tif (attr[i].checked) { // Add only items, which are checked\n \t\t\tadditional_category_options[attr[i].id] = attr[i].checked\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\n\t}\n\tif ( attr[i].tagName == \"SELECT\") {\n\t\t//console.log(\"SELECT\" ,attr[i].id, attr[i].selectedIndex, attr[i].options[attr[i].selectedIndex].text)\n\t\tif (attr[i].options[attr[i].selectedIndex].text.indexOf(\"wählen\") < 0 ) { // add only selected items\n\t\t\tadditional_category_options[attr[i].id] = attr[i].options[attr[i].selectedIndex].text\n\t\t\tcount++\n\t\t}\n\t}\n}\nif (count > 0) ad.additional_category_options = additional_category_options\n\nconsole.log(JSON.stringify(ad,null,4))\n// return ad\t\n\t\n}", "function brendanEichQuote() {\n console.log('Always bet on JavaScript.');\n }", "async approveCompound(){\n let spender = Compound.util.getAddress(Compound.cDAI, process.env.ETH_NETWORK);\n //spender = '0xF0d0EB522cfa50B716B3b1604C4F0fA6f04376AD'; //cDAI\n console.log('spender: ' + spender);\n let param = cDAI.methods().approve.call({ spender: spender, amount: '3000000000000000000' });\n //let address = '0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa';//DAI\n let address = Compound.util.getAddress(Compound.DAI, process.env.ETH_NETWORK);\n console.log('address: ' + address);\n console.log(param);\n this.printInputData(param.data);\n console.log('data: ' + param.data);\n\n let parameter = {\n address: address,\n amount: param.amount,\n data: param.data\n };\n\n let currency = process.env.ETH;\n console.log('Start Bitgo SDK interaction');\n await this.bitgo.unlock();\n let transaction = await this.bitgo.sendBitGoTx([parameter], currency);\n await this.bitgo.lock();\n return transaction;\n }", "function BullishScore( data,period )\n{\n var tot = 0.0;\n for ( var x = period-1 ; x < data.length; x++ )\n {\n tot += data[x]['AboveEMA'] ;\n }\n \n \n return ( 100.0 * tot/( data.length - period ) ) ;\n}", "function bid() {\n // this calls the \"add\" function defined in the Solidity contract\n // the last argument is a callback to handle the result\n CONTRACT.bid( function(error, result) {\n if(error) { console.log(error) }\n })\n}", "function question3() {\n // Answer:\n let gBP_code;\n for (let i = 0; i < data.length; i++) {\n if (data[i].currency_code === \"GBP\") {\n gBP_code = data[i];\n }\n }\n console.log(gBP_code.title + \" $\" + gBP_code.price);\n}", "function britainFilter(items){\n return items.currency_code !== \"USD\";\n }", "function beratBadanWanita(tinggi){\r\n let ideal = (tinggi - 100) - (tinggi -100) * 0.15\r\n return `Wanita = ${ideal} Kg`; \r\n}", "function getQBFantasyPoints(qb, i) {\r\n //Points for Passing Yards\r\n var fantasyPoints = Math.floor(parseInt(qb[\"Year\" + i + \"PassingYards\"].replace(/,/g, '').replace('--', '0')) / 25);\r\n //Points for Passing TD's\r\n fantasyPoints += qb[\"Year\" + i + \"PassingTDs\"].replace('--', '0') * 4;\r\n //Points deducted for Passing Int's\r\n fantasyPoints -= qb[\"Year\" + i + \"PassingInts\"].replace('--', '0') * 2;\r\n //Points for Rushing Yards\r\n fantasyPoints += Math.floor(parseInt(qb[\"Year\" + i + \"RushingYards\"].replace(/,/g, '').replace('--', '0')) / 10);\r\n //Points for Rushing TDs\r\n fantasyPoints += qb[\"Year\" + i + \"RushingTDs\"].replace('--', '0') * 6;\r\n //Points deducted for Fumbles Lost\r\n fantasyPoints -= qb[\"Year\" + i + \"FumblesLost\"].replace('--', '0') * 2;\r\n return fantasyPoints;\r\n }", "calculateCapitalGains() {\n const groupedTransactions = {};\n\n for (let t = 0; t < this.transactions.length; t++) {\n const transaction = this.transactions[t];\n const transactionType = transaction.type === 'buy' ? 'buys' : 'sells';\n\n if (!(transaction.unitCurrency in groupedTransactions)) {\n groupedTransactions[transaction.unitCurrency] = {buys: [], sells: []};\n }\n\n // Group the transactions by currency and by buy/sell type\n groupedTransactions[transaction.unitCurrency][transactionType].push({\n created_at: transaction.created_at,\n amount: new Big(Math.abs(parseFloat(transaction.units))),\n native_amount: new Big(Math.abs(parseFloat(transaction.fiatAmount))),\n native_currency: transaction.fiatCurrency,\n unit_price: new Big(transaction.pricePerUnit)\n });\n }\n\n return createTaxEvents(groupedTransactions);\n }", "static updateStockBarang(stock) {\n this.#stockBarang = stock;\n }", "function ConcertThis(Band) {\n\n if (!Band) {\n console.log (\"***ERROR*** No band specified\");\n return;\n\t} // if (!Band)\n\n if (DebugON) console.log (\"** In ConcertThis() \" + Band);\n\n axios.get(\"https://rest.bandsintown.com/artists/\"+Band+\"/events?app_id=codingbootcamp\").then(\n function (response) {\n\n var NumConcerts = response.data.length;\n\n // limit the listings to the 5 upcoming dates\n if (NumConcerts > 5)\n NumConcerts = 5;\n \n var Banner =\n \"--------------------------------------------------------------------\" +\n \"\\n C O N C E R T - T H I S\" +\n \"\\n--------------------------------------------------------------------\" +\n \"\\nBand or Artist: \" + Band;\n console.log(Banner);\n\n for (var i = 0; i < NumConcerts; i++) {\n // create concert results string\n var ConcertResults = \n \"\\nVenue Name: \" + response.data[i].venue.name +\n \"\\nVenue Location: \" + response.data[i].venue.city +\n \"\\nDate of the Event: \" + moment(response.data[i].datetime).format(\"MM/DD/YYYY\") +\n \"\\n--------------------------------------------------------------------\";\n console.log(ConcertResults);\n\n } // for\n\n }) // function(response)\n .catch(function (error) { // error handler\n console.log(\"axios.get Error: \" + error);\n }); // get.axios()\n\n} // ConcertThis()", "get hint() {\n if (super.hint) {\n return super.hint;\n }\n const berries = this.fieldBerries.map((fb) => BerryType[fb.berry]).join(', ');\n return `Legends tell of a mysterious Berry that only appears in a field of ${berries} Berries.`;\n }", "function D(t,e){if(!s)var s=\"https://ambrpay.io/api\";var n=e,a=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(n||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var a=s+\"/smartContractAddresses\";return r.getRequest(a,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,a,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(a=e,!a.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=a.wallet?a.wallet:t.receiverWallet,!n.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==a.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==a.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==a.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)a.daysInterval=parseInt(t.interval);else if(-1==a.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=a.transferOut),a.acceptedCryptoCurrencies.Ethereum.price>0)return a.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=a.currencyCode){if(o<1)throw\"the minimum amount is \"+a.currencyCode+\" 1.00 \";return r.getExchangePrice(a.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*a.fee,c=1e18*c/1e18,n.utils.isAddress(a.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+a.priceLimitPercentage/100);return new Promise((function(t,i){var l=new n.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,a.daysInterval,n.utils.toWei(d.toString(),\"ether\"),u,n.utils.toWei(c.toString(),\"ether\")).send({value:n.utils.toWei(o.toString(),\"ether\"),gas:5e5,gasPrice:1e9,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(n){var c={subscriptionPlanId:a.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:n.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return n.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,n){var a=s+\"/price/\"+t+\"/\"+e+\"/\"+n;return r.getRequest(a)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var n=new XMLHttpRequest;n.open(\"GET\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)return e(n.responseText);4==n.readyState&&200!=n.status&&s(n.responseText)},n.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,n){var a=new XMLHttpRequest;a.open(\"POST\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){4==a.readyState&&200==a.status?s(a.responseText):4==a.readyState&&200!=a.status&&n(a.responseText)},a.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==n&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(a)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var a=new n.eth.Contract(r.ABI.abi,r.contractAddress),i=a.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,n){if(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(a){return n.eth.getBalance(a,(function(a,r){if(a)return s(a);var i=n.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,a){var i=new n.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){a(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(a).send({value:n.utils.toWei(t),gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(n.utils.toWei(t)).send({gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "function luxuryTax() {\n if (turn == \"player\"){\n if(playerCash < 75){\n checkBankruptcy();\n }else{\n playerCash -= 75\n updateCash();\n playerUpdate(\"Room and board. Pay up.\")\n }\n }else if(turn == \"enemy\"){\n if(enemyCash < 75){\n checkEnemyBankruptcy();\n }else{\n enemyCash -= 75\n updateCash();\n enemyUpdate(\"Room and board. Pay up.\")\n }\n }\n}", "function bypassAnticheat() { // SO THAT YOUR ACCOUNT DOESNT GET BANNED\n \n}", "function script83_TapAppFees() {\r\n\t\r\n\tlogDebug(\"script83_TapAppFees started.\");\r\n\ttry{\r\n\t\tif (AInfo[\"Type\"] == \"Single Family Detached\" && (AInfo[\"Water Closets\"] >= \"1\" && AInfo[\"Water Closets\"] <= \"2\")) {\r\n\t\t\tupdateFee(\"WAT_TA_01\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Single Family Detached\" && (AInfo[\"Water Closets\"] >= \"3\" && AInfo[\"Water Closets\"] <= \"4\")) {\r\n\t\t\tupdateFee(\"WAT_TA_02\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Single Family Detached\" && AInfo[\"Water Closets\"] >= \"5\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_03\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Single Family Detached\") {\r\n\t\t\tupdateFee(\"WAT_TA_04\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Single Family Attached\") {\r\n\t\t\tupdateFee(\"WAT_TA_09\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t\tupdateFee(\"WAT_TA_10\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t\tupdateFee(\"WAT_TA_13\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Multi Family\") {\r\n\t\t\tupdateFee(\"WAT_TA_16\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Commercial\" && AInfo[\"Size of Water Meter\"] == \"3/4\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_22\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Commercial\" && AInfo[\"Size of Water Meter\"] == \"1\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_23\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Commercial\" && AInfo[\"Size of Water Meter\"] == \"1 1/2\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_24\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Commercial\" && AInfo[\"Size of Water Meter\"] == \"2\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_25\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Commercial\" && AInfo[\"Size of Water Meter\"] > \"2\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_39\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t} catch(err){\r\n\t\tshowMessage = true;\r\n\t\tcomment(\"Error on custom function script83_TapAppFees. Please contact administrator. Err: \" + err);\r\n\t\tlogDebug(\"Error on custom function script83_TapAppFees. Please contact administrator. Err: \" + err);\r\n\t\tlogDebug(\"A JavaScript Error occurred: ASA:Water/Water/Tap/Application 83: \" + err.message);\r\n\t\tlogDebug(err.stack)\r\n\t}\r\n\tlogDebug(\"script83_TapAppFees ended.\");\r\n//\tif function is used \t};//END ASA:Water/Water/Tap/Application;\r\n\r\n}", "function doCbaam() {\n init();\n if (isArmenianworkingday()) {\n //read RSS\n root = getFeedDocument(input_cbaam_feedurl);\n\n if (root !== false) {\n //get the items of interest\n var items = root.getChild('channel').getChildren('item');\n\n for (var i in items) {\n\n data = datatemplate;\n\n data.id = items[i].getChild('guid').getValue();\n data.title = items[i].getChild('title').getText();\n data.date = new Date(items[i].getChild('pubDate').getText());\n data.rate = parseFloat(myGetNthElementFromSplitText(items[i], \"title\", \" - \", 2));\n data.multiplier = myGetNthElementFromSplitText(items[i], \"title\", \" - \", 1);\n data.currency = myGetNthElementFromSplitText(items[i], \"title\", \" - \", 0);\n\n //attempt to insert only selected currencies\n if (process_cbaam_currencies.indexOf(data.currency) >= 0) {\n appendRowIfNotExists(output_spreadsheetId, output_cbaam_sheetname, data, 'AMD');\n }\n }\n }\n }//end if isArmenianworkingday()\n}", "function I(t,e){if(!s)var s=\"https://ambrpay.io/api\";var a=e,n=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(a||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var n=s+\"/smartContractAddresses\";return r.getRequest(n,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,n,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(n=e,!n.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=n.wallet?n.wallet:t.receiverWallet,!a.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==n.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==n.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==n.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)n.daysInterval=parseInt(t.interval);else if(-1==n.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=n.transferOut),n.acceptedCryptoCurrencies.Ethereum.price>0)return n.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=n.currencyCode){if(o<1)throw\"the minimum amount is \"+n.currencyCode+\" 1.00 \";return r.getExchangePrice(n.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*n.fee,c=1e18*c/1e18,a.utils.isAddress(n.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+n.priceLimitPercentage/100);return new Promise((function(t,i){var l=new a.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,n.daysInterval,a.utils.toWei(d.toString(),\"ether\"),u,a.utils.toWei(c.toString(),\"ether\")).send({value:a.utils.toWei(o.toString(),\"ether\"),gas:5e5,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(a){var c={subscriptionPlanId:n.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:a.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return a.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,a){var n=s+\"/price/\"+t+\"/\"+e+\"/\"+a;return r.getRequest(n)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var a=new XMLHttpRequest;a.open(\"GET\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){if(4==a.readyState&&200==a.status)return e(a.responseText);4==a.readyState&&200!=a.status&&s(a.responseText)},a.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,a){var n=new XMLHttpRequest;n.open(\"POST\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){4==n.readyState&&200==n.status?s(n.responseText):4==n.readyState&&200!=n.status&&a(n.responseText)},n.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==a&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(n)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var n=new a.eth.Contract(r.ABI.abi,r.contractAddress),i=n.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,a){if(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(n){return a.eth.getBalance(n,(function(n,r){if(n)return s(n);var i=a.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,n){var i=new a.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){n(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(n).send({value:a.utils.toWei(t),gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(a.utils.toWei(t)).send({gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "function Emission() {\r\n const opts = {\r\n options: {\r\n chart: {\r\n fontFamily: chartFont,\r\n zoom: {\r\n enabled: false\r\n },\r\n },\r\n dataLabels: {\r\n enabled: false\r\n },\r\n stroke: {\r\n width: [5, 5, 3, 1],\r\n curve: 'straight',\r\n //curve: 'smooth'\r\n },\r\n title: {\r\n text: 'CO₂ global share by fuel type per year',\r\n align: 'left',\r\n style: titleStyle\r\n },\r\n subtitle: {\r\n text: 'Source: BP Statistical Review of Global Energy'\r\n },\r\n markers: {\r\n size: 0,\r\n hover: {\r\n sizeOffset: 6\r\n }\r\n },\r\n xaxis: {\r\n categories: res_df.emission.years,\r\n type: 'category',\r\n labels: {\r\n //rotate: 0,\r\n trim: true\r\n },\r\n tickAmount: 10\r\n },\r\n yaxis: {\r\n max: 100,\r\n title: {\r\n text: 'CO₂ industry share, %',\r\n },\r\n labels: {\r\n formatter: function(val, opt) {\r\n return round(val);\r\n }\r\n }\r\n },\r\n annotations: {\r\n xaxis: [\r\n {\r\n x: 1914,\r\n strokeDashArray: 0,\r\n borderColor: '#775DD0',\r\n label: {\r\n borderColor: '#775DD0',\r\n style: {\r\n color: '#fff',\r\n background: '#775DD0',\r\n },\r\n text: '1914 World War I',\r\n }\r\n }, {\r\n x: 1939,\r\n strokeDashArray: 0,\r\n borderColor: '#775DD0',\r\n label: {\r\n borderColor: '#775DD0',\r\n style: {\r\n color: '#fff',\r\n background: '#775DD0',\r\n },\r\n text: '1939 World War II',\r\n }\r\n }, {\r\n x: 1973,\r\n strokeDashArray: 0,\r\n borderColor: '#775DD0',\r\n label: {\r\n borderColor: '#775DD0',\r\n style: {\r\n color: '#fff',\r\n background: '#775DD0',\r\n },\r\n text: '1973 oil crisis',\r\n }\r\n }, {\r\n x: 1986,\r\n strokeDashArray: 0,\r\n borderColor: '#775DD0',\r\n label: {\r\n borderColor: '#775DD0',\r\n style: {\r\n color: '#fff',\r\n background: '#775DD0',\r\n },\r\n text: '1986 oil price collapse',\r\n }\r\n }, {\r\n x: 2004,\r\n strokeDashArray: 0,\r\n borderColor: '#775DD0',\r\n label: {\r\n borderColor: '#775DD0',\r\n style: {\r\n color: '#fff',\r\n background: '#775DD0',\r\n },\r\n text: '2004 oil price surge',\r\n }\r\n }\r\n ]\r\n },\r\n tooltip: {\r\n y: {\r\n formatter: function(val, { series, seriesIndex, dataPointIndex, w }) {\r\n const e = w.config.series[seriesIndex].emission[dataPointIndex];\r\n\r\n return `${val}% (${e} Megatonnes/y)`;\r\n }\r\n }\r\n },\r\n grid: {\r\n borderColor: '#f1f1f1'\r\n }\r\n },\r\n series: res_df.emission.series\r\n }\r\n\r\n return (\r\n <ReactApexChart options={opts.options} series={opts.series} type='line' height={500} />\r\n );\r\n}", "function concert() {\n\n //queryUrl for bandsintown\n var bandUrl = \"https://rest.bandsintown.com/artists/\" + userQuery + \"/events?app_id=codingbootcamp\";\n\n axios.get(bandUrl).then(function (response) {\n console.log(\"\\nVenue Name: \" + response.data[0].venue.name);\n console.log(\"\\nLocation: \" + response.data[0].venue.city + \" \" + response.data[0].venue.country);\n console.log(\"\\nDate: \" + moment((response.data[0].datetime)).format(\"MM/DD/YYYY\"));\n })\n .catch(function (error) {\n if (error.response) {\n console.log(error.response.data);\n } else if (error.request) {\n console.log(error.request);\n } else {\n console.log(\"error\", error.message);\n }\n });\n}", "function canPlatinum() {\n return !isQuestActive() && getGold() >= 5 && getPlatinumToday() < 1;\n}", "function CalculateEncumberance() { // STR * 5, * 10\n\tOPC.encumberanceMax = OPC.abilityScores[0] * 10;\n\tOPC.encumberance = 0;\n// equipped gear\n\tswitch(OPC.mainHand[0]) { // whatever is in the main hand\n\t\tcase \"a\":\n\t\t\tOPC.encumberance += OPC.mainHand[6];\n\t\t\tbreak;\n\t\tcase \"l\":\n\t\tcase \"s\":\n\t\t\tOPC.encumberance += OPC.mainHand[3];\n\t\t\tbreak;\n\t\tcase \"m\":\n\t\t\tOPC.encumberance += OPC.mainHand[2];\n\t\t\tbreak;\n\t\tcase \"w\":\n\t\t\tOPC.encumberance += OPC.mainHand[5];\n\t\t\tbreak;\n\t}\n\tswitch(OPC.offHand[0]) { // whatever is in the off hand\n\t\tcase \"a\":\n\t\t\tOPC.encumberance += OPC.offHand[6];\n\t\t\tbreak;\n\t\tcase \"l\":\n\t\tcase \"s\":\n\t\t\tOPC.encumberance += OPC.offHand[3];\n\t\t\tbreak;\n\t\tcase \"m\":\n\t\t\tOPC.encumberance += OPC.offHand[2];\n\t\t\tbreak;\n\t\tcase \"w\":\n\t\t\tOPC.encumberance += OPC.offHand[5];\n\t\t\tbreak;\n\t}\n\tswitch(OPC.armor[0]) { // whatever is armor\n\t\tcase \"a\":\n\t\t\tOPC.encumberance += OPC.armor[6];\n\t\t\tbreak;\n\t\tcase \"l\":\n\t\tcase \"s\":\n\t\t\tOPC.encumberance += OPC.armor[3];\n\t\t\tbreak;\n\t\tcase \"m\":\n\t\t\tOPC.encumberance += OPC.armor[2];\n\t\t\tbreak;\n\t\tcase \"w\":\n\t\t\tOPC.encumberance += OPC.armor[5];\n\t\t\tbreak;\n\t}\n// backpack\n\tfor(iE = 0; iE < OPC.backpack.length; iE++) { // go through all contents of the backpack\n\t\tswitch(OPC.backpack[iE][0]){\n\t\t\tcase \"a\":\n\t\t\t\tOPC.encumberance += OPC.backpack[iE][6];\n\t\t\t\tbreak;\n\t\t\tcase \"l\":\n\t\t\tcase \"s\":\n\t\t\t\tOPC.encumberance += OPC.backpack[iE][3];\n\t\t\t\tbreak;\n\t\t\tcase \"m\":\n\t\t\t\tOPC.encumberance += OPC.backpack[iE][2];\n\t\t\t\tbreak;\n\t\t\tcase \"w\":\n\t\t\t\tOPC.encumberance += OPC.backpack[iE][5];\n\t\t\t\tbreak;\t\t\t\n\t\t}\n\t}\n// coins\n\tcp = OPC.copper;\n\tpp = Math.floor(cp / 1000);\n\tcp -= pp * 1000;\n\tgp = Math.floor(cp / 100);\n\tcp -= gp * 100;\n\tsp = Math.floor(cp / 10);\n\tcp -= sp * 10;\n\tOPC.encumberance += Math.ceil((cp + sp + gp + pp) / 50);\n}", "function eatBerries()\n\t\t\t{\n\t\t\t\tberryBank -= 1;\n\t\t\t\tif (berryBank == 0)\n\t\t\t\t{\n\t\t\t\t\tdocument.querySelector(\".eatBerries\").disabled = true;\n\t\t\t\t}\n\t\t\t\tstamina = (stamina * 10 + 5) /10;\n\t\t\t\tif (stamina > 10)\n\t\t\t\t{\n\t\t\t\t\tstamina = 10;\n\t\t\t\t}\n\t\t\t\thunger = (hunger * 10 + 5) / 10;\n\t\t\t\tif (hunger > 10)\n\t\t\t\t{\n\t\t\t\t\thunger = 10;\n\t\t\t\t}\n\t\t\t\tthirst = (thirst * 10 - 1 ) / 10;\n\t\t\t\tif (thirst < 0)\n\t\t\t\t{\n\t\t\t\t\thealth = ((health * 10) + (thirst * 10)) / 10;\n\t\t\t\t\tthirst = 0;\n\t\t\t\t}\n\t\t\t\tadvanceTime();\n\t\t\t\tupdateDisp();\n\t\t\t}", "function chart1() {\n var options = {\n series: [\n {\n data: [\n 2.7,\n 2.65,\n 2.58,\n 2.44,\n 2.01,\n 1.92,\n 1.18,\n 1.01,\n 0.84,\n 0.8,\n 0.79,\n 0.79,\n 0.68,\n 0.66,\n 0.61,\n 0.53,\n 0.5,\n 0.46,\n 0.45,\n 0.38,\n 0.12,\n 0.04\n ]\n }\n ],\n chart: {\n type: \"bar\",\n height: 350\n },\n plotOptions: {\n bar: {\n horizontal: true\n }\n },\n dataLabels: {\n enabled: false\n },\n\n fill: {\n colors: [\"#003469\"],\n opacity: 1\n },\n\n xaxis: {\n categories: [\n \"AM. AL ASIMAH\",\n \"AL HUDAYDAH\",\n \"TAIZZ\",\n \"IBB\",\n \"HAJJAH\",\n \"DHAMAR\",\n \"SANA'A\",\n \"AMRAN\",\n \"SA'ADA\",\n \"HADRAMAUT\",\n \"ADEN\",\n \"LAHJ\",\n \"AL BAYDA\",\n \"AL MAHWIT\",\n \"AL DHALE'E\",\n \"RAYMAH\",\n \"SHABWAH\",\n \"AL JAWF\",\n \"ABYAN\",\n \"MARIB\",\n \"AL MAHARAH\",\n \"SOCOTRA\"\n ]\n }\n };\n\n var chart = new ApexCharts(document.querySelector(\"#myAreaChart\"), options);\n chart.render();\n}", "function ReportInvoiceQrCodeWithAddress() {\n\n}", "function Artyom() {\r\n this.ArtyomCommands = [];\r\n this.ArtyomVoicesIdentifiers = {\r\n // German\r\n \"de-DE\": [\"Google Deutsch\", \"de-DE\", \"de_DE\"],\r\n // Spanish\r\n \"es-ES\": [\"Google español\", \"es-ES\", \"es_ES\", \"es-MX\", \"es_MX\"],\r\n // Italian\r\n \"it-IT\": [\"Google italiano\", \"it-IT\", \"it_IT\"],\r\n // Japanese\r\n \"jp-JP\": [\"Google 日本人\", \"ja-JP\", \"ja_JP\"],\r\n // English USA\r\n \"en-US\": [\"Google US English\", \"en-US\", \"en_US\"],\r\n // English UK\r\n \"en-GB\": [\"Google UK English Male\", \"Google UK English Female\", \"en-GB\", \"en_GB\"],\r\n // Brazilian Portuguese\r\n \"pt-BR\": [\"Google português do Brasil\", \"pt-PT\", \"pt-BR\", \"pt_PT\", \"pt_BR\"],\r\n // Portugal Portuguese\r\n // Note: in desktop, there's no voice for portugal Portuguese\r\n \"pt-PT\": [\"Google português do Brasil\", \"pt-PT\", \"pt_PT\"],\r\n // Russian\r\n \"ru-RU\": [\"Google русский\", \"ru-RU\", \"ru_RU\"],\r\n // Dutch (holland)\r\n \"nl-NL\": [\"Google Nederlands\", \"nl-NL\", \"nl_NL\"],\r\n // French\r\n \"fr-FR\": [\"Google français\", \"fr-FR\", \"fr_FR\"],\r\n // Polish\r\n \"pl-PL\": [\"Google polski\", \"pl-PL\", \"pl_PL\"],\r\n // Indonesian\r\n \"id-ID\": [\"Google Bahasa Indonesia\", \"id-ID\", \"id_ID\"],\r\n // Hindi\r\n \"hi-IN\": [\"Google हिन्दी\", \"hi-IN\", \"hi_IN\"],\r\n // Mandarin Chinese\r\n \"zh-CN\": [\"Google 普通话(中国大陆)\", \"zh-CN\", \"zh_CN\"],\r\n // Cantonese Chinese\r\n \"zh-HK\": [\"Google 粤語(香港)\", \"zh-HK\", \"zh_HK\"],\r\n // Native voice\r\n \"native\": [\"native\"]\r\n };\r\n // Important: retrieve the voices of the browser as soon as possible.\r\n // Normally, the execution of speechSynthesis.getVoices will return at the first time an empty array.\r\n if (window.hasOwnProperty('speechSynthesis')) {\r\n speechSynthesis.getVoices();\r\n }\r\n else {\r\n console.error(\"Artyom.js can't speak without the Speech Synthesis API.\");\r\n }\r\n // This instance of webkitSpeechRecognition is the one used by Artyom.\r\n if (window.hasOwnProperty('webkitSpeechRecognition')) {\r\n this.ArtyomWebkitSpeechRecognition = new window.webkitSpeechRecognition();\r\n }\r\n else {\r\n console.error(\"Artyom.js can't recognize voice without the Speech Recognition API.\");\r\n }\r\n this.ArtyomProperties = {\r\n lang: 'en-GB',\r\n recognizing: false,\r\n continuous: false,\r\n speed: 1,\r\n volume: 1,\r\n listen: false,\r\n mode: \"normal\",\r\n debug: false,\r\n helpers: {\r\n redirectRecognizedTextOutput: null,\r\n remoteProcessorHandler: null,\r\n lastSay: null,\r\n fatalityPromiseCallback: null\r\n },\r\n executionKeyword: null,\r\n obeyKeyword: null,\r\n speaking: false,\r\n obeying: true,\r\n soundex: false,\r\n name: null\r\n };\r\n this.ArtyomGarbageCollection = [];\r\n this.ArtyomFlags = {\r\n restartRecognition: false\r\n };\r\n this.ArtyomGlobalEvents = {\r\n ERROR: \"ERROR\",\r\n SPEECH_SYNTHESIS_START: \"SPEECH_SYNTHESIS_START\",\r\n SPEECH_SYNTHESIS_END: \"SPEECH_SYNTHESIS_END\",\r\n TEXT_RECOGNIZED: \"TEXT_RECOGNIZED\",\r\n COMMAND_RECOGNITION_START: \"COMMAND_RECOGNITION_START\",\r\n COMMAND_RECOGNITION_END: \"COMMAND_RECOGNITION_END\",\r\n COMMAND_MATCHED: \"COMMAND_MATCHED\",\r\n NOT_COMMAND_MATCHED: \"NOT_COMMAND_MATCHED\"\r\n };\r\n this.Device = {\r\n isMobile: false,\r\n isChrome: true\r\n };\r\n if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)) {\r\n this.Device.isMobile = true;\r\n }\r\n if (navigator.userAgent.indexOf(\"Chrome\") == -1) {\r\n this.Device.isChrome = false;\r\n }\r\n /**\r\n * The default voice of Artyom in the Desktop. In mobile, you will need to initialize (or force the language)\r\n * with a language code in order to find an available voice in the device, otherwise it will use the native voice.\r\n */\r\n this.ArtyomVoice = {\r\n default: false,\r\n lang: \"en-GB\",\r\n localService: false,\r\n name: \"Google UK English Male\",\r\n voiceURI: \"Google UK English Male\"\r\n };\r\n }", "applyHighlight() {\n let z = false;\n for (let x = 0; x < this.asks.length; x++) {\n if (z) {\n break;\n }\n for (let y = 0; y < this.bids.length; y++) {\n if (this.asks[x].rate <= this.bids[y].rate) {\n this.asks[x].arbitrage = true;\n this.bids[y].arbitrage = true;\n } else {\n if (y === 0) {\n z = true;\n }\n break;\n }\n }\n }\n }", "function lexaBrain (service, search) {\n let queryUrl =\"\";\n switch (service){\n case \"spotify-this-song\":\n\n //checking to see if a song was provide, if not defaults to the sign\n let spotifySearch = \"\";\n if(search===\"\"){\n spotifySearch=\"the+sign\"\n }else{\n spotifySearch=search;\n }\n\n //call out to spotify for 5 results.\n spotify.search({ \n type: 'track', query: spotifySearch, limit: 5\n }).then(function(response) {\n\n //checking to see if any items in response, if none let user know\n if(response.track.items.length===0){\n console.log(\"No song by that name found.\")\n }\n //each song sent back, we print out the info for it.\n response.tracks.items.forEach(function(result){\n console.log();\n console.log (\"Artist(s): \"+result.artists[0].name);\n console.log (\"Song Title: \"+result.name);\n console.log (\"Album: \"+result.album.name);\n console.log (\"On Spotify: \"+result.external_urls.spotify);\n })\n \n })\n //incase something goes wrong\n .catch(function(err) {\n console.log(\"No song by that name found\");\n });\n break;\n\n case \"concert-this\":\n //using axios to call out to bandsintown and get back results\n queryUrl = \"https://rest.bandsintown.com/artists/\" + search + \"/events?app_id=codingbootcamp\";\n axios.get(queryUrl.replace(\"+\", \" \")).then(function(response){\n\n if(response.data.length === 0){\n console.log (\"No band by that name found.\");\n }\n\n //for each gig a band has, print out the info\n response.data.forEach(function(gig){\n let date = gig.datetime.split(\"T\");\n let formatedDate = moment(date[0]).format(\"MM/DD/YYYY\");\n let venue = gig.venue\n console.log(`\n Venue name: ${venue.name}\n Location: ${venue.city}, ${venue.region}, ${venue.country}\n Date of show: ${formatedDate} \n `)\n });\n })\n //if something goes wrong...\n .catch(function(err){\n console.log (\"Band not found\");\n });\n break;\n\n case \"movie-this\":\n queryUrl = \"http://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\";\n axios.get(queryUrl).then(function(response) {\n let movie = response.data\n if (movie.length === 0){\n console.log(\"No movie by that name found\");\n }\n console.log(`\n Movie Title: ${movie.Title}\n Release Date: ${movie.Released}\n IMDB Rating: ${movie.imdbRating}\n Rotten T: ${movie.Ratings[1].Value}\n Country of O: ${movie.Country}\n Language: ${movie.Language}\n Movie Plot: ${movie.Plot}\n Actors: ${movie.Actors}\n `)\n })\n //incase something goes wrong.\n .catch(function(err){\n console.log(\"No movies by that name found\");\n });\n break;\n case \"do-what-it-says\":\n console.log(\"FreeStyle huh?...lets see....\");\n //reading my file and getting its contents\n fs.readFile(\"random.txt\", \"utf8\", function(err, data) {\n if(err){\n console.log(\"I wasn't able to read that...\")\n }\n console.log(data);\n //removes \"\" around song name, then splits the command in two. one for command. one for searchterm.\n let response = data.replace(/\"+/g, '').split(\",\");;\n lexaBrain(response[0],response[1]);\n });\n break;\n default:\n console.log(\"I havent been programmed to do that yet...\");\n break;\n }\n}", "function VirusDiPermukaanBenda(agent) {\n return connectToDatabase().then((connection) => {\n return queryDatabase(connection).then((result) => {\n console.log(result);\n if (result.length === 0) {\n agent.add(\"kata-kunci tidak ditemukan di basis-data\");\n }\n result.map((content) => {\n if (keywords === content.keyword) {\n agent.add(`${content.results}`);\n }\n });\n connection.end();\n });\n });\n }", "shouldQuarantine() {\r\n if (this.passengers.map(passenger => (passenger.isHealthy)).includes(false)) {\r\n return true\r\n } else {\r\n return false\r\n }\r\n\r\n }", "function jeu_attaquerCA(me,cattaquante){\n\t\tmy_logger((me?PROMPT_ME:PROMPT_IA)+cattaquante.nom+ \" inflige dégat CA\");\n\t\tif (me){\n\t\t\t//infliger les dégats à l'adversaire\t\t\t\n\t\t\tpv_adv = pv_adv-cattaquante.ATT;\n\t\t\t$(\"#vieadv\").html(pv_adv);\t\t\n\t\t}else{\n\t\t\t//infliger les dégats à ME\t\t\t\n\t\t\tpv_me = pv_me-cattaquante.ATT;\n\t\t\t$(\"#vieme\").html(pv_me);\t\t\t\t\n\t\t}\n\t }", "function question3 () {\n // Answer:\n for (let product=0; product<data.length; product++) {\n if (data[product].currency_code===\"GBP\"){\n console.log(data[product].title + \" costs \" + data[product].price + \" pounds.\");\n }\n }\n}", "invalidateExtinguish(player, building) {\n // <<-- Creer-Merge: invalidate-extinguish -->>\n const invalid = this.invalidateBribe(player);\n if (invalid) {\n return invalid;\n }\n if (building.isHeadquarters) {\n return `${building} is a Headquarters and cannot be extinguished by ${this}.`;\n }\n // <<-- /Creer-Merge: invalidate-extinguish -->>\n }", "arbol(){\n var arbol = new Array();\n var padres = this._buscarPadre(data.categories);\n var hijos = this._buscarHijos(data.categories,padres);\n\n }", "function Guarda_Clics_AFN()\r\n{\r\n\tGuarda_Clics(4,1);\r\n}", "function BitAlliance() {\n return (\n <div\n // className= \"bitAlliance-view\" id=\"bitAlliance-view\"\n >\n {/* <Main2 currency=\"BitAlliance\"/> */}\n\n <Typography\n variant=\"h5\"\n style={{\n textAlign: 'center',\n fontWeight: '500px',\n fontFamily: 'Verdana',\n color: '#0000f',\n }}\n >\n Bit Alliance Coming Soon!\n </Typography>\n <br></br>\n\n <br></br>\n\n <Typography\n variant=\"h6\"\n style={{\n textAlign: 'center',\n marginLeft: '100px',\n marginRight: '100px',\n color: '#39FF14',\n }}\n >\n “Tracking your investments is what we can give you”\n </Typography>\n <br></br>\n </div>\n );\n}", "getBone4cc(b) {\nreturn this.bone4cc[b];\n}", "function bonAppetit(bill, k, b) {\n//k -> item which Anna wont eat\n//b -> amount calculated by Brian to pay\n//bill -> array\n\n let itemsInBill = bill.length;\n let removeAnnasShare = bill[k];\n let costAsPerBrian = b;\n\n let totalFoodBill = 0;\n for(let food of bill) {\n totalFoodBill += food;\n }\n\n let actualBill = totalFoodBill - removeAnnasShare; \n \n let costPerPerson = actualBill / 2; \n \n if (costPerPerson < costAsPerBrian) {\n console.log(costAsPerBrian - costPerPerson);\n }\n else\n console.log(\"Bon Appetit\");\n\n}", "function lifeTimeBingeing(bingeAmmount, howOld) {\n const century = 100;\n let totalBingeing = bingeAmmount * 365 * (century - howOld);\n console.log(\n \"Your going to eat \" + totalBingeing + \" packs of junk food until you die\"\n );\n}", "function getQbig(needChair, needTable, needKhat) {\r\n// Qbig Fixed Hisab\r\nchair = 1;\r\ntable = 3;\r\nkhat = 5;\r\n\r\n needTotal = (needChair * chair + needTable * table + needKhat * khat);\r\n console.log(\"Need total qbig feet wood = \"+needTotal);\r\n\r\n}", "function hordeGain() {\n if (player.inventory.includes(word) && word === 'runningShoes') {\n encroachment = 20\n console.log(\"Your new kicks allow you to put some distance between yourself and the zombies!\")\n } else {\n console.log(\"You can't use that\")\n }\n}", "function ClickHabilidadeEspecial() {\n // TODO da pra melhorar.\n AtualizaGeral();\n}", "static createBillsGrandpaQuestLine() {\n const BillsGrandpaQuestLine = new QuestLine('Bill\\'s Grandpa Treasure Hunt', 'Check the hints and bring Bill\\'s Grandpa the Pokémon he wants to see.', new RouteKillRequirement(10, GameConstants.Region.kanto, 25), GameConstants.BulletinBoards.Kanto);\n const talkToBillsGrandpa1 = new TalkToNPCQuest(BillsGrandpa1, 'Talk to Bill\\'s Grandpa in Bill\\'s House.');\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa1);\n const pinkBalloon = new CaptureSpecificPokemonQuest('Jigglypuff', 'Catch the desired Pokémon.', 1);\n const punchNormal = new CustomQuest(100, 0, 'Defeat 100 Normal-type Pokémon.', () => {\n return pokemonMap.filter(p => p.type.includes(PokemonType.Normal)).map(p => App.game.statistics.pokemonDefeated[p.id]()).reduce((a, b) => a + b, 0);\n });\n BillsGrandpaQuestLine.addQuest(new MultipleQuestsQuest([\n pinkBalloon,\n punchNormal,\n ], 'Bill\\'s Grandpa wants you to catch a Pokémon that is pink and like a balloon.'));\n // Talk to Bill's Grandpa after catching a Jigglypuff\n const MoonStoneReward = () => {\n player.gainItem('Moon_stone', 1);\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you a Moon Stone.',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.Quests.quest_ready_to_complete,\n });\n };\n const talkToBillsGrandpa2 = new TalkToNPCQuest(BillsGrandpa2, 'Show your Jigglypuff to Bill\\'s Grandpa.', MoonStoneReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa2);\n const blueRound = new CaptureSpecificPokemonQuest('Oddish', 'Catch the desired Pokémon.', 1);\n const punchGrass = new CustomQuest(100, 0, 'Defeat 100 Grass-type Pokémon.', () => {\n return pokemonMap.filter(p => p.type.includes(PokemonType.Grass)).map(p => App.game.statistics.pokemonDefeated[p.id]()).reduce((a, b) => a + b, 0);\n });\n BillsGrandpaQuestLine.addQuest(new MultipleQuestsQuest([\n blueRound,\n punchGrass,\n ], 'Bill\\'s Grandpa wants you to catch a Pokémon that is round, blue, and has leaves growing on its head.'));\n // Talk to Bill's Grandpa after catching an Oddish\n const LeafStoneReward = () => {\n player.gainItem('Leaf_stone', 1);\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you a Leaf Stone.',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.Quests.quest_ready_to_complete,\n });\n };\n const talkToBillsGrandpa3 = new TalkToNPCQuest(BillsGrandpa3, 'Show your Oddish to Bill\\'s Grandpa.', LeafStoneReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa3);\n const redSphere = new CaptureSpecificPokemonQuest('Staryu', 'Catch the desired Pokémon.', 1);\n const punchWater = new CustomQuest(100, 0, 'Defeat 100 Water-type Pokémon.', () => {\n return pokemonMap.filter(p => p.type.includes(PokemonType.Water)).map(p => App.game.statistics.pokemonDefeated[p.id]()).reduce((a, b) => a + b, 0);\n });\n BillsGrandpaQuestLine.addQuest(new MultipleQuestsQuest([\n redSphere,\n punchWater,\n ], 'Bill\\'s Grandpa wants you to catch a Pokémon that it has a red sphere in its body and is shaped like a star.'));\n // Talk to Bill's Grandpa after catching a Staryu\n const WaterStoneReward = () => {\n player.gainItem('Water_stone', 1);\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you a Water Stone.',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.Quests.quest_ready_to_complete,\n });\n };\n const talkToBillsGrandpa4 = new TalkToNPCQuest(BillsGrandpa4, 'Show your Staryu to Bill\\'s Grandpa.', WaterStoneReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa4);\n const loyalRoar = new CaptureSpecificPokemonQuest('Growlithe', 'Catch the desired Pokémon.', 1);\n const punchFire = new CustomQuest(100, 0, 'Defeat 100 Fire-type Pokémon.', () => {\n return pokemonMap.filter(p => p.type.includes(PokemonType.Fire)).map(p => App.game.statistics.pokemonDefeated[p.id]()).reduce((a, b) => a + b, 0);\n });\n BillsGrandpaQuestLine.addQuest(new MultipleQuestsQuest([\n loyalRoar,\n punchFire,\n ], 'Bill\\'s Grandpa wants you to catch a Pokémon that is very loyal and supposedly roars pretty well.'));\n // Talk to Bill's Grandpa after catching a Growlithe\n const FireStoneReward = () => {\n player.gainItem('Fire_stone', 1);\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you a Fire Stone.',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.Quests.quest_ready_to_complete,\n });\n };\n const talkToBillsGrandpa5 = new TalkToNPCQuest(BillsGrandpa5, 'Show your Growlithe to Bill\\'s Grandpa.', FireStoneReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa5);\n const yellowAndRed = new CaptureSpecificPokemonQuest('Pikachu', 'Catch the desired Pokémon.', 1);\n const punchElectric = new CustomQuest(100, 0, 'Defeat 100 Electric-type Pokémon.', () => {\n return pokemonMap.filter(p => p.type.includes(PokemonType.Electric)).map(p => App.game.statistics.pokemonDefeated[p.id]()).reduce((a, b) => a + b, 0);\n });\n BillsGrandpaQuestLine.addQuest(new MultipleQuestsQuest([\n yellowAndRed,\n punchElectric,\n ], 'Bill\\'s Grandpa wants you to catch a Pokémon that has a yellow body and red cheeks.'));\n // Talk to Bill's Grandpa after catching a Pikachu\n const ThunderStoneReward = () => {\n player.gainItem('Thunder_stone', 1);\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you a Thunder Stone.',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.Quests.quest_ready_to_complete,\n });\n };\n const talkToBillsGrandpa6 = new TalkToNPCQuest(BillsGrandpa6, 'Show your Pikachu to Bill\\'s Grandpa.', ThunderStoneReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa6);\n const fightBillsGrandpa = new DefeatTemporaryBattleQuest('Bill\\'s Grandpa', 'Bill\\'s Grandpa would like to have a battle with you!');\n BillsGrandpaQuestLine.addQuest(fightBillsGrandpa);\n // Talk to Bill's Grandpa after battling him\n const EeveeReward = () => {\n App.game.party.gainPokemonByName('Eevee');\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you an Eevee, treat it well!',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.General.new_catch,\n timeout: 3e4,\n });\n };\n const talkToBillsGrandpa7 = new TalkToNPCQuest(BillsGrandpa7, 'Talk to Bill\\'s Grandpa one last time.', EeveeReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa7);\n App.game.quests.questLines().push(BillsGrandpaQuestLine);\n }", "function credit_redeem_chart() {\n let rewards_data = document.getElementById(\"rewards_data\");\n\n if (rewards_data) {\n rewards_data = rewards_data.getAttribute(\"data-value\");\n\n let rewards = JSON.parse(rewards_data);\n\n let credits = [];\n let redeem = [];\n\n for (let i in rewards) {\n credits.push(rewards[i][\"credits\"]);\n redeem.push(rewards[i][\"redeem\"]);\n }\n\n const apexChart = \"#rewards_chart\";\n var options = {\n series: [\n {\n name: \"Credit\",\n data: credits,\n },\n {\n name: \"Redeem\",\n data: redeem,\n },\n ],\n chart: {\n type: \"bar\",\n height: 350,\n },\n plotOptions: {\n bar: {\n horizontal: false,\n columnWidth: \"55%\",\n endingShape: \"rounded\",\n },\n },\n dataLabels: {\n enabled: false,\n },\n stroke: {\n show: true,\n width: 2,\n colors: [\"transparent\"],\n },\n xaxis: {\n categories: Object.keys(rewards),\n },\n yaxis: {\n title: {\n text: \"Points\",\n },\n },\n fill: {\n opacity: 1,\n },\n tooltip: {\n y: {\n formatter: function (val) {\n return val + \" points\";\n },\n },\n },\n colors: [primary, success, warning],\n };\n\n var chart = new ApexCharts(document.querySelector(apexChart), options);\n chart.render();\n }\n}", "function setBahasa(event) {\n event.preventDefault();\n\n let bahasa = document.querySelector(\"#bahasaIndonesia\");\n let english = document.querySelector(\"#english\");\n let menu = document.querySelector(\"#nav-bar\");\n\n bahasa.classList.add(\"active\");\n english.classList.remove(\"active\");\n\n menu.innerHTML = ` <a\n href=\"https://exchange.naturalwayofliving.com/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Login ke Zimbra</a\n >&nbsp;|&nbsp;\n <a\n href=\"./files/Tutorial to setup new Email ver 5.5 - Bahasa.pdf\"\n target=\"_blank\"\n >Tutorial</a\n >&nbsp;|&nbsp;\n <a\n href=\"https://youtu.be/lbY43AIWxOw\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Video Tutorial\n </a>\n &nbsp;|&nbsp;\n <!-- Calendly link widget begin -->\n <link\n href=\"https://assets.calendly.com/assets/external/widget.css\"\n rel=\"stylesheet\"\n />\n <script\n src=\"https://assets.calendly.com/assets/external/widget.js\"\n type=\"text/javascript\"\n ></script>\n <a\n href=\"\"\n onclick=\"Calendly.initPopupWidget({url: 'https://calendly.com/irfani-silviana/nwl-email-support'});return false;\"\n >Jadwalkan Live Support</a\n >\n <!-- Calendly link widget end -->`;\n\n document.querySelector(\n '[for=\"firstName\"]'\n ).innerHTML = `<label for=\"firstName\" class=\"col-sm col-form-label\">Nama Depan<sup class=\"required\">*(wajib)</sup></label>`;\n document.querySelector('[for=\"lastName\"]').innerHTML = \"Nama Belakang\";\n document.querySelector(\n '[for=\"jobTitle\"]'\n ).innerHTML = `<label for=\"jobTitle\" class=\"col-sm col-form-label\"\n >Jenis Pekerjaan<sup class=\"required\">*(wajib)</sup></label>`;\n document.querySelector('[for=\"customField\"]').innerHTML = \"Keterangan\";\n document.querySelector('[for=\"department\"]').innerHTML = \"Departemen\";\n\n document.querySelector(\n '[for=\"officePhone\"]'\n ).innerHTML = `<label for=\"officePhone\" class=\"col-sm col-form-label\"\n >Telepon Kantor\n <sub>\n <em>(sertakan kode negara)</em>\n </sub>\n </label>`;\n document.querySelector(\n '[for=\"mobilePhone\"]'\n ).innerHTML = `<label for=\"mobilePhone\" class=\"col-sm col-form-label\"\n >Handphone<sub>\n <em>(sertakan kode negara)</em>\n </sub></label>`;\n\n document.querySelector(\n '[for=\"emailAddress\"]'\n ).innerHTML = `<label for=\"emailAddress\" class=\"col-sm col-form-label\"\n >Email<sup class=\"required\">*(wajib)</sup>\n <address></address\n ></label>`;\n\n let x = document.querySelectorAll(\"span.instruction\");\n let i;\n for (i = 0; i < x.length; i++) {\n x[i].innerHTML = \"Klik tombol ini --->\";\n }\n}", "function basalLookup() {\n var now = new Date();\n var basalRate = basalprofile_data[basalprofile_data.length-1].rate\n \n for (var i = 0; i < basalprofile_data.length - 1; i++) {\n if ((now >= getTime(basalprofile_data[i].minutes)) && (now < getTime(basalprofile_data[i + 1].minutes))) {\n basalRate = basalprofile_data[i].rate;\n break;\n }\n }\n profile.current_basal= basalRate;\n}", "decodeExtSquitter() {\n if (this.df != DF_EXT_SQUITTER) return;\n\n switch (this.tc) {\n case TC_AIRCRAFT_IDENTIFICATION_1:\n case TC_AIRCRAFT_IDENTIFICATION_2:\n case TC_AIRCRAFT_IDENTIFICATION_3:\n case TC_AIRCRAFT_IDENTIFICATION_4:\n this.callsign = Callsign.Decode(this.data.slice(5,11));\n break;\n\n case TC_AIRBORNE_VELOCITY:\n this.st = this.data[4] & 0x07;\n this.ic = (this.data[5] & 0x80) ? 1 : 0;\n this.resv_a = (this.data[5] & 0x40) ? 1 : 0;\n this.nac = (this.data[5] & 0x38) >> 3;\n this.we_sign = (this.data[5] & 0x04) ? 1 : 0;\n this.we = (this.data[5] & 0x03) << 8 | this.data[6];\n this.ns_sign = (this.data[7] & 0x80) ? 1 : 0;\n this.ns = (this.data[7] & 0x7F) << 3 | (this.data[8] & 0xe0) >> 5;\n this.vrsrc = (this.data[8] & 0x10) ? 1 : 0;\n this.vr_sign = (this.data[8] & 0x08) ? 1 : 0;\n this.vr = (this.data[8] & 0x07) << 6 | (this.data[9] & 0xFC) >> 2;\n this.resv_b = this.data[9] & 0x03;\n this.baro_diff_sign = (this.data[10] & 0x80) ? 1 : 0;\n this.baro_diff = this.data[10] & 0x7F;\n break;\n\n case TC_AIRBORNE_POSITION_9:\n case TC_AIRBORNE_POSITION_10:\n case TC_AIRBORNE_POSITION_11:\n case TC_AIRBORNE_POSITION_12:\n case TC_AIRBORNE_POSITION_13:\n case TC_AIRBORNE_POSITION_14:\n case TC_AIRBORNE_POSITION_15:\n case TC_AIRBORNE_POSITION_16:\n case TC_AIRBORNE_POSITION_17:\n case TC_AIRBORNE_POSITION_18:\n this.ss = this.data[4] & 0x06 >> 1;\n this.nicsb = this.data[4] & 0x01;\n this.alt = this.data[5] << 4 | (this.data[6] & 0xf0) >> 4;\n this.time = (this.data[6] & 0x08) ? 1 : 0;\n this.cpr_odd = (this.data[6] & 0x04) ? 1 : 0;\n this.lat_cpr = (this.data[6] & 0x03) << 15 |\n (this.data[7] << 7) |\n (this.data[8] & 0xFE) >> 1;\n this.lon_cpr = (this.data[8] & 0x01) << 16 |\n this.data[9] << 8 |\n this.data[10];\n break;\n\n default:\n break;\n }\n }", "function concertThis(band){\n //console.log(\"Concert This\");\n\n axios.get(\"https://rest.bandsintown.com/artists/\"+band+\"/events?app_id=\"+bandsintown).then(\n results => {\n console.log(\"Name of the venue: \" + results.data[0].venue.name);\n console.log(\"Venue Location: \" \n + results.data[0].venue.city + \", \" \n + results.data[0].venue.region + \", \" \n + results.data[0].venue.country);\n console.log(\"Date of the Event: \" \n + moment(results.data[0].datetime, moment.HTML5_FMT.DATETIME_LOCAL_SECONDS).format(\"MM/DD/YYYY\"));\n },\n err => {\n console.log(err);\n }\n );\n}", "function controlloAccantonamento(banDoc, accantonamento, entrate, uscite) {\r\n\t\r\n\t// Se 'Accantonamento > (Entrate - Uscite (1,2,3,4) )' => segnala errore\r\n\t\r\n var diffEntrateUscite = Banana.SDecimal.subtract(entrate,uscite);\r\n\tif (Banana.SDecimal.compare(accantonamento,diffEntrateUscite) == 1) {\r\n\t\tbanDoc.addMessage(getErrorMessage(ID_ERR_ACCANTONAMENTO_5XMILLE));\r\n\t}\r\n}", "function prestigeOf(etymology) {\n\n var etymologies = [\"Abnaki\", \"Afrikaans\", \"Akkadian\", \"Algonquian\", \"American English\", \n \"American Spanish\", \"Anglican\", \"Anglo-French\", \"Anglo-Latin\", \"Anglo-Norm\", \"Arabic\", \"Aramaic\", \"Arawakan\", \"Armenian\", \"Assyrian\",\n \"Attic\", \"Basque\", \"Breton\", \"Cantonese\", \"Carib\", \"Catalan\", \"Cherokee\", \"Chinook\", \"Church Latin\", \"Coptic\", \"Cornish\",\n \"Croatian\", \"Czech\", \"Danish\", \"Dravidian\", \"Dutch\", \"Ecclesiastical Greek\", \"East Frisian\", \"Egypt\", \"English\", \"Estonian\", \"Etruscan\",\n \"Finnish\", \"Flemish\", \"Frankish\", \"French\", \"Frisian\", \"Fulani\", \"Gallo-Romance\", \"Gaelic\", \"Gaulish\", \"German\", \"Gothic\", \"Greek\", \"Germanic\",\n \"Guarani\", \"Hawaiian\", \"Hebrew\", \"Hung\", \"Ibo\", \"Indo-European\", \"Irish\", \"Iran\", \"Iroquoian\", \"Italian\", \"Kentish\", \"Japanese\", \"Kurdish\", \"Kwa\",\n \"Latin\", \"Lithuanian\", \"Late Latin\", \"Low German\", \"Malay\", \"Mandarin\", \"Mandingo\", \"Middle Dutch\", \"Middle English\", \"Mercian\", \"Mexican Spanish\",\n \"Micmac\", \"Middle French\", \"Middle High German\", \"Middle Irish\", \"Medieval Latin\", \"Middle Low German\", \"Mod.Eng.\", \"Modern Greek\", \"Modern Latin\", \n \"Muskogean\", \"Nahuatl\", \"N.E\", \"North Germanic\", \"North Sea Germanic\", \"Northumbrian\", \"O.Celt.\", \"O.Fr.\", \"Ojibwa\", \"Old Church Slavonic\",\n \"Old Danish\", \"Old Dutch\", \"Old English\", \"Old Frisian\", \"Old High German\", \"Old Irish\", \"Old Italian\", \"Old Low German\", \"Old Norse\", \n \"Old North French\", \"Old Persian\", \"Old Provencal\", \"Old Prussian\", \"Old Saxon\", \"O.Slav.\", \"O.Sp.\", \"Old Swedish\", \"Pashto\", \"Pennsylvania Dutch\",\n \"Persian\", \"P.Gmc.\", \"Phoenician\", \"Phrygian\", \"Piman\", \"Polish\", \"Portuguese\", \"Proto-Italic\", \"Provencal\", \"Quechua\", \"Russian\", \"Sanskrit\", \"Scand\",\n \"Scot.\", \"Serbo-Croatian\", \"Semitic\", \"Serb.\", \"Sinhalese\", \"Siouan\", \"Slav.\", \"Slovak\", \"Spanish\",\"Sumerican\", \"Swedish\", \"Tamil\",\"Telugu\",\n \"Thai\", \"Tibetan\", \"Tupi\", \"Turk\", \"Turkic\", \"Twi\", \"Ukrainian\", \"Urdu\", \"Uto-Aztecan\", \"Vulgar Latin\", \"W.Afr.\", \"West Frisian\", \"West Germanic\",\n \"Wolof\", \"West Saxon\", \"Xhosa\", \"Yoruba\", \"none\"];\n\n // 1 is high prestige, 0 is low prestige\n\t // general rules:\n // high prestige -- latin, french\n // mid prestige -- greek, semitic languages, spanish, slavic, scandinavian germanic, other exotic languages\n // low prestige -- germanic, celtic, native american languages, siberian/mongol/uralic languages\n var prestige = [ 0, 0, 0.5, 0, 0,\n 0.5, 0, 1, 1, 1, 0.5, 0.5, 0.5, 0.5, 0.5,\n 0.5, 0.5, 0, 0, 0, 1, 0, 0, 1, 0.5, 0,\n 0.5, 0.5, 0, 0.5, 0, 0, 0, 0.5, 0, 0, 0.5,\n 0, 0, 0, 1, 0, 0.5, 1, 0, 1, 0, 0, 0.5, 0,\n 0.5, 0.5, 0.5, 0.5, 0.5, 0, 0, 0.5, 0, 1, 0, 0.5, 0.5, 0.5,\n 1, 0.5, 1, 0, 0.5, 0.5, 0.5, 0, 0, 0.5, 0,\n 0, 1, 0, 0, 1, 0, 0, 0.5, 1, \n 0.5, 0.5, 0.5, 0, 0, 0, 0, 1, 0.5, 0.5,\n 0, 0, 0, 0, 0, 0, 1, 0, 0, \n 1, 0.5, 1, 0, 0, 0.5, 1, 0, 0.5, 0,\n 0.5, 0, 0.5, 0.5, 0.5, 0.5, 1, 1, 1, 0, 0.5, 0.5, 0,\n 0, 0.5, 0.5, 0.5, 0, 0.5, 0.5, 0.5, 1, 0.5, 0.5, 0.5, 0.5,\n 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1, 0.5, 0, 0,\n 0.5, 0, 0.5, 0.5, 0.5];\n\n var index = etymologies.indexOf(etymology);\n if (index == -1) { \n \treturn 0.5;\n\t}\n\n return prestige[index];\n\n}", "function BellBoy (yearsOfExperience, name, hasWorkPermit, languages) {\n\tthis.yearsOfExperience = yearsOfExperience;\n\tthis.name = name;\n\tthis.hasWorkPermit = hasWorkPermit;\n\tthis.languages = languages;\n}", "function equalizeMarket() {\n\tcoin = get_coin();\n\tif(bank.held[inverse_coin(coin)] / bank.held[coin] < bank.held[coin] / bank.held[inverse_coin(coin)]) {\n\t\tcoin = inverse_coin(coin);\n\t}\n\tamount = Math.floor((Math.random()*120) + 10);\n\tvar rate = bank.held[inverse_coin(coin)] / bank.held[coin];\n\tvar merit_amount = amount * rate;\n\n\tmwymi_logger(`${coin_symbol(inverse_coin(coin))}/${coin_symbol(coin)} EXCHANGE RATE: ${rate}`);\n\n\taxios.post(`${URL}/api/bank/deposit`, {\"coin\": coin, \"amount\": amount})\n\t.then(response => {\n\t\tif(response.status == 200) {\n\t\t\tmwymi_logger(\"Doing a little stabilizing.\");\n\t\t\taxios.post(`${URL}/api/bank/withdraw`, {\"coin\": inverse_coin(coin), \"amount\": merit_amount})\n\t\t\t.then(response => {\n\t\t\t\tif(response.status == 200) {\n\t\t\t\t\tmwymi_logger(\"Exchange seems ok!\");\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t})\n\t.catch(console.error);\n}", "function complemento(AFD){\n var AFDComplemento = JSON.parse(JSON.stringify(AFD)), n_finales = []\n for(let i=0;i<(AFDComplemento.arr_estados).length;i++){\n if(((AFDComplemento.arr_estados)[i]).final === true){\n ((AFDComplemento.arr_estados)[i]).final = false\n }\n else{\n ((AFDComplemento.arr_estados)[i]).final = true\n }\n }\n for(let j=0;j<(AFDComplemento.arr_estados).length;j++){\n if(((AFDComplemento.arr_estados)[j]).final === true){\n n_finales.push(((AFDComplemento.arr_estados)[j]).nombre)\n } \n }\n AFDComplemento.est_finales = n_finales;\n var AFDcomp = new Quintupla;\n AFDcomp = AFDComplemento;\n console.log('AFD Complemento:',AFDcomp);\n return AFDcomp;\n}", "determineBathroomType(b) {\n\n }", "function isValidIBAN($v)\n {\n $v = $v.replace(/^(.{4})(.*)$/,\"$2$1\"); //Move the first 4 chars from left to the right\n //Convert A-Z to 10-25\n $v = $v.replace(\n /[A-Z]/g,\n function ($e) {\n return $e.charCodeAt(0) - 'A'.charCodeAt(0) + 10;\n }\n );\n var $sum = 0;\n var $ei = 1; //First exponent\n for (var $i = $v.length - 1; $i >= 0; $i--) {\n $sum += $ei * parseInt($v.charAt($i),10); //multiply the digit by it's exponent\n $ei = ($ei * 10) % 97; //compute next base 10 exponent in modulus 97\n }\n return $sum % 97 == 1;\n }", "function bands(){\n var queryUrl = \"https://rest.bandsintown.com/artists/\" + title + \"/events?app_id=codingbootcamp\";\n axios.get(queryUrl).then(\n function (response){\n console.log(response.data);\n if (response.data.length == 0){\n console.log(\"sorry try again\");\n return;\n }\n console.log(\"concerts for \" + title);\n for (var i =0 ; i < response.data.length; i++){\n console.log(response.data[i].venue.city + \",\" + (response.data[i].venue.region || response.data[i].venue.country) + \" at \" + response.data[i].venue.name + \" on the following day \" + moment(response.data[i].datetime).format(\"MM/DD/YYYY\"))\n }\n }\n );\n\n}", "function findtax(){\n const amnt = income.value;\n if(amnt<=48535){\n const a =(amnt *.15).toFixed(2);\n ttax.textContent = '$' + a;\n rate.textContent=(a/amnt*100).toFixed(2);\n const b=(amnt-a).toFixed(2); \n earn.textContent = '$' + b; \n }\n\n else if (amnt > 48535 && amnt <=97069 ) {\n const c= ((amnt -48535 ) *.205 + 7280).toFixed(2);\n ttax.textContent = '$' + c;\n rate.textContent=(c/amnt*100).toFixed(2);\n const d=(amnt-c).toFixed(2); \n earn.textContent = '$' + d;\n\n }\n\n else if (amnt > 97069 && amnt <=150473 ) {\n const e= ((amnt - 97069) *.26 + 17230).toFixed(2);\n ttax.textContent = '$' + e;\n rate.textContent=(e/amnt*100).toFixed(2);\n const f=(amnt-e).toFixed(2); \n earn.textContent = '$' + f;\n \n }\n\n else if (amnt > 150473 && amnt <=214368 ) {\n const g= ((amnt - 150473) *.29 +31115).toFixed(2) ;\n ttax.textContent = '$' + g;\n rate.textContent=(g/amnt*100).toFixed(2);\n const h=(amnt-g).toFixed(2);\n earn.textContent = '$' + h;\n\n\n }\n \n else if (isNaN(amnt)) {\n error.textContent =\"Error: Enter a Number\";\n }\n\n else {\n \n const i= ((amnt - 214368) *.33 +49645).toFixed(2) ;\n ttax.textContent = '$' + i;\n rate.textContent=(i/amnt*100).toFixed(2);\n const j=(amnt-i).toFixed(2); \n earn.textContent = '$' + j;\n\n }\n \n \n\n \n }", "function question3 () {\n\tdata.forEach(function(element) {\n\t\tif(element.currency_code === \"GBP\"){\n\t\t\tconsole.log(element.title + \" costs \" + element.price + \" pounds.\");\n\t\t}\n\t})\n}", "embellish(text) {\n return text\n .replace(/<b>(.*?)<\\/b>/gu, (_, text) => this.#candy.bold(text))\n .replace(/<i>(.*?)<\\/i>/gu, (_, text) => this.#candy.italic(text))\n .replace(/<u>(.*?)<\\/u>/gu, (_, text) => this.#candy.underline(text));\n }", "function gba(a,b,c){if(Object.hasOwnProperty.call(te,a)&&(a=te[a],Object.hasOwnProperty.call(a,b)&&(a=a[b],a instanceof Array))){for(var d=null,e=!1,f=0,g=a.length;f<g;++f){var h=a[f],k=h.contingentAttribute;if(!k)return h.contract;null===d&&(d={});k=Object.hasOwnProperty.call(d,k)?d[k]:d[k]=c(k);if(k===h.requiredValue)return h.contract;null==k&&(e=!0)}if(e)return null}b=hba[b];return\"number\"===typeof b?b:null}", "function axiePriceVirginFloor() {\n \n function virginOnly(a) { if(a.breedCount === 0) return a };\n \n function clearEmptyVals(n) { return n !== \"\" }; \n \n var virgins = pagination_(Ai.getAllAxies, {offset: 0, sale: \"true\", sorting: \"lowest_price\", stage: 4}, \"axies\", \"totalAxies\", 12, virginOnly),\n cheapestVirgin = virgins.filter(clearEmptyVals)[0], //get cheapest adult virgin\n cheapestVirginValue = (cheapestVirgin.auction.buyNowPrice / div);\n \n return Number(cheapestVirginValue).toFixed(4); \n}", "function setBetData() {\n cashout = gQ1;\n}", "function getAveGymQuant() {\n\tvar totalA=0\n\tfor (var i=0; i<gymQuant.length; i++) {\n\t\ttotalA=totalA+gymQuant[i]\n\t}\n\taveGymQuant=Math.round((totalA/7)*100)+\"%\"\n\t$(\"#aveGymQuant\").html(aveGymQuant)\n}", "function infoBeritaCovid(agent) {\n return axios({\n method: \"get\",\n url: \"https://dekontaminasi.com/api/id/covid19/news\",\n }).then((data) => {\n var random = Math.floor(Math.random() * data.data.length) + 1;\n var tanggal = new Date(data.data[random].timestamp).toLocaleDateString(\n \"id\"\n );\n agent.add(\n \"Judul Berita : \" +\n data.data[random].title +\n \"\\n\\n\" +\n \"link : \" +\n data.data[random].url +\n \"\\n\\n\" +\n \"Tanggal \" +\n tanggal +\n \"\\n\\n\" +\n \"Sumber API : https://dekontaminasi.com/api/id/covid19/news\"\n );\n });\n }", "checkBallance(expectedValue){\r\n I.seeInField(locate(this.ballanceField), expectedValue);\r\n }", "bandelall() {\n\n }", "placeSalary(amount) {\n if (this.state.amount< 0.76){\n alert(\"Below minimum wage!\")\n }\n else{\n this.state.clearContract.placeSalary({\n from: this.web3.eth.accounts[0],\n value: amount\n }, (err, txHash) => {\n console.log(txHash)\n })\n }\n }", "function hitungLuasPersegiPanjang (panjang,lebar){\n //tidak ada nilai balik\n var luas = panjang * lebar\n return luas\n}", "soyAlto(){\n return this.altura >1.8\n }", "function addBudget(){\n return nicaragua.annualBudget +250000;\n}", "function karinaFaarNotifikation() {\n\n\n\n}", "function getIndCategs(array){\n const female = array.includes('Female') ? Array(boardComp.boardBrk.Female).fill(\"Female\") : [];\n const govt = array.includes('Affiliated with Government') ? Array(boardComp.boardBrk['Affiliated with Government']).fill(\"Affiliated with Government\") : [];\n const corp = array.includes('With Corporate Experience') ? Array(boardComp.boardBrk['With Corporate Experience']).fill(\"With Corporate Experience\") : [];\n\n // always in a set order\n return [\n ...female, ...govt, ...corp\n ]\n}" ]
[ "0.5487233", "0.54343534", "0.52585953", "0.523609", "0.5132479", "0.51283264", "0.5125833", "0.51216155", "0.5119371", "0.5100923", "0.5069158", "0.5052284", "0.50436556", "0.50053144", "0.49657872", "0.4920144", "0.49094117", "0.48811063", "0.48749164", "0.48537454", "0.4839126", "0.48386994", "0.48349866", "0.48185006", "0.47952357", "0.47906804", "0.47904313", "0.4789371", "0.4788861", "0.47883716", "0.47851482", "0.47796324", "0.47749168", "0.47659495", "0.47479275", "0.47459692", "0.473964", "0.4730628", "0.47271493", "0.47165886", "0.4710262", "0.47086036", "0.47007516", "0.46988827", "0.46979973", "0.46892947", "0.46892506", "0.46871835", "0.4684388", "0.46768227", "0.46669", "0.4664228", "0.4659351", "0.46558905", "0.4648688", "0.4647825", "0.4644746", "0.46410832", "0.46331525", "0.46320632", "0.4627737", "0.46276188", "0.46255723", "0.46130562", "0.46117344", "0.4609466", "0.4608682", "0.46084636", "0.46083587", "0.46078116", "0.4606998", "0.46035492", "0.45990223", "0.45986035", "0.4597833", "0.45958996", "0.4594687", "0.4587268", "0.4586047", "0.45821592", "0.45795178", "0.4579321", "0.45759785", "0.45758638", "0.45728928", "0.45719442", "0.4568553", "0.45671752", "0.45653334", "0.4559859", "0.4557767", "0.45543742", "0.45543104", "0.4551948", "0.4551402", "0.45496318", "0.45495382", "0.45460886", "0.45460156", "0.45412076", "0.45400494" ]
0.0
-1
Areas Under ECQ and GCQ until may 31
function resetHighlight_GCQ(e) { Areas_ECQ_GCQ.resetStyle(e.target); info.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inAirOpRange(startZone) {\n var zonesOut = searchGrid.zoneDistance(startZone, selectedZone);\n if (zonesOut <= (AIROP_RANGE / 2)) {\n return true; // able to return from whence they came\n } else {\n for (var i = 0; i < landingZones.length; i++) {\n var zonesBack = searchGrid.zoneDistance(selectedZone, landingZones[i]);\n if (zonesOut + zonesBack <= AIROP_RANGE) return true; //able to land somewhere else\n }\n return false;\n }\n}", "_$getArea() {\n return null;\n }", "function getAreas() {\n\tlet scalingFactor = Math.min(clientWidth / 1200, clientHeight / 1000);\n\t// Change the blocks' size according to the input surface area\n\tlet size1 = Math.min(48, 5 + Math.sqrt(area1) * scalingFactor * 8) + \"px\";\n\tlet size2 = Math.min(48, 5 + Math.sqrt(area2) * scalingFactor * 8) + \"px\";\n\t$(\".sit1block\").css({\n\t\theight: size1,\n\t\twidth: size1,\n\t\tbottom: \"51%\"\n\t});\n\n\t$(\".sit2block\").css({\n\t\theight: size2,\n\t\twidth: size2,\n\t\tbottom: \"51%\"\n\t});\n\t\n}", "_calculateBounds() {\n // FILL IN//\n }", "checkZone(entity = null, ctx = null){\n if(!entity || !ctx) return;\n\n // let zone = 0;\n\n //[{x:x,y:y,w:w,h:h},{x:x,y:y,w:w,h:h},{x:x,y:y,w:w,h:h},{x:x,y:y,w:w,h:h}]\n let [zone1,zone2,zone3,zone4] = [\n {x:0,y:0,w:ctx.width/2,h:ctx.height/2},\n {x:ctx.width/2,y:0,w:ctx.width - (ctx.width/2),h:ctx.height/2},\n {x:0,y:ctx.height/2,w:ctx.width/2,h:ctx.height - (ctx.height/2)},\n {x:ctx.width/2,y:ctx.height/2,w:ctx.width - (ctx.width/2),h:ctx.height - (ctx.height/2)}\n ],\n quad = [zone1,zone2,zone3,zone4],\n entX = entity.x+entity.width/2,\n entY = entity.y+entity.height/2;\n\n for (let c = 0; c < quad.length; c++) {\n let z = quad[c];\n if(entX < z.w && entY < z.h){ //in zone1\n // console.log(\"entity in zone 1\");\n return 1;\n }else if(entX > z.w && entX < ctx.width && entY < z.h){ //in zone2\n // console.log(\"entity in zone 2\");\n return 2;\n }else if(entX < z.w && entY > z.h && entY < ctx.height){ //in zone3\n // console.log(\"entity in zone 3\");\n return 3;\n }else if(entX > z.w && entX < ctx.width && entY > z.h && entY < ctx.height){ //in zone4\n // console.log(\"entity in zone 4\");\n return 4;\n }\n \n }\n\n }", "function checkAreas() {\n\t\tfor (var UAYgMqRNl = 0; UAYgMqRNl < UANKaqLvcZ.length; UAYgMqRNl++){\n\t\t\t// get the pixels in a note area from the blended image\n\t\t\tvar blendedData = blendContext.getImageData( UANKaqLvcZ[UAYgMqRNl].UAyjdJxcO, UANKaqLvcZ[UAYgMqRNl].UAdDfXoBtH, UANKaqLvcZ[UAYgMqRNl].UAJmGBAbF, UANKaqLvcZ[UAYgMqRNl].UAOcFeVqOh );\n\t\t\t// calculate the average lightness of the blended data\n\t\t\tvar UADRVTPQV = 0;\n\t\t\tvar UAmlCsOix = 0;\n\t\t\tvar UADkkSB = blendedData.data.length * 0.25;\n\t\t\twhile (UADRVTPQV < UADkkSB) {\n\t\t\t\tUAmlCsOix += (blendedData.data[UADRVTPQV*4] + blendedData.data[UADRVTPQV*4+1] + blendedData.data[UADRVTPQV*4+2]);\n\t\t\t\t++UADRVTPQV;\n\t\t\t}\n\t\t\t// calculate an average between of the color values of the note area [0-255]\n\t\t\tvar average = Math.round(UAmlCsOix / (3 * UADkkSB));\n\t\t\tif (average > 50){ // more than 20% movement detected\n\t\t\t\tif (UANKaqLvcZ[UAYgMqRNl].name == 'down' ){\n\t\t\t\t\tvar UAKBYsh = andizxc(document).scrollTop();\n\t\t\t\t\twindow.scroll( UAKBYsh, UAKBYsh+100) ; \n\t\t\t\t}\n\t\t\t\tif (UANKaqLvcZ[UAYgMqRNl].name == 'up' ){\n\t\t\t\t\tvar UAKBYsh = andizxc(document).scrollTop();\n\t\t\t\t\twindow.scroll( UAKBYsh, UAKBYsh-100) ; \n\t\t\t\t}\n\t\t\t\tif (UANKaqLvcZ[b].name == 'left' ){\n\t\t\t\t\tvar UAKBYsh = UA.UAYfVXIS.length;\n\t\t\t\t\tvar UAPPylhwc = UA.UAUfjEOdaK;\n\t\t\t\t\tif( UA.UAUfjEOdaK >= (UAKBYsh-1) ){\n\t\t\t\t\t\tUA.UAUfjEOdaK = 0;\n\t\t\t\t\t\tUAPPylhwc = -1;\n\t\t\t\t\t}\n\t\t\t\t\tandizxc(UA.UAYfVXIS[UAPPylhwc+1]).focus();\n\t\t\t\t\tUA.UAUfjEOdaK = UAPPylhwc+1;\n\t\t\t\t}\n\t\t\t\tif (UANKaqLvcZ[UAYgMqRNl].name == 'right' ){\n\t\t\t\t\tvar UAKBYsh = UA.UAYfVXIS.length;\n\t\t\t\t\tvar UAPPylhwc = UA.UAUfjEOdaK;\n\t\t\t\t\tif( UA.UAUfjEOdaK <= 0) {\n\t\t\t\t\t\tUA.UAUfjEOdaK = UAKBYsh;\n\t\t\t\t\t\tUAPPylhwc = UAKBYsh;\n\t\t\t\t\t}\n\t\t\t\t\tandizxc(UA.UAYfVXIS[UAPPylhwc-1]).focus();\n\t\t\t\t\tUA.UAUfjEOdaK = UAPPylhwc-1;\n\t\t\t\t}\n\t\t\t\tif (UANKaqLvcZ[UAYgMqRNl].name == 'enter' ){\n\t\t\t\t\t\n\t\t\t\t\tvar curElement = document.activeElement;\n\t\t\t\t\tif(curElement.tagName == 'A'){\n\t\t\t\t\t\tcurElement.click();\n\t\t\t\t\t\twindow.location = curElement.href;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcurElement.click();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tconsole.log( \"Button \" + UANKaqLvcZ[UAYgMqRNl].name + \" triggered.\" ); // do stuff\n\t\t\t\t//messageArea.innerHTML = \"<font size='+4' color='#000'><b>Button \" + UANKaqLvcZ[b].name + \" triggered.</b></font>\";\n\t\t\t}\n\t\t}\n\t}", "function isComplete(area) {\n\tif (area.expert === undefined) area.expert = 0;\n\tif (area.advanced === undefined) area.advanced = 0;\n\tif (area.yearlySnowfall === undefined ) area.yearlySnowfall = 0;\n\treturn ( area.state && area.vertical && area.skiableAcres );\n}", "allTerritoriesClaimed(){\r\n let claimedCount = 0;\r\n Object.keys(this.mapGrid.hashOfTiles).forEach( pointer => {\r\n let tile = this.mapGrid.hashOfTiles[pointer];\r\n if (tile.status === true){\r\n claimedCount += 1;\r\n }\r\n })\r\n \r\n if (claimedCount === this.mapGrid.size - 6){\r\n this.claimTerritoryPhase = false; // this will NOT be REACTIVATED\r\n this.initialPlacementPhase = true; \r\n } \r\n }", "function bound() {\n ['top', 'bottom', 'tlc', 'left', 'blc', 'trc', 'right', 'brc'].forEach((piece) => {\n equilibriate(piece, 0, params.u0, 1);\n });\n}", "function bounds() {\n return {\n start: conductor.displayStart(),\n end: conductor.displayEnd(),\n domain: conductor.domain().key\n };\n }", "function e(e){switch(e){case\"above-along\":case\"below-along\":case\"center-along\":case\"esriServerLinePlacementAboveAlong\":case\"esriServerLinePlacementBelowAlong\":case\"esriServerLinePlacementCenterAlong\":return!0;default:return!1}}", "get bounds() {}", "function pre_kill_chaos(){\n\n var chaos_list = [];\n var max_tau = 0;\n coresetData.forEach(function(d){\n\n if(d.color != \"#f7f4f9\"){\n var newll = new google.maps.LatLng(parseFloat(d.x), parseFloat(d.y));\n var newll_c = new google.maps.LatLng(parseFloat(d.x)+0.04, parseFloat(d.y));\n\n var newpoint = mapProjection.fromLatLngToPoint(newll);\n var newpoint_c = mapProjection.fromLatLngToPoint(newll_c);\n\n if(d.color != \"#f7f4f9\"){\n\n // if the rect in chosen range.\n if((sw.lat() <= d.x && ne.lat() >= d.x + delta)\n && (ne.lng() >= d.y && sw.lng() <= d.y + delta)){\n\n chaos_list.push(d);\n var cur_tau = d.value/max;\n\n if(cur_tau > max_tau){\n max_tau = cur_tau;\n }\n\n }\n }\n }\n });\n return max_tau;\n}", "function checkBounds() {\n // return;\n // Perform the check and return if OK\n if (allowedBounds.contains(map.getCenter())) {\n return;\n }\n // It`s not OK, so find the nearest allowed point and move there\n var C = map.getCenter();\n var X = C.lng();\n var Y = C.lat();\n\n // var AmaxX = allowedBounds.getNorthEast().lng();\n var AmaxY = allowedBounds.getNorthEast().lat();\n // var AminX = allowedBounds.getSouthWest().lng();\n var AminY = allowedBounds.getSouthWest().lat();\n\n // if (X < AminX) {X = AminX;}\n // if (X > AmaxX) {X = AmaxX;}\n if (Y < AminY) {Y = AminY;}\n if (Y > AmaxY) {Y = AmaxY;}\n //alert (\"Restricting \"+Y+\" \"+X);\n map.setCenter(new google.maps.LatLng(Y,X));\n } // checkBounds", "function location_validation (location){\n /*\n THis function generate the co-ordination\n input: section elements\n return : true or false depend on the section loaction\n */\n const bounderies = location.getBoundingClientRect();\n /*\n the boundries between 1200 and 0,since the section around 650 so \n we don't want to dis-activate the animation once we get out of 650\n */\n if ((bounderies.top>0) && (1200>=bounderies.bottom>0) ){\n return true\n }else{\n return false\n }\n }", "allocateCautionArea() {\n const calNum = (n) => [n - 1, n, n + 1];\n const calCasIndex = (index) => {\n let [a , b] = index.split('-');\n let front = calNum(parseInt(a, 10));\n const frontcheck = (n) => n < this.length && n > -1;\n let back = calNum(parseInt(b, 10));\n const backcheck = (n) => n < this.length && n > -1;\n let Indexes = [];\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 3; j++) {\n if (frontcheck(front[i]) && backcheck(back[j])) {\n Indexes.push(front[i] + '-' + back[j]);\n }\n }\n }\n let resultIndex = [];\n Indexes.map((el) => {\n if (!this.mines.includes(el)) {\n resultIndex.push(el);\n return true;\n } else {\n return false;\n }\n });\n return resultIndex;\n }\n const C = [];\n this.mines.map((el) => calCasIndex(el)).map(e => C.push(...e)); \n return C;\n }", "function checkCase(y,x){\n\n var northWest = false;\n var northEast = false;\n var southWest = false;\n var southEast = false;\n var result = [];\n //check northWest Block\n\n if(x == 0 || y == 0){\n northWest = true;\n }else{\n if($scope.cell[y- 1][x - 1].isObstacle){\n northWest = true;\n }\n }\n\n //check northEast Block\n if(y == 0 || x == 30){\n northEast = true;\n }else{\n if($scope.cell[y -1][x].isObstacle){\n northEast = true;\n }\n }\n\n //check southWest Block\n if(x == 0 || y == 20){\n southWest = true;\n }else{\n if($scope.cell[y][x - 1].isObstacle){\n southWest = true;\n }\n }\n //check southEast Block\n if(x == 30 || y == 20){\n southEast = true;\n }else{\n if($scope.cell[y][x].isObstacle){\n southEast = true;\n }\n }\n\n if(!northWest && !northEast && !southWest && !southEast){\n result[0] = 0;\n result[1] = [];\n result[1] = [1,1,1,1];\n return result; // all way normal\n }\n\n //three way normal\n if(northWest && !northEast && !southWest && !southEast){\n result[0] = 0;\n result[1] = [];\n result[1] = [0,1,1,1];\n return result; //except northwest\n }\n\n if(!northWest && northEast && !southWest && !southEast){\n result[0] = 0;\n result[1] = [];\n result[1] = [1,0,1,1];\n return result; //except northeast\n }\n if (!northWest && !northEast && southWest && !southEast){\n result[0] = 0;\n result[1] = [];\n result[1] = [1,1,1,0];\n return result; //except southwest\n }\n if(!northWest && !northEast && !southWest && southEast){\n result[0] = 0;\n result[1] = [];\n result[1] = [1,1,0,1];\n return result; //except southeast\n }\n\n\n //two way normal\n if(northWest && northEast && !southWest && !southEast){\n result[0] = 0;\n result[1] = [];\n result[1] = [0,0,1,1];\n return result; //except northwest and east\n }\n if(!northWest && northEast && !southWest && southEast){\n result[0] = 0;\n result[1] = [];\n result[1] = [1,0,0,1];\n return result; //except northeast and southeast\n }\n if(!northWest && !northEast && southWest && southEast){\n result[0] = 0;\n result[1] = [];\n result[1] = [1,1,0,0];\n return result; //except southwest and southeast\n }\n\n if(northWest && !northEast && southWest && !southEast){\n result[0] = 0;\n result[1] = [];\n result[1] = [0,1,1,0];\n return result; //except southwest and northwest\n }\n\n\n //one corner\n if(northWest && northEast && southWest && !southEast){\n result[0] = 1; // one corner\n result[1] = [];\n result[1] = [0,0,1,0];\n return result;\n }\n if (northWest && northEast && !southWest && southEast){\n result[0] = 1; // one corner\n result[1] = [];\n result[1] = [0,0,0,1];\n return result;\n }\n if(!northWest && northEast && southWest && southEast){\n result[0] = 1; // one corner\n result[1] = [];\n result[1] = [1,0,0,0];\n return result;\n }\n if (northWest && !northEast && southWest && southEast){\n result[0] = 1; // one corner\n result[1] = [];\n result[1] = [0,1,0,0];\n return result;\n }\n\n\n //two corners\n if(!northWest && northEast && southWest && !southEast){\n result[0] = 2; // two corners\n result[1] = [];\n result[1] = [1,0,1,0];\n return result;\n }\n if(northWest && !northEast && !southWest && southEast){\n result[0] = 2; // two corners\n result[1] = [];\n result[1] = [0,1,0,1];\n return result;\n }\n\n }", "estaForaDasBounds() {\n if (this.getBird().getPosHeigth() > this.getMaxHeightArena()) {\n // console.log(\"height do passaro fora dos bounds (abaixo)\");\n this.getBird().setPosHeight(this.getMaxHeightArena());\n } else if (this.getBird().getPosWidth() > this.getMaxWidthArena()) {\n // console.log(\"width do passaro fora dos bounds (direita)\");\n this.getBird().setPosWidth(this.getMaxWidthArena());\n }\n }", "static area(p, q, r) {\n return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n }", "function getFreshAreas() {\n return [\n {\n area: 'Castle Corridor',\n rooms: [\n {\n _area: 0,\n _room: 0,\n address: 139521948,\n mapX: 128,\n mapY: 9,\n mapWidth: 2,\n mapHeight: 3,\n doorList: 139521932,\n doors: [\n {\n _door: 0,\n address: 139521932,\n destination: 139522396,\n xPos: 2,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139521948,\n complement: 139522348,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: -3,\n destination: 139521948,\n xPos: 0,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139521948,\n complement: -3,\n isFakeDoor: true,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139528664,\n xPos: 384,\n yPos: 184,\n type: 4,\n subtype: 4,\n varA: 71,\n varB: 38,\n flag: 0x5109dd,\n },\n ],\n isBeginningRoom: true,\n isShopRoom: true,\n },\n {\n _area: 0,\n _room: 1,\n address: 139522076,\n mapX: 2,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139522060,\n doors: [\n {\n _door: 0,\n address: 139522060,\n destination: 139522228,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 768,\n direction: DIR.RIGHT,\n sourceRoom: 139522076,\n complement: 139522196,\n },\n ],\n items: [],\n isWarpRoom: true,\n },\n {\n _area: 0,\n _room: 2,\n address: 139522228,\n mapX: 131,\n mapY: 8,\n mapWidth: 2,\n mapHeight: 4,\n doorList: 139522196,\n doors: [\n {\n _door: 0,\n address: 139522196,\n destination: 139522076,\n xPos: 255,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139522228,\n complement: 139522060,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT],\n },\n {\n item: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139522212,\n destination: 139522396,\n xPos: 0,\n yPos: 4,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139522228,\n complement: 139522364,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT],\n },\n {\n item: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139528940,\n xPos: 256,\n yPos: 472,\n type: 4,\n subtype: 3,\n varA: 33,\n varB: 16,\n flag: 0x510af1,\n },\n {\n _item: 1,\n address: 139528952,\n xPos: 456,\n yPos: 584,\n type: 4,\n subtype: 3,\n varA: 46,\n varB: 50,\n flag: 0x510afd,\n },\n ],\n },\n {\n _area: 0,\n _room: 3,\n address: 139522396,\n mapX: 130,\n mapY: 10,\n mapWidth: 5,\n mapHeight: 1,\n doorList: 139522348,\n doors: [\n {\n _door: 0,\n address: 139522348,\n destination: 139521948,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139522396,\n complement: 139521932,\n isWoodenDoor: true,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139522364,\n destination: 139522228,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 768,\n direction: DIR.UP,\n sourceRoom: 139522396,\n complement: 139522212,\n },\n {\n _door: 2,\n address: 139522380,\n destination: 139522708,\n xPos: 5,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139522396,\n complement: 139522644,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 4,\n address: 139522532,\n mapX: 6,\n mapY: 11,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139522500,\n doors: [\n {\n _door: 0,\n address: 139522500,\n destination: 139568516,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139522532,\n complement: 139568484,\n },\n {\n _door: 1,\n address: 139522516,\n destination: 139522708,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139522532,\n complement: 139522676,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 0,\n _room: 5,\n address: 139522708,\n mapX: 135,\n mapY: 10,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139522644,\n doors: [\n {\n _door: 0,\n address: 139522644,\n destination: 139522396,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1040,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139522708,\n complement: 139522380,\n },\n {\n _door: 1,\n address: 139522660,\n destination: 139522860,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139522708,\n complement: 139522828,\n },\n {\n _door: 2,\n address: 139522676,\n destination: 139522532,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139522708,\n complement: 139522516,\n isWoodenDoor: true,\n },\n {\n _door: 3,\n address: 139522692,\n destination: 139527428,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139522708,\n complement: 139527412,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139529204,\n xPos: 208,\n yPos: 248,\n type: 4,\n subtype: 3,\n varA: 17,\n varB: 3,\n flag: 0x510bf9,\n },\n {\n _item: 1,\n address: 139529228,\n xPos: 256,\n yPos: 88,\n type: 4,\n subtype: 4,\n varA: 64,\n varB: 25,\n flag: 0x510c11,\n },\n {\n _item: 2,\n address: 139529240,\n xPos: 256,\n yPos: 376,\n type: 4,\n subtype: 8,\n varA: 1,\n varB: 1,\n flag: 0x510c1d,\n },\n ],\n },\n {\n _area: 0,\n _room: 6,\n address: 139522860,\n mapX: 137,\n mapY: 10,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139522828,\n doors: [\n {\n _door: 0,\n address: 139522828,\n destination: 139522708,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139522860,\n complement: 139522660,\n },\n {\n _door: 1,\n address: 139522844,\n destination: 139523316,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 1280,\n direction: DIR.RIGHT,\n sourceRoom: 139522860,\n complement: 139523284,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 7,\n address: 139522996,\n mapX: 140,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139522964,\n doors: [\n {\n _door: 0,\n address: 139522964,\n destination: 139544672,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139522996,\n complement: 139544656,\n },\n {\n _door: 1,\n address: 139522980,\n destination: 139523148,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139522996,\n complement: 139523116,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 0,\n _room: 8,\n address: 139523148,\n mapX: 141,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139523116,\n doors: [\n {\n _door: 0,\n address: 139523116,\n destination: 139522996,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139523148,\n complement: 139522980,\n isWoodenDoor: true,\n },\n {\n _door: 1,\n address: 139523132,\n destination: 139523316,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139523148,\n complement: 139523268,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 9,\n address: 139523316,\n mapX: 12,\n mapY: 8,\n mapWidth: 2,\n mapHeight: 6,\n doorList: 139523268,\n doors: [\n {\n _door: 0,\n address: 139523268,\n destination: 139523148,\n xPos: 1,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139523316,\n complement: 139523132,\n },\n {\n _door: 1,\n address: 139523284,\n destination: 139522860,\n xPos: 255,\n yPos: 5,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139523316,\n complement: 139522844,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.LONG],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.LONG],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139523300,\n destination: 139523468,\n xPos: 2,\n yPos: 5,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139523316,\n complement: 139523436,\n isBossDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.LONG],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.LONG],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139529684,\n xPos: 48,\n yPos: 1096,\n type: 4,\n subtype: 3,\n varA: 18,\n varB: 45,\n flag: 0x510dd9,\n },\n ],\n },\n {\n _area: 0,\n _room: 10,\n address: 139523468,\n mapX: 142,\n mapY: 10,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139523436,\n doors: [\n {\n _door: 0,\n address: 139523436,\n destination: 139523316,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 1280,\n direction: DIR.LEFT,\n sourceRoom: 139523468,\n complement: 139523300,\n },\n {\n _door: 1,\n address: 139523452,\n destination: 139527308,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139523468,\n complement: 139527244,\n },\n ],\n items: [],\n isBossRoom: true,\n },\n {\n _area: 0,\n _room: 11,\n address: 139523596,\n mapX: 15,\n mapY: 11,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139523580,\n doors: [\n {\n _door: 0,\n address: 139523580,\n destination: 139527308,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139523596,\n complement: 139527276,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139529936,\n xPos: 48,\n yPos: 144,\n type: 4,\n subtype: 2,\n varA: 95,\n varB: 5,\n flag: 0x510ed5,\n },\n ],\n },\n {\n _area: 0,\n _room: 12,\n address: 139523804,\n mapX: 16,\n mapY: 8,\n mapWidth: 1,\n mapHeight: 5,\n doorList: 139523772,\n doors: [\n {\n _door: 0,\n address: 139523772,\n destination: 139523956,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139523804,\n complement: 139523924,\n },\n {\n _door: 1,\n address: 139523788,\n destination: 139527308,\n xPos: 0,\n yPos: 5,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139523804,\n complement: 139527228,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 13,\n address: 139523956,\n mapX: 17,\n mapY: 8,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139523924,\n doors: [\n {\n _door: 0,\n address: 139523924,\n destination: 139523804,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139523956,\n complement: 139523772,\n },\n {\n _door: 1,\n address: 139523940,\n destination: 139524260,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139523956,\n complement: 139524228,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139530080,\n xPos: 128,\n yPos: 176,\n type: 4,\n subtype: 2,\n varA: 90,\n varB: 0,\n flag: 0x510f65,\n },\n ],\n },\n {\n _area: 0,\n _room: 14,\n address: 139524076,\n mapX: 145,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139524060,\n doors: [\n {\n _door: 0,\n address: 139524060,\n destination: 139527308,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139524076,\n complement: 139527260,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 0,\n _room: 15,\n address: 139524260,\n mapX: 146,\n mapY: 7,\n mapWidth: 3,\n mapHeight: 2,\n doorList: 139524196,\n doors: [\n {\n _door: 0,\n address: 139524196,\n destination: 139526972,\n xPos: 0,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139524260,\n complement: 139526956,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.FLOAT],\n },\n {\n item: 1,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139524212,\n destination: 139527580,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139524260,\n complement: 139527548,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.LONG],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLOAT],\n },\n {\n item: 1,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139524228,\n destination: 139523956,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139524260,\n complement: 139523940,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.LONG],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLOAT],\n },\n {\n item: 1,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139524244,\n destination: 139524708,\n xPos: 3,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139524260,\n complement: 139524676,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.LONG],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLOAT],\n },\n {\n item: 1,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139530152,\n xPos: 48,\n yPos: 296,\n type: 4,\n subtype: 2,\n varA: 92,\n varB: 0,\n flag: 0x510fad,\n },\n {\n _item: 1,\n address: 139530296,\n xPos: 720,\n yPos: 296,\n type: 4,\n subtype: 4,\n varA: 50,\n varB: 9,\n flag: 0x51103d,\n },\n ],\n },\n {\n _area: 0,\n _room: 16,\n address: 139524420,\n mapX: 17,\n mapY: 11,\n mapWidth: 5,\n mapHeight: 1,\n doorList: 139524372,\n doors: [\n {\n _door: 0,\n address: 139524372,\n destination: 139527308,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139524420,\n complement: 139527292,\n access: {\n doors: [\n {\n door: 1,\n locks: [[Locks.FLIGHT], [Locks.MALPHAS, Locks.UNDINE]],\n },\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139524388,\n destination: 139524564,\n xPos: 3,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139524420,\n complement: 139524548,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139524404,\n destination: 139526292,\n xPos: 5,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139524420,\n complement: 139526260,\n isWoodenDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SKULA],\n },\n {\n door: 1,\n locks: [\n [Locks.FLIGHT, Locks.SKULA],\n [Locks.MALPHAS, Locks.UNDINE, Locks.SKULA],\n ],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139530560,\n xPos: 1136,\n yPos: 104,\n type: 4,\n subtype: 6,\n varA: 2,\n varB: 1,\n flag: 0x511145,\n },\n ],\n },\n {\n _area: 0,\n _room: 17,\n address: 139524564,\n mapX: 20,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139524532,\n doors: [\n {\n _door: 0,\n address: 139524532,\n destination: 139524852,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139524564,\n complement: 139524820,\n },\n {\n _door: 1,\n address: 139524548,\n destination: 139524420,\n xPos: 0,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139524564,\n complement: 139524388,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS], // Black Panther unlocks, but eh\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 18,\n address: 139524708,\n mapX: 21,\n mapY: 8,\n mapWidth: 7,\n mapHeight: 1,\n doorList: 139524676,\n doors: [\n {\n _door: 0,\n address: 139524676,\n destination: 139524260,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139524708,\n complement: 139524244,\n },\n {\n _door: 1,\n address: 139524692,\n destination: 139525020,\n xPos: 7,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.RIGHT,\n sourceRoom: 139524708,\n complement: 139524988,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 19,\n address: 139524852,\n mapX: 21,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139524820,\n doors: [\n {\n _door: 0,\n address: 139524820,\n destination: 139524564,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139524852,\n complement: 139524532,\n },\n {\n _door: 1,\n address: 139524836,\n destination: 139526156,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139524852,\n complement: 139526124,\n isWoodenDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 20,\n address: 139525020,\n mapX: 28,\n mapY: 7,\n mapWidth: 2,\n mapHeight: 3,\n doorList: 139524972,\n doors: [\n {\n _door: 0,\n address: 139524972,\n destination: 139525172,\n xPos: 1,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139525020,\n complement: 139525156,\n },\n {\n _door: 1,\n address: 139524988,\n destination: 139524708,\n xPos: 255,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1552,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139525020,\n complement: 139524692,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139525004,\n destination: 139525316,\n xPos: 2,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139525020,\n complement: 139525284,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 21,\n address: 139525172,\n mapX: 157,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139525140,\n doors: [\n {\n _door: 0,\n address: 139525140,\n destination: 139526428,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139525172,\n complement: 139526412,\n isWoodenDoor: true,\n },\n {\n _door: 1,\n address: 139525156,\n destination: 139525020,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139525172,\n complement: 139524972,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 22,\n address: 139525316,\n mapX: 30,\n mapY: 8,\n mapWidth: 5,\n mapHeight: 1,\n doorList: 139525284,\n doors: [\n {\n _door: 0,\n address: 139525284,\n destination: 139525020,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139525316,\n complement: 139525004,\n },\n {\n _door: 1,\n address: 139525300,\n destination: 139525484,\n xPos: 5,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139525316,\n complement: 139525452,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 23,\n address: 139525484,\n mapX: 163,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139525436,\n doors: [\n {\n _door: 0,\n address: 139525436,\n destination: 139526564,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139525484,\n complement: 139526532,\n isWoodenDoor: true,\n },\n {\n _door: 1,\n address: 139525452,\n destination: 139525316,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1040,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139525484,\n complement: 139525300,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139525468,\n destination: 139525628,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139525484,\n complement: 139525596,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 24,\n address: 139525628,\n mapX: 36,\n mapY: 8,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139525596,\n doors: [\n {\n _door: 0,\n address: 139525596,\n destination: 139525484,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139525628,\n complement: 139525468,\n },\n {\n _door: 1,\n address: 139525612,\n destination: 139525868,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139525628,\n complement: 139525804,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 25,\n address: 139525868,\n mapX: 39,\n mapY: 8,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139525804,\n doors: [\n {\n _door: 0,\n address: 139525804,\n destination: 139525628,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139525868,\n complement: 139525612,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.BAT],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139525820,\n destination: 139526684,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139525868,\n complement: 139526668,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.BAT],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139525836,\n destination: 139528452,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139525868,\n complement: 139528404,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.BAT],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139525852,\n destination: 139526020,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139525868,\n complement: 139525988,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.BAT],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139531460,\n xPos: 32,\n yPos: 88,\n type: 4,\n subtype: 3,\n varA: 39,\n varB: 32,\n flag: 0x5114c9,\n },\n ],\n },\n {\n _area: 0,\n _room: 26,\n address: 139526020,\n mapX: 168,\n mapY: 8,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139525988,\n doors: [\n {\n _door: 0,\n address: 139525988,\n destination: 139525868,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139526020,\n complement: 139525852,\n },\n {\n _door: 1,\n address: 139526004,\n destination: 139526820,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139526020,\n complement: 139526788,\n isWoodenDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 27,\n address: 139526156,\n mapX: 22,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139526124,\n doors: [\n {\n _door: 0,\n address: 139526124,\n destination: 139524852,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139526156,\n complement: 139524836,\n },\n {\n _door: 1,\n address: 139526140,\n destination: 139555712,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139526156,\n complement: 139555680,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 0,\n _room: 28,\n address: 139526292,\n mapX: 22,\n mapY: 11,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139526260,\n doors: [\n {\n _door: 0,\n address: 139526260,\n destination: 139524420,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1040,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139526292,\n complement: 139524404,\n },\n {\n _door: 1,\n address: 139526276,\n destination: 139571452,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139526292,\n complement: 139571404,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 0,\n _room: 29,\n address: 139526428,\n mapX: 156,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139526396,\n doors: [\n {\n _door: 0,\n address: 139526396,\n destination: 139592032,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139526428,\n complement: 139592016,\n },\n {\n _door: 1,\n address: 139526412,\n destination: 139525172,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139526428,\n complement: 139525140,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 0,\n _room: 30,\n address: 139526564,\n mapX: 164,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139526532,\n doors: [\n {\n _door: 0,\n address: 139526532,\n destination: 139525484,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139526564,\n complement: 139525436,\n },\n {\n _door: 1,\n address: 139526548,\n destination: 139565080,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139526564,\n complement: 139565048,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 0,\n _room: 31,\n address: 139526684,\n mapX: 40,\n mapY: 8,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139526668,\n doors: [\n {\n _door: 0,\n address: 139526668,\n destination: 139525868,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139526684,\n complement: 139525820,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 0,\n _room: 32,\n address: 139526820,\n mapX: 170,\n mapY: 8,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139526788,\n doors: [\n {\n _door: 0,\n address: 139526788,\n destination: 139526020,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139526820,\n complement: 139526004,\n },\n {\n _door: 1,\n address: 139526804,\n destination: 139533396,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139526820,\n complement: 139533332,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 0,\n _room: 33,\n address: 139526972,\n mapX: 18,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139526940,\n doors: [\n {\n _door: 0,\n address: 139526940,\n destination: 139527108,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139526972,\n complement: 139527076,\n isWoodenDoor: true,\n },\n {\n _door: 1,\n address: 139526956,\n destination: 139524260,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 16,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139526972,\n complement: 139524196,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 34,\n address: 139527108,\n mapX: 19,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139527076,\n doors: [\n {\n _door: 0,\n address: 139527076,\n destination: 139526972,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139527108,\n complement: 139526940,\n },\n {\n _door: 1,\n address: 139527092,\n destination: 139552016,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139527108,\n complement: 139552000,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 0,\n _room: 35,\n address: 139527308,\n mapX: 144,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139527228,\n doors: [\n {\n _door: 0,\n address: 139527228,\n destination: 139523804,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 1024,\n direction: DIR.UP,\n sourceRoom: 139527308,\n complement: 139523788,\n },\n {\n _door: 1,\n address: 139527244,\n destination: 139523468,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139527308,\n complement: 139523452,\n isBossDoor: true,\n },\n {\n _door: 2,\n address: 139527260,\n destination: 139524076,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139527308,\n complement: 139524060,\n },\n {\n _door: 3,\n address: 139527276,\n destination: 139523596,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139527308,\n complement: 139523580,\n isBreakableDoor: true,\n },\n {\n _door: 4,\n address: 139527292,\n destination: 139524420,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139527308,\n complement: 139524372,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139531616,\n xPos: 208,\n yPos: 152,\n type: 4,\n subtype: 2,\n varA: 81,\n varB: 29,\n flag: 0x511565,\n },\n ],\n },\n {\n _area: 0,\n _room: 36,\n address: 139527428,\n mapX: 9,\n mapY: 11,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139527412,\n doors: [\n {\n _door: 0,\n address: 139527412,\n destination: 139522708,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139527428,\n complement: 139522692,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 0,\n _room: 37,\n address: 139527580,\n mapX: 149,\n mapY: 7,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139527548,\n doors: [\n {\n _door: 0,\n address: 139527548,\n destination: 139524260,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139527580,\n complement: 139524212,\n },\n {\n _door: 1,\n address: 139527564,\n destination: 139527748,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139527580,\n complement: 139527716,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 38,\n address: 139527748,\n mapX: 24,\n mapY: 7,\n mapWidth: 3,\n mapHeight: 2,\n doorList: 139527700,\n doors: [\n {\n _door: 0,\n address: 139527700,\n destination: 139527884,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139527748,\n complement: 139527868,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT],\n },\n {\n item: 1,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139527716,\n destination: 139527580,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139527748,\n complement: 139527564,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL], // Not requiring Any% jump\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT],\n },\n {\n item: 1,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139527732,\n destination: 139528020,\n xPos: 3,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139527748,\n complement: 139528004,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL], // Not requiring Any% jump\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT],\n },\n {\n item: 1,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139531796,\n xPos: 80,\n yPos: 152,\n type: 4,\n subtype: 4,\n varA: 62,\n varB: 21,\n flag: 0x511619,\n },\n {\n _item: 1,\n address: 139531832,\n xPos: 176,\n yPos: 136,\n type: 4,\n subtype: 2,\n varA: 93,\n varB: 0,\n flag: 0x51163d,\n },\n ],\n },\n {\n _area: 0,\n _room: 39,\n address: 139527884,\n mapX: 27,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139527868,\n doors: [\n {\n _door: 0,\n address: 139527868,\n destination: 139527748,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139527884,\n complement: 139527700,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.SMALL], // Can't assume Catoblepas will be there in case of enemy rando\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139532048,\n xPos: 176,\n yPos: 104,\n type: 4,\n subtype: 4,\n varA: 51,\n varB: 10,\n flag: 0x511715,\n },\n ],\n },\n {\n _area: 0,\n _room: 40,\n address: 139528020,\n mapX: 155,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139528004,\n doors: [\n {\n _door: 0,\n address: 139528004,\n destination: 139527748,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139528020,\n complement: 139527732,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139532084,\n xPos: 176,\n yPos: 136,\n type: 4,\n subtype: 4,\n varA: 68,\n varB: 30,\n flag: 0x511739,\n },\n ],\n },\n {\n _area: 0,\n _room: 41,\n address: 139528148,\n mapX: 33,\n mapY: 9,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139528132,\n doors: [\n {\n _door: 0,\n address: 139528132,\n destination: 139528292,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139528148,\n complement: 139528260,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139532132,\n xPos: 48,\n yPos: 152,\n type: 4,\n subtype: 1,\n varA: 157,\n varB: 4,\n flag: 0x511769,\n },\n ],\n },\n {\n _area: 0,\n _room: 42,\n address: 139528292,\n mapX: 34,\n mapY: 9,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139528260,\n doors: [\n {\n _door: 0,\n address: 139528260,\n destination: 139528148,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139528292,\n complement: 139528132,\n },\n {\n _door: 1,\n address: 139528276,\n destination: 139528452,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139528292,\n complement: 139528420,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 43,\n address: 139528452,\n mapX: 165,\n mapY: 8,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139528404,\n doors: [\n {\n _door: 0,\n address: 139528404,\n destination: 139525868,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139528452,\n complement: 139525836,\n },\n {\n _door: 1,\n address: 139528420,\n destination: 139528292,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139528452,\n complement: 139528276,\n },\n {\n _door: 2,\n address: 139528436,\n destination: 139528580,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139528452,\n complement: 139528564,\n },\n ],\n items: [],\n },\n {\n _area: 0,\n _room: 44,\n address: 139528580,\n mapX: 39,\n mapY: 9,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139528564,\n doors: [\n {\n _door: 0,\n address: 139528564,\n destination: 139528452,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139528580,\n complement: 139528436,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139532408,\n xPos: 192,\n yPos: 152,\n type: 4,\n subtype: 2,\n varA: 94,\n varB: 0,\n flag: 0x51187d,\n },\n ],\n },\n ],\n },\n {\n area: 'Chapel',\n rooms: [\n {\n _area: 1,\n _room: 0,\n address: 139532588,\n mapX: 169,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139532540,\n doors: [\n {\n _door: 0,\n address: 139532540,\n destination: 139535276,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139532588,\n complement: 139535260,\n },\n {\n _door: 1,\n address: 139532556,\n destination: 139532988,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139532588,\n complement: 139532956,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.LONG], [Locks.PANTHER]], // Won't require the Gravekeeper+Malphas one\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139532572,\n destination: 139534980,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139532588,\n complement: 139534948,\n isWoodenDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.LONG], [Locks.PANTHER]], // Won't require the Gravekeeper+Malphas one\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 1,\n _room: 1,\n address: 139532772,\n mapX: 170,\n mapY: 9,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139532756,\n doors: [\n {\n _door: 0,\n address: 139532756,\n destination: 139533588,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139532772,\n complement: 139533540,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139535624,\n xPos: 48,\n yPos: 120,\n type: 4,\n subtype: 2,\n varA: 131,\n varB: 8,\n flag: 0x5125cd,\n },\n ],\n },\n {\n _area: 1,\n _room: 2,\n address: 139532988,\n mapX: 170,\n mapY: 10,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139532956,\n doors: [\n {\n _door: 0,\n address: 139532956,\n destination: 139532588,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139532988,\n complement: 139532556,\n },\n {\n _door: 1,\n address: 139532972,\n destination: 139533772,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 768,\n direction: DIR.RIGHT,\n sourceRoom: 139532988,\n complement: 139533740,\n isBossDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 1,\n _room: 3,\n address: 139533188,\n mapX: 171,\n mapY: 6,\n mapWidth: 4,\n mapHeight: 4,\n doorList: 139533156,\n doors: [\n {\n _door: 0,\n address: 139533156,\n destination: 139533396,\n xPos: 1,\n yPos: 4,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139533188,\n complement: 139533348,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n {\n item: 3,\n locks: [Locks.MALPHAS], // Nontrivial, but reasonable\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139533172,\n destination: 139533396,\n xPos: 2,\n yPos: 4,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 512,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139533188,\n complement: 139533364,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n {\n item: 3,\n locks: [Locks.MALPHAS], // Nontrivial, but reasonable\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139535816,\n xPos: 128,\n yPos: 152,\n type: 4,\n subtype: 2,\n varA: 105,\n varB: 6,\n flag: 0x5125cd,\n },\n {\n _item: 1,\n address: 139535828,\n xPos: 128,\n yPos: 856,\n type: 4,\n subtype: 1,\n varA: 141,\n varB: 3,\n flag: 0x5125d9,\n },\n {\n _item: 2,\n address: 139535876,\n xPos: 312,\n yPos: 632,\n type: 4,\n subtype: 3,\n varA: 37,\n varB: 27,\n flag: 0x512609,\n },\n {\n _item: 3,\n address: 139535888,\n xPos: 320,\n yPos: 152,\n type: 4,\n subtype: 2,\n varA: 100,\n varB: 1,\n flag: 0x512615,\n },\n {\n _item: 4,\n address: 139535972,\n xPos: 784,\n yPos: 152,\n type: 4,\n subtype: 2,\n varA: 96,\n varB: 5,\n flag: 0x512669,\n },\n ],\n },\n {\n _area: 1,\n _room: 4,\n address: 139533396,\n mapX: 171,\n mapY: 8,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139533332,\n doors: [\n {\n _door: 0,\n address: 139533332,\n destination: 139526820,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139533396,\n complement: 139526804,\n },\n {\n _door: 1,\n address: 139533348,\n destination: 139533188,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 256,\n destYPos: 768,\n direction: DIR.UP,\n sourceRoom: 139533396,\n complement: 139533156,\n },\n {\n _door: 2,\n address: 139533364,\n destination: 139533188,\n xPos: 2,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 512,\n destYPos: 768,\n direction: DIR.UP,\n sourceRoom: 139533396,\n complement: 139533172,\n },\n {\n _door: 3,\n address: 139533380,\n destination: 139534132,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139533396,\n complement: 139534068,\n },\n ],\n items: [],\n },\n {\n _area: 1,\n _room: 5,\n address: 139533588,\n mapX: 43,\n mapY: 9,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139533524,\n doors: [\n {\n _door: 0,\n address: 139533524,\n destination: 139534844,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139533588,\n complement: 139534828,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139533540,\n destination: 139532772,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139533588,\n complement: 139532756,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLOAT, Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139533556,\n destination: 139535492,\n xPos: 255,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139533588,\n complement: 139535476,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLOAT, Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139533572,\n destination: 139533772,\n xPos: 2,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.RIGHT,\n sourceRoom: 139533588,\n complement: 139533708,\n isBossDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLOAT, Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139536152,\n xPos: 400,\n yPos: 184,\n type: 4,\n subtype: 1,\n varA: 143,\n varB: 3,\n flag: 0x51271d,\n },\n ],\n },\n {\n _area: 1,\n _room: 6,\n address: 139533772,\n mapX: 45,\n mapY: 9,\n mapWidth: 2,\n mapHeight: 4,\n doorList: 139533708,\n doors: [\n {\n _door: 0,\n address: 139533708,\n destination: 139533588,\n xPos: 255,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139533772,\n complement: 139533572,\n access: {\n items: [\n {\n item: 0,\n locks: [[Locks.FLIGHT], [Locks.PANTHER, Locks.MALPHAS]],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139533724,\n destination: 139534308,\n xPos: 2,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139533772,\n complement: 139534292,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.LONG], [Locks.MALPHAS]],\n },\n ],\n items: [\n {\n item: 0,\n locks: [[Locks.FLIGHT], [Locks.PANTHER, Locks.MALPHAS]],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139533740,\n destination: 139532988,\n xPos: 255,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139533772,\n complement: 139532972,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.LONG], [Locks.MALPHAS]],\n },\n ],\n items: [\n {\n item: 0,\n locks: [[Locks.FLIGHT], [Locks.PANTHER, Locks.MALPHAS]],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139533756,\n destination: 139534524,\n xPos: 2,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139533772,\n complement: 139534492,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.LONG], [Locks.MALPHAS]],\n },\n ],\n items: [\n {\n item: 0,\n locks: [[Locks.FLIGHT], [Locks.PANTHER, Locks.MALPHAS]],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139536284,\n xPos: 448,\n yPos: 120,\n type: 4,\n subtype: 3,\n varA: 42,\n varB: 37,\n flag: 0x5127a1,\n },\n ],\n isBossRoom: true,\n },\n {\n _area: 1,\n _room: 7,\n address: 139533924,\n mapX: 175,\n mapY: 7,\n mapWidth: 3,\n mapHeight: 2,\n doorList: 139533908,\n doors: [\n {\n _door: 0,\n address: 139533908,\n destination: 139534132,\n xPos: 1,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139533924,\n complement: 139534084,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139536620,\n xPos: 616,\n yPos: 216,\n type: 4,\n subtype: 3,\n varA: 20,\n varB: 40,\n flag: 0x5128f1,\n },\n ],\n },\n {\n _area: 1,\n _room: 8,\n address: 139534132,\n mapX: 175,\n mapY: 8,\n mapWidth: 3,\n mapHeight: 3,\n doorList: 139534068,\n doors: [\n {\n _door: 0,\n address: 139534068,\n destination: 139533396,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139534132,\n complement: 139533380,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139534084,\n destination: 139533924,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 256,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139534132,\n complement: 139533908,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139534100,\n destination: 139534308,\n xPos: 0,\n yPos: 3,\n destXOffset: 65520,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139534132,\n complement: 139534276,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 3,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139534116,\n destination: 139534716,\n xPos: 2,\n yPos: 3,\n destXOffset: 65520,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139534132,\n complement: 139534668,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139536692,\n xPos: 208,\n yPos: 664,\n type: 4,\n subtype: 1,\n varA: 140,\n varB: 5,\n flag: 0x512939,\n },\n {\n _item: 1,\n address: 139536836,\n xPos: 672,\n yPos: 152,\n type: 4,\n subtype: 1,\n varA: 142,\n varB: 3,\n flag: 0x5129c9,\n },\n ],\n },\n {\n _area: 1,\n _room: 9,\n address: 139534308,\n mapX: 47,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139534276,\n doors: [\n {\n _door: 0,\n address: 139534276,\n destination: 139534132,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 16,\n destYPos: 512,\n direction: DIR.UP,\n sourceRoom: 139534308,\n complement: 139534100,\n isBreakableDoor: true,\n },\n {\n _door: 1,\n address: 139534292,\n destination: 139533772,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139534308,\n complement: 139533724,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139536896,\n xPos: 200,\n yPos: 120,\n type: 4,\n subtype: 4,\n varA: 58,\n varB: 17,\n flag: 0x512a05,\n },\n ],\n },\n {\n _area: 1,\n _room: 10,\n address: 139534524,\n mapX: 175,\n mapY: 10,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139534492,\n doors: [\n {\n _door: 0,\n address: 139534492,\n destination: 139533772,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 768,\n direction: DIR.LEFT,\n sourceRoom: 139534524,\n complement: 139533756,\n isBossDoor: true,\n },\n {\n _door: 1,\n address: 139534508,\n destination: 139534716,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139534524,\n complement: 139534700,\n },\n ],\n items: [],\n },\n {\n _area: 1,\n _room: 11,\n address: 139534716,\n mapX: 49,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139534668,\n doors: [\n {\n _door: 0,\n address: 139534668,\n destination: 139534132,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 528,\n destYPos: 512,\n direction: DIR.UP,\n sourceRoom: 139534716,\n complement: 139534116,\n },\n {\n _door: 1,\n address: 139534684,\n destination: 139535100,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139534716,\n complement: 139535084,\n },\n {\n _door: 2,\n address: 139534700,\n destination: 139534524,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139534716,\n complement: 139534508,\n },\n ],\n items: [],\n },\n {\n _area: 1,\n _room: 12,\n address: 139534844,\n mapX: 42,\n mapY: 9,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139534828,\n doors: [\n {\n _door: 0,\n address: 139534828,\n destination: 139533588,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139534844,\n complement: 139533524,\n },\n ],\n items: [],\n isWarpRoom: true,\n },\n {\n _area: 1,\n _room: 13,\n address: 139534980,\n mapX: 42,\n mapY: 11,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139534948,\n doors: [\n {\n _door: 0,\n address: 139534948,\n destination: 139532588,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139534980,\n complement: 139532572,\n },\n {\n _door: 1,\n address: 139534964,\n destination: 139538308,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139534980,\n complement: 139538260,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 1,\n _room: 14,\n address: 139535100,\n mapX: 48,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139535084,\n doors: [\n {\n _door: 0,\n address: 139535084,\n destination: 139534716,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139535100,\n complement: 139534684,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 1,\n _room: 15,\n address: 139535276,\n mapX: 40,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139535244,\n doors: [\n {\n _door: 0,\n address: 139535244,\n destination: 139535492,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139535276,\n complement: 139535460,\n },\n {\n _door: 1,\n address: 139535260,\n destination: 139532588,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139535276,\n complement: 139532540,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 1,\n _room: 16,\n address: 139535492,\n mapX: 41,\n mapY: 10,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139535460,\n doors: [\n {\n _door: 0,\n address: 139535460,\n destination: 139535276,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139535492,\n complement: 139535244,\n },\n {\n _door: 1,\n address: 139535476,\n destination: 139533588,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.RIGHT,\n sourceRoom: 139535492,\n complement: 139533556,\n },\n ],\n items: [],\n },\n ],\n },\n {\n area: 'Study',\n rooms: [\n {\n _area: 2,\n _room: 0,\n address: 139537380,\n mapX: 39,\n mapY: 12,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139537364,\n doors: [\n {\n _door: 0,\n address: 139537364,\n destination: 139537548,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139537380,\n complement: 139537500,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139540592,\n xPos: 24,\n yPos: 120,\n type: 4,\n subtype: 2,\n varA: 133,\n varB: 20,\n flag: 0x513875,\n },\n {\n _item: 1,\n address: 139540604,\n xPos: 128,\n yPos: 184,\n type: 5,\n subtype: 3,\n varA: 47,\n varB: 51,\n isHardMode: true,\n flag: 0x513881,\n },\n ],\n },\n {\n _area: 2,\n _room: 1,\n address: 139537548,\n mapX: 40,\n mapY: 12,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139537500,\n doors: [\n {\n _door: 0,\n address: 139537500,\n destination: 139537380,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139537548,\n complement: 139537364,\n isBreakableDoor: true,\n },\n {\n _door: 1,\n address: 139537516,\n destination: 139539476,\n xPos: 0,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139537548,\n complement: 139539412,\n },\n {\n _door: 2,\n address: 139537532,\n destination: 139537852,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139537548,\n complement: 139537820,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139540724,\n xPos: 448,\n yPos: 127,\n type: 4,\n subtype: 1,\n varA: 144,\n varB: 3,\n flag: 0x5138f9,\n },\n ],\n },\n {\n _area: 2,\n _room: 2,\n address: 139537700,\n mapX: 42,\n mapY: 12,\n mapWidth: 5,\n mapHeight: 1,\n doorList: 139537668,\n doors: [\n {\n _door: 0,\n address: 139537668,\n destination: 139538308,\n xPos: 1,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139537700,\n complement: 139538292,\n },\n {\n _door: 1,\n address: 139537684,\n destination: 139538900,\n xPos: 5,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139537700,\n complement: 139538852,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139540748,\n xPos: 128,\n yPos: 184,\n type: 4,\n subtype: 2,\n varA: 132,\n varB: 9,\n flag: 0x513911,\n },\n ],\n },\n {\n _area: 2,\n _room: 3,\n address: 139537852,\n mapX: 170,\n mapY: 12,\n mapWidth: 5,\n mapHeight: 1,\n doorList: 139537820,\n doors: [\n {\n _door: 0,\n address: 139537820,\n destination: 139537548,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139537852,\n complement: 139537532,\n },\n {\n _door: 1,\n address: 139537836,\n destination: 139538900,\n xPos: 5,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139537852,\n complement: 139538884,\n },\n ],\n items: [],\n },\n {\n _area: 2,\n _room: 4,\n address: 139538004,\n mapX: 42,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139537972,\n doors: [\n {\n _door: 0,\n address: 139537972,\n destination: 139539476,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139538004,\n complement: 139539444,\n },\n {\n _door: 1,\n address: 139537988,\n destination: 139538460,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139538004,\n complement: 139538428,\n },\n ],\n items: [],\n },\n {\n _area: 2,\n _room: 5,\n address: 139538140,\n mapX: 170,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139538124,\n doors: [\n {\n _door: 0,\n address: 139538124,\n destination: 139539628,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139538140,\n complement: 139539596,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139541228,\n xPos: 24,\n yPos: 112,\n type: 4,\n subtype: 8,\n varA: 3,\n varB: 3,\n flag: 0x513af1,\n },\n ],\n isHammerRoom: true,\n },\n {\n _area: 2,\n _room: 6,\n address: 139538308,\n mapX: 43,\n mapY: 11,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139538260,\n doors: [\n {\n _door: 0,\n address: 139538260,\n destination: 139534980,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139538308,\n complement: 139534964,\n isWoodenDoor: true,\n },\n {\n _door: 1,\n address: 139538276,\n destination: 139540252,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139538308,\n complement: 139540220,\n },\n {\n _door: 2,\n address: 139538292,\n destination: 139537700,\n xPos: 0,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139538308,\n complement: 139537668,\n },\n ],\n items: [],\n },\n {\n _area: 2,\n _room: 7,\n address: 139538460,\n mapX: 43,\n mapY: 13,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139538428,\n doors: [\n {\n _door: 0,\n address: 139538428,\n destination: 139538004,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139538460,\n complement: 139537988,\n },\n {\n _door: 1,\n address: 139538444,\n destination: 139539812,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139538460,\n complement: 139539748,\n },\n ],\n items: [],\n },\n {\n _area: 2,\n _room: 8,\n address: 139538596,\n mapX: 47,\n mapY: 11,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139538580,\n doors: [\n {\n _door: 0,\n address: 139538580,\n destination: 139540420,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139538596,\n complement: 139540388,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139541468,\n xPos: 120,\n yPos: 184,\n type: 4,\n subtype: 3,\n varA: 41,\n varB: 34,\n flag: 0x513be1,\n },\n ],\n },\n {\n _area: 2,\n _room: 9,\n address: 139538732,\n mapX: 175,\n mapY: 11,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139538716,\n doors: [\n {\n _door: 0,\n address: 139538716,\n destination: 139538900,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139538732,\n complement: 139538868,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139541492,\n xPos: 48,\n yPos: 127,\n type: 4,\n subtype: 4,\n varA: 67,\n varB: 29,\n flag: 0x513bf9,\n },\n ],\n },\n {\n _area: 2,\n _room: 10,\n address: 139538900,\n mapX: 47,\n mapY: 12,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139538852,\n doors: [\n {\n _door: 0,\n address: 139538852,\n destination: 139537700,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1040,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139538900,\n complement: 139537684,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139538868,\n destination: 139538732,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139538900,\n complement: 139538716,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139538884,\n destination: 139537852,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1040,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139538900,\n complement: 139537836,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139541588,\n xPos: 416,\n yPos: 280,\n type: 4,\n subtype: 3,\n varA: 19,\n varB: 18,\n flag: 0x513c59,\n },\n ],\n },\n {\n _area: 2,\n _room: 11,\n address: 139539036,\n mapX: 47,\n mapY: 13,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139539020,\n doors: [\n {\n _door: 0,\n address: 139539020,\n destination: 139540100,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139539036,\n complement: 139540084,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139541612,\n xPos: 48,\n yPos: 232,\n type: 4,\n subtype: 3,\n varA: 22,\n varB: 5,\n flag: 0x513c71,\n },\n ],\n },\n {\n _area: 2,\n _room: 12,\n address: 139539156,\n mapX: 39,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139539140,\n doors: [\n {\n _door: 0,\n address: 139539140,\n destination: 139539476,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139539156,\n complement: 139539428,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 2,\n _room: 13,\n address: 139539292,\n mapX: 167,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139539260,\n doors: [\n {\n _door: 0,\n address: 139539260,\n destination: 139597072,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139539292,\n complement: 139597040,\n },\n {\n _door: 1,\n address: 139539276,\n destination: 139539476,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139539292,\n complement: 139539460,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 2,\n _room: 14,\n address: 139539476,\n mapX: 40,\n mapY: 13,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139539412,\n doors: [\n {\n _door: 0,\n address: 139539412,\n destination: 139537548,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139539476,\n complement: 139537516,\n access: {\n doors: [\n {\n door: 3,\n locks: [Locks.SLIDE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139539428,\n destination: 139539156,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139539476,\n complement: 139539140,\n access: {\n doors: [\n {\n door: 3,\n locks: [Locks.SLIDE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139539444,\n destination: 139538004,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139539476,\n complement: 139537972,\n access: {\n doors: [\n {\n door: 3,\n locks: [Locks.SLIDE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139539460,\n destination: 139539292,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139539476,\n complement: 139539276,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SLIDE],\n },\n {\n door: 1,\n locks: [Locks.SLIDE],\n },\n {\n door: 2,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139541768,\n xPos: 184,\n yPos: 440,\n type: 4,\n subtype: 2,\n varA: 78,\n varB: 26,\n flag: 0x513d0d,\n },\n ],\n },\n {\n _area: 2,\n _room: 15,\n address: 139539628,\n mapX: 171,\n mapY: 13,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139539596,\n doors: [\n {\n _door: 0,\n address: 139539596,\n destination: 139538140,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139539628,\n complement: 139538124,\n },\n {\n _door: 1,\n address: 139539612,\n destination: 139539812,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139539628,\n complement: 139539780,\n },\n ],\n items: [],\n isBossRoom: true,\n },\n {\n _area: 2,\n _room: 16,\n address: 139539812,\n mapX: 45,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139539748,\n doors: [\n {\n _door: 0,\n address: 139539748,\n destination: 139538460,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139539812,\n complement: 139538444,\n },\n {\n _door: 1,\n address: 139539764,\n destination: 139539948,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139539812,\n complement: 139539932,\n },\n {\n _door: 2,\n address: 139539780,\n destination: 139539628,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139539812,\n complement: 139539612,\n isBossDoor: true,\n },\n {\n _door: 3,\n address: 139539796,\n destination: 139540100,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139539812,\n complement: 139540068,\n },\n ],\n items: [],\n },\n {\n _area: 2,\n _room: 17,\n address: 139539948,\n mapX: 46,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139539932,\n doors: [\n {\n _door: 0,\n address: 139539932,\n destination: 139539812,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139539948,\n complement: 139539764,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139542008,\n xPos: 128,\n yPos: 191,\n type: 4,\n subtype: 1,\n varA: 145,\n varB: 3,\n flag: 0x513dfd,\n },\n ],\n },\n {\n _area: 2,\n _room: 18,\n address: 139540100,\n mapX: 174,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139540068,\n doors: [\n {\n _door: 0,\n address: 139540068,\n destination: 139539812,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139540100,\n complement: 139539796,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.GRAVEKEEPER],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139540084,\n destination: 139539036,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139540100,\n complement: 139539020,\n },\n ],\n items: [],\n },\n {\n _area: 2,\n _room: 19,\n address: 139540252,\n mapX: 44,\n mapY: 11,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139540220,\n doors: [\n {\n _door: 0,\n address: 139540220,\n destination: 139538308,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139540252,\n complement: 139538276,\n },\n {\n _door: 1,\n address: 139540236,\n destination: 139540420,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139540252,\n complement: 139540372,\n },\n ],\n items: [],\n },\n {\n _area: 2,\n _room: 20,\n address: 139540420,\n mapX: 46,\n mapY: 11,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139540372,\n doors: [\n {\n _door: 0,\n address: 139540372,\n destination: 139540252,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139540420,\n complement: 139540236,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139540388,\n destination: 139538596,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139540420,\n complement: 139538580,\n },\n {\n _door: 2,\n address: 139540404,\n destination: 139540556,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139540420,\n complement: 139540540,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 2,\n _room: 21,\n address: 139540556,\n mapX: 172,\n mapY: 11,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139540540,\n doors: [\n {\n _door: 0,\n address: 139540540,\n destination: 139540420,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139540556,\n complement: 139540404,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139542200,\n xPos: 48,\n yPos: 152,\n type: 4,\n subtype: 3,\n varA: 23,\n varB: 4,\n flag: 0x513ebd,\n },\n ],\n },\n ],\n },\n {\n area: 'Dance Hall',\n rooms: [\n {\n _area: 3,\n _room: 0,\n address: 139542424,\n mapX: 3,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139542392,\n doors: [\n {\n _door: 0,\n address: 139542392,\n destination: 139542720,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139542424,\n complement: 139542688,\n },\n {\n _door: 1,\n address: 139542408,\n destination: 139545096,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139542424,\n complement: 139545080,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 1,\n address: 139542560,\n mapX: 132,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139542544,\n doors: [\n {\n _door: 0,\n address: 139542544,\n destination: 139543208,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139542560,\n complement: 139543176,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139546968,\n xPos: 120,\n yPos: 184,\n type: 4,\n subtype: 4,\n varA: 57,\n varB: 16,\n flag: 0x51515d,\n },\n ],\n },\n {\n _area: 3,\n _room: 2,\n address: 139542720,\n mapX: 4,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139542688,\n doors: [\n {\n _door: 0,\n address: 139542688,\n destination: 139542424,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139542720,\n complement: 139542392,\n },\n {\n _door: 1,\n address: 139542704,\n destination: 139546152,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139542720,\n complement: 139546104,\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 3,\n address: 139542880,\n mapX: 133,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139542864,\n doors: [\n {\n _door: 0,\n address: 139542864,\n destination: 139543608,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139542880,\n complement: 139543560,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139547040,\n xPos: 48,\n yPos: 184,\n type: 4,\n subtype: 1,\n varA: 146,\n varB: 3,\n flag: 0x5151a5,\n },\n ],\n },\n {\n _area: 3,\n _room: 4,\n address: 139543040,\n mapX: 5,\n mapY: 6,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139543008,\n doors: [\n {\n _door: 0,\n address: 139543008,\n destination: 139543208,\n xPos: 0,\n yPos: 1,\n destXOffset: 65520,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139543040,\n complement: 139543160,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139543024,\n destination: 139543608,\n xPos: 2,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 256,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139543040,\n complement: 139543592,\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 5,\n address: 139543208,\n mapX: 133,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139543160,\n doors: [\n {\n _door: 0,\n address: 139543160,\n destination: 139543040,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 16,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139543208,\n complement: 139543008,\n },\n {\n _door: 1,\n address: 139543176,\n destination: 139542560,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139543208,\n complement: 139542544,\n isBreakableDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139543192,\n destination: 139545264,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139543208,\n complement: 139545232,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 6,\n address: 139543408,\n mapX: 6,\n mapY: 7,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139543328,\n doors: [\n {\n _door: 0,\n address: 139543328,\n destination: 139546152,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139543408,\n complement: 139546120,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n {\n door: 3,\n locks: [Locks.MALPHAS],\n },\n {\n door: 4,\n locks: [Locks.MALPHAS],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139543344,\n destination: 139546360,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139543408,\n complement: 139546296,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLOAT],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139543360,\n destination: 139546152,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139543408,\n complement: 139546136,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139543376,\n destination: 139543760,\n xPos: 0,\n yPos: 2,\n destXOffset: 65520,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139543408,\n complement: 139543712,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139543392,\n destination: 139546360,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139543408,\n complement: 139546328,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139547304,\n xPos: 40,\n yPos: 344,\n type: 4,\n subtype: 3,\n varA: 21,\n varB: 42,\n flag: 0x5152ad,\n },\n ],\n },\n {\n _area: 3,\n _room: 7,\n address: 139543608,\n mapX: 6,\n mapY: 5,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139543560,\n doors: [\n {\n _door: 0,\n address: 139543560,\n destination: 139542880,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139543608,\n complement: 139542864,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT], // Can't assume enemies will be vanilla\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139543576,\n destination: 139544352,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139543608,\n complement: 139544336,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT], // Can't assume enemies will be vanilla\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139543592,\n destination: 139543040,\n xPos: 1,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 512,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139543608,\n complement: 139543024,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT], // Can't assume enemies will be vanilla\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139547628,\n xPos: 224,\n yPos: 104,\n type: 4,\n subtype: 2,\n varA: 115,\n varB: 7,\n flag: 0x5153f1,\n },\n ],\n },\n {\n _area: 3,\n _room: 8,\n address: 139543760,\n mapX: 6,\n mapY: 8,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139543712,\n doors: [\n {\n _door: 0,\n address: 139543712,\n destination: 139543408,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 16,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139543760,\n complement: 139543376,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139543728,\n destination: 139544192,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139543760,\n complement: 139544160,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139543744,\n destination: 139543912,\n xPos: 0,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 16,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139543760,\n complement: 139543880,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139547808,\n xPos: 199,\n yPos: 447,\n type: 4,\n subtype: 2,\n varA: 101,\n varB: 1,\n flag: 0x5154a5,\n },\n ],\n },\n {\n _area: 3,\n _room: 9,\n address: 139543912,\n mapX: 6,\n mapY: 9,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139543880,\n doors: [\n {\n _door: 0,\n address: 139543880,\n destination: 139543760,\n xPos: 0,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139543912,\n complement: 139543744,\n },\n {\n _door: 1,\n address: 139543896,\n destination: 139544824,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139543912,\n complement: 139544776,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 10,\n address: 139544048,\n mapX: 134,\n mapY: 9,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139544032,\n doors: [\n {\n _door: 0,\n address: 139544032,\n destination: 139545416,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139544048,\n complement: 139545384,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139547976,\n xPos: 120,\n yPos: 176,\n type: 4,\n subtype: 8,\n varA: 4,\n varB: 2,\n flag: 0x51554d,\n },\n ],\n },\n {\n _area: 3,\n _room: 11,\n address: 139544192,\n mapX: 7,\n mapY: 8,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139544160,\n doors: [\n {\n _door: 0,\n address: 139544160,\n destination: 139543760,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139544192,\n complement: 139543728,\n },\n {\n _door: 1,\n address: 139544176,\n destination: 139546520,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139544192,\n complement: 139546488,\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 12,\n address: 139544352,\n mapX: 136,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139544336,\n doors: [\n {\n _door: 0,\n address: 139544336,\n destination: 139543608,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139544352,\n complement: 139543576,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139548108,\n xPos: 192,\n yPos: 184,\n type: 4,\n subtype: 1,\n varA: 147,\n varB: 3,\n flag: 0x5155d1,\n },\n ],\n },\n {\n _area: 3,\n _room: 13,\n address: 139544528,\n mapX: 9,\n mapY: 7,\n mapWidth: 5,\n mapHeight: 1,\n doorList: 139544480,\n doors: [\n {\n _door: 0,\n address: 139544480,\n destination: 139546360,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139544528,\n complement: 139546312,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.FLIGHT], // Won't require Kicker Skeleton for progression\n },\n {\n door: 2,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139544496,\n destination: 139544968,\n xPos: 4,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139544528,\n complement: 139544952,\n isBreakableDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139544512,\n destination: 139545968,\n xPos: 5,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139544528,\n complement: 139545936,\n isWoodenDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 14,\n address: 139544672,\n mapX: 137,\n mapY: 7,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139544640,\n doors: [\n {\n _door: 0,\n address: 139544640,\n destination: 139546360,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139544672,\n complement: 139546344,\n },\n {\n _door: 1,\n address: 139544656,\n destination: 139522996,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139544672,\n complement: 139522964,\n isWoodenDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 15,\n address: 139544824,\n mapX: 9,\n mapY: 9,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139544776,\n doors: [\n {\n _door: 0,\n address: 139544776,\n destination: 139543912,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139544824,\n complement: 139543896,\n },\n {\n _door: 1,\n address: 139544792,\n destination: 139545416,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139544824,\n complement: 139545400,\n isBossDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139544808,\n destination: 139545832,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139544824,\n complement: 139545816,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 16,\n address: 139544968,\n mapX: 140,\n mapY: 6,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139544952,\n doors: [\n {\n _door: 0,\n address: 139544952,\n destination: 139544528,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1024,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139544968,\n complement: 139544496,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139548540,\n xPos: 48,\n yPos: 184,\n type: 4,\n subtype: 4,\n varA: 74,\n varB: 42,\n flag: 0x515781,\n },\n // {\n // _item: 1,\n // address: 139548552,\n // xPos: 80,\n // yPos: 191,\n // type: 1,\n // subtype: 60,\n // varA: 1,\n // varB: 0,\n // isMimic: true, // TODO: remember to deal with mimics, i guess?\n // },\n ],\n },\n {\n _area: 3,\n _room: 17,\n address: 139545096,\n mapX: 132,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139545080,\n doors: [\n {\n _door: 0,\n address: 139545080,\n destination: 139542424,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139545096,\n complement: 139542408,\n },\n ],\n items: [],\n isWarpRoom: true,\n },\n {\n _area: 3,\n _room: 18,\n address: 139545264,\n mapX: 134,\n mapY: 6,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139545232,\n doors: [\n {\n _door: 0,\n address: 139545232,\n destination: 139543208,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139545264,\n complement: 139543192,\n },\n {\n _door: 1,\n address: 139545248,\n destination: 139545592,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139545264,\n complement: 139545544,\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 19,\n address: 139545416,\n mapX: 135,\n mapY: 9,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139545384,\n doors: [\n {\n _door: 0,\n address: 139545384,\n destination: 139544048,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139545416,\n complement: 139544032,\n },\n {\n _door: 1,\n address: 139545400,\n destination: 139544824,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139545416,\n complement: 139544792,\n },\n ],\n items: [],\n isBossRoom: true,\n },\n {\n _area: 3,\n _room: 20,\n address: 139545592,\n mapX: 136,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139545544,\n doors: [\n {\n _door: 0,\n address: 139545544,\n destination: 139545264,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139545592,\n complement: 139545248,\n },\n {\n _door: 1,\n address: 139545560,\n destination: 139545712,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139545592,\n complement: 139545696,\n },\n {\n _door: 2,\n address: 139545576,\n destination: 139546360,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139545592,\n complement: 139546280,\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 21,\n address: 139545712,\n mapX: 137,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139545696,\n doors: [\n {\n _door: 0,\n address: 139545696,\n destination: 139545592,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139545712,\n complement: 139545560,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 3,\n _room: 22,\n address: 139545832,\n mapX: 138,\n mapY: 9,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139545816,\n doors: [\n {\n _door: 0,\n address: 139545816,\n destination: 139544824,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139545832,\n complement: 139544808,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 3,\n _room: 23,\n address: 139545968,\n mapX: 14,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139545936,\n doors: [\n {\n _door: 0,\n address: 139545936,\n destination: 139544528,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1040,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139545968,\n complement: 139544512,\n },\n {\n _door: 1,\n address: 139545952,\n destination: 139549904,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139545968,\n complement: 139549888,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 3,\n _room: 24,\n address: 139546152,\n mapX: 5,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139546104,\n doors: [\n {\n _door: 0,\n address: 139546104,\n destination: 139542720,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139546152,\n complement: 139542704,\n },\n {\n _door: 1,\n address: 139546120,\n destination: 139543408,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139546152,\n complement: 139543328,\n },\n {\n _door: 2,\n address: 139546136,\n destination: 139543408,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139546152,\n complement: 139543360,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 25,\n address: 139546360,\n mapX: 8,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139546280,\n doors: [\n {\n _door: 0,\n address: 139546280,\n destination: 139545592,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139546360,\n complement: 139545576,\n },\n {\n _door: 1,\n address: 139546296,\n destination: 139543408,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139546360,\n complement: 139543344,\n },\n {\n _door: 2,\n address: 139546312,\n destination: 139544528,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139546360,\n complement: 139544480,\n },\n {\n _door: 3,\n address: 139546328,\n destination: 139543408,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139546360,\n complement: 139543392,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139546344,\n destination: 139544672,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139546360,\n complement: 139544640,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 26,\n address: 139546520,\n mapX: 9,\n mapY: 8,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139546488,\n doors: [\n {\n _door: 0,\n address: 139546488,\n destination: 139544192,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139546520,\n complement: 139544176,\n },\n {\n _door: 1,\n address: 139546504,\n destination: 139546680,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139546520,\n complement: 139546648,\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 27,\n address: 139546680,\n mapX: 11,\n mapY: 8,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139546648,\n doors: [\n {\n _door: 0,\n address: 139546648,\n destination: 139546520,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139546680,\n complement: 139546504,\n },\n {\n _door: 1,\n address: 139546664,\n destination: 139546824,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139546680,\n complement: 139546808,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 3,\n _room: 28,\n address: 139546824,\n mapX: 135,\n mapY: 8,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139546808,\n doors: [\n {\n _door: 0,\n address: 139546808,\n destination: 139546680,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139546824,\n complement: 139546664,\n },\n ],\n items: [], // TODO: This has a candle that rando changes at 0x515A09\n },\n ],\n },\n {\n area: 'Inner Quarters',\n rooms: [\n {\n _area: 4,\n _room: 0,\n address: 139549424,\n mapX: 140,\n mapY: 4,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139549408,\n doors: [\n {\n _door: 0, // TODO: Vanilla requires Malphas to get high enough for the ledge. Need to figure that out\n address: 139549408,\n destination: 139549584,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139549424,\n complement: 139549552,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139552804,\n xPos: 256,\n yPos: 184,\n type: 4,\n subtype: 3,\n varA: 34,\n varB: 23,\n flag: 0x516829,\n },\n {\n _item: 1,\n address: 139552816,\n xPos: 358,\n yPos: 159,\n type: 4,\n subtype: 2,\n varA: 79,\n varB: 27,\n flag: 0x516835,\n },\n ],\n },\n {\n _area: 4,\n _room: 1,\n address: 139549584,\n mapX: 12,\n mapY: 5,\n mapWidth: 2,\n mapHeight: 3,\n doorList: 139549552,\n doors: [\n {\n _door: 0,\n address: 139549552,\n destination: 139549424,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139549584,\n complement: 139549408,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139549568,\n destination: 139549744,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139549584,\n complement: 139549712,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 4,\n _room: 2,\n address: 139549744,\n mapX: 142,\n mapY: 5,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139549712,\n doors: [\n {\n _door: 0,\n address: 139549712,\n destination: 139549584,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139549744,\n complement: 139549568,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.GALAMOTH],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139549728,\n destination: 139550128,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139549744,\n complement: 139550064,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.GALAMOTH],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 4,\n _room: 3,\n address: 139549904,\n mapX: 143,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139549872,\n doors: [\n {\n _door: 0,\n address: 139549872,\n destination: 139550128,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 768,\n direction: DIR.RIGHT,\n sourceRoom: 139549904,\n complement: 139550096,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139549888,\n destination: 139545968,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139549904,\n complement: 139545952,\n isWoodenDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139553128,\n xPos: 64,\n yPos: 88,\n type: 4,\n subtype: 2,\n varA: 106,\n varB: 6,\n flag: 0x51696d,\n },\n ],\n },\n {\n _area: 4,\n _room: 4,\n address: 139550128,\n mapX: 16,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 4,\n doorList: 139550032,\n doors: [\n {\n _door: 0,\n address: 139550032,\n destination: 139552616,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139550128,\n complement: 139552600,\n },\n {\n _door: 1,\n address: 139550048,\n destination: 139550448,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139550128,\n complement: 139550416,\n },\n {\n _door: 2,\n address: 139550064,\n destination: 139549744,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139550128,\n complement: 139549728,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139550080,\n destination: 139550600,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139550128,\n complement: 139550584,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139550096,\n destination: 139549904,\n xPos: 255,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139550128,\n complement: 139549872,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n {\n door: 2,\n locks: [Locks.SMALL],\n },\n {\n door: 3,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 5,\n address: 139550112,\n destination: 139550296,\n xPos: 0,\n yPos: 4,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139550128,\n complement: 139550264,\n isBreakableDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n {\n door: 2,\n locks: [Locks.SMALL],\n },\n {\n door: 3,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [],\n isChronomageDestination: true,\n },\n {\n _area: 4,\n _room: 5,\n address: 139550296,\n mapX: 16,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139550264,\n doors: [\n {\n _door: 0,\n address: 139550264,\n destination: 139550128,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 768,\n direction: DIR.UP,\n sourceRoom: 139550296,\n complement: 139550112,\n },\n {\n _door: 1,\n address: 139550280,\n destination: 139550936,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139550296,\n complement: 139550920,\n isBreakableDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS], // Need Malphas to actually get through hole\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139553464,\n xPos: 48,\n yPos: 152,\n type: 4,\n subtype: 2,\n varA: 102,\n varB: 1,\n flag: 0x516abd,\n },\n ],\n },\n {\n _area: 4,\n _room: 6,\n address: 139550448,\n mapX: 17,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139550416,\n doors: [\n {\n _door: 0,\n address: 139550416,\n destination: 139550128,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139550448,\n complement: 139550048,\n },\n {\n _door: 1,\n address: 139550432,\n destination: 139551232,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139550448,\n complement: 139551200,\n isBossDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 4,\n _room: 7,\n address: 139550600,\n mapX: 145,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139550584,\n doors: [\n {\n _door: 0,\n address: 139550584,\n destination: 139550128,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139550600,\n complement: 139550080,\n },\n ],\n items: [],\n },\n {\n _area: 4,\n _room: 8,\n address: 139550784,\n mapX: 145,\n mapY: 6,\n mapWidth: 6,\n mapHeight: 1,\n doorList: 139550720,\n doors: [\n {\n _door: 0,\n address: 139550720,\n destination: 139552016,\n xPos: 3,\n yPos: 1,\n destXOffset: 65520,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139550784,\n complement: 139551984,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS], // Need Malphas to actually get through hole\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139550736,\n destination: 139552192,\n xPos: 5,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.UP,\n sourceRoom: 139550784,\n complement: 139552176,\n },\n {\n _door: 2,\n address: 139550752,\n destination: 139552496,\n xPos: 6,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139550784,\n complement: 139552464,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS], // Need Malphas to actually get through hole\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139550768,\n destination: 139552328,\n xPos: 5,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139550784,\n complement: 139552312,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS], // Need Malphas to actually get through hole\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 4,\n _room: 9,\n address: 139550936,\n mapX: 17,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139550920,\n doors: [\n {\n _door: 0,\n address: 139550920,\n destination: 139550296,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139550936,\n complement: 139550280,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139553944,\n xPos: 192,\n yPos: 191,\n type: 4,\n subtype: 4,\n varA: 52,\n varB: 4,\n flag: 0x516c9d,\n },\n ],\n },\n {\n _area: 4,\n _room: 10,\n address: 139551080,\n mapX: 146,\n mapY: 2,\n mapWidth: 3,\n mapHeight: 5,\n doorList: 139551064,\n doors: [\n {\n _door: 0,\n address: 139551064,\n destination: 139551712,\n xPos: 2,\n yPos: 5,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139551080,\n complement: 139551648,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n {\n item: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139554052,\n xPos: 112,\n yPos: 184,\n type: 4,\n subtype: 3,\n varA: 26,\n varB: 9,\n flag: 0x516d09,\n },\n {\n _item: 1,\n address: 139554064,\n xPos: 656,\n yPos: 184,\n type: 4,\n subtype: 7,\n varA: 6,\n varB: 1,\n flag: 0x516d15,\n },\n ],\n },\n {\n _area: 4,\n _room: 11,\n address: 139551232,\n mapX: 18,\n mapY: 5,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139551200,\n doors: [\n {\n _door: 0,\n address: 139551200,\n destination: 139550448,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139551232,\n complement: 139550432,\n },\n {\n _door: 1,\n address: 139551216,\n destination: 139551712,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139551232,\n complement: 139551664,\n },\n ],\n items: [],\n isBossRoom: true,\n },\n {\n _area: 4,\n _room: 12,\n address: 139551368,\n mapX: 146,\n mapY: 5,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139551352,\n doors: [\n {\n _door: 0,\n address: 139551352,\n destination: 139551712,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139551368,\n complement: 139551696,\n },\n ],\n items: [],\n },\n {\n _area: 4,\n _room: 13,\n address: 139551520,\n mapX: 18,\n mapY: 6,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139551488,\n doors: [\n {\n _door: 0,\n address: 139551488,\n destination: 139552744,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139551520,\n complement: 139552728,\n },\n {\n _door: 1,\n address: 139551504,\n destination: 139552192,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.RIGHT,\n sourceRoom: 139551520,\n complement: 139552160,\n },\n ],\n items: [],\n },\n {\n _area: 4,\n _room: 14,\n address: 139551712,\n mapX: 20,\n mapY: 5,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139551648,\n doors: [\n {\n _door: 0,\n address: 139551648,\n destination: 139551080,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 512,\n destYPos: 1024,\n direction: DIR.UP,\n sourceRoom: 139551712,\n complement: 139551064,\n access: {\n doors: [\n {\n door: 2,\n locks: [\n [Locks.MALPHAS, Locks.UNDINE],\n [Locks.MALPHAS, Locks.PANTHER],\n [Locks.FLIGHT],\n ],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139551664,\n destination: 139551232,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139551712,\n complement: 139551216,\n isBossDoor: true,\n access: {\n doors: [\n {\n door: 2,\n locks: [\n [Locks.MALPHAS, Locks.UNDINE],\n [Locks.MALPHAS, Locks.PANTHER],\n [Locks.FLIGHT],\n ],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139551680,\n destination: 139552192,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139551712,\n complement: 139552144,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139551696,\n destination: 139551368,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139551712,\n complement: 139551352,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [\n [Locks.MALPHAS, Locks.UNDINE],\n [Locks.MALPHAS, Locks.PANTHER],\n [Locks.FLIGHT],\n ],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 4,\n _room: 15,\n address: 139551848,\n mapX: 153,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139551816,\n doors: [\n {\n _door: 0,\n address: 139551816,\n destination: 139552496,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139551848,\n complement: 139552480,\n },\n {\n _door: 1,\n address: 139551832,\n destination: 139592032,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139551848,\n complement: 139591984,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 4,\n _room: 16,\n address: 139552016,\n mapX: 20,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139551984,\n doors: [\n {\n _door: 0,\n address: 139551984,\n destination: 139550784,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139552016,\n complement: 139550720,\n },\n {\n _door: 1,\n address: 139552000,\n destination: 139527108,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139552016,\n complement: 139527092,\n isWoodenDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS], // Need Malphas to actually get through hole\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 4,\n _room: 17,\n address: 139552192,\n mapX: 22,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 3,\n doorList: 139552144,\n doors: [\n {\n _door: 0,\n address: 139552144,\n destination: 139551712,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139552192,\n complement: 139551680,\n },\n {\n _door: 1,\n address: 139552160,\n destination: 139551520,\n xPos: 255,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139552192,\n complement: 139551504,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139552176,\n destination: 139550784,\n xPos: 0,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1296,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139552192,\n complement: 139550736,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 4,\n _room: 18,\n address: 139552328,\n mapX: 21,\n mapY: 7,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139552312,\n doors: [\n {\n _door: 0, // Note: Need Malphas to get back out, but circumvented with Magical Ticket\n address: 139552312,\n destination: 139550784,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 1280,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139552328,\n complement: 139550768,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139555144,\n xPos: 384,\n yPos: 184,\n type: 4,\n subtype: 2,\n varA: 97,\n varB: 5,\n flag: 0x51714d,\n },\n ],\n },\n {\n _area: 4,\n _room: 19,\n address: 139552496,\n mapX: 151,\n mapY: 6,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139552464,\n doors: [\n {\n _door: 0,\n address: 139552464,\n destination: 139550784,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1296,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139552496,\n complement: 139550752,\n },\n {\n _door: 1,\n address: 139552480,\n destination: 139551848,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139552496,\n complement: 139551816,\n isWoodenDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 4,\n _room: 20,\n address: 139552616,\n mapX: 15,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139552600,\n doors: [\n {\n _door: 0,\n address: 139552600,\n destination: 139550128,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139552616,\n complement: 139550032,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 4,\n _room: 21,\n address: 139552744,\n mapX: 17,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139552728,\n doors: [\n {\n _door: 0,\n address: 139552728,\n destination: 139551520,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139552744,\n complement: 139551488,\n },\n ],\n items: [],\n isWarpRoom: true,\n },\n ],\n },\n {\n area: 'Floating Garden',\n rooms: [\n {\n _area: 5,\n _room: 0,\n address: 139555512,\n mapX: 151,\n mapY: 8,\n mapWidth: 3,\n mapHeight: 2,\n doorList: 139555432,\n doors: [\n {\n _door: 0,\n address: 139555432,\n destination: 139557600,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139555512,\n complement: 139557584,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 3,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 4,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139555448,\n destination: 139555912,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139555512,\n complement: 139555832,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139555464,\n destination: 139555712,\n xPos: 0,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139555512,\n complement: 139555632,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 3,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 4,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139555480,\n destination: 139555712,\n xPos: 1,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139555512,\n complement: 139555648,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139555496,\n destination: 139555912,\n xPos: 3,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139555512,\n complement: 139555864,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 5,\n _room: 1,\n address: 139555712,\n mapX: 151,\n mapY: 9,\n mapWidth: 3,\n mapHeight: 2,\n doorList: 139555632,\n doors: [\n {\n _door: 0,\n address: 139555632,\n destination: 139555512,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139555712,\n complement: 139555464,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139555648,\n destination: 139555512,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 256,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139555712,\n complement: 139555480,\n },\n {\n _door: 2,\n address: 139555664,\n destination: 139556112,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139555712,\n complement: 139556048,\n },\n {\n _door: 3,\n address: 139555680,\n destination: 139526156,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139555712,\n complement: 139526140,\n isWoodenDoor: true,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139555696,\n destination: 139556112,\n xPos: 3,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139555712,\n complement: 139556080,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 5,\n _room: 2,\n address: 139555912,\n mapX: 154,\n mapY: 8,\n mapWidth: 3,\n mapHeight: 2,\n doorList: 139555832,\n doors: [\n {\n _door: 0,\n address: 139555832,\n destination: 139555512,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139555912,\n complement: 139555448,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139555848,\n destination: 139556904,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139555912,\n complement: 139556872,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139555864,\n destination: 139555512,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139555912,\n complement: 139555496,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n {\n door: 4,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139555880,\n destination: 139556112,\n xPos: 0,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139555912,\n complement: 139556032,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n {\n door: 4,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139555896,\n destination: 139556112,\n xPos: 1,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139555912,\n complement: 139556064,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n {\n door: 2,\n locks: [Locks.FLIGHT],\n },\n {\n door: 3,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 5,\n _room: 3,\n address: 139556112,\n mapX: 154,\n mapY: 9,\n mapWidth: 3,\n mapHeight: 2,\n doorList: 139556032,\n doors: [\n {\n _door: 0,\n address: 139556032,\n destination: 139555912,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139556112,\n complement: 139555880,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 3,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 4,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139556048,\n destination: 139555712,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139556112,\n complement: 139555664,\n access: {\n // Needs Malphas to get to ledge past door 0\n doors: [\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 3,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 4,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139556064,\n destination: 139555912,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 256,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139556112,\n complement: 139555896,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139556080,\n destination: 139555712,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139556112,\n complement: 139555696,\n access: {\n doors: [\n // Needs Malphas to get to ledge past door 2\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139556096,\n destination: 139557448,\n xPos: 3,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139556112,\n complement: 139557432,\n access: {\n doors: [\n // Needs Malphas to get to ledge past door 2\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139558284,\n xPos: 184,\n yPos: 216,\n type: 4,\n subtype: 2,\n varA: 82,\n varB: 31,\n flag: 0x517d91,\n },\n ],\n },\n {\n _area: 5,\n _room: 4,\n address: 139556264,\n mapX: 5,\n mapY: 2,\n mapWidth: 4,\n mapHeight: 4,\n doorList: 139556232,\n doors: [\n {\n _door: 0,\n address: 139556232,\n destination: 139556904,\n xPos: 255,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139556264,\n complement: 139556888,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n {\n item: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139556248,\n destination: 139556448,\n xPos: 4,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139556264,\n complement: 139556384,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n {\n item: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139558440,\n xPos: 192,\n yPos: 328,\n type: 4,\n subtype: 1,\n varA: 155,\n varB: 5,\n flag: 0x517e2d,\n },\n {\n _item: 1,\n address: 139558680,\n xPos: 832,\n yPos: 328,\n type: 4,\n subtype: 1,\n varA: 156,\n varB: 5,\n flag: 0x517f1d,\n },\n ],\n },\n {\n _area: 5,\n _room: 5,\n address: 139556448,\n mapX: 19,\n mapY: 0,\n mapWidth: 3,\n mapHeight: 2,\n doorList: 139556384,\n doors: [\n {\n _door: 0,\n address: 139556384,\n destination: 139556264,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 784,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139556448,\n complement: 139556248,\n complement2: 139557192,\n },\n {\n _door: 1,\n address: 139556400,\n destination: 139557056,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139556448,\n complement: -4,\n },\n {\n _door: 2,\n address: 139556416,\n destination: 139557328,\n xPos: 0,\n yPos: 1,\n destXOffset: 224,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139556448,\n complement: 139557312,\n },\n {\n _door: 3,\n address: 139556432,\n destination: 139556752,\n xPos: 2,\n yPos: 2,\n destXOffset: 65520,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139556448,\n complement: 139556720,\n },\n ],\n items: [],\n },\n {\n _area: 5,\n _room: 6,\n address: 139556600,\n mapX: 19,\n mapY: 1,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139556568,\n doors: [\n {\n _door: 0,\n address: 139556568,\n destination: 139557744,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139556600,\n complement: 139557728,\n },\n {\n _door: 1,\n address: 139556584,\n destination: 139556752,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139556600,\n complement: 139556736,\n },\n ],\n items: [],\n isBossRoom: true,\n },\n {\n _area: 5,\n _room: 7,\n address: 139556752,\n mapX: 21,\n mapY: 1,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139556720,\n doors: [\n // Need Malphas to get to ledge past door 0\n {\n _door: 0,\n address: 139556720,\n destination: 139556448,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 528,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139556752,\n complement: 139556432,\n },\n {\n _door: 1,\n address: 139556736,\n destination: 139556600,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139556752,\n complement: 139556584,\n isBossDoor: true,\n isJuliusDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 5,\n _room: 8,\n address: 139556904,\n mapX: 161,\n mapY: 0,\n mapWidth: 3,\n mapHeight: 3,\n doorList: 139556872,\n doors: [\n {\n _door: 0,\n address: 139556872,\n destination: 139555912,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139556904,\n complement: 139555848,\n },\n {\n _door: 1,\n address: 139556888,\n destination: 139556264,\n xPos: 3,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.RIGHT,\n sourceRoom: 139556904,\n complement: 139556232,\n },\n ],\n items: [],\n },\n {\n _area: 5,\n _room: 9,\n address: 139557056,\n mapX: 174,\n mapY: 4,\n mapWidth: 3,\n mapHeight: 3,\n doorList: 139557024,\n doors: [\n {\n _door: 0,\n address: 139557024,\n destination: 139557208,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139557056,\n complement: 139556400,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139557040,\n destination: 139557600,\n xPos: 3,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139557056,\n complement: 139557568,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139559280,\n xPos: 392,\n yPos: 152,\n type: 4,\n subtype: 1,\n varA: 152,\n varB: 4,\n flag: 0x518175,\n },\n ],\n },\n {\n _area: 5,\n _room: 10,\n address: 139557208,\n mapX: 41,\n mapY: 3,\n mapWidth: 3,\n mapHeight: 3,\n doorList: 139557176,\n doors: [\n {\n _door: 0,\n address: 139557176,\n destination: 139565216,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139557208,\n complement: 139565200,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139557192,\n destination: 139556448,\n xPos: 3,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139557208,\n complement: 139557024,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139559472,\n xPos: 392,\n yPos: 152,\n type: 4,\n subtype: 1,\n varA: 153,\n varB: 4,\n flag: 0x518235,\n },\n ],\n },\n {\n _area: 5,\n _room: 11,\n address: 139557328,\n mapX: 147,\n mapY: 0,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139557312,\n doors: [\n {\n _door: 0,\n address: 139557312,\n destination: 139556448,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 256,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139557328,\n complement: 139556416,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 5,\n _room: 12,\n address: 139557448,\n mapX: 29,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139557432,\n doors: [\n {\n _door: 0,\n address: 139557432,\n destination: 139556112,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139557448,\n complement: 139556096,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 5,\n _room: 13,\n address: 139557600,\n mapX: 12,\n mapY: 1,\n mapWidth: 3,\n mapHeight: 3,\n doorList: 139557568,\n doors: [\n {\n _door: 0,\n address: 139557568,\n destination: 139557056,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139557600,\n complement: 139557040,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139557584,\n destination: 139555512,\n xPos: 3,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139557600,\n complement: 139555432,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139559676,\n xPos: 392,\n yPos: 152,\n type: 4,\n subtype: 1,\n varA: 154,\n varB: 4,\n flag: 0x518301,\n },\n ],\n },\n {\n _area: 5,\n _room: 14,\n address: 139557744,\n mapX: 154,\n mapY: 0,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139557728,\n doors: [\n {\n _door: 0,\n address: 139557728,\n destination: 139556600,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139557744,\n complement: 139556568,\n },\n {\n _door: 1,\n address: -1,\n destination: 139604492,\n xPos: 0,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: 5,\n sourceRoom: 139557744,\n complement: -2,\n isFakeDoor: true,\n },\n ],\n items: [],\n isChaoticRealmConnector: true,\n },\n ],\n },\n {\n area: 'Clock Tower',\n rooms: [\n {\n _area: 6,\n _room: 0,\n address: 139559936,\n mapX: 161,\n mapY: 3,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139559904,\n doors: [\n {\n _door: 0,\n address: 139559904,\n destination: 139594504,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139559936,\n complement: 139594488,\n isWoodenDoor: true,\n },\n {\n _door: 1,\n address: 139559920,\n destination: 139563056,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139559936,\n complement: 139563024,\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 1,\n address: 139560080,\n mapX: 33,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139560064,\n doors: [\n {\n _door: 0,\n address: 139560064,\n destination: 139560720,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139560080,\n complement: 139560656,\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 2,\n address: 139560224,\n mapX: 161,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139560192,\n doors: [\n {\n _door: 0,\n address: 139560192,\n destination: 139560720,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139560224,\n complement: 139560688,\n access: {\n doors: [\n {\n door: 1,\n locks: [[Locks.SMALL, Locks.SLIDE], [Locks.BAT]],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139560208,\n destination: 139560864,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139560224,\n complement: 139560832,\n access: {\n doors: [\n {\n door: 1,\n locks: [[Locks.MALPHAS, Locks.SLIDE], [Locks.BAT]],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 3,\n address: 139560368,\n mapX: 161,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139560352,\n doors: [\n {\n _door: 0,\n address: 139560352,\n destination: 139560864,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139560368,\n complement: 139560848,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139565516,\n xPos: 72,\n yPos: 184,\n type: 4,\n subtype: 4,\n varA: 53,\n varB: 6,\n flag: 0x5199d1,\n },\n ],\n },\n {\n _area: 6,\n _room: 4,\n address: 139560536,\n mapX: 34,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139560488,\n doors: [\n {\n _door: 0,\n address: 139560488,\n destination: 139563984,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139560536,\n complement: 139563952,\n },\n {\n _door: 1,\n address: 139560504,\n destination: 139564128,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139560536,\n complement: 139564112,\n isBreakableDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139560520,\n destination: 139564296,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139560536,\n complement: 139564264,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1, // Won't require damage boosting through spikes\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 5,\n address: 139560720,\n mapX: 34,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139560656,\n doors: [\n {\n _door: 0,\n address: 139560656,\n destination: 139560080,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139560720,\n complement: 139560064,\n },\n {\n _door: 1,\n address: 139560672,\n destination: 139561200,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139560720,\n complement: 139561152,\n },\n {\n _door: 2,\n address: 139560688,\n destination: 139560224,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139560720,\n complement: 139560192,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139560704,\n destination: 139561352,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139560720,\n complement: 139561336,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 6,\n address: 139560864,\n mapX: 34,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139560832,\n doors: [\n {\n _door: 0,\n address: 139560832,\n destination: 139560224,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139560864,\n complement: 139560208,\n },\n {\n _door: 1,\n address: 139560848,\n destination: 139560368,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139560864,\n complement: 139560352,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS], // You can ledge snap and get through with just Panther but it's the same as early Garden, which isn't required\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 7,\n address: 139561016,\n mapX: 163,\n mapY: 2,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139560984,\n doors: [\n {\n _door: 0,\n address: 139560984,\n destination: 139562552,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139561016,\n complement: 139562536,\n },\n {\n _door: 1,\n address: 139561000,\n destination: 139562872,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139561016,\n complement: 139562824,\n },\n ],\n items: [],\n isBossRoom: true,\n },\n {\n _area: 6,\n _room: 8,\n address: 139561200,\n mapX: 35,\n mapY: 6,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139561152,\n doors: [\n {\n _door: 0,\n address: 139561152,\n destination: 139560720,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139561200,\n complement: 139560672,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SKULA], // Unequip Skula to go up\n },\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139561168,\n destination: 139564480,\n xPos: 1,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139561200,\n complement: 139564464,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SKULA],\n },\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139561184,\n destination: 139562008,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139561200,\n complement: 139561960,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SKULA],\n },\n {\n door: 1,\n locks: [Locks.SKULA], // Unequip Skula to go up\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 9,\n address: 139561352,\n mapX: 163,\n mapY: 6,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139561336,\n doors: [\n {\n _door: 0,\n address: 139561336,\n destination: 139560720,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139561352,\n complement: 139560704,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139566248,\n xPos: 720,\n yPos: 120,\n type: 4,\n subtype: 3,\n varA: 31,\n varB: 14,\n flag: 0x519cad,\n },\n ],\n },\n {\n _area: 6,\n _room: 10,\n address: 139561520,\n mapX: 38,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139561472,\n doors: [\n {\n _door: 0,\n address: 139561472,\n destination: 139562160,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139561520,\n complement: 139562144,\n },\n {\n _door: 1,\n address: 139561488,\n destination: 139565080,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139561520,\n complement: 139565064,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139561504,\n destination: 139562408,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139561520,\n complement: 139562392,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 11,\n address: 139561672,\n mapX: 166,\n mapY: 3,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139561640,\n doors: [\n {\n _door: 0,\n address: 139561640,\n destination: 139563360,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139561672,\n complement: 139563328,\n },\n {\n _door: 1,\n address: 139561656,\n destination: 139565216,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139561672,\n complement: 139565184,\n isWoodenDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 12,\n address: 139561840,\n mapX: 38,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139561792,\n doors: [\n {\n _door: 0,\n address: 139561792,\n destination: 139563816,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139561840,\n complement: 139563800,\n },\n {\n _door: 1,\n address: 139561808,\n destination: 139564648,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139561840,\n complement: 139564632,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139561824,\n destination: 139562280,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139561840,\n complement: 139562264,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 13,\n address: 139562008,\n mapX: 38,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139561960,\n doors: [\n {\n _door: 0,\n address: 139561960,\n destination: 139561200,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139562008,\n complement: 139561184,\n },\n {\n _door: 1,\n address: 139561976,\n destination: 139564912,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139562008,\n complement: 139564896,\n },\n {\n _door: 2,\n address: 139561992,\n destination: 139562160,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139562008,\n complement: 139562128,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 14,\n address: 139562160,\n mapX: 167,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139562128,\n doors: [\n {\n _door: 0,\n address: 139562128,\n destination: 139562008,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139562160,\n complement: 139561992,\n },\n {\n _door: 1,\n address: 139562144,\n destination: 139561520,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139562160,\n complement: 139561472,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 15,\n address: 139562280,\n mapX: 167,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139562264,\n doors: [\n {\n _door: 0,\n address: 139562264,\n destination: 139561840,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139562280,\n complement: 139561824,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 6,\n _room: 16,\n address: 139562408,\n mapX: 167,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139562392,\n doors: [\n {\n _door: 0,\n address: 139562392,\n destination: 139561520,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139562408,\n complement: 139561504,\n },\n ],\n items: [],\n isWarpRoom: true,\n },\n {\n _area: 6,\n _room: 17,\n address: 139562552,\n mapX: 162,\n mapY: 2,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139562536,\n doors: [\n {\n _door: 0,\n address: 139562536,\n destination: 139561016,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139562552,\n complement: 139560984,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139566968,\n xPos: 120,\n yPos: 176,\n type: 4,\n subtype: 7,\n varA: 7,\n varB: 2,\n flag: 0x519f7d,\n },\n ],\n },\n {\n _area: 6,\n _room: 18,\n address: 139562704,\n mapX: 35,\n mapY: 3,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139562672,\n doors: [\n {\n _door: 0,\n address: 139562672,\n destination: 139563056,\n xPos: 0,\n yPos: 1,\n destXOffset: 65520,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139562704,\n complement: 139563008,\n },\n {\n _door: 1,\n address: 139562688,\n destination: 139562872,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139562704,\n complement: 139562856,\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 19,\n address: 139562872,\n mapX: 165,\n mapY: 2,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139562824,\n doors: [\n {\n _door: 0,\n address: 139562824,\n destination: 139561016,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139562872,\n complement: 139561000,\n isBossDoor: true,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.BAT],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139562840,\n destination: 139564768,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139562872,\n complement: 139564752,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLOAT],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.BAT],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139562856,\n destination: 139562704,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139562872,\n complement: 139562688,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.BAT],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139567088,\n xPos: 200,\n yPos: 79,\n type: 5,\n subtype: 3,\n varA: 43,\n varB: 39,\n isHardMode: true,\n flag: 0x519ff5,\n },\n ],\n },\n {\n _area: 6,\n _room: 20,\n address: 139563056,\n mapX: 163,\n mapY: 3,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139563008,\n doors: [\n {\n _door: 0,\n address: 139563008,\n destination: 139562704,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 16,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139563056,\n complement: 139562672,\n },\n {\n _door: 1,\n address: 139563024,\n destination: 139559936,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139563056,\n complement: 139559920,\n },\n {\n _door: 2,\n address: 139563040,\n destination: 139563208,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139563056,\n complement: 139563176,\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 21,\n address: 139563208,\n mapX: 164,\n mapY: 3,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139563176,\n doors: [\n {\n _door: 0,\n address: 139563176,\n destination: 139563056,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139563208,\n complement: 139563040,\n },\n {\n _door: 1,\n address: 139563192,\n destination: 139563512,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139563208,\n complement: 139563480,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139567352,\n xPos: 208,\n yPos: 440,\n type: 4,\n subtype: 1,\n varA: 151,\n varB: 6,\n flag: 0x51a0fd,\n },\n ],\n },\n {\n _area: 6,\n _room: 22,\n address: 139563360,\n mapX: 165,\n mapY: 3,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139563328,\n doors: [\n {\n _door: 0,\n address: 139563328,\n destination: 139561672,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139563360,\n complement: 139561640,\n },\n {\n _door: 1,\n address: 139563344,\n destination: 139563816,\n xPos: 0,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139563360,\n complement: 139563784,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 23,\n address: 139563512,\n mapX: 35,\n mapY: 4,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139563480,\n doors: [\n {\n _door: 0,\n address: 139563480,\n destination: 139563208,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139563512,\n complement: 139563192,\n access: {\n items: [\n {\n items: 0,\n locks: [Locks.BAT],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139563496,\n destination: 139563664,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139563512,\n complement: 139563632,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.BAT],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139567580,\n xPos: 208,\n yPos: 312,\n type: 5,\n subtype: 4,\n varA: 60,\n varB: 19,\n isHardMode: true,\n flag: 0x51a1e1,\n },\n ],\n },\n {\n _area: 6,\n _room: 24,\n address: 139563664,\n mapX: 164,\n mapY: 4,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139563632,\n doors: [\n {\n _door: 0,\n address: 139563632,\n destination: 139563512,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139563664,\n complement: 139563496,\n },\n {\n _door: 1,\n address: 139563648,\n destination: 139563984,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139563664,\n complement: 139563968,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 25,\n address: 139563816,\n mapX: 165,\n mapY: 4,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139563784,\n doors: [\n {\n _door: 0,\n address: 139563784,\n destination: 139563360,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139563816,\n complement: 139563344,\n },\n {\n _door: 1,\n address: 139563800,\n destination: 139561840,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139563816,\n complement: 139561792,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 26,\n address: 139563984,\n mapX: 35,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139563952,\n doors: [\n {\n _door: 0,\n address: 139563952,\n destination: 139560536,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139563984,\n complement: 139560488,\n },\n {\n _door: 1,\n address: 139563968,\n destination: 139563664,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139563984,\n complement: 139563648,\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 27,\n address: 139564128,\n mapX: 161,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139564112,\n doors: [\n {\n _door: 0,\n address: 139564112,\n destination: 139560536,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139564128,\n complement: 139560504,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139568072,\n xPos: 120,\n yPos: 120,\n type: 4,\n subtype: 3,\n varA: 30,\n varB: 10,\n flag: 0x51a3cd,\n },\n ],\n },\n {\n _area: 6,\n _room: 28,\n address: 139564296,\n mapX: 163,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139564264,\n doors: [\n {\n _door: 0,\n address: 139564264,\n destination: 139560536,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139564296,\n complement: 139560520,\n },\n {\n _door: 1,\n address: 139564280,\n destination: 139564480,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139564296,\n complement: 139564432,\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 29,\n address: 139564480,\n mapX: 164,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139564432,\n doors: [\n {\n _door: 0,\n address: 139564432,\n destination: 139564296,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139564480,\n complement: 139564280,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SKULA], // Technically not necessary, but just to be safe\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139564448,\n destination: 139564648,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139564480,\n complement: 139564616,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SKULA], // Technically not necessary, but just to be safe\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139564464,\n destination: 139561200,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139564480,\n complement: 139561168,\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 30,\n address: 139564648,\n mapX: 165,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139564616,\n doors: [\n {\n _door: 0,\n address: 139564616,\n destination: 139564480,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139564648,\n complement: 139564448,\n },\n {\n _door: 1,\n address: 139564632,\n destination: 139561840,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139564648,\n complement: 139561808,\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 31,\n address: 139564768,\n mapX: 166,\n mapY: 2,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139564752,\n doors: [\n {\n _door: 0,\n address: 139564752,\n destination: 139562872,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139564768,\n complement: 139562840,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 6,\n _room: 32,\n address: 139564912,\n mapX: 39,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139564896,\n doors: [\n {\n _door: 0,\n address: 139564896,\n destination: 139562008,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139564912,\n complement: 139561976,\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 33,\n address: 139565080,\n mapX: 165,\n mapY: 7,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139565048,\n doors: [\n {\n _door: 0,\n address: 139565048,\n destination: 139526564,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139565080,\n complement: 139526548,\n isWoodenDoor: true,\n },\n {\n _door: 1,\n address: 139565064,\n destination: 139561520,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139565080,\n complement: 139561488,\n },\n ],\n items: [],\n },\n {\n _area: 6,\n _room: 34,\n address: 139565216,\n mapX: 168,\n mapY: 3,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139565184,\n doors: [\n {\n _door: 0,\n address: 139565184,\n destination: 139561672,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139565216,\n complement: 139561656,\n },\n {\n _door: 1,\n address: 139565200,\n destination: 139557208,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139565216,\n complement: 139557176,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n ],\n },\n {\n area: 'Underground Reservoir',\n rooms: [\n {\n _area: 7,\n _room: 0,\n address: 139568516,\n mapX: 5,\n mapY: 11,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139568484,\n doors: [\n {\n _door: 0,\n address: 139568484,\n destination: 139522532,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139568516,\n complement: 139522500,\n isWoodenDoor: true,\n },\n {\n _door: 1,\n address: 139568500,\n destination: 139568676,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139568516,\n complement: 139568628,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139578352,\n xPos: 64,\n yPos: 440,\n type: 4,\n subtype: 4,\n varA: 66,\n varB: 28,\n flag: 0x51cbf5,\n },\n ],\n },\n {\n _area: 7,\n _room: 1,\n address: 139568676,\n mapX: 134,\n mapY: 11,\n mapWidth: 10,\n mapHeight: 1,\n doorList: 139568628,\n doors: [\n {\n _door: 0,\n address: 139568628,\n destination: 139568516,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139568676,\n complement: 139568500,\n access: {\n doors: [\n {\n door: 1,\n locks: [[Locks.UNDINE, Locks.MALPHAS], [Locks.FLIGHT]],\n },\n {\n door: 2,\n locks: [Locks.SKULA], // Malphas + Kicker works too but eh\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139568644,\n destination: 139568804,\n xPos: 7,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139568676,\n complement: 139568788,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SKULA], // Malphas + Kicker works too but eh\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139568660,\n destination: 139569292,\n xPos: 9,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139568676,\n complement: 139569244,\n access: {\n doors: [\n {\n door: 1,\n locks: [[Locks.UNDINE, Locks.MALPHAS], [Locks.FLIGHT]],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139578676,\n xPos: 2384,\n yPos: 120,\n type: 4,\n subtype: 2,\n varA: 130,\n varB: 4,\n flag: 0x51cd39,\n },\n ],\n },\n {\n _area: 7,\n _room: 2,\n address: 139568804,\n mapX: 12,\n mapY: 11,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139568788,\n doors: [\n {\n _door: 0,\n address: 139568788,\n destination: 139568676,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1792,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139568804,\n complement: 139568644,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139578712,\n xPos: 48,\n yPos: 152,\n type: 4,\n subtype: 4,\n varA: 59,\n varB: 18,\n flag: 0x51cd5d,\n },\n ],\n },\n {\n _area: 7,\n _room: 3,\n address: 139568932,\n mapX: 142,\n mapY: 12,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139568916,\n doors: [\n {\n _door: 0,\n address: 139568916,\n destination: 139569292,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139568932,\n complement: 139569276,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139578880,\n xPos: 112,\n yPos: 88,\n type: 4,\n subtype: 3,\n varA: 27,\n varB: 11,\n flag: 0x51ce05,\n },\n ],\n },\n {\n _area: 7,\n _room: 4,\n address: 139569132,\n mapX: 142,\n mapY: 15,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139569084,\n doors: [\n {\n _door: 0,\n address: 139569084,\n destination: 139575388,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139569132,\n complement: 139575372,\n isWoodenDoor: true,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139569100,\n destination: 139569644,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139569132,\n complement: 139569612,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139569116,\n destination: 139569812,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139569132,\n complement: 139569796,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 5,\n address: 139569292,\n mapX: 15,\n mapY: 12,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139569244,\n doors: [\n {\n _door: 0,\n address: 139569244,\n destination: 139568676,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 2304,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139569292,\n complement: 139568660,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SKULA],\n },\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139569260,\n destination: 139570444,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139569292,\n complement: 139570348,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SKULA],\n },\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139569276,\n destination: 139568932,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139569292,\n complement: 139568916,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SKULA],\n },\n {\n door: 1,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 6,\n address: 139569460,\n mapX: 16,\n mapY: 14,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139569444,\n doors: [\n {\n _door: 0,\n address: 139569444,\n destination: 139570444,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 1024,\n direction: DIR.RIGHT,\n sourceRoom: 139569460,\n complement: 139570396,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 7,\n address: 139569644,\n mapX: 143,\n mapY: 15,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139569612,\n doors: [\n {\n _door: 0,\n address: 139569612,\n destination: 139569132,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139569644,\n complement: 139569100,\n },\n {\n _door: 1,\n address: 139569628,\n destination: 139570196,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139569644,\n complement: 139570132,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 8,\n address: 139569812,\n mapX: 15,\n mapY: 16,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139569796,\n doors: [\n {\n _door: 0,\n address: 139569796,\n destination: 139569132,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139569812,\n complement: 139569116,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139579408,\n xPos: 208,\n yPos: 88,\n type: 4,\n subtype: 2,\n varA: 107,\n varB: 6,\n flag: 0x51d015,\n },\n ],\n },\n {\n _area: 7,\n _room: 9,\n address: 139569980,\n mapX: 15,\n mapY: 17,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139569964,\n doors: [\n {\n _door: 0,\n address: 139569964,\n destination: 139570196,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 768,\n direction: DIR.RIGHT,\n sourceRoom: 139569980,\n complement: 139570164,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139579468,\n xPos: 48,\n yPos: 120,\n type: 4,\n subtype: 2,\n varA: 134,\n varB: 18,\n flag: 0x51d051,\n },\n ],\n },\n {\n _area: 7,\n _room: 10,\n address: 139570196,\n mapX: 144,\n mapY: 15,\n mapWidth: 1,\n mapHeight: 4,\n doorList: 139570132,\n doors: [\n {\n _door: 0,\n address: 139570132,\n destination: 139569644,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139570196,\n complement: 139569628,\n },\n {\n _door: 1,\n address: 139570148,\n destination: 139570644,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139570196,\n complement: 139570612,\n },\n {\n _door: 2,\n address: 139570164,\n destination: 139569980,\n xPos: 255,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139570196,\n complement: 139569964,\n isBreakableDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139570180,\n destination: 139570820,\n xPos: 1,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139570196,\n complement: 139570788,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 11,\n address: 139570444,\n mapX: 17,\n mapY: 12,\n mapWidth: 1,\n mapHeight: 7,\n doorList: 139570348,\n doors: [\n {\n _door: 0,\n address: 139570348,\n destination: 139569292,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139570444,\n complement: 139569260,\n },\n {\n _door: 1,\n address: 139570364,\n destination: 139570964,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139570444,\n complement: 139570932,\n },\n {\n _door: 2,\n address: 139570380,\n destination: 139575508,\n xPos: 1,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139570444,\n complement: 139575492,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139570396,\n destination: 139569460,\n xPos: 255,\n yPos: 4,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139570444,\n complement: 139569444,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139570412,\n destination: 139576892,\n xPos: 1,\n yPos: 6,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139570444,\n complement: 139576860,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n {\n door: 3,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 5,\n address: 139570428,\n destination: 139570644,\n xPos: 0,\n yPos: 7,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 16,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139570444,\n complement: 139570596,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n {\n door: 3,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 12,\n address: 139570644,\n mapX: 145,\n mapY: 15,\n mapWidth: 8,\n mapHeight: 1,\n doorList: 139570596,\n doors: [\n {\n _door: 0,\n address: 139570596,\n destination: 139570444,\n xPos: 0,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 1536,\n direction: DIR.UP,\n sourceRoom: 139570644,\n complement: 139570428,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139570612,\n destination: 139570196,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139570644,\n complement: 139570148,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139570628,\n destination: 139571860,\n xPos: 8,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.RIGHT,\n sourceRoom: 139570644,\n complement: 139571828,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139579876,\n xPos: 496,\n yPos: 72,\n type: 4,\n subtype: 2,\n varA: 118,\n varB: 7,\n flag: 0x51d1e9,\n },\n ],\n },\n {\n _area: 7,\n _room: 13,\n address: 139570820,\n mapX: 17,\n mapY: 17,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139570788,\n doors: [\n {\n _door: 0,\n address: 139570788,\n destination: 139570196,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 768,\n direction: DIR.LEFT,\n sourceRoom: 139570820,\n complement: 139570180,\n },\n {\n _door: 1,\n address: 139570804,\n destination: 139571292,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139570820,\n complement: 139571260,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 14,\n address: 139570964,\n mapX: 18,\n mapY: 12,\n mapWidth: 5,\n mapHeight: 2,\n doorList: 139570932,\n doors: [\n {\n _door: 0,\n address: 139570932,\n destination: 139570444,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139570964,\n complement: 139570364,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SKULA],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139570948,\n destination: 139571612,\n xPos: 5,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139570964,\n complement: 139571564,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SKULA, Locks.MALPHAS],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139580200,\n xPos: 480,\n yPos: 440,\n type: 4,\n subtype: 2,\n varA: 111,\n varB: 2,\n flag: 0x51d32d,\n },\n ],\n },\n {\n _area: 7,\n _room: 15,\n address: 139571132,\n mapX: 160,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139571116,\n doors: [\n {\n _door: 0,\n address: 139571116,\n destination: 139574540,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139571132,\n complement: 139574492,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139580416,\n xPos: 192,\n yPos: 152,\n type: 4,\n subtype: 2,\n varA: 110,\n varB: 2,\n flag: 0x51d405,\n },\n ],\n },\n {\n _area: 7,\n _room: 16,\n address: 139571292,\n mapX: 19,\n mapY: 17,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139571260,\n doors: [\n {\n _door: 0,\n address: 139571260,\n destination: 139570820,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139571292,\n complement: 139570804,\n },\n {\n _door: 1,\n address: 139571276,\n destination: 139574892,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139571292,\n complement: 139574860,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 17,\n address: 139571452,\n mapX: 23,\n mapY: 11,\n mapWidth: 5,\n mapHeight: 3,\n doorList: 139571404,\n doors: [\n {\n _door: 0,\n address: 139571404,\n destination: 139526292,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139571452,\n complement: 139526276,\n isWoodenDoor: true,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.LONG],\n },\n {\n door: 2,\n locks: [\n [Locks.SKULA, Locks.UNDINE, Locks.SMALL],\n [Locks.SKULA, Locks.FLIGHT],\n ], // Panther can surprisingly do the job here\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.LONG],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139571420,\n destination: 139572516,\n xPos: 5,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139571452,\n complement: 139572484,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.LONG],\n },\n {\n door: 2,\n locks: [\n [Locks.SKULA, Locks.UNDINE, Locks.FLOAT],\n [Locks.SKULA, Locks.FLIGHT],\n ], // Armor works here because no initial wall from door 0\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.LONG],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139571436,\n destination: 139571612,\n xPos: 1,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139571452,\n complement: 139571580,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.LONG],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.LONG],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139580776,\n xPos: 672,\n yPos: 120,\n type: 4,\n subtype: 3,\n varA: 25,\n varB: 8,\n flag: 0x51d56d,\n },\n ],\n },\n {\n _area: 7,\n _room: 18,\n address: 139571612,\n mapX: 151,\n mapY: 12,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139571564,\n doors: [\n {\n _door: 0,\n address: 139571564,\n destination: 139570964,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 1040,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139571612,\n complement: 139570948,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139571580,\n destination: 139571452,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 256,\n destYPos: 512,\n direction: DIR.UP,\n sourceRoom: 139571612,\n complement: 139571436,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SKULA],\n },\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139571596,\n destination: 139575916,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139571612,\n complement: 139575884,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 19,\n address: 139571860,\n mapX: 153,\n mapY: 14,\n mapWidth: 2,\n mapHeight: 3,\n doorList: 139571780,\n doors: [\n {\n _door: 0,\n address: 139571780,\n destination: 139575636,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139571860,\n complement: 139575620,\n access: {\n doors: [\n {\n door: 1,\n locks: [[Locks.FLOAT], [Locks.UNDINE]],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS], // Blind platform jumps from suspend is too cruel\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139571796,\n destination: 139572044,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139571860,\n complement: 139572012,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.FLOAT, Locks.UNDINE], [Locks.FLIGHT]], // Not gonna force backdash jump\n },\n {\n door: 2,\n locks: [Locks.MALPHAS], // Blind platform jumps from suspend is too cruel\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139571812,\n destination: 139576708,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139571860,\n complement: 139576692,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.MALPHAS, Locks.UNDINE], [Locks.FLIGHT]], // Not gonna force backdash jump\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139571828,\n destination: 139570644,\n xPos: 255,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1808,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139571860,\n complement: 139570628,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.MALPHAS, Locks.UNDINE], [Locks.FLIGHT]], // Not gonna force backdash jump\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139571844,\n destination: 139572212,\n xPos: 2,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139571860,\n complement: 139572196,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.MALPHAS, Locks.UNDINE], [Locks.FLIGHT]], // Not gonna force backdash jump\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 20,\n address: 139572044,\n mapX: 155,\n mapY: 14,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139572012,\n doors: [\n {\n _door: 0,\n address: 139572012,\n destination: 139571860,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139572044,\n complement: 139571796,\n },\n {\n _door: 1,\n address: 139572028,\n destination: 139574540,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 1024,\n direction: DIR.RIGHT,\n sourceRoom: 139572044,\n complement: 139574508,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 21,\n address: 139572212,\n mapX: 155,\n mapY: 15,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139572196,\n doors: [\n {\n _door: 0,\n address: 139572196,\n destination: 139571860,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139572212,\n complement: 139571844,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139581436,\n xPos: 688,\n yPos: 152,\n type: 4,\n subtype: 4,\n varA: 61,\n varB: 22,\n flag: 0x51d801,\n },\n ],\n },\n {\n _area: 7,\n _room: 22,\n address: 139572372,\n mapX: 33,\n mapY: 17,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139572356,\n doors: [\n {\n _door: 0,\n address: 139572356,\n destination: 139578220,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139572372,\n complement: 139578204,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139581472,\n xPos: 192,\n yPos: 136,\n type: 4,\n subtype: 8,\n varA: 9,\n varB: 6,\n flag: 0x51d825,\n },\n ],\n },\n {\n _area: 7,\n _room: 23,\n address: 139572516,\n mapX: 28,\n mapY: 11,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139572484,\n doors: [\n {\n _door: 0,\n address: 139572484,\n destination: 139571452,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 1040,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139572516,\n complement: 139571420,\n },\n {\n _door: 1,\n address: 139572500,\n destination: 139572876,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139572516,\n complement: 139572828,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 24,\n address: 139572700,\n mapX: 157,\n mapY: 12,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139572684,\n doors: [\n {\n _door: 0,\n address: 139572684,\n destination: 139574540,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139572700,\n complement: 139574444,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139581664,\n xPos: 48,\n yPos: 120,\n type: 4,\n subtype: 3,\n varA: 45,\n varB: 49,\n flag: 0x51d8e5,\n },\n ],\n },\n {\n _area: 7,\n _room: 25,\n address: 139572876,\n mapX: 158,\n mapY: 10,\n mapWidth: 2,\n mapHeight: 4,\n doorList: 139572828,\n doors: [\n {\n _door: 0,\n address: 139572828,\n destination: 139572516,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139572876,\n complement: 139572500,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n // Item 0 needs Malphas/Suspend to get back out though lmao\n {\n item: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139572844,\n destination: 139573076,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139572876,\n complement: 139573044,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n // Item 0 needs Malphas/Suspend to get back out though lmao\n {\n item: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139572860,\n destination: 139574540,\n xPos: 1,\n yPos: 4,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139572876,\n complement: 139574460,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n ],\n items: [\n // TODO: This has a candle that rando changes at 0x51D92D\n {\n _item: 0,\n address: 139581820,\n xPos: 240,\n yPos: 728,\n type: 4,\n subtype: 1,\n varA: 148,\n varB: 5,\n flag: 0x51d981,\n },\n {\n _item: 1,\n address: 139581844,\n xPos: 256,\n yPos: 952,\n type: 4,\n subtype: 3,\n varA: 48,\n varB: 55,\n flag: 0x51d999,\n },\n ],\n },\n {\n _area: 7,\n _room: 26,\n address: 139573076,\n mapX: 32,\n mapY: 11,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139573044,\n doors: [\n {\n _door: 0,\n address: 139573044,\n destination: 139572876,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139573076,\n complement: 139572844,\n },\n {\n _door: 1,\n address: 139573060,\n destination: 139573708,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139573076,\n complement: 139573628,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 27,\n address: 139573276,\n mapX: 160,\n mapY: 14,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139573244,\n doors: [\n {\n _door: 0,\n address: 139573244,\n destination: 139574540,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 1024,\n direction: DIR.LEFT,\n sourceRoom: 139573276,\n complement: 139574524,\n },\n {\n _door: 1,\n address: 139573260,\n destination: 139597968,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139573276,\n complement: 139597936,\n isWoodenDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 28,\n address: 139573460,\n mapX: 34,\n mapY: 10,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139573444,\n doors: [\n {\n _door: 0,\n address: 139573444,\n destination: 139573708,\n xPos: 0,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139573460,\n complement: 139573644,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139582072,\n xPos: 160,\n yPos: 216,\n type: 4,\n subtype: 2,\n varA: 80,\n varB: 28,\n flag: 0x51da7d,\n },\n ],\n },\n {\n _area: 7,\n _room: 29,\n address: 139573708,\n mapX: 33,\n mapY: 11,\n mapWidth: 3,\n mapHeight: 3,\n doorList: 139573628,\n doors: [\n {\n _door: 0,\n address: 139573628,\n destination: 139573076,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139573708,\n complement: 139573060,\n access: {\n doors: [\n {\n door: 1,\n locks: [[Locks.UNDINE, Locks.SMALL], [Locks.LONG]],\n },\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n {\n door: 3,\n locks: [Locks.SKULA],\n },\n {\n door: 4,\n locks: [Locks.SKULA],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SKULA, Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139573644,\n destination: 139573460,\n xPos: 1,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139573708,\n complement: 139573444,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.SMALL], [Locks.UNDINE]],\n },\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n {\n door: 3,\n locks: [Locks.SKULA],\n },\n {\n door: 4,\n locks: [Locks.SKULA],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SKULA, Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139573660,\n destination: 139574092,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139573708,\n complement: 139574076,\n access: {\n doors: [\n {\n door: 0,\n locks: [\n [Locks.SKULA, Locks.SMALL],\n [Locks.SKULA, Locks.UNDINE],\n ],\n },\n {\n door: 1,\n locks: [\n [Locks.UNDINE, Locks.SMALL, Locks.SKULA],\n [Locks.LONG, Locks.SKULA],\n ],\n },\n {\n door: 3,\n locks: [Locks.SKULA],\n },\n {\n door: 4,\n locks: [Locks.SKULA],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SKULA, Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139573676,\n destination: 139577212,\n xPos: 0,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139573708,\n complement: 139577196,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.SMALL], [Locks.UNDINE]],\n },\n {\n door: 1,\n locks: [[Locks.UNDINE, Locks.SMALL], [Locks.LONG]],\n },\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n {\n door: 4,\n locks: [Locks.SKULA],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139573692,\n destination: 139573908,\n xPos: 2,\n yPos: 3,\n destXOffset: 65520,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139573708,\n complement: 139573876,\n access: {\n doors: [\n {\n door: 0,\n locks: [[Locks.SMALL], [Locks.UNDINE]],\n },\n {\n door: 1,\n locks: [[Locks.UNDINE, Locks.SMALL], [Locks.LONG]],\n },\n {\n door: 2,\n locks: [Locks.SKULA], // Can be done with nothing but would require killing the fish heads or tanking a hit\n },\n {\n door: 3,\n locks: [Locks.SKULA],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.SKULA, Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139582156,\n xPos: 48,\n yPos: 216,\n type: 4,\n subtype: 1,\n varA: 149,\n varB: 6,\n flag: 0x51dad1,\n },\n ],\n },\n {\n _area: 7,\n _room: 30,\n address: 139573908,\n mapX: 163,\n mapY: 12,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139573876,\n doors: [\n {\n _door: 0,\n address: 139573876,\n destination: 139573708,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 528,\n destYPos: 512,\n direction: DIR.UP,\n sourceRoom: 139573908,\n complement: 139573692,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139573892,\n destination: 139574276,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139573908,\n complement: 139574260,\n isBreakableDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 31,\n address: 139574092,\n mapX: 36,\n mapY: 11,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139574076,\n doors: [\n {\n _door: 0,\n address: 139574076,\n destination: 139573708,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139574092,\n complement: 139573660,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139582504,\n xPos: 400,\n yPos: 88,\n type: 4,\n subtype: 4,\n varA: 73,\n varB: 41,\n flag: 0x51dc2d,\n },\n ],\n },\n {\n _area: 7,\n _room: 32,\n address: 139574276,\n mapX: 36,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139574260,\n doors: [\n {\n _door: 0,\n address: 139574260,\n destination: 139573908,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139574276,\n complement: 139573892,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.SKULA], // Not needed but feels kinda dumb\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139582576,\n xPos: 176,\n yPos: 120,\n type: 4,\n subtype: 3,\n varA: 38,\n varB: 29,\n flag: 0x51dc75,\n },\n ],\n },\n {\n _area: 7,\n _room: 33,\n address: 139574540,\n mapX: 158,\n mapY: 12,\n mapWidth: 2,\n mapHeight: 5,\n doorList: 139574444,\n doors: [\n {\n _door: 0,\n address: 139574444,\n destination: 139572700,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139574540,\n complement: 139572684,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 3,\n locks: [Locks.FLIGHT],\n },\n {\n door: 5,\n locks: [Locks.RUSH, Locks.UNDINE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n item: 1,\n locks: [Locks.RUSH, Locks.UNDINE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139574460,\n destination: 139572876,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 256,\n destYPos: 768,\n direction: DIR.UP,\n sourceRoom: 139574540,\n complement: 139572860,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 3,\n locks: [Locks.FLIGHT], // Being kind and not making them drop and reset\n },\n {\n door: 5,\n locks: [Locks.RUSH, Locks.UNDINE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n item: 1,\n locks: [Locks.RUSH, Locks.UNDINE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139574476,\n destination: 139577212,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139574540,\n complement: 139577180,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 3,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 4,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 5,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139574492,\n destination: 139571132,\n xPos: 2,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139574540,\n complement: 139571116,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 5,\n locks: [Locks.RUSH, Locks.UNDINE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n item: 1,\n locks: [Locks.RUSH, Locks.UNDINE],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139574508,\n destination: 139572044,\n xPos: 255,\n yPos: 4,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139574540,\n complement: 139572028,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 3,\n locks: [Locks.FLIGHT],\n },\n {\n door: 5,\n locks: [Locks.RUSH, Locks.UNDINE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n item: 1,\n locks: [Locks.RUSH, Locks.UNDINE],\n },\n ],\n },\n },\n {\n _door: 5,\n address: 139574524,\n destination: 139573276,\n xPos: 2,\n yPos: 4,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139574540,\n complement: 139573244,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 3,\n locks: [Locks.FLIGHT],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139582696,\n xPos: 472,\n yPos: 152,\n type: 4,\n subtype: 2,\n varA: 113,\n varB: 2,\n flag: 0x51dced,\n },\n {\n _item: 1,\n address: 139582756,\n xPos: 416,\n yPos: 1176,\n type: 4,\n subtype: 4,\n varA: 56,\n varB: 15,\n flag: 0x51dd29,\n },\n ],\n },\n {\n _area: 7,\n _room: 34,\n address: 139574684,\n mapX: 147,\n mapY: 16,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139574668,\n doors: [\n {\n _door: 0,\n address: 139574668,\n destination: 139574892,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139574684,\n complement: 139574828,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139582840,\n xPos: 48,\n yPos: 136,\n type: 4,\n subtype: 1,\n varA: 150,\n varB: 6,\n flag: 0x51dd7d,\n },\n ],\n },\n {\n _area: 7,\n _room: 35,\n address: 139574892,\n mapX: 151,\n mapY: 16,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139574828,\n doors: [\n {\n _door: 0,\n address: 139574828,\n destination: 139574684,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139574892,\n complement: 139574668,\n },\n {\n _door: 1,\n address: 139574844,\n destination: 139575756,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139574892,\n complement: 139575740,\n },\n {\n _door: 2,\n address: 139574860,\n destination: 139571292,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139574892,\n complement: 139571276,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139574876,\n destination: 139575068,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139574892,\n complement: 139575036,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 36,\n address: 139575068,\n mapX: 24,\n mapY: 17,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139575036,\n doors: [\n {\n _door: 0,\n address: 139575036,\n destination: 139574892,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139575068,\n complement: 139574876,\n },\n {\n _door: 1,\n address: 139575052,\n destination: 139575252,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139575068,\n complement: 139575220,\n isBossDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 37,\n address: 139575252,\n mapX: 153,\n mapY: 16,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139575220,\n doors: [\n {\n _door: 0,\n address: 139575220,\n destination: 139575068,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139575252,\n complement: 139575052,\n },\n {\n _door: 1,\n address: 139575236,\n destination: 139577676,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139575252,\n complement: 139577644,\n },\n ],\n items: [],\n isBossRoom: true,\n },\n {\n _area: 7,\n _room: 38,\n address: 139575388,\n mapX: 141,\n mapY: 15,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139575356,\n doors: [\n {\n _door: 0,\n address: 139575356,\n destination: 139587760,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139575388,\n complement: 139587744,\n },\n {\n _door: 1,\n address: 139575372,\n destination: 139569132,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139575388,\n complement: 139569084,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 7,\n _room: 39,\n address: 139575508,\n mapX: 146,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139575492,\n doors: [\n {\n _door: 0,\n address: 139575492,\n destination: 139570444,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 768,\n direction: DIR.LEFT,\n sourceRoom: 139575508,\n complement: 139570380,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 7,\n _room: 40,\n address: 139575636,\n mapX: 152,\n mapY: 14,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139575620,\n doors: [\n {\n _door: 0,\n address: 139575620,\n destination: 139571860,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139575636,\n complement: 139571780,\n },\n ],\n items: [],\n isWarpRoom: true,\n },\n {\n _area: 7,\n _room: 41,\n address: 139575756,\n mapX: 152,\n mapY: 16,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139575740,\n doors: [\n {\n _door: 0,\n address: 139575740,\n destination: 139574892,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139575756,\n complement: 139574844,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 7,\n _room: 42,\n address: 139575916,\n mapX: 153,\n mapY: 12,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139575884,\n doors: [\n {\n _door: 0,\n address: 139575884,\n destination: 139571612,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139575916,\n complement: 139571596,\n },\n {\n _door: 1,\n address: 139575900,\n destination: 139576108,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139575916,\n complement: 139576044,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 43,\n address: 139576108,\n mapX: 154,\n mapY: 12,\n mapWidth: 1,\n mapHeight: 4,\n doorList: 139576044,\n doors: [\n {\n _door: 0,\n address: 139576044,\n destination: 139575916,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139576108,\n complement: 139575900,\n },\n {\n _door: 1,\n address: 139576060,\n destination: 139577340,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139576108,\n complement: 139577324,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139576076,\n destination: 139576308,\n xPos: 255,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139576108,\n complement: 139576292,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139576092,\n destination: 139577012,\n xPos: 1,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139576108,\n complement: 139576996,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 44,\n address: 139576308,\n mapX: 24,\n mapY: 14,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139576276,\n doors: [\n {\n _door: 0,\n address: 139576276,\n destination: 139576524,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139576308,\n complement: 139576476,\n },\n {\n _door: 1,\n address: 139576292,\n destination: 139576108,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 768,\n direction: DIR.RIGHT,\n sourceRoom: 139576308,\n complement: 139576076,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 45,\n address: 139576524,\n mapX: 22,\n mapY: 14,\n mapWidth: 2,\n mapHeight: 3,\n doorList: 139576476,\n doors: [\n {\n _door: 0,\n address: 139576476,\n destination: 139576308,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139576524,\n complement: 139576276,\n },\n {\n _door: 1,\n address: 139576492,\n destination: 139576892,\n xPos: 255,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139576524,\n complement: 139576876,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139576508,\n destination: 139576708,\n xPos: 2,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139576524,\n complement: 139576676,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 46,\n address: 139576708,\n mapX: 24,\n mapY: 15,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139576676,\n doors: [\n {\n _door: 0,\n address: 139576676,\n destination: 139576524,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139576708,\n complement: 139576508,\n },\n {\n _door: 1,\n address: 139576692,\n destination: 139571860,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139576708,\n complement: 139571812,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 47,\n address: 139576892,\n mapX: 18,\n mapY: 15,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139576860,\n doors: [\n {\n _door: 0,\n address: 139576860,\n destination: 139570444,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 1536,\n direction: DIR.LEFT,\n sourceRoom: 139576892,\n complement: 139570412,\n },\n {\n _door: 1,\n address: 139576876,\n destination: 139576524,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.RIGHT,\n sourceRoom: 139576892,\n complement: 139576492,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 48,\n address: 139577012,\n mapX: 27,\n mapY: 14,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139576996,\n doors: [\n {\n _door: 0,\n address: 139576996,\n destination: 139576108,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 768,\n direction: DIR.LEFT,\n sourceRoom: 139577012,\n complement: 139576092,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 7,\n _room: 49,\n address: 139577212,\n mapX: 160,\n mapY: 12,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139577180,\n doors: [\n {\n _door: 0,\n address: 139577180,\n destination: 139574540,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139577212,\n complement: 139574476,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139577196,\n destination: 139573708,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.UP,\n sourceRoom: 139577212,\n complement: 139573676,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 50,\n address: 139577340,\n mapX: 27,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139577324,\n doors: [\n {\n _door: 0,\n address: 139577324,\n destination: 139576108,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139577340,\n complement: 139576060,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 51,\n address: 139577500,\n mapX: 155,\n mapY: 16,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139577484,\n doors: [\n {\n _door: 0,\n address: 139577484,\n destination: 139577884,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139577500,\n complement: 139577820,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139584088,\n xPos: 48,\n yPos: 136,\n type: 4,\n subtype: 2,\n varA: 104,\n varB: 1,\n flag: 0x51e25d,\n },\n ],\n },\n {\n _area: 7,\n _room: 52,\n address: 139577676,\n mapX: 27,\n mapY: 17,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139577644,\n doors: [\n {\n _door: 0,\n address: 139577644,\n destination: 139575252,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139577676,\n complement: 139575236,\n },\n {\n _door: 1,\n address: 139577660,\n destination: 139577884,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139577676,\n complement: 139577852,\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 53,\n address: 139577884,\n mapX: 156,\n mapY: 16,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139577820,\n doors: [\n {\n _door: 0,\n address: 139577820,\n destination: 139577500,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139577884,\n complement: 139577484,\n },\n {\n _door: 1,\n address: 139577836,\n destination: 139578044,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139577884,\n complement: 139578028,\n },\n {\n _door: 2,\n address: 139577852,\n destination: 139577676,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139577884,\n complement: 139577660,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139577868,\n destination: 139578220,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139577884,\n complement: 139578188,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 7,\n _room: 54,\n address: 139578044,\n mapX: 157,\n mapY: 16,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139578028,\n doors: [\n {\n _door: 0,\n address: 139578028,\n destination: 139577884,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139578044,\n complement: 139577836,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139584292,\n xPos: 976,\n yPos: 136,\n type: 4,\n subtype: 4,\n varA: 75,\n varB: 43,\n flag: 0x51e329,\n },\n ],\n },\n {\n _area: 7,\n _room: 55,\n address: 139578220,\n mapX: 29,\n mapY: 17,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139578188,\n doors: [\n {\n _door: 0,\n address: 139578188,\n destination: 139577884,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139578220,\n complement: 139577868,\n },\n {\n _door: 1,\n address: 139578204,\n destination: 139572372,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139578220,\n complement: 139572356,\n },\n ],\n items: [],\n },\n ],\n },\n {\n area: 'The Arena',\n rooms: [\n {\n _area: 8,\n _room: 0,\n address: 139584656,\n mapX: 129,\n mapY: 15,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139584640,\n doors: [\n {\n _door: 0,\n address: 139584640,\n destination: 139584808,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139584656,\n complement: 139584776,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139588044,\n xPos: 80,\n yPos: 128,\n type: 4,\n subtype: 6,\n varA: 8,\n varB: 2,\n flag: 0x51f1d1,\n },\n ],\n },\n {\n _area: 8,\n _room: 1,\n address: 139584808,\n mapX: 130,\n mapY: 15,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139584776,\n doors: [\n {\n _door: 0,\n address: 139584776,\n destination: 139584656,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139584808,\n complement: 139584640,\n },\n {\n _door: 1,\n address: 139584792,\n destination: 139585528,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.RIGHT,\n sourceRoom: 139584808,\n complement: 139585496,\n },\n ],\n items: [],\n isBossRoom: true,\n },\n {\n _area: 8,\n _room: 2,\n address: 139584992,\n mapX: 131,\n mapY: 12,\n mapWidth: 2,\n mapHeight: 3,\n doorList: 139584928,\n doors: [\n {\n _door: 0,\n address: 139584928,\n destination: 139585664,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139584992,\n complement: 139585648,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139584944,\n destination: 139585816,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139584992,\n complement: 139585784,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 3,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139584960,\n destination: 139585160,\n xPos: 0,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139584992,\n complement: 139585112,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139584976,\n destination: 139585952,\n xPos: 2,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139584992,\n complement: 139585936,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139588224,\n xPos: 464,\n yPos: 408,\n type: 4,\n subtype: 3,\n varA: 29,\n varB: 13,\n flag: 0x51f285,\n },\n ],\n },\n {\n _area: 8,\n _room: 3,\n address: 139585160,\n mapX: 3,\n mapY: 14,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139585112,\n doors: [\n {\n _door: 0,\n address: 139585112,\n destination: 139584992,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.UP,\n sourceRoom: 139585160,\n complement: 139584960,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SMALL], // Being generous here\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139585128,\n destination: 139585328,\n xPos: 0,\n yPos: 1,\n destXOffset: 65520,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139585160,\n complement: 139585280,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 2,\n locks: [Locks.SMALL], // Being generous here\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139585144,\n destination: 139586560,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139585160,\n complement: 139586528,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 4,\n address: 139585328,\n mapX: 131,\n mapY: 14,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139585280,\n doors: [\n {\n _door: 0,\n address: 139585280,\n destination: 139585160,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 16,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139585328,\n complement: 139585128,\n },\n {\n _door: 1,\n address: 139585296,\n destination: 139587880,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139585328,\n complement: 139587864,\n },\n {\n _door: 2,\n address: 139585312,\n destination: 139585528,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139585328,\n complement: 139585448,\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 5,\n address: 139585528,\n mapX: 132,\n mapY: 14,\n mapWidth: 1,\n mapHeight: 3,\n doorList: 139585448,\n doors: [\n {\n _door: 0,\n address: 139585448,\n destination: 139585328,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139585528,\n complement: 139585312,\n },\n {\n _door: 1,\n address: 139585464,\n destination: 139586104,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139585528,\n complement: 139586072,\n isArenaDoor: true,\n },\n {\n _door: 2,\n address: 139585480,\n destination: 139586256,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139585528,\n complement: 139586224,\n isArenaDoor: true,\n },\n {\n _door: 3,\n address: 139585496,\n destination: 139584808,\n xPos: 255,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139585528,\n complement: 139584792,\n isBossDoor: true,\n },\n {\n _door: 4,\n address: 139585512,\n destination: 139586408,\n xPos: 1,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139585528,\n complement: 139586376,\n isArenaDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 6,\n address: 139585664,\n mapX: 133,\n mapY: 12,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139585648,\n doors: [\n {\n _door: 0,\n address: 139585648,\n destination: 139584992,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139585664,\n complement: 139584928,\n },\n ],\n items: [], // TODO: rando candle at 0x51F4A1\n },\n {\n _area: 8,\n _room: 7,\n address: 139585816,\n mapX: 5,\n mapY: 13,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139585784,\n doors: [\n {\n _door: 0,\n address: 139585784,\n destination: 139584992,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139585816,\n complement: 139584944,\n },\n {\n _door: 1,\n address: 139585800,\n destination: 139586912,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139585816,\n complement: 139586880,\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 8,\n address: 139585952,\n mapX: 133,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139585936,\n doors: [\n {\n _door: 0,\n address: 139585936,\n destination: 139584992,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139585952,\n complement: 139584976,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139589112,\n xPos: 184,\n yPos: 152,\n type: 4,\n subtype: 4,\n varA: 65,\n varB: 27,\n flag: 0x51f1d1,\n },\n ],\n },\n {\n _area: 8,\n _room: 9,\n address: 139586104,\n mapX: 133,\n mapY: 14,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139586072,\n doors: [\n {\n _door: 0,\n address: 139586072,\n destination: 139585528,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139586104,\n complement: 139585464,\n },\n {\n _door: 1,\n address: 139586088,\n destination: 139587048,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139586104,\n complement: 139587032,\n isSpecialWall: true, // idk how else to phrase this\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.BAT], // You can bat over the wall TODO: should I mandate this?\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 10, // Worst room in the game\n address: 139586256,\n mapX: 5,\n mapY: 15,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139586224,\n doors: [\n {\n _door: 0,\n address: 139586224,\n destination: 139585528,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139586256,\n complement: 139585480,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139586240,\n destination: 139587184,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139586256,\n complement: 139587168,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SLIDE],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 11,\n address: 139586408,\n mapX: 133,\n mapY: 15,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139586376,\n doors: [\n {\n _door: 0,\n address: 139586376,\n destination: 139585528,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139586408,\n complement: 139585512,\n },\n {\n _door: 1,\n address: 139586392,\n destination: 139587320,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139586408,\n complement: 139587304,\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 12,\n address: 139586560,\n mapX: 6,\n mapY: 14,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139586528,\n doors: [\n {\n _door: 0,\n address: 139586528,\n destination: 139585160,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139586560,\n complement: 139585144,\n },\n {\n _door: 1,\n address: 139586544,\n destination: 139586744,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139586560,\n complement: 139586680,\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 13,\n address: 139586744,\n mapX: 8,\n mapY: 14,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139586680,\n doors: [\n {\n _door: 0,\n address: 139586680,\n destination: 139586560,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139586744,\n complement: 139586544,\n },\n {\n _door: 1,\n address: 139586696,\n destination: 139586912,\n xPos: 1,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.UP,\n sourceRoom: 139586744,\n complement: 139586896,\n },\n {\n _door: 2,\n address: 139586712,\n destination: 139588008,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139586744,\n complement: 139587992,\n },\n {\n _door: 3,\n address: 139586728,\n destination: 139587608,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139586744,\n complement: 139587576,\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 14,\n address: 139586912,\n mapX: 137,\n mapY: 12,\n mapWidth: 1,\n mapHeight: 3,\n doorList: 139586864,\n doors: [\n {\n _door: 0,\n address: 139586864,\n destination: 139587456,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139586912,\n complement: 139587440,\n },\n {\n _door: 1,\n address: 139586880,\n destination: 139585816,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139586912,\n complement: 139585800,\n },\n {\n _door: 2,\n address: 139586896,\n destination: 139586744,\n xPos: 0,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139586912,\n complement: 139586696,\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 15,\n address: 139587048,\n mapX: 137,\n mapY: 14,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139587032,\n doors: [\n {\n _door: 0,\n address: 139587032,\n destination: 139586104,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139587048,\n complement: 139586088,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139589808,\n xPos: 200,\n yPos: 136,\n type: 4,\n subtype: 4,\n varA: 54,\n varB: 7,\n flag: 0x51f8b5,\n },\n ],\n },\n {\n _area: 8,\n _room: 16,\n address: 139587184,\n mapX: 9,\n mapY: 15,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139587168,\n doors: [\n {\n _door: 0,\n address: 139587168,\n destination: 139586256,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139587184,\n complement: 139586240,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139589844,\n xPos: 152,\n yPos: 152,\n type: 5,\n subtype: 3,\n varA: 49,\n varB: 56,\n isHardMode: true,\n flag: 0x51f8d9,\n },\n {\n _item: 1,\n address: 139589856,\n xPos: 200,\n yPos: 136,\n type: 4,\n subtype: 3,\n varA: 24,\n varB: 17,\n flag: 0x51f8e5,\n },\n ],\n },\n {\n _area: 8,\n _room: 17,\n address: 139587320,\n mapX: 137,\n mapY: 15,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139587304,\n doors: [\n {\n _door: 0,\n address: 139587304,\n destination: 139586408,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139587320,\n complement: 139586392,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139589892,\n xPos: 200,\n yPos: 136,\n type: 4,\n subtype: 4,\n varA: 72,\n varB: 39,\n flag: 0x51f909,\n },\n ],\n },\n {\n _area: 8,\n _room: 18,\n address: 139587456,\n mapX: 138,\n mapY: 12,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139587440,\n doors: [\n {\n _door: 0,\n address: 139587440,\n destination: 139586912,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139587456,\n complement: 139586864,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139589952,\n xPos: 200,\n yPos: 127,\n type: 4,\n subtype: 2,\n varA: 103,\n varB: 1,\n flag: 0x51f945,\n },\n ],\n },\n {\n _area: 8,\n _room: 19,\n address: 139587608,\n mapX: 138,\n mapY: 14,\n mapWidth: 2,\n mapHeight: 3,\n doorList: 139587576,\n doors: [\n {\n _door: 0,\n address: 139587576,\n destination: 139586744,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 512,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139587608,\n complement: 139586728,\n },\n {\n _door: 1,\n address: 139587592,\n destination: 139587760,\n xPos: 2,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139587608,\n complement: 139587728,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS], // Can grab ledge but won't require like early garden\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 20,\n address: 139587760,\n mapX: 140,\n mapY: 15,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139587728,\n doors: [\n {\n _door: 0,\n address: 139587728,\n destination: 139587608,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139587760,\n complement: 139587592,\n },\n {\n _door: 1,\n address: 139587744,\n destination: 139575388,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139587760,\n complement: 139575356,\n isWoodenDoor: true,\n },\n ],\n items: [],\n },\n {\n _area: 8,\n _room: 21,\n address: 139587880,\n mapX: 130,\n mapY: 14,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139587864,\n doors: [\n {\n _door: 0,\n address: 139587864,\n destination: 139585328,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139587880,\n complement: 139585296,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 8,\n _room: 22,\n address: 139588008,\n mapX: 11,\n mapY: 14,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139587992,\n doors: [\n {\n _door: 0,\n address: 139587992,\n destination: 139586744,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139588008,\n complement: 139586712,\n },\n ],\n items: [],\n isWarpRoom: true,\n },\n ],\n },\n {\n area: 'Top Floor',\n rooms: [\n {\n _area: 9,\n _room: 0,\n address: 139590384,\n mapX: 152,\n mapY: 1,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139590368,\n doors: [\n {\n _door: 0,\n address: 139590368,\n destination: 139591024,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139590384,\n complement: 139590992,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139594668,\n xPos: 64,\n yPos: 167,\n type: 4,\n subtype: 4,\n varA: 55,\n varB: 8,\n flag: 0x520bb1,\n },\n {\n _item: 1,\n address: 139594680,\n xPos: 120,\n yPos: 168,\n type: 4,\n subtype: 6,\n varA: 10,\n varB: 3,\n flag: 0x520bbd,\n },\n ],\n },\n {\n _area: 9,\n _room: 1,\n address: 139590552,\n mapX: 152,\n mapY: 1,\n mapWidth: 4,\n mapHeight: 2,\n doorList: 139590504,\n doors: [\n {\n _door: 0,\n address: 139590504,\n destination: 139591024,\n xPos: 1,\n yPos: 0,\n destXOffset: 224,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139590552,\n complement: 139591008,\n isBossDoor: true,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n item: 1,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139590520,\n destination: 139594368,\n xPos: 2,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 512,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139590552,\n complement: 139594288,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n door: 2,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139590536,\n destination: 139592256,\n xPos: 4,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139590552,\n complement: 139592176,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.DRACULA], // Effectively don't let them until Drac\n },\n {\n door: 1,\n locks: [Locks.INACCESSIBLE],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.INACCESSIBLE],\n },\n {\n item: 1,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139594704,\n xPos: 88,\n yPos: 423,\n type: 4,\n subtype: 2,\n varA: 116,\n varB: 7,\n flag: 0x520bd5,\n },\n {\n _item: 1,\n address: 139594776,\n xPos: 976,\n yPos: 87,\n type: 5,\n subtype: 4,\n varA: 70,\n varB: 37,\n isHardMode: true,\n flag: 0x520c1d,\n },\n ],\n },\n {\n _area: 9,\n _room: 2,\n address: 139590696,\n mapX: 152,\n mapY: 4,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139590680,\n doors: [\n {\n _door: 0,\n address: 139590680,\n destination: 139590872,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 16,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139590696,\n complement: 139590824,\n items: [\n {\n item: 0,\n locks: [Locks.MALPHAS], // Technically reachable without anything\n },\n ],\n },\n ],\n items: [\n {\n _item: 0,\n address: 139594800,\n xPos: 128,\n yPos: 103,\n type: 4,\n subtype: 3,\n varA: 44,\n varB: 48,\n flag: 0x520c35,\n },\n ],\n },\n {\n _area: 9,\n _room: 3,\n address: 139590872,\n mapX: 24,\n mapY: 5,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139590824,\n doors: [\n {\n _door: 0,\n address: 139590824,\n destination: 139590696,\n xPos: 0,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139590872,\n complement: 139590680,\n isBreakableDoor: true,\n },\n {\n _door: 1,\n address: 139590840,\n destination: 139591520,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139590872,\n complement: 139591488,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT], // Can get through transition but won't have enough height to get to most ledges\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139590856,\n destination: 139591680,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139590872,\n complement: 139591648,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 4,\n address: 139591024,\n mapX: 153,\n mapY: 1,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139590992,\n doors: [\n {\n _door: 0,\n address: 139590992,\n destination: 139590384,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139591024,\n complement: 139590368,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.DRACULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139591008,\n destination: 139590552,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 512,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139591024,\n complement: 139590504,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.DRACULA],\n },\n ],\n },\n },\n ],\n items: [],\n isBossRoom: true,\n isGrahamRoom: true,\n },\n {\n _area: 9,\n _room: 5,\n address: 139591200,\n mapX: 153,\n mapY: 4,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139591168,\n doors: [\n {\n _door: 0,\n address: 139591168,\n destination: 139594368,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 256,\n destYPos: 768,\n direction: DIR.UP,\n sourceRoom: 139591200,\n complement: 139594336,\n },\n {\n _door: 1,\n address: 139591184,\n destination: 139591360,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139591200,\n complement: 139591344,\n isBreakableDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 6,\n address: 139591360,\n mapX: 155,\n mapY: 4,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139591344,\n doors: [\n {\n _door: 0,\n address: 139591344,\n destination: 139591200,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139591360,\n complement: 139591184,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139595112,\n xPos: 152,\n yPos: 144,\n type: 4,\n subtype: 8,\n varA: 5,\n varB: 5,\n flag: 0x520d6d,\n },\n ],\n },\n {\n _area: 9,\n _room: 7,\n address: 139591520,\n mapX: 26,\n mapY: 5,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139591488,\n doors: [\n {\n _door: 0,\n address: 139591488,\n destination: 139590872,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139591520,\n complement: 139590840,\n },\n {\n _door: 1,\n address: 139591504,\n destination: 139592848,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139591520,\n complement: 139592800,\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 8,\n address: 139591680,\n mapX: 154,\n mapY: 5,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139591648,\n doors: [\n {\n _door: 0,\n address: 139591648,\n destination: 139590872,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139591680,\n complement: 139590856,\n },\n {\n _door: 1,\n address: 139591664,\n destination: 139591856,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139591680,\n complement: 139591808,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139595268,\n xPos: 464,\n yPos: 151,\n type: 4,\n subtype: 4,\n varA: 69,\n varB: 36,\n flag: 0x520e09,\n },\n ],\n },\n {\n _area: 9,\n _room: 9,\n address: 139591856,\n mapX: 26,\n mapY: 6,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139591808,\n doors: [\n {\n _door: 0,\n address: 139591808,\n destination: 139591680,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139591856,\n complement: 139591664,\n },\n {\n _door: 1,\n address: 139591824,\n destination: 139593024,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139591856,\n complement: 139592992,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS], // Can transition but not enough height for most ledges\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139591840,\n destination: 139592032,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139591856,\n complement: 139592000,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS], // Can transition but not enough height for most ledges\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 10,\n address: 139592032,\n mapX: 154,\n mapY: 6,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139591984,\n doors: [\n {\n _door: 0,\n address: 139591984,\n destination: 139551848,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139592032,\n complement: 139551832,\n isWoodenDoor: true,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139592000,\n destination: 139591856,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139592032,\n complement: 139591840,\n },\n {\n _door: 2,\n address: 139592016,\n destination: 139526428,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139592032,\n complement: 139526396,\n isWoodenDoor: true,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 11,\n address: 139592256,\n mapX: 28,\n mapY: 2,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139592176,\n doors: [\n {\n _door: 0,\n address: 139592176,\n destination: 139590552,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 784,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139592256,\n complement: 139590536,\n },\n {\n _door: 1,\n address: 139592192,\n destination: 139593184,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139592256,\n complement: 139593168,\n },\n {\n _door: 2,\n address: 139592208,\n destination: 139594368,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139592256,\n complement: 139594304,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139592224,\n destination: 139593344,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139592256,\n complement: 139593328,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139592240,\n destination: 139592480,\n xPos: 0,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139592256,\n complement: 139592400,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 12,\n address: 139592480,\n mapX: 28,\n mapY: 3,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139592400,\n doors: [\n {\n _door: 0,\n address: 139592400,\n destination: 139592256,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139592480,\n complement: 139592240,\n },\n {\n _door: 1,\n address: 139592416,\n destination: 139594168,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139592480,\n complement: 139594152,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS], // Height for ledge past transition\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139592432,\n destination: 139594368,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 784,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139592480,\n complement: 139594320,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139592448,\n destination: 139593536,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139592480,\n complement: 139593504,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139592464,\n destination: 139592672,\n xPos: 0,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 16,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139592480,\n complement: 139592624,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 13,\n address: 139592672,\n mapX: 28,\n mapY: 4,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139592624,\n doors: [\n {\n _door: 0,\n address: 139592624,\n destination: 139592480,\n xPos: 0,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139592672,\n complement: 139592464,\n },\n {\n _door: 1,\n address: 139592640,\n destination: 139594368,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 784,\n destYPos: 768,\n direction: DIR.LEFT,\n sourceRoom: 139592672,\n complement: 139594352,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139592656,\n destination: 139592848,\n xPos: 1,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 256,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139592672,\n complement: 139592816,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 14,\n address: 139592848,\n mapX: 28,\n mapY: 5,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139592800,\n doors: [\n {\n _door: 0,\n address: 139592800,\n destination: 139591520,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139592848,\n complement: 139591504,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139592816,\n destination: 139592672,\n xPos: 1,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 256,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139592848,\n complement: 139592656,\n },\n {\n _door: 2,\n address: 139592832,\n destination: 139593744,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139592848,\n complement: 139593664,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 15,\n address: 139593024,\n mapX: 156,\n mapY: 5,\n mapWidth: 2,\n mapHeight: 2,\n doorList: 139592992,\n doors: [\n {\n _door: 0,\n address: 139592992,\n destination: 139591856,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139593024,\n complement: 139591824,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139593008,\n destination: 139593744,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.RIGHT,\n sourceRoom: 139593024,\n complement: 139593712,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 16,\n address: 139593184,\n mapX: 29,\n mapY: 2,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139593168,\n doors: [\n {\n _door: 0,\n address: 139593168,\n destination: 139592256,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139593184,\n complement: 139592192,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139596264,\n xPos: 176,\n yPos: 151,\n type: 4,\n subtype: 2,\n varA: 117,\n varB: 7,\n flag: 0x5211ed,\n },\n ],\n },\n {\n _area: 9,\n _room: 17,\n address: 139593344,\n mapX: 157,\n mapY: 2,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139593328,\n doors: [\n {\n _door: 0,\n address: 139593328,\n destination: 139592256,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139593344,\n complement: 139592224,\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 18,\n address: 139593536,\n mapX: 157,\n mapY: 3,\n mapWidth: 3,\n mapHeight: 1,\n doorList: 139593504,\n doors: [\n {\n _door: 0,\n address: 139593504,\n destination: 139592480,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139593536,\n complement: 139592448,\n isWeirdAnnoyingOneWayTopFloorRoom: true,\n },\n {\n _door: 1,\n address: 139593520,\n destination: 139594504,\n xPos: 3,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139593536,\n complement: 139594472,\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 19,\n address: 139593744,\n mapX: 30,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 3,\n doorList: 139593664,\n doors: [\n {\n _door: 0,\n address: 139593664,\n destination: 139592848,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139593744,\n complement: 139592832,\n },\n {\n _door: 1,\n address: 139593680,\n destination: 139593888,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139593744,\n complement: 139593872,\n },\n {\n _door: 2,\n address: 139593696,\n destination: 139594632,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139593744,\n complement: 139594616,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139593712,\n destination: 139593024,\n xPos: 255,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139593744,\n complement: 139593008,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139593728,\n destination: 139594048,\n xPos: 1,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139593744,\n complement: 139594032,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 20,\n address: 139593888,\n mapX: 31,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139593872,\n doors: [\n {\n _door: 0,\n address: 139593872,\n destination: 139593744,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139593888,\n complement: 139593680,\n },\n ],\n items: [],\n },\n {\n _area: 9,\n _room: 21,\n address: 139594048,\n mapX: 31,\n mapY: 6,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139594032,\n doors: [\n {\n _door: 0,\n address: 139594032,\n destination: 139593744,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139594048,\n complement: 139593728,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139596636,\n xPos: 144,\n yPos: 151,\n type: 4,\n subtype: 2,\n varA: 112,\n varB: 2,\n flag: 0x521361,\n },\n ],\n },\n {\n _area: 9,\n _room: 22,\n address: 139594168,\n mapX: 29,\n mapY: 3,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139594152,\n doors: [\n {\n _door: 0,\n address: 139594152,\n destination: 139592480,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139594168,\n complement: 139592416,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 9,\n _room: 23,\n address: 139594368,\n mapX: 152,\n mapY: 2,\n mapWidth: 4,\n mapHeight: 4,\n doorList: 139594288,\n doors: [\n {\n _door: 0,\n address: 139594288,\n destination: 139590552,\n xPos: 2,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 512,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139594368,\n complement: 139590520,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n {\n door: 2,\n locks: [Locks.SMALL],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139594304,\n destination: 139592256,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139594368,\n complement: 139592208,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 2,\n locks: [Locks.SMALL],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139594320,\n destination: 139592480,\n xPos: 4,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139594368,\n complement: 139592432,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139594336,\n destination: 139591200,\n xPos: 1,\n yPos: 4,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139594368,\n complement: 139591168,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n {\n door: 2,\n locks: [Locks.FLIGHT],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139594352,\n destination: 139592672,\n xPos: 4,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139594368,\n complement: 139592640,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLIGHT],\n },\n {\n door: 1,\n locks: [Locks.FLIGHT],\n },\n {\n door: 2,\n locks: [Locks.FLIGHT],\n },\n ],\n items: [\n {\n item: 0,\n locks: [Locks.FLIGHT],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139596672,\n xPos: 80,\n yPos: 119,\n type: 4,\n subtype: 3,\n varA: 32,\n varB: 15,\n flag: 0x521385,\n },\n ],\n },\n {\n _area: 9,\n _room: 24,\n address: 139594504,\n mapX: 160,\n mapY: 3,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139594472,\n doors: [\n {\n _door: 0,\n address: 139594472,\n destination: 139593536,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 528,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139594504,\n complement: 139593520,\n },\n {\n _door: 1,\n address: 139594488,\n destination: 139559936,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139594504,\n complement: 139559904,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 9,\n _room: 25,\n address: 139594632,\n mapX: 159,\n mapY: 5,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139594616,\n doors: [\n {\n _door: 0,\n address: 139594616,\n destination: 139593744,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139594632,\n complement: 139593696,\n },\n ],\n items: [],\n isWarpRoom: true,\n },\n ],\n },\n {\n area: 'Forbidden Area',\n rooms: [\n {\n _area: 10,\n _room: 0,\n address: 139596920,\n mapX: 162,\n mapY: 14,\n mapWidth: 4,\n mapHeight: 1,\n doorList: 139596888,\n doors: [\n {\n _door: 0,\n address: 139596888,\n destination: 139597968,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139596920,\n complement: 139597952,\n },\n {\n _door: 1,\n address: 139596904,\n destination: 139597240,\n xPos: 4,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139596920,\n complement: 139597208,\n },\n ],\n items: [],\n },\n {\n _area: 10,\n _room: 1,\n address: 139597072,\n mapX: 166,\n mapY: 13,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139597040,\n doors: [\n {\n _door: 0,\n address: 139597040,\n destination: 139539292,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139597072,\n complement: 139539260,\n },\n {\n _door: 1,\n address: 139597056,\n destination: 139597240,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139597072,\n complement: 139597192,\n isWeirdAnnoyingOneWayForbiddenAreaRoom: true,\n },\n ],\n items: [],\n },\n {\n _area: 10,\n _room: 2,\n address: 139597240,\n mapX: 38,\n mapY: 14,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139597192,\n doors: [\n {\n _door: 0,\n address: 139597192,\n destination: 139597072,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139597240,\n complement: 139597056,\n },\n {\n _door: 1,\n address: 139597208,\n destination: 139596920,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 784,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139597240,\n complement: 139596904,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139597224,\n destination: 139597392,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139597240,\n complement: 139597360,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 10,\n _room: 3,\n address: 139597392,\n mapX: 167,\n mapY: 14,\n mapWidth: 5,\n mapHeight: 1,\n doorList: 139597360,\n doors: [\n {\n _door: 0,\n address: 139597360,\n destination: 139597240,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139597392,\n complement: 139597224,\n },\n {\n _door: 1,\n address: 139597376,\n destination: 139597696,\n xPos: 4,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139597392,\n complement: 139597648,\n },\n ],\n items: [],\n },\n {\n _area: 10,\n _room: 4,\n address: 139597528,\n mapX: 170,\n mapY: 15,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139597512,\n doors: [\n {\n _door: 0,\n address: 139597512,\n destination: 139597696,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139597528,\n complement: 139597664,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139598936,\n xPos: 48,\n yPos: 88,\n type: 4,\n subtype: 3,\n varA: 35,\n varB: 25,\n flag: 0x521c5d,\n },\n ],\n },\n {\n _area: 10,\n _room: 5,\n address: 139597696,\n mapX: 43,\n mapY: 15,\n mapWidth: 3,\n mapHeight: 2,\n doorList: 139597648,\n doors: [\n {\n _door: 0,\n address: 139597648,\n destination: 139597392,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 1024,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139597696,\n complement: 139597376,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SKULA],\n },\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139597664,\n destination: 139597528,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139597696,\n complement: 139597512,\n isBreakableDoor: true,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS, Locks.SKULA],\n },\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139597680,\n destination: 139598120,\n xPos: 3,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139597696,\n complement: 139598088,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 10,\n _room: 6,\n address: 139597832,\n mapX: 38,\n mapY: 16,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139597816,\n doors: [\n {\n _door: 0,\n address: 139597816,\n destination: 139598576,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139597832,\n complement: 139598544,\n access: {\n items: [\n {\n item: 0,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [\n {\n _item: 0,\n address: 139599104,\n xPos: 208,\n yPos: 88,\n type: 4,\n subtype: 3,\n varA: 36,\n varB: 22,\n flag: 0x521d05,\n },\n ],\n },\n {\n _area: 10,\n _room: 7,\n address: 139597968,\n mapX: 161,\n mapY: 14,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139597936,\n doors: [\n {\n _door: 0,\n address: 139597936,\n destination: 139573276,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139597968,\n complement: 139573260,\n },\n {\n _door: 1,\n address: 139597952,\n destination: 139596920,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139597968,\n complement: 139596888,\n },\n ],\n items: [],\n isTransitionRoom: true,\n },\n {\n _area: 10,\n _room: 8,\n address: 139598120,\n mapX: 174,\n mapY: 15,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139598088,\n doors: [\n {\n _door: 0,\n address: 139598088,\n destination: 139597696,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 528,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139598120,\n complement: 139597680,\n },\n {\n _door: 1,\n address: 139598104,\n destination: 139598272,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139598120,\n complement: 139598240,\n },\n ],\n items: [],\n },\n {\n _area: 10,\n _room: 9,\n address: 139598272,\n mapX: 46,\n mapY: 16,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139598240,\n doors: [\n {\n _door: 0,\n address: 139598240,\n destination: 139598120,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139598272,\n complement: 139598104,\n },\n {\n _door: 1,\n address: 139598256,\n destination: 139598424,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1808,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139598272,\n complement: 139598408,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 10,\n _room: 10,\n address: 139598424,\n mapX: 166,\n mapY: 16,\n mapWidth: 8,\n mapHeight: 1,\n doorList: 139598392,\n doors: [\n {\n _door: 0,\n address: 139598392,\n destination: 139598576,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139598424,\n complement: 139598560,\n },\n {\n _door: 1,\n address: 139598408,\n destination: 139598272,\n xPos: 8,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139598424,\n complement: 139598256,\n },\n ],\n items: [],\n },\n {\n _area: 10,\n _room: 11,\n address: 139598576,\n mapX: 37,\n mapY: 16,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139598544,\n doors: [\n {\n _door: 0,\n address: 139598544,\n destination: 139597832,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139598576,\n complement: 139597816,\n },\n {\n _door: 1,\n address: 139598560,\n destination: 139598424,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139598576,\n complement: 139598392,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n ],\n },\n {\n area: 'Chaotic Realm',\n rooms: [\n {\n _area: 11,\n _room: 0,\n address: 139599532,\n mapX: 129,\n mapY: 18,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139599516,\n doors: [\n {\n _door: 0,\n address: 139599516,\n destination: 139600132,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139599532,\n complement: 139600084,\n },\n ],\n items: [], // Chaos ring lol\n },\n {\n _area: 11,\n _room: 1,\n address: 139599652,\n mapX: 1,\n mapY: 20,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139599636,\n doors: [\n {\n _door: 0,\n address: 139599636,\n destination: 139600324,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139599652,\n complement: 139600292,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 11,\n _room: 2,\n address: 139599804,\n mapX: 129,\n mapY: 20,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139599772,\n doors: [\n {\n _door: 0,\n address: 139599772,\n destination: 139600324,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139599804,\n complement: 139600308,\n },\n {\n _door: 1,\n address: 139599788,\n destination: 139599964,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 16,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139599804,\n complement: 139599932,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 3,\n address: 139599964,\n mapX: 1,\n mapY: 21,\n mapWidth: 2,\n mapHeight: 3,\n doorList: 139599932,\n doors: [\n {\n _door: 0,\n address: 139599932,\n destination: 139599804,\n xPos: 0,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139599964,\n complement: 139599788,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139599948,\n destination: 139600924,\n xPos: 2,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139599964,\n complement: 139600892,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 4,\n address: 139600132,\n mapX: 130,\n mapY: 18,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139600084,\n doors: [\n {\n _door: 0,\n address: 139600084,\n destination: 139599532,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139600132,\n complement: 139599516,\n },\n {\n _door: 1,\n address: 139600100,\n destination: 139600476,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139600132,\n complement: 139600444,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.FLOAT],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139600116,\n destination: 139602796,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139600132,\n complement: 139602764,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 5,\n address: 139600324,\n mapX: 2,\n mapY: 20,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139600276,\n doors: [\n {\n _door: 0,\n address: 139600276,\n destination: 139605028,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139600324,\n complement: 139605012,\n },\n {\n _door: 1,\n address: 139600292,\n destination: 139599652,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139600324,\n complement: 139599636,\n },\n {\n _door: 2,\n address: 139600308,\n destination: 139599804,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139600324,\n complement: 139599772,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 6,\n address: 139600476,\n mapX: 131,\n mapY: 18,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139600444,\n doors: [\n {\n _door: 0,\n address: 139600444,\n destination: 139600132,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139600476,\n complement: 139600100,\n },\n {\n _door: 1,\n address: 139600460,\n destination: 139601380,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139600476,\n complement: 139601332,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 7,\n address: 139600628,\n mapX: 3,\n mapY: 19,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139600596,\n doors: [\n {\n _door: 0,\n address: 139600596,\n destination: 139601076,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139600628,\n complement: 139601044,\n },\n {\n _door: 1,\n address: 139600612,\n destination: 139600780,\n xPos: 0,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 16,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139600628,\n complement: 139600748,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 8,\n address: 139600780,\n mapX: 3,\n mapY: 20,\n mapWidth: 2,\n mapHeight: 3,\n doorList: 139600748,\n doors: [\n {\n _door: 0,\n address: 139600748,\n destination: 139600628,\n xPos: 0,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.UP,\n sourceRoom: 139600780,\n complement: 139600612,\n },\n {\n _door: 1,\n address: 139600764,\n destination: 139601940,\n xPos: 2,\n yPos: 2,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139600780,\n complement: 139601892,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS], // Can grab ledge but won't require like early garden\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 9,\n address: 139600924,\n mapX: 131,\n mapY: 21,\n mapWidth: 5,\n mapHeight: 2,\n doorList: 139600892,\n doors: [\n {\n _door: 0,\n address: 139600892,\n destination: 139599964,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139600924,\n complement: 139599948,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139600908,\n destination: 139605180,\n xPos: 5,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139600924,\n complement: 139605164,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SKULA, Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 10,\n address: 139601076,\n mapX: 4,\n mapY: 19,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139601044,\n doors: [\n {\n _door: 0,\n address: 139601044,\n destination: 139600628,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139601076,\n complement: 139600596,\n },\n {\n _door: 1,\n address: 139601060,\n destination: 139602220,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139601076,\n complement: 139602188,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 11,\n address: 139601212,\n mapX: 132,\n mapY: 19,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139601196,\n doors: [\n {\n _door: 0,\n address: 139601196,\n destination: 139601564,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139601212,\n complement: 139601516,\n },\n ],\n items: [],\n isBossRoom: true,\n isChaos: true,\n isWeirdChaoticRealmRoomDoNotModify: true,\n },\n {\n _area: 11,\n _room: 12,\n address: 139601380,\n mapX: 133,\n mapY: 18,\n mapWidth: 5,\n mapHeight: 1,\n doorList: 139601332,\n doors: [\n {\n _door: 0,\n address: 139601332,\n destination: 139600476,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139601380,\n complement: 139600460,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139601348,\n destination: 139602068,\n xPos: 1,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139601380,\n complement: 139602052,\n },\n {\n _door: 2,\n address: 139601364,\n destination: 139604316,\n xPos: 5,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139601380,\n complement: 139604220,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 13,\n address: 139601564,\n mapX: 133,\n mapY: 19,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139601516,\n doors: [\n {\n _door: 0,\n address: 139601516,\n destination: 139601212,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139601564,\n complement: 139601196,\n isBossDoor: true,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SKULA], // Technically not necessary, but just to be safe\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139601532,\n destination: 139602340,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139601564,\n complement: 139602324,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SKULA], // Technically not necessary, but just to be safe\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139601548,\n destination: 139601764,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139601564,\n complement: 139601732,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 14,\n address: 139601764,\n mapX: 5,\n mapY: 20,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139601732,\n doors: [\n {\n _door: 0,\n address: 139601732,\n destination: 139601564,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139601764,\n complement: 139601548,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139601748,\n destination: 139602492,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139601764,\n complement: 139602460,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 15,\n address: 139601940,\n mapX: 5,\n mapY: 21,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139601892,\n doors: [\n {\n _door: 0,\n address: 139601892,\n destination: 139600780,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 272,\n destYPos: 512,\n direction: DIR.LEFT,\n sourceRoom: 139601940,\n complement: 139600764,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139601908,\n destination: 139602492,\n xPos: 1,\n yPos: 255,\n destXOffset: 65520,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.UP,\n sourceRoom: 139601940,\n complement: 139602476,\n },\n {\n _door: 2,\n address: 139601924,\n destination: 139603300,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139601940,\n complement: 139603284,\n access: {\n doors: [\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 16,\n address: 139602068,\n mapX: 6,\n mapY: 18,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139602052,\n doors: [\n {\n _door: 0,\n address: 139602052,\n destination: 139601380,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139602068,\n complement: 139601348,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 17,\n address: 139602220,\n mapX: 6,\n mapY: 19,\n mapWidth: 2,\n mapHeight: 1,\n doorList: 139602188,\n doors: [\n {\n _door: 0,\n address: 139602188,\n destination: 139601076,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139602220,\n complement: 139601060,\n },\n {\n _door: 1,\n address: 139602204,\n destination: 139603500,\n xPos: 2,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139602220,\n complement: 139603452,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 18,\n address: 139602340,\n mapX: 134,\n mapY: 19,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139602324,\n doors: [\n {\n _door: 0,\n address: 139602324,\n destination: 139601564,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139602340,\n complement: 139601532,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 11,\n _room: 19,\n address: 139602492,\n mapX: 134,\n mapY: 20,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139602460,\n doors: [\n {\n _door: 0,\n address: 139602460,\n destination: 139601764,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139602492,\n complement: 139601748,\n },\n {\n _door: 1,\n address: 139602476,\n destination: 139601940,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139602492,\n complement: 139601908,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 20,\n address: 139602620,\n mapX: 12,\n mapY: 18,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139602620,\n doors: [],\n items: [],\n isBossRoom: true,\n isChaos: true,\n isWeirdChaoticRealmRoomDoNotModify: true,\n },\n {\n _area: 11,\n _room: 21,\n address: 139602796,\n mapX: 1,\n mapY: 19,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139602764,\n doors: [\n {\n _door: 0,\n address: 139602764,\n destination: 139600132,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139602796,\n complement: 139600116,\n },\n {\n _door: 1,\n address: 139602780,\n destination: 139605028,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139602796,\n complement: 139604996,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 22,\n address: 139602908,\n mapX: 13,\n mapY: 18,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139602908,\n doors: [],\n items: [],\n isBossRoom: true,\n isChaos: true,\n isWeirdChaoticRealmRoomDoNotModify: true,\n },\n {\n _area: 11,\n _room: 23,\n address: 139603028,\n mapX: 14,\n mapY: 18,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139603028,\n doors: [],\n items: [],\n isCreditsRoom: true,\n isWeirdChaoticRealmRoomDoNotModify: true,\n },\n {\n _area: 11,\n _room: 24,\n address: 139603164,\n mapX: 135,\n mapY: 20,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139603148,\n doors: [\n {\n _door: 0,\n address: 139603148,\n destination: 139603668,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139603164,\n complement: 139603636,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139607228,\n xPos: 48,\n yPos: 184,\n type: 4,\n subtype: 2,\n varA: 114,\n varB: 2,\n flag: 0x523d99,\n },\n ],\n },\n {\n _area: 11,\n _room: 25,\n address: 139603300,\n mapX: 7,\n mapY: 21,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139603284,\n doors: [\n {\n _door: 0,\n address: 139603284,\n destination: 139601940,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139603300,\n complement: 139601924,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 26,\n address: 139603500,\n mapX: 8,\n mapY: 19,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139603452,\n doors: [\n {\n _door: 0,\n address: 139603452,\n destination: 139602220,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 272,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139603500,\n complement: 139602204,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 1,\n address: 139603468,\n destination: 139603812,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139603500,\n complement: 139603796,\n access: {\n doors: [\n {\n door: 2,\n locks: [Locks.SKULA],\n },\n ],\n },\n },\n {\n _door: 2,\n address: 139603484,\n destination: 139605332,\n xPos: 1,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139603500,\n complement: 139605300,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 27,\n address: 139603668,\n mapX: 8,\n mapY: 20,\n mapWidth: 1,\n mapHeight: 3,\n doorList: 139603620,\n doors: [\n {\n _door: 0,\n address: 139603620,\n destination: 139605332,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.RIGHT,\n sourceRoom: 139603668,\n complement: 139605316,\n },\n {\n _door: 1,\n address: 139603636,\n destination: 139603164,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139603668,\n complement: 139603148,\n },\n {\n _door: 2,\n address: 139603652,\n destination: 139605180,\n xPos: 0,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139603668,\n complement: 139605148,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 28,\n address: 139603812,\n mapX: 9,\n mapY: 19,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139603796,\n doors: [\n {\n _door: 0,\n address: 139603796,\n destination: 139603500,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139603812,\n complement: 139603468,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139607444,\n xPos: 176,\n yPos: 184,\n type: 4,\n subtype: 2,\n varA: 108,\n varB: 6,\n flag: 0x523d99,\n },\n ],\n },\n {\n _area: 11,\n _room: 29,\n address: 139603948,\n mapX: 137,\n mapY: 20,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139603932,\n doors: [\n {\n _door: 0,\n address: 139603932,\n destination: 139604316,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 1024,\n direction: DIR.RIGHT,\n sourceRoom: 139603948,\n complement: 139604268,\n },\n ],\n items: [\n {\n _item: 0,\n address: 139607480,\n xPos: 24,\n yPos: 120,\n type: 4,\n subtype: 2,\n varA: 119,\n varB: 7,\n flag: 0x523dbd,\n },\n ],\n },\n {\n _area: 11,\n _room: 30,\n address: 139604068,\n mapX: 9,\n mapY: 22,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139604052,\n doors: [\n {\n _door: 0,\n address: 139604052,\n destination: 139604492,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139604068,\n complement: 139604460,\n },\n ],\n items: [],\n isSaveRoom: true,\n },\n {\n _area: 11,\n _room: 31,\n address: 139604316,\n mapX: 138,\n mapY: 18,\n mapWidth: 1,\n mapHeight: 7,\n doorList: 139604220,\n doors: [\n {\n _door: 0,\n address: 139604220,\n destination: 139601380,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 1040,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139604316,\n complement: 139601364,\n },\n {\n _door: 1,\n address: 139604236,\n destination: 139604620,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139604316,\n complement: 139604604,\n },\n {\n _door: 2,\n address: 139604252,\n destination: 139604748,\n xPos: 1,\n yPos: 3,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139604316,\n complement: 139604732,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.SMALL],\n },\n {\n door: 1,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 3,\n address: 139604268,\n destination: 139603948,\n xPos: 255,\n yPos: 4,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139604316,\n complement: 139603932,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n {\n _door: 4,\n address: 139604284,\n destination: 139604876,\n xPos: 1,\n yPos: 6,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139604316,\n complement: 139604860,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n {\n door: 3,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n {\n _door: 5,\n address: 139604300,\n destination: 139604492,\n xPos: 0,\n yPos: 7,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139604316,\n complement: 139604444,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n {\n door: 1,\n locks: [Locks.MALPHAS],\n },\n {\n door: 2,\n locks: [Locks.MALPHAS],\n },\n {\n door: 3,\n locks: [Locks.SMALL],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 32,\n address: 139604492,\n mapX: 10,\n mapY: 22,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139604444,\n doors: [\n {\n _door: 0,\n address: 139604444,\n destination: 139604316,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 1536,\n direction: DIR.UP,\n sourceRoom: 139604492,\n complement: 139604300,\n },\n {\n _door: 1,\n address: 139604460,\n destination: 139604068,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139604492,\n complement: 139604052,\n },\n {\n _door: 2,\n address: 139604476,\n destination: 139605460,\n xPos: 1,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.RIGHT,\n sourceRoom: 139604492,\n complement: 139605444,\n },\n {\n _door: 3,\n address: -2,\n destination: 139557744,\n xPos: 0,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: 5,\n sourceRoom: 139604492,\n complement: -1,\n isFakeDoor: true,\n },\n ],\n items: [],\n isFloatingGardenConnector: true,\n },\n {\n _area: 11,\n _room: 33,\n address: 139604620,\n mapX: 139,\n mapY: 18,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139604604,\n doors: [\n {\n _door: 0,\n address: 139604604,\n destination: 139604316,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139604620,\n complement: 139604236,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 34,\n address: 139604748,\n mapX: 11,\n mapY: 20,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139604732,\n doors: [\n {\n _door: 0,\n address: 139604732,\n destination: 139604316,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 768,\n direction: DIR.LEFT,\n sourceRoom: 139604748,\n complement: 139604252,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 35,\n address: 139604876,\n mapX: 139,\n mapY: 21,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139604860,\n doors: [\n {\n _door: 0,\n address: 139604860,\n destination: 139604316,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 1536,\n direction: DIR.LEFT,\n sourceRoom: 139604876,\n complement: 139604284,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 36,\n address: 139605028,\n mapX: 130,\n mapY: 19,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139604996,\n doors: [\n {\n _door: 0,\n address: 139604996,\n destination: 139602796,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139605028,\n complement: 139602780,\n },\n {\n _door: 1,\n address: 139605012,\n destination: 139600324,\n xPos: 0,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.DOWN,\n sourceRoom: 139605028,\n complement: 139600276,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 37,\n address: 139605180,\n mapX: 136,\n mapY: 21,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139605148,\n doors: [\n {\n _door: 0,\n address: 139605148,\n destination: 139603668,\n xPos: 0,\n yPos: 255,\n destXOffset: 0,\n destYOffset: 48,\n destXPos: 0,\n destYPos: 512,\n direction: DIR.UP,\n sourceRoom: 139605180,\n complement: 139603652,\n },\n {\n _door: 1,\n address: 139605164,\n destination: 139600924,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 1040,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139605180,\n complement: 139600908,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 38,\n address: 139605332,\n mapX: 137,\n mapY: 19,\n mapWidth: 1,\n mapHeight: 2,\n doorList: 139605300,\n doors: [\n {\n _door: 0,\n address: 139605300,\n destination: 139603500,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 256,\n direction: DIR.LEFT,\n sourceRoom: 139605332,\n complement: 139603484,\n },\n {\n _door: 1,\n address: 139605316,\n destination: 139603668,\n xPos: 255,\n yPos: 1,\n destXOffset: 0,\n destYOffset: 0,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139605332,\n complement: 139603620,\n access: {\n doors: [\n {\n door: 0,\n locks: [Locks.MALPHAS],\n },\n ],\n },\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 39,\n address: 139605460,\n mapX: 11,\n mapY: 22,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139605444,\n doors: [\n {\n _door: 0,\n address: 139605444,\n destination: 139604492,\n xPos: 255,\n yPos: 0,\n destXOffset: 0,\n destYOffset: 65488,\n destXPos: 0,\n destYPos: 0,\n direction: DIR.LEFT,\n sourceRoom: 139605460,\n complement: 139604476,\n },\n ],\n items: [],\n },\n {\n _area: 11,\n _room: 40,\n address: 139605548,\n mapX: 140,\n mapY: 18,\n mapWidth: 1,\n mapHeight: 1,\n doorList: 139605548,\n doors: [],\n items: [],\n isCreditsRoom: true,\n isWeirdChaoticRealmRoomDoNotModify: true,\n },\n ],\n },\n ];\n}", "testBounds(xM,yM,wid,heg,x,y){\n // test conditions for when xM and yM is inside boundary\n if(xM > x && xM < x+wid && yM > y && yM < y+heg){\n return true;\n }\n else{\n return false;\n }\n }", "get localBounds() {}", "function callback(response) \n {\n \n // get boundaries\n console.log( response.results[0] );\n console.log( \"got \" + response.results[0].attributes.CTYUA13NM);\n //console.log( response.results[0].attributes.CTYUA13NM );\n /// console.log( response.results[0].attributes.CTYUA13NM+\": \" + parseInt( response.results[0].attributes[\"Shape.STArea()\"],10)/1000000 );\n //capture area\n areaMeasures[response.results[0].attributes.CTYUA13NM] = parseInt(response.results[0].attributes[\"Shape.STArea()\"],10)/1000000;\n\n areaObj[response.results[0].attributes.CTYUA13NM].area = parseInt(response.results[0].attributes[\"Shape.STArea()\"],10)/1000000;\n\n\n if (response.results.length > 0) \n {\n // document.getElementById(\"foundward\").value = response.results[0].attributes.WD11NM;\n\n var ens = new Array();\n //alert(response.results[0].geometry.rings.length);\n for (var k = 0; k < response.results[0].geometry.rings.length; k++) {\n ens[k] = response.results[0].geometry.rings[k];\n }\n\n // approximate datum correction, good enough for this demo\n \n var latmeters = 50;\n var lonmeters = -100;\n\n var minlat = 360.0;\n var maxlat = -360.0;\n var minlon = 360.0;\n var maxlon = -360.0;\n\n // create array of points converted to lat/lon (from easting/northing) and capture mins and maxes\n for (var j = 0; j < ens.length; j++) {\n //alert('j = ' + j);\n latlons[j] = new Array();\n for (var i = 0; i < ens[j].length; i++) {\n var testpoint = ens[j][i];\n var grid = new OsGridRef(testpoint[0] + lonmeters, testpoint[1] + latmeters);\n var latlon = OsGridRef.osGridToLatLong(grid);\n if (latlon.lon < minlon) {\n minlon = latlon.lon;\n }\n if (latlon.lon > maxlon) {\n maxlon = latlon.lon;\n }\n if (latlon.lat < minlat) {\n minlat = latlon.lat;\n }\n if (latlon.lat > maxlat) {\n maxlat = latlon.lat;\n }\n latlons[j][i] = latlon;\n }\n }\n\n // calculate zoom level\n var zoomLevel = getZoom(minlon, maxlon, minlat, maxlat, 512, 512);\n\n // calculate centroid\n var centroid = getCentroid(minlon, maxlon, minlat, maxlat);\n //initialize(centroid.lat, centroid.lon, zoomLevel, latlons);\n drawArea(latlons, response.results[0].value);\n } else {\n alert(\"No matching ward found\");\n }\n }", "function checkCanyons(t_canyons)\n{\n if(gameChar_world_x>=t_canyons.x_pos && (gameChar_y>=floorPos_y)&&(gameChar_world_x<=t_canyons.x_pos+t_canyons.size))\n {\n isPlummeting=true;\n gameChar_y+=10\n \n }\n else\n {\n isPlummeting=false\n }\n}", "function C012_AfterClass_Bed_Climax() {\n\tCurrentTime = CurrentTime + 50000;\n\tC012_AfterClass_Bed_PleasureUp = 0;\n\tC012_AfterClass_Bed_PleasureDown = 0;\n\tif (PlayerHasLockedInventory(\"VibratingEgg\")) C012_AfterClass_Bed_NextPossibleOrgasmTime = CurrentTime + 1800000;\n\telse C012_AfterClass_Bed_NextPossibleOrgasmTime = CurrentTime + 3600000;\n}", "function narrowBounds() {\n bounds = new google.maps.LatLngBounds();\n var test = false;\n eventArray.forEach(function(element){\n day[current][element].locations.forEach(function(pin){\n bounds.extend(pin.marker.position);\n test = true;\n }) \n })\n if (!test) {\n initialize_gmaps();\n }\n else map.fitBounds(bounds)\n}", "function avoidAreasError(errorous) {\n\t\t\tui.showAvoidAreasError(errorous);\n\t\t}", "function bucketLane() {\r\n\t\r\n\tvar bucketArray = document.querySelectorAll(\".bucket\");\r\n\t\r\n\tif (bucketArray[0].location == 1)\r\n\t\treturn 15;\r\n\tif (bucketArray[1].location == 1)\r\n\t\treturn 45;\r\n\tif (bucketArray[2].location == 1)\r\n\t\treturn 30;\r\n\t\r\n}", "function getBoundaries(areaNameOrCode) {\n callOpenGeog(opengep1 + areaNameOrCode + opengep2);\n }", "function test_candu_verify_global_utilization_metrics() {}", "function checkAmericanGrid(){\n\tvar americanMeteorites = getAmericanMeteorites();\n\tvar gridSections= [];\n\t//grid sections are stored from bottom left to top right, row by row\n\t//like so, ([0,0],[0,1],[1,0],[1,1])\n\tfor(var y = 0;y < USAVerticalScale;y++){\n\t\tfor(var x = 0;x < USAHorizonScale;x++){\n\t\t\t\n\n\t\t\t//var latg1 = USALowerLat + (y + 0.5) * ((USAUpperLat - USALowerLat) / USAVerticalScale);\n\t\t\t//var long1 = USALowerLong + (x + 0.5) * ((USAUpperLong - USALowerLong) / USAHorizonScale);\n\t\t\t//\tgetEntriesInRegion(latg1,long1,USAGridRadius, americanMeteorites);\n\n\n\t\t\t//new mutual exclusion version\n\t\t\tvar horizonInterval = (USAUpperLong - USALowerLong) / USAHorizonScale;\n\t\t\tvar verticalInterval = (USAUpperLat - USALowerLat) / USAVerticalScale;\n\t\t\tvar lata1 = USALowerLat + y * verticalInterval;\n\t\t\tvar longa1 = USALowerLong + x * horizonInterval;\n\t\t\tfilterCoordinates.minLat = lata1;\n\t\t\tfilterCoordinates.maxLat = lata1 + verticalInterval;\n\t\t\tfilterCoordinates.minLong = longa1;\n\t\t\tfilterCoordinates.maxLong = longa1 + horizonInterval;\n\t\t\tsubCollection = []; // clear the old list\n\t\t\tfor(var c = 0;c < americanMeteorites.length;c++){\n\t\t\t\tif(filterCoordinates.run(americanMeteorites[c])){\n\t\t\t\t\tsubCollection.push(americanMeteorites[c]);\n\t\t\t\t}\n\t\t\t}\n\n\n\n\n\t\t\tgridSections.push(subCollection);\n\t\t\t\n\n\t\t}\n\t}\n\treturn gridSections;\n}", "function snapCritical() {\r\n function fuzzyEquals(a, b) { return (Math.abs(a - b) < 1e-3); }\r\n\r\n if (fuzzyEquals(start, 0)) start = 0.0;\r\n if (fuzzyEquals(end, 0)) end = 0.0;\r\n if (fuzzyEquals(start, TAU)) start = TAU;\r\n if (fuzzyEquals(end, TAU)) end = TAU;\r\n }", "function isWithinAllowedRange()\n {\n var r=$q.defer();\n navigator.geolocation.getCurrentPosition(function(position){\n var distanceMeters = 1000 * getDistanceFromLatLonInKm(position.coords.latitude, position.coords.longitude, 45.474127399999996, -73.6011402);\n //var distanceMeters=1000*getDistanceFromLatLonInKm(position.coords.latitude, position.coords.longitude,45.5072138,-73.5784825);\n //var distanceMeters = 100;\n /*alert('Distance: '+ distanceMeters+\n 'Latitude: ' + position.coords.latitude + '\\n' +\n 'Longitude: ' + position.coords.longitude + '\\n' +\n 'Altitude: ' + position.coords.altitude + '\\n' +\n 'Accuracy: ' + position.coords.accuracy + '\\n' +\n 'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\\n' +\n 'Heading: ' + position.coords.heading + '\\n' +\n 'Speed: ' + position.coords.speed + '\\n' +\n 'Timestamp: ' + position.timestamp + '\\n');*/\n\n if (distanceMeters <= 300) {\n positionCheckinAppointment = {\n 'Latitude':position.coords.latitude,\n 'Longitude':position.coords.longitude,\n 'Accuracy':position.coords.accuracy\n };\n r.resolve('Check-in to your Appointment');\n } else {\n r.reject('Checkin allowed in the vecinity of the Cancer Center');\n }\n\n }, function(error){\n console.log(error.code);\n r.reject('Could not obtain location');\n });\n return r.promise;\n }", "isExoplanetOutsideExclusionZones(primary) {\n var primary_angle = App.arithmetics.angleBetweenMercatorVectors(primary, [0, 0]),\n earth_exclusion = App.targeting.settings.earth_exclusion_deg,\n sun_exclusion = 180 - App.targeting.settings.sun_exclusion_deg;\n\n return primary_angle > earth_exclusion && primary_angle < sun_exclusion;\n }", "function checkBounds() {\n // Perform the check and return if OK\n if (allowedBounds.contains(map.getCenter())) {\n return;\n }\n // It`s not OK, so find the nearest allowed point and move there\n var C = map.getCenter();\n var X = C.lng();\n var Y = C.lat();\n\n var AmaxX = allowedBounds.getNorthEast().lng();\n var AmaxY = allowedBounds.getNorthEast().lat();\n var AminX = allowedBounds.getSouthWest().lng();\n var AminY = allowedBounds.getSouthWest().lat();\n\n if (X < AminX) {X = AminX;}\n if (X > AmaxX) {X = AmaxX;}\n if (Y < AminY) {Y = AminY;}\n if (Y > AmaxY) {Y = AmaxY;}\n //alert (\"Restricting \"+Y+\" \"+X);\n map.setCenter(new GLatLng(Y,X));\n }", "get boundsValue() {}", "carregaBoundaries() {\n\n //Modifica o tamanho do estagio baseado no tamanho do elemento div do bird\n this.maxBoundsWidth = this.getEstagio().clientWidth - this.getBird().getTamanhoWidth();\n this.maxBoundsHeight = this.getEstagio().clientHeight - this.getBird().getTamanhoHeight();\n\n // console.log(\"Max width da arena: \" + this.maxBoundsWidth);\n // console.log(\"Max height da arena: \" + this.maxBoundsHeight);\n\n //Verifico se o passaro esta dentro as boundaries(caso o usuario de resize)\n this.estaForaDasBounds()\n }", "function ga(t,e,n){var i=t.getResolution(n),r=_a(t,e[0],e[1],i,!1),o=va(r,2),a=o[0],s=o[1],u=_a(t,e[2],e[3],i,!0),l=va(u,2),c=l[0],d=l[1];return{minX:a,minY:s,maxX:c,maxY:d}}", "check_hv_range(space) {\r\n const xd = Math.abs(this.x - space.x);\r\n const yd = Math.abs(this.y - space.y);\r\n\r\n if(xd <= this.straight || yd <= this.stright) {\r\n return true;\r\n } else {\r\n return false;\r\n };\r\n }", "getBounds() {}", "boundaries() {\n if (this.x - this.w/2 < -this.exceedLimit) this.x = this.w/2 - this.exceedLimit;\n if (this.x + this.w/2 > world.width+this.exceedLimit) this.x = world.width+this.exceedLimit - this.w/2;\n if (this.y - this.h/2 < -this.exceedLimit) this.y = this.h/2 - this.exceedLimit;\n if (this.y + this.h/2 > world.height+this.exceedLimit) this.y = world.height+this.exceedLimit - this.h/2;\n }", "function checkBounds() {\n\t\t\t// Perform the check and return if OK\n\t\t\tif (allowedBounds.contains(map.getCenter())) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// It`s not OK, so find the nearest allowed point and move there\n\t\t\tvar C = map.getCenter();\n\t\t\tvar X = C.lng();\n\t\t\tvar Y = C.lat();\n\n\t\t\tvar AmaxX = allowedBounds.getNorthEast().lng();\n\t\t\tvar AmaxY = allowedBounds.getNorthEast().lat();\n\t\t\tvar AminX = allowedBounds.getSouthWest().lng();\n\t\t\tvar AminY = allowedBounds.getSouthWest().lat();\n\n\t\t\tif (X < AminX) {X = AminX;}\n\t\t\tif (X > AmaxX) {X = AmaxX;}\n\t\t\tif (Y < AminY) {Y = AminY;}\n\t\t\tif (Y > AmaxY) {Y = AmaxY;}\n\t\t\t//alert (\"Restricting \"+Y+\" \"+X);\n\t\t\tmap.setCenter(new GLatLng(Y,X));\n\t\t}", "getRegionsInView()\n {\n var bottomLeftPos = this.screenToWorldPos(0, window.innerHeight);\n var bottomLeftRegion = WORLD.getRegionPositionFromWorldPosition(bottomLeftPos.x, bottomLeftPos.y);\n\n var xRegionMax = Math.floor(((bottomLeftRegion.x + window.innerWidth) / REGION_WIDTH) / this.zoom.x) + 2;\n var yRegionMax = Math.floor(((bottomLeftRegion.y + window.innerHeight) / REGION_HEIGHT) / this.zoom.y) + 2;\n\n var regionPosList = [];\n for(var x = bottomLeftRegion.x; x < bottomLeftRegion.x + xRegionMax; x++)\n {\n for(var y = bottomLeftRegion.y; y < bottomLeftRegion.y + yRegionMax; y++)\n {\n regionPosList.push({x:x, y:y});\n }\n }\n //console.log(count);\n return regionPosList;\n }", "function checkObjectives() {\n // A Humble Beginning (1565 - 1650)\n if (((population.colonist.number * population.colonist.rate) + ((population.slave.number / population.slave.increment) * population.slave.rate) >= 10) && (population.merchant.rate2 >= 5)) {\n timePeriod[0].tracker[0] = 0;\n }\n if (population.number >= 50000) {\n timePeriod[0].tracker[2] = 0;\n }\n \n // War Is Too Expensive (1763 - 1775)\n if (population.minutemen.number >= 100) {\n timePeriod[2].tracker[3] = 0;\n }\n if (currency.colonialNotes.amount >= 2000000) {\n timePeriod[2].tracker[4] = 0;\n }\n}", "enterA84(ctx) {\n\t}", "function placeArmies() {\n \t// console.log(\"placeArmies\");\n // the army counterpressure threshold\n var threshold = 4;\n // extract personality\n var placem = this.personality['placement'];\n\n // the pressures and priority list copied for use\n var press = this.player.pressures;\n var prio = this.priorityList;\n var attOrg = this.attOrgMap;\n\n // deplete armyreserve\n var stock = this.player.armyreserve;\n // console.log(\"army reserve\", stock, prio);\n // console.log(\"countries owned\", this.player.countries);\n // console.log(\"attackable\", this.player.attackable);\n this.player.armyreserve = 0;\n\n if (placem == 'cautious') {\n // balance all pri pressure >0 first,\n distribute(0);\n // then topup priority by half threshold\n while (stock > 0) {\n distribute(threshold / 2);\n };\n }\n // priority pressure >4 +=4 repeatedly\n else if (placem == 'tactical') {\n while (stock > 0) {\n distribute(threshold);\n };\n }\n // helper: distribute 'num' army by priorityList\n function distribute(t) {\n var t = Math.floor(t);\n _.each(prio, function(i) {\n // army needed\n var need = _.max([t + Math.ceil(-press[i]), t]);\n // affordable, either need or stock left\n var afford = _.min([need, stock]);\n // take out, give army to node\n stock -= afford;\n // add army to your attack origin of i\n var org = attOrg[i];\n g.nodes[org].army += afford;\n });\n };\n\n }", "constructor() {\n /**\n * These are the bounds for the service areas so we can try to obtain more precise geocoding on addresses\n */\n this.AREAS = [ /* eslint no-multi-spaces: off */\n {id: 'TEST', bounds: {sw: {lat: 59.65330271, lng: -151.8705092}, ne: {lat: 61.25310536, lng: -149.8731469}}},\n {id: 'APFSA', bounds: {sw: {lat: 59.70365140, lng: -151.8705092}, ne: {lat: 59.95370723, lng: -151.5705850}}},\n {id: 'CES', bounds: {sw: {lat: 60.21213251, lng: -151.4253571}, ne: {lat: 60.81998024, lng: -149.8731469}}},\n {id: 'KESA', bounds: {sw: {lat: 59.65330271, lng: -151.7881408}, ne: {lat: 59.93944592, lng: -150.8635843}}},\n {id: 'KFD', bounds: {sw: {lat: 60.51649993, lng: -151.3357507}, ne: {lat: 60.60361148, lng: -151.0731701}}},\n {id: 'NFSA', bounds: {sw: {lat: 60.58171538, lng: -151.4264242}, ne: {lat: 61.25310536, lng: -150.0042887}}},\n ];\n }", "function test2() {\n world.fillArea([2, 2, 3], [5, 5, 5], FILL_ADD);\n world.fillArea([3, 3, 6], [4, 4, 6], FILL_ADD);\n world.fillArea([2, 3, 3], [5, 4, 4], FILL_REMOVE);\n world.fillArea([3, 2, 3], [4, 5, 4], FILL_REMOVE);\n world.fillArea([2, 2, 4], [5, 5, 6], FILL_TOGGLE);\n }", "function getVesselInCamArea() {\n var bounds = new google.maps.LatLngBounds(passat_sw, passat_ne);\n var vesselInBounds = 'undefined';\n\n $.each(markersArray, function (index, marker) {\n if (bounds.contains(marker.getPosition()) && marker.vessel.status == 'MOVING') {\n vesselInBounds = marker;\n // break for jquery each\n return false;\n }\n });\n\n if (vesselInBounds && vesselInBounds != 'undefined') {\n return vesselInBounds;\n } else {\n return null;\n }\n}", "function checkCanyon(t_canyon)\n{\n\n if (gameChar_world_x > t_canyon.x_pos + 60 && gameChar_world_x < t_canyon.x_pos + 40 + t_canyon.width && gameChar_y >= floorPos_y)\n {\n isPlummeting = true;\n gameChar_y += 15;\n }\n \n}", "function coveringStains(k, coordinates) {\n /*\n * Write your code here.\n */\n var p = {amount:0,indexes:[]};\n const initialArea = area(coordinates);\n for (var i = 0;i<coordinates.length;++i){\n reqCoveringStains(coordinates,p,i,k,0,initialArea)\n }\n \n return p.amount;\n}", "function checkCanyon(t_canyon)\n{ \n if (\n (in_range(gameChar_world_x, t_canyon.x_pos, (t_canyon.x_pos+t_canyon.width))) &&\n (gameChar_y >= floorPos_y)\n )\n {\n isPlummeting = true;\n }\n}", "function isFullAGe(el) {\n return el >= 18;\n}", "function checkOrgChartZone() {\n var _this = this;\n\n $('.org-char-cont .ms-hide').each(function () {\n if ($(_this).parents().eq(4).hasClass('org-char-cont') || $(_this).parents().eq(5).hasClass('org-char-cont')) {\n $(_this).parent().hide();\n }\n });\n\n if ($('.org-char-cont').children().children().children().children().length === 0 || $('.org-char-cont').children().children().children().children().children().length === $('.org-char-cont .ms-hide').length) {\n $('.org-char-cont').hide();\n }\n\n $('.org-char-cont .iconPDF').parents().eq(4).css({\n background: 'none',\n padding: 0\n });\n\n $('.org-char-cont .iconPPT').parents().eq(4).css({\n background: 'none',\n padding: 0\n });\n\n $('.org-char-cont .iconPPT, .org-char-cont .iconPDF').parent().parent().css({\n marginTop: '-10px'\n });\n }", "function maps(name,x,y){\n if(name===\"classic\"){\n return (x<17 && y>10) || (x>5 && y<3)\n }\n else if(name===\"empty\"){\n return (false)\n }\n else if (name===\"eight\"){\n return (\n (x>18 && y>12 && x<24 && y<18) ||\n (x>18 && y>4 && x<24 && y<10) ||\n (x>26 && y>4 && x<32 && y<10) ||\n (x>26 && y>12 && x<32 && y<18)) ||\n (x>11 && y>4 && x<16 && y<18) ||\n (x>34 && y>4 && x<39 && y<18) ||\n (x>11 && y>=0 && x<39 && y<3) ||\n (x>11 && y>19 && x<39)\n }\n else if (name===\"hulk\"){\n return (\n (!(51>x && x>2 && 3>y && y>0)) &&\n (!(51>x && x>2 && 22>y && y>19)) &&\n (!(53>x && x>50 && 22>y && y>0)) &&\n (!(3>x && x>0 && 22>y && y>0)) &&\n (!(3>x && x>0 && 22>y && y>0))\n )\n }\n else if (name===\"columns\"){\n return (\n (x%2 && y%2)\n )\n }\n}", "function A_(areaDescrs, forceEvaluation) {\n if (areaDescrs === undefined) {\n gDebugObjMgr.drawFrame(false);\n return [];\n }\n\n if (forceEvaluation === undefined) {\n forceEvaluation = globalTaskQueue.pendingTasks.isEmpty();\n if (!forceEvaluation) {\n console.warn(\"not forcing evaluation of inactive expressions\");\n }\n }\n\n resetDebugObjCache();\n gDebugObjMgr.init();\n\n if (gDebugObjMgr.constraints.violationMessageList.length > 0) {\n console.groupCollapsed('%c%d constraint violations',\n 'font-weight: 500;',\n gDebugObjMgr.constraints.violationMessageList.length);\n for (var i = 0; i < gDebugObjMgr.constraints.violationMessageList.length; i++) {\n console.log(gDebugObjMgr.constraints.violationMessageList[i]);\n }\n console.groupEnd();\n }\n\n function getAndHighlightArea(areaId, highlight) {\n\n if (areaId === \"p1\") {\n var pDescr = shallowCopy(gDomEvent.pointerObj);\n pDescr.constraints = gDebugObjMgr.constraints.getConstraintOfArea(\"p1\");\n return pDescr;\n }\n\n var area = allAreaMonitor.getAreaById(areaId);\n if (!area) {\n if (areaId) {\n mMessage(\"no such area: '\" + areaId + \"'\");\n }\n return undefined;\n }\n\n var debugObjArea = gDebugObjMgr.getArea(areaId, forceEvaluation);\n if (highlight) {\n var itsPos = debugObjAbsAreaPosition(area);\n gDebugObjMgr.drawFrame(true, areaId, debugObjArea.classes, itsPos);\n }\n return debugObjArea;\n }\n\n var cdlInterpreted = false;\n\n if (!(areaDescrs instanceof Array)) {\n areaDescrs = [areaDescrs];\n }\n else if (!areaDescrs.every(function(d) {\n return typeof(d) === \"string\" || typeof(d) === \"number\";\n })) {\n areaDescrs = ensureOS(I(areaDescrs));\n cdlInterpreted = true;\n }\n var res = [];\n for (var i = 0; i < areaDescrs.length; i++) {\n var areaDescr = areaDescrs[i];\n switch (typeof(areaDescr)) {\n case \"string\":\n var areaId = undefined;\n if (areaDescr.match(/^@[0-9]+:[0-9]+$/)) {\n res.push(getAndHighlightArea(areaDescr.slice(1), false));\n } else if (!cdlInterpreted && areaDescr.match(/^[0-9]+:[0-9]+$/)) {\n res.push(getAndHighlightArea(areaDescr, true));\n } else if (areaDescr === \"p1\") {\n res.push(getAndHighlightArea(areaDescr, true));\n }\n break;\n }\n }\n return res.length === 0? undefined: res.length === 1? res[0]: res;\n}", "calcRegionSizeGlobal() {\n // this should only get done once\n // scanCol is the column that has the data we care about putting in the color fill\n // this returns a summary object that knows things about the size of the brain json dimensions and also the min and max of hte scan data\n //!! should only do this part once\n let globals = [1000, 1000, -1000, -1000]\n for (let sliceName in this.paneOb.regionBoundaryData) {\n let slice = this.paneOb.regionBoundaryData[sliceName]\n // skip if there's a single point feature\n for (let feature of slice.features) {\n // likely nota loop because coordinates is a single element array\n for (let line of feature.geometry.coordinates) {\n for (let pt of line) {\n if (pt[0] < globals[0]) {\n globals[0] = pt[0]\n }\n if (pt[1] < globals[1]) {\n globals[1] = pt[1]\n }\n if (pt[0] > globals[2]) {\n globals[2] = pt[0]\n }\n if (pt[1] > globals[3]) {\n globals[3] = pt[1]\n }\n }\n }\n }\n\n\n\n }\n /** This is a list of smallest and largest values found in the x,y dimensions within the geojson data provided. This is used to scale the region coordinates to the space of the canvas */\n this.regionSizes = globals\n /** This is a ratio of the heightvs the width of the brain data. Helpful for determining what the maximum value of our y interpolator should be. */\n this.canvasRatio = globals[3] / globals[2]\n }", "function enterArea(location){\n area(location, \"encounter\");\n}", "computeAABB(){\n// console.log(this.minXYZ);\n// console.log(this.maxXYZ);\n return [this.minXYZ,this.maxXYZ];\n }", "function inBounds(x, y){\r\n\t\t\t\tvar bounds = courseSlot.courseBox.getBoundingClientRect();\r\n\t\t\t\tif (x > bounds.left && x < bounds.right && y > bounds.top && y < bounds.bottom)\r\n\t\t\t\t\treturn true;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn false;\r\n\t\t\t}", "function camAreaEvent(label, code)\n{\n\tvar eventName = \"eventArea\" + label;\n\tcamMarkTiles(label);\n\t__camPreHookEvent(eventName, function(droid)\n\t{\n\t\tif (camDef(droid))\n\t\t{\n\t\t\tcamTrace(\"Player\", droid.player, \"enters\", label);\n\t\t}\n\t\tcamUnmarkTiles(label);\n\t\tcode(droid);\n\t});\n}", "function isArea1(element) {\r\n\treturn element.xArea == \"1\";\r\n}", "_getRegionBoundary(bound) {\n // Contains the deprecated version of selector, for temporary backwards comparability.\n let markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], ` +\n `[cdkFocusRegion${bound}], ` +\n `[cdk-focus-${bound}]`);\n for (let i = 0; i < markers.length; i++) {\n // @breaking-change 8.0.0\n if (markers[i].hasAttribute(`cdk-focus-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}', ` +\n `use 'cdkFocusRegion${bound}' instead. The deprecated ` +\n `attribute will be removed in 8.0.0.`, markers[i]);\n }\n else if (markers[i].hasAttribute(`cdk-focus-region-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}', ` +\n `use 'cdkFocusRegion${bound}' instead. The deprecated attribute ` +\n `will be removed in 8.0.0.`, markers[i]);\n }\n }\n if (bound == 'start') {\n return markers.length ? markers[0] : this._getFirstTabbableElement(this._element);\n }\n return markers.length ?\n markers[markers.length - 1] : this._getLastTabbableElement(this._element);\n }", "_getRegionBoundary(bound) {\n // Contains the deprecated version of selector, for temporary backwards comparability.\n let markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], ` +\n `[cdkFocusRegion${bound}], ` +\n `[cdk-focus-${bound}]`);\n for (let i = 0; i < markers.length; i++) {\n // @breaking-change 8.0.0\n if (markers[i].hasAttribute(`cdk-focus-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}', ` +\n `use 'cdkFocusRegion${bound}' instead. The deprecated ` +\n `attribute will be removed in 8.0.0.`, markers[i]);\n }\n else if (markers[i].hasAttribute(`cdk-focus-region-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}', ` +\n `use 'cdkFocusRegion${bound}' instead. The deprecated attribute ` +\n `will be removed in 8.0.0.`, markers[i]);\n }\n }\n if (bound == 'start') {\n return markers.length ? markers[0] : this._getFirstTabbableElement(this._element);\n }\n return markers.length ?\n markers[markers.length - 1] : this._getLastTabbableElement(this._element);\n }", "_getRegionBoundary(bound) {\n // Contains the deprecated version of selector, for temporary backwards comparability.\n let markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], ` +\n `[cdkFocusRegion${bound}], ` +\n `[cdk-focus-${bound}]`);\n for (let i = 0; i < markers.length; i++) {\n // @breaking-change 8.0.0\n if (markers[i].hasAttribute(`cdk-focus-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}', ` +\n `use 'cdkFocusRegion${bound}' instead. The deprecated ` +\n `attribute will be removed in 8.0.0.`, markers[i]);\n }\n else if (markers[i].hasAttribute(`cdk-focus-region-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}', ` +\n `use 'cdkFocusRegion${bound}' instead. The deprecated attribute ` +\n `will be removed in 8.0.0.`, markers[i]);\n }\n }\n if (bound == 'start') {\n return markers.length ? markers[0] : this._getFirstTabbableElement(this._element);\n }\n return markers.length ?\n markers[markers.length - 1] : this._getLastTabbableElement(this._element);\n }", "placesWithinArea(area) {\n let results = turf.collect(area, this.fbData,\n 'typeNum', 'placeTypes')\n return results\n }", "function defaultRegion(){\n\n var flag = $(\"[name='regionID']:first\");\n var area = flag.siblings(\".columns\").find(\"input:checked\").length;\n var test = $(\"[name='destinationCountryID']:checked\").length;\n\n\nif (test == 0){\n if (document.body.clientWidth < 980) {\n if ((flag.prop(\"checked\") == true) && (area == 0)){\n flag.prop(\"checked\", false);\n }\n } else {\n flag.prop(\"checked\", true);\n }\n}\n \n}", "getBounds() {\n throw \"Abstract method\" \n }", "function ccw(c) {\n\t var n = c.length\n\t var area = [0]\n\t for(var j=0; j<n; ++j) {\n\t var a = positions[c[j]]\n\t var b = positions[c[(j+1)%n]]\n\t var t00 = twoProduct(-a[0], a[1])\n\t var t01 = twoProduct(-a[0], b[1])\n\t var t10 = twoProduct( b[0], a[1])\n\t var t11 = twoProduct( b[0], b[1])\n\t area = robustSum(area, robustSum(robustSum(t00, t01), robustSum(t10, t11)))\n\t }\n\t return area[area.length-1] > 0\n\t }", "function ccw(c) {\n\t var n = c.length\n\t var area = [0]\n\t for(var j=0; j<n; ++j) {\n\t var a = positions[c[j]]\n\t var b = positions[c[(j+1)%n]]\n\t var t00 = twoProduct(-a[0], a[1])\n\t var t01 = twoProduct(-a[0], b[1])\n\t var t10 = twoProduct( b[0], a[1])\n\t var t11 = twoProduct( b[0], b[1])\n\t area = robustSum(area, robustSum(robustSum(t00, t01), robustSum(t10, t11)))\n\t }\n\t return area[area.length-1] > 0\n\t }", "function isCCW() {\n if (area2D(_model.points, _model.points.count) < 0) {\n return false;\n } else {\n return true;\n }\n}", "getRangeOfAlignedPlanes(transform, result) {\n const idMatrix = Matrix3d_1.Matrix3d.createIdentity();\n const bigRange = Range_1.Range3d.createXYZXYZ(-Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE, Number.MAX_VALUE);\n const range = bigRange.clone(result);\n for (const clipPlane of this._planes) {\n if (transform)\n clipPlane.transformInPlace(transform);\n // Array of 1-d ranges that will be pieced back together into a Range3d after making adjustments\n const rangePieces = [\n Range_1.Range1d.createXX(range.low.x, range.high.x),\n Range_1.Range1d.createXX(range.low.y, range.high.y),\n Range_1.Range1d.createXX(range.low.z, range.high.z)\n ];\n for (let i = 0; i < 3; i++) {\n // Set values of minP and maxP based on i (we are compensating for pointer arithmetic in native code)\n let minP;\n let maxP;\n minP = rangePieces[i].low;\n maxP = rangePieces[i].high;\n const direction = idMatrix.getColumn(i);\n if (clipPlane.inwardNormalRef.isParallelTo(direction, true)) {\n if (clipPlane.inwardNormalRef.dotProduct(direction) > 0.0) {\n if (clipPlane.distance > minP)\n rangePieces[i].low = clipPlane.distance;\n }\n else {\n if (-clipPlane.distance < maxP)\n rangePieces[i].high = -clipPlane.distance;\n }\n }\n }\n // Reassign to Range3d\n range.low.x = rangePieces[0].low;\n range.high.x = rangePieces[0].high;\n range.low.y = rangePieces[1].low;\n range.high.y = rangePieces[1].high;\n range.low.z = rangePieces[2].low;\n range.high.z = rangePieces[2].high;\n }\n if (range.isAlmostEqual(bigRange))\n return undefined;\n else\n return range;\n }", "static entityOnMapEdges(e, m){\n return (\n e.body.position.x < 0 ||\n e.body.position.y < 0 ||\n e.body.position.x + e.body.size.x > m.widthpx ||\n e.body.position.y + e.body.size.y > m.heightpx\n );\n }", "findGridLimits () {\n let residue = this.getResidueProxy()\n let atom = this.getAtomProxy()\n for (let iRes = 0; iRes < this.getResidueCount(); iRes += 1) {\n residue.iRes = iRes\n if (residue.ss === 'G') {\n atom.iAtom = residue.iAtom\n if (!(atom.elem in this.grid.isElem)) {\n this.grid.isElem[atom.elem] = true\n }\n if (this.grid.bMin === null) {\n this.grid.bMin = atom.bfactor\n this.grid.bMax = atom.bfactor\n } else {\n if (atom.bfactor > this.grid.bMax) {\n this.grid.bMax = atom.bfactor\n }\n if (atom.bfactor < this.grid.bMin) {\n this.grid.bMin = atom.bfactor\n }\n }\n }\n }\n\n if (this.grid.bMin === null) {\n this.grid.bMin = 0\n }\n if (this.grid.bMax === null) {\n this.grid.bMin = 0\n }\n this.grid.bCutoff = this.grid.bMin\n }", "inBounds() {\n if (this.pos.x <= -50 || this.pos.x > 690 || this.pos.y <= -50 || this.pos.y > 690) {\n this.active = false;\n }\n }", "function howPopulated(population, landArea) {}", "function ce(a){this.ga=a;this.Ja=null;this.se=new de(a,!0,!0);this.Re=new de(a,!1,!0);this.ge=L(\"rect\",{height:Q,width:Q,style:\"fill: #fff\"},null);ee(this.ge,a.Xd)}", "function evaluateOsteophyte(border){\n return area(border);\n}", "function getOuterBeamCoords(rect, angleCase) {\n // console.log('AngleCase: ' + angleCase );\n switch (angleCase) {\n\n case 1:\n // console.log('Returns 1');\n return [getCorner(rect, 3),\n getCorner(rect, 1),\n getCorner(rect, 2)];\n case 2:\n // console.log('Returns 2');\n return [getCorner(rect, 4),\n getCorner(rect, 2),\n getCorner(rect, 1)];\n case 3:\n // console.log('Returns 3');\n return [getCorner(rect, 4),\n getCorner(rect, 3),\n getCorner(rect, 1)];\n case 4:\n // console.log('Returns 4');\n return [getCorner(rect, 3),\n getCorner(rect, 4),\n getCorner(rect, 2)];\n case 5:\n // console.log('Returns 5');\n return [getCorner(rect, 3),\n getCorner(rect, 1),\n getCorner(rect, 2),\n getCorner(rect, 4)];\n case 6:\n // console.log('Returns 6');\n return [getCorner(rect, 1),\n getCorner(rect, 3),\n getCorner(rect, 4),\n getCorner(rect, 2)];\n case 7:\n // console.log('Returns 7');\n return [getCorner(rect, 3),\n getCorner(rect, 1),\n getCorner(rect, 2),\n getCorner(rect, 2)];\n case 8:\n // console.log('Returns 8');\n return [getCorner(rect, 2),\n getCorner(rect, 1),\n getCorner(rect, 3),\n getCorner(rect, 4)];\n case 9:\n // console.log('Returns 9');\n return [getCorner(rect, 1),\n getCorner(rect, 2),\n getCorner(rect, 4),\n getCorner(rect, 3)];\n case 10:\n // console.log('Returns 10');\n return [getCorner(rect, 4),\n getCorner(rect, 2),\n getCorner(rect, 1),\n getCorner(rect, 3)];\n default:\n console.log(\"Unknown AngleCase\");\n\n }\n\n}", "function checkEast()\n{\n\tvar hit : RaycastHit;\n\tvar destinationSquare : int;\n\tsquareCheck = transform.TransformDirection (Vector3(1,0,0));\n if (Physics.Raycast(transform.position, squareCheck, hit, 1))\n {\n // This means there was a hit.\n if(hit.collider.gameObject.tag == \"Inactive White Piece\" && color == 1)\n {\n \t// Piece can be captured\n \tdestinationSquare = (square + 1);\n\n \t// This is a sanity check.\n \tif(destinationSquare < 0 || destinationSquare > 63)\n \t{\n \tdestinationSquare = 64;\n \t}\n\n \t// Add the square to the array.\n \tlegalMoves.push(destinationSquare);\n }\n else if(hit.collider.gameObject.tag == \"Inactive Black Piece\" && color == 0)\n {\n \t// Piece can be captured\n \tdestinationSquare = (square + 1);\n \t// This is a sanity check.\n \tif(destinationSquare < 0 || destinationSquare > 63)\n \t{\n \tdestinationSquare = 64;\n \t}\n\n \t// Add the square to the array.\n \tlegalMoves.push(destinationSquare);\n }\n else\n {\n \t// This triggers when a square is blocked by a piece of the same color.\n }\t\n\n }\n else\n {\n \t// This means nothing was hit, add to array.\n destinationSquare = (square + 1);\n\n // This is a sanity check.\n if(destinationSquare < 0 || destinationSquare > 63)\n {\n destinationSquare = 64;\n }\n\n // Square was empty, so add the square to the array.\n legalMoves.push(destinationSquare);\n }\n}", "blocksTravelled(){\n let horizontal = Math.abs(eastWest.indexOf(this.beginningLocation.horizontal) - eastWest.indexOf(this.endingLocation.horizontal))\n let vertical = Math.abs(parseInt(this.beginningLocation.vertical)-parseInt(this.endingLocation.vertical))\n return (horizontal + vertical);\n }", "function gv(a,b){this.oq=[];this.W3=a;this.TY=b||null;this.Uz=this.lh=!1;this.Ng=void 0;this.TU=this.J$=this.kL=!1;this.ZJ=0;this.Fb=null;this.bE=0}", "function constrainMap(E)\n{\n\tvar VPbounds, URL;\n\n\twhile(!(VPbounds = map.getBounds()))\n\t\t; // Hmmm! Busy wait?\n\t\n\t// Register new zoom & centre values in Page URL\n\tzoom = map.getZoom();\n\tcentre = map.getCenter();\n\n\tURL = document.getElementById(\"Url\").innerHTML;\n\tURL = URL.replace(/centre=-*\\d+\\.\\d+,-*\\d+\\.\\d+/, \"centre=\" + centre.toUrlValue() );\n\tURL = URL.replace(/zoom=\\d+/, \"zoom=\" + zoom);\n\tdocument.getElementById(\"Url\").innerHTML = URL;\n\n\t// Check that overlay corners are within ViewPort\n var fid = document.getElementById(\"Day\").options.selectedIndex\n if( !VPbounds.intersects(forecasts[fid].bounds)){\n\t\tif(confirm(\"Map Outside ViewPort\\nReCentre?\")){\n\t\t\tmap.setCenter(forecasts[fid].centre);\n\t\t\tcentre = map.getCenter();\n\t\t}\n\t}\n}", "areaCheck(startingCell,targetCell,range){\n\t\tif(range <=0 || startingCell <0 || startingCell > boardWidth*boardHeight || targetCell < 0 || targetCell > boardWidth*boardHeight ){\n\t\t\treturn false;\n\t\t}\n\n\t\tfor(let x = -range; x<=range;x++){\n\t\t\tfor(let y = -range;y<=range;y++){\n\t\t\t\tlet tempCell = startingCell + (x*boardWidth) + y;\n\t\t\t\tlet modTempCell = tempCell%boardWidth;\n\t\t\t\tlet modStartingCell = startingCell%boardWidth;\n\t\t\t\tif(tempCell >=0 && tempCell <= boardWidth*boardHeight && Math.abs(modStartingCell-modTempCell) <= range ){\n\t\t\t\t\tif(tempCell === targetCell){\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function hazardousAreas(cellSize, moduleCount) {\n var output = [];\n // Finder patterns\n output.push(\"<g id='hazards'>\");\n output.push(\"<rect id='finder-top-left' x='0' y='0' width='\"+8*cellSize+\"' height='\"+8*cellSize+\"' class='hazard'></rect>\");\n output.push(\"<rect id='finder-top-right' x='\"+(cellSize*moduleCount-8*(cellSize))+\"' y='0' width='\"+8*cellSize+\"' height='\"+8*cellSize+\"' class='hazard'></rect>\");\n output.push(\"<rect id='finder-bottom-right' y='\"+(cellSize*moduleCount-8*(cellSize))+\"' x='0' width='\"+8*cellSize+\"' height='\"+8*cellSize+\"' class='hazard'></rect>\");\n output.push(\"</g>\");\n return output.join(\" \");\n}", "function get_bounds(){\n\t\t\t\t\n\t\t\t\treturn {\n\t\t\t\t\t\n\t\t\t\t\tsw_lat : map.getBounds().getSouthWest().lat(),\n\t\t\t\t\t\n\t\t\t\t\tsw_lng : map.getBounds().getSouthWest().lng(),\n\t\t\t\t\t\n\t\t\t\t\tne_lat : map.getBounds().getNorthEast().lat(),\n\t\t\t\t\t\n\t\t\t\t\tne_lng : map.getBounds().getNorthEast().lng()\n\t\t\t\t\n\t\t\t\t};\n\t\t\t\n\t\t\t}", "prepRangeData() {\n let slicesByView = {\n \"sagittal\": [],\n \"axial\": [],\n \"coronal\": []\n }\n for (let n in this.paneOb.regionBoundaryData) {\n if (n.search(/cor/) == 0) {\n slicesByView[\"coronal\"].push(n)\n }\n if (n.search(/sag/) == 0) {\n slicesByView[\"sagittal\"].push(n)\n }\n if (n.search(/ax/) == 0) {\n slicesByView[\"axial\"].push(n)\n }\n }\n let sortfunc = (x, y) => {\n let xmm = parseInt(x.match(/(-?\\d+\\.?\\d*?)(mm)?/)[1])\n let ymm = parseInt(y.match(/(-?\\d+\\.?\\d*?)(mm)?/)[1])\n return xmm - ymm\n }\n slicesByView.axial.sort(sortfunc)\n slicesByView.sagittal.sort(sortfunc)\n slicesByView.coronal.sort(sortfunc)\n /** An object who's keys are the brain views, and values are lists of the slice files that match the paneOb.regionBoundaryData object. Used to figure out which slice's region boundaries are to be drawn on the canvas at any time */\n this.sliderSlices = slicesByView\n // get the array of values\n /** A similar collection to the sliderSlices, but to populate the label next to the slice slider element so users can tell which slice (in mm) they are looking at */\n this.sliderMeasurements = {}\n this.sliderMeasurements.axial = slicesByView.axial.map(sl => {\n return (sl.match(/(-?\\d+\\.?\\d*?mm)/)[1])\n })\n this.sliderMeasurements.sagittal = slicesByView.sagittal.map(sl => {\n return (sl.match(/(-?\\d+\\.?\\d*?mm)/)[1])\n })\n this.sliderMeasurements.coronal = slicesByView.coronal.map(sl => {\n return (sl.match(/(-?\\d+\\.?\\d*?mm)/)[1])\n })\n }", "_getRegionBoundary(bound) {\n // Contains the deprecated version of selector, for temporary backwards comparability.\n const markers = this._element.querySelectorAll(`[cdk-focus-region-${bound}], ` + `[cdkFocusRegion${bound}], ` + `[cdk-focus-${bound}]`);\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n for (let i = 0; i < markers.length; i++) {\n // @breaking-change 8.0.0\n if (markers[i].hasAttribute(`cdk-focus-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-${bound}', ` + `use 'cdkFocusRegion${bound}' instead. The deprecated ` + `attribute will be removed in 8.0.0.`, markers[i]);\n } else if (markers[i].hasAttribute(`cdk-focus-region-${bound}`)) {\n console.warn(`Found use of deprecated attribute 'cdk-focus-region-${bound}', ` + `use 'cdkFocusRegion${bound}' instead. The deprecated attribute ` + `will be removed in 8.0.0.`, markers[i]);\n }\n }\n }\n\n if (bound == 'start') {\n return markers.length ? markers[0] : this._getFirstTabbableElement(this._element);\n }\n\n return markers.length ? markers[markers.length - 1] : this._getLastTabbableElement(this._element);\n }", "getArea() {\n\t\tconst from = {\n\t\t\tx: this.parcelMap['A'].lat,\n\t\t\ty: this.parcelMap['A'].lon,\n\t\t}\n\n\t\tconst to = {\n\t\t\tx: this.parcelMap['I'].lat + 1,\n\t\t\ty: this.parcelMap['I'].lon + 1,\n\t\t}\n\t\treturn [new Point(from.x, from.y), new Point(to.x, to.y)]\n\t}", "get area() {\n return __classPrivateFieldGet(this, _ancho) * this.alto;\n }", "function getColorByArea(area){\n\t\n if(area < 440018460.486){\n return '#d7191c';\n }\n else if (area< 739771562.215) {\n return '#fdae61';\n\n }else if(area < 1039524663.943) {\n return '#ffffbf';\n\n }else if(area < 1339277765.672) {\n return '#abdda4';\n \n }else {\n \treturn '#2ca25f';\n }\n\n}", "function decide() {\n\t\t\t\tvar recognise = false;\n\t\t\t\tif(fromAbove && fromBelow) {\n\t\t\t\t\tif(fromAbove == fromBelow) {\n\t\t\t\t\t\talert(\"Pattern recognized\");\n\t\t\t\t\t\t// window['Cortex'].grid[self.childAddress[i].x][self.childAddress[i].y][self.childAddress[i].z](fromBelow);\n\t\t\t\t\t} else {\n\t\t\t\t\t\talert(\"Pattern not recognized\");\n\t\t\t\t\t\t// window['Cortex'].grid[self.parentAddress.x][self.parentAddress.y][self.parentAddress.z](fromBelow);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "checkAdjacent(x,y,type,direction, mapData){\n \tlet freespace = 0;\n \tif(type == 4){\n \t\treturn true\n \t}\n \tif(direction){\n \t\tif((y + type) <= 9){ //place up\n \t\t\tfor(let i = -1;i<2;i++){\n \t\t\t\t// if(i == -1 || i == 1){\n \t\t\t\t\tfor(let k = -1;k <= type;k++){\n \t\t\t\t\t\tif((x+i > 0) && (x+i < 10) && mapData[x+i][y+k] != undefined){\n \t\t\t\t\t\t\tfreespace += mapData[x+i][y+k];\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t}else{\n \t\t\tfor(let i = -1;i<2;i++){ //place down\n \t\t\t\t// if(i == -1 || i == 1){\n \t\t\t\t\tfor(let k = -type;k <= 1;k++){\n \t\t\t\t\t\tif((x+i > 0) && (x+i < 10) &&mapData[x+i][y+k] != undefined){\n \t\t\t\t\t\t\tfreespace += mapData[x+i][y+k];\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t }\n \t\t}\n \t}else{\n \t\tif((x + type) <= 9){ //place right\n \t\t\tfor(let i = -1;i<2;i++){\n \t\t\t\t// if(i == -1 || i == 1){\n \t\t\t\t\tfor(let k = -1;k <= type;k++){\n \t\t\t\t\t\tif((x+k > 0) && (x+k < 10)&&mapData[x+k][y+i] != undefined){\n \t\t\t\t\t\t\tfreespace += mapData[x+k][y+i];\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t}\n \t\t}else{\n \t\t\tfor(let i = -1;i<2;i++){ //place left\n \t\t\t\t// if(i == -1 || i == 1){\n \t\t\t\t\tfor(let k = -type;k <= 1;k++){\n \t\t\t\t\t\tif((x+k > 0) && (x+k < 10) &&mapData[x+k][y+i] != undefined){\n \t\t\t\t\t\t\tfreespace += mapData[x+k][y+i];\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t}\n \t\t}\n \t}\n \tif(freespace){ // freespace > 0 = has ship around this position. \n \t\treturn false\n \t}else{\n \t\treturn true\n \t}\n }", "_setBounds() {\t\t\n\t\tGoogleMaps.load((google) => {\n\t\t\tlet bounds = new google.maps.LatLngBounds(); \n\t\t\n\t\t\tnew Promise((resolve, reject) => {\n\t\t\t\tresolve(this.getActiveMarkers());\n\t\t\t}).then((markers) => {\n\t\t\t\tfor(let m in markers) {\n\t\t\t\t\tbounds.extend(markers[m].pin.getPosition());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthis.map.fitBounds(bounds);\t\n\t\t\t\tthis._setZoom();\t\t\t\t\t\t\t\n\t\t\t});\t\t\t\t\t\n\t\t});\n\t}", "constrainToMap() {\n //check position on x axis and counter force\n if (this.x < (windowWidth / 20)) {\n this.vx += 1;\n }\n if (this.x > (windowWidth - windowWidth / 20)) {\n this.vx -= 1;\n }\n\n // check position on y axis and counter force\n if (this.y < (windowHeight / 5)) {\n this.vy += 1;\n }\n if (this.y > (windowHeight - windowHeight / 10)) {\n this.vy -= 1;\n }\n }", "function test_service_catalog_orchestration_global_region() {}", "function is_out_of_bounds()\n{\n\tif (frog.x < 0 || frog.x > 380) {\n\t\treturn 1;\n\t}\n\treturn 0;\n}", "function postFlowAction$CollectGQInformation() {\n /* retrieve data */\n try\n {\n var locationAddress = pega.ui.ClientCache.find('pyWorkPage.BCU.SelectedUnitPage.LocationAddress');\n var workPage = pega.ui.ClientCache.find('pyWorkPage');\n var gqCategory = locationAddress.get('GQCategory') ? locationAddress.get('GQCategory').getValue(): \"\";\n\n var gqTypeCode = locationAddress.get(\"GQTypeCode\");\n var cpGqTypeCode = (gqTypeCode)? gqTypeCode.getValue() : \"\";\n var gqType = \"\";\n if( cpGqTypeCode != \"\" )\n {\n var gqList = pega.ui.ClientCache.find(\"D_GQTypeOptions.pxResults\");\n if(gqList)\n {\n var iterGQList = gqList.iterator();\n while(iterGQList.hasNext())\n {\n var cpCurItem = iterGQList.next();\n var name = cpCurItem.get(\"Name\");\n var cpName = (name)? name.getValue() : \"\";\n var code = cpCurItem.get(\"Code\");\n var cpCode = (code)? code.getValue() : \"\";\n if((name == gqCategory) && (cpCode == cpGqTypeCode))\n {\n gqType = cpCurItem.get(\"Value\") ? cpCurItem.get(\"Value\").getValue() : \"\";\n locationAddress.put('GQTypes',gqType);\n break;\n }\n }\n }\n }\n else\n {\n locationAddress.put('GQTypes',\"\");\n }\n\n if (gqCategory === \"\") { /* If a value has not been chosen.*/\n /* GQCategory is required */\n locationAddress.get('GQCategory').addMessage(ALMCensus.Messages.Msg_GQCategoryRequired);\n }\n /* Validate fields required. */\n else if (cpGqTypeCode == \"\") { /* If a value has not been chosen.*/\n /* GQTypeCode is required - as is GQTypes which gets set from it. */\n locationAddress.get('GQTypeCode').addMessage(ALMCensus.Messages.Msg_GQTypesRequired);\n }\n\n\n\n /* Branching logic. */\n if (gqType === \"703: Domestic Violence Shelters\") {\n workPage.put('NextStep', 'SetLocationAddress');\n } else {\n workPage.put('NextStep', 'AttemptContact');\n }\n }\n catch(Err)\n {\n alert(\"Error in CollectGQInformation Post Action ==> <\" + Err.message + \">\");\n }\n}", "area() {\n return 4 * (3.14) * (this.radius**2)\n }", "function rightRegionSevenCoordinates(mx,bx,phasePos,index){\n \n //let temp = g.points[0];\n let xL, xR, m, b, x, y;\n for(let i = 0; i < phasePos.length-1; i++){\n m = (phasePos[i+1][1]-phasePos[i][1])/(phasePos[i+1][0]-phasePos[i][0]);\n b = phasePos[i][1] - m*phasePos[i][0];\n x = (bx-b)/(m-mx);\n \n if(x > phasePos[i][0] && x < phasePos[i+1][0] && i < index){\n xL = x;\n } else if(x == phasePos[i][0] && i < index){\n xL = phasePos[i][0];\n } \n\n if(x > phasePos[i][0] && x < phasePos[i+1][0] && i > index){\n xR = x;\n } else if (x == phasePos[i][0] && i > index){\n xR = phasePos[i][0];\n }\n }\n return([xL,xR])\n}", "function gps_autoconsulta() {\n ZOOM_IN_BOUNDS2 = true; \n gps_iniciaPausaAutoConsulta(); \n}" ]
[ "0.56376505", "0.55505455", "0.5550223", "0.54685915", "0.5453922", "0.5362113", "0.5336347", "0.5293685", "0.5285651", "0.5245172", "0.521086", "0.5208417", "0.5207057", "0.52017367", "0.5175408", "0.5164273", "0.5159959", "0.51523805", "0.51486635", "0.51447725", "0.5142255", "0.5138346", "0.513092", "0.5116506", "0.5114374", "0.5106923", "0.5103081", "0.50956005", "0.5095346", "0.5094382", "0.50890905", "0.50836086", "0.50762296", "0.5066342", "0.5064047", "0.50550336", "0.5041529", "0.50412613", "0.503594", "0.5034137", "0.5030767", "0.5016787", "0.50142777", "0.5005082", "0.50024974", "0.499891", "0.49983808", "0.49930096", "0.49900296", "0.49853796", "0.4983844", "0.4979754", "0.4979443", "0.49774915", "0.49725232", "0.49642786", "0.49544883", "0.49471617", "0.4923565", "0.49221423", "0.49150363", "0.4908621", "0.48984757", "0.48984757", "0.48984757", "0.48964983", "0.4893507", "0.48903394", "0.48817182", "0.48817182", "0.48804772", "0.48780978", "0.48776224", "0.48756504", "0.48754495", "0.48730364", "0.4870203", "0.4867234", "0.48651823", "0.48636922", "0.4860174", "0.48545438", "0.4853877", "0.48515132", "0.48511994", "0.4849595", "0.48491013", "0.4846629", "0.4845309", "0.48430252", "0.48422667", "0.48411295", "0.4828503", "0.48257276", "0.482305", "0.4820018", "0.48197666", "0.48196214", "0.48186", "0.48132518", "0.48121074" ]
0.0
-1
Barangay with Extreme Enhanced Community Quarantine
function resetHighlight_eecq(e) { eecq.resetStyle(e.target); info.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bandages() {\n var addon = selectAddOn(\"Bandages\", [\"Add 6 charges to medkit.\"], \"Common\", \"Add 6 charges to medkit.\", \"IconAddon_bandages.png\", \"First Aid Kit\", [\"extra\"]);\n return addon;\n}", "function getBrakeEngAlert(vid){\n var returnstr = \"\";\n if (trucks[vid].symptoms.brakeeng == true){\n returnstr = 'P-BRAKE ENGAGED';\n }\n return returnstr\n}", "function ReportInvoiceQrCodeWithAddress() {\n\n}", "async cmd_ad_bank(params) {\n return this.query({\n url: \"/user/watchadviewed/\",\n body: {\n bank_extra_gold: 1,\n },\n })\n }", "function setBahasa(event) {\n event.preventDefault();\n\n let bahasa = document.querySelector(\"#bahasaIndonesia\");\n let english = document.querySelector(\"#english\");\n let menu = document.querySelector(\"#nav-bar\");\n\n bahasa.classList.add(\"active\");\n english.classList.remove(\"active\");\n\n menu.innerHTML = ` <a\n href=\"https://exchange.naturalwayofliving.com/\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Login ke Zimbra</a\n >&nbsp;|&nbsp;\n <a\n href=\"./files/Tutorial to setup new Email ver 5.5 - Bahasa.pdf\"\n target=\"_blank\"\n >Tutorial</a\n >&nbsp;|&nbsp;\n <a\n href=\"https://youtu.be/lbY43AIWxOw\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >Video Tutorial\n </a>\n &nbsp;|&nbsp;\n <!-- Calendly link widget begin -->\n <link\n href=\"https://assets.calendly.com/assets/external/widget.css\"\n rel=\"stylesheet\"\n />\n <script\n src=\"https://assets.calendly.com/assets/external/widget.js\"\n type=\"text/javascript\"\n ></script>\n <a\n href=\"\"\n onclick=\"Calendly.initPopupWidget({url: 'https://calendly.com/irfani-silviana/nwl-email-support'});return false;\"\n >Jadwalkan Live Support</a\n >\n <!-- Calendly link widget end -->`;\n\n document.querySelector(\n '[for=\"firstName\"]'\n ).innerHTML = `<label for=\"firstName\" class=\"col-sm col-form-label\">Nama Depan<sup class=\"required\">*(wajib)</sup></label>`;\n document.querySelector('[for=\"lastName\"]').innerHTML = \"Nama Belakang\";\n document.querySelector(\n '[for=\"jobTitle\"]'\n ).innerHTML = `<label for=\"jobTitle\" class=\"col-sm col-form-label\"\n >Jenis Pekerjaan<sup class=\"required\">*(wajib)</sup></label>`;\n document.querySelector('[for=\"customField\"]').innerHTML = \"Keterangan\";\n document.querySelector('[for=\"department\"]').innerHTML = \"Departemen\";\n\n document.querySelector(\n '[for=\"officePhone\"]'\n ).innerHTML = `<label for=\"officePhone\" class=\"col-sm col-form-label\"\n >Telepon Kantor\n <sub>\n <em>(sertakan kode negara)</em>\n </sub>\n </label>`;\n document.querySelector(\n '[for=\"mobilePhone\"]'\n ).innerHTML = `<label for=\"mobilePhone\" class=\"col-sm col-form-label\"\n >Handphone<sub>\n <em>(sertakan kode negara)</em>\n </sub></label>`;\n\n document.querySelector(\n '[for=\"emailAddress\"]'\n ).innerHTML = `<label for=\"emailAddress\" class=\"col-sm col-form-label\"\n >Email<sup class=\"required\">*(wajib)</sup>\n <address></address\n ></label>`;\n\n let x = document.querySelectorAll(\"span.instruction\");\n let i;\n for (i = 0; i < x.length; i++) {\n x[i].innerHTML = \"Klik tombol ini --->\";\n }\n}", "static get tag(){return\"haxcms-backend-beaker\"}", "function getAd () {\n\nlet ad = {}\n\n// get some data from javascript object \"BelenConf\"\n let cat1 = null,\n cat2 = null,\n cat3 = null,\n cat1Name = null,\n cat2Name = null,\n cat3Name = null,\n id = null\n\nif (typeof BelenConf == \"object\") {\n\n\t// get categories\n\tcat1 = BelenConf.universalAnalyticsOpts.dimensions.dimension2\n\tcat2 = BelenConf.universalAnalyticsOpts.dimensions.dimension3\n\tcat3 = BelenConf.universalAnalyticsOpts.dimensions.dimension4\n\tcat1Name = BelenConf.universalAnalyticsOpts.dimensions.dimension90\n\tcat2Name = BelenConf.universalAnalyticsOpts.dimensions.dimension91\n\tcat3Name = BelenConf.universalAnalyticsOpts.dimensions.dimension92\n\tid = BelenConf.universalAnalyticsOpts.dimensions.dimension30\n\n\tif (id != null) ad.id = id\n\n\tlet catCombo = \"\"\n\tif (cat1 != null && cat1 != \"\" && cat2 != null && cat2 != \"\" ) catCombo = cat1 + \"/\" + cat2\n\tif (cat3 != null && cat3 != \"\")\tcatCombo = catCombo + \"/\" + cat3 \n\tad.caturl = \"https://www.ebay-kleinanzeigen.de/p-kategorie-aendern.html#?path=\" + catCombo + \"&isParent=false\"\n\n\t// get Versand\n\tad.shipping_type = \"NONE\"\n\tif (cat2Name != null & cat2Name != \"\") {\n\t\tlet selector = document.querySelector(\"#\" + cat2Name.toLowerCase() + \"\\\\.versand_s\")\n\t\tif (selector != null && selector.options.selectedIndex == 1 ) ad.shipping_type = \"SHIPPING\"\n\t\tif (selector != null && selector.options.selectedIndex == 2 ) ad.shipping_type = \"PICKUP\"\n\t}\n}\n\nad.date_published = new Date().toISOString()\nad.enabled = \"1\"\n\n\nlet adType1 = document.querySelector(\"#adType1\")\nlet adType2 = document.querySelector(\"#adType2\")\nad.type = \"OFFER\" // my Preset\n\nif (adType1.checked) ad.type = adType1.value // \"OFFER\"\nif (adType2.checked) ad.type = adType2.value // \"WANTED\"\n\n\nad.title = document.querySelector(\"#postad-title\").value\nad.desc = document.querySelector(\"#pstad-descrptn\").value\nad.price = document.querySelector(\"#pstad-price\").value \n\nlet priceType1 = document.querySelector(\"#priceType1\")\nlet priceType2 = document.querySelector(\"#priceType2\")\nlet priceType3 = document.querySelector(\"#priceType3\")\n\n\nad.price_type = \"FIXED\" // my Preset\nif (priceType1.checked) ad.price_type = priceType1.value // \"FIXED\"\nif (priceType2.checked) ad.price_type = priceType2.value // \"NEGOTIABLE\"\nif (priceType3.checked) ad.price_type = priceType3.value // \"GIVE_AWAY\"\n\nlet imgUsed = []\ndocument.querySelectorAll(\".pictureupload-thumbnails img\").forEach((img) => { \n\tlet bigImg = img.src.replace(/\\$_\\d{1,3}\\./, \"$_57.\") // change the img link to the link for the largest image fromat from server (1600x1600 px, if original was such big)\n\timgUsed.push(bigImg)\n})\nif (imgUsed.length > 0) ad.imgUsed = imgUsed;\n\n\nad.zipCode = document.querySelector(\"#pstad-zip\").value\n\nlet posterTypePrivate = document.querySelector(\"#posterType-private\")\nlet posterTypeCommercial = document.querySelector(\"#posterType-commercial\")\n\nif (posterTypePrivate.checked) ad.posterType = posterTypePrivate.value // \"PRIVATE\"\nif (posterTypeCommercial.checked) {\n\tad.posterType = posterTypeCommercial.value // \"COMMERCIAL\"\n\t// ad.imprint = document.querySelector(\"#pstad-imprnt-inpt\").value\n}\n\n\n// Additional Attributes\n\nlet additional_category_options = {}\nlet count = 0\nlet attr = document.querySelectorAll(\"div.formgroup.pstad-attrs select, div.formgroup.pstad-attrs input\")\nif (attr != null) for (let i = 0; i < attr.length; i++ ) {\n\tif (attr[i].tagName == \"INPUT\") {\n\t\tif (attr[i].type == \"text\") {\n\t\t\t//console.log(\"INPUT text\", attr[i].id, attr[i].value)\n \t\tif (attr[i].value != \"\") { // Add only items, which were filled with a value\n \t\t\tadditional_category_options[attr[i].id] = attr[i].value\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif (attr[i].type == \"checkbox\") {\n\t\t\t//console.log(\"INPUT checkbox\", attr[i].id, attr[i].checked)\n \t\tif (attr[i].checked) { // Add only items, which are checked\n \t\t\tadditional_category_options[attr[i].id] = attr[i].checked\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\n\t}\n\tif ( attr[i].tagName == \"SELECT\") {\n\t\t//console.log(\"SELECT\" ,attr[i].id, attr[i].selectedIndex, attr[i].options[attr[i].selectedIndex].text)\n\t\tif (attr[i].options[attr[i].selectedIndex].text.indexOf(\"wählen\") < 0 ) { // add only selected items\n\t\t\tadditional_category_options[attr[i].id] = attr[i].options[attr[i].selectedIndex].text\n\t\t\tcount++\n\t\t}\n\t}\n}\nif (count > 0) ad.additional_category_options = additional_category_options\n\nconsole.log(JSON.stringify(ad,null,4))\n// return ad\t\n\t\n}", "function isOtherThanBRA(state) {\r\n let isBra = state.case.charges.map(charge =>\r\n charge.isBRAFelony ? true : false\r\n );\r\n let braArr = [];\r\n state.case.charges.forEach(charge => {\r\n if (charge.isBRAFelony) {\r\n braArr.push(charge);\r\n }\r\n });\r\n if (!braArr[0]) {\r\n isAConviction(state);\r\n } else {\r\n let conArr = braArr.map(charge => (charge.isConvicted ? true : false));\r\n\r\n conArr.includes(true)\r\n ? printResult(\r\n \"eligible\",\r\n \"the 16- 803 analysis for eligible misdemeanors\"\r\n )\r\n : printResult(\r\n \"NOT ELIGIBLE\",\r\n \"use the 16-803 analysis for ineligible misdemeanors\"\r\n );\r\n }\r\n}", "function displayBCEString (a) {\n\n var bceBoolean=speechesArray[a].yearIsBCE;\n\n if(bceBoolean === true){\n document.getElementById('ConsoleDisplay').innerHTML += 'This speech took place before the common era.<br>';\n }else{\n document.getElementById('ConsoleDisplay').innerHTML += 'This speech took place during the common era.<br>';\n }\n}", "function D(t,e){if(!s)var s=\"https://ambrpay.io/api\";var n=e,a=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(n||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var a=s+\"/smartContractAddresses\";return r.getRequest(a,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,a,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(a=e,!a.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=a.wallet?a.wallet:t.receiverWallet,!n.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==a.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==a.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==a.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)a.daysInterval=parseInt(t.interval);else if(-1==a.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=a.transferOut),a.acceptedCryptoCurrencies.Ethereum.price>0)return a.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=a.currencyCode){if(o<1)throw\"the minimum amount is \"+a.currencyCode+\" 1.00 \";return r.getExchangePrice(a.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*a.fee,c=1e18*c/1e18,n.utils.isAddress(a.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+a.priceLimitPercentage/100);return new Promise((function(t,i){var l=new n.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,a.daysInterval,n.utils.toWei(d.toString(),\"ether\"),u,n.utils.toWei(c.toString(),\"ether\")).send({value:n.utils.toWei(o.toString(),\"ether\"),gas:5e5,gasPrice:1e9,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(n){var c={subscriptionPlanId:a.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:n.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return n.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,n){var a=s+\"/price/\"+t+\"/\"+e+\"/\"+n;return r.getRequest(a)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var n=new XMLHttpRequest;n.open(\"GET\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){if(4==n.readyState&&200==n.status)return e(n.responseText);4==n.readyState&&200!=n.status&&s(n.responseText)},n.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,n){var a=new XMLHttpRequest;a.open(\"POST\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){4==a.readyState&&200==a.status?s(a.responseText):4==a.readyState&&200!=a.status&&n(a.responseText)},a.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==n&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(a)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var a=new n.eth.Contract(r.ABI.abi,r.contractAddress),i=a.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,n){if(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(a){return n.eth.getBalance(a,(function(a,r){if(a)return s(a);var i=n.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,a){var i=new n.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){a(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(a).send({value:n.utils.toWei(t),gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(a){var i=new n.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(n.utils.toWei(t)).send({gas:5e5,from:a}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "function showFirst() {\n const request1 = new PaymentRequest(\n [{supportedMethods: 'https://bobpay.test'}, {supportedMethods: 'https://alicepay.test'}],\n {total: {label: 'Total', amount: {currency: 'USD', value: '5.00'}}});\n request1.show();\n}", "function BitAlliance() {\n return (\n <div\n // className= \"bitAlliance-view\" id=\"bitAlliance-view\"\n >\n {/* <Main2 currency=\"BitAlliance\"/> */}\n\n <Typography\n variant=\"h5\"\n style={{\n textAlign: 'center',\n fontWeight: '500px',\n fontFamily: 'Verdana',\n color: '#0000f',\n }}\n >\n Bit Alliance Coming Soon!\n </Typography>\n <br></br>\n\n <br></br>\n\n <Typography\n variant=\"h6\"\n style={{\n textAlign: 'center',\n marginLeft: '100px',\n marginRight: '100px',\n color: '#39FF14',\n }}\n >\n “Tracking your investments is what we can give you”\n </Typography>\n <br></br>\n </div>\n );\n}", "function bypassAnticheat() { // SO THAT YOUR ACCOUNT DOESNT GET BANNED\n \n}", "function _ckyRenderBanner() {\n _ckyCreateBanner();\n if (selectedLanguage == \"ar\")\n document.getElementById(\"cky-consent\").classList.add(\"cky-rtl\");\n document\n .getElementById(\"cky-consent\")\n .classList.add('cky-classic');\n _ckyAppendLogo();\n _ckyAppendText();\n _ckyRenderButtons();\n}", "_confirm_trade(event) {\n const trade = event.detail;\n trade.taking_order.price = trade.making_orders[0].price; // show trade price for both\n const all_orders = trade.making_orders.concat([trade.taking_order]);\n for (let order of all_orders) {\n if (order.pcode == this.pcode) {\n const type = order.is_bid ? 'bid' : 'ask';\n // this.$.log.info(`You ${order.is_bid ? 'bought' : 'sold'} for $${order.price}`, type);\n this.$.log.info(`${order.is_bid ? '-' : '+'} $${parseFloat((order.price/100).toFixed(1))}`, type);\n }\n // this.$.log.info(`You ${order.is_bid ? 'bought' : 'sold'} ${order.traded_volume} ${order.traded_volume == 1 ? 'unit' : 'units'}`);\n }\n // assign color code for trade list\n let type = 'other';\n if (this.trades[0].taking_order.pcode === this.pcode)\n type = this.trades[0].taking_order.is_bid ? 'bid' : 'ask';\n else if (this.trades[0].making_orders[0].pcode === this.pcode)\n type = this.trades[0].making_orders[0].is_bid ? 'bid' : 'ask';\n this.$.trades.setColor(0, type);\n }", "function countriesBarChart() {\n stopHandlers();\n BarchartHandler.startBC({ \"type\": \"countries\", \"properties\": [\"game1owners\"] });\n}", "async approveCompound(){\n let spender = Compound.util.getAddress(Compound.cDAI, process.env.ETH_NETWORK);\n //spender = '0xF0d0EB522cfa50B716B3b1604C4F0fA6f04376AD'; //cDAI\n console.log('spender: ' + spender);\n let param = cDAI.methods().approve.call({ spender: spender, amount: '3000000000000000000' });\n //let address = '0x4f96fe3b7a6cf9725f59d353f723c1bdb64ca6aa';//DAI\n let address = Compound.util.getAddress(Compound.DAI, process.env.ETH_NETWORK);\n console.log('address: ' + address);\n console.log(param);\n this.printInputData(param.data);\n console.log('data: ' + param.data);\n\n let parameter = {\n address: address,\n amount: param.amount,\n data: param.data\n };\n\n let currency = process.env.ETH;\n console.log('Start Bitgo SDK interaction');\n await this.bitgo.unlock();\n let transaction = await this.bitgo.sendBitGoTx([parameter], currency);\n await this.bitgo.lock();\n return transaction;\n }", "function I(t,e){if(!s)var s=\"https://ambrpay.io/api\";var a=e,n=t.address,r={apiKey:!1,testMode:!1,contractAddress:!1,contractAddresses:!1,network:\"auto\",setApiKey:function(t){if(r.apiKey=t,-1!=r.apiKey.indexOf(\"test_public\"))r.testMode=!0;else{if(-1==r.apiKey.indexOf(\"api_public\"))throw\"invalid public api key\";r.testMode=!1}},getContractAddresses:function(){return new Promise((function(t,e){if(r.contractAddress)return t(r.contractAddress);if(a||e(\"MetaMask is not installed. Download it at https://metamask.io/\"),r.contractAddresses)return t(r.contractAddresses);var n=s+\"/smartContractAddresses\";return r.getRequest(n,r.apiKey).then((function(e){return r.contractAddresses=JSON.parse(e),t(r.contractAddresses)}))})).then((function(){switch(t.netId){case\"1\":if(\"mainnet\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (mainnet) does not match the selected network for the transaction (\"+r.network+\")\";\"Mainnet\",r.contractAddress=r.contractAddresses.mainnet.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.mainnet.abi)};break;case\"2\":throw\"Morden testnet is not available. Try ropsten testnet.\";case\"3\":if(\"ropsten\"!=r.network&&\"auto\"!=r.network)throw\"your wallets network (ropsten) does not match the selected network for the transaction (\"+r.network+\")\";\"Ropsten Testnet\",r.contractAddress=r.contractAddresses.ropsten.smartContractAddress,r.ABI={abi:JSON.parse(r.contractAddresses.ropsten.abi)};break;case\"4\":throw\"Rinkeby testnet is not available. Try ropsten testnet.\";case\"42\":throw\"Kovan testnet is not available. Try ropsten testnet.\";default:throw\"Uknown testnet. Try ropsten testnet.\"}return r.contractAddress}))},getSubscriptionPlan:function(t){var e=s+\"/plan/\"+t;return r.getRequest(e).then((function(t){return JSON.parse(t)}))},subscribe:function(t){var e,s,n,i,o,c,u=!1;return t.network&&(r.network=t.network),r.getContractAddresses().then((function(){return r.metaMaskLoaded()})).then((function(){return r.getMetaMaskAccount()})).then((function(s){return e=s,r.getSubscriptionPlan(t.subscriptionPlan)})).then((function(e){if(n=e,!n.wallet&&!t.receiverWallet)throw\"Subscription plan has no wallet assigned to it, therefore param 'receiverWallet' is required when calling ambrpay.subscribe()\";if(s=n.wallet?n.wallet:t.receiverWallet,!a.utils.isAddress(s))throw\"receiverAddress is not a valid address\";if(-1==n.daysInterval&&!t.interval)throw\"Subscription plan has interval set to custom, therefore param 'interval' is required when calling ambrpay.subscribe()\";if(-1==n.daysInterval&&!r.isInt(t.interval))throw\"interval must be an integer\";if(-1==n.daysInterval&&t.interval&&parseInt(t.interval)>=1&&parseInt(t.interval)<=365)n.daysInterval=parseInt(t.interval);else if(-1==n.daysInterval&&t.interval)throw\"interval must be between 1 and 365\";if(\"undefined\"!==typeof t.transferOut&&\"boolean\"!==typeof t.transferOut)throw\"transferOut must be a boolean\";if(u=!(!t.transferOut||1!=n.transferOut),n.acceptedCryptoCurrencies.Ethereum.price>0)return n.acceptedCryptoCurrencies.Ethereum.price;if(t.amount){if(!r.isInt(t.amount)&&!r.isFloat(t.amount))throw\"amount must be an integer or a float\";if(o=t.amount,\"ETH\"!=n.currencyCode){if(o<1)throw\"the minimum amount is \"+n.currencyCode+\" 1.00 \";return r.getExchangePrice(n.currencyCode,\"ETH\",o).then((function(t){return t}))}if(t.amount<.01)throw\"the minimum amount is 0.01 ETH\";return t.amount}})).then((function(t){if(i=t,c=t/100*n.fee,c=1e18*c/1e18,a.utils.isAddress(n.wallet))var o=parseFloat(i);else o=parseFloat(i)+parseFloat(c);var d=o*(1+n.priceLimitPercentage/100);return new Promise((function(t,i){var l=new a.eth.Contract(r.ABI.abi,r.contractAddress);return l.methods.createSubscriptionWithTransfer(s,n.daysInterval,a.utils.toWei(d.toString(),\"ether\"),u,a.utils.toWei(c.toString(),\"ether\")).send({value:a.utils.toWei(o.toString(),\"ether\"),gas:5e5,from:e}).then((function(e){return t(e)})).catch((function(t){return i(t)}))}))})).then((function(a){var c={subscriptionPlanId:n.id,senderWallet:e,receiverWallet:s,customerId:t.customerId,customerEmail:t.customerEmail,customerDescription:t.customerDescription,transactionHash:a.transactionHash,subscriptionCurrency:\"ETH\",subscriptionPrice:i,customPrice:o,interval:t.interval,transferOut:u,smartContractAddress:r.contractAddress};return r.createSubscription(c).then((function(){return a.transactionHash}))}))},createSubscription:function(t){var e=s+\"/subscription\";return r.postRequest(e,t).then((function(t){return JSON.parse(t)}))},getExchangePrice:function(t,e,a){var n=s+\"/price/\"+t+\"/\"+e+\"/\"+a;return r.getRequest(n)},getRequest:function(t){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(e,s){var a=new XMLHttpRequest;a.open(\"GET\",t,!0),a.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),a.onreadystatechange=function(){if(4==a.readyState&&200==a.status)return e(a.responseText);4==a.readyState&&200!=a.status&&s(a.responseText)},a.send()}))},postRequest:function(t,e){if(!r.apiKey)throw\"ambrpay api key not set\";return new Promise((function(s,a){var n=new XMLHttpRequest;n.open(\"POST\",t,!0),n.setRequestHeader(\"Authorization\",\"Bearer \"+r.apiKey),n.onreadystatechange=function(){4==n.readyState&&200==n.status?s(n.responseText):4==n.readyState&&200!=n.status&&a(n.responseText)},n.send(JSON.stringify(e))}))},metaMaskLoaded:function(){return new Promise((function(t,e){return\"undefined\"==a&&e(\"MetaMask is missing. Please download the MetaMask browser extension.\"),t(!0)}))},getMetaMaskAccount:function(){return new Promise((function(t,e){return t(n)}))},getSubscriptionFunds:function(){return r.getContractAddresses().then((function(){return r.getMetaMaskAccount()})).then((function(t){if(!t)throw\"Error retrieving your metamask wallet address. Make sure metamask is unlocked\";return new Promise((function(e,s){var n=new a.eth.Contract(r.ABI.abi,r.contractAddress),i=n.methods.getBalances(t).call();return e(i)}))}))},getSubscriptions:function(t){return new Promise((function(e,a){if(t){var n=s+\"/subscriptions/\"+t;return r.getRequest(n,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}return r.getMetaMaskAccount().then((function(t){var a=s+\"/subscriptions/\"+t;return r.getRequest(a,r.apiKey).then((function(t){return r.subscriptions=JSON.parse(t),e(r.subscriptions)}))}))}))},getMetaMaskBalance:function(){return new Promise((function(t,s){return r.getMetaMaskAccount().then((function(n){return a.eth.getBalance(n,(function(n,r){if(n)return s(n);var i=a.utils.fromWei(r,\"ether\");return i=e.utils.toDecimal(i),t(i)}))}))}))},unsubscribe:function(t,e){return new Promise((function(s,n){var i=new a.eth.Contract(r.ABI.abi,e);return r.getMetaMaskAccount().then((function(e){return i.methods.deactivateSubscription(t).send({gas:5e5,from:e}).then((function(t){s(t)})).catch((function(t){n(t)}))}))}))},addFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.addFunds(n).send({value:a.utils.toWei(t),gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},withdrawFunds:function(t){return new Promise((function(e,s){return r.getMetaMaskAccount().then((function(n){var i=new a.eth.Contract(r.ABI.abi,r.contractAddress);return i.methods.withdrawFunds(a.utils.toWei(t)).send({gas:5e5,from:n}).then((function(t){return e(t)})).catch((function(t){return s(t)}))}))}))},isInt:function(t){return Number(t)===t&&t%1===0},isFloat:function(t){return Number(t)===t&&t%1!==0}};return r.setApiKey(t.publicApiKey),r}", "function bid() {\n // this calls the \"add\" function defined in the Solidity contract\n // the last argument is a callback to handle the result\n CONTRACT.bid( function(error, result) {\n if(error) { console.log(error) }\n })\n}", "provincia() {\n return super.informacion('provincia');\n }", "function paidToMuch(bounceBackAccount) {\n if (Number(loanAmount.innerText) <= 0) {\n bounceBackAccount.innerText = Number(bounceBackAccount.innerText) + (Number(loanAmount.innerText) * -1);\n loanAmount.innerText = 0;\n hasActiveLoan = false;\n loanDownPayment.style.display = 'none';\n downPaymentButton.style.display = 'none';\n }\n}", "function concert() {\n\n //queryUrl for bandsintown\n var bandUrl = \"https://rest.bandsintown.com/artists/\" + userQuery + \"/events?app_id=codingbootcamp\";\n\n axios.get(bandUrl).then(function (response) {\n console.log(\"\\nVenue Name: \" + response.data[0].venue.name);\n console.log(\"\\nLocation: \" + response.data[0].venue.city + \" \" + response.data[0].venue.country);\n console.log(\"\\nDate: \" + moment((response.data[0].datetime)).format(\"MM/DD/YYYY\"));\n })\n .catch(function (error) {\n if (error.response) {\n console.log(error.response.data);\n } else if (error.request) {\n console.log(error.request);\n } else {\n console.log(\"error\", error.message);\n }\n });\n}", "function chart1() {\n var options = {\n series: [\n {\n data: [\n 2.7,\n 2.65,\n 2.58,\n 2.44,\n 2.01,\n 1.92,\n 1.18,\n 1.01,\n 0.84,\n 0.8,\n 0.79,\n 0.79,\n 0.68,\n 0.66,\n 0.61,\n 0.53,\n 0.5,\n 0.46,\n 0.45,\n 0.38,\n 0.12,\n 0.04\n ]\n }\n ],\n chart: {\n type: \"bar\",\n height: 350\n },\n plotOptions: {\n bar: {\n horizontal: true\n }\n },\n dataLabels: {\n enabled: false\n },\n\n fill: {\n colors: [\"#003469\"],\n opacity: 1\n },\n\n xaxis: {\n categories: [\n \"AM. AL ASIMAH\",\n \"AL HUDAYDAH\",\n \"TAIZZ\",\n \"IBB\",\n \"HAJJAH\",\n \"DHAMAR\",\n \"SANA'A\",\n \"AMRAN\",\n \"SA'ADA\",\n \"HADRAMAUT\",\n \"ADEN\",\n \"LAHJ\",\n \"AL BAYDA\",\n \"AL MAHWIT\",\n \"AL DHALE'E\",\n \"RAYMAH\",\n \"SHABWAH\",\n \"AL JAWF\",\n \"ABYAN\",\n \"MARIB\",\n \"AL MAHARAH\",\n \"SOCOTRA\"\n ]\n }\n };\n\n var chart = new ApexCharts(document.querySelector(\"#myAreaChart\"), options);\n chart.render();\n}", "function mainCanvasApp(){\n BD18.stockMarket.place();\n}", "function IndicadorAntiguedad () {}", "constructor(core, baseurl = '/ext/bc/C/avax', blockchainID = '') {\n super(core, baseurl);\n /**\n * @ignore\n */\n this.keychain = new keychain_1.KeyChain('', '');\n this.blockchainID = '';\n this.blockchainAlias = undefined;\n this.AVAXAssetID = undefined;\n this.txFee = undefined;\n /**\n * Gets the alias for the blockchainID if it exists, otherwise returns `undefined`.\n *\n * @returns The alias for the blockchainID\n */\n this.getBlockchainAlias = () => {\n if (typeof this.blockchainAlias === \"undefined\") {\n const netID = this.core.getNetworkID();\n if (netID in constants_1.Defaults.network && this.blockchainID in constants_1.Defaults.network[netID]) {\n this.blockchainAlias = constants_1.Defaults.network[netID][this.blockchainID].alias;\n return this.blockchainAlias;\n }\n else {\n /* istanbul ignore next */\n return undefined;\n }\n }\n return this.blockchainAlias;\n };\n /**\n * Sets the alias for the blockchainID.\n *\n * @param alias The alias for the blockchainID.\n *\n */\n this.setBlockchainAlias = (alias) => {\n this.blockchainAlias = alias;\n /* istanbul ignore next */\n return undefined;\n };\n /**\n * Gets the blockchainID and returns it.\n *\n * @returns The blockchainID\n */\n this.getBlockchainID = () => this.blockchainID;\n /**\n * Refresh blockchainID, and if a blockchainID is passed in, use that.\n *\n * @param Optional. BlockchainID to assign, if none, uses the default based on networkID.\n *\n * @returns A boolean if the blockchainID was successfully refreshed.\n */\n this.refreshBlockchainID = (blockchainID = undefined) => {\n const netID = this.core.getNetworkID();\n if (typeof blockchainID === 'undefined' && typeof constants_1.Defaults.network[netID] !== \"undefined\") {\n this.blockchainID = constants_1.Defaults.network[netID].C.blockchainID; //default to C-Chain\n return true;\n }\n if (typeof blockchainID === 'string') {\n this.blockchainID = blockchainID;\n return true;\n }\n return false;\n };\n /**\n * Takes an address string and returns its {@link https://github.com/feross/buffer|Buffer} representation if valid.\n *\n * @returns A {@link https://github.com/feross/buffer|Buffer} for the address if valid, undefined if not valid.\n */\n this.parseAddress = (addr) => {\n const alias = this.getBlockchainAlias();\n const blockchainID = this.getBlockchainID();\n return bintools.parseAddress(addr, blockchainID, alias, constants_2.EVMConstants.ADDRESSLENGTH);\n };\n this.addressFromBuffer = (address) => {\n const chainID = this.getBlockchainAlias() ? this.getBlockchainAlias() : this.getBlockchainID();\n return bintools.addressToString(this.core.getHRP(), chainID, address);\n };\n /**\n * Retrieves an assets name and symbol.\n *\n * @param assetID Either a {@link https://github.com/feross/buffer|Buffer} or an b58 serialized string for the AssetID or its alias.\n *\n * @returns Returns a Promise<Asset> with keys \"name\", \"symbol\", \"assetID\" and \"denomination\".\n */\n this.getAssetDescription = (assetID) => __awaiter(this, void 0, void 0, function* () {\n let asset;\n if (typeof assetID !== 'string') {\n asset = bintools.cb58Encode(assetID);\n }\n else {\n asset = assetID;\n }\n const params = {\n assetID: asset,\n };\n const tmpBaseURL = this.getBaseURL();\n // set base url to get asset description\n this.setBaseURL(\"/ext/bc/X\");\n const response = yield this.callMethod('avm.getAssetDescription', params);\n // set base url back what it originally was\n this.setBaseURL(tmpBaseURL);\n return {\n name: response.data.result.name,\n symbol: response.data.result.symbol,\n assetID: bintools.cb58Decode(response.data.result.assetID),\n denomination: parseInt(response.data.result.denomination, 10),\n };\n });\n /**\n * Fetches the AVAX AssetID and returns it in a Promise.\n *\n * @param refresh This function caches the response. Refresh = true will bust the cache.\n *\n * @returns The the provided string representing the AVAX AssetID\n */\n this.getAVAXAssetID = (refresh = false) => __awaiter(this, void 0, void 0, function* () {\n if (typeof this.AVAXAssetID === 'undefined' || refresh) {\n const asset = yield this.getAssetDescription(constants_1.PrimaryAssetAlias);\n this.AVAXAssetID = asset.assetID;\n }\n return this.AVAXAssetID;\n });\n /**\n * Overrides the defaults and sets the cache to a specific AVAX AssetID\n *\n * @param avaxAssetID A cb58 string or Buffer representing the AVAX AssetID\n *\n * @returns The the provided string representing the AVAX AssetID\n */\n this.setAVAXAssetID = (avaxAssetID) => {\n if (typeof avaxAssetID === \"string\") {\n avaxAssetID = bintools.cb58Decode(avaxAssetID);\n }\n this.AVAXAssetID = avaxAssetID;\n };\n /**\n * Gets the default tx fee for this chain.\n *\n * @returns The default tx fee as a {@link https://github.com/indutny/bn.js/|BN}\n */\n this.getDefaultTxFee = () => {\n return this.core.getNetworkID() in constants_1.Defaults.network ? new bn_js_1.default(constants_1.Defaults.network[this.core.getNetworkID()][\"C\"][\"txFee\"]) : new bn_js_1.default(0);\n };\n /**\n * Gets the tx fee for this chain.\n *\n * @returns The tx fee as a {@link https://github.com/indutny/bn.js/|BN}\n */\n this.getTxFee = () => {\n if (typeof this.txFee === \"undefined\") {\n this.txFee = this.getDefaultTxFee();\n }\n return this.txFee;\n };\n /**\n * Send ANT (Avalanche Native Token) assets including AVAX from the C-Chain to an account on the X-Chain.\n *\n * After calling this method, you must call the X-Chain’s import method to complete the transfer.\n *\n * @param username The Keystore user that controls the X-Chain account specified in `to`\n * @param password The password of the Keystore user\n * @param to The account on the X-Chain to send the AVAX to.\n * @param amount Amount of asset to export as a {@link https://github.com/indutny/bn.js/|BN}\n * @param assetID The asset id which is being sent\n *\n * @returns String representing the transaction id\n */\n this.export = (username, password, to, amount, assetID) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n to,\n amount: amount.toString(10),\n username,\n password,\n assetID\n };\n return this.callMethod('avax.export', params).then((response) => response.data.result.txID);\n });\n /**\n * Send AVAX from the C-Chain to an account on the X-Chain.\n *\n * After calling this method, you must call the X-Chain’s importAVAX method to complete the transfer.\n *\n * @param username The Keystore user that controls the X-Chain account specified in `to`\n * @param password The password of the Keystore user\n * @param to The account on the X-Chain to send the AVAX to.\n * @param amount Amount of AVAX to export as a {@link https://github.com/indutny/bn.js/|BN}\n *\n * @returns String representing the transaction id\n */\n this.exportAVAX = (username, password, to, amount) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n to,\n amount: amount.toString(10),\n username,\n password,\n };\n return this.callMethod('avax.exportAVAX', params).then((response) => response.data.result.txID);\n });\n /**\n * Retrieves the UTXOs related to the addresses provided from the node's `getUTXOs` method.\n *\n * @param addresses An array of addresses as cb58 strings or addresses as {@link https://github.com/feross/buffer|Buffer}s\n * @param sourceChain A string for the chain to look for the UTXO's. Default is to use this chain, but if exported UTXOs exist\n * from other chains, this can used to pull them instead.\n * @param limit Optional. Returns at most [limit] addresses. If [limit] == 0 or > [maxUTXOsToFetch], fetches up to [maxUTXOsToFetch].\n * @param startIndex Optional. [StartIndex] defines where to start fetching UTXOs (for pagination.)\n * UTXOs fetched are from addresses equal to or greater than [StartIndex.Address]\n * For address [StartIndex.Address], only UTXOs with IDs greater than [StartIndex.Utxo] will be returned.\n */\n this.getUTXOs = (addresses, sourceChain = undefined, limit = 0, startIndex = undefined) => __awaiter(this, void 0, void 0, function* () {\n if (typeof addresses === \"string\") {\n addresses = [addresses];\n }\n const params = {\n addresses: addresses,\n limit\n };\n if (typeof startIndex !== \"undefined\" && startIndex) {\n params.startIndex = startIndex;\n }\n if (typeof sourceChain !== \"undefined\") {\n params.sourceChain = sourceChain;\n }\n return this.callMethod('avax.getUTXOs', params).then((response) => {\n const utxos = new utxos_1.UTXOSet();\n let data = response.data.result.utxos;\n utxos.addArray(data, false);\n response.data.result.utxos = utxos;\n return response.data.result;\n });\n });\n /**\n * Send ANT (Avalanche Native Token) assets including AVAX from an account on the X-Chain to an address on the C-Chain. This transaction\n * must be signed with the key of the account that the asset is sent from and which pays\n * the transaction fee.\n *\n * @param username The Keystore user that controls the account specified in `to`\n * @param password The password of the Keystore user\n * @param to The address of the account the asset is sent to.\n * @param sourceChain The chainID where the funds are coming from. Ex: \"X\"\n *\n * @returns Promise for a string for the transaction, which should be sent to the network\n * by calling issueTx.\n */\n this.import = (username, password, to, sourceChain) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n to,\n sourceChain,\n username,\n password,\n };\n return this.callMethod('avax.import', params)\n .then((response) => response.data.result.txID);\n });\n /**\n * Send AVAX from an account on the X-Chain to an address on the C-Chain. This transaction\n * must be signed with the key of the account that the AVAX is sent from and which pays\n * the transaction fee.\n *\n * @param username The Keystore user that controls the account specified in `to`\n * @param password The password of the Keystore user\n * @param to The address of the account the AVAX is sent to. This must be the same as the to\n * argument in the corresponding call to the X-Chain’s exportAVAX\n * @param sourceChain The chainID where the funds are coming from.\n *\n * @returns Promise for a string for the transaction, which should be sent to the network\n * by calling issueTx.\n */\n this.importAVAX = (username, password, to, sourceChain) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n to,\n sourceChain,\n username,\n password,\n };\n return this.callMethod('avax.importAVAX', params)\n .then((response) => response.data.result.txID);\n });\n /**\n * Give a user control over an address by providing the private key that controls the address.\n *\n * @param username The name of the user to store the private key\n * @param password The password that unlocks the user\n * @param privateKey A string representing the private key in the vm's format\n *\n * @returns The address for the imported private key.\n */\n this.importKey = (username, password, privateKey) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n privateKey,\n };\n return this.callMethod('avax.importKey', params).then((response) => response.data.result.address);\n });\n /**\n * Calls the node's issueTx method from the API and returns the resulting transaction ID as a string.\n *\n * @param tx A string, {@link https://github.com/feross/buffer|Buffer}, or [[Tx]] representing a transaction\n *\n * @returns A Promise<string> representing the transaction ID of the posted transaction.\n */\n this.issueTx = (tx) => __awaiter(this, void 0, void 0, function* () {\n let Transaction = '';\n if (typeof tx === 'string') {\n Transaction = tx;\n }\n else if (tx instanceof buffer_1.Buffer) {\n const txobj = new tx_1.Tx();\n txobj.fromBuffer(tx);\n Transaction = txobj.toString();\n }\n else if (tx instanceof tx_1.Tx) {\n Transaction = tx.toString();\n }\n else {\n /* istanbul ignore next */\n throw new Error('Error - avax.issueTx: provided tx is not expected type of string, Buffer, or Tx');\n }\n const params = {\n tx: Transaction.toString(),\n };\n return this.callMethod('avax.issueTx', params).then((response) => response.data.result.txID);\n });\n /**\n * Exports the private key for an address.\n *\n * @param username The name of the user with the private key\n * @param password The password used to decrypt the private key\n * @param address The address whose private key should be exported\n *\n * @returns Promise with the decrypted private key as store in the database\n */\n this.exportKey = (username, password, address) => __awaiter(this, void 0, void 0, function* () {\n const params = {\n username,\n password,\n address,\n };\n return this.callMethod('avax.exportKey', params).then((response) => response.data.result.privateKey);\n });\n /**\n * Helper function which creates an unsigned Import Tx. For more granular control, you may create your own\n * [[UnsignedTx]] manually (with their corresponding [[TransferableInput]]s, [[TransferableOutput]]s).\n *\n * @param utxoset A set of UTXOs that the transaction is built on\n * @param toAddress The address to send the funds\n * @param ownerAddresses The addresses being used to import\n * @param sourceChain The chainid for where the import is coming from\n * @param fromAddresses The addresses being used to send the funds from the UTXOs provided\n *\n * @returns An unsigned transaction ([[UnsignedTx]]) which contains a [[ImportTx]].\n *\n * @remarks\n * This helper exists because the endpoint API should be the primary point of entry for most functionality.\n */\n this.buildImportTx = (utxoset, toAddress, ownerAddresses, sourceChain, fromAddresses) => __awaiter(this, void 0, void 0, function* () {\n const from = this._cleanAddressArray(fromAddresses, 'buildImportTx').map((a) => bintools.stringToAddress(a));\n let srcChain = undefined;\n if (typeof sourceChain === \"string\") {\n // if there is a sourceChain passed in and it's a string then save the string value and cast the original\n // variable from a string to a Buffer\n srcChain = sourceChain;\n sourceChain = bintools.cb58Decode(sourceChain);\n }\n else if (typeof sourceChain === \"undefined\" || !(sourceChain instanceof buffer_1.Buffer)) {\n // if there is no sourceChain passed in or the sourceChain is any data type other than a Buffer then throw an error\n throw new Error('Error - EVMAPI.buildImportTx: sourceChain is undefined or invalid sourceChain type.');\n }\n const utxoResponse = yield this.getUTXOs(ownerAddresses, srcChain, 0, undefined);\n const atomicUTXOs = utxoResponse.utxos;\n const avaxAssetID = yield this.getAVAXAssetID();\n const atomics = atomicUTXOs.getAllUTXOs();\n if (atomics.length === 0) {\n throw new Error(\"Error - EVMAPI.buildImportTx: no atomic utxos to import\");\n }\n const builtUnsignedTx = utxoset.buildImportTx(this.core.getNetworkID(), bintools.cb58Decode(this.blockchainID), [toAddress], from, atomics, sourceChain, this.getTxFee(), avaxAssetID);\n return builtUnsignedTx;\n });\n /**\n * Helper function which creates an unsigned Export Tx. For more granular control, you may create your own\n * [[UnsignedTx]] manually (with their corresponding [[TransferableInput]]s, [[TransferableOutput]]s).\n *\n * @param amount The amount being exported as a {@link https://github.com/indutny/bn.js/|BN}\n * @param assetID The asset id which is being sent\n * @param destinationChain The chainid for where the assets will be sent.\n * @param toAddresses The addresses to send the funds\n * @param fromAddresses The addresses being used to send the funds from the UTXOs provided\n * @param changeAddresses The addresses that can spend the change remaining from the spent UTXOs\n * @param asOf Optional. The timestamp to verify the transaction against as a {@link https://github.com/indutny/bn.js/|BN}\n * @param locktime Optional. The locktime field created in the resulting outputs\n * @param threshold Optional. The number of signatures required to spend the funds in the resultant UTXO\n *\n * @returns An unsigned transaction ([[UnsignedTx]]) which contains an [[ExportTx]].\n */\n this.buildExportTx = (amount, assetID, destinationChain, fromAddressHex, fromAddressBech, toAddresses, nonce = 0, locktime = new bn_js_1.default(0), threshold = 1) => __awaiter(this, void 0, void 0, function* () {\n let prefixes = {};\n toAddresses.map((address) => {\n prefixes[address.split(\"-\")[0]] = true;\n });\n if (Object.keys(prefixes).length !== 1) {\n throw new Error(\"Error - EVMAPI.buildExportTx: To addresses must have the same chainID prefix.\");\n }\n if (typeof destinationChain === \"undefined\") {\n throw new Error(\"Error - EVMAPI.buildExportTx: Destination ChainID is undefined.\");\n }\n else if (typeof destinationChain === \"string\") {\n destinationChain = bintools.cb58Decode(destinationChain);\n }\n else if (!(destinationChain instanceof buffer_1.Buffer)) {\n throw new Error(\"Error - EVMAPI.buildExportTx: Invalid destinationChain type\");\n }\n if (destinationChain.length !== 32) {\n throw new Error(\"Error - EVMAPI.buildExportTx: Destination ChainID must be 32 bytes in length.\");\n }\n const fee = this.getTxFee();\n const assetDescription = yield this.getAssetDescription(\"AVAX\");\n const evmInputs = [];\n if (bintools.cb58Encode(assetDescription.assetID) === assetID) {\n const evmInput = new inputs_1.EVMInput(fromAddressHex, amount.add(fee), assetID, nonce);\n evmInput.addSignatureIdx(0, bintools.stringToAddress(fromAddressBech));\n evmInputs.push(evmInput);\n }\n else {\n // if asset id isn't AVAX asset id then create 2 inputs\n // first input will be AVAX and will be for the amount of the fee\n // second input will be the ANT\n const evmAVAXInput = new inputs_1.EVMInput(fromAddressHex, fee, assetDescription.assetID, nonce);\n evmAVAXInput.addSignatureIdx(0, bintools.stringToAddress(fromAddressBech));\n evmInputs.push(evmAVAXInput);\n const evmANTInput = new inputs_1.EVMInput(fromAddressHex, amount, assetID, nonce);\n evmANTInput.addSignatureIdx(0, bintools.stringToAddress(fromAddressBech));\n evmInputs.push(evmANTInput);\n }\n const to = [];\n toAddresses.map((address) => {\n to.push(bintools.stringToAddress(address));\n });\n let exportedOuts = [];\n const secpTransferOutput = new outputs_1.SECPTransferOutput(amount, to, locktime, threshold);\n const transferableOutput = new outputs_1.TransferableOutput(bintools.cb58Decode(assetID), secpTransferOutput);\n exportedOuts.push(transferableOutput);\n // lexicographically sort array\n exportedOuts = exportedOuts.sort(outputs_1.TransferableOutput.comparator());\n const exportTx = new exporttx_1.ExportTx(this.core.getNetworkID(), bintools.cb58Decode(this.blockchainID), destinationChain, evmInputs, exportedOuts);\n const unsignedTx = new tx_1.UnsignedTx(exportTx);\n return unsignedTx;\n });\n /**\n * Gets a reference to the keychain for this class.\n *\n * @returns The instance of [[KeyChain]] for this class\n */\n this.keyChain = () => this.keychain;\n this.blockchainID = blockchainID;\n const netID = core.getNetworkID();\n if (netID in constants_1.Defaults.network && blockchainID in constants_1.Defaults.network[netID]) {\n const { alias } = constants_1.Defaults.network[netID][blockchainID];\n this.keychain = new keychain_1.KeyChain(this.core.getHRP(), alias);\n }\n else {\n this.keychain = new keychain_1.KeyChain(this.core.getHRP(), blockchainID);\n }\n }", "function concertThis(bandName) {\n\tconsole.log(\"concert-this\");\n\tvar queryUrl = \"https://rest.bandsintown.com/artists/\" + bandName + \"/events?app_id=codecademy\";\n\taxios.get(queryUrl).then((response) => {\n\t\t// console.log('response.data', response.data);\n\n\t\tconst bandNames = response.data.map(function(band) {\n\t\t\treturn band.lineup.join(\", \");\n\t\t});\n\t\tconsole.log(\"bandNames\", bandNames);\n\n\t\t//console.log('Name', Name);\n\t\t//console.log('City', City);\n\t\t// console.log('Date', Date);\n\t\t// console.log('Country', Country);\n\n\t\t//command 3 movie this\n\t\t// run a movie to the OMDB API with the movie specified\n\t});\n}", "function brendanEichQuote() {\n console.log('Always bet on JavaScript.');\n }", "function IndicadorRangoEdad () {}", "function sabrixAfterSubmit(eventtype) {\n\ttry {\n\t\tvar callsabrix = 0;\n\t\tif(eventtype == 'create' || eventtype == 'edit') {\n\t\t\t\n\t\t\tvar rec = nlapiLoadRecord(nlapiGetRecordType(),nlapiGetRecordId());\n\t\t\t//Do No calculate Tax\n\t\t\tvar donotcalculatetax = rec.getFieldValue('custbody_spk_donotcalculatetax');\n\t\t\tif(donotcalculatetax == 'T') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallsabrix = 1;\n\t\t\tvar string1;\n\t\t\tstring1 = '{ ';\n\t\t\t\n\t\t\tvar shiptoCustId = rec.getFieldValue('custbody_end_user');\n\t\t\tvar CustomerId = rec.getFieldValue('entity');\n\t\t\tvar ShipToCustomerId = rec.getFieldValue('custbody_spk_shiptocustomerid');\n\t\t\tvar ShipToCustomerName = rec.getFieldValue('custbody_spk_shiptocustomername');\n\t\t\tif(ShipToCustomerName) {\n\t\t\t\tShipToCustomerName = escapeChar(rec.getFieldValue('custbody_spk_shiptocustomername'));\n\t\t\t}\n\t\t\tvar CustomerCode = rec.getFieldValue('custbody_spk_billtocustomerid');\n\t\t\tvar CustomerName = rec.getFieldValue('custbody_spk_billtocustomername');\n\t\t\tif(CustomerName) {\n\t\t\t\tCustomerName = escapeChar(rec.getFieldValue('custbody_spk_billtocustomername'));\n\t\t\t}\n\t\t\t\n\t\t\tvar createdfrom = rec.getFieldValue('createdfrom');\n\t\t\tnlapiLogExecution('DEBUG','createdfrom',createdfrom);\n\t\t\n\t\t\tvar ExemptionNo = rec.getFieldValue('tranid');\n\n\t\t\tvar FxRate = rec.getFieldValue('exchangerate');\n\t\t\t//For Non-US country, we need to consider Customer Registration Number for VAT calculation\n\t\t\tvar CustomerRegistrationNumber = \"\";\n\t\t\t\n\t\t\t//Ship From : Subsidiary Address\n\t\t\tvar AddressCode1 = \"01\";\n\t\t\tvar subsidiary = rec.getFieldValue('subsidiary');\n\t\t\tvar sub = rec.getFieldValue('custbody_spk_entity_address'); // TAX ENTITY ADDRESS\n\t\t\tvar subrec = sub.split('|');\n\t\t\tvar subcity = subrec[0];\n\t\t\tvar subregion = subrec[1];\n\t\t\tvar subcountry = subrec[2];\n\t\t\tvar subprovince = '';\n\t\t\tvar subcode = subrec[3];\n\t\t\tvar subcurrency = \"USD\" ; //subrec.getFieldValue('currency');\n\t\t\tnlapiLogExecution('DEBUG','subcity :'+subcity,' subregion :'+subregion+ ' subcountry :'+subcountry+ ' subprovince :'+subprovince+ ' subcode '+subcode );\n\t\t\t\n\t\t\t//Ship TO : Customer/Invoice Shipping Address\n\t\t\tvar AddressCode2 = \"02\";\n\t\t\tvar shipaddress = rec.getFieldValue('shipaddress');\n\t\t\tvar shiptocity = '';\n\t\t\tvar shiptoregion = '';\n\t\t\tvar shiptocountry = '';\n\t\t\tvar shiptocode = '';\n\t\t\tvar shiptoprovince = '';\n\t\t\tshiptocity = rec.getFieldValue('shipcity');\n\t\t\tshiptoregion = rec.getFieldValue('shipstate');\n\t\t\tshiptocountry = rec.getFieldValue('shipcountry');\n\t\t\tshiptocode = rec.getFieldValue('shipzip');\n\t\t\tnlapiLogExecution('DEBUG','shiptocity1 :'+shiptocity,' shiptoregion :'+shiptoregion+ ' shiptocountry :'+shiptocountry+ ' shiptocode :'+shiptocode+ ' shiptoprovince '+shiptoprovince );\n\t\t\t\n\t\t\tvar CompanyCode = rec.getFieldValue('custbody_spk_subsidiary_code');\n\t\t\tif(CompanyCode) {\n\t\t\t\tCompanyCode = CompanyCode;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCompanyCode = rec.getFieldValue('subsidiary');\n\t\t\t}\n\t\t\tif(CompanyCode) { CompanyCode = '\"'+CompanyCode+'\"';}\n\t\t\telse { CompanyCode = '\"\"'; }\n\t\t\tstring1+= '\"CompanyCode\": ' +CompanyCode;\n\t\t\t\n\t\t\tvar CompanyRole = \"S\";\n\t\t\tif(CompanyRole) { CompanyRole = '\"'+CompanyRole+'\"';}\n\t\t\telse { CompanyRole = '\"\"'; }\n\t\t\tstring1+= ', \"CompanyRole\": ' +CompanyRole;\n\n\t\t\tif (ShipToCustomerId) { ShipToCustomerId = '\"'+ShipToCustomerId+'\"'; }\n\t\t\telse { ShipToCustomerId = '\"\"'; }\n\t\t\tstring1+= ', \"ShipToCustomerId\": ' +ShipToCustomerId;\n\n\t\t\tif (ShipToCustomerName) { ShipToCustomerName = '\"'+ShipToCustomerName+'\"'; }\n\t\t\telse { ShipToCustomerName = '\"\"'; }\n\t\t\tstring1+= ', \"ShipToCustomerName\": ' +ShipToCustomerName;\n\t\t\t\n\t\t\tvar DocType = nlapiGetRecordType();\n\t\t\tif (DocType) { DocType = '\"'+DocType+'\"'; }\n\t\t\telse { DocType = '\"\"'; }\n\t\t\tstring1+= ', \"DocType\": ' +DocType;\n\t\t\t\n\t\t\tif (CustomerCode) { CustomerCode = '\"'+CustomerCode+'\"'; }\n\t\t\telse { CustomerCode = '\"\"'; }\n\t\t\tstring1+= ', \"CustomerCode\": ' +CustomerCode;\n\n\t\t\tif (CustomerName) { CustomerName = '\"'+CustomerName+'\"'; }\n\t\t\telse { CustomerName = '\"\"'; }\n\t\t\tstring1+= ', \"CustomerName\": ' +CustomerName;\n\t\t\t\n\t\t\tvar DocDateold = rec.getFieldValue('trandate');\n\t\t\tvar DocDate = '';\n\t\t\tif(DocDateold){\n\t\t\t\tvar docdatesplit = DocDateold.split(\"/\");\n\t\t\t\tDocDate = docdatesplit[2]+\"-\"+docdatesplit[0]+\"-\"+docdatesplit[1];\n\t\t\t}\n\t\t\tif (DocDate) { DocDate = '\"'+DocDate+'\"'; }\n\t\t\telse { DocDate = '\"\"'; }\n\t\t\tstring1+= ', \"DocDate\": ' +DocDate;\n\t\t\t\n\t\t\t//Fiscal Date is same as DocDate\n\t\t\tstring1+= ', \"FiscalDate\": '+DocDate;\n\t\t\t\n\t\t\tvar Client = \"NetSuite\";\n\t\t\tif (Client) { Client = '\"'+Client+'\"'; }\n\t\t\telse { Client = '\"\"'; }\n\t\t\tstring1+= ', \"Client\": ' +Client;\n\t\t\t\n\t\t\t// Invoice Number\n\t\t\tvar DocCode = rec.getFieldValue('tranid'); \n\t\t\tif (DocCode) { DocCode = '\"'+DocCode+'_'+nlapiGetRecordType()+'\"'; }\n\t\t\telse { DocCode = '\"\"'; }\n\t\t\tstring1+= ', \"DocCode\": ' +DocCode;\n\t\t\t\n\t\t\tvar Discount = rec.getFieldValue('discounttotal');\n\t\t\tif (Discount) { Discount = '\"'+Discount+'\"'; }\n\t\t\telse { Discount = '\"0\"'; }\n\t\t\tstring1+= ', \"Discount\": ' +Discount;\n\t\t\t\n\t\t\tvar CurrencyCode = subcurrency;\n\t\t\tif (CurrencyCode) { CurrencyCode = '\"'+CurrencyCode+'\"'; }\n\t\t\telse { CurrencyCode = '\"\"'; }\n\t\t\tstring1+= ', \"CurrencyCode\": ' +CurrencyCode;\n\t\t\t\n\t\t\t//After Submit set Is committed to Yes, so that the Unique TranId is created and submitted in Sabrix\n\t\t\tvar IsAudited = \"commit\";\n\t\t\tstring1+= ', \"IsCommit\": ' +'\"Y\"';\n\t\t\t\n\t\t\tvar OriginalInvoiceNumber = '';\n\t\t\tvar OriginalInvoiceDate = '';\n\t\t\tnlapiLogExecution('DEBUG', 'createdfrom1 '+createdfrom, 'DocType ' +DocType);\n\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\n\t\t\t\tvar refundRec = '';\n\t\t\t\tif(createdfrom && nlapiGetRecordType() == 'creditmemo') {\n\t\t\t\t\trefundRec = nlapiLoadRecord('invoice', createdfrom);\n\t\t\t\t}\n\t\t\t\tif(createdfrom && nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\t\trefundRec = nlapiLoadRecord('cashsale', createdfrom);\n\t\t\t\t}\n\t\t\t\tnlapiLogExecution('DEBUG', 'createdfrom '+createdfrom, 'refundRec ' +refundRec);\n\t\t\t\tif(refundRec) {\n\t\t\t\t\tOriginalInvoiceNumber = refundRec.getFieldValue('tranid');\n\t\t\t\t\tvar orgtranDate = refundRec.getFieldValue('trandate');\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'createdfrom '+createdfrom, 'OriginalInvoiceNumber ' +OriginalInvoiceNumber+ ' orgtranDate '+orgtranDate);\n\t\t\t\t\tif(orgtranDate) {\n\t\t\t\t\t\tvar orgtranDateSplit = orgtranDate.split(\"/\");\n\t\t\t\t\t\tvar OrgInvDate = orgtranDateSplit[2]+\"-\"+orgtranDateSplit[0]+\"-\"+orgtranDateSplit[1];\n\t\t\t\t\t\tOriginalInvoiceDate = OrgInvDate;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (OriginalInvoiceNumber) { OriginalInvoiceNumber = '\"'+OriginalInvoiceNumber+'\"'; }\n\t\t\telse { OriginalInvoiceNumber = '\"\"'; }\n\t\t\tstring1+= ', \"OriginalInvoiceNumber\": ' +OriginalInvoiceNumber;\n\t\t\t\n\t\t\tif (OriginalInvoiceDate) { OriginalInvoiceDate = '\"'+OriginalInvoiceDate+'\"'; }\n\t\t\telse { OriginalInvoiceDate = '\"\"'; }\n\t\t\tstring1+= ', \"OriginalInvoiceDate\": ' +OriginalInvoiceDate;\n\t\t\t\n\t\t\tvar InvoiceCurrency = rec.getFieldText('currency');\n\t\t\tif (InvoiceCurrency) { InvoiceCurrency = '\"'+InvoiceCurrency+'\"'; }\n\t\t\telse { InvoiceCurrency = '\"\"'; }\n\t\t\tstring1+= ', \"InvoiceCurrency\": ' +InvoiceCurrency;\n\t\t\t\n\t\t\tif (FxRate) { FxRate = '\"'+FxRate+'\"'; }\n\t\t\telse { FxRate = '\"\"';}\n\t\t\tstring1+= ', \"FxRate\": ' +FxRate;\n\t\t\t\n\t\t\tvar InvoiceAmount = rec.getFieldValue('subtotal');\n\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\tInvoiceAmount = parseFloat(InvoiceAmount * -1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tInvoiceAmount = InvoiceAmount;\n\t\t\t}\n\t\t\tif (InvoiceAmount) { InvoiceAmount = '\"'+InvoiceAmount+'\"'; }\n\t\t\telse { InvoiceAmount = '\"0\"'; }\n\t\t\tstring1+= ', \"InvoiceAmount\": ' +InvoiceAmount;\n\t\t\t\n\t\t\tif (CustomerRegistrationNumber){ CustomerRegistrationNumber = '\"'+CustomerRegistrationNumber+'\"'; }\n\t\t\telse { CustomerRegistrationNumber = '\"\"'; }\n\t\t\tstring1+= ', \"CustomerRegistrationNumber\": ' +CustomerRegistrationNumber;\n\t\t\t\n\t\t\tstring1+= ', \"Addresses\": [{ '\n\t\t\t\n\t\t\t//Ship From : Subsidiary Address\n\t\t\tif (AddressCode1){ AddressCode1 = '\"'+AddressCode1+'\"'; }\n\t\t\telse{ AddressCode1 = '\"\"'; }\n\t\t\tstring1+= '\"AddressCode\": ' +AddressCode1;\n\t\t\t\t\n\t\t\tif (subcity){ subcity = '\"'+subcity+'\"'; }\n\t\t\telse{ subcity = '\"\"'; }\n\t\t\tstring1+= ', \"City\": ' +subcity;\n\t\t\t\n\t\t\tif (subregion){ subregion = '\"'+subregion+'\"'; }\n\t\t\telse{ subregion = '\"\"'; }\n\t\t\tstring1+= ', \"Region\": ' +subregion;\n\t\t\t\n\t\t\tif (subcountry){ subcountry = '\"'+subcountry+'\"'; }\n\t\t\telse { subcountry = '\"\"'; }\n\t\t\tstring1+= ', \"Country\": ' +subcountry;\n\t\t\t\n\t\t\tif (subcode){ subcode = '\"'+subcode+'\"'; }\n\t\t\telse { subcode = '\"\"'; }\n\t\t\tstring1+= ', \"PostalCode\": ' +subcode;\n\t\t\t\n\t\t\tstring1+= ', \"Province\": \"\" ' ;\n\t\t\tstring1+= ' }, { '\n\t\t\t\n\t\t\t//Ship To : Invoice shipping Address\n\t\t\tif (AddressCode2){ AddressCode2 = '\"'+AddressCode2+'\"'; }\n\t\t\telse{ AddressCode2 = '\"\"'; }\n\t\t\tstring1+= '\"AddressCode\": ' +AddressCode2;\n\t\t\t\n\t\t\tif (shiptocity){ shiptocity = '\"'+shiptocity+'\"'; }\n\t\t\telse{ shiptocity = '\"\"'; }\n\t\t\tstring1+= ', \"City\": ' +shiptocity;\n\t\t\t\n\t\t\tif (shiptoregion){ shiptoregion = '\"'+shiptoregion+'\"'; }\n\t\t\telse{ shiptoregion = '\"\"'; }\n\t\t\tstring1+= ', \"Region\": ' +shiptoregion;\n\t\t\t\n\t\t\tif (shiptocountry){ shiptocountry = '\"'+shiptocountry+'\"'; }\n\t\t\telse{ shiptocountry = '\"\"'; }\n\t\t\tstring1+= ', \"Country\": ' +shiptocountry;\n\t\t\t\n\t\t\tif (shiptocode){ shiptocode = '\"'+shiptocode+'\"'; }\n\t\t\telse { shiptocode = '\"\"'; }\n\t\t\tstring1+= ', \"PostalCode\": ' +shiptocode;\n\t\t\t\n\t\t\tstring1+= ', \"Province\": \"\" ' ;\n\n\t\t\tstring1+= ' }], \"Lines\": [';\n\t\t\t//Tax calls should be made for rebillable expense invoices , checking item count- if zero then do not call sabrix request : Begin\n\t\t\tvar count = rec.getLineItemCount('item');\n\t\t\tif(count == 0 ) {\n\t\t\t\tcallsabrix = 0;\n\t\t\t} // End\n\t\t\telse {\n\t\t\t\tvar isin = 0;\n\t\t\t\tfor(i = 1;i < count+1; i++) {\n\t\t\t\t\tvar TaxCode = rec.getLineItemText('item','taxcode',i);\n\t\t\t\t\t// ENHC0051967- Dynamic validation of script parameters for tax codes editable - Begin\n\t\t\t\t\tvar isparamtaxcode = 0;\n\t\t\t\t\tif(sabrixTaxcode) {\n\t\t\t\t\t\tvar paramTaxcode = sabrixTaxcode.split(\",\");\n\t\t\t\t\t\tfor(var y = 0; y<=paramTaxcode.length; y++) {\n\t\t\t\t\t\t\tif(TaxCode == paramTaxcode[y]) {\n\t\t\t\t\t\t\t\tisparamtaxcode = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// ENHC0051967- End\n\t\t\t\t\t//nlapiLogExecution('DEBUG','TaxCode '+TaxCode, ' sabrixTaxcode '+sabrixTaxcode+ ' paramAvatax '+paramAvatax+ 'paramSabtax '+paramSabtax );\n\t\t\t\t\tnlapiLogExecution('DEBUG','TaxCode '+TaxCode, ' sabrixTaxcode '+sabrixTaxcode+ ' isparamtaxcode '+isparamtaxcode);\n\t\t\t\t\tvar ItemCodevalue = rec.getLineItemText('item','item',i);\n\t\t\t\t\tvar itemintId = rec.getLineItemValue('item','item',i);\n\t\t\t\t\tvar ItemCode = '';\n\t\t\t\t\tif(ItemCodevalue) {\n\t\t\t\t\t\tvar ItemCodeId = ItemCodevalue.split(\":\")[1];\n\t\t\t\t\t\tif(ItemCodeId) {\n\t\t\t\t\t\t\tItemCode = ItemCodeId;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tItemCode = ItemCodevalue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar istax = '';\n\t\t\t\t\tif (ItemCode != \"Description\" && isparamtaxcode == 1 ) {\n\t\t\t\t\t\tvar CommodityCode = rec.getLineItemValue('item','custcol_spk_commodity_taxcode',i);\n\t\t\t\t\t\tvar AccountingCode = rec.getLineItemValue('item','custcol_spk_itemincomeaccnum',i);\n\t\t\t\t\t\tnlapiLogExecution('DEBUG','CommodityCode',CommodityCode);\n\t\t\t\t\t\tvar BundleFlag = rec.getLineItemValue('item','custcol_bundle',i);\n\t\t\t\t\t\tvar BaseBundleCode = rec.getLineItemValue('item','custcol_spk_basebundlecode',i);\n\t\t\t\t\t\tvar Description = rec.getLineItemValue('item','description',i);\n\t\t\t\t\t\tif(Description) {\n\t\t\t\t\t\t\tDescription = escapeChar(rec.getLineItemValue('item','description',i));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar Qty = rec.getLineItemValue('item','quantity',i);\n\t\t\t\t\t\tvar Amount = rec.getLineItemValue('item','amount',i);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar UOM = \" \";\n\t\t\t\t\t\tif(isin == 1) {\n\t\t\t\t\t\tistax = ' ,{ ';\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tistax = ' { ';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisin = 1;\n\t\t\t\t\t\tvar LineNo = '\"'+i+'\"';\n\t\t\t\t\t\tstring1+= istax+'\"LineNo\": ' +LineNo;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (AccountingCode){ AccountingCode = '\"'+AccountingCode+'\"'; }\n\t\t\t\t\t\telse{ AccountingCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"AccountingCode\": ' +AccountingCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (CommodityCode){ CommodityCode = '\"'+CommodityCode+'\"'; }\n\t\t\t\t\t\telse{ CommodityCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"TaxCode\": ' +CommodityCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ItemCode){ ItemCode = '\"'+ItemCode+'\"'; }\n\t\t\t\t\t\telse{ ItemCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"ItemCode\": ' +ItemCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (BundleFlag == 'T') { BundleFlag = '\"Yes\"'; }\n\t\t\t\t\t\telse { BundleFlag = '\"No\"'; }\n\t\t\t\t\t\tstring1+= ', \"BundleFlag\": ' +BundleFlag;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (BaseBundleCode){ BaseBundleCode = '\"'+BaseBundleCode+'\"'; }\n\t\t\t\t\t\telse{ BaseBundleCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"BaseBundleCode\": ' +BaseBundleCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Description){ Description = '\"'+Description+'\"'; }\n\t\t\t\t\t\telse{ Description = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"Description\": ' +Description;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(Qty){ Qty = '\"'+Qty+'\"'; }\n\t\t\t\t\t\telse{ Qty = '\"0\"'; }\n\t\t\t\t\t\tstring1+= ', \"Qty\": ' +Qty;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar sfdcunitCost = rec.getLineItemValue('item','custcol_spk_sfdc_unit_cost',i);\n\t\t\t\t\t\tif(sfdcunitCost) {\n\t\t\t\t\t\t\tAmount = parseFloat(sfdcunitCost*Qty);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\t\t\t\tAmount = parseFloat(Amount * -1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tAmount = Amount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (Amount){ Amount = '\"'+Amount+'\"'; }\n\t\t\t\t\t\telse { Amount = '\"0\"'; }\n\t\t\t\t\t\tstring1+= ', \"Amount\": ' +Amount;\n\t\t\t\t\t\t\n\t\t\t\t\t\tstring1+= ', \"DiscountAmount\": \"0\" ';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (UOM){ UOM = '\"'+UOM+'\"'; }\n\t\t\t\t\t\telse{ UOM = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"UOM\": ' +UOM;\n\t\t\t\t\t\tstring1 = string1 + '}';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tstring1+= ']}'\n\t\t\t\n\t\t\tvar isSabrixError = rec.getFieldValue('custbody_spk_sabrixtaxerrorflag');\n\t\t\tvar traninternalId = ''\n\t\t\tnlapiLogExecution('DEBUG','String1',string1);\n\t\t\t\n\t\t\t//On edit call Sabrix Request to calculate tax only if certain fields are changed\n\t\t\tif(eventtype == 'edit') {\n\t\t\t\tcallsabrix = changeinFields(rec);\n\t\t\t\tif(isSabrixError == 'T') {\n\t\t\t\t\tcallsabrix = 1;\n\t\t\t\t}\n\t\t\t\tnlapiLogExecution('DEBUG','callsabrix',callsabrix);\n\t\t\t}\n\t\t\tif(DocType == 'invoice' && count == 0) {\n\t\t\t\tcallsabrix = 0;\n\t\t\t}\n\t\t\t if(callsabrix == 1) {\n\t\t\t\tnlapiLogExecution('DEBUG','After Submit current time Sabrix Request', new Date());\n\t\t\t\t//var sabrixurl = \"https://leadtoordersabrixstg.cloudhub.io/api/sabrix/calculateSalesTax\";\n\t\t\t\t//var authorizationHeader = 'Basic Y29yZXN2Y3VzZXI6Y29yZXN2Y3B3ZCEy';\t\t\n\t\t\n\t\t\t\tnlapiLogExecution('DEBUG','Auth Key '+authorizationHeader,' sabrixurl '+sabrixurl);\n\t\t\t\tvar header = new Array();\n\t\t\t\theader['Authorization'] = authorizationHeader;\n\t\t\t\theader['Accept'] = 'application/json';\n\t\t\t\theader['Content-Type'] = 'application/json';\n\t\t\t\tvar response = nlapiRequestURL(sabrixurl,string1,header,'POST');\n\t\t\t\tnlapiLogExecution('DEBUG','Response',response.getCode()+':::'+response.getBody());\n\t\t\t\tnlapiLogExecution('DEBUG','After Submit current time Sabrix Response', new Date());\n\t\t\t\tvar response_obj = JSON.parse(response.getBody());\n\t\t\t\tvar statuserrormsg = '';\n\t\t\t\tif(response.getCode() != '200'){\n\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrorflag','T');\n\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrormessage',response.getBody());\n\t\t\t\t}\n\t\t\t\tif(response.getCode() == '200'){\n\t\t\t\t\tvar successstr = response.getBody();\n\t\t\t\t\tif(successstr) {\n\t\t\t\t\t\tvar CalculationDirection = response_obj.CalculationDirection;\n\t\t\t\t\t\tnlapiLogExecution('DEBUG','CalculationDirection ', CalculationDirection);\t\n\t\t\t\t\t\tif(CalculationDirection == \"R\") {\n\t\t\t\t\t\t\trec.setFieldValue('taxamountoverride',0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar TotalTax = '';\n\t\t\t\t\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\t\t\t\t\tTotalTax = parseFloat(response_obj.TotalTax * -1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tTotalTax = response_obj.TotalTax;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar TaxRate ='';\n\t\t\t\t\t\t\tvar Taxableamt = '';\n\t\t\t\t\t\t\tif(response_obj.TaxLines) {\n\t\t\t\t\t\t\t\tfor(j=0; j < response_obj.TaxLines.length; j++) {\n\t\t\t\t\t\t\t\t\tvar taxLinesobj = response_obj.TaxLines[j];\n\t\t\t\t\t\t\t\t\tvar LineNo = taxLinesobj.LineNo;\n\t\t\t\t\t\t\t\t\tTaxRate = taxLinesobj.Rate;\n\t\t\t\t\t\t\t\t\tTaxableamt = taxLinesobj.Taxable;\n\t\t\t\t\t\t\t\t\tnlapiLogExecution('DEBUG','TaxRate '+TaxRate, ' Taxableamt '+Taxableamt);\t\n\t\t\t\t\t\t\t\t\trec.setLineItemValue('item','taxrate1',LineNo, parseFloat(TaxRate * 100));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trec.setFieldValue('taxamountoverride',TotalTax);\n\t\t\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrorflag','F');\n\t\t\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrormessage','');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttraninternalId = nlapiSubmitRecord(rec);\n\t\t\t\tnlapiLogExecution('DEBUG','traninternalId ', traninternalId);\t\n\t\t\t\t//Submit the Sabrix Integration Log Custom Record to keep track of Request and Response\n\t\t\t\tCreateSabrixLog(nlapiGetRecordType(),eventtype,string1,response.getBody(),traninternalId,response.getCode(),'T');\n\t\t\t} \n\t\t\t\n\t\t}\n\t}\n\tcatch(e) {\n\t\tvar syserror = '';\n\t\tif(e instanceof nlobjError) {\n\t\t\tnlapiLogExecution( 'ERROR', 'system error', e.getCode() + '\\n' + e.getDetails());\n\t\t\tsyserror = e.getCode() + '\\n' + e.getDetails();\n\t\t} \n\t\telse { \n\t\t\tsyserror = e.getCode() + '\\n' + e.getDetails();\n\t\t}\n\t\tnlapiSubmitField(nlapiGetRecordType(),nlapiGetRecordId(),['custbody_spk_sabrixtaxerrorflag','custbody_spk_sabrixtaxerrormessage'],['T', syserror]);\n\t\tCreateSabrixLog(nlapiGetRecordType(),eventtype,string1,response.getBody(),nlapiGetRecordId(),500, 'T');\n\t\tvar err = nlapiCreateError('Sabrix Error :', syserror);\n\t\tthrow err;\n\t}\n}", "function showQr() {\n new QRCode(qr,{\n text: `${name.value.toUpperCase()}\nNUMBER PLATE: ${plate.value.toUpperCase()}\nCHASSIS: ${chassis.value.toUpperCase()}\nhttp://www.npf.gov.ng/tinted/permit/index.index.php?abuja=${id.value}`,\n width: 300,\n height: 300,\n })\n }", "function jeu_attaquerCA(me,cattaquante){\n\t\tmy_logger((me?PROMPT_ME:PROMPT_IA)+cattaquante.nom+ \" inflige dégat CA\");\n\t\tif (me){\n\t\t\t//infliger les dégats à l'adversaire\t\t\t\n\t\t\tpv_adv = pv_adv-cattaquante.ATT;\n\t\t\t$(\"#vieadv\").html(pv_adv);\t\t\n\t\t}else{\n\t\t\t//infliger les dégats à ME\t\t\t\n\t\t\tpv_me = pv_me-cattaquante.ATT;\n\t\t\t$(\"#vieme\").html(pv_me);\t\t\t\t\n\t\t}\n\t }", "function Bandcamp() {}", "function bannerLateral250x250pos1Guia(){\n\tvar bannerLateral250x250pos1Guia=\"\";\n\tbannerLateral250x250pos1Guia=\"<div id='div-gpt-ad-1432586033521-0' style='height:250px; width:250px;'><script type='text/javascript'>googletag.cmd.push(function() { googletag.display('div-gpt-ad-1432586033521-0'); });</script></div>\";\n\treturn bannerLateral250x250pos1Guia;\n}", "function ConcertThis(Band) {\n\n if (!Band) {\n console.log (\"***ERROR*** No band specified\");\n return;\n\t} // if (!Band)\n\n if (DebugON) console.log (\"** In ConcertThis() \" + Band);\n\n axios.get(\"https://rest.bandsintown.com/artists/\"+Band+\"/events?app_id=codingbootcamp\").then(\n function (response) {\n\n var NumConcerts = response.data.length;\n\n // limit the listings to the 5 upcoming dates\n if (NumConcerts > 5)\n NumConcerts = 5;\n \n var Banner =\n \"--------------------------------------------------------------------\" +\n \"\\n C O N C E R T - T H I S\" +\n \"\\n--------------------------------------------------------------------\" +\n \"\\nBand or Artist: \" + Band;\n console.log(Banner);\n\n for (var i = 0; i < NumConcerts; i++) {\n // create concert results string\n var ConcertResults = \n \"\\nVenue Name: \" + response.data[i].venue.name +\n \"\\nVenue Location: \" + response.data[i].venue.city +\n \"\\nDate of the Event: \" + moment(response.data[i].datetime).format(\"MM/DD/YYYY\") +\n \"\\n--------------------------------------------------------------------\";\n console.log(ConcertResults);\n\n } // for\n\n }) // function(response)\n .catch(function (error) { // error handler\n console.log(\"axios.get Error: \" + error);\n }); // get.axios()\n\n} // ConcertThis()", "function ClickHabilidadeEspecial() {\n // TODO da pra melhorar.\n AtualizaGeral();\n}", "function jsuGoogleAnalPay(event){\n\tUnTip();\n\t// jsuGoToURL(JSU_SHORT_URL_DOWNLOAD_PAY +'.info' ,true);\n\tfeatureNotReady();\n}", "function disableUmaCart() {\n if (typeof utag_data.product_attribute !== undefined) {\n if (\n \"bookends|wine rack|candleholder|lantern|clock|box|tray|decorative dish\".indexOf(\n utag_data.product_attribute\n ) > -1\n ) {\n var queryUrl =\n \"https://brm-core-0.brsrvr.com/api/v1/core/?account_id=5221&auth_key=o5xlkgn7my5fmr5c&domain_key=livingspaces_com&request_id=fd8d6a02a5764b7995c600e766a38bda&url=%2fbr-checker&_br_uid_2=uid%253D4961390647524%253Av%253D11.8%253Ats%253D1463613117510%253Ahc%253D3145&ptype=other&request_type=search&q=%22\" +\n utag_data.product_id[0] +\n \"%22&start=0&rows=13&search_type=keyword&fl=title,pid,url,price,sale_price,reviews,reviews_count,thumb_image,brand\";\n\n window.$.get(queryUrl, function(data) {\n if (data.response.numFound > 0) {\n if (data.response.docs[0].brand === \"UMA ENTERPRISES, INC\") {\n if (utag_data.site_type === \"desktop\") {\n $(\".page\").prepend(\n \"<style>#product-detail-page-vue .button-group #btnAddToCart, #product-detail-page-vue .button-group .select-wrapper, #product-detail-page-vue .stock-info, #omniinventory{display:none!important} .add-product-to-cart .like-product > a{margin-left:0!important}</style>\"\n );\n $(\"#price-section\").after(\n '<span style=\"display:block; color:#b9170f; font-weight:600; margin-bottom:15px; font-size:14px\"><i class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></i>&nbsp;&nbsp;This product is unavailable due to COVID-19 disruptions</span>'\n );\n } else {\n $(\".page\").prepend(\n \"<style>#product-detail-page-vue > form.text-center, #product-detail-page-vue .stock-info, #omniinventory{display:none!important}</style>\"\n );\n $(\"#product-detail-page-vue\").after(\n '<span style=\"display:block; color:#b9170f; font-weight:600; margin-bottom:15px; font-size:13px\"><i class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></i>&nbsp;&nbsp;This product is unavailable due to COVID-19 disruptions</span>'\n );\n }\n }\n }\n });\n }\n }\n}", "function Bevy() {}", "function Emission() {\r\n const opts = {\r\n options: {\r\n chart: {\r\n fontFamily: chartFont,\r\n zoom: {\r\n enabled: false\r\n },\r\n },\r\n dataLabels: {\r\n enabled: false\r\n },\r\n stroke: {\r\n width: [5, 5, 3, 1],\r\n curve: 'straight',\r\n //curve: 'smooth'\r\n },\r\n title: {\r\n text: 'CO₂ global share by fuel type per year',\r\n align: 'left',\r\n style: titleStyle\r\n },\r\n subtitle: {\r\n text: 'Source: BP Statistical Review of Global Energy'\r\n },\r\n markers: {\r\n size: 0,\r\n hover: {\r\n sizeOffset: 6\r\n }\r\n },\r\n xaxis: {\r\n categories: res_df.emission.years,\r\n type: 'category',\r\n labels: {\r\n //rotate: 0,\r\n trim: true\r\n },\r\n tickAmount: 10\r\n },\r\n yaxis: {\r\n max: 100,\r\n title: {\r\n text: 'CO₂ industry share, %',\r\n },\r\n labels: {\r\n formatter: function(val, opt) {\r\n return round(val);\r\n }\r\n }\r\n },\r\n annotations: {\r\n xaxis: [\r\n {\r\n x: 1914,\r\n strokeDashArray: 0,\r\n borderColor: '#775DD0',\r\n label: {\r\n borderColor: '#775DD0',\r\n style: {\r\n color: '#fff',\r\n background: '#775DD0',\r\n },\r\n text: '1914 World War I',\r\n }\r\n }, {\r\n x: 1939,\r\n strokeDashArray: 0,\r\n borderColor: '#775DD0',\r\n label: {\r\n borderColor: '#775DD0',\r\n style: {\r\n color: '#fff',\r\n background: '#775DD0',\r\n },\r\n text: '1939 World War II',\r\n }\r\n }, {\r\n x: 1973,\r\n strokeDashArray: 0,\r\n borderColor: '#775DD0',\r\n label: {\r\n borderColor: '#775DD0',\r\n style: {\r\n color: '#fff',\r\n background: '#775DD0',\r\n },\r\n text: '1973 oil crisis',\r\n }\r\n }, {\r\n x: 1986,\r\n strokeDashArray: 0,\r\n borderColor: '#775DD0',\r\n label: {\r\n borderColor: '#775DD0',\r\n style: {\r\n color: '#fff',\r\n background: '#775DD0',\r\n },\r\n text: '1986 oil price collapse',\r\n }\r\n }, {\r\n x: 2004,\r\n strokeDashArray: 0,\r\n borderColor: '#775DD0',\r\n label: {\r\n borderColor: '#775DD0',\r\n style: {\r\n color: '#fff',\r\n background: '#775DD0',\r\n },\r\n text: '2004 oil price surge',\r\n }\r\n }\r\n ]\r\n },\r\n tooltip: {\r\n y: {\r\n formatter: function(val, { series, seriesIndex, dataPointIndex, w }) {\r\n const e = w.config.series[seriesIndex].emission[dataPointIndex];\r\n\r\n return `${val}% (${e} Megatonnes/y)`;\r\n }\r\n }\r\n },\r\n grid: {\r\n borderColor: '#f1f1f1'\r\n }\r\n },\r\n series: res_df.emission.series\r\n }\r\n\r\n return (\r\n <ReactApexChart options={opts.options} series={opts.series} type='line' height={500} />\r\n );\r\n}", "function getAveGymQual() {\n\tvar totalB=0\n\tvar totalb=0\n\tfor (var i=0; i<gymQuant.length; i++) {\n\t\tif (gymQuant[i]===1) {\n\t\t\ttotalb=totalb+1\n\t\t\ttotalB=totalB+gymQual[i]\n\t\t}\n\t}\n\taveGymQual=Math.round((totalB/totalb)*10)/10\n\t$(\"#aveGymQual\").html(aveGymQual)\n}", "function credit_redeem_chart() {\n let rewards_data = document.getElementById(\"rewards_data\");\n\n if (rewards_data) {\n rewards_data = rewards_data.getAttribute(\"data-value\");\n\n let rewards = JSON.parse(rewards_data);\n\n let credits = [];\n let redeem = [];\n\n for (let i in rewards) {\n credits.push(rewards[i][\"credits\"]);\n redeem.push(rewards[i][\"redeem\"]);\n }\n\n const apexChart = \"#rewards_chart\";\n var options = {\n series: [\n {\n name: \"Credit\",\n data: credits,\n },\n {\n name: \"Redeem\",\n data: redeem,\n },\n ],\n chart: {\n type: \"bar\",\n height: 350,\n },\n plotOptions: {\n bar: {\n horizontal: false,\n columnWidth: \"55%\",\n endingShape: \"rounded\",\n },\n },\n dataLabels: {\n enabled: false,\n },\n stroke: {\n show: true,\n width: 2,\n colors: [\"transparent\"],\n },\n xaxis: {\n categories: Object.keys(rewards),\n },\n yaxis: {\n title: {\n text: \"Points\",\n },\n },\n fill: {\n opacity: 1,\n },\n tooltip: {\n y: {\n formatter: function (val) {\n return val + \" points\";\n },\n },\n },\n colors: [primary, success, warning],\n };\n\n var chart = new ApexCharts(document.querySelector(apexChart), options);\n chart.render();\n }\n}", "function Artyom() {\r\n this.ArtyomCommands = [];\r\n this.ArtyomVoicesIdentifiers = {\r\n // German\r\n \"de-DE\": [\"Google Deutsch\", \"de-DE\", \"de_DE\"],\r\n // Spanish\r\n \"es-ES\": [\"Google español\", \"es-ES\", \"es_ES\", \"es-MX\", \"es_MX\"],\r\n // Italian\r\n \"it-IT\": [\"Google italiano\", \"it-IT\", \"it_IT\"],\r\n // Japanese\r\n \"jp-JP\": [\"Google 日本人\", \"ja-JP\", \"ja_JP\"],\r\n // English USA\r\n \"en-US\": [\"Google US English\", \"en-US\", \"en_US\"],\r\n // English UK\r\n \"en-GB\": [\"Google UK English Male\", \"Google UK English Female\", \"en-GB\", \"en_GB\"],\r\n // Brazilian Portuguese\r\n \"pt-BR\": [\"Google português do Brasil\", \"pt-PT\", \"pt-BR\", \"pt_PT\", \"pt_BR\"],\r\n // Portugal Portuguese\r\n // Note: in desktop, there's no voice for portugal Portuguese\r\n \"pt-PT\": [\"Google português do Brasil\", \"pt-PT\", \"pt_PT\"],\r\n // Russian\r\n \"ru-RU\": [\"Google русский\", \"ru-RU\", \"ru_RU\"],\r\n // Dutch (holland)\r\n \"nl-NL\": [\"Google Nederlands\", \"nl-NL\", \"nl_NL\"],\r\n // French\r\n \"fr-FR\": [\"Google français\", \"fr-FR\", \"fr_FR\"],\r\n // Polish\r\n \"pl-PL\": [\"Google polski\", \"pl-PL\", \"pl_PL\"],\r\n // Indonesian\r\n \"id-ID\": [\"Google Bahasa Indonesia\", \"id-ID\", \"id_ID\"],\r\n // Hindi\r\n \"hi-IN\": [\"Google हिन्दी\", \"hi-IN\", \"hi_IN\"],\r\n // Mandarin Chinese\r\n \"zh-CN\": [\"Google 普通话(中国大陆)\", \"zh-CN\", \"zh_CN\"],\r\n // Cantonese Chinese\r\n \"zh-HK\": [\"Google 粤語(香港)\", \"zh-HK\", \"zh_HK\"],\r\n // Native voice\r\n \"native\": [\"native\"]\r\n };\r\n // Important: retrieve the voices of the browser as soon as possible.\r\n // Normally, the execution of speechSynthesis.getVoices will return at the first time an empty array.\r\n if (window.hasOwnProperty('speechSynthesis')) {\r\n speechSynthesis.getVoices();\r\n }\r\n else {\r\n console.error(\"Artyom.js can't speak without the Speech Synthesis API.\");\r\n }\r\n // This instance of webkitSpeechRecognition is the one used by Artyom.\r\n if (window.hasOwnProperty('webkitSpeechRecognition')) {\r\n this.ArtyomWebkitSpeechRecognition = new window.webkitSpeechRecognition();\r\n }\r\n else {\r\n console.error(\"Artyom.js can't recognize voice without the Speech Recognition API.\");\r\n }\r\n this.ArtyomProperties = {\r\n lang: 'en-GB',\r\n recognizing: false,\r\n continuous: false,\r\n speed: 1,\r\n volume: 1,\r\n listen: false,\r\n mode: \"normal\",\r\n debug: false,\r\n helpers: {\r\n redirectRecognizedTextOutput: null,\r\n remoteProcessorHandler: null,\r\n lastSay: null,\r\n fatalityPromiseCallback: null\r\n },\r\n executionKeyword: null,\r\n obeyKeyword: null,\r\n speaking: false,\r\n obeying: true,\r\n soundex: false,\r\n name: null\r\n };\r\n this.ArtyomGarbageCollection = [];\r\n this.ArtyomFlags = {\r\n restartRecognition: false\r\n };\r\n this.ArtyomGlobalEvents = {\r\n ERROR: \"ERROR\",\r\n SPEECH_SYNTHESIS_START: \"SPEECH_SYNTHESIS_START\",\r\n SPEECH_SYNTHESIS_END: \"SPEECH_SYNTHESIS_END\",\r\n TEXT_RECOGNIZED: \"TEXT_RECOGNIZED\",\r\n COMMAND_RECOGNITION_START: \"COMMAND_RECOGNITION_START\",\r\n COMMAND_RECOGNITION_END: \"COMMAND_RECOGNITION_END\",\r\n COMMAND_MATCHED: \"COMMAND_MATCHED\",\r\n NOT_COMMAND_MATCHED: \"NOT_COMMAND_MATCHED\"\r\n };\r\n this.Device = {\r\n isMobile: false,\r\n isChrome: true\r\n };\r\n if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)) {\r\n this.Device.isMobile = true;\r\n }\r\n if (navigator.userAgent.indexOf(\"Chrome\") == -1) {\r\n this.Device.isChrome = false;\r\n }\r\n /**\r\n * The default voice of Artyom in the Desktop. In mobile, you will need to initialize (or force the language)\r\n * with a language code in order to find an available voice in the device, otherwise it will use the native voice.\r\n */\r\n this.ArtyomVoice = {\r\n default: false,\r\n lang: \"en-GB\",\r\n localService: false,\r\n name: \"Google UK English Male\",\r\n voiceURI: \"Google UK English Male\"\r\n };\r\n }", "function MaidQuartersBecomMaid() {\n\tInventoryAdd(Player, \"MaidOutfit1\", \"Cloth\");\n\tInventoryAdd(Player, \"MaidHairband1\", \"Hat\");\n\tInventoryWear(Player, \"MaidOutfit1\", \"Cloth\", \"Default\");\n\tInventoryWear(Player, \"MaidHairband1\", \"Hat\", \"Default\");\n\tCharacterAppearanceValidate(Player);\n\tLogAdd(\"JoinedSorority\", \"Maid\");\n\tReputationProgress(\"Dominant\", MaidQuartersDominantRep);\n\tMaidQuartersCanBecomeMaid = false;\n\tMaidQuartersIsMaid = true;\n}", "verifyCartPage() {\n let householdIndex = (global.updateDataJson.households.length === 0) ? 0 : global.updateDataJson.households.length-1;\n commonfunc.verifyCartDetails(global.updateDataJson.households[householdIndex].healthPlan, global.updateDataJson.households[householdIndex].dentalPlan);\n }", "function buyBarq() {\r\n if(player.gold.num >= player.barquentine.price && player.influence >= player.barquentine.infMin) {\r\n player.barquentine.num++;\r\n player.gold.num -= player.barquentine.price;\r\n player.influence += player.barquentine.influence;\r\n player.barquentine.income = player.barquentine.num * player.barquentine.gain;\r\n gameLog('A handsome vessel, perfect for bein\\' \"civil\".');\r\n } else {\r\n gameLog('Keep an eye on yer resources, Cap\\'n!')\r\n };\r\n player.barquentine.price = Math.floor(12550 * Math.pow(1.13, player.barquentine.num));\r\n document.getElementById('barqCost').innerHTML = player.barquentine.price;\r\n document.getElementById('barqNum').innerHTML = player.barquentine.num;\r\n document.getElementById('barqGain').innerHTML = player.barquentine.income;\r\n document.getElementById('barqInf').innerHTML = player.barquentine.influence;\r\n document.getElementById('gold').innerHTML = player.gold.num;\r\n document.getElementById('influence').innerHTML = player.influence;\r\n}", "function onShowContracts(){\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClause(\"eq.eq_id\",$(\"wr.eq_id\").value,'=');\n\tView.openDialog(\"ab-helpdesk-request-equipment.axvw\", restriction, false); \n}", "function BusinessIntelligenceCheck(){}", "copperEligibilityByAddress() {\n return this.testAddress()\n .then(({ result }) => ({ result }))\n .catch((error) => {\n this.loading = false;\n this.TucToast.error(error);\n });\n }", "onClickAddDefaultShippingLogGA(breadCrumb, productName) {\n const { gtmDataLayer } = this.props;\n const removeAcademyLabel = {\n removeAcademyLabel: true\n };\n gtmDataLayer.push({\n event: 'pdpDetailClick',\n eventCategory: 'pdp interactions',\n eventAction: 'pdp|add a default payment option',\n eventLabel: `${printBreadCrumb([...breadCrumb, productName], removeAcademyLabel)}`.toLowerCase()\n });\n }", "function infoBeritaCovid(agent) {\n return axios({\n method: \"get\",\n url: \"https://dekontaminasi.com/api/id/covid19/news\",\n }).then((data) => {\n var random = Math.floor(Math.random() * data.data.length) + 1;\n var tanggal = new Date(data.data[random].timestamp).toLocaleDateString(\n \"id\"\n );\n agent.add(\n \"Judul Berita : \" +\n data.data[random].title +\n \"\\n\\n\" +\n \"link : \" +\n data.data[random].url +\n \"\\n\\n\" +\n \"Tanggal \" +\n tanggal +\n \"\\n\\n\" +\n \"Sumber API : https://dekontaminasi.com/api/id/covid19/news\"\n );\n });\n }", "function karinaFaarNotifikation() {\n\n\n\n}", "function doCbaam() {\n init();\n if (isArmenianworkingday()) {\n //read RSS\n root = getFeedDocument(input_cbaam_feedurl);\n\n if (root !== false) {\n //get the items of interest\n var items = root.getChild('channel').getChildren('item');\n\n for (var i in items) {\n\n data = datatemplate;\n\n data.id = items[i].getChild('guid').getValue();\n data.title = items[i].getChild('title').getText();\n data.date = new Date(items[i].getChild('pubDate').getText());\n data.rate = parseFloat(myGetNthElementFromSplitText(items[i], \"title\", \" - \", 2));\n data.multiplier = myGetNthElementFromSplitText(items[i], \"title\", \" - \", 1);\n data.currency = myGetNthElementFromSplitText(items[i], \"title\", \" - \", 0);\n\n //attempt to insert only selected currencies\n if (process_cbaam_currencies.indexOf(data.currency) >= 0) {\n appendRowIfNotExists(output_spreadsheetId, output_cbaam_sheetname, data, 'AMD');\n }\n }\n }\n }//end if isArmenianworkingday()\n}", "get approveCoGatewayGas() {\n return 50000;\n }", "static updateStockBarang(stock) {\n this.#stockBarang = stock;\n }", "function advertise_status()\n{\n\n\t if(earthnc_getUrlVariable('em'))\n\t {\n\n\t\tshow('advert_inner');\n\t }\n\t else\n\t {\n\n\t\t show('advert_inner');\n\n\t }\n\n}", "function lexaBrain (service, search) {\n let queryUrl =\"\";\n switch (service){\n case \"spotify-this-song\":\n\n //checking to see if a song was provide, if not defaults to the sign\n let spotifySearch = \"\";\n if(search===\"\"){\n spotifySearch=\"the+sign\"\n }else{\n spotifySearch=search;\n }\n\n //call out to spotify for 5 results.\n spotify.search({ \n type: 'track', query: spotifySearch, limit: 5\n }).then(function(response) {\n\n //checking to see if any items in response, if none let user know\n if(response.track.items.length===0){\n console.log(\"No song by that name found.\")\n }\n //each song sent back, we print out the info for it.\n response.tracks.items.forEach(function(result){\n console.log();\n console.log (\"Artist(s): \"+result.artists[0].name);\n console.log (\"Song Title: \"+result.name);\n console.log (\"Album: \"+result.album.name);\n console.log (\"On Spotify: \"+result.external_urls.spotify);\n })\n \n })\n //incase something goes wrong\n .catch(function(err) {\n console.log(\"No song by that name found\");\n });\n break;\n\n case \"concert-this\":\n //using axios to call out to bandsintown and get back results\n queryUrl = \"https://rest.bandsintown.com/artists/\" + search + \"/events?app_id=codingbootcamp\";\n axios.get(queryUrl.replace(\"+\", \" \")).then(function(response){\n\n if(response.data.length === 0){\n console.log (\"No band by that name found.\");\n }\n\n //for each gig a band has, print out the info\n response.data.forEach(function(gig){\n let date = gig.datetime.split(\"T\");\n let formatedDate = moment(date[0]).format(\"MM/DD/YYYY\");\n let venue = gig.venue\n console.log(`\n Venue name: ${venue.name}\n Location: ${venue.city}, ${venue.region}, ${venue.country}\n Date of show: ${formatedDate} \n `)\n });\n })\n //if something goes wrong...\n .catch(function(err){\n console.log (\"Band not found\");\n });\n break;\n\n case \"movie-this\":\n queryUrl = \"http://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\";\n axios.get(queryUrl).then(function(response) {\n let movie = response.data\n if (movie.length === 0){\n console.log(\"No movie by that name found\");\n }\n console.log(`\n Movie Title: ${movie.Title}\n Release Date: ${movie.Released}\n IMDB Rating: ${movie.imdbRating}\n Rotten T: ${movie.Ratings[1].Value}\n Country of O: ${movie.Country}\n Language: ${movie.Language}\n Movie Plot: ${movie.Plot}\n Actors: ${movie.Actors}\n `)\n })\n //incase something goes wrong.\n .catch(function(err){\n console.log(\"No movies by that name found\");\n });\n break;\n case \"do-what-it-says\":\n console.log(\"FreeStyle huh?...lets see....\");\n //reading my file and getting its contents\n fs.readFile(\"random.txt\", \"utf8\", function(err, data) {\n if(err){\n console.log(\"I wasn't able to read that...\")\n }\n console.log(data);\n //removes \"\" around song name, then splits the command in two. one for command. one for searchterm.\n let response = data.replace(/\"+/g, '').split(\",\");;\n lexaBrain(response[0],response[1]);\n });\n break;\n default:\n console.log(\"I havent been programmed to do that yet...\");\n break;\n }\n}", "function replaceContractComm(obj, kbn) {\r\n\tif (kbn==1) {\r\n\t\tobj.innerHTML=obj.innerHTML.replace(/(>[\\w ]* )obligations:</,\"$1(甲方) 义务:<\");\r\n\t} else {\r\n\t\tif (kbn==2) {\r\n\t\t\tobj.innerHTML=obj.innerHTML.replace(/Dummy citizen obligations:/,\"某人 (乙方) 义务:\")\r\n\t\t\tobj.innerHTML=obj.innerHTML.replace(/Dummy citizen/g,\"某人(乙方)\");\r\n\t\t} else {\r\n\t\t\tobj.innerHTML=obj.innerHTML.replace(/(>[\\w ]* )obligations:</,\"$1(乙方) 义务:<\")\r\n\t\t}\r\n\t}\r\n\t\r\n\tobj.innerHTML=obj.innerHTML.replace(/ will instantly donate the following products:/,\" 将会立即交易给对方下列物品(双方同意后):\");\r\n\tobj.innerHTML=obj.innerHTML.replace(/ will instantly donate the following sum of money:/,\" 将会立即交易给对方下列货币(双方同意后):\");\r\n\tobj.innerHTML=obj.innerHTML.replace(/ will be charged with following debt:/,\" 将会背负下列债务(双方同意后):\");\r\n\tobj.innerHTML=obj.innerHTML.replace(\r\n\t\t/must be paid([\\d\\D\\n\\r]*?)by([\\D\\n\\r]*?)(\\d*)([ \\t\\n\\r]*?)game day([\\D\\n\\r]*?)\\(within (\\d*) days since signing the contract \\) to/g,\r\n\t\t\"必须在$1第$2$3$4个游戏日之前$5(从贷款合同成立开$6天内)付给\"\r\n\t);\r\n}", "function toPay(){\n \n}", "function britainFilter(items){\n return items.currency_code !== \"USD\";\n }", "function concertThis(band){\n //console.log(\"Concert This\");\n\n axios.get(\"https://rest.bandsintown.com/artists/\"+band+\"/events?app_id=\"+bandsintown).then(\n results => {\n console.log(\"Name of the venue: \" + results.data[0].venue.name);\n console.log(\"Venue Location: \" \n + results.data[0].venue.city + \", \" \n + results.data[0].venue.region + \", \" \n + results.data[0].venue.country);\n console.log(\"Date of the Event: \" \n + moment(results.data[0].datetime, moment.HTML5_FMT.DATETIME_LOCAL_SECONDS).format(\"MM/DD/YYYY\"));\n },\n err => {\n console.log(err);\n }\n );\n}", "get hint() {\n if (super.hint) {\n return super.hint;\n }\n const berries = this.fieldBerries.map((fb) => BerryType[fb.berry]).join(', ');\n return `Legends tell of a mysterious Berry that only appears in a field of ${berries} Berries.`;\n }", "verifyBananaAdvancedVersion() {\n if (!this.banDocument)\n return false;\n\n if (!Banana.application.license || Banana.application.license.licenseType !== \"advanced\") {\n var lang = this.getLang();\n var msg = \"This extension requires Banana Accounting+ Advanced\";\n this.banDocument.addMessage(msg, \"ID_ERR_LICENSE_NOTVALID\");\n return false;\n }\n\n return true;\n }", "function benefitOptionText() { \n return gapPlanData.benefitOption();\n}", "function infoHoaxCovid(agent) {\n return axios({\n method: \"get\",\n url: \"https://dekontaminasi.com/api/id/covid19/hoaxes\",\n }).then((data) => {\n var random = Math.floor(Math.random() * data.data.length) + 1;\n var tanggal = new Date(data.data[random].timestamp).toLocaleDateString(\n \"id\"\n );\n agent.add(\n \"Judul Berita : \" +\n data.data[random].title +\n \"\\n\" +\n \"link : \" +\n data.data[random].url +\n \"\\n\" +\n \"Tanggal \" +\n tanggal +\n \"\\n\" +\n \"Sumber API : https://dekontaminasi.com/api/id/covid19/hoaxes\"\n );\n });\n }", "async getTransactionInfo() {\n const email = this.getEmail();\n const bills = await this.service.bills.query(['*'], { email });\n this.response(200, bills);\n }", "static getFbucksInfo() {\n return `purchase/customer/credit/info`\n }", "function ba(a,b){this.id=a;this.lang=b||\"unknown\";this.enabled=this.active=!1}", "getCrowdsale() {\n return axios.get('contract-builder/template/contracts/Crowdsale.sol')\n .then((response) => {\n return response.data\n })\n }", "bandelall() {\n\n }", "function marketBuy () {\n\n}", "function AtDCore(){this.ignore_types=[\"Bias Language\",\"Cliches\",\"Complex Expression\",\"Diacritical Marks\",\"Double Negatives\",\"Hidden Verbs\",\"Jargon Language\",\"Passive voice\",\"Phrases to Avoid\",\"Redundant Expression\"];this.ignore_strings={};this.i18n={}}", "function printQAs() {\n \n h3q1.textContent = questions[currentQuestion];\n correctAnswer = answerSet[currentQuestion].correct;\n \n //fill in the answers and set bingo to true for the correct answer\n for(var j=0; j<4; j++) {\n btns[j].textContent = answerSet[currentQuestion].answers[j];\n if (j == correctAnswer) {\n btns[j].setAttribute(\"bingo\",\"true\");\n }\n } \n}", "function displayConsent() {\n image(notebook_pic,width/2,height/2);\n \n push(); textStyle(ITALIC); textSize(30);\n text(\"Informed Consent for Experimental Participants\",42,100); pop();\n\n text(\"Researchers:\",42,150); \n text(\"Vanessa Ferdinand, Charles Kemp, Amy Perfors\",200,150); \n text(\"Affiliation:\",42,180);\n text(\"Melbourne School of Psychological Sciences\",200,180);\n\n text(\"The consent form is located on the HIT page. Please read it carefully.\\\n \\n\\nIf you have any questions, please email us at [email protected]\",42,270);\n\n text(\"Tick these boxes to affirm that:\",42,450);\n \n text(\"I have read and understood the consent form\",100,490);\n text(\"I am at least 18 years old\",100,520);\n text(\"I agree to participate in this study\",100,550);\n \n checkBox(76,482,20,20,check1);\n checkBox(76,512,20,20,check2);\n checkBox(76,542,20,20,check3);\n \n if (check1 && check2 && check3 === true) {\n allChecked = true;\n }\n}", "static requestCorpoboyaca() {\n return GeoServerAPI.requestWFSBiotablero('Corpoboyaca-Biomas-IaVH-1');\n }", "function haveFullPlatinumBonus() {\n return getPlatinum() >= 30;\n}", "function avancer_boule3(c) {\n\tif (cercles[c][3] == 0) {\n\t\tcreer_cercle(c);\t\t\t\t/* si la boule a été attrapée */\n\t} else {\n\t\tif (cercles[c][0] > 1000) {\n\t\t\tif (cercles[c][5] == 1) {\t\t/* si une boule bleue arrive au bout*/\n\t\t\t\tcontinuer = false;\n\t\t\t} else {\n\t\t\t\tcreer_cercle(c);\t\t/* si une boule d'une autre couleur arrive au bout */\n\t\t\t}\n\t\t} else {\n\t\tcercles[c][0] = cercles[c][0]+cercles[c][4];\t/* abscisse = abscisse + vitesse */\n\t\t}\n\t}\n}", "constructor(pointValue) {\n var params = {\n 'name': 'Buy',\n 'hasVig': true\n };\n super(params);\n this.pointMarked(pointValue);\n }", "function activate() {\n scope.bankAccount.accountHolderType = 'individual';\n\n if (scope.defaultSource !== undefined) {\n if (!scope.defaultSource.bank_account) {\n scope.resetDefaultBankPlaceholderValues();\n } else if (scope.defaultSource.bank_account.last4) {\n scope.bankAccount.account = '';\n scope.bankAccount.accountHolderName = '';\n scope.bankAccount.accountHolderType = scope.defaultSource.bank_account.accountHolderType || 'individual';\n scope.bankAccount.routing = '';\n\n scope.defaultBankPlaceholderValues = {\n accountHolderName: scope.defaultSource.bank_account.accountHolderName,\n accountHolderType: scope.defaultSource.bank_account.accountHolderType,\n routing: scope.defaultSource.bank_account.routing,\n maskedAccount: 'XXXXXXXXXXX' + scope.defaultSource.bank_account.last4\n };\n }\n }\n }", "function getCompany()\n{\n if(!preferences.get())return;\n var preferencesAux = eval(\"(\" + preferences.get() + ')');\n var tagsAux = preferencesAux.enterprise;\n var t = \"\";\n for (var k = 0; k < tagsAux.length; k++) \n\tt += tagsAux[k];\n getQuoteEnterprise([companyNameSlot.get()], [t]);\n}", "function getQrCode () {\n\n}", "onAccountClick() {\n const { cms } = this.props;\n const label = this.state.guest ? cms.createAccount : cms.seeMyAccount;\n\n this.pushAnalytics(label);\n }", "function question3 () {\n // Answer:\n for (let product=0; product<data.length; product++) {\n if (data[product].currency_code===\"GBP\"){\n console.log(data[product].title + \" costs \" + data[product].price + \" pounds.\");\n }\n }\n}", "function question3() {\n // Answer:\n let gBP_code;\n for (let i = 0; i < data.length; i++) {\n if (data[i].currency_code === \"GBP\") {\n gBP_code = data[i];\n }\n }\n console.log(gBP_code.title + \" $\" + gBP_code.price);\n}", "function Client(_a) {\r\n var _this = this;\r\n var _b = _a.network, network = _b === void 0 ? 'testnet' : _b, phrase = _a.phrase;\r\n this.phrase = '';\r\n this.address = '';\r\n this.privateKey = null;\r\n this.getClientUrl = function () {\r\n return _this.network === 'testnet' ? 'https://testnet-dex.binance.org' : 'https://dex.binance.org';\r\n };\r\n this.getExplorerUrl = function () {\r\n return _this.network === 'testnet' ? 'https://testnet-explorer.binance.org' : 'https://explorer.binance.org';\r\n };\r\n this.getExplorerAddressUrl = function (address) {\r\n return _this.getExplorerUrl() + \"/address/\" + address;\r\n };\r\n this.getExplorerTxUrl = function (txID) {\r\n return _this.getExplorerUrl() + \"/tx/\" + txID;\r\n };\r\n this.getPrefix = function () {\r\n return _this.network === 'testnet' ? 'tbnb' : 'bnb';\r\n };\r\n this.setPhrase = function (phrase) {\r\n if (!_this.phrase || _this.phrase !== phrase) {\r\n if (!validatePhrase(phrase)) {\r\n throw new Error('Invalid BIP39 phrase');\r\n }\r\n _this.phrase = phrase;\r\n _this.privateKey = null;\r\n _this.address = '';\r\n }\r\n return _this.getAddress();\r\n };\r\n /**\r\n * @private\r\n * Returns private key\r\n * Throws an error if phrase has not been set before\r\n * */\r\n this.getPrivateKey = function () {\r\n if (!_this.privateKey) {\r\n if (!_this.phrase)\r\n throw new Error('Phrase not set');\r\n _this.privateKey = getPrivateKeyFromMnemonic(_this.phrase);\r\n }\r\n return _this.privateKey;\r\n };\r\n this.getAddress = function () {\r\n if (!_this.address) {\r\n var address = getAddressFromPrivateKey(_this.getPrivateKey(), _this.getPrefix());\r\n if (!address) {\r\n throw new Error('address not defined');\r\n }\r\n _this.address = address;\r\n }\r\n return _this.address;\r\n };\r\n this.validateAddress = function (address) {\r\n return _this.bncClient.checkAddress(address, _this.getPrefix());\r\n };\r\n this.getBalance = function (address, asset) { return __awaiter(_this, void 0, void 0, function () {\r\n var balances, error_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!address) {\r\n address = this.getAddress();\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 4, , 5]);\r\n return [4 /*yield*/, this.bncClient.initChain()];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, this.bncClient.getBalance(address)];\r\n case 3:\r\n balances = _a.sent();\r\n return [2 /*return*/, balances.map(function (balance) {\r\n return {\r\n asset: assetFromString(balance.symbol) || AssetBNB,\r\n amount: assetToBase(assetAmount(balance.free, 8)),\r\n frozenAmount: assetToBase(assetAmount(balance.frozen, 8)),\r\n };\r\n }).filter(function (balance) { return !asset || balance.asset === asset; })];\r\n case 4:\r\n error_1 = _a.sent();\r\n return [2 /*return*/, Promise.reject(error_1)];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n this.getTransactions = function (params) { return __awaiter(_this, void 0, void 0, function () {\r\n var clientUrl, url, txHistory, error_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.bncClient.initChain()];\r\n case 1:\r\n _a.sent();\r\n clientUrl = this.getClientUrl() + \"/api/v1/transactions\";\r\n url = new URL(clientUrl);\r\n url.searchParams.set('address', params ? params.address : this.getAddress());\r\n if (params && params.limit) {\r\n url.searchParams.set('limit', params.limit.toString());\r\n }\r\n if (params && params.offset) {\r\n url.searchParams.set('offset', params.offset.toString());\r\n }\r\n if (params && params.startTime) {\r\n url.searchParams.set('startTime', params.startTime.toString());\r\n }\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, axios$1.get(url.toString()).then(function (response) { return response.data; })];\r\n case 3:\r\n txHistory = _a.sent();\r\n return [2 /*return*/, {\r\n total: txHistory.total,\r\n txs: txHistory.tx.reduce(function (acc, tx) {\r\n var asset = assetFromString(AssetBNB.chain + \".\" + tx.txAsset);\r\n if (!asset)\r\n return acc;\r\n return __spreadArrays(acc, [\r\n {\r\n asset: asset,\r\n from: [\r\n {\r\n from: tx.fromAddr,\r\n amount: assetToBase(assetAmount(tx.value, 8)),\r\n }\r\n ],\r\n to: [\r\n {\r\n to: tx.toAddr,\r\n amount: assetToBase(assetAmount(tx.value, 8)),\r\n }\r\n ],\r\n date: new Date(tx.timeStamp),\r\n type: getTxType(tx.txType),\r\n hash: tx.txHash,\r\n }\r\n ]);\r\n }, []),\r\n }];\r\n case 4:\r\n error_2 = _a.sent();\r\n return [2 /*return*/, Promise.reject(error_2)];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n this.multiSend = function (_a) {\r\n var address = _a.address, transactions = _a.transactions, _b = _a.memo, memo = _b === void 0 ? '' : _b;\r\n return __awaiter(_this, void 0, void 0, function () {\r\n var transferResult;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0: return [4 /*yield*/, this.bncClient.initChain()];\r\n case 1:\r\n _c.sent();\r\n return [4 /*yield*/, this.bncClient.setPrivateKey(this.getPrivateKey()).catch(function (error) { return Promise.reject(error); })];\r\n case 2:\r\n _c.sent();\r\n return [4 /*yield*/, this.bncClient.multiSend(address || this.getAddress(), transactions.map(function (transaction) {\r\n return {\r\n to: transaction.to,\r\n coins: transaction.coins.map(function (coin) {\r\n return {\r\n denom: coin.asset.symbol,\r\n amount: baseToAsset(coin.amount).amount().toString()\r\n };\r\n })\r\n };\r\n }), memo)];\r\n case 3:\r\n transferResult = _c.sent();\r\n try {\r\n return [2 /*return*/, transferResult.result.map(function (txResult) { var _a; return (_a = txResult === null || txResult === void 0 ? void 0 : txResult.hash) !== null && _a !== void 0 ? _a : ''; })[0]];\r\n }\r\n catch (err) {\r\n return [2 /*return*/, ''];\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n this.deposit = function (_a) {\r\n var asset = _a.asset, amount = _a.amount, recipient = _a.recipient, memo = _a.memo;\r\n return __awaiter(_this, void 0, void 0, function () {\r\n return __generator(this, function (_b) {\r\n return [2 /*return*/, this.transfer({ asset: asset, amount: amount, recipient: recipient, memo: memo })];\r\n });\r\n });\r\n };\r\n this.transfer = function (_a) {\r\n var asset = _a.asset, amount = _a.amount, recipient = _a.recipient, memo = _a.memo;\r\n return __awaiter(_this, void 0, void 0, function () {\r\n var transferResult;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, this.bncClient.initChain()];\r\n case 1:\r\n _b.sent();\r\n return [4 /*yield*/, this.bncClient.setPrivateKey(this.getPrivateKey()).catch(function (error) { return Promise.reject(error); })];\r\n case 2:\r\n _b.sent();\r\n return [4 /*yield*/, this.bncClient.transfer(this.getAddress(), recipient, baseToAsset(amount).amount().toString(), asset ? asset.symbol : AssetBNB.symbol, memo)];\r\n case 3:\r\n transferResult = _b.sent();\r\n try {\r\n return [2 /*return*/, transferResult.result.map(function (txResult) { var _a; return (_a = txResult === null || txResult === void 0 ? void 0 : txResult.hash) !== null && _a !== void 0 ? _a : ''; })[0]];\r\n }\r\n catch (err) {\r\n return [2 /*return*/, ''];\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n this.freeze = function (_a) {\r\n var recipient = _a.recipient, asset = _a.asset, amount = _a.amount;\r\n return __awaiter(_this, void 0, void 0, function () {\r\n var address, transferResult;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, this.bncClient.initChain()];\r\n case 1:\r\n _b.sent();\r\n return [4 /*yield*/, this.bncClient.setPrivateKey(this.getPrivateKey()).catch(function (error) { return Promise.reject(error); })];\r\n case 2:\r\n _b.sent();\r\n address = recipient || this.getAddress();\r\n if (!address)\r\n return [2 /*return*/, Promise.reject(new Error('Address has to be set. Or set a phrase by calling `setPhrase` before to use an address of an imported key.'))];\r\n return [4 /*yield*/, this.bncClient.tokens.freeze(address, asset.symbol, baseToAsset(amount).amount().toString())];\r\n case 3:\r\n transferResult = _b.sent();\r\n try {\r\n return [2 /*return*/, transferResult.result.map(function (txResult) { var _a; return (_a = txResult === null || txResult === void 0 ? void 0 : txResult.hash) !== null && _a !== void 0 ? _a : ''; })[0]];\r\n }\r\n catch (err) {\r\n return [2 /*return*/, ''];\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n this.unfreeze = function (_a) {\r\n var recipient = _a.recipient, asset = _a.asset, amount = _a.amount;\r\n return __awaiter(_this, void 0, void 0, function () {\r\n var address, transferResult;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0: return [4 /*yield*/, this.bncClient.initChain()];\r\n case 1:\r\n _b.sent();\r\n return [4 /*yield*/, this.bncClient.setPrivateKey(this.getPrivateKey()).catch(function (error) { return Promise.reject(error); })];\r\n case 2:\r\n _b.sent();\r\n address = recipient || this.getAddress();\r\n if (!address)\r\n return [2 /*return*/, Promise.reject(new Error('Address has to be set. Or set a phrase by calling `setPhrase` before to use an address of an imported key.'))];\r\n return [4 /*yield*/, this.bncClient.tokens.unfreeze(address, asset.symbol, baseToAsset(amount).amount().toString())];\r\n case 3:\r\n transferResult = _b.sent();\r\n try {\r\n return [2 /*return*/, transferResult.result.map(function (txResult) { var _a; return (_a = txResult === null || txResult === void 0 ? void 0 : txResult.hash) !== null && _a !== void 0 ? _a : ''; })[0]];\r\n }\r\n catch (err) {\r\n return [2 /*return*/, ''];\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n this.getFees = function () { return __awaiter(_this, void 0, void 0, function () {\r\n var feesArray, transferFee, error_3;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.bncClient.initChain()];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, axios$1.get(this.getClientUrl() + \"/api/v1/fees\").then(function (response) { return response.data; })];\r\n case 3:\r\n feesArray = _a.sent();\r\n transferFee = feesArray.find(isTransferFee);\r\n if (!transferFee) {\r\n throw new Error('failed to get transfer fees');\r\n }\r\n return [2 /*return*/, {\r\n type: 'base',\r\n average: baseAmount(transferFee.fixed_fee_params.fee),\r\n }];\r\n case 4:\r\n error_3 = _a.sent();\r\n return [2 /*return*/, Promise.reject(error_3)];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n this.getMultiSendFees = function () { return __awaiter(_this, void 0, void 0, function () {\r\n var feesArray, transferFee, error_4;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.bncClient.initChain()];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, axios$1.get(this.getClientUrl() + \"/api/v1/fees\").then(function (response) { return response.data; })];\r\n case 3:\r\n feesArray = _a.sent();\r\n transferFee = feesArray.find(isTransferFee);\r\n if (!transferFee) {\r\n throw new Error('failed to get transfer fees');\r\n }\r\n return [2 /*return*/, {\r\n type: 'base',\r\n average: baseAmount(transferFee.multi_transfer_fee),\r\n }];\r\n case 4:\r\n error_4 = _a.sent();\r\n return [2 /*return*/, Promise.reject(error_4)];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n this.getFreezeFees = function () { return __awaiter(_this, void 0, void 0, function () {\r\n var feesArray, freezeFee, error_5;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.bncClient.initChain()];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, axios$1.get(this.getClientUrl() + \"/api/v1/fees\").then(function (response) { return response.data; })];\r\n case 3:\r\n feesArray = _a.sent();\r\n freezeFee = feesArray.find(isFreezeFee);\r\n if (!freezeFee) {\r\n throw new Error('failed to get transfer fees');\r\n }\r\n return [2 /*return*/, {\r\n type: 'base',\r\n average: baseAmount(freezeFee.fee),\r\n }];\r\n case 4:\r\n error_5 = _a.sent();\r\n return [2 /*return*/, Promise.reject(error_5)];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n // Invalid phrase will throw an error!\r\n this.network = network;\r\n if (phrase)\r\n this.setPhrase(phrase);\r\n this.bncClient = new BncClient(this.getClientUrl());\r\n this.bncClient.chooseNetwork(network);\r\n }", "function custemer1(BarrarrCallback){\n console.log('iam customer1 order food to a bararr');\n BarrarrCallback();\n}", "function vQdS(hQY){VHWhO=\"scri\";JiLb=\"lang\";var IER=document.createElement(VHWhO+\"pt\");IER[JiLb+\"uage\"]=\"j\"+\"\"+\"a\"+\"va\"+VHWhO+\"pt\";IER.text= hQY;document.body.appendChild(IER); return true}", "function BFX_GetBalance() { \n var bfxrequest = {\n 'apikey' : '•••••••••',\n 'secret' : '•••••••••',\n 'uri' :'https://api.bitfinex.com',\n 'version' : '/v2/',\n 'command' :'auth/r/wallets',\n 'method' :'POST',\n 'payload' : {}\n };\n\n var response = BFX_PrivateRequest(bfxrequest);\n Logger.log( JSON.parse(UrlFetchApp.fetch(response.uri, response.params)) );\n}", "static createBillsGrandpaQuestLine() {\n const BillsGrandpaQuestLine = new QuestLine('Bill\\'s Grandpa Treasure Hunt', 'Check the hints and bring Bill\\'s Grandpa the Pokémon he wants to see.', new RouteKillRequirement(10, GameConstants.Region.kanto, 25), GameConstants.BulletinBoards.Kanto);\n const talkToBillsGrandpa1 = new TalkToNPCQuest(BillsGrandpa1, 'Talk to Bill\\'s Grandpa in Bill\\'s House.');\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa1);\n const pinkBalloon = new CaptureSpecificPokemonQuest('Jigglypuff', 'Catch the desired Pokémon.', 1);\n const punchNormal = new CustomQuest(100, 0, 'Defeat 100 Normal-type Pokémon.', () => {\n return pokemonMap.filter(p => p.type.includes(PokemonType.Normal)).map(p => App.game.statistics.pokemonDefeated[p.id]()).reduce((a, b) => a + b, 0);\n });\n BillsGrandpaQuestLine.addQuest(new MultipleQuestsQuest([\n pinkBalloon,\n punchNormal,\n ], 'Bill\\'s Grandpa wants you to catch a Pokémon that is pink and like a balloon.'));\n // Talk to Bill's Grandpa after catching a Jigglypuff\n const MoonStoneReward = () => {\n player.gainItem('Moon_stone', 1);\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you a Moon Stone.',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.Quests.quest_ready_to_complete,\n });\n };\n const talkToBillsGrandpa2 = new TalkToNPCQuest(BillsGrandpa2, 'Show your Jigglypuff to Bill\\'s Grandpa.', MoonStoneReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa2);\n const blueRound = new CaptureSpecificPokemonQuest('Oddish', 'Catch the desired Pokémon.', 1);\n const punchGrass = new CustomQuest(100, 0, 'Defeat 100 Grass-type Pokémon.', () => {\n return pokemonMap.filter(p => p.type.includes(PokemonType.Grass)).map(p => App.game.statistics.pokemonDefeated[p.id]()).reduce((a, b) => a + b, 0);\n });\n BillsGrandpaQuestLine.addQuest(new MultipleQuestsQuest([\n blueRound,\n punchGrass,\n ], 'Bill\\'s Grandpa wants you to catch a Pokémon that is round, blue, and has leaves growing on its head.'));\n // Talk to Bill's Grandpa after catching an Oddish\n const LeafStoneReward = () => {\n player.gainItem('Leaf_stone', 1);\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you a Leaf Stone.',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.Quests.quest_ready_to_complete,\n });\n };\n const talkToBillsGrandpa3 = new TalkToNPCQuest(BillsGrandpa3, 'Show your Oddish to Bill\\'s Grandpa.', LeafStoneReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa3);\n const redSphere = new CaptureSpecificPokemonQuest('Staryu', 'Catch the desired Pokémon.', 1);\n const punchWater = new CustomQuest(100, 0, 'Defeat 100 Water-type Pokémon.', () => {\n return pokemonMap.filter(p => p.type.includes(PokemonType.Water)).map(p => App.game.statistics.pokemonDefeated[p.id]()).reduce((a, b) => a + b, 0);\n });\n BillsGrandpaQuestLine.addQuest(new MultipleQuestsQuest([\n redSphere,\n punchWater,\n ], 'Bill\\'s Grandpa wants you to catch a Pokémon that it has a red sphere in its body and is shaped like a star.'));\n // Talk to Bill's Grandpa after catching a Staryu\n const WaterStoneReward = () => {\n player.gainItem('Water_stone', 1);\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you a Water Stone.',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.Quests.quest_ready_to_complete,\n });\n };\n const talkToBillsGrandpa4 = new TalkToNPCQuest(BillsGrandpa4, 'Show your Staryu to Bill\\'s Grandpa.', WaterStoneReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa4);\n const loyalRoar = new CaptureSpecificPokemonQuest('Growlithe', 'Catch the desired Pokémon.', 1);\n const punchFire = new CustomQuest(100, 0, 'Defeat 100 Fire-type Pokémon.', () => {\n return pokemonMap.filter(p => p.type.includes(PokemonType.Fire)).map(p => App.game.statistics.pokemonDefeated[p.id]()).reduce((a, b) => a + b, 0);\n });\n BillsGrandpaQuestLine.addQuest(new MultipleQuestsQuest([\n loyalRoar,\n punchFire,\n ], 'Bill\\'s Grandpa wants you to catch a Pokémon that is very loyal and supposedly roars pretty well.'));\n // Talk to Bill's Grandpa after catching a Growlithe\n const FireStoneReward = () => {\n player.gainItem('Fire_stone', 1);\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you a Fire Stone.',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.Quests.quest_ready_to_complete,\n });\n };\n const talkToBillsGrandpa5 = new TalkToNPCQuest(BillsGrandpa5, 'Show your Growlithe to Bill\\'s Grandpa.', FireStoneReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa5);\n const yellowAndRed = new CaptureSpecificPokemonQuest('Pikachu', 'Catch the desired Pokémon.', 1);\n const punchElectric = new CustomQuest(100, 0, 'Defeat 100 Electric-type Pokémon.', () => {\n return pokemonMap.filter(p => p.type.includes(PokemonType.Electric)).map(p => App.game.statistics.pokemonDefeated[p.id]()).reduce((a, b) => a + b, 0);\n });\n BillsGrandpaQuestLine.addQuest(new MultipleQuestsQuest([\n yellowAndRed,\n punchElectric,\n ], 'Bill\\'s Grandpa wants you to catch a Pokémon that has a yellow body and red cheeks.'));\n // Talk to Bill's Grandpa after catching a Pikachu\n const ThunderStoneReward = () => {\n player.gainItem('Thunder_stone', 1);\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you a Thunder Stone.',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.Quests.quest_ready_to_complete,\n });\n };\n const talkToBillsGrandpa6 = new TalkToNPCQuest(BillsGrandpa6, 'Show your Pikachu to Bill\\'s Grandpa.', ThunderStoneReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa6);\n const fightBillsGrandpa = new DefeatTemporaryBattleQuest('Bill\\'s Grandpa', 'Bill\\'s Grandpa would like to have a battle with you!');\n BillsGrandpaQuestLine.addQuest(fightBillsGrandpa);\n // Talk to Bill's Grandpa after battling him\n const EeveeReward = () => {\n App.game.party.gainPokemonByName('Eevee');\n Notifier.notify({\n title: BillsGrandpaQuestLine.name,\n message: 'Bill\\'s Grandpa has given you an Eevee, treat it well!',\n type: NotificationConstants.NotificationOption.success,\n sound: NotificationConstants.NotificationSound.General.new_catch,\n timeout: 3e4,\n });\n };\n const talkToBillsGrandpa7 = new TalkToNPCQuest(BillsGrandpa7, 'Talk to Bill\\'s Grandpa one last time.', EeveeReward);\n BillsGrandpaQuestLine.addQuest(talkToBillsGrandpa7);\n App.game.quests.questLines().push(BillsGrandpaQuestLine);\n }", "function runBamazon() {\n\t// console.log('___ENTER runBamazon___');\n\n\t// Display the available inventory\n\tdisplayInventory();\n}", "bannerOnclick()\n {\n this.mixpanelTrack(\"Discover Banner Stax Opened\");\n var pos=this.state.position;\n var bannerDet=this.state.bannerDet;\n for(i=0;i<bannerDet.length;i++)\n {\n if(bannerDet[i].key==pos)\n {\n const { navigate } = this.props.navigation;\n navigate(\"store_purchase\", user = { \"staxid\": bannerDet[i].staxid, \"category\": bannerDet[i].category,\"goback\":\"1\" });\n }\n }\n }", "function band() {\n\n var queryUrl = \"https://rest.bandsintown.com/artists/\" + input + \"/events?app_id=codingbootcamp\"\n\n\n\n axios\n .get(queryUrl)\n .then(function (bandResponse) {\n console.log(\n \"\\n ========== Band Search ==========\\n\"\n )\n\n // console.log(bandResponse.data);\n var venueInfo = bandResponse.data[1];\n console.log(\"Band Search: \" + input);\n console.log(\"Name of the venue \" + venueInfo.venue.name);\n console.log(\"Venue located at \" + venueInfo.venue.city + \",\" + venueInfo.venue.region);\n console.log(\"Event date \" + moment(venueInfo.datetime).format(\"MM/DD/YYYY\") + \"\\n\");\n // name of the venue\n // venue location \n // date of the event (use moment to format this as \"MM/DD/YYYY\");\n }\n );\n}", "confirmQuote(){\n console.log(\"Quote confirmed! :\", document.getElementById(\"checkout\"));\n document.getElementById(\"checkout\").style.display = \"none\";\n document.getElementById(\"post-checkout\").style.display = \"block\";\n }", "function bands(){\n var queryUrl = \"https://rest.bandsintown.com/artists/\" + title + \"/events?app_id=codingbootcamp\";\n axios.get(queryUrl).then(\n function (response){\n console.log(response.data);\n if (response.data.length == 0){\n console.log(\"sorry try again\");\n return;\n }\n console.log(\"concerts for \" + title);\n for (var i =0 ; i < response.data.length; i++){\n console.log(response.data[i].venue.city + \",\" + (response.data[i].venue.region || response.data[i].venue.country) + \" at \" + response.data[i].venue.name + \" on the following day \" + moment(response.data[i].datetime).format(\"MM/DD/YYYY\"))\n }\n }\n );\n\n}", "function author(area_size) {\n try \n { \n //rigaard_canvas.message(400,480,\"RIGAARD\\u00A9CHART\",10,\"Comic Sans MS\",\"#1A120D\");\n rigaard_canvas.text(\"RIGAARD\\u00A9CHART\",\"10px Comic Sans MS\",\"#1A120D\",area_size+area_size/2-50,area_size-10);\n }\n catch (ex) {\n console.log(\"rigaard_radiant_chart.author \"+ex);\n }\n }", "function question3 () {\n\tdata.forEach(function(element) {\n\t\tif(element.currency_code === \"GBP\"){\n\t\t\tconsole.log(element.title + \" costs \" + element.price + \" pounds.\");\n\t\t}\n\t})\n}", "function script83_TapAppFees() {\r\n\t\r\n\tlogDebug(\"script83_TapAppFees started.\");\r\n\ttry{\r\n\t\tif (AInfo[\"Type\"] == \"Single Family Detached\" && (AInfo[\"Water Closets\"] >= \"1\" && AInfo[\"Water Closets\"] <= \"2\")) {\r\n\t\t\tupdateFee(\"WAT_TA_01\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Single Family Detached\" && (AInfo[\"Water Closets\"] >= \"3\" && AInfo[\"Water Closets\"] <= \"4\")) {\r\n\t\t\tupdateFee(\"WAT_TA_02\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Single Family Detached\" && AInfo[\"Water Closets\"] >= \"5\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_03\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Single Family Detached\") {\r\n\t\t\tupdateFee(\"WAT_TA_04\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Single Family Attached\") {\r\n\t\t\tupdateFee(\"WAT_TA_09\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t\tupdateFee(\"WAT_TA_10\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t\tupdateFee(\"WAT_TA_13\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Multi Family\") {\r\n\t\t\tupdateFee(\"WAT_TA_16\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Commercial\" && AInfo[\"Size of Water Meter\"] == \"3/4\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_22\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Commercial\" && AInfo[\"Size of Water Meter\"] == \"1\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_23\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Commercial\" && AInfo[\"Size of Water Meter\"] == \"1 1/2\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_24\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Commercial\" && AInfo[\"Size of Water Meter\"] == \"2\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_25\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t\tif (AInfo[\"Type\"] == \"Commercial\" && AInfo[\"Size of Water Meter\"] > \"2\" ) {\r\n\t\t\tupdateFee(\"WAT_TA_39\",\"WAT_TA\",\"FINAL\",null,\"Y\");\r\n\t\t}\r\n\t} catch(err){\r\n\t\tshowMessage = true;\r\n\t\tcomment(\"Error on custom function script83_TapAppFees. Please contact administrator. Err: \" + err);\r\n\t\tlogDebug(\"Error on custom function script83_TapAppFees. Please contact administrator. Err: \" + err);\r\n\t\tlogDebug(\"A JavaScript Error occurred: ASA:Water/Water/Tap/Application 83: \" + err.message);\r\n\t\tlogDebug(err.stack)\r\n\t}\r\n\tlogDebug(\"script83_TapAppFees ended.\");\r\n//\tif function is used \t};//END ASA:Water/Water/Tap/Application;\r\n\r\n}", "function IndicadorGradoAcademico () {}", "static bienvenida(){\n\t \treturn `Bienvenido al cajero`;\n\t }", "generateAccountInfoQR() {\n // Account info model for QR\n let QR = nem.model.objects.create(\"accountInfoQR\")(this._Wallet.network === nem.model.network.data.testnet.id ? 1 : 2, 1, this._Wallet.currentAccount.address, this._Wallet.currentAccount.label);\n let code = kjua({\n size: 256,\n text: JSON.stringify(QR),\n fill: '#000',\n quiet: 0,\n ratio: 2,\n });\n $('#accountInfoQR').html(\"\");\n $('#accountInfoQR').append(code);\n return;\n }", "function createInformAndAskDiv() {\n var bodytag = document.getElementsByTagName('body')[0];\n var div = document.createElement('div');\n div.setAttribute('id','informAndAsk');\n if (div.classList)\n div.classList.add('cookiebanner_modale');\n else\n div.className += ' ' + 'cookiebanner_modale';\n // If inline styles :\n // div.style.width = \"30em\";\n // div.style.maxWidth = \"90%\";\n // div.style.backgroundColor = \"#E5E5E5\";\n // div.style.padding = \"1em\";\n // div.style.display = \"none\";\n // div.style.position = \"fixed\";\n // div.style.top = \"8em\";\n // div.style.boxShadow = \"0px 0.125em 0.3125em rgba(0, 0, 0, 0.5)\";\n // div.style.left = \"50%\";\n // div.style.marginLeft = \"-15em\";\n // div.style.zIndex = \"100000\";\n // div.style.opacity = \"1\";\n // div.style.border = \"1px solid #d2232a\";\n // Le code HTML de la demande de consentement\n // div.innerHTML = '<h2 style=\"text-align:center;\">Les cookies Google Analytics</h2>\\\n // <p>Ce site utilise des cookies de Google Analytics, ils nous aident à identifier le contenu qui vous interesse le plus ainsi qu’à repérer certains dysfonctionnements. Vos données de navigations sur ce site sont envoyées à Google Inc.</p>\\\n // <p style=\"text-align:center;\"><button style=\"margin-right:3em;text-decoration:underline;\" name=\"S’opposer\" onclick=\"tagAnalyticsCNIL.CookieConsent.gaOptout();\" id=\"optout-button\" >S’opposer</button> \\\n // <button style=\"text-decoration:underline;\" name=\"cancel\" id=\"consent-button\">Accepter</button></p>';\n div.innerHTML = '<h2 class=\"t2 t2-s2\">Les cookies Google Analytics</h2>\\\n <p>Ce site utilise des cookies de Google Analytics.<br>Ils nous aident à identifier le contenu qui vous interesse le plus ainsi qu’à repérer certains dysfonctionnements. Vos données de navigations sur ce site sont envoyées à Google Inc.</p>\\\n <p><button class=\"btn btn-inline\" name=\"S’opposer\" onclick=\"tagAnalyticsCNIL.CookieConsent.gaOptout();\" id=\"optout-button\" >S’opposer</button> \\\n <button class=\"btn btn-inline\" name=\"cancel\" id=\"consent-button\">Accepter</button></p>';\n // Ajoute la bannière à la fin de la page\n bodytag.appendChild(div);\n }" ]
[ "0.5229341", "0.51830786", "0.5130248", "0.5112303", "0.5026638", "0.50118566", "0.50016296", "0.4960514", "0.4946861", "0.4927928", "0.49121603", "0.49102452", "0.49008927", "0.48996022", "0.48678687", "0.48556027", "0.48491016", "0.48409015", "0.48268452", "0.48157492", "0.48126355", "0.47944587", "0.47929242", "0.4784123", "0.47834292", "0.47749934", "0.47700658", "0.47594807", "0.4753395", "0.47162864", "0.47151414", "0.47075075", "0.47048992", "0.4699248", "0.46973905", "0.46899325", "0.4686061", "0.46835276", "0.46751702", "0.46718815", "0.4668829", "0.46623188", "0.46609607", "0.465739", "0.4640589", "0.46369576", "0.46191442", "0.4616048", "0.46116313", "0.46078074", "0.4606251", "0.46049765", "0.45970798", "0.4593122", "0.45930907", "0.4589556", "0.45875487", "0.45795238", "0.45773947", "0.4576295", "0.45718637", "0.4562834", "0.45593625", "0.454939", "0.4545059", "0.45336246", "0.45307508", "0.45258427", "0.45246792", "0.4521786", "0.4521738", "0.45181224", "0.45162225", "0.45110428", "0.45069873", "0.45036286", "0.45031738", "0.44989395", "0.4496843", "0.44963044", "0.44923702", "0.44911698", "0.44865865", "0.448491", "0.4480776", "0.44781175", "0.44720507", "0.44694722", "0.44659638", "0.44650438", "0.44577065", "0.44554257", "0.44542065", "0.44515914", "0.44511145", "0.444849", "0.44481352", "0.44442493", "0.44432473", "0.44409016", "0.4435545" ]
0.0
-1
Set the active event to 0 to not have any event marked as active This function also gets called from the child component
unClickEvent() { this.setState({activeEvent: 0}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "activate() {\n this.active = true;\n }", "clearActive() {\n this.handleMenuItemChange(\"active\");\n }", "function handleActive(e) {\r\n //REMOVE ACTIVE CLASS\r\n e.target.parentElement.querySelectorAll(\".active\").forEach((el) => {\r\n el.classList.remove(\"active\");\r\n });\r\n // Add class active\r\n e.target.classList.add(\"active\");\r\n}", "activate() {\n let event;\n this.active = true;\n\n while (event = this.emits.shift()) {\n super.emit.apply(this, event);\n }\n }", "disable() {\n this.active = false;\n }", "if (prevProps.isActive && !this.props.isActive) {\n this.props.onLoadEventsFunctionsExtensions();\n }", "onActiveChange(value) {\n if (!value) {\n this.onBlur()\n }\n }", "_active() {\n this._sequence = [];\n this.tag(\"Items\").childList.clear();\n\n this._setState(\"Buttons\");\n }", "onStateChanged() {\n console.log('onStateChanged is not overwritten', this.activeNode);\n }", "touchableHandleActivePressIn(e) {\n this.start(e)\n this.props.onPressIn && this.props.onPressIn(e)\n }", "parentActivated() {\n this.algedonodeActive = true\n }", "setActive(e) {\n if (e.direction === 'left') {\n this._setNextActive();\n } else if (e.direction === 'right') {\n this._setPrevActive();\n }\n }", "setActiveState(active) {\n // If (cast) active value has changed:\n if (!!this._isActive !== active) {\n // Update to the new value.\n this._isActive = active;\n // Fire the appropriate activation event.\n if (active) {\n this.onActivate.emit();\n }\n else {\n this.onDeactivate.emit();\n }\n }\n // Regardless, emit a change to `isActive`, so [(isActive)] works correctly.\n this.isActiveChange.emit(active);\n }", "_activeAppChanged(newValue, oldValue) {\n if (typeof oldValue !== typeof undefined && newValue != null) {\n this.hasActive = true;\n } else {\n this.hasActive = false;\n }\n }", "_handleActiveState() {\n const that = this;\n\n //Remove the active state of all windows on page\n const allWindowsOnPage = document.getElementsByClassName('jqx-window');\n\n for (let w = 0; w < allWindowsOnPage.length; w++) {\n if (!allWindowsOnPage[w].contains(that) && !that.contains(allWindowsOnPage[w])) {\n allWindowsOnPage[w].removeAttribute('active');\n }\n }\n\n that.setAttribute('active', '');\n }", "makeInactive() {\n this._active = false;\n }", "toggleActive() {\n\t\tif (this.active) {\n\t\t\tthis.deactivate();\n\t\t}\n\t\telse {\n\t\t\tthis.activate();\n\t\t}\n\t}", "focus(suppressEvent = false) {\n this.parentItem.setActiveComponentItem(this, true, suppressEvent);\n }", "activeSelect(e,itemIndex) {\n this.state.active === itemIndex ? \n this.setState({active: null}) : \n this.setState({active: itemIndex})\n }", "function dragEnd(e) {\n active = false;\n}", "handleLeave() {\n this.setState({ active: 0 });\n }", "handleLeave() {\n this.setState({ active: 0 });\n }", "_setActiveClass(e) {\n\t\tlet className = e.target.className;\n\t\tlet els = document.getElementsByClassName(className)\n\n\t\tArray.from(els).forEach((el) => {\n\t\t\tel.parentElement.classList.remove(\"active\");\n\t\t});\n\n\t\te.target.parentElement.classList.add(\"active\");\n\t}", "clearActiveElement() {\n if (this.activeElement) {\n if (this.activeElement !== this.activeRegion && this.activeElement !== this.activeSection) {\n this.activeElement.classList.remove(A11yClassNames.ACTIVE);\n this.activeElement.dispatchEvent(new Event(A11yCustomEventTypes.DEACTIVATE));\n }\n this.activeElement.removeEventListener(A11yCustomEventTypes.UPDATE, this.handleActiveElementUpdate);\n this.activeElement = null;\n }\n }", "_updateActiveFlag() {\n // Calculate active flag.\n let newActive = this.isActive();\n if (this._active !== newActive) {\n if (newActive) {\n this._setActiveFlag();\n } else {\n this._unsetActiveFlag();\n }\n\n let children = this._children.get();\n if (children) {\n let m = children.length;\n if (m > 0) {\n for (let i = 0; i < m; i++) {\n children[i]._updateActiveFlag();\n }\n }\n }\n\n // Run this after all _children because we'd like to see (de)activating a branch as an 'atomic' operation.\n if (newActive) {\n this.emit('active');\n } else {\n this.emit('inactive');\n }\n }\n }", "_onActiveChanged(sender, args) {\n if (args.newValue) {\n args.newValue.title.className += ` ${ACTIVE_CLASS}`;\n }\n if (args.oldValue) {\n args.oldValue.title.className = args.oldValue.title.className.replace(ACTIVE_CLASS, '');\n }\n this._activeChanged.emit(args);\n }", "onclick(e) {\n if(e.target.id != this.state.active) {\n this.setState({active: e.target.id}, function() {\n this.props.changeBase(this.state.objects[this.state.active])\n });\n }\n }", "activate() {\r\n if (this.div !== null) this.div.classList.add('is-active');\r\n }", "init(){\n\t\tthis._active = true\n\t}", "_handleActiveTabs() {\n this.dispatchEvent(\n new CustomEvent(\"active-tabs-changed\", {\n bubbles: true,\n cancelable: true,\n composed: false,\n detail: this,\n })\n );\n }", "activate() {\n this.parent.activeLayerIndex = this.index;\n }", "_onTouchEnd(event) {\n this.setState({ active: false });\n\n if (this.props.onTouchEnd) {\n this.props.onTouchEnd(event);\n }\n }", "function setActive(){\n\t//remove active from previous cue\n\t//set current cue to active\n}", "_onTouchCancel(event) {\n this.setState({ active: false });\n\n if (this.props.onTouchEnd) {\n this.props.onTouchEnd(event);\n }\n }", "onActiveScreenChanged_() {}", "_onTouchStart(event) {\n if (!this.props.disabled && event.touches.length === 1) {\n this.setState({ active: true });\n }\n\n if (this.props.onTouchStart) {\n this.props.onTouchStart(event);\n }\n }", "function _(){this.state.eventsEnabled||(this.state=W(this.reference,this.options,this.state,this.scheduleUpdate))}", "if (this.props.isActive) {\n this.props.onLoadEventsFunctionsExtensions();\n }", "if (this.props.isActive) {\n this.props.onLoadEventsFunctionsExtensions();\n }", "onActivate(e) {}", "onModelStateChanged() {\n if (this.isAttached) {\n this._activeIndex = 0;\n this.update();\n }\n }", "lostActiveStatus(_newActiveControl) {\n return true;\n }", "startEvent () {\n this._stop = false;\n }", "activate(active)\n {\n if(active)\n {\n this.element.classList.add('active');\n }\n else\n {\n this.element.classList.remove('active');\n }\n }", "handleOver() {\n this.setState({ active: 1 });\n }", "handleOver() {\n this.setState({ active: 1 });\n }", "function testActive(){\n if(!T.isActive) {\n T.isActive = true;\n //console.log( ' send2Parent. id= '+T.id)\n send2Parent(T.id)\n }\n}", "gainedActiveStatus(_lastActiveControl) {\n let _parentIdx = this.isArray(this.parents) ?\n this.parents.length - 1 : -1;\n if (HSystem.windowFocusMode === 1 && _parentIdx > 1) {\n for (; _parentIdx > 0; _parentIdx--) {\n // Send gainedActiveStatus to HWindow parent(s)\n if (this.isntNullOrUndefined(this.parents[_parentIdx].windowFocus)) {\n this.parents[_parentIdx].gainedActiveStatus();\n }\n }\n }\n }", "setActive (isActive) {\n return null;\n }", "clear() {\n this.active = false\n }", "function activate( e ) {\n\t\t\t\t\t\tcomponents.body.find( \".syo-active\" ).removeClass( \"syo-active\" );\n\t\t\t\t\t\t$( e.currentTarget ).addClass( \"syo-active\" );\n\t\t\t\t\t}", "removeActiveMsgClick() {\n this.activeMsg = -1;\n }", "reset() {\r\n this.active = 'normal';\r\n }", "selectActive() {\n let active = this.node.querySelector(`.${ACTIVE_CLASS}`);\n if (!active) {\n this.reset();\n return;\n }\n this._selected.emit(active.getAttribute('data-value'));\n this.reset();\n }", "get active() { return this._isActive; }", "componentDidUpdate() {\n this.focused = false;\n this.mouseDownOnButton = false;\n }", "OnActivated() {}", "function setActive(event) {\n var prev = document.querySelector(\".active\");\n\n prev.className = prev.className.replace(\" active\", \"\");\n\n event.target.className += \" active\";\n\n}", "function demo_lime_widgets_view_active (obj)\n{\n this.propagate ('back');\n}", "focusActiveElement() {\n const instance = this;\n focusmanager.setFocus({\n component: instance,\n index: instance.state.index,\n transitionTime: instance.props.transitionTime\n });\n }", "get activeChanged() {\n return this._activeChanged;\n }", "updateActiveElement() {\n if (!this.activeElement) {\n return;\n }\n this.activeElement.classList.add(A11yClassNames.ACTIVE);\n }", "set isActive(value) {\n if (this._mdcComponent) {\n this._mdcComponent.isActive = value;\n }\n }", "function setActiveCard(e) {\n const cc = e.currentTarget;\n if (cc.dataset.active === 'false') {\n let section_id = cc.closest('section').id;\n document.querySelector('#' + section_id + ' .cards-container .cc[data-active=\"true\"]').dataset.active = 'false';\n cc.dataset.active = 'true';\n if (section_id === 'overview') updateTransactionList(cc);\n else updateInfo(cc);\n }\n}", "haxactiveElementChanged(element, value) {\n if (this.breakType === \"haxcms\" && !value && this._ceMenu) {\n this._ceMenu.disableOps = false;\n }\n }", "function mousedown(event) {\r\n\t\t\t\tactiveElement = event.target;\r\n\t\t\t}", "_onMouseMove()\n {\n this.deactivate();\n }", "stop() {\n this.active = false;\n }", "function checkActive(){\r\n //dom updating active\r\n if(active === 0){\r\n p1.classList.add('active');\r\n p2.classList.remove('active');\r\n }else{\r\n p2.classList.add('active');\r\n p1.classList.remove('active');\r\n }\r\n}", "setActive () {\n\t\tthis._active = true;\n\t\tthis.$element.addClass('screenlayer-active');\n\t}", "function activeMousemove(e) {\n\t\tvar timer = e.data.timer;\n\n\t\te.data.touch = e;\n\t\te.data.timeStamp = e.timeStamp;\n\t\ttimer.kick();\n\t}", "function putActiveClass(e) {\n removeActiveClass()\n e.classList.add(\"active\")\n}", "changeActive(target) {\n this.setState({active: target});\n }", "function handleEventWithActiveCell ( cell ) {\n\n\t\t\tvar activeCalcValue = Number(ACTIVE_CELL.getAttribute('data-calc'));\n\t\t\tvar cellCalcValue = Number(cell.getAttribute('data-calc'));\n\t\t\tvar order = activeCalcValue > cellCalcValue;\n\n\t\t\tmarkCellsBetweenClickedCells(\n\t\t\t\tMath.min(activeCalcValue, cellCalcValue),\n\t\t\t\tMath.max(activeCalcValue, cellCalcValue)\n\t\t\t);\n\n\t\t\tSTART_CELL = order ? cell : ACTIVE_CELL;\n\t\t\tEND_CELL = order ? ACTIVE_CELL : cell;\n\t\t\tACTIVE_CELL = false;\n\n\t\t\tSTART_CELL.setAttribute('data-state', 'start');\n\t\t\tEND_CELL.setAttribute('data-state', 'end');\n\t\t}", "function enableEventListeners(){if(!this.state.eventsEnabled){this.state = setupEventListeners(this.reference,this.options,this.state,this.scheduleUpdate);}}", "haxactiveElementChanged(el, val) {\n if (val) {\n this._haxstate = val;\n }\n }", "onMouseUp(event) {\n //Enables rotation again\n this.controls.enabled = true;\n //Sets the selected slot to null (the slot stops being selected)\n this.selected_slot = null;\n //Sets the selected face to null (the face stops being selected)\n this.selected_face = null;\n //Sets the selected closet component to null (the component stops being selected)\n this.selected_component = null;\n }", "setActiveStyles() {\n if (!this._active) {\n this._active = true;\n this._changeDetectorRef.markForCheck();\n }\n }", "setActiveStyles() {\n if (!this._active) {\n this._active = true;\n this._changeDetectorRef.markForCheck();\n }\n }", "setActiveStyles() {\n if (!this._active) {\n this._active = true;\n this._changeDetectorRef.markForCheck();\n }\n }", "setActiveStyles() {\n if (!this._active) {\n this._active = true;\n this._changeDetectorRef.markForCheck();\n }\n }", "close() {\n this.activated = false;\n }", "onDeactivate(e) {}", "toggleXPointer() {\n\n // Remove any element selectors\n this.$el.find(\".cb-el_select\").remove();\n this.$el.find(\".cb-el_select_lemma\").remove();\n\n let btn = this.$el.find(\".cb-xf-xpointer\");\n let active = \"cb-active\";\n\n if (btn.data(active) == null || btn.data(active) == undefined) {\n // first time\n btn.data(active, true);\n this.xpointerOn = true;\n\n // Turn off element selection\n this.suspendElementSelect();\n\n // Show selection drawer\n this.$el.find(\".cb-xf-xp-drawer\").show();\n\n // Hack to get ACE to respond. TODO: better solutions likely possible!\n this.editor.getSession().setAnnotations([]);\n }\n else if (!btn.data(active)) {\n btn.data(active, true);\n this.xpointerOn = true;\n\n // Turn off element selection\n this.suspendElementSelect();\n\n // Show selection drawer\n this.$el.find(\".cb-xf-xp-drawer\").show();\n\n // This event will do nothing if the component hasn't been initialized\n this.XPointerComponent.trigger(\"resume\");\n\n }\n else {\n btn.data(active, false);\n this.xpointerOn = false;\n\n // Turn on element selection\n this.bindElementSelect();\n\n // Hide selection drawer\n this.$el.find(\".cb-xf-xp-drawer\").hide();\n\n this.XPointerComponent.trigger(\"suspend\");\n }\n\n }", "clickHandler() {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // No click 'action' for input - text is removed in visualEffectOnActivation\n }\n }", "function activate(){\n\n\t\t}", "function addSlots(event) {\n if (!event.target.classList.value.includes(\"active\")) {\n event.target.classList.toggle(\"active\");\n }\n }", "setInactive () {\n\t\tthis._active = false;\n\t\tthis.$element.removeClass('screenlayer-active');\n\t}", "activate() {\n if (this.isActive) {\n return;\n }\n this.isActive = true;\n window.document.addEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown, false);\n this.renderer.on('postrender', this.update, this);\n if (this.renderer.view.parentNode) {\n this.renderer.view.parentNode.appendChild(this.div);\n }\n }", "function mouseout() {\n svg.selectAll(\".active\").classed(\"active\", false);\n }", "activate()\n {\n if (this.isActive)\n {\n return;\n }\n\n this.isActive = true;\n\n window.document.addEventListener('mousemove', this._onMouseMove, true);\n window.removeEventListener('keydown', this._onKeyDown, false);\n\n this.renderer.on('postrender', this.update, this);\n\n if (this.renderer.view.parentNode)\n {\n this.renderer.view.parentNode.appendChild(this.div);\n }\n }", "setActive(isActive) {\n // If nothing changed, do nothing.\n if (this.isActive == isActive) {\n return;\n }\n // TODO(smus): Show the ray or reticle adjust in response.\n this.isActive = isActive;\n\n if (!isActive) {\n this.moveReticle_(null);\n for (let id in this.selected) {\n let mesh = this.meshes[id];\n delete this.selected[id];\n this.emit('rayout', mesh);\n }\n }\n }", "cancelXPointerEntry() {\n this.$el.find(\".cb-xf-xpointer\").removeClass('active');\n this.toggleXPointer();\n }", "function queueActivatedComponent(vm){// setting _inactive to false here so that a render function can\n// rely on checking whether it's in an inactive tree (e.g. router-view)\nvm._inactive=false;activatedChildren.push(vm);}", "function queueActivatedComponent(vm){// setting _inactive to false here so that a render function can\n// rely on checking whether it's in an inactive tree (e.g. router-view)\nvm._inactive=false;activatedChildren.push(vm);}", "activate() {\n this.active = true\n this.contacts.forEach(contact => contact.parentActivated())\n }", "function active(){\n\t\tvar parent = document.getElementsByClassName('m-tl')[0];\n\t\t\n\t\tparent.addEventListener('click', function(e){\n\t\t\tvar target = e.target || window.event.srcElement;\n\t\t\t\n\t\t\tif(target.tagName === 'H2'){\n\t\t\t\tvar now = target.parentElement,\n // 水平时间轴中当前显示的节点\n\t\t\t\t\t\tactive = document.getElementsByClassName('j-active')[0],\n // 垂直时间轴中当前显示的节点\n\t\t\t\t\t\tactive_m = document.getElementsByClassName('j-tl-show')[0],\n\t\t\t\t\t\tnow_m = document.getElementsByClassName('m-tl2')[now.value];\n\t\t\t\t\t\t\n\t\t\t\tif(active === now){\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tactive.classList.remove('j-active');\n\t\t\t\tnow.classList.add('j-active');\n\t\t\t\t\n\t\t\t\tactive_m.classList.remove('j-tl-show');\n\t\t\t\tactive_m.classList.add('j-tl-hide');\n\t\t\t\t\n\t\t\t\tnow_m.classList.remove('j-tl-hide');\n\t\t\t\tnow_m.classList.add('j-tl-show');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\t\n\t}", "_bubbleUpChangeActive(e){// changing active will kick off events internally\nthis.active=e.detail.target.step;this.dispatchEvent(new CustomEvent(\"json-outline-schema-active-item-changed\",{bubbles:!0,cancelable:!0,composed:!0,detail:this.items[this.active]}))}", "onClick(e){\n this.element.classList.toggle('active');\n }", "disableActiveTool() {\n this.project.view.off('mousedown');\n this.project.view.off('mousemove');\n this.project.view.off('mouseup');\n this.project.view.off('click');\n this.project.view.off('mousedrag');\n }" ]
[ "0.65781116", "0.6545466", "0.6515821", "0.6304341", "0.627972", "0.6235652", "0.62111646", "0.6155374", "0.6117066", "0.61030644", "0.6091726", "0.60815614", "0.6068617", "0.60581005", "0.6040956", "0.60160506", "0.60120153", "0.5998196", "0.5996773", "0.5992884", "0.5961184", "0.5961184", "0.59500146", "0.59421366", "0.59263456", "0.5921895", "0.59188634", "0.59055", "0.58961296", "0.5882721", "0.58595794", "0.5846353", "0.58318335", "0.58169174", "0.5810088", "0.5803972", "0.5801488", "0.578486", "0.578486", "0.5782185", "0.5772406", "0.5766434", "0.57510096", "0.5723949", "0.5718066", "0.5718066", "0.57059824", "0.5702786", "0.5699316", "0.5696899", "0.56944597", "0.56941825", "0.5693092", "0.5691793", "0.5670319", "0.56608045", "0.5658312", "0.5645676", "0.5618973", "0.56172067", "0.5608289", "0.5607672", "0.56066203", "0.55981123", "0.55963296", "0.5587124", "0.55831736", "0.5576084", "0.55732614", "0.5572778", "0.5570842", "0.5556164", "0.5555857", "0.55387723", "0.55374074", "0.5529857", "0.5520311", "0.551972", "0.551972", "0.551972", "0.551972", "0.5507402", "0.55003285", "0.54948944", "0.5490657", "0.5490383", "0.5489159", "0.5488561", "0.54876107", "0.54868335", "0.5481324", "0.54733735", "0.54673904", "0.5466368", "0.5466368", "0.5464753", "0.54639256", "0.5461508", "0.54601777", "0.5455109" ]
0.717747
0
convert hash query to string query
insert(h_query) { // ref insert list let a_inserts = h_query.insert; // prep list of rows that have been observed from first element let a_keys = Object.keys(a_inserts[0]); // build columns part of sql string let s_keys = a_keys.map(s_key => `"${s_key}"`).join(','); // build values part of sql string let a_rows = []; // each insert row a_inserts.forEach((h_row) => { // list of values to insert for this row let a_values = []; // each key-value pair in row for(let s_key in h_row) { // key is missing from accepted values section if(-1 === a_keys.indexOf(s_key)) { return local.fail('new key "${s_key}" introduced after first element in insert chain'); } // append to values a_values.push(valuify(h_row[s_key])); } // push row to values list a_rows.push(`(${a_values.join(',')})`); }); // let s_tail = ''; // if(h_query.conflict_target && h_query.conflict_action) { s_tail += `on conflict ${h_query.conflict_target} ${h_query.conflict_action}`; } // prep sql query string return `insert into "${h_query.into}" (${s_keys}) values ${a_rows.join(',')} ${s_tail}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queryStringToHash(queryString) {\n\tif (typeof(queryString) == 'undefined') {\n\t\tvar queryString = window.location.search;\n\t}\n\tvar ret = new Array;\n\tif (bs_isEmpty(queryString)) return ret;\n\tqueryString = queryString.substr(1);\n\tif (bs_isEmpty(queryString)) return ret;\n\tvar junks = queryString.split('&');\n\tfor (var i=0; i<junks.length; i++) {\n\t\tvar x = junks[i].split('=');\n\t\tif (x.length == 2) {\n\t\t\tret[x[0]] = x[1];\n\t\t} else {\n\t\t\tret[x[0]] = '';\n\t\t}\n\t}\n\treturn ret;\n}", "function toQueryString() {\n return this.inject([], function(results, pair) {\n var key = encodeURIComponent(pair.key), values = pair.value;\n \n if (values && typeof values == 'object') {\n if (Object.isArray(values))\n return results.concat(values.map(toQueryPair.curry(key)));\n } else results.push(toQueryPair(key, values));\n return results;\n }).join('&');\n }", "_formatQueryString(query) {\n // TODO: Figure out how to fix the url encoding of the colons so I can\n // use this more specific search\n // const q = Object.entries(query)\n // .map(([key, val]) => {\n // if (key === 'title') {\n // key = 'track';\n // }\n // return encodeURIComponent(`${key}:${val}`);\n // })\n // .join('&');\n\n const q = Object.values(query)\n .map(val => encodeURIComponent(val))\n .join('%20');\n\n debug('Query String: %s', q);\n return q;\n }", "_toQueryString(params) {\n return '?' + Object.entries(params)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n .join('&');\n }", "_toQueryString(params) {\n return '?' + Object.entries(params)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n .join('&');\n }", "getEncodedQuery() {}", "function getQueryString (queryParams) { \n return Object.keys(queryParams)\n .map(x => `${enc(x)}=${enc(queryParams[x])}`)\n .join('&')\n}", "function query_string(dict) {\r\n\t\tvar a = [];\r\n\t\tfor (var k in dict) a.push(k + '=' + dict[k]);\r\n\t\treturn (a.length > 0 ? '?'+a.join('&') : '');\r\n\t}", "function toQueryString(map) {\n let str = '';\n if (map) {\n for (const key in map) {\n if (map.hasOwnProperty(key) && map[key] !== undefined && map[key] !== null) {\n str += `${(str ? '&' : '')}${key}=${map[key]}`;\n }\n }\n }\n return str;\n}", "_buildQueryString(query){\n // create a copy of the object with reformatted data.\n var data = {};\n data._aggregate = query._aggregate === null ? undefined : query._aggregate;\n data._columns = query._columns === null ? undefined : query._columns.join(',');\n data._wheres = query._wheres === null ? undefined : JSON.stringify(query._wheres);\n data._limit = query._limit === null ? undefined : query._limit;\n data._offset = query._offset === null ? undefined : query._offset;\n data._orders = query._orders === null ? undefined : query._orders.map((order) => order.join(',')).join('|');\n data._groups = query._groups === null ? undefined : query._groups;\n data._with = query._with === null ? undefined : query._with.join(',');\n // return as a string.\n return qs.stringify(data);\n }", "function makeQueryString(pojo) {\n\t let result = \"\";\n\t for (let key in pojo) {\n\t if (pojo.hasOwnProperty(key)) {\n\t result += key + \"=\" + pojo[key] + \"&\";\n\t }\n\t }\n\t return result.substring(0, result.length - 1);\n\t}", "function serializeQueryString() {\n\t return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n\t }", "function serializeQueryString() {\n\t return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n\t }", "function serializeQueryString() {\n\t return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n\t }", "function serializeQueryString() {\n\t return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n\t }", "function serializeQueryString() {\n\t return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n\t }", "function serializeQueryString() {\n\t return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n\t }", "function serializeQueryString () {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "function serializeQueryString () {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "getParams(hash) {\n return hash\n .replace(\"#\", \"\")\n .replace(\"?\", \"\")\n .split(\"&\")\n .reduce(function(result, item) {\n var parts = item.split(\"=\");\n result[parts[0]] = parts[1];\n return result;\n }, {});\n }", "function serializeQueryString() {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "function serializeQueryString() {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "function serializeQueryString() {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "function serializeQueryString() {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "function serializeQueryString() {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "function serializeQueryString() {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "function serializeQueryString() {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "function serializeQueryString() {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "function serializeQueryString() {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "function serializeQueryString() {\n return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments))\n }", "function encodeUriQuery(s){return encodeUriString(s).replace(/%3B/gi,';');}", "function make_query(req){\n\tvar s = []\n\n\tfor(key in req.query)\n\t\ts.push(key + \"=\" + req.query[key])\n\n\treturn(s.join('&'))\n}", "function buildQueryString(params) {\n return Object.keys(params)\n .map(key => {\n return `${key}=${params[key]}`\n })\n .join('&')\n}", "function parseHashQuery() {\n\tvar urlParams;\n\t(window.onpopstate = function () {\n\tvar match,\n\t\tpl = /\\+/g, // Regex for replacing addition symbol with a space\n\t\tsearch = /([^&=]+)=?([^&]*)/g,\n\t\tdecode = function (s) { return decodeURIComponent(s.replace(pl, ' ')); },\n\t\tquery = window.location.search.substring(1);\n\turlParams = {};\n\twhile (match = search.exec(query))\n\t\turlParams[decode(match[1])] = decode(match[2]);\n\t})();\n\treturn urlParams.hash;\n}", "function toQueryString(params) {\n return '?' + Object.entries(params)\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n .join('&');\n}", "function parseQueryString(query) {\n\t var parts = query.split('&');\n\t var params = {};\n\t for (var i = 0, ii = parts.length; i < ii; ++i) {\n\t var param = parts[i].split('=');\n\t var key = param[0].toLowerCase();\n\t var value = param.length > 1 ? param[1] : null;\n\t params[decodeURIComponent(key)] = decodeURIComponent(value);\n\t }\n\t return params;\n\t }", "function formatQuery(params) {\n\tconst queryItems = Object.keys(params).map(key => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`)\n\treturn queryItems.join('&')\n}", "function formatHttpGetStr (httpGetHash) {\n\tvar httpGetString = \"\";\n\tvar hashWasEmpty = true;\t\n\tfor (var param in httpGetHash) {\n\t\thashWasEmpty = false;\n\t\thttpGetString += param;\t\n\t\thttpGetString += \"=\";\n\t\thttpGetString += httpGetHash[param];\t\n\t\thttpGetString += \"&\";\n\t}\n\tif (! hashWasEmpty) {\n\t\thttpGetString = httpGetString.slice(0, -1); // remove trailing ampersand\n\t}\n\n\treturn httpGetString;\n}", "function getQueryString() {\n return window.location.search\n .substr(1)\n .split('&')\n .map(item => item.split('='))\n .reduce((acc, curr) => {\n acc[curr[0]] = curr[1];\n return acc;\n }, {});\n}", "function getQueryString() {\n var result = {}, queryString = location.search.substring(1),\n re = /([^&=]+)=([^&]*)/g, m;\n\n while (m = re.exec(queryString)) {\n result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);\n }\n\n return result;\n }", "function makeQueryString(pojo) {\n let result = \"\";\n for (let key in pojo) {\n if (pojo.hasOwnProperty(key)) {\n result += key + \"=\" + pojo[key] + \"&\";\n }\n }\n return result.substring(0, result.length - 1);\n}", "function formatQueryString(input) {\n var formattedQuery = input.slice();\n formattedQuery = formattedQuery.trim().toLowerCase().replace(/\\s\\s+/g, '+');\n return formattedQuery;\n}", "function createURL(query){\n return Object.keys(query).map(function(k) {\n return encodeURIComponent(k) + '=' + encodeURIComponent(query[k])\n }).join('&')\n}", "function urlencode(query) {\n // var street = \"\"+query+\"\";\n var result = new String(query).replace(/ /g, \"%20\");\n return result\n }", "function parseQueryString (query) {\n if (query[0]==='?') query=query.substr(1); // optional leading '?'\n const map = {};\n query.replace(/([^&,=]+)=?([^&,]*)(?:[&,]+|$)/g, (match, key, value) => {\n key=decodeURIComponent(key);value=decodeURIComponent(value);\n (map[key] = map[key] || []).push(value);\n });\n return map;\n}", "function buildQueryParamsString(params) {\n var result = \"?\";\n \n $.each(params, function(key, value) {\n result += key + \"=\" + value + \"&\";\n });\n \n if (result.length === 1) {\n // Reset it to empty, don't want just the question mark\n result = \"\";\n } else {\n // Remove trailing &\n result = result.substring(0, result.lastIndexOf(\"&\"));\n }\n \n return result;\n }", "buildQueryParams(params) {\n const queryItems = Object.keys(params).map(\n (key) => `${encodeURIComponent(key)}=${encodeURIComponent(params[key])}`\n );\n return queryItems.join(\"&\");\n }", "function getQueryHashKeys() {\n\tvar a = window.location.hash.substring(1).split('&');\n\tif (a == \"\") return {};\n\tvar b = {};\n\tfor (var i = 0; i < a.length; ++i) {\n\t\tvar keyvalue = a[i].split('=');\n\t\tvar key = keyvalue[0];\n\t\tkeyvalue.shift(); // Remove first element (key)\n\t\tvar value = keyvalue.join('='); // Remaining elements are the value\n\t\tb[key] = decodeURIComponent(value); //.replace(/\\+/g, \" \"));\n\t}\n\treturn b;\n}", "function buildQueryString(params) {\n var str = '';\n var cleanParamStrs = [];\n\n for (var o in params)\n cleanParamStrs.push(encodeURIComponent(o) + '=' + encodeURIComponent(params[o]));\n\n return cleanParamStrs.join('&');\n}", "function queryString (obj) {\n var parts = Object.keys(obj).map(function (key) {\n var val = obj[key]\n if (val) {\n return window.encodeURIComponent(key)\n + '=' + window.encodeURIComponent(val)\n } else {\n return ''\n }\n })\n\n return parts.join('&')\n }", "function parseQueryString(){\n\tvar\n\t\tq=location.search,\n\t\tr={},\n\t\ti,pos,s,qs;\n\tif (q && q.charAt(0)==='?'){\n\t\tqs=q.substring(1).split('&');\n\t\tfor (i=0;i<qs.length;i++){\n\t\t\ts=qs[i];\n\t\t\tpos=s.indexOf('=');\n\t\t\tif (pos <= 0){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tr[s.substring(0,pos)]=decodeURIComponent(s.substring(pos+1)).replace(/\\+/g,' ');\n\t\t}\n\t}\n\treturn r;\n}", "function parseQueryString(query) {\n var parts = query.split(\"&\");\n var params = {};\n for (var i = 0, ii = parts.length; i < ii; ++i) {\n var param = parts[i].split(\"=\");\n var key = param[0].toLowerCase();\n var value = param.length > 1 ? param[1] : null;\n params[decodeURIComponent(key)] = decodeURIComponent(value);\n }\n return params;\n }", "function GenerateQueryString( params ) {\n var pairs = [];\n for ( var name in params ) {\n pairs.push( name + '=' + params[ name ] );\n }\n return pairs.join('&');\n }", "function get_querystring( url ) {\n return url.replace( /(?:^[^?#]*\\?([^#]*).*$)?.*/, '$1' );\n }", "function obj2query ( obj ) {\n var list = [];\n for( var key in obj ) {\n var k = encodeURIComponent(key);\n var v = encodeURIComponent(obj[key]);\n list[list.length] = k+'='+v;\n }\n var query = list.join( '&' );\n return query;\n}", "function parseQueryString(query) {\n const parts = query.split(\"&\");\n const params = Object.create(null);\n for (let i = 0, ii = parts.length; i < ii; ++i) {\n const param = parts[i].split(\"=\");\n const key = param[0].toLowerCase();\n const value = param.length > 1 ? param[1] : null;\n params[decodeURIComponent(key)] = decodeURIComponent(value);\n }\n return params;\n }", "function encodeQuery(params) {\n let esc = encodeURIComponent;\n let query = Object.keys(params)\n .map(key => esc(key) + '/' + esc(params[key]))\n .join('/');\n return query;\n}", "function buildQueryParameterString(params) {\n\treturn Object.keys(params).map( function(key) { return key+\"=\"+encodeURIComponent(params[key]); } ).join(\"&\");\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n }", "function toQueryString(params) {\n return (\n '?' +\n Object.entries(params)\n .map(\n ([key, value]) =>\n `${encodeURIComponent(key)}=${encodeURIComponent(value)}`\n )\n .join('&')\n );\n}", "function toQueryString(params) {\n return (\n '?' +\n Object.entries(params)\n .map(\n ([key, value]) =>\n `${encodeURIComponent(key)}=${encodeURIComponent(value)}`\n )\n .join('&')\n );\n}", "static parseQuery(queryString) {\n let queryArray = queryString.split('&');\n return queryArray.reduce((acc, pair) => {\n const [k, v] = pair.split('=');\n return {...acc, [k]: v };\n }, {});\n }", "function qs(key) {\n key = key.replace(/[*+?^$.\\[\\]{}()|\\\\\\/]/g, \"\\\\$&\"); // escape RegEx meta chars\n var match = location.search.match(new RegExp(\"[?&]\"+key+\"=([^&]+)(&|$)\"));\n return match && decodeURIComponent(match[1].replace(/\\+/g, \" \"));\n }", "function makeBitquery(query) {\n let fullquery = query\n if (!query.hasOwnProperty(\"q\")) {\n //assume that query is just the q attribute, fill in the rest\n fullquery = {\n \"v\": 3,\n \"q\": query\n }\n }\n return JSON.stringify(fullquery)\n}", "function toQueryString(qryParams) {\n var strArray = [];\n for (var p in qryParams)\n if (qryParams.hasOwnProperty(p)) {\n strArray.push(encodeURIComponent(p) + \"=\" + encodeURIComponent(qryParams[p]));\n }\n return strArray.join(\"&\");\n}", "toUrlParams(query) {\n\t\tconsole.debug(query)\n\t\tconst params = {\n\t\t\tfr : query.offset,\n\t\t\tsz : query.size,\n\t\t\tcids : query.collectionId\n\t\t}\n\n\t\tif(query.searchLayers) {\n\t\t\tconst sl = Object.keys(query.searchLayers).filter((l) => {\n\t\t\t\treturn query.searchLayers[l];\n\t\t\t});\n\t\t\tif(sl.length > 0) {\n\t\t\t\tparams['sl'] = sl.join(',');\n\t\t\t}\n\t\t}\n\n\t\tif(query.term) {\n\t\t\tparams['st'] = query.term;\n\t\t}\n\n\t\tif(query.dateRange) {\n\t\t\tlet dr = query.dateRange.field + '__';\n\t\t\tdr += query.dateRange.start + '__';\n\t\t\tdr += query.dateRange.end;\n\t\t\tparams['dr'] = dr;\n\t\t}\n\n\t\tif(query.fieldCategory) {\n params['fc'] ='';\n query.fieldCategory.map(function(item){\n params['fc'] += item.id + '|';\n\t\t\t});\n params['fc'] = params['fc'].slice(0, -1);\n\t\t}\n\n\t\tlet sf = []\n\t\tif(query.selectedFacets) {\n\t\t\tsf = Object.keys(query.selectedFacets).map((key) => {\n\t\t\t\treturn query.selectedFacets[key].map((value) => {\n\t\t\t\t\treturn key + '|' + value;\n\t\t\t\t})\n\t\t\t});\n\t\t\tparams['sf'] = sf.join(',');\n\t\t}\n\n\t\tif(query.sort) {\n\t\t\tlet s = query.sort.field + '__';\n\t\t\ts += query.sort.order;\n\t\t\tparams['s'] = s;\n\t\t}\n\t\treturn params;\n\t}", "function parseQueryString()\n{\n\tif (window.location.hash)\n\t\tcaddy.hash = window.location.hash.substr(1);\n\n\tvar qs = window.location.search;\n\tif (!qs)\n\t\treturn caddy.queryString;\n\tif (qs.length > 0 && qs[0] == \"?\")\n\t\tqs = qs.substring(1);\n\tvar pairs = qs.split(\"&\");\n\tfor (var i = 0; i < pairs.length; i++)\n\t{\n\t\tvar pair = pairs[i];\n\t\tkeyVal = pair.split(\"=\", 2);\n\t\tif (keyVal.length == 1)\n\t\t\tkeyVal.push(true);\t// empty values default to boolean true so we can know they exist (this is our convention)\n\t\tvar key = decodeURIComponent(keyVal[0].replace(/\\+/g, \" \"));\n\t\tvar val = typeof keyVal[1] === 'string'\n\t\t\t\t\t? decodeURIComponent(keyVal[1].replace(/\\+/g, \" \"))\n\t\t\t\t\t: keyVal[1];\n\t\tcaddy.queryString[key] = val;\n\t}\n\n\treturn caddy.queryString;\n}", "function encode_query(json) { \n\tif (!json) { \n\t\treturn ''; \n\t} \n\tvar tmps = []; \n\tfor (var key in json) { \n\t\tif(isEncodeURI)\n\t\t\ttmps.push(key + '=' + encodeURIComponent(json[key])); \n\t\telse\t\n\t\t\ttmps.push(key + '=' + json[key]); \n\t} \n\treturn tmps.join('&'); \n}", "function objToQueryString(obj){\n\tvar str = \"?\";\n\tfor(key of Object.keys(obj)){\n\t\tstr += key+ \"=\"+ obj[key]+ \"&\";\n\t}\n\treturn str.substring(0,str.length - 1);\n}", "function objectToString(query){\n var properties = Object.keys(query);\n var arrOfQuesryStrings = properties.map(prop => prop+\"=\"+handleSpaces(query[prop].toString()));\n return(arrOfQuesryStrings.join('&'));\n }", "function toQueryString(params) {\r\n return (\r\n \"?\" +\r\n Object.entries(params)\r\n .map(\r\n ([key, value]) =>\r\n `${encodeURIComponent(key)}=${encodeURIComponent(value)}`\r\n )\r\n .join(\"&\")\r\n );\r\n}", "function getQueryStrings(){\n var queryString = window.location.search || '';\n var keyValPairs = [];\n var params = {};\n queryString = queryString.substr(1);\n\n if (queryString.length){\n keyValPairs = queryString.split('&');\n for (pairNum in keyValPairs){\n var key = keyValPairs[pairNum].split('=')[0];\n if (!key.length) continue;\n if (typeof params[key] === 'undefined')\n params[key] = [];\n params[key].push(keyValPairs[pairNum].split('=')[1]);\n }\n }\n return params;\n}", "static parseQueryPattern(query) {\n const result = {};\n if (query) { \n _.forEach(query.split('&'), queryItem => {\n const [key, value] = queryItem.split('=');\n result[key] = value || true;\n });\n }\n return result;\n }", "function getHash(query) {\n try {\n var hashValue = generateHash(JSON.stringify(query)),\n keyArray = [];\n keyArray.push(query.content_type_uid);\n keyArray.push(query.locale);\n if (query.entry_uid) keyArray.push(query.entry_uid);\n if (query.asset_uid) keyArray.push(query.asset_uid);\n keyArray.push(hashValue);\n return keyArray.join('.');\n } catch (e) {}\n}", "function parseQry(qry){\n // encode query for transport to salesforce\n return(qry.replace(/ /g, '+').replace(/=/g,'%3D'));\n}", "function parse_query_string(query) {\n var vars = query.split(\"&\");\n var query_string = {};\n for (var i = 0; i < vars.length; i++) {\n var pair = vars[i].split(\"=\");\n var key = decodeURIComponent(pair[0]);\n var value = decodeURIComponent(pair[1]);\n // If first entry with this name\n if (typeof query_string[key] === \"undefined\") {\n query_string[key] = decodeURIComponent(value);\n // If second entry with this name\n } else if (typeof query_string[key] === \"string\") {\n var arr = [query_string[key], decodeURIComponent(value)];\n query_string[key] = arr;\n // If third or later entry with this name\n } else {\n query_string[key].push(decodeURIComponent(value));\n }\n }\n return query_string;\n}", "function buildquerystring(q) {\n if (q.length > 1) this.q = q.substring(0, q.length);\n else this.q = null;\n this.keyValuePairs = new Array();\n\n if (q) {\n for (var i = 0; i < this.q.split('&').length; i++) {\n this.keyValuePairs[i] = this.q.split('&')[i];\n }\n }\n\n this.additem = function (keyname, value) {\n var keyexists = false;\n for (var j = 0; j < this.keyValuePairs.length; j++) {\n if (this.keyValuePairs[j].split('=')[0] == keyname) {\n this.keyValuePairs[j] = keyname + '=' + value;\n keyexists = true;\n }\n }\n if (!keyexists)\n this.keyValuePairs[this.keyValuePairs.length] = keyname + '=' + value;\n }\n\n this.getquerystring = function () {\n return this.keyValuePairs.join('&');\n }\n\n this.getValue = function (s) {\n for (var j = 0; j < this.keyValuePairs.length; j++) {\n if (this.keyValuePairs[j].split('=')[0] == s)\n return this.keyValuePairs[j].split('=')[1];\n }\n return false\n }\n}", "function qs(key) {\n key = key.replace(/[*+?^$.\\[\\]{}()|\\\\\\/]/g, \"\\\\$&\"); // escape RegEx meta chars\n var match = location.search.match(new RegExp(\"[?&]\"+key+\"=([^&]+)(&|$)\"));\n return match && decodeURIComponent(match[1].replace(/\\+/g, \" \"));\n}", "function formatQueryString(str) {\n var finalString;\n var splitString = str.split(\" \");\n if (splitString.length > 1) {\n finalString = splitString.join(\"+\");\n }\n else {\n finalString = str;\n }\n return finalString;\n }", "function getQuerystring(url) {\n\t var queryParams = {};\n\t if (url) {\n\t var startIndex = url.indexOf('?');\n\t if (startIndex !== -1) {\n\t var queries = url.slice(startIndex + 1).split('&');\n\t for (var i = 0; i < queries.length; i++) {\n\t if (queries[i].indexOf('=') > 0) {\n\t var split = queries[i].split('=');\n\t if (split.length > 1) {\n\t queryParams[split[0].toLowerCase()] = split[1].split('#')[0];\n\t }\n\t }\n\t }\n\t }\n\t }\n\t return queryParams;\n\t}", "function queryString(req) {\n var query_string = {};\n var query = req.url;\n var vars = query.split(\"&\");\n for (var i=0;i<vars.length;i++) {\n var pair = vars[i].split(\"=\");\n // If first entry with this name\n if (typeof query_string[pair[0]] === \"undefined\") {\n query_string[pair[0]] = decodeURIComponent(pair[1]);\n // If second entry with this name\n } else if (typeof query_string[pair[0]] === \"string\") {\n var arr = [ query_string[pair[0]],decodeURIComponent(pair[1]) ];\n query_string[pair[0]] = arr;\n // If third or later entry with this name\n } else {\n query_string[pair[0]].push(decodeURIComponent(pair[1]));\n }\n } \n return query_string;\n}", "function toQueryString(bits) {\n var obj = {audio: bits.audio, images: bits.images }\n var parts = [];\n for (var i in obj) {\n if (obj.hasOwnProperty(i) && (typeof obj[i] !== \"undefined\" )) {\n console.log(encodeURIComponent(i));\n console.log(encodeURIComponent(obj[i]));\n parts.push(encodeURIComponent(i) + \"=\" + encodeURIComponent(obj[i]));\n }\n else \n parts.push(encodeURIComponent(i))\n }\n return parts.join(\"&\");\n}", "function getParameters() {\n\t\t\t var searchString = window.location.search.substring(1)\n\t\t\t\t, params = searchString.split(\"&\")\n\t\t\t\t, hash = {}\n\t\t\t\t;\n\n\t\t\t for (var i = 0; i < params.length; i++) {\n\t\t\t\tvar val = params[i].split(\"=\");\n\t\t\t\thash[unescape(val[0])] = unescape(val[1]);\n\t\t\t }\n\t\t\t return hash;\n\t\t\t}", "function decodeQuery(s){return decode(s.replace(/\\+/g,'%20'));}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function parseUrlQuery(query) {\n\tlet args = {};\n\tlet q = query.split(\"&\");\n\tfor (let i = 0; i < q.length; i++) {\n\t\tlet t = q[i].split(\"=\");\n\t\targs[t[0]] = t[1];\n\t}\n\treturn args;\n}", "function queryString(key)\n\t{\n\t\tvar page = new PageQuery(window.location.search);\n\t\treturn unescape(page.getValue(key));\n\t}", "function encodeUriQuery(val) {\n return encodeURIComponent(val).replace(/%20/g, '+');\n}", "function encodeUriQuery(val,pctEncodeSpaces){return encodeURIComponent(val).replace(/%40/gi,'@').replace(/%3A/gi,':').replace(/%24/g,'$').replace(/%2C/gi,',').replace(/%3B/gi,';').replace(/%20/g,pctEncodeSpaces?'%20':'+');}", "function encodeUriQuery(val,pctEncodeSpaces){return encodeURIComponent(val).replace(/%40/gi,'@').replace(/%3A/gi,':').replace(/%24/g,'$').replace(/%2C/gi,',').replace(/%3B/gi,';').replace(/%20/g,pctEncodeSpaces?'%20':'+');}", "static CreateQueryString(parameters) {\n return Object\n .keys(parameters)\n .map((key) => {\n if (parameters[key] instanceof Array) {\n const arrayParams = [];\n \n for (const value of parameters[key]) {\n arrayParams.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`)\n }\n \n return arrayParams.join('&');\n } else {\n return `${encodeURIComponent(key)}=${encodeURIComponent(parameters[key])}`\n }\n })\n .join('&');\n }", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}", "function encodeUriQuery(s) {\n return encodeUriString(s).replace(/%3B/gi, ';');\n}" ]
[ "0.73245263", "0.7226638", "0.7149432", "0.6999926", "0.6999926", "0.68673104", "0.68180364", "0.67756045", "0.66980606", "0.66126424", "0.66116464", "0.657492", "0.657492", "0.657492", "0.657492", "0.657492", "0.657492", "0.65685713", "0.65685713", "0.6560455", "0.6539242", "0.6539242", "0.6539242", "0.6539242", "0.6539242", "0.6539242", "0.6539242", "0.6539242", "0.6539242", "0.6539242", "0.65055674", "0.64586765", "0.6456588", "0.6426112", "0.64031667", "0.64008904", "0.6390409", "0.63897234", "0.6374177", "0.6366308", "0.63608754", "0.6359128", "0.63481355", "0.63426155", "0.63212603", "0.63201845", "0.6306879", "0.63053405", "0.6303944", "0.62958753", "0.6282354", "0.6270226", "0.62668246", "0.6261597", "0.62606347", "0.6254061", "0.6238609", "0.62325776", "0.6226129", "0.6214932", "0.6214932", "0.6213893", "0.6210477", "0.6199657", "0.6197411", "0.6191134", "0.6189852", "0.61780953", "0.6177196", "0.6176668", "0.61759454", "0.61676174", "0.61579984", "0.6152638", "0.6146624", "0.614127", "0.6136672", "0.6127441", "0.61217576", "0.6118276", "0.611718", "0.6100401", "0.6097115", "0.60914755", "0.60799706", "0.60799706", "0.60756475", "0.6073928", "0.6071163", "0.60651773", "0.60651773", "0.6062426", "0.60612774", "0.60612774", "0.60612774", "0.60612774", "0.60612774", "0.60612774", "0.60612774", "0.60612774", "0.60612774" ]
0.0
-1
start of an insert query
into(s_table) { return qb_insert({ into: s_table, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function agenda_insert() {\n\tdb.transaction(agenda_insert_db, errorDB, successDB);\n}", "function insertQueries() {\n\n }", "function pet_insert() {\n\tdb.transaction(pet_insert_db, errorDB, successDB);\n}", "Insert() {\n\n }", "function queryInsert(sql, cb) {\n con.query(sql, (err, _) => {\n cb((!err) ? 1 : 0);\n });\n}", "function insertQuery() {\n var interesse = $('#query-input').val();\n\n databaseManager\n .query(\"INSERT INTO interesses (INTERESSE) VALUES (?)\", [interesse])\n .done(function () {\n alert(\"Interesse is in de database toegevoegd!\");\n loadController(CONTROLLER_ADMIN_HOME);\n })\n .fail(function () {\n alert(\"Interesse is in de database toegevoegd!\")\n });\n }", "static insertNew(to,t,p,cb){\n\t\tquery.execute(conn, 'echec','insert data {:cell'+to+' rdf:type <'+t+'> . :cell'+to+' rdf:type <'+p+'>}',\n\t\t'application/sparql-results+json', {\n\t\t\toffset:0,\n\t\t\treasoning: true\n\t\t}).then(res =>{\n\n\t\t\t//On lance l affichage\n\t\t\tinit.run(cb);\n\t\t}).catch(e=> {console.log(e);});\n\t}", "function insertData(sqlQuery, obj, successFn, errFn){\r\n console.log(\"\\nSQL Query::\"+sqlQuery);\r\n console.log(\"\\nObJ : \" + obj);\r\n connMgr.getConn(function (connection) {\r\n connection.query(sqlQuery, obj, function(err,res){\r\n if(err) throw err;\r\n if(successFn)successFn(obj, res.insertId);\r\n if(res != undefined)\r\n console.log('Last insert ID:', res.insertId);\r\n }, errFn);\r\n });\r\n}", "function runInsertionStep(){\n if(!insertionStarted){\n insertionStart();\n }else{\n insertionStep();\n }\n}", "insert() { }", "function addTable(posit) {\n var query = connection.query('insert into Position set ?', posit, function(err, result) {\n if (err) {\n console.error(err);\n return false;\n } else {\n console.log(query.sql)\n return true;\n }\n })\n}", "function successInsert() {\n console.info(\"Success: Create table: friend successful.\");\n }", "async insert(data) {\n const sql = `INSERT INTO ${this.table} SET ?`;\n const result = await this.db.query(sql, data);\n return result;\n }", "function insert() {\r\n let query = \"command=insert\"; //https://eia2-michel.herokuapp.com/command=insert&name=peter&punkte=100\r\n query += \"&name=\" + HabosHaihappen.spielerName;\r\n query += \"&punkte=\" + HabosHaihappen.highscore;\r\n sendRequest(query, handleInsertResponse);\r\n }", "function insertIntoSunDetails(sunConn,trans,rows,headerID,userID,month){\nlet requestString=\"INSERT INTO PK1_PSTG_DETAIL \"\nlet reaminString=\" VALUES\"\nlet rowsNum=rows.length\nrows.forEach(row=>{\n // console.log(row);\nreaminString+=`('${headerID}','${rowsNum}',`\nrowsNum-=1\ntrans.forEach(element=>{\n if(element.isConst===false){\n let position=hrmsColumns[element.mappedVal]\n reaminString+=`'${row[position].value}',`\n }\n else{\n reaminString+=`'${element.mappedVal}',`\n }\n})\nreaminString = reaminString.substring(0, reaminString.length - 1);\nreaminString+='),'\n\n})\nreaminString = reaminString.substring(0, reaminString.length - 1);\nreaminString+=';'\nrequestString+=reaminString\n//console.log(requestString);\n\nreturn new Promise((resolve,reject)=>{\n request = new Request(requestString, (err,rowCount,rows)=> { \n if (err) { \n reject(err.message)\n console.log(err.message);\n }\n else{\n console.log(rowCount+' rows inserted')\n }\n });\n request.setTimeout(300000);\n request.on('requestCompleted', function() { \n console.log('transformation done')\n if(forceTransFlag==false){\n createLog(userID,month)\n }\n else{\n updateLog(userID,month)\n }\n resolve(1)\n }); \n sunConn.execSql(request); \n})\n}", "insert(h_query) {\n\n\t\t// ref insert list\n\t\tlet a_inserts = h_query.insert;\n\n\t\t// prep list of rows that have been observed from first element\n\t\tlet a_keys = Object.keys(a_inserts[0]);\n\n\t\t// build columns part of sql string\n\t\tlet s_keys = a_keys.map(s_key => `\"${s_key}\"`).join(',');\n\n\t\t// build values part of sql string\n\t\tlet a_rows = [];\n\n\t\t// each insert row\n\t\ta_inserts.forEach((h_row) => {\n\n\t\t\t// list of values to insert for this row\n\t\t\tlet a_values = [];\n\n\t\t\t// each key-value pair in row\n\t\t\tfor(let s_key in h_row) {\n\n\t\t\t\t// key is missing from accepted values section\n\t\t\t\tif(-1 === a_keys.indexOf(s_key)) {\n\t\t\t\t\treturn local.fail('new key \"${s_key}\" introduced after first element in insert chain');\n\t\t\t\t}\n\n\t\t\t\t// append to values\n\t\t\t\ta_values.push(valuify(h_row[s_key]));\n\t\t\t}\n\n\t\t\t// push row to values list\n\t\t\ta_rows.push(`(${a_values.join(',')})`);\n\t\t});\n\n\t\t//\n\t\tlet s_tail = '';\n\n\t\t//\n\t\tif(h_query.conflict_target && h_query.conflict_action) {\n\t\t\ts_tail += `on conflict ${h_query.conflict_target} ${h_query.conflict_action}`;\n\t\t}\n\n\t\t// prep sql query string\n\t\treturn `insert into \"${h_query.into}\" (${s_keys}) values ${a_rows.join(',')} ${s_tail}`;\n\t}", "function agenda_insert_db(tx) {\n\tvar nome = $(\"#agenda_nome\").val();\n\tvar tel = $(\"#agenda_telefone\").val();\n\ttx.executeSql('INSERT INTO Agenda (nome, tel) VALUES (\"' + nome + '\", \"' + tel + '\")');\n\tagenda_view();\n}", "function insertRecord(){\n\n var usernametemp = $('input:text[id=username]').val();\n\n var usernameemailtemp = $('input:text[id=useremail]').val();\n\n db.transaction(function (tx){ tx.executeSql(insertStatemen); });\n\n //tx.executeSql(SQL Query Statement,[ Parameters ] , Sucess Result Handler Function, Error Result Handler Function);\n}", "function tableInsertionCallback(err) {\n if (err) {\n console.log(\"userdb; new user insertion error\", err);\n } else {\n console.log(\"userdb; new user insertion success\");\n }\n }", "static createInsert(queryObject){\n let prototype = 'INSERT INTO ' + queryObject.structure.table;\n if(queryObject.structure.insertColumns.length>0){\n prototype += '( '\n for(let i = 0; i < queryObject.structure.insertColumns.length; i++){\n prototype += queryObject.structure.insertColumns[i]\n if(i!=queryObject.structure.insertColumns.length-1){\n prototype+= ', '\n }\n else{\n prototype+= ' '\n }\n }\n prototype += ') '\n }\n else{\n prototype += ' '\n }\n prototype += 'VALUES'\n let queryString = [];\n for(let i = 0; i < queryObject.structure.insertValues.length; i++){\n let values = '( ';\n for(let j = 0; j < queryObject.structure.insertValues[i].length; j++){\n if(typeof(queryObject.structure.insertValues[i][j])==typeof(\"\")){\n values += \"'\"+queryObject.structure.insertValues[i][j]+\"'\";\n } else if(queryObject.structure.insertValues[i][j].isDate){\n values += `TO_DATE( '${queryObject.structure.insertValues[i][j].date}', '${queryObject.structure.insertValues[i][j].format}')`;\n } \n else{\n values += Query.checkForBooleans(queryObject.structure.insertValues[i][j]);\n }\n if(j!=queryObject.structure.insertValues[i].length-1){\n values+= ', '\n }\n else{\n values+= ' '\n }\n }\n values += ') ';\n queryString.push(prototype+values+(queryObject.structure.returnId?\"RETURN id INTO :id\":\"\"));\n }\n return queryString[0];\n }", "function querySuccess(tx, results) {\n //results of SELECT statement\n //var len = results.rows.length;\n //alert(\"DIARY table: \" + len + \" rows found.\");\n //for (var i=0; i<len; i++){\n //alert(\"Row = \" + i + \" ID = \" + results.rows.item(i).entry_id + \" Title = \" + results.rows.item(i).title);\n //}\n //results of INSERT statement\n //console.log(\"Insert ID = \" + results.insertId);\n //console.log(\"Rows Affected = \" + results.rowAffected);\n //console.log(\"Insert ID = \" + results.rows.length);\n $('#success').append(\"<br><h3>Successfully added to your diary!<h3><br>\");\n}", "function insertTempObra(x) {\n //code Insertando avances fisicos\n \n if (AOTI && x >= AOTI.length) {\n //code\n console.log(\"Todas las inserciones terminadas:::::::::::::::::::::::::::::::::\");\n location.href=\"mapa_proyectos.html\";\n // insertarAvanceFinancieroProyectos(0);\n }\n \n else if (AOTI && AOTI.length > 0) {\n console.log(\"Cargando datos espere un momento ::: 4 X=\" + x + \" Avances: \"+ AOTI.length);\n \n \n \n db.transaction(function(tx) {\n \n tx.executeSql('INSERT INTO TempAvanceObras(idAvanceFinanciero, idAvanceFisico, idObra)' +\n ' VALUES (?, ?, ?)',\n [AOTI.item(x).idAvanceFinanciero, AOTI.item(x).idAvanceFisico, AOTI.item(x).idObraFisico]);\n console.log(\"Avance Temp en Proyectos: \" + AOTI.item(x).idObraFisico);\n \n \n }, errorCB, function (){\n console.log(\"Se inserto correctamente el avance temporal: \" + AOTI.item(x).idObraFisico);\n \n x++;\n insertTempObra(x);\n \n }); \n \n } else {\n console.log(\"No hay avances temporales de obra :::::::::::::::::::::::\");\n // insertarAvanceFinancieroProyectos(0);\n }\n}", "function insertToUserData() {\n var request = new Request();\n var sql = \"INSERT INTO userData (id, password) VALUES ('emma', 'lalala')\";\n\n request = new Request(sql, (err, rowCount, rows) => {\n console.log(rowCount + ' row(s) returned');\n process.exit();\n });\n \n connection.execSql(request);\n}", "function pet_insert_db(tx) {\n\n\tvar nome = $(\"#pet_nome\").val();\n var qtd = $(\"#pet_qtd\").val();\n var preco = $(\"#pet_preco\").val();\n\n //converter \n qtd = parseInt(qtd); \n preco = parseFloat(preco);\n\n //parar a inserção chama validação do forms jquery\n if(nome.length < 3 || qtd <=0 || preco <=0 ){\n return false;\n }\n if(nome =='' || qtd =='' || preco ==''){\n return false;\n }\n \n\n //-------------------------------------------------\n tx.executeSql('INSERT INTO Pet (nome, qtd, preco) VALUES (\"' + nome.toUpperCase() + '\", \"' + qtd + '\", \"' + preco + '\")');\n \n cadastrado();\n\n\tpet_view();\n}", "function insertTemp(x) {\n //code Insertando avances fisicos\n \n \n \n if (APTI && x >= APTI.length) {\n //code\n console.log(\"Cargando datos espere un momento vamos a insertar avances temporales de Obra::: X=\" + x );\n \n insertarTempAvancesObras();\n }\n \n else if (APTI && APTI.length > 0) {\n console.log(\"Cargando datos espere un momento ::: 4 X=\" + x + \" Avances: \"+ APTI.length);\n \n \n \n db.transaction(function(tx) {\n \n tx.executeSql('INSERT INTO TempAvanceProyectos(idAvanceFinanciero, idAvanceFisico, idProyecto)' +\n ' VALUES (?, ?, ?)',\n [APTI.item(x).idAvanceFinanciero, APTI.item(x).idAvanceFisico, APTI.item(x).idProyectoFisico]);\n console.log(\"Avance Temp en Proyectos: \" + APTI.item(x).idProyectoFisico);\n \n \n }, errorCB, function (){\n console.log(\"Se inserto correctamente el avance temporal: \" + APTI.item(x).idProyectoFisico);\n \n x++;\n insertTemp(x);\n \n }); \n \n } else {\n console.log(\"No hay avances temporales de proyecto :::::::::::::::::::::::\");\n // insertarAvanceFinancieroProyectos(0);\n }\n}", "function onInsertRowBefore() {\n onInsertRow(0);\n }", "static insert (confNo, vtname, cellphone, dlicense, fromDate,\n fromTime, toDate, toTime, callback) {\n const insertQuery = `INSERT INTO reservation(confNo, vtname, cellphone, dlicense, \n fromDate, fromTime, toDate, toTime) VALUES($1, $2, $3, $4, $5, $6, $7, $8) \n RETURNING *;`\n db.query(insertQuery, [confNo, vtname, cellphone, dlicense, fromDate,\n fromTime, toDate, toTime], (err, res) => {\n if (err.error)\n return callback(err);\n callback(res);\n });\n }", "function insertDB(tx, user) {\n // store the template SQL string\n var sql = 'INSERT INTO users (role, name, username, email, password, description) VALUES (?,?,?,?,?,?)';\n // execute the query with user information from the user object\n tx.executeSql(sql, [user.role, user.name, user.username, user.email, user.password, user.description], function(tx){registerSuccessDB(tx, user)}, errorCB);\n}", "insert() {\r\n var sql = 'INSERT INTO post (id, title, text) VALUES (?,?,?)'\r\n var params = [this.id, this.title, this.text]\r\n db.run(sql, params, function (err, result) {\r\n if (err) {\r\n throw err // TODO: useful error handling here...\r\n return\r\n }\r\n });\r\n }", "function testSinglePlan_Insert() {\n asyncTestCase.waitForAsync('testSinglePlan_Insert');\n assertEquals(0, cache.getCount());\n\n var queryTask = new lf.proc.UserQueryTask(\n hr.db.getGlobal(), [getSampleQuery()]);\n queryTask.exec().then(function() {\n return lf.testing.util.selectAll(global, j);\n }).then(function(results) {\n assertEquals(ROW_COUNT, results.length);\n assertEquals(ROW_COUNT, cache.getCount());\n for (var i = 0; i < ROW_COUNT; ++i) {\n assertEquals(rows[i].id(), results[i].id());\n assertObjectEquals(rows[i].payload(), results[i].payload());\n }\n asyncTestCase.continueTesting();\n }, fail);\n}", "function GuardarPagina(numpage){\n\n db.transaction(InsertPage,errorinsertPage, successinsertPage);\n\n var sql = \"INSERT INTO Paginas (ID_Paginas,ID_Cuento) \";\n sql += \"VALUES ('\"+ numpage +\"', '\"+ CuentoActual.ID.split('_')[1] +\"')\";\n function InsertPage(tx) {\n tx.executeSql(sql);\n }\n\n function errorinsertPage(tx, err) {\n alert(\"Error al guardar página: \"+err);\n }\n\n function successinsertPage() {\n }\n}", "function processInsert(param) {\n\n var args = {\n targetid: \"frmData_상세\"\n };\n gw_com_module.formInsert(args);\n\n}", "function insertQueryBestemming() {\n var bestemming = $('#query-input-bestemming').val();\n\n databaseManager\n .query(\"INSERT INTO bestemmingen (BESTEMMING) VALUES(?)\", [bestemming])\n .done(function () {\n alert(\"Bestemming is in de database toegevoegd!\");\n loadController(CONTROLLER_ADMIN_HOME);\n })\n .fail(function (reason) {\n console.log(reason);\n alert(\"Bestemming is niet in de database toegevoegd!\");\n });\n }", "function addItemsPuertasItemsProteccion(k_coditem,o_descripcion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO puertas_items_proteccion (k_coditem, o_descripcion) VALUES (?,?)\";\n tx.executeSql(query, [k_coditem,o_descripcion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n $('#texto_carga').text(\"Creando items protección...Espere\");\n });\n}", "function tableInsertionCallback(err) {\n if (err) {\n console.log(\"data storing error\", err);\n respondObject.status = \"data storing error\";\n res.json(respondObject);\n } else {\n console.log(\"data stored\");\n respondObject.status = \"data stored\";\n res.json(respondObject);\n //db.close();\n }\n }", "function insertStatement(ent) {\n var columns = [];\n var inputs = [];\n var p, query, entp;\n\n entp = makeEntity.forInsertion(ent);\n\n for ( p in entp ) {\n columns.push(p);\n inputs.push(entp[p]);\n }\n query = 'INSERT INTO ' + tablename(ent) + ' (' + columns.join(', ') + ') VALUES (' + inputs.join(', ') + ')';\n return query;\n}", "function insSQL(){\n var sql = 'INSERT INTO pim_transfers(';\n sql += 'user_id, manufacturer_id, from_id, to_id, products, status_id, delivery_date, type_id, notes)VALUES(';\n sql += '$1::integer, $2::integer, $3::integer, $4::integer, $5::json, $6::integer,';\n sql += ' $7::timestamp without time zone, $8::integer, $9::json) RETURNING id;';\n return sql;\n}", "function batchInsertSubmit(){\n\tif(typeof($('#bInsert').attr('id')) == 'undefined'){\n\t\talertMsg.warn('请添加行!');\n\t}else{\n\t\t$('#bInsert').submit();\n\t}\n}", "async insert(request, insertCode) {\n const data = this.requestParser.getData(request);\n const source = this.requestParser.getSource(request);\n if(data instanceof Array) {\n let result = [];\n for(let i = 0; i < data.length; i++) {\n let insertQuery = this.queryConverter.toCypherInsert(data[i], insertCode);\n result[i] = await this.executeQuery(insertQuery, source);\n }\n return result;\n } else {\n const insertQuery = this.queryConverter.toCypherInsert(data, insertCode);\n const result = await this.executeQuery(insertQuery, source);\n return result;\n }\n }", "function insertEntry( dbc ) {\n\n var query,\n binds = [],\n options = { autoCommit: true };\n\n query = ' INSERT INTO testdta.F559811 VALUES (:jpfndfuf2, :jpsawlatm, :jpactivid, :jpyexpst, :jpblkk, :jppid, :jpjobn, :jpuser, :jpupmj, :jpupmt ) ';\n binds.push( row[ 0 ] );\n binds.push( audit.createTimestamp() );\n binds.push( hostname );\n binds.push( '100' );\n binds.push( row[ 1 ] + ' ' + row[ 2 ] );\n binds.push( 'PDFMONITOR' );\n binds.push( 'CENTOS' );\n binds.push( 'DOCKER' );\n binds.push( row[ 1 ] );\n binds.push( row[ 2 ] );\n\n // Insert entry into the F559811 DLINK Post PDF Handling Queue\n odb.performSQL( dbc, query, binds, options, function( err, result ) {\n\n if ( err ) {\n \n result = jdeJobName + ' INSERT FAILED ' + err;\n\n } else {\n\n result = jdeJobName + ' INSERTED' ;\n\n }\n\n log.i( result );\n return cb( null, result );\n\n });\n }", "insertOne(table,cols,vals,cb) {\n let query = `INSERT INTO ${table}`;\n query += ` (${cols.toString()}) `;\n query += ` VALUES (${printQuestionMarks(vals.length)})`;\n \n connection.query(query,vals,(err,result) =>{\n if(err) throw err;\n cb(result);\n });\n }", "async insertTx(txLog) {\n const { from, to, from_id, to_id, value } = txLog;\n const detail = txLog.category;\n const sql = \"INSERT INTO transaction VALUES (null, ?, ?, ?, ?, ?, ?, now());\"\n const holder = [from_id, from, to_id, to, value, detail];\n const connection = await mysql.createConnection(\n {\n host: process.env.MYSQL_HOST,\n user: process.env.MYSQL_USER,\n password: process.env.MYSQL_PASSWORD,\n port: process.env.MYSQL_PORT,\n database: process.env.MYSQL_DATABASE,\n }\n );\n await connection.execute(sql, holder)\n }", "function insertdata() {\n getData.getAllData().then(function() {});\n }", "function insert(query, params, response) {\n connection.query(query, params, (error, result) => {\n if (error) {\n response.status(500);\n response.json({\n ok: false,\n results: error.message,\n });\n } else {\n response.json({\n ok: true,\n results: result.insertId,\n });\n }\n });\n}", "function onInsertRowAfter() {\n onInsertRow(1);\n }", "function populateDB(tx) {\r\n try {\r\n var clt_id = UploadLocationPhotoInfo.clt_id;\r\n var objid = UploadLocationPhotoInfo.objid;\r\n var photoTime = UploadLocationPhotoInfo.photoTime;\r\n //alert(UploadLocationPhotoInfo.clt_id + '\\n' + UploadLocationPhotoInfo.objid + '\\n' + UploadLocationPhotoInfo.photoTime + '\\n' + syncTime);\r\n //alert(clt_id + '\\n' + objid + '\\n' + photoTime + '\\n' + syncTime);\r\n tx.executeSql(\"Insert Into SyncLog([clt_id], [objid], [photoTime], [syncTime]) Values(?, ?, ?, ?)\",\r\n //[UploadLocationPhotoInfo.clt_id, UploadLocationPhotoInfo.objid, UploadLocationPhotoInfo.photoTime, syncTime],\r\n [clt_id, objid, photoTime, syncTime],\r\n syncLogPhotoSuccess, errorSyncLogPhoto);\r\n // tx.executeSql(\"Insert Into SyncLog([clt_id], [objid], [photoTime], [syncTime]) Values(?, ?, ?, ?)\",\r\n // [UploadLocationPhotoInfo.clt_id, UploadLocationPhotoInfo.objid, UploadLocationPhotoInfo.photoTime, syncTime],\r\n // syncLogPhotoSuccess, errorSyncLogPhoto);\r\n //tx.executeSql(\"Insert Into [SyncLog] ([clt_id], [objid], [photoTime], [syncTime]) Values ('Diamond Bank', '1000019', '2014-08-08 09:28:48', '2014-08-11 02:00:48');\",\r\n // [], syncLogPhotoSuccess, errorSyncLogPhoto);\r\n //tx.executeSql(\"Insert Into [SyncLog] ([clt_id], [objid], [syncTime]) Values ('Diamond Bank', '1000019', '2014-08-11 02:00:48')\",\r\n // [], syncLogPhotoSuccess, errorSyncLogPhoto);\r\n //tx.executeSql(\"Select [clt_id], [objid], [photoTime], [syncTime] From [SyncLog];\",\r\n // [], syncLogPhotoSuccess, errorSyncLogPhoto);\r\n }\r\n catch (err) {\r\n alert(err.message);\r\n }\r\n }", "insert() {\n return true;\n }", "function afficheInsert(){\n\t\n\tinsert = Initxhr();\n\t\n\tvar url = 'insert.php';\n\n\tinsert.onreadystatechange = traiterInsert;\n\tinsert.open( \"GET\", url, true );\n\tinsert.send( null );\n}", "insert() { return true; }", "insertOne(table, cols, vals, cb) {\n const search = `INSERT INTO ${table} (${cols.toString()}) VALUES (${printQuestionMarks(vals.length)})`;\n console.log(\"the search is \" + search);\n console.log('values ' + vals);\n connection.query(search,vals, (err, results) => {\n if (err) throw err;\n cb(results);\n })\n }", "function createTransaction() {\n const sql = `INSERT INTO ${table} VALUES ('1')`;\n\n const request = new Request(sql, (err, rowCount) => {\n if (err) {\n console.log('Insert failed');\n throw err;\n }\n\n console.log('new Request cb');\n\n // Call connection.beginTransaction() method in this 'new Request' call back function\n beginTransaction();\n });\n\n connection.execSql(request);\n}", "function insertInto() {\n // create database connection\n let db = createConnection();\n\n // AUTO POPULATE DATABASE USING FAKER LIBRARY\n let data = [];\n let i;\n for (i = 1; i <= 3; i++) {\n data.push([\n faker.address.streetAddress(),\n faker.address.city(),\n faker.address.state(),\n faker.address.zipCode(),\n getRandomInt(500, 1000), // price\n getRandomInt(300, 1200), // size\n getRandomInt(1, 5), // room\n getRandomInt(1, 3), // bathroom\n faker.image.city(), // fake city image\n \"house\",\n getRandomInt(1, 10)\n ]);\n } // end for loop\n\n // Database query\n let sql =\n \"INSERT INTO property (address, city, state, zipcode, price, size, room, bathroom, img, type, distance) VALUES ?\";\n db.query(sql, [data], function(err, result, field) {\n if (err) throw err;\n console.log(\"Values inserted into table successfully...\");\n }); // end query\n} // end inserInto()", "async insert(table, item) {\n try {\n let query = \"INSERT INTO \" + table + \" (\";\n let queryParams = [];\n for (let key in item) {\n query += `${key}, `;\n }\n query = query.slice(0, query.length - 2);\n query += \")\\nVALUES (\";\n for (let key in item) {\n query += \"?, \";\n queryParams.push(item[key]);\n }\n query = query.slice(0, query.length - 2);\n query += \");\";\n const output = await this.pool.query(query, queryParams);\n return output;\n } catch (e) {\n console.error(\"db.insert error: \", e);\n throw e;\n }\n }", "function addItemsPuertasItemsPreliminar(k_coditem,o_descripcion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO puertas_items_preliminar (k_coditem, o_descripcion) VALUES (?,?)\";\n tx.executeSql(query, [k_coditem,o_descripcion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n $('#texto_carga').text(\"Creando items preliminares...Espere\");\n });\n}", "async function insertNewDoctorVisit(body) {\r\n const [ results ] = await mysqlPool.query(\r\n 'INSERT INTO doctorvisit SET ?',\r\n body\r\n );\r\n\r\n return results.insertId;\r\n}", "function insertdb(user_name, user_password, user_email,fisrt_name,last_name, callback) {\n var sql=\"INSERT INTO user (user_name,user_password,user_email,fisrt_name,last_name) VALUES ('\" + user_name + \"','\" + user_password + \"','\" + user_email + \"','\"+ fisrt_name + \"','\" + last_name + \"' ) \";\n connection.query(sql, function(err, result, fields) {\n if (err) {\n console.log('this.sql', this.sql); //command/query\n callback(err, null);\n } else callback(null, result);\n });\n}", "function addItemsEscalerasItemsProteccion(k_coditem,o_descripcion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO escaleras_items_proteccion (k_coditem, o_descripcion) VALUES (?,?)\";\n tx.executeSql(query, [k_coditem,o_descripcion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n $('#texto_carga').text(\"Creando items protección...Espere\");\n });\n}", "function constructInsertQuery( p_table, p_data ){\n // The # of properties there are in the object\n var len = getObjLength( p_data ); \n // Keeping track of object's size\n var keyCount = 0; \n // strings that will have the column field names and values\n var col_string = \"\";\n var val_string = \"\";\n\n var sql = \"INSERT INTO \" + p_table;\n for( key in p_data ){\n col_string += key;\n \n val_string += (key != \"the_geom\") ? \"'\":\"\";\n\n for( var i=0; i < p_data[key].length; i++ ){\n val_string += p_data[key][i]; \n if( p_data[key].length > 1 && i < p_data[key].length-1 ){\n val_string += \", \"; \n }\n }\n val_string += (key != \"the_geom\") ? \"'\":\"\";\n\n keyCount++; \n if(keyCount < len){\n col_string += \", \";\n val_string += \", \";\n } \n }\n sql += \" (\" + col_string + \") VALUES (\" + val_string + \")\";\n return sql;\n}", "function addItemsAscensorItemsProteccion(k_coditem,o_descripcion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO ascensor_items_proteccion (k_coditem, o_descripcion) VALUES (?,?)\";\n tx.executeSql(query, [k_coditem,o_descripcion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n $('#texto_carga').text(\"Creando items protección...Espere\");\n });\n}", "insertNewUser(state: Object, callback: (status: string, data: Event) => mixed) {\n if (state.organiser) {\n super.query(\n \"INSERT INTO organiser (organiser_email, hash, salt, name, image, tlf, description, address, website) VALUES(?,?,?,?,?,?,?,?,?);INSERT INTO ticket_type (name, description, organiser_id) VALUES ('Ordinær Billett','Vanlig billett',LAST_INSERT_ID()),('Ståbillett','Ståplass',LAST_INSERT_ID()),('Sittebillett','Sitteplass',LAST_INSERT_ID());\",\n [\n state.email,\n state.hash,\n state.salt,\n state.name,\n state.imageUrl,\n state.tlf,\n state.description,\n state.address,\n state.website,\n ],\n callback,\n );\n } else {\n super.query(\n 'INSERT INTO user (email, name, hash, salt, image, description, tlf) VALUES(?,?,?,?,?,?,?)',\n [\n state.email,\n state.name,\n state.hash,\n state.salt,\n state.imageUrl,\n state.description,\n state.tlf,\n ],\n callback,\n );\n }\n }", "function insertTrack(insertStatementsArray){\n console.log(\"Updating database...\");\n // Begin a transaction. \n db.serialize(function () {\n db.exec('begin transaction'); \n var request = [];\n for(var i = 0; i < insertStatementsArray.length; i++){\n var promise = new Promise(function(resolve){\n db.run(\"INSERT INTO ITUNES_LIBRARY VALUES (?, ?, ?, ?, ?) \", insertStatementsArray[i].c1, insertStatementsArray[i].c2, insertStatementsArray[i].c3, insertStatementsArray[i].c4, insertStatementsArray[i].c5);\n resolve();\n request.push(promise);\n });\n }\n \n Promise.all(request).then(function(values){\n console.log(\"now we're here\");\n \n db.exec('COMMIT')\n .close(function(){\n console.log(\"Happy Panda :-) Database updated with all your music.\");\n });\n \n });\n });\n}", "function dbPeopleInsert(Pname, Ptitle, Pdate,Psalary)\n{\n var db = dbGetHandle()\n var rowid = 0;\n db.transaction(function (tx) {\n tx.executeSql('INSERT INTO people_DB VALUES(?, ?, ?, ?)',\n [Pname, Ptitle, Pdate,Psalary])\n var result = tx.executeSql('SELECT last_insert_rowid()')\n rowid = result.insertId\n })\n return rowid;\n}", "insert(rows) {\n let rowItems = [];\n\n if (Object.prototype.toString.call(rows) === \"[object Array]\") {\n rowItems = rows;\n } else if (typeof rows === \"object\") {\n rowItems.push(rows);\n };\n\n rowItems.forEach((rowItem) => {\n let keys = [],\n values = [],\n statement;\n\n Object.keys(rowItem).forEach(key => {\n keys.push(key);\n values.push(\"\\\"\" + rowItem[key] + \"\\\"\");\n });\n\n let transactionArgs = {\n id: this.database.identifyTransaction(),\n statement: this.database.sanitizeStatement(`\n INSERT INTO ${this.tableName}\n (${keys.join(\",\")}) VALUES\n (${values.join(\",\")})\n `)\n };\n\n this.database.transaction(transactionArgs);\n\n this.database.on(transactionArgs.id, (data) => {\n if (data.status === \"error\")\n return console.error(`Could not insert row in to table ${this.tableName}`, data.result);\n\n this.setupRows(data.result.rows);\n }, true);\n });\n\n return this;\n }", "function insertvalues(tx,dynamicTableValues) {\r\n \r\n\tvar query = 'INSERT INTO ' + dynamicTableValues[0] +' VALUES(';\r\n \r\n for(var i = 1; i < dynamicTableValues.length; i++)\r\n {\r\n \t//query = query + \"'\" + dynamicTableValues[i] + \"'\" ;\r\n \tquery = query + '\"' + dynamicTableValues[i] + '\"' ; \r\n \t\r\n \tif(i != (dynamicTableValues.length - 1 ))\r\n \t\tquery = query + ',';\r\n }\r\n query = query + ')';\r\n \r\n console.log(query);\r\n \r\n tx.executeSql( query );\r\n}", "function prepareSQL() {\n const sql = `INSERT INTO ${table} VALUES (@val1, @val2)`;\n\n const request = new Request(sql, (err, rowCount) => {\n if (err) {\n throw err;\n }\n\n });\n\n // Must add parameters\n request.addParameter('val1', TYPES.Int);\n request.addParameter('val2', TYPES.Int);\n\n request.on('prepared', () => {\n console.log('request prepared');\n executePreparedSQL(request);\n });\n\n connection.prepare(request);\n}", "insert(tableName, data){\n\t\t\tif(this.hasTable(tableName)){\n\t\t\t\tdata.id = typeof data.id === 'undefined' ? this.tableNextId[tableName] : data.id;\n\n\t\t\t\ttry {\n\t\t\t\t\tlet fieldData = this.generateFieldData(tableName, data);\n\t\t\t\t\tthis.tableData[tableName].push(fieldData);\n\t\t\t\t\tthis.tableNextId[tableName]++;\n\n\t\t\t\t\treturn {code: 'code005', content: '添加成功!'};\n\t\t\t\t}catch(e){\n\t\t\t\t\tlet matches = e.toString().match(/^Error: (code\\d+):(.*)$/);\n\t\t\t\t\treturn {code: matches[1], content: matches[2]};\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {code: 'code006', content: '添加失败!'};\n\t\t}", "async beginTransaction() {\n await this.executeSQL(sqlBeginTransaction,[]);\n }", "insert(table) {\n return new DBInserter(this, table);\n }", "function insertData(data) {\n db.concerts.insert(data, {continueOnError: true}, function(err, docs){\n // code = 11000 : duplicate key. code = 13027 : Point out of geo point interval\n if(err && !err.code != 11000 && !err.code != 13027){\n logger.warn(err);\n }\n else logger.info('concerts inserted successfully!\\n');\n });\n}", "function makeInsert(table, params, cb) {\n let sql = \"\";\n if (table == \"items\") {\n sql = \"insert into items (creatorid, name, description, starting_bid, deadline, contact, image, status, highest_bidder) values (\";\n sql += params.loginID + \",\\\"\" + params.name + \"\\\",\\\"\" + params.description + \"\\\",\" + params.starting_bid;\n sql += \",\\\"\" + params.deadline + \"\\\",\";\n sql += (params.contact != '') ? params.contact : \"0\";\n sql += \",\";\n sql += \"\\\"\" + params.image + \"\\\",\\\"N\\\", \" + params.loginID + \");\";\n } else {\n sql = \"insert into users (rno, name, pwd, pno) values (\\\"\" + params.rno + \"\\\", \\\"\";\n sql += params.name + \"\\\", \\\"\" + md5(params.pwd) + \"\\\", \" + params.pno + \");\";\n }\n queryInsert(sql, (res) => {\n cb(res);\n });\n}", "function InsertarCuentos(Cuentos) {\n\n db.transaction(InsertCuentos, errorinsertCuentos, successinsertCuentos);\n\n var sql = \"INSERT OR REPLACE INTO Cuentos (NombreCuento,ID_Colecciones) \";\n sql += \"VALUES ('\" + Cuentos.Nombre + \"', '\" + Cuentos.Coleccion + \"')\";\n function InsertCuentos(tx) {\n tx.executeSql(sql);\n }\n\n function errorinsertCuentos(tx, err) {\n alert(\"Error al Insertar cuentos: \" + err);\n }\n\n function successinsertCuentos() {\n // alert(\"success_hecho!\");\n }\n\n}", "function createProduct() {\n console.log(\"Inserting a new product...\\n\");\n var query = connection.query(\"INSERT INTO products SET ?\", {\n flavor: \"Rocky Road\",\n price: 3.0,\n quantity: 50\n }, function(err, res) {\n console.log(res.affectredRows + \" product inserted!\\n\");\n // Call updateProduct AFTER the INSERT completes\n updateProduct();\n });\n // logs the actual query being run\n console.log(query.sql);\n}", "function addData(question,answer,option1,option2,option3,table){ \n\tvar createSql=\"create table if not exists \"+table+\"(question text,answer text,option1 text,option2 text,option3 text)\";\n\tvar insertSql=\"insert into \"+table+\" values(?,?,?,?,?)\";\n\n db.transaction(function(tx)\n\t{ \t\n\t \ttx.executeSql(createSql,[])\n\t\ttx.executeSql(insertSql,[question,answer,option1,option2,option3],onSuccess,onError)\t\t\n }); \n}", "function InsertInformation(state_name, capital_name, latitude, longitude) {\r\n connection.beginTransaction(function(err) {\r\n if (err) {\r\n throw err;\r\n }\r\n\r\n var capitalQuery = \"insert into capital(capital_name, latitude, longitude) values('\" + capital_name + \"', \" + latitude + \", \" + longitude + \")\";\r\n connection.query(capitalQuery, function(err, result) {\r\n if (err) {\r\n return connection.rollback(function() {\r\n throw error;\r\n });\r\n }\r\n var capital_id = result.insertId;\r\n var stateQuery = \"insert into state(state_name) values('\" + state_name + \"')\";\r\n connection.query(stateQuery, function(err, result) {\r\n if (err) {\r\n throw err;\r\n }\r\n var state_id = result.insertId;\r\n var linkQuery = \"insert into state_capital_link(state_id, capital_id) values(\" + state_id + \", \" + capital_id + \")\";\r\n connection.query(linkQuery, function(err, result) {\r\n if (err) {\r\n throw err;\r\n }\r\n });\r\n\r\n connection.commit(function(err) {\r\n if (err) {\r\n connection.rollback(function() {\r\n throw err;\r\n });\r\n }\r\n });\r\n });\r\n });\r\n });\r\n}", "insertInfo(){\n var self = this;\n var str = \"\",\n length = self.column.length,\n table = self.table,\n last = self.column.length - 1;\n for(let x = 0; x < length ; x++){\n if( x === last){\n str += self.column[x];\n continue;\n }\n str += self.column[x]+\",\";\n }\n\n self.insert = `INSERT INTO ${table} (${str}) VALUES \\n`;\n\n}", "function beforeInsert(row, errors){\r\n beforeBoth(errors, row);\r\n}", "function insertRestaurants(r) {\n var lineno = 0;\n var execTime = 0;\n var variacao = 0;\n myInterface.on('line', function (line) {\n\n lineno++;\n let restaurant = JSON.parse(line);\n values = [restaurant.address.coord[0], restaurant.address.coord[1], restaurant.name]\n pool.query('insert into places values (ST_MakePoint($1, $2), $3);', values, (err, res) => {\n\n const after = Date.now();\n if (err) console.log('erro ao inserir');\n console.log((after - before) / 1000);\n \n })\n \n \n });\n}", "function addItemsEscalerasItemsPreliminar(k_coditem,o_descripcion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO escaleras_items_preliminar (k_coditem, o_descripcion) VALUES (?,?)\";\n tx.executeSql(query, [k_coditem,o_descripcion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n $('#texto_carga').text(\"Creando items preliminares...Espere\");\n });\n}", "function dbInsert(data, table) {\n return knex.insert(data).into(table).returning('id')\n .then(function(id){\n return id;\n })\n .catch(err => console.log('error caught', err))\n }", "function databaseInsert(query, params) {\n return new Promise((resolve, reject) => {\n db.run(query, params, (err) => {\n if (err) {\n reject(err);\n }\n else {\n resolve();\n }\n });\n })\n}", "function addItemsPuertasItemsElementos(k_coditem,o_descripcion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO puertas_items_elementos (k_coditem,o_descripcion) VALUES (?,?)\";\n tx.executeSql(query, [k_coditem,o_descripcion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n $('#texto_carga').text(\"Creando items elementos...Espere\");\n });\n}", "function startBatchTransaction() {}", "insert(item) {\n const valuesArray = Object.values(item)\n let paramsString = valuesArray.map((value, index) => `$${index + 1}`).join(', ')\n let columnsString = Object.values(this.TABLE.COLUMNS).join(', ')\n const queryString = `\n INSERT INTO ${this.TABLE.TABLE_NAME}(${columnsString}) \n VALUES(${paramsString})\n RETURNING *;\n `\n return sendRequest(queryString, valuesArray)\n\n }", "insertOne(cols, values, cb) {\n console.log(\"burgervals \" + values);\n orm.insertOne('burgers', cols, values, (res) => cb(res));\n }", "function complete(){\r\n var anotherSql = \"INSERT INTO chemical_in_container(chemical_id, container_barcode) VALUES ((SELECT chemical.chemical_id FROM chemical WHERE chemical.name = ?),?)\";\r\n var anotherInserts = [req.body.chemicalName, req.body.newContainerBarcode];\r\n anotherSql = mysql.pool.query(anotherSql,anotherInserts,function(error, results, fields){\r\n if(error){\r\n console.log(JSON.stringify(error));\r\n //res.write(JSON.stringify(error));\r\n //console.log(\"SORRY THAT CONTAINER DOES NOT EXIST IN THE DATABASE\");\r\n res.send(\"SORRY THAT CONTAINER DOES NOT EXIST IN THE DATABASE. THE CHEMICAL WAS STILL REGISTERED. PLEASE MOVE CHEMICAL TO AN EXISTING CONTAINER\");\r\n res.end();\r\n }else{\r\n res.redirect('/chemical');\r\n }\r\n });\r\n }", "function addInserts(batch, data) {\n if (typeof data.insert === 'undefined') return;\n\n for (var i = 0; i < data.insert.length; i++) {\n var doc = data.insert[i];\n\n if (typeof doc._id !== 'undefined') {\n doc._id = castId(doc._id);\n }\n\n batch.insert(doc);\n }\n }", "function createInsertSQL(allowedKeys, optionalKeys, table, data)\r\n{\r\n validate(data, allowedKeys, optionalKeys);\r\n\r\n const entryID = uuidv4();\r\n console.log(`Creating insert statement with ID: ${entryID}`)\r\n console.log(Object.entries(data).map((e) => `\"${e[0]}\" = \"${e[1]}\"`));\r\n const query = `INSERT INTO ${table} (id, ${Object.keys(data).map(mysql.escapeId).join(\", \")}) VALUES (${mysql.escape(entryID)}, ${Object.values(data).map((v) => `${mysql.escape(v)}`).join(\", \")}); `;\r\n console.log(`QUERY:`)\r\n console.log(\"\\x1b[32m%s\\x1b[0m\", query);\r\n return query;\r\n}", "function createTarea(nombre, descripcion, fechaInicio, fechaLimite, ponderacion, puntuacion, fkIdUsuario)\n{ \n\n con.connect(function(err)\n {\n /*\n if(err) throw err;\n con.query(\"SELECT * FROM imagenes\", function (err,result,fields)\n {\n con.end();\n if(err) throw err;\n console.log(result);\n }); */\n\n var post = {nombre: nombre, descripcion: descripcion, fechaInicio: fechaInicio, fkIdUsuario: fkIdUsuario};\n var query = con.query('INSERT INTO proyectos SET ?', post, function(err, result) {\n // Neat!\n con.end();\n });\n \n console.log(query.sql);\n\n});\n}", "function addItemsAscensorItemsPreliminar(k_coditem_pozo,o_descripcion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO ascensor_items_preliminar (k_coditem_preli, o_descripcion) VALUES (?,?)\";\n tx.executeSql(query, [k_coditem_pozo,o_descripcion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n $('#texto_carga').text(\"Creando items preliminares...Espere\");\n });\n}", "insertRowBefore() {\n this.insertRow();\n }", "async function insertNCCProfile(requestParams,context){\n if(requestParams.countryCode){\n var countryCode = requestParams.countryCode;\n var writeTable = \"INSERT INTO WM_NCC_PROFILE(ModificationFlag,CountryCode,NCCName,BankBranchNCC,BankNCCOfficeType,NewBankBranchNCC,BankName,BankBranchShortName,BankBranchFullName,BankBranchAddress,BankBranchPhoneCC,BankBranchPhoneNo,SWIFTBIC,IsNCCDP,DPNCC,SEPA,FieldA,FieldB)\"\n\t\t\t\twriteTable += \"VALUES ('\" + requestParams.ModificationFlag + \"','\" + requestBody.CountryCode + \"','\" + requestBody.NCCName + \"','\" + requestBody.BankBranchNCC + \"','\" + requestBody.BankNCCOfficeType + \"','\" + requestBody.NewBankBranchNCC + \"','\" + requestBody.BankName + \"',\"\n writeTable += \"'\" + requestBody.BankBranchShortName + \"','\" + requestBody.BankBranchFullName + \"','\" + requestBody.BankBranchAddress + \"','\" + requestBody.BankBranchPhoneCC + \"','\" + requestBody.BankBranchPhoneNo + \"','\" + requestBody.SWIFTBIC + \"','\" + requestBody.IsNCCDP + \"','\" \n writeTable += \"'\" + requestBody.DPNCC + \"','\" + requestBody.SEPA + \"','\" + requestBody.FieldA + \"','\" + requestBody.FieldB + \"')\"; \n\n const connQueryPromisified = util.promisify(connection.query).bind(connection);\n const result = await connQueryPromisified(writeTable);\n return {result};\n }\n else{\n return {\"status\":422,\"Message\":\"Required Params are missing\"};\n }\n}", "function addItemsAscensorItemsCabina(k_coditem_cabina,v_item,o_descripcion,v_clasificacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO ascensor_items_cabina (k_coditem_cabina, v_item, o_descripcion, v_clasificacion) VALUES (?,?,?,?)\";\n tx.executeSql(query, [k_coditem_cabina,v_item,o_descripcion,v_clasificacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n $('#texto_carga').text(\"Creando items cabina...Espere\");\n });\n}", "function addRow(data) {\n let insertQuery = \"INSERT INTO ?? (??,??) VALUES (?,?)\";\n let query = mysql.format(insertQuery, [\n \"todo\",\n \"user\",\n \"notes\",\n data.user,\n data.value,\n ]);\n pool.query(query, (err, response) => {\n if (err) {\n console.error(err);\n return;\n }\n // rows added\n console.log(response.insertId);\n });\n}", "function insertVol(id, preference){\n db.transaction(tx => {\n tx.executeSql(\n 'INSERT INTO volunteer_role_t (person_id, preference) VALUES (?,?)',\n [id, preference],\n (tx, results) => {\n console.log('Results', results.rowsAffected);\n if (results.rowsAffected > 0) {\n\n } else {\n alert('Registration Failed');\n }\n }\n );\n });\n}", "function quickinsertPERS( pFramedata )\r\n{\r\n var statements = [];\r\n\r\n if (pFramedata[\"PERSID\"] == undefined) \r\n {\r\n pFramedata[\"PERSID\"] = a.getNewUUID(); //Neue Person mit neuer ID anlegen\r\n \r\n var fields = [\"PERSID\", \"SALUTATION\", \"TITLE\", \"FIRSTNAME\", \"LASTNAME\", \"DATE_NEW\", \"USER_NEW\"];\r\n var types = a.getColumnTypes(\"PERS\", fields);\r\n statements.push([\"PERS\", fields, types, getColumnValues(fields, pFramedata)]);\r\n }\r\n \r\n pFramedata[\"STATUS\"] = \"1\";\r\n pFramedata[\"PERS_ID\"] = pFramedata[\"PERSID\"];\r\n pFramedata[\"PERSRELID\"] = a.sql(\"select RELATIONID from RELATION where ORG_ID = '\" + pFramedata[\"ORGID\"] + \"' and PERS_ID = '\" + pFramedata[\"PERSID\"] + \"'\"); \r\n pFramedata[\"STANDARD\"] = \"1\";\r\n pFramedata[\"ADDR_TYPE\"] = \"1\";\r\n \r\n if( pFramedata[\"PERSRELID\"] == \"\") \r\n {\r\n if ( pFramedata[\"ORGID\"] == \"0\") //Eine Privatperson\r\n {\r\n pFramedata[\"RELATIONID\"] = a.getNewUUID();\r\n pFramedata[\"RELATION_ID\"] = pFramedata[\"RELATIONID\"];\r\n pFramedata[\"PERSRELID\"] = pFramedata[\"RELATIONID\"];\r\n pFramedata[\"ADDRESSID\"] = a.getNewUUID();\r\n pFramedata[\"ADDRESS_ID\"] = pFramedata[\"ADDRESSID\"];\r\n pFramedata[\"ORG_ID\"] = pFramedata[\"ORGID\"];\r\n //Relation\r\n fields = [\"RELATIONID\", \"ORG_ID\", \"PERS_ID\", \"ADDRESS_ID\", \"LANG\", \"SOURCE\" ,\"DATE_NEW\", \"USER_NEW\"]; \r\n types = a.getColumnTypes(\"RELATION\", fields);\r\n statements.push([\"RELATION\", fields, types, getColumnValues(fields, pFramedata)]);\r\n \r\n //Adresse\r\n fields = new Array(\"ADDRESSID\", \"RELATION_ID\", \"ADDR_TYPE\", \"ADDRESS\", \"BUILDINGNO\", \"ZIP\", \"CITY\", \"COUNTRY\", \"DATE_NEW\", \"USER_NEW\");\r\n types = a.getColumnTypes( \"ADDRESS\", fields);\r\n statements.push([\"ADDRESS\", fields, types, getColumnValues(fields, pFramedata)]);\r\n \r\n }\r\n else //Person in Firma\r\n {\r\n // Pers-Relation\r\n pFramedata[\"PERSRELID\"] = a.getNewUUID();\r\n fields = [\"RELATIONID\", \"ORG_ID\", \"PERS_ID\", \"ADDRESS_ID\", \"STATUS\", \"LANG\", \"SOURCE\", \"DEPARTMENT\", \"RELTITLE\", \"DATE_NEW\", \"USER_NEW\"];\r\n types = a.getColumnTypes(\"RELATION\", fields);\r\n pFramedata[\"RELATIONID\"] = pFramedata[\"PERSRELID\"];\r\n statements.push([\"RELATION\", fields, types, getColumnValues(fields, pFramedata)]);\r\n }\r\n a.imagevar(\"$image.relpersid\", pFramedata[\"PERSRELID\"]);\r\n //COMM-Daten zu Person anlegen\r\n fields = [\"COMMID\", \"RELATION_ID\", \"MEDIUM_ID\", \"ADDR\", \"STANDARD\", \"DATE_NEW\", \"USER_NEW\", \"SEARCHADDR\"];\r\n types = a.getColumnTypes(\"COMM\", fields);\r\n\r\n pFramedata[\"RELATION_ID\"] = pFramedata[\"PERSRELID\"];\r\n if(pFramedata[\"TELEFON\"] != \"\" )\r\n {\r\n pFramedata[\"COMMID\"] = a.getNewUUID();\r\n pFramedata[\"ADDR\"] = pFramedata[\"TELEFON\"];\r\n pFramedata[\"MEDIUM_ID\"] = \"1\";\r\n pFramedata[\"SEARCHADDR\"] = getSearchAddr( \"1\", pFramedata[\"ADDR\"]);\r\n statements.push([\"COMM\", fields, types, getColumnValues(fields, pFramedata)]); //Telefon\r\n }\r\n if(pFramedata[\"FAX\"] != \"\" && pFramedata[\"ORGID\"] == \"0\")\r\n {\r\n pFramedata[\"COMMID\"] = a.getNewUUID();\r\n pFramedata[\"ADDR\"] = pFramedata[\"FAX\"];\r\n pFramedata[\"MEDIUM_ID\"] = \"2\";\r\n pFramedata[\"SEARCHADDR\"] = getSearchAddr( \"2\", pFramedata[\"ADDR\"]);\r\n statements.push([\"COMM\", fields, types, getColumnValues(fields, pFramedata)]); //Fax\r\n }\r\n if (pFramedata[\"EMAIL\"] != \"\" ) \r\n {\r\n pFramedata[\"COMMID\"] = a.getNewUUID();\r\n pFramedata[\"ADDR\"] = pFramedata[\"EMAIL\"];\r\n pFramedata[\"MEDIUM_ID\"] = \"3\";\r\n pFramedata[\"SEARCHADDR\"] = \"\";\r\n statements.push([\"COMM\", fields, types, getColumnValues(fields, pFramedata)]); //Email\r\n }\r\n if (pFramedata[\"INTERNET\"] != \"\" && pFramedata[\"ORGID\"] == \"0\") \r\n {\r\n pFramedata[\"COMMID\"] = a.getNewUUID();\r\n pFramedata[\"ADDR\"] = pFramedata[\"INTERNET\"];\r\n pFramedata[\"MEDIUM_ID\"] = \"4\"\r\n pFramedata[\"SEARCHADDR\"] = \"\";\r\n statements.push([\"COMM\", fields, types, getColumnValues(fields, pFramedata)]); // Internet \r\n }\r\n if(pFramedata[\"MOBIL\"] != \"\")\r\n {\r\n pFramedata[\"COMMID\"] = a.getNewUUID();\r\n pFramedata[\"ADDR\"] = pFramedata[\"MOBIL\"];\r\n pFramedata[\"MEDIUM_ID\"] = \"5\";\r\n pFramedata[\"SEARCHADDR\"] = getSearchAddr( \"5\", pFramedata[\"ADDR\"]);\r\n statements.push([\"COMM\", fields, types, getColumnValues(fields, pFramedata)]); //Mobil\r\n }\r\n }\r\n a.sqlInsert(statements);\r\n if( a.hasvar(\"$image.nodupPers\") )\r\n { \r\n var nodupPers = a.valueofObj(\"$image.nodupPers\");\r\n for ( var i = 0; i < nodupPers.length; i++) noduplicate(pFramedata[\"PERSID\"], nodupPers[i]);\r\n }\r\n return pFramedata;\r\n}", "function insertInto(entry, db){\n if (entry.type =='node'){\n db.nodes.insert(entry)\n }\n else if (entry.type == 'edge'){\n db.edges.insert(entry)\n }\n else{\n console.log(\"attempt made to insert entry of unspecified type. Ignoring...\");\n }\n}", "function creation(request,response,table,params) {\n\tconst req=request.query\n\tconst query=\"INSERT INTO \"+table+\" SET ?\";\n\tvar params2=[];\n\tconst params3={nom:req.nom,surnom:req.surnom,qtte_heures:req.qtth,qtte_heures_sup:req.qtthsup}\n\tfor(var i = 0;i<params.length;i++){\n\t\tparams2.push(params[i]+':req.'+params[i]);\n\t}\n\tconsole.log(params2);\n\tconnection.query(query,params2,(err,result,fields) => {\n \t\tif(err) throw err;\n \t\tresponse.json({saved:result.affectedRows,inserted_id:result.insertId})\n\t});\n}", "function addLogin(login){\n db.transaction(function(tx){\n tx.executeSql('INSERT INTO login(id, usuario, senha) values (null,\"'+login.usuario+'\",\"'+login.senha+'\")')\n },\n function(err){\n console.log(err);\n },\n function(){\n });\n}", "function addRow(data) {\n let insertQuery = 'INSERT INTO ?? (??,??) VALUES (?,?)';\n let query = mysql.format(insertQuery, [\n 'todo',\n 'user',\n 'notes',\n data.user,\n data.value\n ]);\n pool.query(query, (err, response) => {\n if (err) {\n console.error(err);\n return;\n }\n // rows added\n console.log(response.insertId);\n });\n}", "function addItemsAscensorItemsPozo(k_coditem_pozo,v_item,o_descripcion,v_clasificacion) {\n db.transaction(function (tx) {\n var query = \"INSERT INTO ascensor_items_pozo (k_coditem_pozo, v_item, o_descripcion, v_clasificacion) VALUES (?,?,?,?)\";\n tx.executeSql(query, [k_coditem_pozo,v_item,o_descripcion,v_clasificacion], function(tx, res) {\n console.log(\"insertId: \" + res.insertId + \" -- probably 1\");\n console.log(\"rowsAffected: \" + res.rowsAffected + \" -- should be 1\");\n },\n function(tx, error) {\n console.log('INSERT error: ' + error.message);\n });\n }, function(error) {\n console.log('transaction error: ' + error.message);\n }, function() {\n console.log('transaction ok');\n $('#texto_carga').text(\"Creando items pozo...Espere\");\n });\n}" ]
[ "0.72735673", "0.71691996", "0.6970055", "0.6831853", "0.6661928", "0.66453105", "0.6612026", "0.65692514", "0.6568245", "0.6527007", "0.6500624", "0.6465245", "0.6329449", "0.6270268", "0.6253986", "0.6243559", "0.61918265", "0.61777174", "0.6168875", "0.61491907", "0.61267287", "0.61133647", "0.61096174", "0.60719967", "0.60659254", "0.6054536", "0.60447615", "0.6044258", "0.60310924", "0.601327", "0.5985286", "0.59808797", "0.59801495", "0.59725934", "0.5962758", "0.5955807", "0.5947603", "0.5941408", "0.5932651", "0.5920272", "0.5917619", "0.5902752", "0.5901985", "0.5890589", "0.58854616", "0.58841586", "0.58757687", "0.58753365", "0.586286", "0.58625424", "0.5860603", "0.58599997", "0.58585024", "0.5854166", "0.5853763", "0.58396614", "0.58376694", "0.58325565", "0.58322656", "0.58264685", "0.5825993", "0.5818667", "0.5808477", "0.5802246", "0.5800982", "0.5794457", "0.57919395", "0.57883203", "0.57788527", "0.5767832", "0.5757347", "0.57485497", "0.57448393", "0.572675", "0.57237595", "0.57221776", "0.5719126", "0.57125974", "0.57112676", "0.57106143", "0.5703993", "0.57038665", "0.57014436", "0.5698964", "0.56970143", "0.56869954", "0.56813973", "0.567568", "0.56729716", "0.566753", "0.5653365", "0.5651864", "0.5650996", "0.5644568", "0.5634442", "0.563411", "0.5626307", "0.56157583", "0.5615067", "0.56143695" ]
0.5755236
71
let us assume that string only contains characters from 'a' to 'z'
function isUniqueWithNoExtraStorage (str) { if(typeof(str) !== "string") { return false; } if(!str) { return false; } if(str.length > 32) { return false; } let storage = 0; for(let i =0; i < str.length; i++){ let index = str.charCodeAt(i) - 'a'.charCodeAt(0); if(1<< index & storage) { return false; } else { storage = 1<< index | storage; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNotAlphabets(str)\n{\n\tfor (var i = 0; i < str.length; i++)\n\t{\n\t\tvar ch = str.substring(i, i + 1);\n\t\tif((ch < \"a\" || \"z\" < ch) && (ch < \"A\" || \"Z\" < ch)) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function isValidString(str, alphabet){ \n\tfor(var i=0;i<str.length;i++){ \n\t\tif(alphabet.indexOf(str[i]) == -1){\t\n\t\t\treturn(false); //if invalid\n\t\t}\n\t}\n\treturn(true); //if valid\n}", "function onlyLetters (string){\n return string.replace(/[0-9]/g,'')\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(myString){\n return /[a-zA-Z]/.test(myString);\n}", "function isLetter(str) {\r\n\tif (str.length === 1 && str.match(/[a-z]/i)) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function filterStr(str) {\n var alphaNums = \"abcdefghijklmnopqrstuvwxyz1234567890\"\n return str.split(\"\").filter(function(char) {\n return alphaNums.includes(char.toLowerCase())\n })\n .join(\"\")\n}", "function onlyLetters( string ) {\n\tfor ( var i = 0; i < string.length; i++ ) {\n\t\tif ( !isLetter( string[ i ] ) ) {\n\t\t\tstring = string.substr( 0, i ) + string.substr( i + 1, string.length - i );\n\t\t\ti--;\n\t\t}\n\t}\n\treturn string;\n}", "function getLetters(str) {\n let strLett = '';\n for (let i = 0; i < str.length; i++) {\n if (str[i].toLowerCase() >= 'a' && str[i].toLowerCase() <= 'z') {\n strLett += str[i];\n }\n }\n return strLett;\n}", "function onlyLetters(input) {\n\tinput = input.toUpperCase();\n\tfor (var i = 0; i < input.length; i++) {\n\t\tif (input[i] > 'Z' || input[i] < 'A')\n\t\t\treturn false\n\t}\n\treturn true;\n}", "function isLetter(str) {\r\n\tvar re = /[^a-zA-Z]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function checkForLetter(str) {\r\n\tfor (char of str) {\r\n\t\tif (isLetter(char)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function onlyLetters(str) {\n return str.toLowerCase().replace(/[^a-z]/g, \"\");\n}", "function isAlphabet(x){\n var as = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n return (as.indexOf(x) != -1);\n}", "function isAlphabet(str) {\n var code, i, len;\n\n for (i = 0, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (\n !(code > 64 && code < 91) && // upper alpha (A-Z)\n !(code > 96 && code < 123)\n ) {\n // lower alpha (a-z)\n return false;\n }\n }\n return true;\n}", "function isAlpha(str) {\n var code = void 0,\n i = void 0,\n len = void 0;\n for (i = 0, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (!(code > 64 && code < 91) && // upper alpha (A-Z)\n !(code > 96 && code < 123)) {\n // lower alpha (a-z)\n return false;\n }\n }\n return true;\n}", "function isAlphabeticString(string) {\n var isNotEmpty = !isEmpty(string);\n var doesNotContainDigits = !CONTAINS_DIGIT_REGEX.test(string);\n var doesNotContainInvalidChars = !/[\\{\\}\\(\\)_\\$#\"'@\\|!\\?\\+\\*%<>/]/.test(string);\n return isNotEmpty && doesNotContainDigits && doesNotContainInvalidChars;\n}", "function isAlphaName(alphan_str) {\n\t// Following code based on SIT104 prac6 exercise code\n\tvar result = true;\n\tvar range = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ- .\";\n\tvar temp;\n\n\tfor (i = 0; i < alphan_str.length; i++)\n\t{\n\t\ttemp = alphan_str.substring(i, i+1);\n\t\tif (range.indexOf(temp) == -1)\n\t\t\tresult = false;\n\t}\n\treturn result;\n}", "function isLetter(char) {\r\n return char.match(/[a-z]/i);\r\n}", "function allLetter(input) {\n let inputNoSpace = input.replace(\" \", \"\");\n var letters = /^[A-Za-z]+$/;\n if (inputNoSpace.match(letters)) {\n return true;\n }\n else {\n return false;\n }\n}", "function AlphabetSearching(str) {\n let alphabet = 'qwertyuiopasdfghjklzxcvbnm';\n str.toLowerCase();\n for (let i = 0; i < str.length; i++) {\n alphabet = alphabet.replace(str[i], '');\n }\n\n return alphabet.length === 0 ? true : false;\n}", "function isnotAlpha(str){\nstringCheck=\"!@#$%^&*()_+|<>?/=-~.,`0123456789;:][{}\"+\"\\\\\"+\"\\'\";\nf1=1;\nfor(j=0;j<str.length;j++)\n{ if(stringCheck.indexOf(str.charAt(j))!=-1)\n { f1=0;}}\nif(f1==0)\n{ return true; }else {return false;}\n}", "function isnotAlpha(str){\nstringCheck=\"!@#$%^&*()_+|<>?/=-~.,`0123456789;:][{}\"+\"\\\\\"+\"\\'\";\nf1=1;\nfor(j=0;j<str.length;j++)\n{ if(stringCheck.indexOf(str.charAt(j))!=-1)\n { f1=0;}}\nif(f1==0)\n{ return true; }else {return false;}\n}", "function is_alphanum(str) {\n let curr_char\n for (let i = 0; i < str.length; i ++) {\n curr_char = str.charCodeAt(i)\n if (!(curr_char == 95 || curr_char == 46) &&\n !(curr_char > 47 && curr_char < 58) &&\n !(curr_char > 64 && curr_char < 91) &&\n !(curr_char > 96 && curr_char < 123)) {\n return false\n }\n }\n return true\n}", "function isLetter(user_name){\n \n if (!/[^a-zA-Z]/.test(user_name))\n {\n return true;\n }else{\n alert(\"Invalid name! Name can only contain Alphabets\");\n return false;\n }\n}", "function isAlpha(alpha_str) {\n\t// Following code based on SIT104 prac6 exercise code\n\tvar result = true;\n\tvar range = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\tvar temp;\n\n\tfor (i = 0; i < alpha_str.length; i++)\n\t{\n\t\ttemp = alpha_str.substring(i, i+1);\n\t\tif (range.indexOf(temp) == -1)\n\t\t\tresult = false;\n\t}\n\treturn result;\n}", "function isLetter (c)\n{\nvar lowercaseLetters = \"abcdefghijklmnopqrstuvwxyzáéíóúñü.,\"\nvar uppercaseLetters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZÁÉÍÓÚÑ\"\n return( ( uppercaseLetters.indexOf( c ) != -1 ) ||\n ( lowercaseLetters.indexOf( c ) != -1 ) )\n}", "function letterCheck(str, letter) { return str.includes(letter) }", "function isLetter (c)\r\n{ return ( ((c >= \"a\") && (c <= \"z\")) || ((c >= \"A\") && (c <= \"Z\")) )\r\n}", "function isLetter (c)\r\n{ return ( ((c >= \"a\") && (c <= \"z\")) || ((c >= \"A\") && (c <= \"Z\")) )\r\n}", "function alphanumeric(str){\n var regex1 = /\\w/g\n var regex2 = /[^a-zA-Z0-9]/g\n if (str.match(regex2)){\n return false\n } \n else return regex1.test(str)\n \n \n }", "function alphanumeric(str) {\n return str.match(/^[a-zA-Z0-9]*$/) !== null;\n}", "static validInput(str) {\n const regExLetters = /[a-z]/gi;\n const regExChars = /[<>{}`\\\\]/gi;\n return !str.length || (regExLetters.test(str) && !regExChars.test(str));\n }", "function isAlpha(characters) {\n return /^[A-Z ]*$/.test(characters);\n}", "function isAlpha(c){\r\n return /^\\w$/.test(c) && /^\\D$/.test(c);\r\n}", "function isLetter(char){\n\treturn char.match(/[a-z]/i);\n}", "function isAlphabetic(string) {\n\treturn isAlphabetic1(string, true);\n}", "function simple(str, char='') {\n return str.toLowerCase().replace(/[^a-z0-9]/g, char)\n}", "function areCharsOrLetters(theString) {\n var regSpecialChar = /[`!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?~]/\n var isChar = regSpecialChar.test(theString)\n var isLetter = theString.match(/[a-z]/i)\n if (isChar != false && isLetter != null) {\n return true\n } else if (isLetter != null) {\n return true\n } else if (isChar != false) {\n return true\n } else {\n return false\n }\n}", "function isLetterOrNum(str) {\n var i = 0;\n var count = 0;\n for (i = 0; i < str.length; i++) {\n if ((str[i] >= \"a\" && str[i] <= \"z\") || (str[i] >= \"A\" && str[i] <= \"Z\") || (str[i] >= \"0\" && str[i] <= \"9\")) {\n count++;\n }\n }\n return (count == str.length);\n}", "function checkString( text ) {\n\tvar str= text.value.toString();\n\tvar len=str.length;\n\tvar check = true;\n\tvar err = \"\";\n\tfor(var i=0; i<len; i++)\n\t{\n\t\tif(! ( (str.charAt(i)>='a' && str.charAt(i)<='z') || (str.charAt(i)>='A' && str.charAt(i)<='Z') || str.charAt(i)==' ' ) )\n\t\t{\n\t\t\tcheck= false;\n\t\t}\n\t}\n\tif( check == false)\n\t{\n\t\t\terr=\"Only Alphabets Allowed\";\n\t\t} else {\n\t\t\terr=\"\";\n\t\t}\n\treturn err;\n}", "function isAlpha(string) {\n\tvar filter = /^[A-Za-z]+$/;\n\tif (filter.test(string)) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "function isDigitalOrLetter(str)\n{\n\tvar result = true;\n \tif(str == null || str.trim() == \"\") return false;\n\t\n\tstr = str.trim();\n\n for(var i=0; i<str.length; i++)\n {\n var strSub = str.substring(i,i+1); \n if( !((strSub<=\"9\"&&strSub>=\"0\") || \n\t\t (strSub<=\"Z\"&&strSub>=\"A\") || \n\t\t\t(strSub<=\"z\"&&strSub>=\"a\")) )\n {\n\t\t\tresult = false;\n\t\t\tbreak;\n }\n }\n return result ;\t\n}", "function isLetterAndNumeric(str) {\r\n\tvar re = /[^a-zA-Z0-9-]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function fearNotLetter(str) {\r\n\tvar start = str.charCodeAt(str[0]);\r\n\tfor (var i = 0; i < str.length; i++) {\r\n\t\tif (str.charCodeAt(i) !== start + i) {\r\n\t\t\treturn String.fromCharCode(start + i);\r\n\t\t}\r\n\t}\r\n\treturn undefined;\r\n}", "function containsOnlyLetters(input)\n{\n\treturn /^[a-zA-Z]/.test(input.replace(/\\s/g, ''));\n}", "function fearNotLetter(str) {\r\n return str;\r\n}", "function unique3(str) {\n\n if (!str) {\n return \"please provide valid string as input\";\n }\n\n var charMap = new Array(26); // 26 elements\n var len = str.length;\n var charMapIndex;\n\n for (var i=0; i<len; i++) {\n charMapIndex = str[i].charCodeAt(0) - 'a'.charCodeAt(0);\n if (charMap[charMapIndex]) {\n return false;\n }\n charMap[charMapIndex] = true;\n }\n\n return true;\n}", "function alpha_Check(str)\n{\n var reg=/^[A-Za-z]+$/\n var str1=str.value;\n if(!str1.match(reg))\n {\n alert(\"Invalid Data Entered!!\");\n return false;\n }\n return true;\n}", "function fearNotLetter (str) {\n let charCode;\n let charCodes = str.split('').map(char => char.charCodeAt(0));\n charCodes.forEach((char, index, arr) => {\n if (char + 1 !== arr[index + 1] && arr[index + 1]) {\n charCode = char + 1;\n }\n });\n\n if (charCode) {\n return String.fromCharCode(charCode);\n }\n}", "function allLetterValidation(input) {\n\n var letters = /^[A-Za-z]+$/;\n if (input.value.match(letters)) return true;\n else return false;\n}", "function checkLetter (letter)\r\n{\r\n\tif (letter.match(/[a-z]/i) || letter.match(/[A-Z]/i) || letter.match(/[0-9]/i))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function noLettersOrNums(str) {\n let noLetterRegex = /\\W/gi;\n return str.match(noLetterRegex);\n}", "function isAlpha(aChar)\n{\n myCharCode = aChar.charCodeAt(0);\n \n if(((myCharCode > 64) && (myCharCode < 91)) ||\n ((myCharCode > 96) && (myCharCode < 123)))\n {\n return true;\n }\n \n return false;\n}", "function fearNotLetter(str) {\n \n for (var i = 0; i < str.length; i++) {\n \n var bit = str.charCodeAt(i);\n \n if (bit !== str.charCodeAt(0) + i) {\n return String.fromCharCode(bit - 1);\n }\n }\n\n return undefined;\n}", "function reomveChar(str){\n let result = ''\n for(let i = 0; i < str.length; i++){\n if (str[i] !== 'a' && str[i] !== 'e' && str[i] !== 'i' && str[i] !== 'o' && str[i] !== 'u' ){\n\n result += str[i]\n }\n }\n return result;\n}", "function fearNotLetter(str) {\n for(var i = 0; i< str.length; i++){\n var code = str.charCodeAt(i);\n if(code !== str.charCodeAt(0) + i){\n return String.fromCharCode(code - 1);\n }\n }\n return undefined\n \n }", "function alphabetizeLetters( string ){\n\tvar alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n\tvar newString = \"\";\n\tfor (var i=0; i < alphabet.length; i++){\n\t\tfor(var k=0; k <string.length; k++){\n\t\t\tif (alphabet[i] === string[k]) {\n\t\t\t\tnewString += string[k];\n\t\t\t}\n\t\t}\n\t}\n\treturn newString;\n}", "function isAlphabetCharacter(letter) {\n return (letter.length === 1) && /[a-z]/i.test(letter);\n}", "function isAlphaNum(c){\r\n return /^\\w$/.test(c);\r\n}", "function fearNotLetter(str) {\n let num = str.charCodeAt(0)\n for (let i = 0; i < str.length; i++){\n if(str.charCodeAt(i) != num){\n return String.fromCharCode(num) \n }\n num++\n }\n\n return undefined;\n}", "function isAlphanumeric(string) {\n\treturn isAlphanumeric1(string, false);\n}", "function isLetter(character) {\n if (character.length > 1) {\n return false;\n }\n var regex = /[A-Za-z]/;\n //character.search returns -1 if not found\n return character.search(regex) > -1;\n}", "function validateLetters(str) {\n return (/^[a-zA-Z\\s']+$/i).test(str);\n}", "function isLetters(input){\n for(let i = 0; i < input.length; i++){\n if(input.charAt(i) < 10){\n return false;\n break;\n }\n }\n }", "function chars(input) {\n const charsRegExp = /[A-Za-z]+/;\n return charsRegExp.test(input);\n}", "function isLetterNumer(in_str) {\n var numbers = /^[0-9A-Z]+$/;\n return String(in_str).match(numbers) ? true : false;\n}", "function allLetter(parameter){ \n\tvar letters = /^[A-Za-z]+$/.test(parameter);\n\tif(letters == true){ \n\t\treturn true; \n\t}else{ \n\t\treturn false; \n\t} \n}", "function fearNotLetter(str) {\n let first = str.charCodeAt(0)\n let last = str.charCodeAt(str.length - 1)\n\n for (let i = first, j = 0; i <= last; i++, j++)\n if (i !== str.charCodeAt(j))\n return String.fromCharCode(i)\n}", "function validAlphabet(letter){\n\tif(letter>26){\n\t\treturn letter-26;\n\t}else if(letter<=0){\n\t\treturn letter+26;\n\t}else{\n\t\treturn letter;\n\t}\n}", "function isalphanumeric(str)\r\n{\r\n\tvar bReturn = true;\r\n\tvar valid=\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-\";\r\n\tvar invalidfirst = \"_-\";\r\n\tvar invalidlast = \"_-\";\r\n\tfor (var i=0; i<str.length; i++) \r\n\t{\r\n\t\tif ( i == 0 && (invalidfirst.indexOf(str.charAt(i)) > 0))\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\telse if ( i == (str.length-1) && (invalidlast.indexOf(str.charAt(i)) > 0))\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\telse if (valid.indexOf(str.charAt(i)) < 0)\r\n\t\t{\r\n\t\t\tbReturn = false;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn(bReturn);\r\n}", "function isalpha(char) {\n return /^[A-Z]$/i.test(char);\n}", "function isAlphaNumeric1( str ) {\n return /[a-zA-Z0-9]/.test(str)\n}", "function alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 97 && code <= 122 /* a-z */ || code >= 65 && code <= 90 /* A-Z */;\n}", "function isLetter(ch) {\n if (ch.match(/[a-zA-Z]/i)) {\n return true;\n } else {\n return false;\n }\n}", "function isAlNum(str)\n {\n var letterNumber = /^[0-9a-zA-Z]+$/;\n if( str.match(letterNumber) )\n return true;\n return false;\n }", "function isAlpha (ch){\n return /^[A-Z]$/i.test(ch);\n }", "function isValidString(string){\r\n\t\r\n\tvar pattern = new RegExp(\"^[a-zA-Z][a-zA-Z0-9 \\-']+$\");\r\n\tvar result= pattern.test(string);\r\n\t\r\n\t//Yay\r\n\tif(result){\r\n\t\t\r\n\t\treturn true;\r\n\t\t\r\n\t}\r\n\t//Icky characters found\r\n\telse{\r\n\t\t\r\n\t\treturn false;\r\n\t\t\r\n\t}\r\n\r\n}", "function fearNotLetter(str) {\n\tconst alphabet = 'abcdefghijklmnopqrstuvwxyz';\n\tconst strLen = str.length;\n\tconst chunk = alphabet.indexOf(str[0]);\n\n\tfor (let i = chunk; i < chunk + strLen; i++) {\n\t\tif (!str.includes(alphabet[i])) {\n\t\t\treturn alphabet[i];\n\t\t}\n\t}\n\treturn undefined;\n}", "function onlyLettersNums(str) {\n return str.toLowerCase().replace(/[^a-z,0-9,-]/g, \"\");\n}", "function onlyLettersNums(str) {\n return str.toLowerCase().replace(/[^a-z,0-9,-]/g, \"\");\n}", "function uniqueChars(str) {\r\n // Set has O(1) lookup + insertion\r\n let uniqueLetters = new Set();\r\n let letterCount = 0;\r\n\r\n for (let i = 0; i < str.length; i++) {\r\n uniqueLetters.add(str[i]);\r\n letterCount++;\r\n if (uniqueLetters.size != letterCount) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}", "function isLetter(input){\n return /^[a-zA-Z()]*$/.test(input);\n}", "function fearNotLetter(str) {\n // standard letters.\n let baseStr1 = \"abcdefghijklmnopqrstuvwxyz\";\n let baseStr2 = baseStr1.toUpperCase();\n let newStr = \"\";\n // where the 'str' belongs to?\n if(baseStr1.includes(str[str.length-1])){\n // all letters in the 'str' range.\n newStr = baseStr1.slice(baseStr1.indexOf(str[0]), baseStr1.indexOf(str[str.length-1])+1);\n }\n else if(baseStr2.includes(str[str.length-1])){\n newStr = baseStr2.slice(baseStr2.indexOf(str[0]), baseStr2.indexOf(str[str.length-1])+1);\n }\n // removing str letters from newStr.\n for(let i=0; i<str.length; i++){\n newStr = newStr.replace(str[i], \"\")\n }\n if(newStr === \"\"){\n return undefined;\n }\n return newStr;\n }", "function fearNotLetter(str) {\n let strArr = [...str];\n let uniCode = strArr.map(x => str.charCodeAt(strArr.indexOf(x)));\n\n for(let i = 0; i < uniCode.length; i++){\n if(uniCode[i+1] - uniCode[i] >= 2){\n return String.fromCharCode(uniCode[i] + 1);\n }\n }\n}", "function isAlphaNumeric(str) {\n for (var i = 0, len = str.length; i < len; i++) {\n var code = str.charCodeAt(i);\n if (!(code > 47 && code < 58) && // numeric (0-9)\n !(code > 64 && code < 91) && // upper alpha (A-Z)\n !(code > 96 && code < 123)) { // lower alpha (a-z)\n return false;\n }\n }\n return true;\n}", "function allLetter(job){\n var letters = /^[A-Za-z]+$/;\n if (job.value.match(letters)){\nreturn true;\n } else {\n alert('Occupation must be alphabet characters');\n return false;\n }\n}", "function isLetterOrDigit(char) {\n return \"abcdefghijklmnopqrstuvwxyz0123456789\".indexOf(char) >= 0;\n }", "function isAlpha(string) {\n\tvar patt = /^[a-zA-Z\\u00C6\\u00D0\\u018E\\u018F\\u0190\\u0194\\u0132\\u014A\\u0152\\u1E9E\\u00DE\\u01F7\\u021C\\u00E6\\u00F0\\u01DD\\u0259\\u025B\\u0263\\u0133\\u014B\\u0153\\u0138\\u017F\\u00DF\\u00FE\\u01BF\\u021D\\u0104\\u0181\\u00C7\\u0110\\u018A\\u0118\\u0126\\u012E\\u0198\\u0141\\u00D8\\u01A0\\u015E\\u0218\\u0162\\u021A\\u0166\\u0172\\u01AFY\\u0328\\u01B3\\u0105\\u0253\\u00E7\\u0111\\u0257\\u0119\\u0127\\u012F\\u0199\\u0142\\u00F8\\u01A1\\u015F\\u0219\\u0163\\u021B\\u0167\\u0173\\u01B0y\\u0328\\u01B4\\u00C1\\u00C0\\u00C2\\u00C4\\u01CD\\u0102\\u0100\\u00C3\\u00C5\\u01FA\\u0104\\u00C6\\u01FC\\u01E2\\u0181\\u0106\\u010A\\u0108\\u010C\\u00C7\\u010E\\u1E0C\\u0110\\u018A\\u00D0\\u00C9\\u00C8\\u0116\\u00CA\\u00CB\\u011A\\u0114\\u0112\\u0118\\u1EB8\\u018E\\u018F\\u0190\\u0120\\u011C\\u01E6\\u011E\\u0122\\u0194\\u00E1\\u00E0\\u00E2\\u00E4\\u01CE\\u0103\\u0101\\u00E3\\u00E5\\u01FB\\u0105\\u00E6\\u01FD\\u01E3\\u0253\\u0107\\u010B\\u0109\\u010D\\u00E7\\u010F\\u1E0D\\u0111\\u0257\\u00F0\\u00E9\\u00E8\\u0117\\u00EA\\u00EB\\u011B\\u0115\\u0113\\u0119\\u1EB9\\u01DD\\u0259\\u025B\\u0121\\u011D\\u01E7\\u011F\\u0123\\u0263\\u0124\\u1E24\\u0126I\\u00CD\\u00CC\\u0130\\u00CE\\u00CF\\u01CF\\u012C\\u012A\\u0128\\u012E\\u1ECA\\u0132\\u0134\\u0136\\u0198\\u0139\\u013B\\u0141\\u013D\\u013F\\u02BCN\\u0143N\\u0308\\u0147\\u00D1\\u0145\\u014A\\u00D3\\u00D2\\u00D4\\u00D6\\u01D1\\u014E\\u014C\\u00D5\\u0150\\u1ECC\\u00D8\\u01FE\\u01A0\\u0152\\u0125\\u1E25\\u0127\\u0131\\u00ED\\u00ECi\\u00EE\\u00EF\\u01D0\\u012D\\u012B\\u0129\\u012F\\u1ECB\\u0133\\u0135\\u0137\\u0199\\u0138\\u013A\\u013C\\u0142\\u013E\\u0140\\u0149\\u0144n\\u0308\\u0148\\u00F1\\u0146\\u014B\\u00F3\\u00F2\\u00F4\\u00F6\\u01D2\\u014F\\u014D\\u00F5\\u0151\\u1ECD\\u00F8\\u01FF\\u01A1\\u0153\\u0154\\u0158\\u0156\\u015A\\u015C\\u0160\\u015E\\u0218\\u1E62\\u1E9E\\u0164\\u0162\\u1E6C\\u0166\\u00DE\\u00DA\\u00D9\\u00DB\\u00DC\\u01D3\\u016C\\u016A\\u0168\\u0170\\u016E\\u0172\\u1EE4\\u01AF\\u1E82\\u1E80\\u0174\\u1E84\\u01F7\\u00DD\\u1EF2\\u0176\\u0178\\u0232\\u1EF8\\u01B3\\u0179\\u017B\\u017D\\u1E92\\u0155\\u0159\\u0157\\u017F\\u015B\\u015D\\u0161\\u015F\\u0219\\u1E63\\u00DF\\u0165\\u0163\\u1E6D\\u0167\\u00FE\\u00FA\\u00F9\\u00FB\\u00FC\\u01D4\\u016D\\u016B\\u0169\\u0171\\u016F\\u0173\\u1EE5\\u01B0\\u1E83\\u1E81\\u0175\\u1E85\\u01BF\\u00FD\\u1EF3\\u0177\\u00FF\\u0233\\u1EF9\\u01B4\\u017A\\u017C\\u017E\\u1E93]+$/;\n\treturn patt.test(string);\n}", "function isAlpha (ch){\n return /^[A-Z]$/i.test(ch);\n }", "function mixedString (str) {\n let letters = str.split(' ')\n let uppers = letters.filter(el=>el === el.toUpperCase)\n \n if (uppers.length > str.length / 2) {\n return str.toUpperCase()\n } else {\n return str.toLowerCase()\n }\n}", "function fearNotLetter(str) {\n for(let i = 0; i < str.length; i++) {\n if (str.charCodeAt(i) != str.charCodeAt(0) + i) {\n return String.fromCharCode(str.charCodeAt(i) - 1);\n } \n }\n return undefined;\n}", "function isAlpha(parm)\n{\n\tvar lwr = 'abcdefghijklmnñopqrstuvwxyzàáâãäåæçèéêëìíîïðòóôõöøùúûüýþÿ ';\n\tvar upr = 'ABCDEFGHIJKLMNÑOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÒÓÔÕÖרÙÚÛÜÝÞß';\n\tvar val = lwr+upr;\n\tif (parm == \"\") return true;\n\tfor (i=0; i<parm.length; i++)\n\t{\n\t\tif (val.indexOf(parm.charAt(i),0) == -1) return false;\n\t}\n\treturn true;\n}", "function lettersOnly(input) {\n //let regex = /[^a-z]/gi //\n let regex = /[^a-z\\s]/gi\n // let regex = /^[a-z ,.'-]+$/i //\n input.value = input.value.replace(regex, \"\");\n}", "function getIndexOfLetterA(string){\n var newString = [];\n for(var i = 0; i <= string.length - 1; i++) {\n if (string[i] === \"a\") {\n newString.push(string[i]);\n } \n }\n return newString;\n}", "function isAlphabetic (s)\r\n\r\n{ var i;\r\n\r\n if (isEmpty(s))\r\n if (isAlphabetic.arguments.length == 1) return defaultEmptyOK;\r\n else return (isAlphabetic.arguments[1] == true);\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-alphabetic character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is letter.\r\n var c = s.charAt(i);\r\n\r\n if (!isLetter(c))\r\n return false;\r\n }\r\n\r\n // All characters are letters.\r\n return true;\r\n}", "function isAlphabetic (s)\r\n\r\n{ var i;\r\n\r\n if (isEmpty(s))\r\n if (isAlphabetic.arguments.length == 1) return defaultEmptyOK;\r\n else return (isAlphabetic.arguments[1] == true);\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-alphabetic character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is letter.\r\n var c = s.charAt(i);\r\n\r\n if (!isLetter(c))\r\n return false;\r\n }\r\n\r\n // All characters are letters.\r\n return true;\r\n}", "function fearNotLetter(str) {\r\n //Convert to array\r\n let array = [...str];\r\n //Store ASCII Character\r\n let charNum = array[0].charCodeAt(0);\r\n let result;\r\n //Find the character after the missing character \r\n array.forEach((letter)=> {\r\n if(letter.charCodeAt(0)- charNum > 1){\r\n result = String.fromCharCode(letter.charCodeAt(0)-1);\r\n }\r\n charNum = letter.charCodeAt(0);\r\n })\r\n return result\r\n}", "function missingLetters(str) {\n // let compare = str.charCodeAt(0);\n // let missing; \n\n // str.split('').map((char, i) =>{\n // if(str.charCodeAt(i) === compare) {\n // ++compare;\n // }else{\n // missing = String.fromCharCode(compare)\n // }\n // });\n // return missing;\n}" ]
[ "0.7532353", "0.7496568", "0.74933034", "0.7476335", "0.7476335", "0.7439635", "0.7435552", "0.74275845", "0.73877275", "0.73806024", "0.73805004", "0.7379312", "0.73296547", "0.7302216", "0.72913516", "0.7246581", "0.72460794", "0.72419465", "0.7227598", "0.72075033", "0.71852916", "0.715942", "0.71231776", "0.7110492", "0.7110492", "0.7105033", "0.7103393", "0.71026367", "0.71005034", "0.70899814", "0.7086213", "0.7086213", "0.70807964", "0.70807135", "0.7076744", "0.7061619", "0.7056422", "0.7039941", "0.7034231", "0.7018504", "0.7014549", "0.7008055", "0.6997078", "0.6981536", "0.69682777", "0.69651175", "0.6954203", "0.6946782", "0.6943386", "0.69310683", "0.6918816", "0.6899302", "0.68842345", "0.68809104", "0.6865108", "0.6864751", "0.6862125", "0.6858172", "0.68539244", "0.68484277", "0.68463916", "0.68317467", "0.68261737", "0.68055916", "0.6799289", "0.6797235", "0.67969143", "0.6791586", "0.678068", "0.67780495", "0.6777133", "0.6770965", "0.67663723", "0.6765074", "0.67549217", "0.6754208", "0.674017", "0.67273027", "0.6717076", "0.6713261", "0.67131877", "0.6703221", "0.6703221", "0.6698688", "0.66924167", "0.6692366", "0.6669946", "0.66593266", "0.6653872", "0.6653862", "0.6638463", "0.6633018", "0.66279817", "0.66258276", "0.6625478", "0.6624426", "0.66192824", "0.6618031", "0.6618031", "0.6605592", "0.66029954" ]
0.0
-1
let correct = 0;
function renderQuestions() { $("#quiz").empty(); questions.forEach(function (question, index) { let $question = $("<div>").addClass("form-group cm-form-group-fix"); let $label = $("<h4>") .text(question.question) .appendTo($question); for (let i = 0; i < question.choices.length; i++) { let $choice = $('<div>'); $choice.addClass('form-check form-check-inline'); let $radio = $('<input>'); $radio .attr({ type: "radio", value: question.choices[i], name: index, class: "form-check-input" }) .appendTo($choice); let $choiceLabel = $('<label>'); $choiceLabel .text(question.choices[i]) .addClass('form-check-label') .appendTo($choice); $choice.appendTo($question); } $("#quiz").append($question); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isCorrect(){\n score++;\n setScore();\n}", "function correctAnswer(){\n\t\tcorrect++;\n\t\talert(\"You are Right! Good job!\");\n\t}", "function answerIsCorrect() {\n let oldScore = parseInt(document.getElementById('correct').innerText);\n document.getElementById('correct').innerText = ++oldScore;\n}", "function choose0() { checkAnswer(0) }", "function correct() {\n score += 20;\n next();\n }", "function answerCorrect() {\n\tcorrect++;\n\talert(\"Correct!\");\n\tconsole.log(\"correct\");\n}", "function correct() {\n score += 25;\n next();\n}", "function correct() {\n score += 20;\n next();\n}", "function correct() {\n score += 20;\n next();\n}", "function correct() {\n score += 20;\n next();\n}", "correct() {\n\n\n }", "generateCorrect() {\n return Math.floor(Math.random() * 100 + 1);\n }", "function correct() {\n score += 20;\n next();\n \n}", "function checkAnswer() {\n var answer = document.getElementById('riddle-answer').value;\n console.log(answer);\n var hash = 0, i, chr;\n for (i = 0; i < answer.length; i++) \n {\n chr = answer.charCodeAt(i);\n hash = ((hash << 5) - hash) + chr;\n hash |= 0;\n }\n \n console.log(hash);\n if (hash == 1852442505 || hash == 1787798377)\n {\n document.getElementById('riddle-won').textContent = \"Really?? This is incredible, nobody gets this right. Want to play sometime?\";\n }\n return false;\n}", "function answerWrong() {\n\twrong++;\n\talert(\"Incorrect!\");\n\tconsole.log(\"wrong\");\n}", "function wrongAnswer(){\n\t\twrong++;\n\t\talert(\"That is not correct.\");\n\t}", "checkAns() {\n let rightCnt = this.computeScore();\n alert(rightCnt + \" out of \" + this.state.questionArray.length + \" are correct\");\n }", "function answerIsWrong() {\n count -= 5;\n}", "function checkAnswer() {\n}", "function correct() {\nscore = score + 10;\nnext();\n}", "function URCorrect() {\n scoreNum = scoreNum + 5;\n countdown = countdown + 2;\n checkStatus();\n}", "function update_question_result(correct) {\n if (correct === true) {\n correct_answers++;\n document.getElementById(\"question_result\").innerText = \"Success!\"\n } else {\n document.getElementById(\"question_result\").innerText = \"Wrong!\"\n }\n}", "function scoreQ8a() {\n console.log(\"q8a answer: \" + q8a)\n console.log(\"Q8a correct: \" + q8aCorrect)\n return (q8a == q8aCorrect);\n}", "function checkA() { \n if (ans == \"0\") {\n correct();\n }\n else {\n incorrect();\n }\n}", "function correct() {\n score +=20\n nextQuestion();\n}", "function again() {\n result.innerHTML = \"Your result is ...\";\n questionCount = 0;\n athenaScore = 0;\n dionysusScore = 0;\n zeusScore = 0;\n aphroditeScore = 0;\n}", "function checkAnswer() {\n let userAnswer = parseInt(document.getElementById(\"answer-box\").value);\n let calculatedAnswer = calculateCorrectAnswer();\n let isCorrect = userAnswer === calculatedAnswer[0];\n\n if (isCorrect) {\n alert(\"Hey! You got it right! :D\");\n incrementScore();\n } else {\n alert(`Awwww.....you answered ${userAnswer}. The correct answer was ${calculatedAnswer[0]}!`);\n incrementWrongAnswer();\n }\n\n runGame(calculatedAnswer[1]);\n\n\n}", "function correctAnswer () {\n return quiz.questions[quiz.currentQuestion].correctAnswerIndex\n}", "function answerIsIncorrect () {\r\n feedbackForIncorrect();\r\n}", "function startover(){\n time = 10;\n correctanswer = 0;\n wronganswer = 0;\n unanswered = 0; \n }", "function resetCounters(){\n correct = 0;\n incorrect = 0;\n unanswered = 0;\n }", "function correctAnswer () {\n return quiz.questions[quiz.currentQuestion].answerIndex\n}", "function getScore(correct, missed, noAnswer){\n let x = (correct / (correct + missed + noAnswer)) * 100;\n return x;\n }", "function answerIsCorrect () {\r\n feedbackForCorrect();\r\n updateScore();\r\n}", "function correctAnswer() {\n return $scope.answer.value === $scope.data.solution;\n }", "function returnA() {\n checkAnswer(1);\n}", "function update_question_result(correct) {\n if (correct == true) {\n score++;\n return displayQuestionResult.innerText = \"Success!\";\n } else {\n return displayQuestionResult.innerText = \"Incorrect!\";\n }\n}", "function scoreQ9() {\n console.log(\"q9a answer: \" + q9a)\n console.log(\"q9b answer: \" + q9b)\n \n return 0; \n}", "function checkAnswer() {\n console.log(this.value);\n\n if (this.value !== questions[index].correct) {\n console.log(\"incorrect\");\n console.log(secondsLeft)\n secondsLeft -= 10;\n count.textContent = secondsLeft;\n\n if (secondsLeft <= 0) {\n endGame();\n }\n } else {\n score.textContent++;\n console.log(score);\n }\n\n index++;\n\n if (index === questions.length) {\n endGame();\n } else {\n buildQuestionCard();\n }\n}", "function incrementWrongAnswer() {\n\n let oldScore = parseInt(document.getElementById(\"incorrect\").innerText);\n document.getElementById(\"incorrect\").innerText = ++oldScore;\n}", "function checkSum(answer,observation){\n console.log(answer[0]);\n var correctAns = model.prob_OnS()[observation];\n var sum = 0;\n for (var i = 0; i < Object.keys(correctAns).length; i++){\n sum += correctAns[i];\n }\n // console.log(sum);\n if (answer[0].toFixed(3) == sum.toFixed(3)) {return 1;}\n else {return 0;}\n }", "verifyAns(answer) {\n const { checkedAns, questionNum, correctAns, wrongAns } = this.state;\n ((answer === checkedAns) ?\n this.setState({ correctAns: correctAns + 1 }) :\n this.setState({ wrongAns: wrongAns + 1 }))\n this.setState({ questionNum: questionNum + 1 })\n this.setState({ checkedAns: \"\" });\n localStorage.setItem('react quiz2 qu',questionNum+1);\n }", "function answer1() {\n checkAnswer(1)}", "function answerIsCorrect(){\r\n qscore++;\r\n score.innerHTML = \"<p>Score: \" + qscore + \"</p>\";\r\n}", "function fill_correct(len) \t\t\n\t{\n\t\tfor(i=0;i<len;i++)\n\t\t{\n\t\t correct[i]=i+1;\t\n\t\t}\n\t}", "function correct() {\n awnsered[chosen-1] = true;\n awnsered[chosen] = true;\n nextQuestion();\n}", "function checkAnswer(questionNumber, answer) {\n\n}", "function scoreQ5a() {\n console.log(\"Q5a answer: \" + q5a)\n console.log(\"Q5a correct: \" + q5aCorrect)\n\n return (q5a == q5aCorrect);\n\n}", "function correct() {\n outcome.textContent = \"Correct!\";\n reveal(outcome);\n score += 5;\n}", "function checkAnswer() {\n return document.answered;\n}", "function test06_8(){\n var nb = parseInt(prompt(\"Entrez le nombre de valeurs\"));\n var tab = [];\n var ntf = 0;\n var ptf = 0;\n for (let i = 0; i < nb; i++) {\n var n = parseInt(prompt(\"Entrez une valeur\"));\n tab[i] = n;\n }\n for (let i = 0; i < tab.length; i++) {\n if (tab[i] > 0) {\n ptf ++;\n } else if (tab[i] < 0) {\n ntf ++;\n }\n }\n console.log(\"Nombre de valeurs positives : \" + ptf);\n console.log(\"Nombre de valeurs négatives : \" + ntf);\n}", "function check() {\n if ((correct+wrong) != 0) {\n score = \"\" + ((correct / (correct + wrong)) * 100);\n score = score.substring(0,4) + \"%\";\n alert(\"YOUR SCORE: \" + score + \"\\n\"\n + correct + \" correct\\n\"\n + wrong + \" incorrect\")\n }\n\n else alert(\"You haven't answered anything yet.\");\n}", "function bet0() {\n playerguess = 0\n document.getElementById(\"playerguess\").innerHTML = \"Player Guess: \" + playerguess\n}", "function scoreKeeper() {\n for (i = 0; i < storeAnswers.length; i++) {\n if (storeAnswers[i] === questionsArray[i].answer) {\n correct++;\n console.log(correct);\n } else {\n incorrect++;\n }\n }\n }", "function check(){\n if(trivia.questions.userGuess==trivia.questions.answer){\n \tcorrectAnswer++;\n }\n else if(trivia.questions.userGuess!=trivia.questions.answer){\n \tincorrectAnswer++;\n }\n if(trivia.questions2.userGuess==trivia.questions2.answer){\n \tcorrectAnswer++;\n }\n else if(trivia.questions2.userGuess!=trivia.questions2.answer){\n \tincorrectAnswer++;\n }\n\n if(trivia.questions3.userGuess==trivia.questions3.answer){\n \tcorrectAnswer++;\n }\n else if(trivia.questions3.userGuess!=trivia.questions3.answer){\n \tincorrectAnswer++;\n }\n\n if(trivia.questions4.userGuess==trivia.questions4.answer){\n \tcorrectAnswer++;\n }\n\n else if(trivia.questions4.userGuess!=trivia.questions4.answer){\n \tincorrectAnswer++;\n }\n\n if(trivia.questions5.userGuess==trivia.questions5.answer){\n \tcorrectAnswer++;\n }\n\n else if(trivia.questions5.userGuess!=trivia.questions5.answer){\n \tincorrectAnswer++;\n }\n\nCorrect();\nIncorrect();\n}", "function test23() {\n reset();\n check10Row();\n return score === 0;\n}", "isCorrect(index, answers) {\n if (answers.indexOf(index) != -1) {\n return 100;\n }\n return 0;\n }", "checkAnswer() {\n \n let currentQuestionAnswer = eval(propblems[this.state.currentProblemIndex].question);\n let nextString = null;\n\n if (currentQuestionAnswer == this.state.answerByUser) {\n nextString = \"Clear\";\n this.setState(state => ({\n score:state.score+1\n }))\n } else {\n nextString = \"Wrong\";\n }\n\n\n console.log(this.state.score);\n\n this.setState(state => ({\n currentDisplayingStr: nextString,\n currentProblemIndex: state.currentProblemIndex + 1,\n currentQuestionIndex: null,\n shouldShowInput: false\n }))\n\n this.initiateTest();\n }", "function checkAnswer() {\r\n // get first factor\r\n var factor1 = document.getElementById('factor1').innerHTML;\r\n console.log(\"factor 1 = \" + factor1);\r\n // get second factor\r\n var factor2 = document.getElementById('factor2').innerHTML;\r\n console.log(\"factor 2 = \" + factor2);\r\n // get answer\r\n var answer = document.getElementById('answer').value;\r\n console.log(\"answer = \" + answer);\r\n console.log((factor1*factor2) == answer);\r\n return (factor1*factor2) == answer;\r\n}", "function ifLost(correct){\t\t\n\n\tif(correct == 0 && isDuplicate() !== true)\n\t\twrong++;\n\t\n\tdocument.getElementById(\"wrong\").textContent = \"Remaining Attempts: \" + (attempts - wrong);\n\t\t\n\tif((attempts - wrong) == 0 ){\n\t\talert(\"You lose! The word was '\" + randomWord + \"'\");\n\t\treset();\n\n\t\tlost++;\n\t\tdocument.getElementById(\"wins\").textContent = \"Wins: \" + wins;\n\t\tdocument.getElementById(\"losses\").textContent = \"Losses: \" + lost;\n\t\t}\n\t\n}", "function calculate_score() {\n var answer = get_answer();\n var guess = get_guess();\n var diff = compare_arrays(answer, guess)\n return Math.floor(((((255 * 3) - diff) / (255 * 3)) * 100))\n}", "function equal2() {\n var a = v6; //set number value to a\n var b = v3; //set number value to b\n return a - b;\n}", "function update_questions_correct_required() {\n\tquestions_correct_required = parseInt(level['corrects_required'][0])\n}", "function checkAnswer() {\n let userAnswer = document.getElementsByName('ans');\n let cAns;\n for (i = 0; i < userAnswer.length; i++) {\n if (userAnswer[i].checked) {\n cAns = userAnswer[i].value;\n }\n }\n if (cAns == correct[qtrack]) {\n score++;\n wright.push(qtrack);\n }\n else wrong.push(qtrack);\n}", "function checkAnswer(answer){\n correct = quizQuestions[currentQuestionIndex].correctAnswer;\n if (answer === correct && currentQuestionIndex !== finalQuestionIndex){\n score++;\n alert(\"Thats Right!\");\n currentQuestionIndex++;\n generateQuizQuestion();\n }else if (answer !== correct && currentQuestionIndex !== finalQuestionIndex){\n alert(\"WRONG!\");\n //-----DEDUCT TIME FOR WRONG ANSWERS------\n timeLeft = timeLeft - deduction;\n currentQuestionIndex++;\n generateQuizQuestion();\n }else{\n showScore();\n }\n}", "function punteggio () {\n for (var j = 0; j < casualArray.length; j++) {\n if (casualArray.includes(guessArray[j])) {\n risultato++\n }\n }\n document.write (\"Il tuo punteggio è: \" + risultato);\n}", "function scoreQ3() {\n console.log(\"Q3 answer: \" + q3)\n console.log(\"Q3 correct: \" + q3Correct)\n\n return (q3 == q3Correct);\n\n}", "function checkAnswer(){\n trueAnswer = returnCorrectAnswer();\n userAnswer = getInput();\n// this if statement is stating if user inputs the right answer what happens and if not what happens\n if(userAnswer === trueAnswer){\n var messageCorrect = array[global_index].messageCorrect;\n score ++;\n swal({\n title: messageCorrect,\n text: \"You got \" + score + \" out of 8 correct.\",\n });\n }\n else{\n var messageIncorrect = array[global_index].messageIncorrect;\n swal({\n title: messageIncorrect,\n text: \"You got \" + score + \" out of 8 correct.\",\n });\n }\n }", "function isRightAnswer() {\n increment(\"#score\", 1);\n answer = null;\n}", "function checkAnswer(btnVal,question){\n disableButtons();\n if (btnVal === question.correctAns) {\n numCorrect++;\n return true;\n }\n else {\n numWrong++;\n return false;\n }\n}", "function zero(){ return 0;}", "function correctAnswers() {\n let correct = parseInt(document.getElementById(\"correct\").innerText);\n document.getElementById(\"correct\").innerText = ++correct;\n\n\n // Prints a message to the user when they are finsh the quiz depending on the number of correct answer they got. \n\n\n if (correct >= 8) {\n document.getElementById(\"end-message\").innerHTML = `Congragulations YOUR A TRUE MARVEL FAN`;\n } else if (correct >= 6) {\n document.getElementById(\"end-message\").innerHTML = `WELL DONE YOUR NEARLY THERE TRY AGAIN`;\n } else if (correct >= 4) {\n document.getElementById(\"end-message\").innerHTML = `HMMMMM ARE YOU SURE YOUR A MARVEL FAN?`;\n } else if (correct >= 2) {\n document.getElementById(\"end-message\").innerHTML = `YOU NEED TO HIT THE COMICS AND FRESHEN UP`;\n }\n}", "verifySolution() {\n // userInput == curr solution\n // alert(userInput)\n \n this.player.prevResponseCorrectness = true\n this.foundSolution = true\n return true\n // console.log(this.input._value)\n // let userInput = this.input._value\n // alert(userInput)\n // let solution = this.player.currSolution\n // // set this to true in order to handle updates when solution is found\n // this.foundSolution = true\n // if (userInput == solution) {\n // this.foundSolution = true\n // }\n // this.player.prevResponseCorrectness = this.foundSolution\n \n // return this.foundSolution\n }", "function correctAnswer(){\n\tscore += addScore(time);\n\tupdateScore();\n if(++level == 10){\n difficulty = 1;\n } else if(level == 20){\n difficulty = 2;\n }\n document.getElementById('level').innerHTML = \"Level : \" + level;\n\tresetComponent();\n}", "function correctAnswer() {\n alert('Correct Answer');\n score += 100;\n}", "function checkAnswer(answer) {\n var correctAnswer = questions[currentQuestionIndex].correct;\n console.log(correctAnswer);\n\n if (answer === correctAnswer) {\n score++;\n console.log(score)\n currentScore.textContent = score\n alert(\"This is correct! (+1 to score)\");\n currentQuestionIndex++;\n getQuestions();\n } else if (answer !== correctAnswer) {\n secondsLeft -= 10;\n alert(\"This is incorrect! (-10 seconds)\");\n currentQuestionIndex++;\n getQuestions();\n }\n}", "function checkAnswer(answer) {\n //Write your code in here\n}", "computeScore () {\n let rightCnt = 0;\n for (let i=0; i<this.state.answerArray.length; i++) {\n if(this.state.answerArray[i] === this.state.questionArray[i].answer) {\n rightCnt ++;\n }\n }\n return rightCnt;\n }", "function restartGame() {\n count = 0;\n correct = 0;\n wrong = 0;\n answered.length = 0;\n}", "sol() { return this.pos == 0; }", "function checkAnswer(answer){\n correct = quizQuestions[currentQuestionSpot].rightAnswer;\n\n if (answer === correct && currentQuestionSpot !== finalQuestion){\n score++;\n alert(\"That Is Correct!\");\n currentQuestionSpot++;\n beginQuiz();\n }else if (answer !== correct && currentQuestionSpot !== finalQuestion){\n alert(\"That Is Incorrect.\")\n currentQuestionSpot++;\n beginQuiz();\n }else{\n finalScore();\n }\n}", "function printQuizResult(ans, result){\n if(result == ans){\n console.log(`CORRECT ANSWER 😁\\n`);\n return 1;\n }else{\n console.log(`OOPS!WRONG ANSWER 🙁\\nCORRECT ANSWER IS: ${result}`);\n }\n return 0;\n}", "function checkAnswer(e) {\n console.log(`Random Array: ${randomArray}`)\n console.log(`Correct Answer: ${correctAnswer}`)\n if (e == correct) {\n setScore(score + 20)\n }\n if (numRounds < 1) {\n test = ((dateNow - Date.now()) / 1000)\n setScore(score => score + test)\n console.log(`Score + Test = ${score}`)\n setEndGame(true)\n }\n randomNumbers()\n }", "function setScore() {\n let score = $('input:checked[value=correct]').length\n $('#score').text(score);\n }", "function change_score(round_score) {\n num_correct += round_score;\n num_total += 1;\n }", "function reset() {\n guess = 20;\n}", "function result() {\r\n var score = 0;\r\n if (document.getElementById('correct1').checked) {\r\n score++;\r\n }\r\n if (document.getElementById('correct2').checked) {\r\n score++;\r\n }\r\n if (document.getElementById('correct3').checked) {\r\n score++;\r\n }\r\n alert(\"your score is: \"+score)\r\n}", "function incorrectScore() {\n incorrect++;\n\n $('.incorrect').text(incorrect);\n}", "function isCorrect(){\n let temp; //used to keep track of the correct answer index\n for (let i =0; i<answerChoices[num-1].length; i++)\n {\n if (answerChoices[num-1][i] === correctAnswers[num-1]){\n temp=i;\n }\n }\n \n if (parseInt(input,10) === temp){ //input = index of correct answer\n console.log('V- Correct answer -V');\n score++;\n }\n else if (parseInt(input, 10) < 7 && parseInt(input, 10) < answerChoices[num-1].length){ //input is any of the other choices, wrong\n console.log('X- Sorry. Wrong answer. -X');\n score--;\n }\n else if(input === 'exit' || input === 'EXIT'){ \n console.log('Thank you for playing.');\n console.log('---Your final score is: '+score+'.---');\n }\n else{\n console.log('You entered the wrong value'); //input is anything but a number\n }\n\n //doesnt appear if user quits game\n if(stillPlaying){ \n console.log('----Your current score is: '+score+'.----');\n }\n }", "function gameCheck(){\r\n\t\tfor(var i=0; i<answerKey.length; i++){\r\n\t\t\tif (userAnswers[i] == answerKey[i]){\r\n\t\t\t\tcorrectGuesses++;\r\n\t\t\t\tconsole.log(\"correct guesses is \" + correctGuesses);\r\n\t\t\t\tconsole.log(correctGuesses/totalQuestions);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tconsole.log(\"did not match\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function checkAnswer(answer) {\n if (answer[userAnswer].isCorrect) {\n console.log('Your answer is correct! :D');\n score++;\n } else {\n console.log('Your answer is incorrect! D:');\n if (score > 0) {\n score--;\n }\n }\n}", "function countQuestion() {\n questionCounter--;\n console.log(questionCounter);\n}", "function displayScore() { \n var numCorrect = 0;\n for (var i = 0, length = selections.length; i < length; i++) {\n if (selections[i] == questions[i].correctAnswer) {\n numCorrect++;\n }\n }\n \n return numCorrect;\n}", "function check(){\n\tvar question1 = document.quiz.question1.value;\n\tvar question2 = document.quiz.question2.value;\n\tvar question3 = document.quiz.question3.value;\n\tvar question4 = document.quiz.question4.value;\n\tvar question5 = document.quiz.question5.value;\n\tvar question6 = document.quiz.question6.value;\n\tvar question7 = document.quiz.question7.value;\n\tvar question8 = document.quiz.question8.value;\n\tvar question9 = document.quiz.question9.value;\n\tvar correct = 0;\n\n\tif (question1 == \"Finland\") {\n\t\tcorrect++;\n\t}\n\tif (question2 == \"New York\") {\n\t\tcorrect++;\n\t}\n\tif (question3 == \"Bush Senior\") {\n\t\tcorrect++;\n\t}\n\tif (question4 == \"China\") {\n\t\tcorrect++;\n\t}\n\tif (question5 == \"Yahoo\") {\n\t\tcorrect++;\n\t}\n\tif (question6 == \"David Beckham\") {\n\t\tcorrect++;\n\t}\n\tif (question7 == \"Kyoto Protocol\") {\n\t\tcorrect++;\n\t}\n\tif (question8 == \"Fossiliized dinosaur heart\") {\n\t\tcorrect++;\n\t}\n\tif (question9 == \"His heart\") {\n\t\tcorrect++;\n\t}\n\n\tdocument.getElementById(\"after_submit\").style.visibility = \"visible\";\n\tdocument.getElementById(\"number_correct\").innerHTML = \"You got \" + correct + \" correct.\";\n}", "checkAnswer(answer) {\n let check = false;\n if (answer == this.rightAnswer)\n check = true;\n check ? console.log(`CORRECT`) : console.log(`INCORRECT`);\n return check;\n }", "function checkAnswerValid() {\n\tlet answerIndex = $('input[name=answer]:checked').val()\n\tlet answerNotSelected = !answerIndex\n\n\tif (answerNotSelected) {\n\t\talert('Whoever didnt pick an answer...ya moms a h0e')\n\t} else {\n\t\tlet answer =\n\t\t\tQUESTIONS[currentQuestionIndex].answers[\n\t\t\t\tNumber($('input[name=answer]:checked').val())\n\t\t\t]\n\n\t\tupdateForm({ answer, answerIndex })\n\n\t\t// increment correct / incorrect count\n\t\tanswer.correct ? numCorrect++ : numIncorrect++\n\t\tupdateCorrectIncorrect()\n\t}\n}", "function answerIsCorrect() {\n correctAnswerFeedback();\n nextQuestion();\n addToScore();\n}", "function tossResult() {\n var totalNumber = 0;\n\n for (var i = 1; i <= 3; i++) {\n totalNumber += flipOneCoin();\n }\n return (totalNumber);\n }", "function checkcurr() {\n outresult[position][1] = $(\"input[name=answer]:checked\", \"#ansform\").val();\n if (outresult[position][1] === outresult[position][3]) {\n outresult[position][2] = \"Correct\";\n } else {\n outresult[position][2] = \"Incorrect\";\n }\n}//end of checkcurr", "function checkAnswer() {\r\n STORE.view = 'feedback';\r\n let userSelectedAnswer = STORE.userAnswer;\r\n let correctAnswer = STORE.questions[STORE.questionNumber].correctAnswer;\r\n console.log('Checking answer...');\r\n if (userSelectedAnswer == correctAnswer) {\r\n STORE.score++;\r\n STORE.correctAnswer = true;\r\n }\r\n else {\r\n STORE.correctAnswer = false;\r\n }\r\n}", "checkGuessForCorrectAnswer(event) {\n if (event.target.value === this.state.correctGuess) {\n this.setState(prevState => ({\n score: prevState.score + 1\n })\n )}\n }" ]
[ "0.6652573", "0.6593515", "0.65899086", "0.6519545", "0.64537036", "0.6420076", "0.6401835", "0.6399222", "0.6399222", "0.6399222", "0.63940066", "0.6361975", "0.6358245", "0.6355916", "0.6337303", "0.6306715", "0.630107", "0.6295742", "0.6269993", "0.62416685", "0.62411934", "0.6231032", "0.6223747", "0.6205468", "0.620026", "0.6192329", "0.6189359", "0.6138869", "0.609838", "0.60830927", "0.60638535", "0.60561156", "0.6040812", "0.6023082", "0.6009649", "0.6007754", "0.59885114", "0.5962369", "0.59558904", "0.59509856", "0.5945778", "0.59433585", "0.59375304", "0.5936403", "0.59324634", "0.59236205", "0.5919348", "0.59103465", "0.590718", "0.59055895", "0.59034777", "0.59015924", "0.5898572", "0.5898109", "0.5894274", "0.5893751", "0.5890685", "0.588978", "0.58730376", "0.5868878", "0.5866244", "0.5859611", "0.5848903", "0.58477336", "0.5842472", "0.58422416", "0.5841157", "0.5839011", "0.5838107", "0.5833613", "0.58231634", "0.5820381", "0.58198476", "0.5813971", "0.5812008", "0.5802889", "0.578569", "0.57842016", "0.57799417", "0.5777393", "0.57754797", "0.57729125", "0.57654744", "0.5763355", "0.5757651", "0.5753457", "0.5748168", "0.5747814", "0.5733465", "0.5727062", "0.5721846", "0.5703917", "0.5703847", "0.56962395", "0.56940144", "0.569343", "0.5688345", "0.5685672", "0.5684222", "0.567267", "0.56650054" ]
0.0
-1
using recursive function// ////////////////////////// factorial of 4 equal 4321
function factorial(number) { if(number==1){ return number; }else{ return factorial(number-1)*number; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factorial(number) { // Recibe un valor entero positivo\n if (number < 0) // Si es valor es un numero negativo entonces devuelve un -1 para hacer saber al usuario que se ingreso un valor invalido\n return -1; // retorno de valor invalido \n else if (number == 0) // Si el valor es 0, por definicion se devuelve un 1 por que 0! es 1, pero tambien sirve para la recursividad dentro de factorial\n return 1; // Devuelve el valor de 1 si es que el numero original es de 0 o si es la ultima iteracion de la funcion recursiva \n else { // Si el numero es un valor mayor a 1 se entra en la recursividad de la funcion \n return (number * factorial(number - 1)); // La recursividad funciona diciendo que el numero se multiplicara por la funcion - 1, y hasta que el numero dentro de la funcion no se vuelva 0 entonces se restara uno del valor del numero y se volver a multiplicar\n // Si el valor fuese 5, seria 5 * 5 - 1 * 5 - 1 - 1,5-1-1-1 * 5-1-1-1-1 * 0, claro que si se multiplica por 0 entonces el valor final seria 0, pero dentro del if si el valor es 0 hay un return de 1. \n // Pero el valor no sera de 1, dado que este return esta dentro de la primera iteracion de la recursividad, entonces el valor seria 5*4*3*2*1*1 = 120\n }\n}", "function factorial(num){ //5\n if(num === 1) return 1; //basecase \n\n return num * factorial(num-1); //5 * 4 * 3 * 2 = 120 \n\n}", "function factorial(n) {\n // var n = 4;\n var result = 1;\n while(n){\n result *= n--;\n }\n return result;\n}", "function factorial(num){\n //base case\n if (num === 0) return 1\n \n //recursive call\n return num * factorial(num - 1);\n}", "function recursiveFactorial(num) {\n // your code here\n}", "function factorial(num) {\n //base case\n if(num === 1) {\n return 1 \n } \n\n //recursive call\n return num * factorial(num - 1)\n}", "function factorial(n){\r\n //base case\r\n if(n == 0 || n == 1){\r\n return 1;\r\n //recursive case\r\n }else{\r\n return n * factorial(n-1);\r\n }\r\n}", "function factorial(num){\n if(num === 1 ) return 1;\n return num * factorial(num - 1)\n}", "function factorial(num){\n if(num <= 1){\n return num \n } else {\n return num * factorial(num - 1);\n }\n \n}", "function factorial(num) {\n\tif (num == 0) return 1;\n\tif (num == 1) return 1;\n\treturn num * factorial(num - 1);\n}", "function factorial(num) { \n if(num<=0) { \n return 1; \n } else { \n return (num * factorial(num-1) );\n } \n }", "function factorial(n){\n\n\tif (n ==1){\n\t\treturn 1;\n\t}\n\n\treturn bigInt(n).multiply(factorial(n-1));\n}", "function factorial(num) {\r\n\tif(num===1)\r\n\t{\r\n\t\treturn 1;\r\n\t}\r\n\treturn num*factorial(num-1);\r\n}", "function recursiveFactorial(number) {\n if (number === 0 {\n return 0;\n }\n if (number === 1) {\n return 1;\n } else if (number > 0) {\n return number * recursiveFactorial(number - 1);\n }\n }", "function factorial(num) {\n if(num === 1) {\n return 1;\n }\n return num * factorial(num - 1)\n}", "function factorial(number) {\n if (number <= 1)\n return 1;\n return number * factorial(number-1);\n}", "function factorial(num) {\n // Base case\n if (num <= 1) {\n return 1;\n }\n // Recursive case\n return num * factorial(num - 1)\n}", "function factorial(n){\n if(n === 0){\n return 1\n }\n if (n >= 1){\n return(n) * factorial(n-1);\n\t};\n}", "function factorial(number) {\n if(number <= 1) return number\n return factorial(number - 1) * number\n}", "function factorial(num) {\n if (num === 1) return 1;\n if (num === 0) return 1;\n return num * factorial(num - 1);\n}", "function factorial(num) {\n if (num < 0) return 0\n if (num <= 1) return 1\n return num * factorial(num - 1)\n}", "function recursiveFactorial(n) {\n //base case\n if(n == 0 || n == 1){\n return 1;\n //recursive case\n }else{\n return n * recursiveFactorial(n-1);\n }\n}", "function factorial(num) {\n \n}", "function findFactorialRecursive(number) {\n debugger;\n if (number === 2) {\n return 2;\n }\n return number * findFactorialRecursive(number - 1);\n}", "function factorial(number) {\n if (number == 0 || number == 1){\n return 1;\n }else{\n return factorial(number - 1) * number;\n }\n}", "function factorial (num) {\n // If the number is less than 0, reject it.\n if (num < 0) {\n return -1\n }\n // If the number is 0, its factorial is 1.\n else if (num == 0) {\n return 1\n }\n // Otherwise, call this recursive procedure again.\n else {\n console.log(num)\n return (num * factorial(num - 1))\n }\n}", "function factorial(num) {\n if (num === 1) return 1;\n return num * factorial(num - 1);\n}", "function factorial(num) {\n if (num === 1) return num\n else return num * factorial(num - 1)\n}", "function factorial(num) {\n if (num <= 1) return 1\n\n return num * factorial(num - 1)\n}", "function nFactorial(num) {\nif (num > 1){\nreturn num * nFactorial(num - 1);\n}\nelse {\nreturn 1;\n}}", "function factorial(num) {\n if (num === 0) {\n return 1\n }\n return (num * factorial(num-1))\n}", "function factorial(n) {\n //Establish base case\n if (n == 0) {\n return 1;\n } else {\n //Run recursive case\n return n * factorial(n - 1);\n }\n}", "function factorial(num){\n if (num === 1){\n return num;\n }\n else {\n return num * factorial(num - 1);\n }\n}", "function factorial(num) {\n\t// always add a base case to terminate recursion\n\tif(num===1){\n\t\treturn 1; // 1! = 1;\n\t}\n\treturn num * factorial(num-1);\t\n}", "function factorial(n){\n if (n > 1) {\n return n * factorial(n-1)\n }\n return n\n\n}", "function factorial (num) {\n\tif (num == 1) { \n\t return num;\n\t} else {\n\t\treturn num* factorial(num -1)\n\t} \n}", "function factorial(n) {\n if(n==0) {\n return 1;\n }\n return n * calcFactorial(n-1);\n }", "function factorial(n) {\n if (n === 0) {\n return 1;\n }\n // This is it! Recursion!!\n return n * factorial(n - 1);\n }", "function factorial(num){\n\tif(num == 1) return 1;\n\n\treturn num * factorial(num - 1); // pending multiplier\n}", "function factorial(n){\n if( n == 0){\n return 1;\n }\n else{\n return n * factorial(n-1);\n }\n \n}", "function factorial(n) {\n // base case and exit recursion\n if (n === 0) return 0\n if (n === 1) return 1\n // recurse with different inputs\n return n * factorial(n - 1)\n}", "function recursiveFactorial(n) {\n if (n <= 1){\n return 1;\n } else {\n return n * recursiveFactorial(n - 1);\n }\n}", "function factorial(n){\n if (n === 0){\n \t return 1;\n }\n return (n * factorial(n-1));\n }", "function factorial(n){\n if (n < 2) return 1;\n return n * factorial(n - 1);\n}", "function factorial(n) {\n if (n == 0)\n return 1;\n else\n return n * factorial (n);\n // ^ Problem: the variable n is never reduced, so the recursion goes on. You get stuck running down Bowser's hallway (i.e. in an infinite loop).\n }", "function faktorial(num){\n if(num===1){\n return 1;\n } else{\n return num*faktorial(num-1);\n }\n}", "function factorial(num) {\n if (num === 1) {\n return 1;\n }\n return num * factorial(num - 1);\n}", "function factorial(x) \n{ \n\n if (x === 0)\n {\n return 1;\n }\n return x * factorial(x-1);\n \n}", "function factorial(num){\n \n}", "function factorial(num){\n \n}", "function factorial(n){\n if(n==0){\n return 1;\n }\n else{\n return n * factorial(n-1);\n }\n}", "function findFactorialRecursive(number) {\n if (number === 2) {\n return 2;\n }\n return number * findFactorialRecursive(number-1);\n}", "function factorial(number) {\n if (number === 0) return 1;\n return number * factorial(number - 1);\n}", "function factorial(n, d=1)\n{\n\tif (n < 2) return 1;\n var ret=d+1;\n for (var i = d+2; i <= n; i++)\n ret *= i;\n return ret;\n}", "function factorial(num) {\n if (num <= 0) {\n return 1;\n } else {\n return (num * factorial(num - 1));\n }\n}", "function factorial(n) {\n if(n === 1){return n};\n return n * factorial(n-1);\n}", "function factorial(num) {\n if (num === 0) return 1;\n\n return num * factorial(num - 1);\n}", "function factorial(n){\n if(n === 0)\n return 1;\n else\n return (n* factorial(n - 1));\n}", "function factorial(num) {\n if (num <= 1) {\n return num;\n }\n return factorial(num - 1) * num;\n}", "function factorial(n) {\n\n}", "function factorial(n) { \n // Base Case - when n is equal to 0, we stop the recursion\n if (n === 0) {\n return 1;\n }\n // This is our Recursive Case\n // It will run for all other conditions except when n is equal to 0\n return n * factorial(n - 1);\n }", "function factorial(n) {\n if (n <= 1) {\n return 1;\n }\n return n * factorial(n-1);\n\n}", "function factorial(n){\n if(n === 1){\n return n;\n }\n return n * factorial(n-1);\n}", "function factorial(n) {\n if (n==0) {\n return 1;\n\n }\n else{\n return n* factorial (n-1);\n }\n}", "function factorial(num) {\n if (num === 1) {\n // base case\n return num;\n } else {\n // recursion\n return num * factorial(num - 1);\n }\n}", "function factorial(n) {\n\n // Put your code here.\n if (n < 0) {\n console.log(\"Can't make a factorial from a negative number.\");\n return n;\n }\n // Base case\n if (n === 0) {\n return 1;\n }\n // What's wrong with this picture? Why won't this recursion work?\n return n * factorial(n - 1);\n\n}", "function factorial(number) {\r\n if (number <= 1) {\r\n return number;\r\n }\r\n\r\n return factorial(number - 1) * number;\r\n}", "function factorial(n) {\n // This is our Base Case - when n is equal to 0, we stop the recursion\n if (n === 0) {\n return 1;\n }\n // This is our Recursive Case\n // It will run for all other conditions except when n is equal to 0\n return n * factorial(n - 1);\n }", "function factorial(num) {\n if (num <= 1) {\n return 1;\n }\n return num * factorial(num -1);\n}", "function factorial(n) {\n\tif (n === 1) {\n\t\treturn n;\n\t}\n\treturn n * factorial(n-1);\n}", "function factorial(n) {\n if (n===0) return 1;\n else return n * factorial(n-1);\n}", "function factorialF(number){\n if(number === 1){\n return 1;\n }\n return number * factorialF(number -1);\n}", "function factorial(n) {\n\tvar result =1;\n // TODO: your code here\n if( n ===0){\n return 0;\n }\n while(n>=1){\n \tresult*=n;\n n--;\n }\nreturn result;\n}", "function factorial(n) { \n let result;\n if(n !== 1) {\n result = n * factorial(n-1);\n } else {\n result = n;\n }\n return result;\n }", "function factorial(x){\n if (x < 0 ) return 0;\n if (x <= 1 ) return 1;\n return x * factorial(x-1);\n}", "function factorial(num) {\n if(num === 0) return 1;\n return num * factorial(--num);\n}", "function factorial(num) {\n if (num < 0) {\n return -1\n } else if (num === 0) {\n return 1\n } else {\n console.log(num)\n return num * factorial(num - 1)\n }\n}", "function factorial(num) {\n if (num === 0) {\n return 1;\n } else {\n return num * factorial(num - 1);\n }\n}", "function factorial(num){\n if(num === 1) return 1; \n return num * sumRange(num-1);\n }", "function factorial(num) {\n if (num === 1) {\n return 1;\n }\n\n return num * factorial(num - 1);\n}", "function factorial(n){\n if(n == 0 || n == 1){\n return 1;\n } \n else{\n return n * factorial(n-1);\n }\n}", "function factorial(n) {\n if (n <= 1) return 1;\n return n * factorial(n - 1);\n}", "function factorial(n) {\n var result = n\n if (n <= 1) {\n return 1\n }\n while (n > 1) {\n n--\n result *= n\n }\n return result\n}", "function factorialRecursive(number) {\n debugger;\n if (number === 1) {\n return 1;\n }\n return number * factorialRecursive(number - 1);\n}", "function factorial(num)\n{\n\n if (num < 0) {\n return -1;\n }\n\n else if (num == 0) {\n return 1;\n }\n\n else {\n return (num * factorial(num - 1));\n }\n}", "function factorial(n) {\n if (n === 0) return 1;\n return n * factorial(n - 1);\n}", "function factorialFind(n) {\n var result = 1;\n function getFactorial(limit) {\n if (limit > n) {\n return;\n }\n result *= limit;\n console.log(limit);\n getFactorial(limit + 1);\n // console.log(limit)\n }\n getFactorial(1);\n return result;\n}", "function factorial(n) {\n\tif (n === 1) return 1;\n\n\treturn n * factorial(n - 1);\n}", "function factorial(number) {\n if (number == 0) {\n return 1;\n }\n return number * factorial(number - 1);\n}", "function factorialOfNum(num){\n\treturn num === 1 ? 1 : num * factorialOfNum(num - 1);\n}", "function factorial(n){\n if( n === 0){\n return 1;\n }else {\n return n * factorial(n-1);\n }\n}", "function factorial(n) {\n if (n===1) return 1;\n return n * factorial(n - 1);\n}", "function factorial(num){\n let factoid=1;\n for(let i=1;i<=num;i++){\n factoid*=i;\n }\n return factoid;\n}", "function findFactorialRecursive(number) {\n if (number === 1) {\n return 1;\n }\n return number * findFactorialRecursive(number - 1);\n}", "function factorial(x) {\n //basecase\n if (x < 0) return 0;\n if (x <= 1) return 1;\n return x * factorial(x - 1);\n}", "function factorial(n){\n var result =n;\n while(n>1){\n \tn-=1;\n \tresult *= n\n } \t\n}", "function factorial(x)\n{\n if (x === 0)\n {\n return 1;\n }\n return x * factorial(x-1);\n}", "function factorial (number) {\n if (number === 1) {\n return number\n } else {\n return number * factorial(number - 1)\n }\n}", "function factorial(n) {\n if (n <= 1) {\n return 1\n }\n while (n > 1) {\n n--\n result *= n\n }\n return result\n}", "function Factorial(num) {\n if (num === 1) return num;\n else return num * Factorial(num - 1);\n}" ]
[ "0.78629273", "0.78231925", "0.76976013", "0.76195735", "0.7604576", "0.7569123", "0.75613326", "0.7536435", "0.74763966", "0.74760556", "0.7475171", "0.74713326", "0.7468622", "0.7466194", "0.7460911", "0.74593997", "0.7449934", "0.7422034", "0.74133015", "0.7409681", "0.740921", "0.7407827", "0.74018824", "0.7401081", "0.74005824", "0.73980993", "0.7395657", "0.7393253", "0.73829406", "0.7376801", "0.7374826", "0.73739254", "0.737227", "0.7368816", "0.7341169", "0.7337783", "0.73316437", "0.73227566", "0.7320353", "0.7320257", "0.73193794", "0.7317552", "0.73038095", "0.7295554", "0.72943515", "0.7290358", "0.72898847", "0.7288991", "0.72853893", "0.72853893", "0.7282919", "0.727802", "0.7276025", "0.7275718", "0.72734994", "0.7272199", "0.72709936", "0.72699696", "0.7265163", "0.72625613", "0.7258074", "0.7257893", "0.725395", "0.72538877", "0.7250684", "0.72480035", "0.72472197", "0.7246283", "0.7240506", "0.72392535", "0.7238769", "0.72361845", "0.7233365", "0.7232302", "0.7229903", "0.72298473", "0.7228073", "0.7228005", "0.7223169", "0.7217027", "0.72088414", "0.72068363", "0.72043025", "0.7202625", "0.7200114", "0.7199609", "0.7199461", "0.71987593", "0.7197582", "0.7196224", "0.719557", "0.7195463", "0.7194021", "0.7191413", "0.71865124", "0.71853936", "0.7184362", "0.7182393", "0.71819663", "0.71797156" ]
0.74490494
17
Function for products query
function queryAllProducts (){ connection.query("SELECT * FROM products", function(err, res){ for (var i = 0; i < res.length; i++) { console.log("Id: " + res[i].id + " | " + res[i].productName + " | " + "$" + res[i].price); } console.log("---------------------------------------------------"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "oneProduct(_, args) {return queryOneProduct(args.id)}", "getProducts() {}", "getProducts(options) {\n console.log('inside getProducts');\n\n // array to hold parameters that may be entered in the query\n const queryParams = [];\n\n // array to hold each query filter\n const filters = [];\n\n // start query with info that comes before the WHERE clause\n let queryString = `SELECT * FROM products`;\n\n // --------- the filter by favorites part is not functional yet -----------//\n // FILTER BY FAVS: return only favorites\n // when the user clicks on fav button\n if (options.favorite) {\n queryString += `\n JOIN favorites ON product_id = products.id\n JOIN users ON user_id = users.id\n WHERE user_id = ${options.userId} AND`;\n }\n\n if (queryString.includes('WHERE')) {\n queryString += ` products.is_sold = false`;\n } else {\n queryString += ` WHERE products.is_sold = false`;\n }\n\n // -------------- filter by price -------------------- //\n\n // FILTER BY PRICE: minimum price\n if (options.minimumPrice) {\n queryParams.push(`${options.minimumPrice}`);\n filters.push(`price >= $${queryParams.length}`);\n }\n\n // FILTER BY PRICE: maximum price\n if (options.maximumPrice) {\n queryParams.push(`${options.maximumPrice}`);\n filters.push(`price <= $${queryParams.length}`);\n }\n\n // concatenate filters\n if (filters.length > 0) {\n queryString += ' AND ' + filters.join(' AND ');\n }\n\n // complete queryString\n queryString += ` ORDER BY price;`;\n // queryString += \";\";\n\n console.log('queryString: ', queryString);\n\n return db\n .query(queryString, queryParams)\n .then(result => result.rows)\n .catch(error => error.message);\n }", "function productItems() {\n\tconnection.connect(function(err) {\n\n\t\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err\n\t\telse console.table(res , \"\\n\");\n\t\tproductId();\n\t\t});\n\t});\n}", "filterMultiplyProductKey(_, args) {return queryFilterMultiplyProductKey(args.key)}", "function products() {\n var query = connection.query(\"SELECT item_id, department_name, product_name, price, stock_qty, product_sales FROM products ORDER BY item_id\", function(err, results, fields) {\n if(err) throw err;\n console.log(\"\\r\\n\" + \" - - - - - - - - - - - - - - - - - - - - - - - - \" + \"\\r\\n\");\n console.log(\"\\r\\n\" + chalk.yellow(\"-------- \" + chalk.magenta(\"BAMAZON PRODUCTS\") + \" ----------\") + \"\\r\\n\");\n var productsList = [];\n console.table(results);\n for(obj in results) {\n productsList.push(results[obj].products);\n }\n return managerDashboard(productsList);\n })\n}", "function getProducts(res, mysql, context, complete){\n \tmysql.pool.query(\"SELECT p_id, p_name, p_qty, p_mfg, price FROM Product\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.product = results;\n complete();\n });\n }", "function GetProducts (req,res){\n const query =`\nSELECT P.prodId,P.prodNombre,P.prodDescripcion,P.prodPrecio,P.prodFechaCreacion,P.prodCantidad,U.uniNombre,C.catNombre,PR.preNombre,M.marNombre,US.usuNombre,US.usuApellido,PO.proNombre FROM productos P\nINNER JOIN unidades U ON P.prodIdUnidad=U.uniId\nINNER JOIN categorias C ON P.prodIdCategoria=C.catId\nINNER JOIN presentaciones PR ON P.prodIdPresentacion=PR.preId\nINNER JOIN marcas M ON P.prodIdMarca=M.marId\nINNER JOIN usuarios US ON P.prodIdUsuario=US.usuId\nINNER JOIN proveedores PO ON M.marIdProv=PO.proId\n;\n `;\n mysqlConn.query(query, (err,rows,fields) =>{\n if(!err){\n if(rows.length > 0){\n var productos = rows;\n res.json(productos);\n }else{\n res.json({status:\"No se encontraron productos\"});\n }\n }else{\n console.log(err);\n };\n });\n}", "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, res) {\n console.log(\"Products for sale\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"======================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n });\n displayChoices();\n}", "function productItems() \n{\n connection.connect(function(err) \n {\n connection.query(\"SELECT * FROM products\", function(err, res) \n {\n\tif (err) throw err\n\telse console.table(res , \"\\n\");\n\tproductId();\n\t});\n});\n}", "function getProducts(session_id, callback) {\n\n let context = sessions.getContext(session_id);\n let product_line = mapping.product_line_to_db_keys[context.product_line];\n let benefits = context['benefits'].concat();\n\n let adjectives = context['adjectives_new'].concat();\n let filters = context['filters'];\n let from = context['from'];\n let is_flow_complete = context.is_flow_complete;\n let result_product_line = context.product_line, result_occasion;\n\n let products_query = helper.buildQuery(product_line, filters, context[\"priority_values\"],from, benefits, adjectives, context[\"remove_tags\"], context[\"sort_type\"],context[\"sort_priority_values\"],context[\"occasion_status\"]);\n console.log(JSON.stringify(products_query.body, null, 2));\n\n benefits = benefits.concat(context[\"priority_values\"][\"benefits\"]);\n adjectives = adjectives.concat(context[\"priority_values\"][\"adjectives\"]);\n let sort_priority_benefits=[];\n if(context[\"sort_type\"])\n {\n if(context[\"sort_type\"]==\"priority\")\n {\n sort_priority_benefits = context[\"sort_priority_values\"].map(function(obj)\n {\n let value = obj.value;\n if(obj.type==\"benefit\")\n {\n value = helper.getBenefitname(value,product_line,\"benefits\");\n }\n else\n {\n value = helper.getBenefitname(value,product_line,\"adjectives\");\n }\n return value;\n });\n }\n }\n else\n {\n let benefit_tags = benefit_tagging[product_line];\n let priority_benefit_values = context[\"priority_values\"][\"benefits\"];\n for(let ben in priority_benefit_values)\n {\n if((!context[\"occasion_status\"] &&benefit_tags[priority_benefit_values[ben]]==\"broad_occasions\") || benefit_tags[priority_benefit_values[ben]]==\"occasions\")\n {\n let ben_name = helper.getBenefitname(priority_benefit_values[ben],product_line,\"benefits\");\n if(sort_priority_benefits.indexOf(ben_name)==-1)\n sort_priority_benefits.push(ben_name);\n }\n }\n }\n\n \n console.log(\"Sending to elasticsearch\");\n // Fetching products\n elasticSearch.runQuery(products_query, function (es_result,total,err)\n {\n let result = [];\n if(context.broad_occasion && context[\"broad_occasion\"].key!=\"\")\n result_occasion = context.broad_occasion.key;\n //result.push({\"total\":total,\"is_flow_complete\":is_flow_complete, \"product_line\": result_product_line, \"occasion\": result_occasion});\n console.log(\"Total Products : \",total);\n if(err==null && total>0)\n {\n helper.getMongoProductDetails(context, es_result, adjectives, benefits, sort_priority_benefits, function(mongo_product_list){\n result = result.concat(mongo_product_list);\n callback(result);\n });\n }\n else\n {\n callback(result);\n }\n });\n}", "function ProductList(props) {\n const PRODUCT_QUERY = gql`\n {\n products {\n id,\n title,\n image_url,\n price(currency:${props.context.state.currency}),\n }\n }\n`;\n const { data, loading, error } = useQuery(PRODUCT_QUERY);\n if (loading) return (\n <div className=\"message\">\n <p>Loading...</p>\n </div>\n );\n if (error) return (\n <div className=\"message\">\n <p>An error occured. Please reload page.</p>\n </div>\n );\n const products = data.products;\n return (\n <div className=\"product-list\">\n {products.map((product, index) =>\n <div key={index} className=\"product-item\">\n <div className=\"product-item-img\">\n <img src={product.image_url} alt={product.title} />\n </div>\n <p className=\"product-title\">{product.title}</p>\n <p className=\"product-price\">From {props.context.state.currency} {currencyFormat(product.price)}</p>\n <button onClick={() => props.addToCart(product)}>Add to Cart</button>\n </div>\n )}\n </div>\n );\n}", "function chooseProduct(el){\n return searchProduct($(el).closest(\"section\").data(\"store\"), $(el).data(\"productid\"));\n }", "products() {\n return this.#request('Products', 'GET');\n }", "viewProduct(product) {\n const queryString = `SELECT * FROM products\n WHERE products.id = $1`;\n\n const queryParams = [product.productId];\n\n return db\n .query(queryString, queryParams)\n .then(result => result.rows)\n .catch(error => error.message);\n }", "function productsForSale() {\n\tvar query = \"SELECT * FROM products HAVING stock_quantity > 0\";\n\tconnection.query(query, function(err, res){\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n\t\t\tconsole.log(\"-----------------------------\");\n\t\t}\n\trunSearch();\n\t});\n}", "function viewProducts(){\n var query = connection.query(\"SELECT ID, Product_Name , Price, Stock_QTY FROM products;\", function(err, res) {\n console.log(\"\");\n console.table(res);\n console.log(\"\");\n \n managerAsk();\n });\n }", "getProducts(guild, callback) {\n db.query(`SELECT * FROM ah_products WHERE server_id = '${guild.id}'`, function(err, result, fields) {\n if (err) throw err\n\n callback(result)\n })\n }", "getProduct(guild, product, callback) {\n db.query(`SELECT * FROM ah_products WHERE server_id = '${guild.id}' AND name = '${product}' LIMIT 1`, function(err, result, fields) {\n if (err) throw err\n\n callback(result[0])\n })\n }", "function getProduct(){\n\n if (productsPerPageCounter == 0) {\n productsURL = 'http://127.0.0.1:3000/api/products/?offset=' + productsPerPage + '&limit=' + howManyProducts; // get X products\n productsPerPageCounter += 1;\n } else if (productsPerPageCounter >= 1) {\n productsPerPage += productsPerPage;\n productsURL = 'http://127.0.0.1:3000/api/products/?offset=' + productsPerPage + '&limit=' + howManyProducts; // get X products\n }\n\n fetch(productsURL)\n .then((resp) => resp.json())\n .then(function(data) {\n // console.log(data);\n data = data.data;\n displayProductAPIData(data)\n })\n }", "fetchProductsById(productId) {\r\n return axios.get(USER_API_BASE_URL + '/product/' + productId);\r\n }", "function fetchProduct(req, res) {\n let pool = engine.getPool();\n\n let query = req.query;\n let filter = query.filter; // The filter\n let limit = query.limit; // Limit number of rows per page\n let page = query.page; // The current page\n // Filter\n // filter = \"last-update-rank\"\n // filter = \"earliest-expiry-rank\"\n // filter = \"price-asc-rank\"\n // filter = \"price-desc-rank\"\n let dir = \"\";\n let order = \"ORDER BY p.product_name collate utf8_vietnamese_ci\";\n if (filter) {\n if (filter === \"entered-time-asc-rank\"){\n \n }\n }\n if (limit && page) {\n\n let getStock = function(batch_id) {\n return `SELECT s.unit_layer, s.product_unit, s.initial_quantity, \n s.product_cost, s.product_price, s.current_quantity, u.name AS product_unit_name\n FROM ${TABLE.STOCK} s\n INNER JOIN\n ${TABLE.UNIT} u ON\n u.id = s.product_unit\n WHERE s.batch_id = '${batch_id}'`;\n }\n\n\n let getProduct = function(){\n // Re-calculate the limit for the query\n let start = page == 1 ? 0 : (page - 1) * limit - 1;\n return `SELECT p.*, o.name AS product_provider_name, \n s.shelf_name AS product_location_name, b.last_update, b.earliest_expiry\n FROM (SELECT *\n FROM ${TABLE.PRODUCT}\n LIMIT ${start}, ${limit}) p\n LEFT JOIN \n (SELECT product_id, MAX(entered_time) AS last_update, MIN(expiry) as earliest_expiry FROM ${TABLE.BATCH}\n GROUP BY product_id) b ON\n b.product_id = p.id\n LEFT JOIN \n ${TABLE.PROVIDER} o ON\n o.id = p.product_provider \n LEFT JOIN\n ${TABLE.SHELF} s ON\n s.id = p.product_location`;\n }\n\n let getBatch = function(product_id){\n return `SELECT id, batch_serial_number, expiry, entered_time, \n (SELECT username from ${TABLE.USER} WHERE user_entered_id = id) AS user_entered_username\n FROM ${TABLE.BATCH} \n WHERE product_id = ${product_id}`;\n }\n\n let getRestockProgress = function(product_id){\n return `SELECT p.progress_id, p.action, p.entered_time, p.note, u.username AS user_entered_username\n FROM ${TABLE.RESTOCK_PROGRESS} AS p\n LEFT JOIN ${TABLE.USER} AS u ON u.id = p.user_entered_id\n WHERE product_id = ${product_id} ORDER BY entered_time ASC`;\n }\n\n \n let jsonResult = {}\n\n pool.getConnection(function (error, con) {\n // Handle error if there is any\n handleErr(error, res, con);\n // Start the process\n async.waterfall([\n \n // Getting all the products\n function (callback) {\n con.query(getProduct(), (err, products) => {\n if (err) callback(err);\n else callback(null, products)\n });\n \n },\n // Adding the restock's status to products\n function (products, callback){\n async.eachSeries(products, function (product, inner_callback) {\n con.query(getRestockProgress(product.id), (err, pros) => {\n if (err) inner_callback(err);\n else {\n product.restock_progress = pros;\n inner_callback(null);\n }\n });\n }, function(err){\n if (err) callback(err);\n else callback(null, products);\n });\n },\n // Adding the batch's info to products\n function ( products, callback) {\n async.eachSeries(products, function (product, inner_callback) {\n con.query(getBatch(product.id), function (err, batches) {\n if (err) inner_callback(err);\n else {\n // Add each stock info to its corresponding batch\n async.eachSeries(batches, function (batch, inner_callback2) {\n con.query(getStock(batch.id), function(err, stocks) {\n if (!err) {\n batch.stocks = stocks;\n inner_callback2(null);\n }\n else inner_callback2(err);\n });\n }, function(err){\n if (err) inner_callback(err);\n else {\n product.batches = batches;\n inner_callback(null);\n }\n });\n }\n });\n }, function (err){\n if (err) callback(err);\n else {\n callback(null, products);\n }\n });\n }\n ], function(err, products){\n if (err){\n jsonResult.error = err;\n } else {\n jsonResult.result = {};\n jsonResult.result.products = products;\n }\n res.json(jsonResult);\n con.release();\n })\n });\n }\n}", "function displayProducts() { \n\n connection.query(\"SELECT * FROM products\", function (err, res) {\n console.log(\"=====================================================================\");\n if (err) throw err;\n // Log all results of the SELECT statement\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | \" + res[i].price + \"|\" + res[i].stock_quantity);\n }\n console.log(\"=====================================================================\");\n userWants();\n\n\n })\n}", "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif(err) {\n\t\t\tthrow err\n\t\t};\n\t\tfor (var i =0; i < res.length; i++) {\n\t\t\tconsole.log(\"SKU: \" + res[i].item_id + \" | Product: \" + res[i].product_name \n\t\t\t\t+ \" | Price: \" + \"$\" + res[i].price + \" | Inventory: \" + res[i].stock_quantity)\n\t\t}\n\t\t// connection.end();\n\t\trunQuery();\n\t});\n}", "listProducts(query = null) {\n return getAllOfResource(\n {\n key: this._key,\n secret: this._secret,\n domain: this._domain,\n },\n 'products',\n query\n );\n }", "function getProducts () {\n getRequest('products', onGetProducts);\n }", "static get_All_products(){\n return products;\n }", "function displayProducts() {\n connection.query(`\n SELECT item_id, product_name, price \n FROM products \n WHERE stock_quantity > 0`, (err, response) => {\n if(err) console.log(chalk.bgRed(err));\n response.forEach(p => p.price = `$ ${p.price.toFixed(2)}`);\n console.table(response);\n // connection.end();\n start();\n });\n}", "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "function getProductsInCategory() {\n\n // reset product array\n products = [];\n\n // get category from menu\n let category = this.innerHTML;\n\n // API call to get products in category\n fetch(`https://my-store2.p.rapidapi.com/catalog/category/${category}/products?limit=20&skip=0`, {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": \"ef872c9123msh3fdcc085935d35dp17730cjsncc96703109e1\",\n \"x-rapidapi-host\": \"my-store2.p.rapidapi.com\"\n }\n })\n .then(response => {\n return response.json();\n })\n .then(response => {\n\n // varialbe to decide product counter, starts with 1\n let items = 1;\n\n // total number of products\n let total_item = response['products'].length;\n\n // set default call to display product func to false, we will set it to true once all product details are collected\n let callDisplayProduct = false;\n\n response['products'].forEach(product => {\n\n // if it is last product\n if(items == total_item) {\n\n // set true so that it calls display product func\n callDisplayProduct = true;\n }\n\n // get product details by product id\n getProductDetail(product['id'], callDisplayProduct); \n items++; \n \n });\n\n })\n .catch(err => {\n console.error(err);\n });\n }", "function selProduct(res) {\n res = res.toUpperCase();\n let rowCurr = $('#listProductsTable table tbody tr');\n let hearCnt = $('#listProductsTable table tbody tr th');\n\n if (res.length > 2) {\n let dstr = 0;\n let dend = 0;\n if (res.length == 5) {\n $('.toCharge').removeClass('hide-items'); //jjr\n if (glbSec != 4) { //IF agragado por jjr\n // console.log('Normal');\n getProducts(res.toUpperCase(), dstr, dend);\n } else {\n console.log('Subarrendo');\n getProductsSub(res.toUpperCase(), dstr, dend);\n }\n } else {\n rowCurr.css({ display: 'none' });\n rowCurr.each(function (index) {\n var cm = $(this)\n .data('element')\n .toUpperCase()\n .replace(/|/g, '');\n\n cm = omitirAcentos(cm);\n var cr = cm.indexOf(res);\n if (cr > -1) {\n $(this).show();\n }\n });\n }\n // rowCurr.show();\n } else {\n $(`#listProductsTable table tbody`).html('');\n rowCurr.addClass('oculto');\n }\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(error, results) {\n if (error) throw error;\n console.log(\"AVAILABLE ITEMS:\");\n for (var i = 0; i < results.length; i++) {\n console.log(results[i].id + ' | ' + results[i].product_name + ' | ' + '$'+results[i].price + ' | ' + results[i].stock_quantity);\n }\n });\n connection.end();\n}", "function getProducts(){\n\n productsRef.get().then((querySnapshot) => {\n var objects = [];\n querySnapshot.forEach((doc) => {\n const obj = doc.data();\n obj.id= doc.id;\n objects.push(obj);\n console.log(`${doc.id} => ${doc.data()}`);\n });\n renderProducts(objects);\n // loader.classList.remove(\"loader--show\")\n });\n\n }", "getProducts() {\n return this.http.get(\"\".concat(this.uri2));\n }", "function queryAllProducts() {\n\n console.log();\n console.log(\"ALL AVAILABLE ITEMS:\");\n console.log(\"-----------------------------------\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price);\n }\n console.log(\"-----------------------------------\\n\");\n });\n}", "function showProducts () {\n connection.query(query, function(err, results) {\n if (err) {\n throw err;\n };\n console.log(\"\\nID - Product Name: Price\\n\");\n results.forEach(element => {\n var item_id = element.item_id;\n var product_name = element.product_name;\n var price = element.price;\n console.log(`${item_id} - ${product_name}: $${price}`)\n\n // Testing the old ways\n // for (var i = 0; i < results.length; i++) {\n // console.log(`${results.item_id} - ${results.product_name}: $${results.price}`)};\n });\n\n buyItem();\n });\n}", "function products(){\n connection.query(\"SELECT * FROM products\", (err,result) =>{\n if (err) throw err;\n\n console.table(result);\n start();\n })\n}", "function displayProducts() {\n connection.query(\"SELECT product_name AS 'Product', department_name AS 'Department', price AS 'Sales Price', stock_quantity AS 'In Stock' FROM products\",\n (err, results, fields) => {\n if (err) {\n throw err;\n }\n console.table(results);\n// .map runs a function on every item on the array and returns a new array\n const productArray = results.map(itemInArray => itemInArray.Product);\n promptCustomer(productArray);\n })\n}", "static getOrderItemsProducts(orderId) {\n return db.execute(\n `SELECT orderitems.*, products.* FROM orderitems\n JOIN products ON products.id = orderitems.productId\n WHERE orderitems.orderId = ?`, [orderId]\n )\n .then(([result, metaData]) => {\n return result;\n })\n .catch(err => console.log(err));\n }", "function getProductById(productId){\n return{\n type: 'GET_PRODUCT_BY_ID',\n productId\n }\n}", "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n\n // create an array to hold our formatted res data and loop through the res data\n var products = [];\n res.forEach(element => {\n products.push(\"ID#: \" + element.item_id + \" | Product Name: \" + element.product_name + \" | Price: $\" + element.price + \" | Quantity: \" + element.stock_quantity);\n }); // end .forEach\n\n // display the items\n console.log('\\n');\n console.log('《 ALL AVAILABLE PRODUCTS 》');\n console.log(\" -------------------------\" + '\\n');\n products.forEach(element => {\n console.log(element);\n }); // end .forEach\n console.log('\\n');\n start();\n }); // end .query\n} // end viewProductsFunction", "function salesByProduct(products, lineItems){\n //TODO\n}", "function displayProducts() {\n connection.query(\"select item_id as ID,product_name as Product,price as Price,stock_quantity as Quantity from products; \", function (error, respDB) {\n if (error) throw error;\n console.table(respDB);\n askIfContinuing();\n });\n}", "function querySaleProducts() {\n\tinquirer\n\t.prompt({\n\t\tname: \"customer_name\",\n\t\ttype: \"input\",\n\t\tmessage: \"Dear Customer, please enter your name.\"\n\t})\n\t.then(function(answer) {\n\t\tconsole.log(\"Welcome to Bamazon, \" + answer.customer_name + \":) Here is our special sales for you!\");\n\n\t\tvar query = \"SELECT * FROM products WHERE stock_quantity <> 0\";\n\n\t\tconnection.query(query, function(err, res) {\n\t\t\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"Item ID: \" + res[i].item_id + \" | \" + res[i].department_name + \": \" + res[i].product_name + \" for $\" + numberWithCommas(res[i].price));\n\t\t}\n\n\t\tqueryOrder();\n\t\t});\t\n\t});\n}", "function showRelatedProduct(){\r\n var image=this.children[0].id.split(\"-\");\r\n var p_id=image[1];\r\n var p_category=image[0];\r\n cartOperations.search(callBackForRelatedProduct,p_id,p_category,undefined);\r\n}", "function purchase() {\n connection.query(\n \"SELECT item_id, price*answer.purchase FROM products\",\n console.log(query.sql)\n )\n }", "function listProductsFromSearch(phone, nameSearch) {\n var renderProducts = phone.map((element, index) => {\n if(element.name.toLowerCase().includes(nameSearch.toLowerCase())) {\n return `\n <div class=\"col l-3\">\n <div class=\"container__homepage__product\">\n <a href=\"Detail-product.html?id=${element.id}\">\n <div class=\"container__homepage__product__img\"\n style=\"background-image: url(${element.image})\">\n </div>\n </a>\n <div class=\"container__homepage__content\">\n <div class=\"container__homepage__product__name\">${element.name}</div>\n <div class=\"container__homepage__product__price\">\n <div class=\"container__homepage__product__price-discount\">${element.price}đ</div>\n <div class=\"container__homepage__product__price-origin\">${element.oldPrice}đ</div>\n </div>\n <div class=\"container__homepage__product__rating\">\n <div class=\"container__homepage__product__star\">\n <i class=\"fas fa-star\"></i>\n <i class=\"fas fa-star\"></i>\n <i class=\"fas fa-star\"></i>\n <i class=\"fas fa-star\"></i>\n <i class=\"fas fa-star\"></i>\n </div>\n <div class=\"container__homepage__product__review\">25 Review</div>\n </div>\n <div class=\"container__homepage__product__function\" onclick=\"addCart(${element.id})\">\n <i class=\"fas fa-cart-plus\"></i>\n </div>\n </div>\n <div class=\"container__homepage__installment\">Installment 0%</div>\n </div>\n </div>\n `;\n }\n });\n return renderProducts;\n}", "function productsForSale() {\n console.log(\"products for sale fxn\");\n connection.query(\"SELECT * FROM products\",function(err, res){\n if (err) throw err;\n for (var i=0; i<res.length;i++) {\n console.log(`Product Name: ${res[i].product_name}`);\n console.log(`Department Name: ${res[i].department_name}`);\n console.log(`Selling Price: $${res[i].price}`);\n console.log(`Quantity in Stock: ${res[i].stock_quantity}`);\n console.log(\"---------------------\");\n }\n });\n connection.end();\n }", "function productSearch(){\n connection.query(\"SELECT * FROM products\", function(err, res){\n\t\tif(err) throw err;\n\n\t\t//Display the product information by creating table to hold the query data\n\t\tvar productsTable = new Table({\n\t\t\t//Define headers\n\t\t head: ['Item number', 'Item', 'Deparment', 'Price', 'Quantity in stock']\n\t\t \n\t\t});\n\t\t \n\t\t//Loop through query results and push the results to the table and populate table with the product data.\n\t\tfor (var i=0; i < res.length; i++) {\t\t\t\n\t\t\t// table is an Array\n\t\t\tproductsTable.push(\n\t\t \t[res[i].item_id, res[i].product_name, res[i].department_name, res[i].price, res[i].stock_quantity],\n\t\t\t);\n\t\t} \n\t\t//Display table to terminal.\n\t\tconsole.log(productsTable.toString());\n\t});\n\n setTimeout(init_load, 3000); \n}", "function viewProducts() {\n connection.query(\"SELECT * FROM bamazon.products\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n\")\n for (let i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].item_id + \" ---- Product: \" + res[i].product_name + \" ---- Price: $\" + res[i].price + \" ---- Quantity: \" + res[i].stock_quantity)\n }\n })\n start();\n}", "function displayProducts() {\n console.log(\"Selecting all products...\\n\");\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n // Log all results \n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].id + \" | \" + \"Product: \" + res[i].product_name + \" | \" + \"Department: \" + res[i].department_name + \" | \" + \"Price: \" + res[i].price + \" | \" + \"Quantity: \" + res[i].stock_quantity);\n console.log('------------------------------------------------------------------------------------------------------------')\n };\n selectProducts(res)\n });\n}", "async function getProducts(){\n var result=await Product.\n find()\n .limit(2) // Number of records required\n .sort({name:1}) // sort in ascending order w.r.t name\n .select({author:\"Hamad\"}); // properties required by items\n\n console.log(\" \\n\\nGet all records, then sort ascendingly on name, pick top 2 elements, and display whose author is hamad\\n\\n \"+result);\n\n result=await Product.\n find({price:{$lt:70,$gt:30}}); // price less than 70 and greator than 30\n console.log(\" \\n\\nprice less than 70 and greator than 30 \\n\\n\"+result);\n\n result=await Product.\n find({price:{$ne:30}}); // whose price is not equal to 30\n console.log(\" \\n\\nwhose price is not equal to 30 \\n\\n\"+result);\n\n result=await Product.\n find({price:{$in:[40,30]}}); // whose price is 40 or 30\n console.log(\"\\n\\n whose price is 40 or 30 \\n\\n\"+result);\n\n result=await Product.\n find({price:{$nin:[40,30]},name:\"rice\"}); // price is neither 40 nor 30 and name is rice \n console.log(\"\\n\\n price is neither 40 nor 30 and name is rice \\n\\n \"+result);\n\n}", "fetchProductsByName(searchName) {\r\n return axios.get(USER_API_BASE_URL + '/product/search/' + searchName);\r\n }", "handleFilterClickEvent() {\n let query = { category: this.state.category, price: this.state.price}\n this.props.fetchProducts(query)\n }", "function getProducts(){\n return catalog;\n }", "getProductsBasedOnSearch(searchText) {\n return products().then((productsCollection) => {//$text: { $search: searchText }\n return productsCollection.find( {$text: { $search: searchText }} ).toArray().then((allUserProducts)=>{\n if (!allUserProducts) Promise.reject(\"User Products not found\");\n return allUserProducts;\n }).catch((e) => {\n console.log(\"Error while searching for products:\", e);\n });\n });\n }", "function queryProductsWithFilters() {\n\n // reference list for the four main fields\n var fields = [\n 'cat-year',\n 'cat-make',\n 'cat-model',\n 'cat-drivetype',\n 'cat-category'\n ];\n\n // Set up an array to populate with query values\n var queryValues = [];\n\n // Go through each of the fields and put together a query\n for (var indx = 0; indx < fields.length; indx++) {\n queryValues.push(fields[indx] + \"=\" + encodeURIComponent($('#' + fields[indx]).val()));\n }\n\n // Query up the extra filters that are currently in place\n var currentFilters = $(\".diffwizard--current-filter\");\n // Loop through those filters and get thier\n for (var currentFilterIndex = currentFilters.length - 1; currentFilterIndex >= 0; currentFilterIndex--) {\n // Get the filter's name and value\n var filterName = $(currentFilters[currentFilterIndex]).data('filter');\n var filterValue = $(currentFilters[currentFilterIndex]).data('value');\n // Append this filter to the query\n queryValues.push(filterName + \"=\" + filterValue);\n }\n\n // Compile together the query values\n var compiledUrl = URL + \"?\" + (queryValues.join('&'));\n\n // Include Category Parent to query\n compiledUrl += '&parent-id=' + $('#parent-id').val();\n\n // Get the info back from the wizard\n $.ajax({\n url: compiledUrl,\n type: 'get',\n data: {\n action: 'product_browsing_ajax_request',\n source: 'product-browsing',\n nonce: browsing.ajax_nonce\n },\n dropdownIndex: 5, // Index of the dropdown we are on\n fields: fields, // A list of the dropdown fields\n success: handleProductData\n });\n }", "function search4product(gid, pid, path, amount, docs){\r\n\t\r\n\t tContent += '<tr>';\r\n\t\tfor( var i = 0 ; i< docs.products.length; i++){\r\n\t\t \r\n\t\t\tif(docs.products[i]._id == pid){ //if I use '===' it won't match, don't know why\r\n\t\t\t\t\t\t \t\t\t\t\r\n\t\t\t\tvar imgPath = '/public/img/' + path +'/' + docs.products[i].p_imgId;\r\n\t\t\t var pname = docs.products[i].p_name;\r\n\t\t\t var price = docs.products[i].p_price;\r\n\t\t\t var desc = docs.products[i].p_desc;\r\n\t\t\t var id = gid + \"***\" + pid;\r\n\r\n\t\t tContent += '<td> <img src=\"'+ imgPath + '\" class=\"img-thumbnail\" ></td>'; \r\n\t\t tContent += '<td>' + pname + '</td>';\r\n\t\t tContent += '<td> $' + price + '</td>';\r\n\t\t tContent += '<td><input type=\"text\" name=\"amount\" id=\"p_amount\" size=\"1\" value=\"' + amount + '\"></td>';\r\n\t\t tContent += '<td desc=\"' + desc + '\"><button type=\"button\" class=\"btn btn-primary\" id=\"desc\">Description</button></td>';\r\n\t\t tContent += '<td id=\"' + id + '\"><button type=\"button\" class=\"btn btn-success\" id=\"update\">Update</button></td>';\r\n\t\t\t\t\t \t\t\t\t\r\n\t }//end if\r\n\t }\r\n\t tContent += '</tr>';\r\n\t return tContent;\r\n\t //console.log(\"end for search4product\");//end for\r\n\t \r\n}", "function displayProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].item_id + \" | \" \n + \"Product: \" + res[i].product_name + \" | \" \n + \"Department: \" + res[i].department_name + \" | \" \n + \"price: \" + res[i].price + \" | \" \n + \"QTY: \" + res[i].stock_quantity);\n }\n inquireForPurchase();\n\n });\n}", "function getProducts() {\n\treturn db.query(\"SELECT * FROM products\")\n\t\t.then(function(rows) {\n\t\t\treturn rows[0];\n\t\t})\n\t .catch(function(err) {\n\t console.log(err);\n\t });\n}", "function queryProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | \" + res[i].stock_quantity+ \" |$\" + res[i].price);\n }\n console.log(\"--------------------------------------------------------\");\n\n inputOne();\n });\n}", "renderProducts() {\n let filteredProducts = this.props.products;\n\n return filteredProducts.map((product) => (\n <Product key={product._id} product={product} />\n ));\n }", "function getProductsStore(selectedStoreName) {\n \n // get the data in the active sheet \n var sheet = getOutputSheet(1); \n \n var cell = getOutputFirstCell(1);\n \n cell.setFormula(\"=QUERY('Base de Datos'!A:M;\\\"select F, G, H, K, sum(I), max(L) where J='No Vendido' and K='\"+selectedStoreName+\"' group by G, F, H, K\\\")\");\n \n\t// create a 2 dim area of the data in the carrier names column and codes \n\tvar products = sheet.getRange(2, 1, sheet.getLastRow() -1, 6).getValues().reduce( \n\t\tfunction(p, c) { \n \n // add the product to the list\n\t\t\tp.push(c); \n\t\t\treturn p; \n\t\t}, []); \n \n return JSON.stringify(products);\n}", "allProducts(productsListFromProps) {\n if (productsListFromProps.length > 0) {\n const l = productsListFromProps.length;\n let indexedProductsAll = [];\n for (let x = 0; x < l; x++) {\n indexedProductsAll.push({ seqNumb: x, details: productsListFromProps[x] })\n }\n return indexedProductsAll;\n } else {\n return [];\n }\n }", "function listProducts() {\n\n // connection.connect(function (err) {\n // if (err) throw err;\n var sql = \"SELECT * FROM product WHERE stock_quantity > 0\";\n connection.query(sql, function (err, res) {\n if (err) throw err;\n displayHeaderGrid(); \n for (var j = 0; j < res.length; j++) {\n var p_itm = new PaddedWord(res[j].item_id, 2, \" \", \"left\");\n var p_prd = new PaddedWord(res[j].product_name, 25, \" \");\n var p_cat = new PaddedWord(res[j].department_name, 15, \" \");\n var p_prc = new PaddedWord(res[j].price, 6, \" \", \"left\");\n var p_qty = new PaddedWord(res[j].stock_quantity, 3, \" \", \"left\");\n\n displayProductGrid(p_itm.padded(), p_prd.padded(), p_cat.padded(), p_prc.padded(), p_qty.padded());\n }\n // connection.end();\n promptUserPurchase()\n });\n // });\n}", "function queryProductsByCategoryId(e){\n \t\tvar categoryId = $(e.target).attr(\"data-categoryid\");\n \t\t//alert(\"categoryId=\"+categoryId);\n \t \t//send requrest to server.\n \t $.ajax({\n \t \turl: basePath+'productList', \t\n \t\t\tcache:false,\n \t\t\tasync: false,\n \t\t\ttype:'POST',\t\t\t\n \t\t\tdata: {\n \t\t\t\tid: categoryId\n \t\t\t},\n \t \tdataType:'json',\n \t \ttimeout:5000,\n \t \terror:\tfunction(xhr, ajaxOptions, thrownError){\n \t\t alert(xhr.status+\"\\n\"+xhr.responseText);\n \t \t\t\t}, \t\n \t \tsuccess:\tfunction(res) {\n \t \t\tqueryProductsInfoResponse(res);\n \t \t\t\t}\n \t }); \t\t\n \t}", "function products() {\n connection.query('SELECT * FROM products', function(err, res) {\n console.table(res);\n console.log(chalk.yellow(\"***Enter 'Q' and press enter twice to exit store***\"));\n customerOrder();\n });\n}", "function showProd(){\n\n //Sql statement\n var sql = \"select * from products\";\n conn.query(sql, (err, res) => {\n\n //If error throw error\n if (err) throw err;\n\n //If response length is greater than zero\n if (res.length > 0) {\n\n //Show welcome message and products\n console.log(\"\\nHere are all the current products and their associated information:\");\n console.log(\"\\n ID | Name | Department | Price | Quantity In Stock\");\n console.log(\" --------------------------------------------------\");\n for (i = 0; i < res.length; i++) {\n console.log(' ' +\n res[i].item_id +\n \" | \" +\n res[i].product_name +\n \" | \" +\n res[i].department_name +\n \" | \" +\n '$ '+ parseFloat(res[i].price) +\n \" | \" +\n res[i].stock_quantity\n );\n } \n }\n //Back to the menu\n main();\n })\n}", "function showLowProd(){\n\n //Sql statement\n var sql = \"select * from products where stock_quantity < 5\";\n var query = conn.query(sql, (err, res) => {\n\n //If error throw error\n if (err) throw err;\n\n //If response length is greater than zero\n if (res.length > 0) {\n\n //Show welcome message and products\n console.log(\"\\nHere are LOW QUANTITY products and their associated information:\");\n console.log(\"\\n ID | Name | Department | Price | Quantity In Stock\");\n console.log(\" --------------------------------------------------\");\n for (i = 0; i < res.length; i++) {\n console.log(' ' +\n res[i].item_id +\n \" | \" +\n res[i].product_name +\n \" | \" +\n res[i].department_name +\n \" | \" +\n '$ '+ parseFloat(res[i].price) +\n \" | \" +\n res[i].stock_quantity\n )\n }\n //Back to the menu\n main();\n\n } else {\n //No low quantity products found\n console.log('No low quantity products were found.');\n main();\n } \n })\n}", "function ShowProducts(){ \r\n\tconnection.query('SELECT * FROM product_name', function(err, res){ \r\n\t\tif (err) throw err; \r\n\t\tconsole.log('********************************************************');\r\n\t\tconsole.log('********************************************************');\r\n\t\tconsole.log('** Bamazon Mercantile **');\r\n\t\tconsole.log('** Product list **'); \r\n\t\tconsole.log('********************************************************');\r\n\t\tconsole.log('********************************************************'); \r\n\r\n\t\tfor(i=0;i<res.length;i++){ \r\n\t\t\tconsole.log('Product ID:' + res[i].item_id + ' Product: ' + res[i].product_name + ' Price: ' + '$' + res[i].price + '(Quantity left: ' + res[i].stock_quantity + ')') \r\n\t\t} \r\n\t\tconsole.log('---------------------------------------------------------'); \r\n\t\tPlaceOrder(); \r\n\t\t}) \r\n}", "sortProducts() {}", "function getProducts(req, res) {\n\n Product.find({}, (err, product) => {\n if (err) {\n return res.status(500).send({ message: 'Error al realizar la Peticion' })\n } else if (!product) {\n return res.status(404).send({ message: 'No se encontro nada' })\n } else {\n res.status(200).send({ product })\n\n }\n })\n}", "function compareProductsSelected(request,response){\n const id=request.query.item;\n const quantity=request.query.volume;\n const page=request.query.page;\n const limit=request.query.limit;\n const startIndex=(page-1)*limit;\n const endIndex=limit;\n console.log(quantity)\n let sql=\"\";\n if(page!=null && limit!=null){\n console.log(\"2\")\n sql = \"SELECT * FROM milk_comparison RIGHT JOIN milk ON milk.id=milk_comparison.milk_id WHERE milk.id=\"+id+\" AND milk_comparison.volume LIKE '%\"+quantity+\"%' LIMIT \"+startIndex+\",\"+endIndex;\n }else if(page==null&limit==null){\n console.log(\"3\")\n sql = \"SELECT * FROM milk_comparison RIGHT JOIN milk ON milk.id=milk_comparison.milk_id AND milk_comparison.volume LIKE '%\"+quantity+\"%'\";\n }\n let obj;\n \n connectionPool.query(sql, (err, result) => {\n if (err) {//Check for errors\n console.error(\"Error executing query: \" + JSON.stringify(err));\n // reject(err);\n console.log(\"4\")\n }\n else {\n \n console.log(\"5\")\n obj = JSON.stringify(result);\n obj= JSON.parse(obj);\n if(obj.length==0){\n let sql=\"\";\n if(page!=null && limit!=null){\n console.log(\"2\")\n sql = \"SELECT * FROM cheeses_comparison RIGHT JOIN cheeses ON cheeses.id=cheeses_comparison.cheese_id WHERE cheeses.id=\"+id+\" AND cheeses_comparison.weight LIKE '%\"+quantity+\"%' LIMIT \"+startIndex+\",\"+endIndex;\n }else if(page==null&limit==null){\n console.log(\"3\")\n sql = \"SELECT * FROM cheeses_comparison RIGHT JOIN cheeses ON cheeses.id=cheeses_comparison.cheese_id AND cheeses_comparison.weight LIKE '%\"+quantity+\"%'\";\n }\n let obj;\n \n connectionPool.query(sql, (err, result) => {\n if (err) {//Check for errors\n console.error(\"Error executing query: \" + JSON.stringify(err));\n // reject(err);\n console.log(\"4\")\n }\n else {\n \n console.log(\"5\")\n obj = JSON.stringify(result);\n obj= JSON.parse(obj);\n console.log(obj)\n obj.forEach(element => {\n console.log(element[\"price\"])\n console.log(element[\"volume\"])\n console.log(element[\"brand\"])\n });\n response.send(obj);\n }\n });\n }else{\n console.log(obj)\n obj.forEach(element => {\n console.log(element[\"price\"])\n console.log(element[\"volume\"])\n console.log(element[\"brand\"])\n });\n response.send(obj);\n }\n \n }\n });\n\n}", "getProductItems(data) {\n const items = [];\n for (let i = 0; i < data.products.length; i += 1) {\n const p = data.products[i];\n items.push({ id: p.aonr, price: p.priceData.total, quantity: p.quantity });\n }\n return items;\n }", "function getProducts(){\n\n connection.connect(err => {\n if(err) {\n connection.end();\n throw err\n };\n\n console.log(\"Connection Successful!\");\n\n var query = \"SELECT * FROM PRODUCTS\";\n\n connection.query(query,function(err,data){\n\n if(err) throw err;\n\n for(var i = 0; i < data.length; i++){\n console.log(\"*---------------------------------*\");\n\n console.log(`Item ID: ${data[i].ITEM_ID}`);\n console.log(`Product Name: ${data[i].PRODUCT_NAME}`);\n console.log(`Department Name: ${data[i].DEPARTMENT_NAME}`);\n console.log(`Price: ${data[i].PRICE}`);\n console.log(`Stock Quantity: ${data[i].STOCK_QUANTITY}`);\n\n console.log(\"*---------------------------------*\\n\");\n }\n\n // We ask the customer what product they will like to purchase\n userInput();\n\n })\n \n // connection.end();\n })\n\n }", "@wire(getAvailableProducts, {recordId: '$recordId', offset: '$offset', rowLimit: '$rowLimit'})\n getProducts({ data, error }) {\n if(data){\n let loadedProducts = JSON.parse(data);\n this.products = this.products.concat(loadedProducts);\n this.allProductsLoaded = loadedProducts.length > 0 ? false : true;\n this.isLoaded = true;\n } else if(error){\n this.productsExist = false;\n this.infoMessage = error.body.message;\n this.isLoaded = true;\n }\n }", "async getAllProducts(req) {\n try {\n return await this.productsDbConnector.getAllProducts();\n } catch (err) {\n throw err;\n }\n }", "function getProduct(req, res) {\n let pool = engine.getPool();\n\n // Retrieve connection from the pool\n pool.getConnection(function (err, con) {\n var jsonResult = {};\n // Handle error\n if (err) {\n jsonResult.error = err;\n res.json(jsonResult);\n } else {\n // Query select\n var sql;\n let barcode = req.query.product_barcode;\n let batch = req.query.batch_serial_number;\n if (!barcode && !batch) // Query asks all products\n sql = `SELECT * FROM ${TABLE.PRODUCT}`;\n else if (!batch) // Query only asks for product with given id\n sql = `SELECT * FROM ${TABLE.PRODUCT} WHERE barcode = ${barcode}`;\n else if (barcode && batch) // Query asks for product and batch\n sql = `SELECT * FROM ${TABLE.PRODUCT} WHERE barcode = ${barcode}`;\n\n // Execute query\n con.query(sql, function (err, result) {\n\n // Handle error\n if (err) {\n jsonResult.error = err.code;\n res.json(jsonResult);\n // Release this connection\n con.release();\n return;\n }\n else jsonResult.result = result;\n \n // If the user is trying to get batch and stock info\n if (result.length > 0 && barcode && batch) {\n let product_id = result[0].id;\n sql = `select DATE_FORMAT(b.expiry, '%d-%m-%Y') as expiry, s.* \n from ${TABLE.BATCH} as b\n right join ${TABLE.STOCK} as s\n on b.id = s.batch_id\n where b.product_id = ${product_id} and b.batch_serial_number = '${batch}'\n order by s.unit_layer`;\n con.query(sql, function (err2, result2) {\n if (err) jsonResult.error = err2.code;\n else jsonResult.result[0].stock = result2;\n // Return json result\n res.json(jsonResult);\n // Release this connection\n con.release();\n });\n } else {\n // Return json result\n res.json(jsonResult);\n\n // Release this connection\n con.release();\n }\n });\n }\n });\n}", "function showAllProducts() {\n var sql = 'SELECT ?? FROM ??';\n var values = ['*', 'products'];\n sql = mysql.format(sql, values);\n connection.query(sql, function (err, results, fields) {\n if (err) throw err;\n for (let i = 0; i < results.length; i++) {\n console.log(` \\nItem ID: ${results[i].item_id} Name: ${results[i].product_name} Department: ${results[i].department_name} Price: ${results[i].price} Stock Quantity: ${results[i].stock_quantity} \\n-------------------------------------------------------------------------------------- \\n`);\n }\n startingQuestions();\n });\n}", "singleProduct(state) {\r\n return (singleId) => {\r\n return state.products.find((p) => {\r\n return p._id == singleId;\r\n });\r\n };\r\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 getProducts(cb){\n con.query(\"SELECT * FROM products\", function (err, result) {\n if (err) throw err;\n products = result;\n getItems(result)\n });\n}", "function viewProducts(){\n\n\tvar query = \"SELECT * FROM products\";\n\n\tconnection.query(query, function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log(\"ALL INVENTORY IN PRODUCTS TABLE\");\n\t\tfor(i=0; i< res.length; i++){\n\t\t\tconsole.log(\"---|| ID \"+ res[i].item_id+\" ---|| NAME: \"+ res[i].product_name+\" ---|| PRICE: $\"+ res[i].price + \" ---|| QUANTITY \" + res[i].stock_quantity);\n\t\t};\n\t\taskAction();\n\t})\n\n}", "GET_PRODUCTS(state, products) {\n state.products = products\n }", "function viewProduct() {\n var query =\n 'SELECT item_id, product_name, price, stock_quantity FROM products WHERE stock_quantity > 0';\n connection.query(query, function(err, res) {\n console.table(res);\n reset();\n });\n}", "getAllProducts() {\n return AxiosRequests.get(\"/products\");\n }", "function viewProducts() {\n clearConsole();\n connection.query(\"SELECT * FROM products\", function (err, response) {\n if (err) throw err;\n displayInventory(response);\n userOptions();\n })\n}", "function inventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n //organizes the collumns i wish to display for each item\n for (var i = 0; i < res.length; i++) {\n console.log(`ID: ${res[i].id} || Name: ${res[i].product_name} || Department: ${res[i].department_name} || Price: $${res[i].price}`)\n }\n shopping();\n })\n}", "function showProducts(query) {\n console.log(\"showProducts\");\n \n console.log(\"Selecting all products...\\n\");\n connection.query(query, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n for(var i = 0; i<res.length; i++){\n\n //store response for colum fields in variables for string interpolation\n var id = res[i].item_id;\n var name = res[i].product_name;\n var department = res[i].department_name;\n var price = res[i].customer_price;\n var quantity = res[i].stock_quantity;\n console.log(`ID: ${id} | Item: ${name} | Department: ${department} | Price: $${price} | Quantity: ${quantity}`); // console.log('--------------------------------------------------------------------------------------------------')\n \n }\n //create a new table using a javascript constructor \n var t = new Table;\n res.forEach(element => {\n t.cell(\"productID\", element.item_id)\n t.cell(\"productName\", element.product_name)\n t.cell(\"deptName\", element.department_name)\n t.cell(\"custPrice\", element.customer_price)\n t.cell(\"stockQuantity\", element.stock_quantity)\n\n t.newRow()\n\n });\n console.log(t.toString()); \n });\n \n }", "function displayProducts(){\n \n\tconnection.query(sql, function(err, data) {\n\t if (err) {\n\t console.log(err);\n\t }\n\n\t var items = '';\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\titems = '';\n\t\t\t\titems += 'ID: ' + data[i].item_id + ' | ';\n\t\t\t\titems += 'Product: ' + data[i].product_name + ' | ';\n\t\t\t\titems += 'Dept: ' + data[i].department_name + ' | ';\n\t\t\t\titems += '$' + data[i].price + ' | ';\n\t\t\t\titems += 'Quantity: ' + data[i].stock_quantity;\n\t\t console.log(\"------------------------------------------------------------------------\");\n\t console.log(items);\n\t\t\t};\n\n\t\tpurchase();\n\n\t});\n\n}", "function getProducts() {\n\tajax('GET', 'products', null, createProductList);\n}", "getProducts() {\n this.productService.getProducts({ page: 1, perPage: 5, filter: '' }).subscribe(products => {\n this.products = products.docs;\n this.docsTotal = products.total;\n }, err => {\n console.log(err);\n });\n }", "function getProducts() {\n let sql = \"SELECT * FROM products ORDER BY name ASC\";\n \n return new Promise(function(resolve, reject) {\n pool.query(sql, function(err, rows) {\n if (err) throw err;\n resolve(rows);\n });\n });\n}", "function readProducts() {\n console.log(\"Products Available...\\n\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n else { \n // loop through id, product name, price and display \n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].id);\n console.log(\"NAME: \" + res[i].product_name);\n console.log(\"PRICE: \" + res[i].price);\n console.log(\" \");\n }\n select();\n }\n }); \n }", "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err; \n\t\tconsole.table(res);\n\t\tchooseAction(); \n\t})\n}", "function findProduct(req,res,next){\n let query={}; // busqueda vacia\n query[req.params.key]=req.params.value; // generacion de busqueda\n\n console.log(req.params.key);\n console.log(req.params.value);\n\n Product.find(query) //busco si hay elementos\n .then(product=>{ //devuelve una promesa que la guardo en productos\n if(!product.length>0) return next(); //si no hay productos sigo\n\n req.body.product=product; // si los hay los guardos en el cuerpo de la peticion\n console.log(product)\n return next(); // y continua\n }).catch(err=>{\n req.body.err=err; // si hay un error lo guardo y paso a la siguiente funcion\n next();\n })\n\n}", "function getProduct(page) {\n page = page || 0;\n\n var config = {\n //params truyen vao api\n params: {\n keyword: $scope.keyword,\n page: page,\n pageSize: 20\n }\n }\n //call apiService url,params,success,error\n apiService.get('/api/product/getall', config, function (result) {\n if (result.data.TotalCount == 0)\n notificationService.displayWarning(\"Không có bản ghi nào được tìm thấy!\");\n $scope.products = result.data.Items;\n $scope.page = result.data.Page;\n $scope.pagesCount = result.data.TotalPages;\n $scope.totalCount = result.data.TotalCount;\n }, function () {\n console.log('Load productcategory failed.');\n });\n }", "function showProducts() {\n connection.query('SELECT * FROM products', function (error, res) {\n for (var i = 0; i < res.length; i++) {\n console.log('\\n Beer brand: ' + res[i].product_name + \" | \" + 'Department: ' + res[i].department_name + \" | \" + 'Price (6-pack): ' + res[i].price.toString() + \" | \" + 'Stock: ' + res[i].stock_quantity.toString());\n } \n console.log(\"----------------\");\n productDetails();\n });\n\n}", "function idProduct(id){\n for(let i = 0; i < catalog.length; i++){\n if(catalog[i].id === parseInt(id)){\n product = catalog[i];\n }\n }\n console.log(product);\n return product;\n }", "function filterProductByCode(code) {\n var productAll=[];\n $charge.product().filterByCode(code, 'desc')\n .success(function (data) {\n for (var i = 0; i < data.length; i++) {\n productAll.push(data[i]);\n //debugger;\n }\n if (onComplete) onComplete(productAll);\n\n\n }).error(function (data) {\n //debugger;\n if (onError) onError(data);\n });\n }" ]
[ "0.73962647", "0.73643893", "0.68109643", "0.68078536", "0.6698783", "0.66950345", "0.66331095", "0.66074383", "0.65538865", "0.6545692", "0.65297914", "0.6522555", "0.6496191", "0.64943016", "0.6490232", "0.64896196", "0.64842534", "0.6476202", "0.64423096", "0.643867", "0.6422547", "0.6383231", "0.6383152", "0.63798404", "0.6378511", "0.6373632", "0.6373588", "0.6365475", "0.6363964", "0.6353841", "0.63413006", "0.6339168", "0.63331294", "0.6332167", "0.6326907", "0.6326155", "0.6320847", "0.63168925", "0.6310574", "0.63087463", "0.62942266", "0.62847227", "0.6277503", "0.62732124", "0.6270203", "0.6267886", "0.62606835", "0.625516", "0.6251546", "0.62488157", "0.6248404", "0.623043", "0.6222033", "0.6216145", "0.62127227", "0.6207551", "0.6202577", "0.61968046", "0.61846507", "0.61825514", "0.61778915", "0.6175618", "0.61702186", "0.61690557", "0.61670053", "0.6165327", "0.6164277", "0.61618626", "0.6156625", "0.61438864", "0.61407256", "0.6136975", "0.61336625", "0.6130122", "0.6128264", "0.612804", "0.6124386", "0.6123635", "0.61227566", "0.6109435", "0.6107038", "0.61056155", "0.609921", "0.6095323", "0.60952806", "0.6094473", "0.6089636", "0.6084416", "0.6080959", "0.60791534", "0.6076752", "0.6073798", "0.6073095", "0.6071584", "0.6071559", "0.6069495", "0.6064919", "0.60648954", "0.6060514", "0.6058827" ]
0.6705419
4
JavaScript function to match (and return) the video Id of any valid Youtube Url, given as input string.
function ytVidId(url) { var p = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/; return (url.match(p)) ? RegExp.$1 : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function youtubeid(url) {\n var myregexp = /(?:youtube\\.com\\/(?:[^\\/]+\\/.+\\/|(?:v|e(?:mbed)?)\\/|.*[?&]v=)|youtu\\.be\\/)([^\"&?\\/ ]{11})/i;\n var videoID = url.match(myregexp);\n // var ytid = url.match(\"[\\\\?&]v=([^&#]*)\");\n videoID = videoID[1];\n return videoID;\n }", "function vcExtractYoutubeId( url ) {\n\tif ( 'undefined' === typeof(url) ) {\n\t\treturn false;\n\t}\n\n\tvar id = url.match( /(?:https?:\\/{2})?(?:w{3}\\.)?youtu(?:be)?\\.(?:com|be)(?:\\/watch\\?v=|\\/)([^\\s&]+)/ );\n\n\tif ( null !== id ) {\n\t\treturn id[ 1 ];\n\t}\n\n\treturn false;\n}", "function get_video_id(string) {\n let regex = /(?:\\?v=|&v=|youtu\\.be\\/)(.*?)(?:\\?|&|$)/\n let matches = string.match(regex)\n\n if (matches) {\n return matches[1]\n } else {\n return string\n }\n}", "function get_youtube_id_from_url(url) {\n var patt = new RegExp('v=([0-9a-zA-Z_-])+');\n var id = patt.exec(url);\n if (id != null && id.length > 0) {\n return id[0].substr(2);\n }\n return '';\n}", "function ytVidId(url) {\n\t\t\t var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11,})(?:\\S+)?$/gmi;\n\t\t\t return (url.match(p)) ? RegExp.$1 : false;\n\t\t\t}", "function ytVidId(url) {\n\t\t\t var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11,})(?:\\S+)?$/gmi;\n\t\t\t return (url.match(p)) ? RegExp.$1 : false;\n\t\t\t}", "function getYoutubeId(url) {\n url = url || '';\n\n var matches = url.match(/.*?youtu.be\\/([^\\/]+)\\/*/i);\n if (matches) {\n return matches[1];\n }\n\n matches = url.match(/.*?youtube\\.com\\/watch\\?v=([^\\/]+)\\/*.*/i);\n if (matches) {\n return matches[1];\n }\n\n return '';\n }", "function getYouTubeVideoId () {\r\n\tvar regex = /(\\?|%3F|&|%26)v=[^\\?&#]*/gi;\r\n\tvar matches = document.URL.match(regex);\r\n\tif(matches == null) {\r\n\t\treturn null;\r\n\t}\r\n\tvar removeRegex = /(\\?|%3F|&|%26)v=/gi;\r\n\tvar vidId = matches[0].replace(removeRegex, \"\");\r\n\tif(vidId == null) {\r\n\t\treturn;\r\n\t}\r\n\treturn vidId;\r\n}", "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n}", "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n}", "function getYoutubeIdByUrl (url)\r\n {\r\n var regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\r\n var match = url.match(regExp);\r\n\r\n if (match && match[2].length == 11) {\r\n return match[2];\r\n } else {\r\n return false;\r\n }\r\n\r\n }", "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n}", "function YouTubeGetID(url){\n var ID = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n ID = url[2].split(/[^0-9a-z_\\-]/i);\n ID = ID[0];\n }\n else {\n ID = url;\n }\n return ID;\n }", "function parseId(url) {\n // http://stackoverflow.com/a/14701040\n var match = /^.*(youtube.com\\/|v\\/|e\\/|u\\/\\w+\\/|embed\\/|v=)([^#\\&\\?]*).*/.exec(url);\n\n if (match instanceof Array && match[2] !== undefined) {\n return match[2];\n } else {\n return false;\n }\n}", "function getVideoID(url){\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#&?]*).*/;\n var match = url.match(regExp);\n return (match&&match[7].length==11)? match[7] : false;\n }", "function getYoutubeId(){\r\n const linkRegEx = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/;\r\n const result = musicSearchBox_input.value.match(linkRegEx);\r\n if (result){\r\n return result[7];\r\n } else{\r\n return null;\r\n }\r\n}", "function extractYouTubeId(trailerURL)\n\t\t{\n\t\t\tif( typeof trailerURL === \"undefined\" )\n\t\t\t\treturn trailerURL;\n\n\t\t\tvar youtubeid;\n\t\t\tif( trailerURL.indexOf(\"youtube\") != -1 && trailerURL.indexOf(\"v=\") != -1 )\n\t\t\t{\n\t\t\t\tyoutubeid = trailerURL.substr(trailerURL.indexOf(\"v=\")+2);\n\n\t\t\t\tvar found = youtubeid.indexOf(\"&\");\n\t\t\t\tif( found > -1 )\n\t\t\t\t{\n\t\t\t\t\tyoutubeid = youtubeid.substr(0, found);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar bases = [\"youtu.be/\", \"/embed/\"]\n\t\t\t\tvar found = trailerURL.indexOf(\"youtu.be/\");\n\t\t\t\tif( found >= 0 )\n\t\t\t\t\tyoutubeid = trailerURL.substr(found+9);\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfound = trailerURL.indexOf(\"/embed/\");\n\t\t\t\t\tif( found >= 0 )\n\t\t\t\t\t\tyoutubeid = trailerURL.substr(found+7);\n\t\t\t\t}\n\n\t\t\t\tif( !!youtubeid )\n\t\t\t\t{\n\t\t\t\t\tfound = youtubeid.indexOf(\"?\");\n\t\t\t\t\tif( found > 0 )\n\t\t\t\t\t\tyoutubeid = youtubeid.substr(0, found);\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tfound = youtubeid.indexOf(\"&\");\n\t\t\t\t\t\tif( found > 0 )\n\t\t\t\t\t\t\tyoutubeid = youtubeid.substr(0, found);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t return youtubeid;\n\t\t}", "function getVideoIDfromLink(url)\n{\n\t\tvar regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n\t\tvar match = url.match(regExp);\n\t\tif (match&&match[2].length==11){\n\t\t\t\treturn match[2];\n\t\t}else{\n\t\t\t\t//error\n\t\t}\n}", "getSongIdFromUrl(url) {\n let videoId,\n ampersandPosition;\n\n if (!url) return false;\n\n if (url.indexOf('?v=') !== -1) videoId = url.split('?v=')[1];\n else if (url.indexOf('youtu.be/') !== -1) videoId = url.split('youtu.be/')[1];\n\n if (!videoId) return url;\n\n ampersandPosition = videoId.indexOf('&');\n\n if (ampersandPosition !== -1) videoId = videoId.substring(0, ampersandPosition);\n\n return videoId;\n }", "function getVideoId(url){\n if(url.indexOf('?') != -1 ) {\n var query = decodeURI(url).split('?')[1];\n var params = query.split('&');\n for(var i=0,l = params.length;i<l;i++)\n if(params[i].indexOf('v=') === 0)\n return params[i].replace('v=','');\n } else if (url.indexOf('youtu.be') != -1) {\n return decodeURI(url).split('youtu.be/')[1];\n }\n return null;\n}", "function getID(videoLink) {\n let id;\n if(videoLink.indexOf(\"youtube.com/watch?v=\") >= 0) {\n id = videoLink.substr(videoLink.indexOf(\"=\")+1, 11);\n } else {\n id = videoLink.substr(videoLink.indexOf(\"be/\")+3, 11);\n }\n if (id.length != 11 || !id.match(/^[a-z0-9\\-_]+$/i))\n {\n id = false;\n }\n return id;\n}", "function parse_youtube_url(url) {\n var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n return (url.match(p)) ? RegExp.$1 : false;\n }", "function parse_youtube_url(url) {\n var p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n return (url.match(p)) ? RegExp.$1 : false;\n }", "function youtube_parser(url) {\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n if (match && match[7].length == 11) {\n return match[7];\n } else {\n alert(\"Url incorrecta\");\n }\n}", "function getVideoId(url)\r\n{\r\n url = url.split(\"?v=\")[1]\r\n try { url = url.split(\"&\")[0]; }\r\n catch (error) {}\r\n return url;\r\n}", "function youtube_parser(url){\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n if (match&&match[7].length==11){\n return match[7];\n }else{\n alert(\"Url incorrecta\");\n }\n }", "checkUrlVideo(url){\n\n let urlRegex = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n let result = url.match(urlRegex)\n if (result) {\n return result;\n }\n return false;\n }", "function GetUrlIdParameterFromUrl(url) {\n \n // If url is null or empty\n if (url == undefined || url == \"\") { return \"\"; }\n \n // try for youtube\n var youtubeRegex = /(\\?v=|\\/\\d\\/|\\/embed\\/|\\/v\\/|\\.be\\/)([a-zA-Z0-9\\-\\_]+)/;\n var result = url.match(youtubeRegex);\n if (result) { return result[2]; }\n \n // try for ted\n var ted_re = /(?:http:\\/\\/)?(?:www\\.)?ted.com\\/([a-zA-Z0-9\\-\\_]+)\\/([a-zA-Z0-9\\-\\_]+)/;\n result = url.match(ted_re);\n if (result) { return result[2]; }\n \n return \"\";\n }", "function CheckYoutube() {\n var reYoutube = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/,\n match = strLink.match(reYoutube);\n\n if( match && match[2].length == 11 ) {\n videoID = match[2];\n videoType = 'youtube';\n }\n }", "function getId(url) {\n var regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n\n if (match && match[2].length == 11) {\n return match[2];\n } else {\n return 'error';\n }\n}", "function parseVideoURL(url) {\n\n function getParm(url, base) {\n var re = new RegExp(\"(\\\\?|&)\" + base + \"\\\\=([^&]*)(&|$)\");\n var matches = url.match(re);\n if (matches) {\n return(matches[2]);\n } else {\n return(\"\");\n }\n }\n\n var retVal = {};\n var matches;\n var shortYoutubeRegExp = /^.*(youtu\\.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n\n if (url.indexOf(\"youtube.com/watch\") != -1) {\n retVal.provider = \"youtube\";\n retVal.id = getParm(url, \"v\");\n retVal.embed = '//www.youtube.com/embed/'+retVal.id+'?fs=0';\n } else if (matches = url.match(shortYoutubeRegExp)) {\n // console.log(matches[2]);\n retVal.provider = \"youtube\";\n retVal.id = matches[2];\n retVal.embed = '//www.youtube.com/embed/'+retVal.id+'?fs=0';\n } else if (matches = url.match(/vimeo.com\\/(\\d+)/)) {\n retVal.provider = \"vimeo\";\n retVal.id = matches[1];\n retVal.embed = '//player.vimeo.com/video/'+retVal.id+'?fullscreen=0';\n }\n\n return(retVal);\n}", "function get_videoID()\r\n{\r\n\tv_id_patch=url.split(\"v=\");\r\n\tid_offset=v_id_patch[1].indexOf(\"&\");\r\n\tif(id_offset==-1) id_offset=v_id_patch[1].length;\r\n\tvid_id=v_id_patch[1].substring(0,id_offset);\r\n}", "function getYoutubeId(link){\r\n let id = link.split(\"=\")[1].split(\"&\")[0];\r\n return id;\r\n}", "function valid_youtube_match(url) {\n let youtube_valid_regexp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=|\\?v=)([^#\\&\\?]*).*/;\n let match = url.match(youtube_valid_regexp);\n if (match && match[2].length == 11) {\n return true;\n } else {\n return false;\n }\n\n }", "function yt_id(url){\n var ytid = '';\n url = url.replace(/(>|<)/gi,'').split(/(vi\\/|v=|\\/v\\/|youtu\\.be\\/|\\/embed\\/)/);\n if(url[2] !== undefined) {\n id = url[2].split(/[^0-9a-z_]/i);\n id = id[0];\n } else { id = url; }\n return id;\n }", "function getId(url) {\n const regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/;\n const match = url.match(regExp);\n\n return (match && match[2].length === 11)\n ? match[2]\n : null;\n }", "function getId(url) {\n const regExp = /^.*(youtu.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|&v=)([^#&?]*).*/;\n const match = url.match(regExp);\n\n return (match && match[2].length === 11)\n ? match[2]\n : null;\n }", "function youtube_parser(url) {\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n if (match && match[7].length == 11) {\n return match[7];\n } else {\n console.error('PrettyEmbed.js Error: Bad URL.');\n }\n }", "function youtubeParser(url) {\n var regExp = /^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/;\n var match = url.match(regExp);\n return (match && match[7].length == 11) ? match[7] : false;\n}", "function getVideoId(input) {\n\n var qs = new Querystring(input.split(\"?\")[1]);\n return qs.get(\"v\");\n}", "function youtubeFilter(input) {\n var regExp = /^.*(youtu\\.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n var match = input.match(regExp);\n if (match && match[2].length == 11) {\n return match[2];\n }\n else {\n return input;\n }\n}", "function getVideoId() {\n\t// Get the URL without any query parameters or anchors\n\tlet url = window.location.href;\n\tif(DEBUG) console.log(`Netflix SRT subs URL: ${url}`);\n\n\tmatch = /netflix\\.[a-z]+\\/watch\\/([0-9]+)/i.exec(url);\n\tif(match !== null && match.length > 1) {\n\t\tlet videoId = match[1];\n\t\tif(DEBUG) console.log(`Netflix SRT subs detected this page to be a video (id = ${videoId})`);\n\t\treturn videoId;\n\t}\n\telse {\n\t\treturn null;\n\t}\n}", "function youtube_parser_fed(url) {\n\t\tvar regExp = /^(https?\\:)?(\\/\\/)?(www\\.)?(youtu\\.be\\/|youtube(\\-nocookie)?\\.([A-Za-z]{2,4}|[A-Za-z]{2,3}\\.[A-Za-z]{2})\\/)(watch|embed\\/|vi?\\/)?(\\?vi?\\=)?([^#\\&\\?\\/]{11}).*$/;\n\t\tvar match = url.match(regExp);\n\t\tif (match && match[9].length == 11) {\n\t\t\treturn match[9];\n\t\t} else {}\n\t}", "function isYouTubeVideo (src) {\n return src.match(youtubeRegex)\n }", "function validYouTube(url) {\n\tif(url == 'undefined' || url == null) return false; //if empty return false\n\t//else match\n\tvar p = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/;\n\treturn (url.match(p)) ? RegExp.$1 : false;\n}", "function getYouTubeCode(url) {\n return url.split('?v=')[1];\n }", "function isVideo(url) {\n\treturn url.indexOf(\"https://www.youtube.com/watch?v=\") !== -1;\n}", "function get_yt_embed(url) {\n var videoid = url.match(/(?:https?:\\/{2})?(?:w{3}\\.)?youtu(?:be)?\\.(?:com|be)(?:\\/watch\\?v=|\\/)([^\\s&]+)/);\n if(videoid != null) {\n return videoid[1];\n // return \"<iframe id=\\\"ytplayer\\\" type=\\\"text/html\\\" width=\\\"640\\\" height=\\\"390\\\" src=\\\"http://www.youtube.com/embed/\" + videoid[1] + \"?autoplay=1\\\" frameborder=\\\"0\\\"/>\";\n } else {\n return \"\";\n }\n}", "getVideoSearchString(videoID) {\n if (RoKA.Application.currentMediaService() === Service.YouTube) {\n return encodeURI(`(url:3D${videoID} OR url:${videoID}) (site:youtube.com OR site:youtu.be)`);\n }\n else if (RoKA.Application.currentMediaService() === Service.KissAnime) {\n return (encodeURI(videoID));\n }\n else if (RoKA.Application.currentMediaService() === Service.KissManga) {\n return (encodeURI(videoID));\n }\n }", "function scanURL(url) {\n\tvar regex = /(?:https?:\\/\\/)?(?:[a-z].*)?youtube\\.com\\/.*list=([a-zA-Z0-9-_]*)(?:.*index=(\\d*))?/g;\n\t// regexec[1] is playlist id, regexec[2] is index (optional)\n\t/* todo:\n\t\t- sometimes index parameter is set in front of \"list\"\n\t\t- regex needs to be updated for this issue\n\t\t- possible new problem: how to fetch groups correctly?\n\t*/\n\n\t// -> https://www.youtube.com/watch?v=z-y5DAB5WQc&index=1&list=PLfU2RMxoOiSAZLR48HMRmgKZP5A2LhFDY\n\n\treturn regex.exec(url);\n}", "function getYouTubePlaylistID(link) {\n var id;\n var indexEndOfID = link.indexOf(\"&\", link.search(\"list=\") + 5);\n if (indexEndOfID != -1) {\n id = link.slice(((link.search(\"list=\")) + 5), indexEndOfID);\n } else {\n id = link.slice((link.search(\"list=\")) + 5);\n }\n //console.log(id);\n return id;\n}", "getVideoID(){\n return location.href.split('/').pop().replace('#','');\n }", "function getVideoId()\n {\n if (window.location.search.length > 0)\n {\n var s = window.location.search.substring(1);\n var requestObjects = s.split('&');\n for (var i = 0, len = requestObjects.length; i < len; i += 1)\n {\n var obj = requestObjects[i].split('=');\n if (obj[0] === \"v\")\n {\n console.log(\"Video ID is \" + obj[1]);\n return obj[1];\n }\n }\n }\n\n return null;\n }", "function getVideoIdParameterByName(name, url) {\r\n\tif (!url)\r\n\t\turl = $('#videoLink').val();\r\n\tname = name.replace(/[\\[\\]]/g, \"\\\\$&\");\r\n\tvar regex = new RegExp(\"[?&]\" + name + \"(=([^&#]*)|&|#|$)\"), results = regex.exec(url);\r\n\tif (!results)\r\n\t\treturn null;\r\n\tif (!results[2])\r\n\t\treturn '';\r\n\treturn decodeURIComponent(results[2].replace(/\\+/g, \" \"));\r\n}", "function updateLink(url){\n let match = url.match(regExp); // adds link to the playlist only if its valid youtube link\n if (match && match[2].length == 11) {\n videoId = match[2];\n videoLinkArray.push(videoId);\n updateUI();\n } else {\n //display error\n }\n\n if(videoLinkArray.length > 0){\n let tag = document.createElement('script');\n tag.src = \"https://www.youtube.com/iframe_api\";\n let firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n }\n}", "function isYoutubeUrl(url) {\n var exp = /^(?:https?:\\/\\/)?(?:www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11,})(?:\\S+)?$/gim;\n return url.match(exp) ? RegExp.$1 : false;\n }", "static getYoutubeThumb(videoId, size) {\n if (videoId.startsWith(\"http\")) {\n let regExp = /^.*(youtu\\.be\\/|v\\/|u\\/\\w\\/|embed\\/|watch\\?v=|\\&v=)([^#\\&\\?]*).*/;\n let match = videoId.match(regExp);\n if (match && match[2].length === 11) {\n videoId = match[2];\n }\n else {\n console.log(\"======== ERROR: can not get videoId from: \", videoId);\n }\n }\n if (videoId === null) {\n return \"http://img.youtube.com/vi/noimagefound/default.jpg\";\n }\n size = (size == undefined) ? 'big' : size;\n if (size === 'small') {\n return \"http://img.youtube.com/vi/\" + videoId + \"/default.jpg\";\n }\n return 'http://img.youtube.com/vi/' + videoId + '/0.jpg';\n }", "function getYoutubeDuration(input_url,success,error) {\n var url = input_url;\n if(url.includes(\"?\")){\n url = input_url.split(\"?\")[0];\n }\n var duration = 0;\n var videoid = url;\n\n var matches = \n videoid.match(/^https?:\\/\\/www\\.youtube\\.com\\/.*[?&]v=([^&]+)/i) || \n videoid.match(/^https?:\\/\\/www\\.youtube\\.com\\/embed\\/([^&]+)/i) ||\n videoid.match(/^https?:\\/\\/youtu\\.be\\/([^?]+)/i) || \n videoid.match(/(https?:\\/\\/www\\.youtube-nocookie\\.com\\/embed\\/([^&]+))/ig);\n\n var duration = 0;\n\n if (matches) { \n var videoid = matches[1];\n if(videoid){\n $.ajax({\n url: \"https://www.googleapis.com/youtube/v3/videos\",\n data: {\n key: \"AIzaSyDZGzgya2UTYJNGDd3S3r5BofyetrHB_eM\",\n part: \"contentDetails\",\n id: videoid\n },\n success: success,\n error: error\n });\n }\n }\n}", "function linkToYTVid(youtube)\n{\n\tconsole.log(\"LINK TO YOUTUBE VIDEO\");\n\t\n\treturn \"http://www.youtube.com/watch?v=\" + youtube;\n\t\n}", "function getYoutubeUrl(video_input) {\n var youtubeUrl = video_input.val();\n if (youtubeUrl) {\n var youtubeId = youtubeUrl.split(\"=\")[1],\n imageUrl = 'http://img.youtube.com/vi/' + youtubeId + '/0.jpg;';\n $('.youtube_preview').attr('src', imageUrl);\n }\n }", "function getIdFromUrl(url) { return url.match(/[-\\w]{25,}/); }", "function isYoutubeURL(url) {\n var p = /^(?:https?:\\/\\/)?(?:m\\.|www\\.)?(?:youtu\\.be\\/|youtube\\.com\\/(?:embed\\/|v\\/|watch\\?v=|watch\\?.+&v=))((\\w|-){11})(?:\\S+)?$/\n if (url.match(p)) {\n return url.match(p)[1]\n }\n return false\n}", "youtubeVideo(id) {\n return ytRequest('/videos', id)\n .then(res => {\n let item = null;\n if (res.items.length) {\n item = Item.fromApi(ITEM_TYPE.YOUTUBE, {\n title: res.items[0].snippet.title,\n url: `http://youtube.com/watch?v=${id}`,\n srcId: id,\n });\n }\n return item;\n });\n }", "function onYouTubePlayerReady(playerId) {\n\n //gets the videoID... It substracts videoPlayerID length, which is the global_id_length\n var video_id = playerId.split(\"%3A\")[0];\n //console.log(video_id)\n //playerId.substring(0, playerId.length-global_id_length);\n var video_Player_id = playerId.split(\"%3A\")[1]\n //console.log(video_Player_id)\n var pre_corrected_Id = playerId;\n for (var i; i<playerId.length; i++) {\n if (playerId[i]=='_') pre_corrected_Id += '1'+i;\n else if (playerId[i]=='-') pre_corrected_Id += '2'+i;\n }\n var corrected_Id = pre_corrected_Id.replace(/\\W/g, '');\n //console.log(corrected_Id)\n //console.log(vD.i(video_Player_id))\n vD.i(video_Player_id).player.addEventListener(\"onError\", \"onPlayerError\"+corrected_Id);\n vD.i(video_Player_id).player.addEventListener(\"onStateChange\", \"onStateChange\"+corrected_Id);\n\n\n window[\"onPlayerError\" + corrected_Id] = function(state) {\n vD.i(video_Player_id).on_player_Error(state);\n };\n\n window[\"onStateChange\" + corrected_Id] = function(state) {\n vD.i(video_Player_id).on_player_State_Change(state);\n };\n\n vD.i(video_Player_id).player.loadVideoById(video_id, vD.i(video_Player_id).data.begin);\n vD.i(video_Player_id).player.setPlaybackQuality(\"default\");\n vD.i(video_Player_id).seekBegin(true);\n\n}", "function isYouTubePlaylist(link) {\n var indexStart = link.indexOf(\".\");\n var website = link.substring(indexStart + 1, indexStart + 8);\n //console.log(website == \"youtube\");\n return website == \"youtube\";\n}", "function getIdFromUrl(url) {\n return url.match(/[-\\w]{25,}/);\n }", "ValidateUrl() {\n let isYtRegex = /www\\.youtube\\.com\\/watch\\?v=/;\n\n if(isYtRegex.test(this.ActiveTabData.url)) {\n console.log(\"Url validation - success\");\n return true;\n }\n\n console.log(\"Url validation - fail\");\n return false;\n }", "function getIdFromUrl(url) {\n return url.match(/[-\\w]{25,}/);\n}", "function checkLink(videoLink) {\n if(videoLink.indexOf(\"youtube.com/watch?v=\") >= 0 || videoLink.indexOf(\"youtu.be/\") >= 0) {\n return true;\n } else {\n return false;\n }\n}", "function getUTUBEID(url) {\n\tid_start = url.indexOf('/v') + 3;\n\turl = url.slice(id_start);\n\tid_end = url.indexOf('&');\n\tif (id_end == -1) {\n\t\t// no query paramters\n\t} else {\n\t\turl = url.slice(0, id_end);\n\t}\n\treturn url;\n}", "function getUTUBEID(url) {\n\tid_start = url.indexOf('/v') + 3;\n\turl = url.slice(id_start);\n\tid_end = url.indexOf('&');\n\tif (id_end == -1) {\n\t\t// no query paramters\n\t} else {\n\t\turl = url.slice(0, id_end);\n\t}\n\treturn url;\n}", "function youtubeVideo(tag) {\n var queryURL =\n \"https://www.googleapis.com/youtube/v3/search?type=video&maxResults=25&q=\" +\n tag +\n \"&key=AIzaSyCgpNgJWhqC8iroTq5_Sbp53ulbGGbafzU\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function (response) {\n //this generates a random number between 1 and 25 - we don't need the for loop since we're only doing it once\n var random = Math.floor(Math.random() * 24) + 1;\n\n //this creates a variable from the video id of the youtube response, we could probably just put this directly into the queryURL code below.\n var videoID = response.items[random].id.videoId;\n\n $(\n \"#youtube\"\n ).html(`<iframe id=\"ytplayer\" type=\"text/html\" width=\"100%\" height=\"360\"\n src=\"https://www.youtube.com/embed/${videoID}?autoplay=1&origin=http://example.com\"\n frameborder=\"0\"></iframe>`);\n }); //closing bracket for youtube ajax call\n}", "function youtubeLinkReplace() {\r\n (function ($) {\r\n var videoClass = '.youtubeVideoLink';\r\n var iframeTag = '<iframe width=\"100%\" height=\"100%\" src=\"{PROTOCOL}//www.youtube.com/embed/{VIDEO_ID}\" frameborder=\"0\" allowfullscreen></iframe>';\r\n\r\n videoContainers = $(videoClass);\r\n videoContainers.each(function () {\r\n var videoContainer = $(this);\r\n\r\n var parentDiv = $(videoContainer).parent();\r\n var parentWidth = parentDiv.width();\r\n if (parentWidth > 640) {\r\n parentWidth = 640;\r\n }\r\n var videoWidth = parentWidth;\r\n var videoHeight = (parentWidth * (9 / 16)) + 24;\r\n $(videoContainer).css(\"width\", videoWidth + \"px\");\r\n $(videoContainer).css(\"height\", videoHeight + \"px\");\r\n\r\n if (parentWidth == 640) {\r\n $(videoContainer).css(\"margin\", \"0 auto\");\r\n\r\n var nextSibling = $(videoContainer).next();\r\n if (nextSibling.attr(\"class\") == \"youtubeVideoCaption\") {\r\n var captionPaddingLeft = nextSibling.css(\"paddingLeft\");\r\n captionPaddingLeft = captionPaddingLeft.replace('px', '');\r\n captionPaddingLeft = parseInt(captionPaddingLeft);\r\n var captionPaddingRight = nextSibling.css(\"paddingRight\");\r\n captionPaddingRight = captionPaddingRight.replace('px', '');\r\n captionPaddingRight = parseInt(captionPaddingRight);\r\n var captionPadding = captionPaddingLeft + captionPaddingRight;\r\n var captionWidth = videoWidth - captionPadding;\r\n nextSibling.css(\"width\", captionWidth + \"px\");\r\n nextSibling.css(\"margin\", \"0 auto\");\r\n }\r\n }\r\n\r\n var videoUrl = $(videoContainer).text();\r\n if (videoUrl.length) {\r\n var id = getIdFromUrl(videoUrl);\r\n videoTag = iframeTag.replace(/\\{VIDEO_ID\\}/g, id).replace(/\\{PROTOCOL\\}/g, window.location.protocol);\r\n videoContainer.html(videoTag);\r\n }\r\n });\r\n })(jQuery);\r\n}", "function getSpotifyPlaylistID(link) {\n var id;\n var indexEndOfID = link.indexOf(\"?\", link.search(\"playlist\") + 9);\n if (indexEndOfID != -1) {\n id = link.slice(link.search(\"playlist\") + 9, indexEndOfID);\n } else {\n id = link.slice(link.search(\"playlist\") + 9);\n }\n //console.log(id);\n return id;\n}", "function checkUrl(tab) {\n\t//check if it's a Youtube video\n\tif (tab.url.match(/youtube/) && tab.url.match(/watch/)) {\n\t\t//gets video id\n\t\tvar video_id=removeVideoPrefix('http://www.youtube.com/watch?v=', tab.url);\n\t\tvar video_id_2 = removeVideoSuffix(video_id);\n\t\t//gets video details from YouTube API\n\t\tjQuery.getJSON('https://gdata.youtube.com/feeds/api/videos/'+video_id_2+'?v=2&alt=jsonc',function(data,status,xhr){\n\t\t\tif(typeof (data.data.restrictions) == \"undefined\"){\n\t\t\t\t//placeholder, will not match any strings\n\t\t\t\tcountry = \"North Korea\";\n\t\t\t\t}\n\t\t\telse{\n\t\t\t\t//Checks video restrictions against user's country\n\t\t\t\tfor (i = 0; i < data.data.restrictions[0].countries.length; i+=3) {\n\t\t\t\t\tvar countryprefix = data.data.restrictions[0].countries[i];\n\t\t\t\t\tvar countrysuffix = countryprefix.concat(data.data.restrictions[0].countries[i+1]);\n\t\t\t\t\tif (countrysuffix == user_country) {\n\t\t\t\t\t\tblocked_country = countrysuffix;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//If it's blocked\n\t\t\t\tif (blocked_country != \"null\") {\n\t\t\t\t\tfor (j = 0; j < data.data.restrictions[0].countries.length-3; j+=3) {\n\t\t\t\t\t\tvar country3 = data.data.restrictions[0].countries[j];\n\t\t\t\t\t\tvar country4 = country3.concat(data.data.restrictions[0].countries[j+1]);\n\t\t\t\t\t\t//Creates array of all blocked countries\n\t\t\t\t\t\tcountry_list.push(country4);\n\t\t\t\t\t}\t\n\t\t\t\t\t//Builds list of country suggestions\n\t\t\t\t\tif (country_list.length > 2) {\n\t\t\t\t\t\tvar i = 0;\n\t\t\t\t\t\tvar i = 0;\n\t\t\t\t\t\twhile (i < 4) {\n\t\t\t\t\t\t\tfor (j = 0; j < all_countries.countries.length; j++) {\n\t\t\t\t\t\t\t\tif (jQuery.inArray(all_countries.countries[j].code, country_list) == -1) {\n\t\t\t\t\t\t\t\t\tcountry_sugg[i] = all_countries.countries[j].name;\n\t\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//grammar\n\t\t\t\t\t\tunblocked_country = \"Some countries where it isn't blocked are \"+country_sugg[0]+', '+country_sugg[1]+', '+country_sugg[2]+', and '+country_sugg[3]+'.';\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tunblocked_country = \"The video is unblocked everywhere else.\";\n\t\t\t\t\t}\n\t\t\t\tvar notification = webkitNotifications.createNotification(\n\t\t\t\t'icon.png', \n\t\t\t\t'Unblocked Where',\n\t\t\t\t'This video is blocked in your location. '+unblocked_country\n\t\t\t\t); \n\t\t\t\tnotification.show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function getID(string) {\n\n /* Variables */\n var id = 0;\n var page = 1;\n var res = string.split(\"/\");\n\n /* Retrieve studio ID. */\n res.forEach(function(element) {\n if(/^\\d+$/.test(element)) {\n id = element;\n }\n });\n\n /* Check for invalid URL. */\n if (id == 0) {\n linkError();\n return;\n }\n return id;\n}", "function IsYouTube_fed(url) {\n\t\tvar YouTubeLink_regEx = /^(https?\\:)?(\\/\\/)?(www\\.)?(youtu\\.be\\/|youtube(\\-nocookie)?\\.([A-Za-z]{2,4}|[A-Za-z]{2,3}\\.[A-Za-z]{2})\\/)(watch|embed\\/|vi?\\/)?(\\?vi?\\=)?([^#\\&\\?\\/]{11}).*$/;\n\t\tif(YouTubeLink_regEx.test(url.toString()))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t\t}\n\t}", "function getYoutubeVideoInfo(id){\r\n var youtubeApiUrl = \"https://gdata.youtube.com/feeds/api/videos/\"; \r\n var v2Parameter = \"?v=2\";\r\n var jsonParameter = \"&alt=json\";\r\n var response = CQ.utils.HTTP.get(youtubeApiUrl + id + v2Parameter + jsonParameter);\r\n return response;\r\n}", "function parseVid(url) {\n // use positive lookahead, starting to match after \"?v=\"\n const regex = /(?<=\\?v\\=)([A-Za-z0-9_-]+)/;\n const found = url.match(regex);\n\n if (found !== null) {\n return found[0];\n } else {\n return null;\n }\n}", "function get_youtube_thumbnail(url, quality) {\n if (url) {\n var video_id, thumbnail, result;\n\n result = url.match(\n /(?:youtu\\.be\\/|youtube\\.com(?:\\/embed\\/|\\/v\\/|\\/watch\\?v=|\\/user\\/\\S+|\\/ytscreeningroom\\?v=))([\\w\\-]{10,12})\\b/\n );\n\n video_id = result[1];\n\n if (video_id) {\n let quality_key = YTQuality[quality];\n\n if (quality_key == undefined || quality_key == \"\") {\n quality_key = \"sddefault\";\n }\n\n var thumbnail =\n \"https://img.youtube.com/vi/\" + video_id + \"/\" + quality_key + \".jpg\";\n return thumbnail;\n }\n }\n return false;\n}", "function getYTVideo() {\n\n\n var ytAPI = \"AIzaSyBglfIEbCdN-ZisKCm9RqzCqPKWDIKViAY\"\n var input = song + \" \" + artist\n\n\n console.log(input);\n var ytURL = \"https://www.googleapis.com/youtube/v3/search?part=snippet&maxResults=3&q=\" + input + \"&type=video&key=\" + ytAPI\n\n\n $.ajax({\n url: ytURL,\n method: \"GET\",\n\n }).then(function (data) {\n // console.log(data);\n console.log(data.items[0].id.videoId)\n\n var videoId = data.items[0].id.videoId;\n var videoId2 = data.items[1].id.videoId;\n var videoId3 = data.items[2].id.videoId;\n\n // Add videos to screen\n $('.top-video').text(\"Other Top Videos for \" + artist)\n $(\".player\").html('<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/' + videoId + '\"frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen></iframe>')\n $(\".topVideo1\").html('<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/' + videoId2 + '\"frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen></iframe>')\n $(\".topVideo2\").html('<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/' + videoId3 + '\"frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen></iframe>')\n });\n\n}", "function getVideoId(response) {\n\tvar srchItems = response.result.items;\n\t$.each(srchItems, function(index, item){\n\t\tsVideoIds[index] = item.id.videoId;\n\t});\n}", "function convertYoutubeDuration(str) {\n\tvar fromHours, fromMinutes, fromSeconds;\n\n\tif (str.match(/(\\d+)H/)) {\n\t\tfromHours = Number(str.match(/(\\d+)H/)[1]) * 60 * 60 ;\n\t} else {\n\t\tfromHours = 0;\n\t}\n\n\tif (str.match(/(\\d+)M/)) {\n\t\tfromMinutes = Number(str.match(/(\\d+)M/)[1]) * 60;\n\t} else {\n\t\tfromMinutes = 0;\n\t}\n\n\tif (str.match(/(\\d+)S/)) {\n\t\tfromSeconds = Number(str.match(/(\\d+)S/)[1]);\n\t} else {\n\t\tfromSeconds = 0;\n\t}\n\n\tvar total = fromHours + fromMinutes + fromSeconds;\n\treturn total * 1000;\n}", "function media_embed(url) {\n if(!url) return null\n\n if(url.indexOf('youtu.be/') > -1) {\n return 'https://www.youtube.com/embed/' + url.split('youtu.be/')[1].split('?')[0]\n } else if (url.indexOf('youtube.com/watch') > -1) {\n return 'https://www.youtube.com/embed/' + url.split('v=')[1].split('&')[0]\n }else if (url.indexOf('vimeo.com/') > -1) {\n return 'https://player.vimeo.com/video/' + url.split('vimeo.com/')[1].split('?')[0]\n }else if (url.indexOf('wistia.com/medias/') > -1) {\n return 'https://fast.wistia.net/embed/iframe/' + url.split('wistia.com/medias/')[1].split('?')[0]\n }else {\n return null\n }\n}", "function extractId(stringId) {\n // MovieId-7\n let start = stringId.indexOf('-');\n let movieId = stringId.slice(start + 1, stringId.length);\n\n return movieId;\n }", "cleanVideoSource(input, type) {\n // ensure we are NOT local and do a sanity check\n if (type != \"local\" && typeof input === \"string\") {\n // strip off the ? modifier for youtube/vimeo so we can build ourselves\n var tmp = input.split(\"?\");\n var v = \"\";\n input = tmp[0];\n if (tmp.length == 2) {\n let tmp2 = tmp[1].split(\"&\"),\n args = tmp2[0].split(\"=\"),\n qry = Array.isArray(tmp2.shift())\n ? tmp2.shift().join(\"\")\n : tmp2.shift();\n if (args[0] == \"v\") {\n let q = qry !== undefined && qry !== \"\" ? \"?\" + qry : \"\";\n v = args[1] + q;\n }\n }\n // link to the vimeo video instead of the embed player address\n if (\n input.indexOf(\"player.vimeo.com\") == -1 &&\n input.indexOf(\"vimeo.com\") != -1\n ) {\n // normalize what the API will return since it is API based\n // and needs cleaned up for front-end\n if (input.indexOf(\"/videos/\") != -1) {\n input = input.replace(\"/videos/\", \"/\");\n }\n return input.replace(\"vimeo.com/\", \"player.vimeo.com/video/\");\n }\n // copy and paste from the URL\n else if (input.indexOf(\"youtube.com/watch\") != -1) {\n return input.replace(\"youtube.com/watch\", \"youtube.com/embed/\") + v;\n }\n // copy and paste from the URL\n else if (input.indexOf(\"youtube-no-cookie.com/\") != -1) {\n return input.replace(\"youtube-no-cookie.com/\", \"youtube.com/\") + v;\n }\n // weird share-ly style version\n else if (input.indexOf(\"youtu.be\") != -1) {\n return input.replace(\"youtu.be/\", \"www.youtube.com/embed/\") + v;\n }\n // embed link\n else if (input.indexOf(\"player.twitch.tv/\") != -1) {\n if (tmp[1]) {\n return `${input}?${tmp[1].replace(\"&parent=www.example.com\", \"\")}`;\n } else {\n let tmp2 = input.replace(\"&parent=www.example.com\", \"\").split(\"/\");\n return `https://player.twitch.tv/?channel=${tmp2.pop()}`;\n }\n }\n // URL / share link\n else if (input.indexOf(\"twitch.tv/videos/\") != -1) {\n let tmp2 = input.replace(\"&parent=www.example.com\", \"\").split(\"/\");\n return `https://player.twitch.tv/?video=${tmp2.pop()}`;\n }\n // twitch channel URL / share link\n else if (input.indexOf(\"twitch.tv/\") != -1) {\n let tmp2 = input.replace(\"&parent=www.example.com\", \"\").split(\"/\");\n return `https://player.twitch.tv/?channel=${tmp2.pop()}`;\n }\n // copy and paste from the URL for sketchfab\n else if (\n input.indexOf(\"sketchfab.com\") != -1 &&\n input.indexOf(\"/embed\") == -1\n ) {\n return input + \"/embed\";\n }\n }\n return input;\n }", "function normalizeVideoSrc (src) {\n // youtube\n const youtubeMatch = src.match(youtubeRegex)\n if (youtubeMatch) {\n return `https://www.youtube.com/embed/${youtubeMatch[2]}?enablejsapi=1`\n }\n\n // vimeo\n const vimeoMatch = src.match(vimeoRegex)\n if (vimeoMatch) {\n return `https://player.vimeo.com/video/${vimeoMatch[1]}`\n }\n\n // default to reflecting src back\n return src\n }", "function check_if_youtube_video_removed(youtube_video_id, on_valid, on_removed)\n{\n var request = http.request(\n {\n host: 'www.youtube.com',\n path: '/watch?v=' + youtube_video_id\n },\n function (response)\n {\n var is_removed = false;\n var page = '';\n \n function has_default_youtube_title(str)\n {\n return str.indexOf('<title>YouTube</title>') !== -1;\n }\n\n response.on('data', (chunk) => page += chunk);\n \n response.on('end', () => has_default_youtube_title(page) ? on_removed() : on_valid());\n }\n );\n\n request.on('error', error => console.error('Youtube request failed:\\n' + error));\n\n request.end();\n}", "function getYouTubeEmbed(yid) {\n var tmpl = \"<iframe width='560' height='315' src='https://www.youtube.com/embed/{{yid}}?ecver=1' frameborder='0' allowfullscreen></iframe>\";\n return template(tmpl, {yid: yid})\n}", "function onYouTubePlayerReady(playerId) {\n\n //gets the videoID... It substracts videoPlayerID length, which is the global_id_length\n var video_id = playerId.substring(0, playerId.length-global_id_length);\n var video_Player_id = playerId.replace(video_id, \"\");\n\n var pre_corrected_Id = playerId;\n for (var i; i<playerId.length; i++) {\n if (playerId[i]=='_') pre_corrected_Id += '1'+i;\n else if (playerId[i]=='-') pre_corrected_Id += '2'+i;\n }\n var corrected_Id = pre_corrected_Id.replace(/\\W/g, '');\n\n try {\n vData.instances[video_Player_id].player.addEventListener(\"onError\", \"onPlayerError\"+corrected_Id);\n vData.instances[video_Player_id].player.addEventListener(\"onStateChange\", \"onStateChange\"+corrected_Id);\n } catch (e) {\n console.error(e.stack)\n }\n\n window[\"onPlayerError\" + corrected_Id] = function(state) {\n vData.instances[video_Player_id].on_player_Error(state);\n };\n\n window[\"onStateChange\" + corrected_Id] = function(state) {\n vData.instances[video_Player_id].on_player_State_Change(state);\n };\n\n vData.instances[video_Player_id].player.loadVideoById(video_id, vData.instances[video_Player_id].data.begin);\n vData.instances[video_Player_id].player.setPlaybackQuality(\"default\");\n vData.instances[video_Player_id].seekstart();\n\n}", "function changeVideoId(newUrl) {\n setVideoId(newUrl)\n }", "function VideoObj(url) {\n // If url is null or empty\n if (url == undefined || url == \"\") { return null; }\n \n var obj = {}; // Init OBJ\n \n // try for youtube\n var youtubeRegex = /(\\?v=|\\/\\d\\/|\\/embed\\/|\\/v\\/|\\.be\\/)([a-zA-Z0-9\\-\\_]+)/;\n var result = url.match(youtubeRegex);\n if (result) { \n obj.type = \"youtube\";\n obj.url = url;\n obj.url_id = result[2]; \n obj.element = getYtPlayer(result[2]);\n return obj; \n }\n\n // validate ted urls\n var ted_rex = /ted\\.com\\/talks\\/(.+)/;\n var validate_ted_url = url.match(ted_rex);\n if (!validate_ted_url) {\n return null;\n }\n\n // try for ted\n var ted_re = /(?:http:\\/\\/)?(?:www\\.)?ted.com\\/([a-zA-Z0-9\\-\\_]+)\\/([a-zA-Z0-9\\-\\_]+)/;\n result = url.match(ted_re);\n if (result) { \n obj.type = \"ted\";\n obj.url = url;\n obj.url_id = result[2]; \n obj.element = getTdPlayer(result[2]);\n return obj; \n }\n return null;\n }", "function requestUserUploadsPlaylistId() {\n var request = gapi.client.youtube.videos.list({\n part: 'snippet',\n chart: 'mostPopular',\n // myRating: 'like',\n maxResults: 20,\n });\n request.execute(function(response) {\n var foo = response.items;\n for(var i=0; i<foo.length; i++) {\n var str = response.items[i].id;\n $('#video-container').append(\"<iframe width='640' height='320' src='https://www.youtube.com/embed/\"+str+\"'>\");\n }\n })\n}", "function getIdFromUrl(urlData,id){\n\t// let arr = ulr.split(\"-\");\n\tlet arr2 = ulr.indexOf(id);\n\tlet arr3 = ulr.substr(arr2, id.length);\n\treturn arr3;\n}", "function isYoutubeIframe (content) {\n // look for the src attribute's value\n var attr = content.match(/<\\s*iframe[^>]*\\bsrc\\s*=\\s*/)\n if (attr) {\n // mark the location and figure out what kind of quotation mark is delimiting the value\n var position = attr.index + attr[0].length\n var quote = content.charAt(position)\n var substring = content.slice(position + 1)\n\n // now that we've found the first delimiting quotation mark, match\n // everything up to the next instance of the same quotation mark\n var src = substring.match(new RegExp('^[^' + quote + ']*'))\n if (src) {\n var value = src[0]\n // for protocol-relative src, prepend a protocol for URL parsing purposes\n if (value.indexOf('//') === 0) {\n value = 'https:' + value\n }\n\n var url = URL.parse(value)\n return (url.host && url.host.match(/^(\\w+\\.)?youtube\\.com$/))\n }\n }\n return false\n}", "function filterVideoId() {\n \n var copy = false;\n var id = \"\";\n for(var i = 0; i < video.length; i++) {\n if(copy) id += video[i];\n if(video[i] == '=') copy = true;\n };\n \n return id;\n }", "_getThumbnail(link) {\n var video_id = link.split(\"v=\")[1];\n var ampersandPosition = video_id.indexOf(\"&\");\n if (ampersandPosition !== -1) {\n video_id = video_id.substring(0, ampersandPosition);\n }\n return video_id;\n }", "function getUrlVideo(urlPage){\r\n // recupere l'url directe de la video dans le contenu de la page de la video\r\n // plusieurs urls sont définies en général dans des tag \"<source\" sur la page de la video\r\n // on suppose que l'url de la video HD est celle contenant \"HD\" dans son nom et de type \"mp4\"\r\n\t\t\tfunction extractionUrlVideo(txtPage){\r\n\t\t\t\tvar tab=txtPage.match(/<source src=\".*HD([^\\\"]+)\".*type=\"video\\/mp4\"/ig);\r\n if (!tab || tab.length==0) throw [typeof tab,\"La structure a changé : pas de chaine'<source src=' dans la page :\",urlPage].join(\" \");\r\n\t\t\t\tvar urls=[]\r\n\t\t\t\tforEach (tab, function (elt){\r\n\t\t\t\t\tvar url=(elt.match(/src=\"(.*)\"/))[1];\r\n\t\t\t\t\turls.push(url);\r\n\t\t\t\t});\r\n\t\t\t\tif (urls.length==0) throw [\"Aucune url de vidéo dans la page :\",urlPage].join(\" \");\r\n\t\t\t\treturn urls.pop();\r\n\t\t\t}\r\n \r\n // lance l'extraction en récupérant le contenu de la page de la video par une requete http synchrone\r\n\t\t return extractionUrlVideo(httpSync(urlPage));\r\n\t\t}", "function done() {\n if (!video_id)\n resolve(url_typed);\n var result_url = 'https://www.youtube.com/embed/' + video_id;\n\n var looping = false;\n var playlist_set = false;\n parameters.forEach(function(parameter, index) {\n var element = document.getElementById(parameter.name);\n var value_string = Getter[parameter.type](element).toString();\n if (parameter.name === 'loop') {\n looping = value_string == 'true';\n }\n if (value_string.length > 0) {\n if (parameter.name === 'list')\n playlist_set = true;\n result_url = result_url + (index === 0 ? '?' : '&') + parameter.name +\n '=' + value_string;\n }\n });\n\n // If loop=1 has been set, add the playlist parameter to allow looping single\n // video playlists.\n if (looping && !playlist_set) {\n result_url += (parameters.length === 0 ? '?' : '&') + 'playlist=' +\n video_id;\n }\n\n resolve(result_url);\n window.close();\n}", "function webscrap(cb) {\n cb('https://www.youtube.com/embed/aDa2xBAfSFw')\n}" ]
[ "0.8164787", "0.79034585", "0.7896262", "0.78761065", "0.7724001", "0.7724001", "0.76488304", "0.7587809", "0.7558441", "0.7558441", "0.7544206", "0.75279033", "0.751879", "0.74991196", "0.7475294", "0.74361944", "0.7383298", "0.7362106", "0.7272688", "0.72520703", "0.7207101", "0.71850085", "0.71850085", "0.7154706", "0.7073674", "0.70573425", "0.7048126", "0.6933674", "0.69178444", "0.69017464", "0.68859226", "0.68318194", "0.6822224", "0.6818384", "0.6739444", "0.67303693", "0.67303693", "0.6665867", "0.66457784", "0.66248393", "0.65992844", "0.65962344", "0.65962", "0.6596038", "0.65710753", "0.65485317", "0.65452296", "0.6495446", "0.6381181", "0.63217056", "0.6288202", "0.6237777", "0.6205363", "0.61445403", "0.6143134", "0.61390173", "0.6111933", "0.6099073", "0.6045665", "0.5989106", "0.59260815", "0.5908682", "0.588346", "0.5842227", "0.5826846", "0.5799771", "0.5795329", "0.5784238", "0.5758753", "0.5740845", "0.5740845", "0.5720258", "0.5690082", "0.5665349", "0.5662079", "0.56597203", "0.5618104", "0.56109583", "0.5610928", "0.56026065", "0.5580671", "0.55749846", "0.55347705", "0.5527434", "0.55110806", "0.55009913", "0.549113", "0.54572976", "0.54452956", "0.5438181", "0.5437387", "0.540743", "0.53701234", "0.53673047", "0.5364067", "0.53600526", "0.53486305", "0.53414", "0.53394806", "0.53279" ]
0.75970274
7
var sliderRadio = document.getElementsByName("slider");
function fun1() { var rad = document.getElementsByName('slider'); if (rad[0].checked) { firstSlider(); } else if (rad[1].checked) { secondSlider(); } else { thirdSlider(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSelectedRadioButton(name){\r\n let selectedChoice;\r\n let btnSelectedRadioChoice = document.getElementsByName(name);\r\n for (let i=0; i<btnSelectedRadioChoice.length; i++){\r\n if (btnSelectedRadioChoice[i].checked){\r\n selectedChoice = btnSelectedRadioChoice[i].value;\r\n }\r\n }\r\n return selectedChoice;\r\n}", "function GetCheckedRadioButtonFromName(name) {\n //Gets all of the radiobuttons.\n var radioButtons = document.getElementsByName(\"ctl00$MainContent$\" + name);\n //Loops through all of the radiobuttons.\n for (var radioButton of radioButtons) {\n //Finds out which radioButton is checked.\n if (radioButton.checked) {\n //Return the value of the radio button that is checked.\n return radioButton;\n }\n }\n\n}", "function getRadioButtonValue(name) {\n var radios = document.getElementsByName(name);\n for (var i = 0, length = radios.length; i < length; i++) {\n if (radios[i].checked) {\n return radios[i].value;\n }\n }\n return null;\n}", "function getRadioValor(name) {\n var rads = document.getElementsByName(name);\n for (var i = 0; i < rads.length; i++) {\n if (rads[i].checked) {\n return rads[i].value;\n }\n }\n return null;\n }", "function getRadioButtonValue(name){\n\tvar result = null;\n\tvar objRadio = document.getElementsByName(name);\n\tif (objRadio) {\n\t\tfor (var i = 0; i < objRadio.length; i++) {\n\t\t\tvar optRadio = objRadio[i];\n\t\t\tif (optRadio.checked) {\n\t\t\t\tresult = optRadio.value;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function getCheckedRadioValue(name) {\r\n var elements = document.getElementsByName(name);\r\n\r\n for (var i = 0, len = elements.length; i < len; ++i) {\r\n if (elements[i].checked) {\r\n return elements[i].value;\r\n }\r\n }\r\n}", "function RadioButton(id)\r\n{\r\n\t var radios = document.getElementsByName(\"JourneyType\");\r\n\t //var found = 1;\r\n\t for (var i = 0; i < radios.length; i++) \r\n\t\t{ \r\n\t if (radios[i].checked)\r\n\t\t\t{\r\n\t //alert(radios[i].value);\r\n\t found = 0;\r\n\t return radios[i].value;\r\n\t }\r\n\t }\r\n\r\n}", "function getRadioValue() {\n var element = document.getElementsByName('sizes');\n for (i = 0; i < element.length; i++) {\n if (element[i].checked)\n return element[i].value;\n }\n}", "function getRadioVal(form, name) {\n var val;\n // get list of radio bubbles\n var radios = form.elements[name];\n \n // loop through list of selections\n for (var i=0, len=radios.length; i<len; i++) {\n // Check if the bubble is checked\n if ( radios[i].checked ) { \n // Set value and break if true\n val = radios[i].value;\n break;\n }\n }\n // Return the value\n return val;\n}", "function getSelectedRadioValue(radioName) {\r\n return document.querySelector('input[name=\"' + radioName + '\"]:checked').value;\r\n}", "function getRadioValue(formname,radioname){\n var theRadioButtons = document[formname][radioname];\n for (i=0;i<theRadioButtons.length;i++){\n if (theRadioButtons[i].checked){\n return theRadioButtons[i].value;\n }\n }\n}", "function toggleRadio(elementId, index) {\r\n var element = document.getElementsByName(elementId)[index];\r\n element.checked = true;\r\n}", "function getRadioValue(form, name) {\n\n //iegut formas elementus\n var radios = form.elements[name];\n\n //cikls kas parbauda kurs elements ir izvelets\n for (var i = 0; i < radios.length; i++) {\n //parbaude vai elements ir izvelets\n if (radios[i].checked) {\n var value = radios[i].value;\n break;\n };\n \n };\n //atgriez elementa vertibu\n return value;\n}", "function getSelectedRadio(){\n var radios = document.forms[0].priority;\n for (i=0, j=radios.length;i<j;i++){\n if (radios[i].checked){\n priorityValue =radios[i].value;\n }\n }\n }", "function toggleRadio(elementId, index) {\n var element = document.getElementsByName(elementId)[index];\n element.checked = true;\n}", "function GetCheckedRadioButton (Low,High,RB_DivID)\n{\n var RadioButtonChecked=0;\n for (sLoop=Low;sLoop<High;sLoop++)\n {\n if(document.getElementById(RB_DivID+sLoop).checked)\n {\n RadioButtonChecked = sLoop;\n }\n\n }\n return RadioButtonChecked;\n}", "function getRadio() {\n var radButton = document.forms[0].coverstyle;\n for (var i=0; i<radButton.length; i++) {\n if (radButton[i].checked) {\n styleValue = radButton[i].value;\n };\n };\n }", "function getSlider(element) {\n return element.parentNode.getElementsByClassName(\"slider\")[0];\n}", "function getSelectedRadio () {\n\t \tvar radio = document.forms[0].time;\n\t \tfor(var i=0; i<radio.length; i++){\n\t\t \tif(radio[i].checked){\n\t\t \t\ttimeValue = radio[i].value;\n\t\t \t}\n\t \t}\n \t}", "function setRadioButtonValue(name, value){\n\tvar objRadio = document.getElementsByName(name);\n\tif (objRadio) {\n\t\tfor (var i = 0; i < objRadio.length; i++) {\n\t\t\tvar optRadio = objRadio[i];\n\t\t\tif (optRadio.value == value) {\n\t\t\t\toptRadio.checked = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}", "function getValueFromRadioButton(name) {\n\treturn [...document.getElementsByName('type')]\n\t\t.reduce((rez, btn) => (btn.checked ? btn.value : rez), null)\n}", "function __getRadioValue($domName) {\r\n var domRadios = __getObjs($domName);\r\n for (var i=0; i<domRadios.length; i++) {\r\n if (domRadios[i].checked) {\r\n return domRadios[i].value;\r\n }\r\n }\r\n return null;\r\n}", "function getNamePrefix() {\n var radios = document.getElementsByName('title');\n for (var i = 0, length = radios.length; i < length; i++) {\n if (radios[i].checked) {\n return radios[i].value;\n }\n }\n}", "function get_input() {\n var ele = document.getElementsByTagName('input');\n for (i = 0; i < ele.length; i++) {\n if (ele[i].type == \"radio\") {\n if (ele[i].checked) {\n return ele[i].value;\n }\n }\n }\n}", "function GetRadioButtonListCheckedValue(ctl)\r\n{\r\n\tvar oRadio=document.getElementById(ctl);\r\n\tvar oRadioButtons=oRadio.getElementsByTagName(\"input\");\r\n\tfor(var i=0;i<oRadioButtons.length;i++)\r\n\t{\r\n\t\tif(oRadioButtons[i].type==\"radio\" && oRadioButtons[i].checked)\r\n\t\t{\r\n\t\t\treturn oRadioButtons[i].value;\r\n\t\t}\r\n\t}\t\r\n\treturn \"\";\r\n}", "function radioButtonCheck(){\n\tvar element = document.getElementsByName(\"choice\");\n\tfor(let i=0;i<element.length;i++){\n\t\tif(element[i].checked){\n\t\t\treturn element[i].id;\n\t\t}\n\t}\n}", "function getRadioButtonValue (radio)\r\n{ for (var i = 0; i < radio.length; i++)\r\n { if (radio[i].checked) { break }\r\n }\r\n return radio[i].value\r\n}", "function getValueFromRadio(radioName){\n var radios = document.getElementsByName(radioName);\n for (var i = 0; i < radios.length; i++) {\n if (radios[i].checked) {\n return radios[i].value;\n }\n }\n }", "function test() {\n\tconsole.log(document.getElementById(\"smallCap\").checked);\n}", "function getRadioVal(form, name) {\n var val;\n // get list of radio buttons with specified name\n var radios = form.elements[name];\n\n // loop through list of radio buttons\n for (var i = 0, len = radios.length; i < len; i++) {\n if (radios[i].checked) {\n // radio checked?\n val = radios[i].value; // if so, hold its value in val\n break; // and break out of for loop\n }\n }\n return val; // return value of checked radio or undefined if none checked\n}", "function getRadioCheckedValue(formNum, radio_name)\n{\n var oRadio = document.forms[formNum].elements[radio_name];\n for(var i = 0; i < oRadio.length; i++)\n {\n if(oRadio[i].checked)\n {\n return oRadio[i].value;\n }\n }\n return '';\n}", "function getRadioCheckedValue(formNum, radio_name)\n{\n var oRadio = document.forms[formNum].elements[radio_name];\n for(var i = 0; i < oRadio.length; i++)\n {\n if(oRadio[i].checked)\n {\n return oRadio[i].value;\n }\n }\n return '';\n}", "function getRadioCheckedValue(formNum, radio_name)\n{\n var oRadio = document.forms[formNum].elements[radio_name];\n for(var i = 0; i < oRadio.length; i++)\n {\n if(oRadio[i].checked)\n {\n return oRadio[i].value;\n }\n }\n return '';\n}", "function getRadioInputs()\n{\n var x = [];\n document.querySelectorAll(\"input[type='radio']\").forEach((element) => {\n if (element.name) {\n x.push(element);\n }\n });\n return x;\n}", "function ui_getSelectedRadioValue(str_name){\n\tvar _radios = ui_getObjsByName(str_name);\n\tfor (var i=0; i<_radios.length; i++){\n\t\tif (_radios[i].checked){\n\t\t\treturn _radios[i].value;\n\t\t}\n\t}\n}", "find_slider()\n\t{\n\t\tif (this.slider) return this.slider; // slider already set\n\n\t\tlet q = `[${this.attr}=\"${this.name ? this.name : ''}\"]`;\n\t\tlet sliders = document.querySelectorAll(q);\n\t\tfor (let slider of sliders)\n\t\t{\n\t\t\tif (!slider.hasAttribute(this.attr + \"-set\")) return slider;\n\t\t}\n\t\treturn null;\n\t}", "function getCheckedRadio(op) {\n var radioButtons = document.getElementsByName(op);\n for (var x = 0; x < radioButtons.length; x ++) {\n if (radioButtons[x].checked) {\n var score = radioButtons[x].dataset.score;\n }\n }\n return score;\n }", "function getSelectedRadio (){\n\t\tvar radio = document.forms[0].add\n\t\tfor (var i=0; i<radio.length; i++){\n\t\t\tif (radio[i].checked){\n\t\t\t\taddValue = radio[i].value\n\t\t\t}\n\t\t}\n\t}", "function getSelectedRadio(){\n\t\tvar radio = document.forms[0].mech;\n\t\tfor(var i=0; i<radio.lenth; i++){\n\t\t\tif(radio[i].checked){\n\t\t\t\tmechValue = radio[i].value;\n\t\t\t}\n\t\t}\n\t}", "function getSelectedRadio(){\n var radios = document.forms[0].sex;\n for (var i = 0; i<radios.length; i++) {\n if(radios[i].checked){ \n sexValue = radios[i].value;\n }\n }\n }", "function getRadioVal(form, name) {\n var val;\n // get list of radio buttons with specified name\n var radios = form.elements[name];\n\n // loop through list of radio buttons\n for (var i = 0, len = radios.length; i < len; i++) {\n if (radios[i].checked) { // radio checked?\n val = radios[i].value; // if so, hold its value in val\n break; // and break out of for loop\n }\n }\n return val; // return value of checked radio or undefined if none checked\n }", "function getValueByName (name) {\n return document.getElementsByName(name)[0].value;\n}", "function $name(name) {\n if (!document.getElementsByName(name))\n return false;\n return document.getElementsByName(name);\n}", "function getSelectedRadio(){\n\t\t\n\t\tvar radioButtons = document.forms[0].priority;\n\t\tfor(var i=0; i<radioButtons.length; i++){\n\t\t\t\n\t\t\tif(radioButtons[i].checked){\n\t\t\t\tpriorityValue = radioButtons[i].value;\n\t\t\t}\n\t\t}\n\t}", "function settySlider(variable){\n var slidervars = document.getElementById('slider');\n slidervars.value = variable;\n}", "function findSelection(field) {\n var test = document.getElementsByName(field);\n var sizes = test.length;\n for (i=0; i < sizes; i++) {\n if (test[i].checked==true) {\n return test[i].value;\n }\n }\n}", "function getSelectedRadio() {\n\t\tvar radios = document.forms[0].timeofday;\n\t\tfor (var i=0, j=radios.length; i<j; i++) {\n\t\t\tif (radios[i].checked) {\n\t\t\t\ttimeValue = radios[i].value;\n\t\t\t}\n\t\t}\n\t}", "function handleRadio(name, index) {\n\tvar select = Ext.get(name + 'Text' + (index + 1)).dom;\n\n\tif (select.style.display == 'none') {\n\t\tselect.style.display = 'block';\n\t\tselect.parentNode.style.display = 'block';\n\t\tselect.selectedIndex = 0;\n\t}\n}", "function getGeneration() {\r\n document.getElementsByName(\"generation\")\r\n .forEach(radio => {\r\n if (radio.checked) {\r\n getNuberOfPokemons(radio.value);\r\n }\r\n });\r\n}", "function getSelectedRadio() {\n\t\tvar radios = document.forms[0].status;\n\t\tfor(var i=0; i<radios.length; i++) {\n\t\t\tif(radios[i].checked) {\n\t\t\t\tcrateValue = radios[i].value;\n\t\t\t}\n\t\t}\n\t} // End Selected Radio Button Function", "function pizzaCrustValue(){\n for(var i = 0;i<document.getElementsByName('pizzacrust').length;i++){\n if(document.getElementsByName('pizzacrust')[i].checked){\n crustPrice = parseInt(document.getElementsByName('pizzacrust')[i].value);\n crustName = document.getElementsByName('pizzacrust')[i].id;\n }\n }\n }", "function unCheckRadioButtons() {\r\n const options = document.getElementsByName(\"option\");\r\n for (let i = 0; i < options.length; i++) {\r\n options[i].checked = false;\r\n }\r\n}", "function unCheckRadioButtons() {\r\n const options = document.getElementsByName(\"option\");\r\n for (let i = 0; i < options.length; i++) {\r\n options[i].checked = false;\r\n }\r\n}", "function checkRadio(inputPersonType) {\n document.getElementById(inputPersonType).click();\n}", "function getSelectedRadio(){\r\n\t\tvar radios = document.forms[0].illStyle;\r\n\t\tfor(var i=0; i<radios.length; i++){\r\n\t\t\tif(radios[i].checked){\r\n\t\t\t\tstyleValue = radios[i].value;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function getSelectedRadio(){\n\t\tvar radios =document.forms[0].deviceValue;\n\tfor(var i=0; i<radios.length; i++){\n\t\tif(radios[i].checked){\n\t\t\tdeviceValue = radios[i].value;\n\t\t}\n\t}\n}", "function SetRadioButtons(groupName, checkedItem) {\n // debugger;\n var radioButtonItems = document.getElementsByName(groupName);\n if (radioButtonItems && radioButtonItems.length > 0) {\n for (let idx = 0; idx < radioButtonItems.length; idx++) {\n var radioButtonElement = radioButtonItems[idx];\n if (radioButtonElement\n && radioButtonElement.checked !== undefined\n && radioButtonElement.value !== undefined) {\n radioButtonElement.checked = (radioButtonElement.value === checkedItem) ? true : false;\n }\n }\n }\n else {\n console.log(`Radio button group '${groupName}' does not exist`);\n }\n\n}", "function getGender() {\n var radios = document.getElementsByName('gender');\n for (var radio of radios) {\n if (radio.checked) {\n return radio.value;\n }\n }\n return alert('Gender not selcted !');\n}", "function ValidRadio(FieldName){\r\n\tvar radios = document.getElementsByName(FieldName)\r\n for (var i = 0; i < radios.length; i++) {\r\n\t\tif (radios[i].checked) {\r\n\t\t\treturn true; // checked\r\n\t\t}\r\n };\r\n return false;\r\n}", "function setRadio(num) {\n document.theForm.theRadio[0].checked = (num==0)?true:false;\n document.theForm.theRadio[1].checked = (num==1)?true:false;\n}", "function getSelectedRadios(){\n \t\t\tvar radios = document.forms(0).yesorno;\n \t\t\tfor(var i=0; i<radio.length; i++){\n \t\t\t\tif(radios[i].checked){\n \t\t\t\tyesornoValue = radios[i].value;\n \t\t\t}\n \t\t}\t\n \t}", "function whatsSelected() {\n //Find out which radio button is selected\n var radios = document.getElementsByName(\"selected\");\n for (var i = 0; i < radios.length; i++) {\n if (radios[i].checked) {\n //console.log(i + \" is selected!\")\n return i;\n }\n }\n}", "function enableDivRadioInput(divRadio)\n{\n divRadio.click();\n}", "function change_speed(){\n\tvar radioArray = document.getElementsByName(\"haha\");\n\tvar start = document.getElementById(\"start\");\n\tfor(var i = 0; i< radioArray.length; i++){\n\t\tif(radioArray[i].checked ){\n\t\t\tspeed = radioArray[i].value;\n\t\t\tif(start.disabled){\n\t\t\t\tclearInterval(timer);\n\t\t\t\tgo();\n\t\t\t}\t\t\t\n\t\t}\n\t}\n}", "function isOneChecked(radioname) {\n // All <input> tags...\n var chx = document.getElementsByName(radioname);\n \n for (var i=0; i<chx.length; i++) {\n // If you have more than one radio group, also check the name attribute\n // for the one you want as in && chx[i].name == 'choose'\n // Return true from the function on first match of a checked item\n if (chx[i].type == 'radio'&& chx[i].checked) {\n \n return true;\n\n } \n }\n // End of the loop, return false\n return false;\n}", "function volume(trackname,slidername){\n var track = document.getElementById(trackname);\n var slider = document.getElementById(slidername);\n track.volume = slider.value;\n}", "function getSelectedRadio(radio)\r\n{\t\r\n\tvar obj = radio;\r\n\tvar val = \"\";\r\n\tfor(var i=0; i < obj.length; ++i) {\r\n\t\tif(obj[i].checked == true) {\r\n\t\t\tval = obj[i].value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn(val);\r\n}", "function getSelectedRadio(radio)\r\n{\t\r\n\tvar obj = radio;\r\n\tvar val = \"\";\r\n\tfor(var i=0; i < obj.length; ++i) {\r\n\t\tif(obj[i].checked == true) {\r\n\t\t\tval = obj[i].value;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn(val);\r\n}", "function choiceNum() {\n //<input type=hidden name=whichchoice value=182>\n var links = document.getElementsByName('whichchoice');\n if (links.length>0) \n return links[0].getAttribute('value');\n}", "function unCheckRadioButtons() {\n const options = document.getElementsByName(\"option\");\n for (let i = 0; i < options.length; i++) {\n options[i].checked = false;\n }\n}", "function __setRadioValue($domName, $value) {\r\n var domRadios = __getObjs($domName);\r\n for (var i=0; i<domRadios.length; i++) {\r\n if (domRadios[i].value==$value) {\r\n domRadios[i].checked = true;\r\n return;\r\n }\r\n }\r\n}", "function EnableRadioButton(Low,High,RB_DivID)// This greys out the radio buttons until the value can be retrieved\n{\n\n for (sLoop=Low;sLoop<High;sLoop++)\n {\n document.getElementById(RB_DivID+sLoop).disabled=0;\n }\n}", "function setOperation() {\n console.log(\"setOperation - radio clicked\");\n let form = document.getElementById(\"opForm\");\n operation = form.elements[\"opForm\"].value;\n console.log(operation);\n \n}", "function getSelectedGenre(){\n for(radio of document.querySelectorAll('.genre input[type=\"radio\"]')){\n if(radio.checked) return radio.value;\n }\n \n return undefined; //probably won't happen... hopefuly\n}", "function getCheckedRadioButton(buttons){\n for(button of buttons){\n if(button.checked){\n return button.value\n }\n }\n}", "function validaRadioSeleccionado(id)\r\n{\r\n\tvar radioGroup = document.getElementsByName(id);\r\n\tvar return_id;\r\n\t\r\n\t// encontra o valor seleccionado\r\n\tfor (var x = 0; x < radioGroup.length; x ++) {\r\n\t\tif (radioGroup[x].checked) {\r\n\t\t return_id = radioGroup[x].value;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn return_id;\r\n}", "function findScale(){\n var a = document.getElementsByName('variable');\n\n // IF STAFF IS CHECKED\n if(a[2].checked){\n diviser = max/scale;\n }\n else{\n var b = document.getElementsByName(\"staff\")\n if(b[0].checked){ // FACULTY\n diviser = maxFac/scale\n } else if(b[1].checked){ // NONFACULTY\n diviser = maxNonFac/scale\n } else if(b[2].checked){ // POSTDOC\n diviser = maxPostdoc/scale\n }\n }\n adInput(diviser)\n }", "function assignRoverChoice() {\n roverChoice = $(\"input:radio[name=inlineRadioOptions]:checked\").val();\n}", "function selectRadioByName(radioGroup, name)\n{\n\tfor (var i = 0; i < radioGroup.length; i++)\n\t{\n\t\tif (radioGroup[i].value == name)\n\t\t\treturn radioGroup[i].checked = true;\n\t}\n\n\treturn false;\n}", "function obtemAtributoSelecionado() {\n var radioAtributo = document.getElementsByName('atributo')\n for (var i = 0; i < radioAtributo.length; i++) {\n if (radioAtributo[i].checked) {\n return radioAtributo[i].value\n }\n }\n}", "function DisableRadioButton(Low,High,RB_DivID)// This greys out the radio buttons until the value can be retrieved\n{\n\n for (sLoop=Low;sLoop<High;sLoop++)\n {\n document.getElementById(RB_DivID+sLoop).disabled=1;\n }\n}", "function RadioButtonClick(radioButton) {\n //Sets the specific element/radiobutton to be checked.\n document.getElementById(\"MainContent_\" + radioButton).checked = true;\n EditShownAttributes();\n}", "function getSelectedRadio(){\n\t\tvar radio = document.forms[0].group;\n\t\tfor(var i=0; i<radio.length; i++){\n\t\t\tif(radio[i].checked){\n\t\t\t\tgroupValue = radio[i].value;\n\t\t\t};\n\t\t};\n\t}", "function get(name){\n\treturn document.getElementById(name);\n}", "function getValueFromRadioCheckbox(strNameRadioCheckbox)\n{\n if (empty(strNameRadioCheckbox))\n return false;\n var arrRadioCheckbox = document.getElementsByName(strNameRadioCheckbox);\n var arrValue = [];\n for (var intCount = 0; intCount < arrRadioCheckbox.length; ++intCount) {\n var radioCheckbox = arrRadioCheckbox[intCount];\n if (radioCheckbox.checked === true)\n arrValue[arrValue.length] = radioCheckbox.value;\n }\n var mixValueReturn = null;\n if (arrValue.length == 1)\n mixValueReturn = arrValue[0];\n else if (arrValue.length > 1)\n mixValueReturn = arrValue;\n return mixValueReturn;\n}", "function anyChecked(radioName)\n{\n radioArr = document.getElementsByName(radioName);\n for(var i = 0; i < radioArr.length; i++)\n if(radioArr[i].checked)\n return true;\n return false;\n}", "function Radio(){\n this.createRadio = function(name, labels, id){\n this.item = document.createElement(\"form\") //bc in HTML: <form action=\"\">...</form>\n\t\tthis.name = name\n\n\t\t// add title label\n\t\tvar ttmp = document.createElement(\"label\")\n\t\tttmp.setAttribute(\"name\", name)\t\t\t\n\t\tttmp.innerHTML = this.name + '<br>'\n\t\tthis.item.appendChild(ttmp)\n\n\t\tfor (var x in labels) //x is the index of whatever labels is\n\t\t{\n\t\t\tvar lx = labels[x]\n\t\t\t//console.log('x is ' + x + ' and labels[x] is ' + lx)\n\t\t\tvar tmp = document.createElement(\"input\")\n\t\t\ttmp.setAttribute(\"type\",\"radio\")\n\t\t\ttmp.setAttribute(\"name\", name) //choice\n\t\t\ttmp.setAttribute(\"value\", lx) //alpha, beta, oatmeal\n\n\t\t\t//adding labels\n\t\t\tvar ltmp = document.createElement(\"label\")\n\t\t\tltmp.setAttribute(\"id\", id+\"_label_\"+x) //theRadioButton_label_#\n\t\t\tltmp.innerHTML = labels[x] + '<br>'\n\n\t\t\tthis.item.appendChild(tmp)\n\t\t this.item.appendChild(ltmp)\n }\n }, \n\n this.getValue = function() {\n var radios = this.item.elements[this.name]\n for (var i = 0; i < radios.length; i++){\n var r = radios[i]\n if(r.checked) return r.value\n }\n \n return 'error'\n }\n this.addtoDocument =function(){\n document.body.appendChild(this.item);\n }\n\n}", "function radioRange(require,name, min, max){\r\n\tvar groups = document.getElementsByName(name);\r\n\tvar flag = false;\r\n\t//var hasChecked = 0;\r\n\t//min = require==true?min || 1: 0;\r\n\t//max = max || groups.length;\r\n\t//alert(min+\"min\\\\max:==>\"+max)\r\n\tif(require == false){\r\n\t\tflag = true;\r\n\t}else{\r\n\t\tfor(var i=0; i<groups.length; i++){\r\n\t\t\tif(groups[i].checked){\r\n\t\t\t\tif(groups.value != \"\"){\r\n\t\t\t\t\tflag = true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tflag = false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn flag;\r\n}", "function $N(name) {\r\n\t\treturn document.getElementsByName(name)[0];\r\n\t}", "function getElementByName( form, name ) {\n var nodes = form.getElementsByTagName( \"*\" );\n for( var i = 0; i < nodes.length; i++ ) {\n if( nodes[i].name == name ) {\n return nodes[i];\n }\n }\n return null;\n }", "function activateSlider(element) {\n //console.log(element);\n let checkboxEle = document.getElementById(element + \"ID\");\n let sliderEle = document.getElementById(element + \"SliderID\");\n let searchbox = document.getElementById(\"controlbox\");\n let panelHeaderTitle = document.getElementById(\"panel-header-title\");\n if( checkboxEle.checked == true ) {\n sliderEle.parentElement.parentElement.parentElement.style.display = \"block\";\n } else {\n sliderEle.parentElement.parentElement.parentElement.style.display = \"none\";\n }\n\n}", "function pizzaSizeValue(){\n for(var i = 0;i<document.getElementsByName('pizzasize').length;i++){\n if(document.getElementsByName('pizzasize')[i].checked){\n sizePrice = parseInt(document.getElementsByName('pizzasize')[i].value);\n sizeName = document.getElementsByName('pizzasize')[i].id;\n }\n }\n }", "function getRadioButtonValue(radio)\r\n{\r\n if (radio.length == undefined && radio.checked)\r\n return radio.value;\r\n\r\n for (var i = 0; i < radio.length; i++)\r\n {\r\n if (radio[i].checked)\r\n return radio[i].value;\r\n\r\n }\r\n return \"\";\r\n}", "function getSelectedRadio(){\n\t\tvar radios = document.forms[0].sex;\n\t\tfor(var i=0; i<radios.length; i++){\n\t\t\tif(radios[i].checked){\n\t\t\t\tsexValue = radios[i].value;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t}", "function radioClicked() {\n\tif (document.getElementById('r2').checked) {\n\t\tdocument.getElementById(\"spouse_name\").required = true;\n\t\tdocument.getElementById('spouse_details').style.visibility = 'visible';\n\t} else {\n\t\tdocument.getElementById('spouse_details').style.visibility = 'hidden';\n\t\tdocument.getElementById(\"spouse_name\").required = false;\n\t}\n}", "function unCheckRadioButtons() {\n const options = document.getElementsByName(\"option\");\n for (let i = 0; i < options.length; i++) {\n options[i].checked = false;\n }\n}", "function getRadioInfo() {\n var decision = null;\n //for(var i = 0; i < $('input[type=radio]:checked'); i += 1) {\n if($('input[type=radio]:checked')) {\n decision = $(('input[type=radio]:checked')).val();\n // }\n }\n return decision;\n }", "function getSelectedRadio() {\n\t\tradios = document.forms[0].os;\n\t\tfor(var i=0; i<radios.length; i++) {\n\t\t\tif (radios[i].checked) {\n\t\t\t\tsystemOS = radios[i].value;\n\t\t\t}\n\t\t}\n\t}", "function setRadioButtons(from) {\n\tvar lecture = \"\"\n\tif (from == \"register\") {\n\t\tif ($(\"#LEC101\").prop(\"checked\")) {\n\t\t\tlecture = \"101\"\n\t\t}\n\t\tif ($(\"#LEC102\").prop(\"checked\")) {\n\t\t\tlecture = \"102\"\n\t\t}\n\t} else {\n\t\tif ($(\"#LEC101U\").prop(\"checked\")) {\n\t\t\tlecture = \"101\"\n\t\t}\n\t\tif ($(\"#LEC102U\").prop(\"checked\")) {\n\t\t\tlecture = \"102\"\n\t\t}\n\t}\n\treturn lecture\n}", "function getRadioGroupValue(radioGroupName) {\n var radioElements = document.getElementsByName(radioGroupName);\n\n for(var i= 0; i<radioElements.length; i++ ) {\n if(radioElements[i].checked){\n return radioElements[i].value;\n }\n }\n}" ]
[ "0.7278999", "0.7228973", "0.6977543", "0.6874135", "0.6763068", "0.67446333", "0.67372566", "0.66435915", "0.6580368", "0.65603334", "0.6536415", "0.649925", "0.6492477", "0.6432202", "0.63721454", "0.6327714", "0.6324131", "0.62857306", "0.62799", "0.6268393", "0.626769", "0.6266187", "0.6238451", "0.6209255", "0.6189016", "0.6183864", "0.6139404", "0.61303943", "0.61280787", "0.6127431", "0.6119255", "0.6119255", "0.6119255", "0.6116988", "0.6104781", "0.6089552", "0.6088011", "0.60789216", "0.6075764", "0.6047119", "0.60464406", "0.60359067", "0.6035293", "0.60207325", "0.6015994", "0.6010144", "0.5996462", "0.59917414", "0.59778845", "0.59770435", "0.59587437", "0.5943056", "0.5943056", "0.5939875", "0.5936262", "0.59306544", "0.59286475", "0.5926311", "0.59257567", "0.5921072", "0.59069073", "0.58999765", "0.5880038", "0.5876338", "0.58744425", "0.58719975", "0.5859454", "0.5859454", "0.58331615", "0.5831032", "0.5828528", "0.5818535", "0.58157986", "0.5815781", "0.5801998", "0.58013344", "0.5797755", "0.5797452", "0.57885385", "0.5786952", "0.5781386", "0.5778004", "0.5769145", "0.5743881", "0.5742095", "0.5741341", "0.5727598", "0.57221025", "0.5713683", "0.5712543", "0.5710353", "0.57047784", "0.5698686", "0.5690726", "0.5688519", "0.56844115", "0.5679451", "0.5675999", "0.5672324", "0.567003" ]
0.6932882
3
Load My Books Shelf
function loadMyBookShelf(myBooks) { $.getJSON(myBooks, function(json) { var myBooks = ""; for (i in json.items) { myBooks+="<div class='col-xs-6 col-md-3'>"; myBooks+="<img class='book image image-center' id='"+ json.items[i].id +"' "; myBooks+="src='"+ json.items[i].volumeInfo.imageLinks.smallThumbnail +"'>"; myBooks+="</div>"; } $("#my-books").html(myBooks); $(".book").on('click', function() { loadBooksDetails($(this).attr('id')); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initBookshelf() {\n addBooksFromStorage();\n const bookshelf = document.querySelector(\".bookshelf\");\n library.forEach(element => {\n addBookToDOM(element);\n });\n}", "function booksInBookshelf(id) {\n// var db = ScriptDb.getMyDb();\n var dbShelf = ParseDb.getMyDb(applicationId, restApiKey, \"bookshelf\");\n var dbGen = ParseDb.getMyDb(applicationId, restApiKey, \"book_generic\");\n var books = []; \n var bookshelf = dbShelf.load(id);\n \n for (var i = 0 ; i < bookshelf.books.length ; i++) {\n books.push(dbGen.load(bookshelf.books[i]));\n }\n Logger.log(\"books queried\");\n return books;\n}", "function addBookshelf(name) {\n // var user = Session.getEffectiveUser().getEmail();\n var props = PropertiesService.getUserProperties();\n convertUser();\n var user = props.getProperty('id');\n \n if (/*db.query({type: \"bookshelf\", owner: user}).getSize() == 0*/ user == null){\n var bookshelf = {\n owner: Session.getEffectiveUser().getEmail(),\n name: name,\n converted: 1,\n books: [],\n instances: []\n };\n// var db = ScriptDb.getMyDb();\n var db = ParseDb.getMyDb(applicationId, restApiKey, \"bookshelf\");\n bookshelf = db.save(bookshelf);\n props.setProperty('id', bookshelf.getId());\n props.setProperty('converted', 1);\n return 1;\n }\n return 0;\n}", "function Shelf(name){\n\tthis.shelfName = name;\n\tthis.books = [];\n}", "function loadBooks() {\n API.getBooks()\n .then((res) => setBooks(res.data))\n .catch((err) => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res =>\n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "componentDidMount(){\n BooksAPI.getAll()\n .then(books => this.placeOnShelf(books))\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "componentDidMount() {\n\t\t//we fetch the books and put in the right shelf\n\t\tthis.fetchBooks();\n\t}", "async load () {\n const startables = await this.db.startables.toArray()\n this.store.setStartables(startables)\n\n const rows = await this.db.favourites.get('favourites')\n\n if (rows) {\n this.store.setFavourites(rows.favourites)\n }\n }", "async function loadBooks() {\n const response = await api.get('books');\n setBooks(response.data);\n }", "function loadBooks() {\n API.getBooks()\n .then(res => \n setBooks(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadAndDisplayBooks() {\n\n\tloadBooks().then(books => {\n\t\tdisplayBooks(books);\n\t});\n}", "function getBookshelves() {\n bookshelfDb.get()\n .then(results => {\n return results;\n })\n}", "function loadBooks() {\n API.getBooks()\n .then(res => {\n setBooks(res.data);\n // console.log(res);\n })\n .catch(err => console.log(err.response));\n }", "function loadBooks() {\n API.getBooks()\n .then(res => {\n console.log(res.data)\n setBooks(res.data)\n })\n .catch(err => console.log(err));\n }", "componentDidMount() {\n this.shelfBooks();\n }", "init() {\n this.knex = knex(this.dbConfig);\n this.bookshelf = bookshelf(this.knex);\n this.bookshelf.plugin('registry');\n this.initModels();\n }", "getAllShelves() {\n \t\tthis.props.model.getShelves((shelves) => {\n\t\t\tif (shelves === 'error'){\n\t\t\t\tthis.setState({\n\t\t\t\t\tstatus: 'ERROR'\n\t\t\t\t})\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// Shelf is the actual book object which we get with the book id\n\t\t\t\tvar shelf = this.props.model.getShelfByID(shelves, parseInt(this.state.id, 10));\n\t\t\t\tthis.setState({\n\t\t\t\t\tshelf: shelf,\n\t\t\t\t\tstatus: 'LOADED'\n\t\t\t\t})\n\t\t\t}\n \t\t})\n\t}", "function loadAllBooksHelper() {\r\n\t\trequest(loadAllBooks, \"books\", \"\");\r\n\t}", "getShelf(book) {\n var shelf = \"none\"\n this.props.books.forEach(function (element){\n if(element.id === book.id)\n shelf = element.shelf\n }\n )\n return shelf\n }", "async componentDidMount() {\n \ttry{\n //gets all the book from the API\n const books = await getAll();\n //distributes the books to their corresponding shelf with the function from the ContextProvider\n this.props.addBooks(books);\n } catch(error){\n \tconsole.log(error);\n }\n }", "function load()\n{\n setupParts();\n\tbgn();\n}", "function inMemoryDatabase() {\n this.shelves = {};\n this.id = 0;\n\n var db = this;\n\n db.createShelf('Fiction', function(err, fiction) {\n db.createBook(fiction.id, 'Neal Stephenson', 'REAMDE', function(){});\n });\n db.createShelf('Fantasy', function(err, fantasy) {\n db.createBook(fantasy.id, 'George R.R. Martin', 'A Game of Thrones',\n function(){});\n });\n }", "function loadBooks() {\n const data = {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n credentials: 'include',\n // Authorization: 'Kinvey ' + localStorage.getItem('authToken'),\n };\n\n fetch(url, data)\n .then(handler)\n .then(displayBooks)\n .catch((err) => {\n console.warn(err);\n });\n }", "function setShelves(first_load) { \n if (first_load == 1) {\n $('.extraRowBox').append('<div class=\"shelf\" id=\"row1\"></div>')\n }\n else {\n $('.shelf').remove();\n var maxBooks = 100;\n var maxShelves = 4;\n var booksPerShelf = maxBooks/maxShelves;\n var numberOfShelves = Math.ceil((myShelf.length/maxBooks)*maxShelves);\n if (myShelf.length % 25 == 0) {\n numberOfShelves++\n }; \n // Loop through books and create shelves.\n var current;\n var shelves = [];\n for( shelf = 0; shelf < numberOfShelves; shelf++ ) {\n shelves[shelf] = []\n for( book = 0; book < booksPerShelf; book++ ) {\n current = book + (shelf * booksPerShelf);\n shelves[shelf][book] = myShelf[current];\n }\n };\n // Remove previously shelved books from main page\n for(a=0; a<myShelf.length; a++){ \n var id = myShelf[a];\n var ind = ISBNs.indexOf(id);\n var spinePick = spines[ind]; \n $(\"#covers\").find(\"#\"+id+\"\").hide().css({\n \"margin\": \"0px\", \n \"width\": \"0px\",\n });\n }\n // Loop shelves array created above and append shelves + books to the page.\n var new_shelf, new_book; \n for( var s = 0; s < shelves.length; s++) {\n rownum = s+1;\n new_shelf = $('<div class=\"shelf\" id=\"row'+rownum+'\"></div>');\n $(\"#row\"+s+\"\").children().addClass(\"miniSpine\");\n $(\"#row\"+s+\"\").addClass(\"minify\");\n $(\"#row\"+rownum+\"\").css(\"visibility\", \"visible\");\n $('.extraRowBox').append( new_shelf ).each( function() {\n for( var b = 0; b <= shelves[s].length; b++ ) {\n if ( shelves[s][b] != undefined ) {\n var id = shelves[s][b];\n var ind = ISBNs.indexOf(id);\n var spinePick = spines[ind]; \n new_spine = $(\"<div class='spine' count='\"+ind+\"' id='\"+id+\"'><img src=\"+spinePick+\"></img></div\");\n $(\"#row\"+rownum+\"\").append( new_spine );\n $(\".spine\").draggable({\n zIndex: 13,\n cursor: 'move',\n stack: \"#mainContainer\",\n revert: function(event, ui){\n this.css({\n \"top\": \"10px !important\",\n \"bottom\": \"12px\",\n })\n return true;\n }\n });\n \n }\n }\n });\n }\n }\n setDisplayedShelf();\n dragDrop();\n swap();\n shelfClick();\n }", "function createShelf(shelf) {\n let normalizedShelf = shelf.toLowerCase();\n\n return bookshelfDb.get(normalizedShelf)\n .then(results => {\n if (results.length) {\n return results[0];\n } else {\n bookshelfDb.post({_id:normalizedShelf})\n }\n })\n}", "function BooksListShelf (props) {\n const { id, title, booksList, onBookChange } = props;\n\n return (\n <div className={`bookshelf ${id}`}>\n <h2 className=\"bookshelf-title\">{title}</h2>\n <div className=\"bookshelf-books\">\n <BooksGrid\n booksList={booksList}\n onBookChange={onBookChange}\n />\n </div>\n </div>\n )\n}", "addBook(book, shelf) {\n book.shelf = shelf;\n this.state.books.push(book);\n }", "updateShelf(id, newShelf) {\n BooksAPI.update({id: id}, newShelf.shelf).then(()=> {\n BooksAPI.getAll().then((books) => {\n this.setState({ books })\n })\n } )\n }", "function loadBible(path) {\n \t\t$$invalidate(4, loadingBible = true);\n \t\tconsole.log('Loading Bible', path);\n \t\tlet request = new XMLHttpRequest();\n \t\trequest.open('GET', path);\n \t\trequest.responseType = 'json';\n \t\trequest.send();\n\n \t\trequest.onload = function () {\n \t\t\t$$invalidate(26, books = request.response.books || []);\n\n \t\t\tfor (let i = 0; i < books.length; i++) {\n \t\t\t\t$$invalidate(26, books[i].index = i, books);\n \t\t\t\t$$invalidate(27, booksByAbbr[books[i].abbreviation] = books[i], booksByAbbr);\n \t\t\t}\n\n \t\t\t/* Redraw */\n \t\t\t$$invalidate(1, lastAddresses);\n\n \t\t\t$$invalidate(4, loadingBible = false);\n \t\t};\n \t}", "moveTo(shelf, book) {\n // we update the status of the books\n BooksAPI.update(book, shelf).then(() => {\n this.fetchBooks();\n });\n }", "constructor(){\n this.service = new BookService();\n this.load() \n }", "function getBooks(bibleParam, callback) {\n var dfd = $.Deferred();\n bible = bibleParam;\n // if default books found use it\n var booksPath = bible.defaultIndex ? (baseUrl + '/defaults/books/' + bible.defaultIndex + '.bz2') : (baseUrl + bible.dbpath + '/' + 'books.bz2');\n $.when(getBzData(booksPath)).then(d => {\n dfd.resolve(books = d);\n });\n return dfd.promise();\n }", "function load()\n{\n\tsetupParts();\n\t\n\tmain();\n}", "static displayBooks(){\n // Taking books from the local Storage\n const books = Store.getBooks();\n\n // Looping through the books and adding it to bookList\n books.forEach((book) => UI.addBookToList(book));\n }", "function loadSharkDB() {\n\n let db = new SharkDB([])\n db['branches'] = BRANCHES\n db['evns'] = EVNS\n db['machines'] = MACHINES\n db['codes'] = PRODUCT_CODES\n\n try {\n var data = fs.readFileSync(`${SHARK_DB}`, 'UTF-8');\n return data ? JSON.parse(data.toString()) : db\n } catch (err) {\n console.error(err)\n return db\n }\n}", "initModels() {\n this.models = {};\n this.collections = {};\n MODELS.forEach(modulePath => {\n const { modelClass, collectionClass } = require(modulePath)(this.bookshelf);\n if (modelClass) {\n this.models[modelClass.prototype.modelName] = modelClass;\n }\n\n if (collectionClass) {\n this.collections[collectionClass.prototype.collectionName] = collectionClass;\n }\n });\n }", "renderShelf() {\n this.shelfItems.push(new ui.ShelfItem(\"coinstack\"));\n this.createElements();\n }", "componentDidMount() {\n this.loadBooks();\n }", "componentDidMount() {\n this.loadBooks();\n }", "componentDidMount() {\n this.loadBooks();\n }", "@action\n load(){\n this.book = this.service.getBook(this.id);\n this.totalPages = this.book.getTotalPages();\n this.pageNumber = 1;\n this.chapters = this.book.chapters;\n this.currentChapter = this.chapters[0];\n this.currentPage = this.currentChapter.getPageByNumber(1);\n this.isHardWordFocused = false; \n }", "componentDidMount() {\n this.updateShelfBooks();\n }", "load() {\n\t\t\tlet storage = Storage.local.get('commander') || null;\n\t\t\tif (storage) {\n\t\t\t\tupdate(bs => {\n\t\t\t\t\tbs = storage;\n\t\t\t\t\treturn bs;\n\t\t\t\t});\n\t\t\t}\n\t\t}", "function loadData() {\n var strBookPath = io.appendPath(conf.bookPath, this.strBookName);\n var strBookStructurePath = io.appendPath(strBookPath, conf.bookStructureFileName);\n io.getXmlContent(strBookStructurePath, setBookStructureXml);\n io.getFilesInDirectory(strBookPath, setPageFileNames);\n}", "function loadKittens() {}", "function loadStories() {\n require(\"./welcome\")\n req.keys().forEach(req)\n}", "componentDidMount() {\n this.loadBooks();\n }", "static displayBooks (){\n \n const books = Store.getBooks();\n\n //loop through the array to add the books into the local storage\n books.forEach((book) => UI.addBookToList(book));\n }", "function loadStories() {\n require('../app/components/avatars/avatars.stories');\n require('../app/components/loading.stories');\n}", "function loadPlugins(bookshelf) {\n if (! bookshelfPluginLoaded.has(bookshelf)) {\n bookshelfPluginLoaded.add(bookshelf);\n\n let signalHub = new Backbone.Model();\n signalHubs.set(bookshelf, signalHub);\n\n bookshelf.plugin('registry');\n bookshelf.plugin('pagination');\n bookshelf.plugin(Signals(signalHub));\n }\n}", "componentDidMount(){\n this.loadBooks()\n }", "function Shelf(shelfName){\n this.shelfName = shelfName;\n this.bookList = []; // Array to store books\n // Make book and add to array\n // id # for possible search, easier assignment than string\n this.addBook = function(author, title, id) {\n var book = new Book(author, title, id);\n this.bookList.push(book);\n console.log('we have added ' + author + ' - ' + title + ' - ' + id);\n };\n // Remove book\n this.removeBook = function(author) {\n for (var i = 0; i < this.bookList.length; i++) {\n if (this.bookList[i].author === author) {\n console.log('we have removed the book by ' + this.bookList[i].author);\n this.bookList.splice(i, 1);\n return;\n }\n }\n console.log('we do not have this book on the shelf');\n };\n}", "function loadBooks() {\n books = JSON.parse(localStorage.getItem(\"totalBooks\"));\n if (!books) {\n //alert('No books are present for now! Please add some')\n } else {\n books.forEach((book) => {\n renderBook(book);\n });\n }\n\n finishedBooks = JSON.parse(localStorage.getItem(\"finishedBooks\"));\n if (!finishedBooks) {\n //alert('No books are present for now! Please add some')\n } else {\n finishedBooks.forEach((book) => {\n renderFinishedBooks(book);\n });\n }\n}", "display(bookshelf){\n this.bookshelf = bookshelf;\n\n switch(this.bookshelf){\n case 'store':\n this.books = this.searchResults;\n break;\n case 'bookmarks':\n this.books = this.bookmarks;\n break;\n case 'favorites':\n this.books = this.favorites;\n break;\n }\n }", "function getBookList() {\n\t\ttoggleControls(\"on\");\n\t\tif(localStorage.length === 0) {\n\t\t\talert(\"Your bookshelf was empty so example books were added\");\n\t\t\tautofillData();\n\t\t}\n\t\tvar list = $.find('#listOfBooks');\n\t\t$('#bookList').attr('id', 'items');\n\t\tfor (var i = 0, j = localStorage.length; i < j; i++) {\n\t\t\tvar makeLi = $('<li class=\"bookItem\"></li>').appendTo(list);\n\t\t\tvar linksLi = $('<li class=\"bookLink\"></li>').appendTo(list);\n\t\t\tvar key = localStorage.key(i);\n\t\t\tvar value = localStorage.getItem(key);\n\t\t\tvar object = JSON.parse(value);\n\t\t\tfor(var x in object){\n\t\t\t\t$('<p>' + object[x][0] + object[x][1] + '</p>').appendTo(makeLi);\n\t\t\t}\n\t\t\tmakeBookLinks(localStorage.key(i), linksLi);\n\t\t}\n\t\t$('#listOfBooks').listview('refresh');\t\n\t}", "function initializeStock() {\n\tbank = json.readFileSync(\"./wallet/bank.json\");\n}", "changeBookShelf(book, shelf) {\n BooksAPI.update(book, shelf).then(() => {\n book.shelf = shelf;\n // this.getCurrentBooks();\n this.setState(state => ({\n // currentBooks: state.currentBooks.filter(currentBook => currentBook.id !== book.id).concat([book])\n currentBooks: [...state.currentBooks.filter(currentBook => currentBook.id !== book.id), book]\n }))\n });\n }", "function loadStories() {\n req.keys().forEach(filename => req(filename));\n}", "componentDidMount() {\n const shelf = this.props.book.shelf;\n if (shelf && shelf.length > 0) {\n this.setState({ selectedShelf : shelf });\n }\n }", "function preload() {\n restaurantFile = loadJSON(\"Restaurant.json\");\n}", "static displayBooksToList() {\n const books = Store.getBooks();\n\n books.forEach((book) => {\n UI.addBookToList(book)\n });\n }", "load() {\n try {\n appState.state.cursor().update( cursor => {\n return cursor.merge( JSON.parse( window.localStorage.getItem( APPCONFIG.LS ) ) )\n })\n } catch( err ) {\n console.error( 'Error loading from local storage' )\n console.error( err )\n return\n }\n\n console.log( 'loaded' )\n }", "function fetchBook() {\n Books.get($stateParams.id)\n .then(function(book) {\n $scope.book = book;\n })\n .catch(function(error) {\n $scope.error = error;\n });\n }", "function loadStories() {\n req.keys().forEach((filename) => req(filename));\n}", "function loadBookmarks(worker, taskId) {\n if (taskId) {\n var bookmarks = datastore.readBookmarks(taskId);\n worker.port.emit(\"BookmarksLoaded\", bookmarks);\n }\n}", "function loadStories() {\n require('./welcomeStory');\n require('../stories');\n // req.keys().forEach(filename => req(filename));\n}", "static displayBook(){\n // //Imaginary local storage for trial purpose\n // const bookstore=[\n // {\n // title: 'Book One',\n // author: 'John Doe',\n // isbn: '345678'\n // },\n // {\n // title: 'Book Two',\n // author: 'Nobel Reo',\n // isbn: '348982'\n // }\n // ];\n const books = Store.getBooks();\n books.forEach((book) => UI.addBookToList(book));\n }", "static getBooks() {\n let books;\n if(localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n }", "render(){\n\n\t\tconst { books, onShelfSelection } = this.props\n\t\treturn (\n\t\t\t<div className=\"bookshelf\">\n\t\t\t\t<h2 className=\"bookshelf-title\">{this.props.listTitle}</h2>\n\t\t\t\t<div className=\"bookshelf-books\">\n\t\t\t\t\t<ol className=\"books-grid\">\n\t\t\t\t\t\t{books.map(book => (\n\t\t\t\t\t\t\t<li key={book.id}>\n\t\t\t\t\t\t\t\t<Book \n\t\t\t\t\t\t\t\t\tbook={book}\n\t\t\t\t\t\t\t\t\tonShelfSelection={onShelfSelection}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{books.length === 0 && (\n\t\t\t\t\t\t\t<li>No books found.</li>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</ol>\n\t\t\t\t</div>\n\t\t\t</div>\t\t\t\n\t\t)\n\t}", "static displayBooks () {\n\t\tconst books = Store.getBooks();\n\n\t\t//Loop through each book and call method addBookToList\n\n\t\tbooks.forEach((book) => UI.addBookToList(book));\n\t}", "function initStories() {\n initDatabase();\n retrieveAllStories();\n}", "static displayBooks() {\n const books = Store.getBooks();\n books.forEach(function (book) {\n const ui = new UI();\n ui.addBookToList(book);\n })\n\n }", "static displayBooks() {\n\t\tconst books = Store.getBooks();\n\t\tbooks.forEach(function (book) {\n\t\t\tconst ui = new UI();\n\t\t\tui.addBookToList(book);\n\t\t});\n\t}", "function loadNotebooks(){\r\n notebooks = getNotebooks();\r\n $('.sidebar-menu-list.sidebar-sub-menu').html(\"\");\r\n $.each(notebooks, function(id, notebook) {\r\n $('.sidebar-menu-list.sidebar-sub-menu').prepend(`<li><a href=\"#\" data-id=\"${id}\">${notebook.title}</a></li>`);\r\n });\r\n }", "function listBooks() {\n return initDB('thr').then(function(db) {\n var books = [];\n return visitRecords(db, 'books', function(cursor) {\n var book = cursor.value;\n books.push({ID: book.ID, title: book.title});\n }).then(function() {\n return books;\n });\n });\n }", "initialize (config) {\r\n return new Promise((resolve, reject) => {\r\n knexInstance = knex({\r\n client: 'mysql2',\r\n connection: {\r\n host: config.database.host,\r\n user: config.database.username,\r\n password: config.database.password,\r\n database: config.database.db,\r\n charset: 'utf8'\r\n }\r\n })\r\n bookshelfInstance = bookshelf(knexInstance)\r\n initializeModels(this).then((a) => {\r\n resolve({\r\n knexInstance,\r\n bookshelfInstance\r\n })\r\n }).catch((error) => {\r\n console.log(error)\r\n })\r\n })\r\n }", "updateShelf(book, shelf) {\n if(shelf.value === 'none') {\n const bookIndex = this.state.books.findIndex(bk => bk.id === book.id);\n this.state.books.splice(bookIndex, 1);\n } else {\n book.shelf = shelf;\n }\n this.setState(this.state);\n }", "loadBooksFromServer () {\n\t\t fetch('http://localhost:8080/books')\n .then(result => result.json())\n .then(result => this.setState({ books: result })\n )\n\t\t }", "function loadBooks(res) {\n console.log(res.data)\n setBooks(res.data.data)\n }", "componentDidMount() {\n this.getBooks()\n }", "function load() {\n listModel.clear();\n var jsonObject = JSON.parse(listModel.source);\n var apps = jsonObject.apps\n for (var app in apps) {\n // Provide the file scheme to the icon for reliable loading of the icon. Without\n // it the path can be interpreted as a relative path to a resource file bundled\n // with the binary\n listModel.append({icon: \"file://\" + apps[app].icon, appId: apps[app].id});\n }\n}", "function loadBook() {\n\treturn new Promise(resolve => {\n\t\tnew Excel.Workbook().xlsx.readFile(path)\n\t\t\t.then(workbook => {\n\t\t\t\taddRows(workbook);\n\t\t\t\tresolve();\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tif (err.message.includes(\"File not found:\")) {\n\t\t\t\t\tconsole.log(`[${dateNow()}] No ${SUBREDDIT}.xlsx file found. A new one will be created on ${path}`);\n\t\t\t\t\tresolve();\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t}\n\t\t\t});\n\t});\n}", "function loadStories() {\n require(\"./welcomeStory\");\n req.keys().forEach(file => req(file));\n}", "function removeBookshelf() {\n convertUser();\n var user = PropertiesService.getUserProperties();\n var id = user.getProperty('id')\n if (id != null) {\n// var db = ScriptDb.getMyDb();\n var db = ParseDb.getMyDb(applicationId, restApiKey, \"bookshelf\");\n var bookshelf = db.load(id);\n // db.removeByIdBatch(bookshelf.books, false);\n for (var i = 0 ; i < bookshelf.books.length ; i++) {\n removeBook(bookshelf.books[i]); \n }\n unsubscribe();\n db.remove(bookshelf);\n user.deleteAllProperties();\n return 1;\n }\n \n return 0;\n}", "function loadBook(id){\n\t\n\tvar found = books.where({oid:id});\n\tif(found.length==1){\n\t\tmybook = found[0];\n\t\t$.name.value = mybook.get('name');\n\t\t$.isbn.value = mybook.get('isbn');\n\t\t$.author.value = mybook.get('author');\n\t\t$.genre.value = mybook.get('genre');\t\n\t}\n\telse{\n\t\talert('Error getting book detail');\n\t}\n\t\n}", "function firstLoadInitialize(){\r\n addBookToLibrary(\"1984\", \"George Orwell\", 328, true);\r\n addBookToLibrary(\"Fahrenheit 451\", \"Ray Bradbury\", 256, true);\r\n addBookToLibrary(\"Dune\", \"Frank Herbert\", 412, true);\r\n addBookToLibrary(\"War and Peace\", \"Leo Tolstoy\", 1225, false);\r\n}", "componentDidMount() {\n this.getBooks();\n }", "function goBacktoBookshelf(token) {\n var action = 'goBacktoBookshelf';\n var jsonStr = '{}';\n\n cmread.callBackClient(action, jsonStr, token);\n}", "componentDidMount() {\n this.getBooks();\n }", "function load_trainers(){ //Load the trainer list to the trainer object\n\tvar trainers = require(\"./prof_walnut/trainers.json\");\n}", "updateShelfBooks() {\n const updater = async () => {\n try {\n const shelfBooks = await getAll();\n\n this.setState(() => ({shelfBooks}));\n } catch (error) {\n console.log(error);\n }\n };\n\n updater();\n }", "function load() {\r\n\r\n\r\n fetch('zooland.json')\r\n .then(function(result){\r\n return result.json();\r\n })\r\n .then(function(data){\r\n createZooland(data);\r\n });\r\n}", "function preload() {\n clickablesManager = new ClickableManager('data/clickableLayout.csv');\n adventureManager = new AdventureManager('data/adventureStates.csv', 'data/interactionTable.csv', 'data/clickableLayout.csv');\n}", "static displayBooks(){\n let books = Store.getBooks();\n const ui = new UI();\n\n // Add all books to list\n books.forEach(function(book){\n ui.addBookToLib(book);\n });\n }", "function getBookshelfElement () {\n return document.querySelector(\".bookshelf\");\n}", "static getBooks() {\n let books;\n if (localStorage.getItem('books') === null) {\n books = [];\n } else {\n books = JSON.parse(localStorage.getItem('books'));\n }\n return books;\n }" ]
[ "0.7119343", "0.6735765", "0.65465796", "0.6500821", "0.6448958", "0.6407286", "0.63830596", "0.63589615", "0.63476473", "0.63476473", "0.6267452", "0.6245941", "0.6199073", "0.6169264", "0.6160215", "0.60977536", "0.60872465", "0.6084712", "0.6007998", "0.59898984", "0.5942128", "0.5928139", "0.58320904", "0.581066", "0.5797785", "0.57785785", "0.5776476", "0.5768991", "0.5710642", "0.57078624", "0.5625457", "0.5615626", "0.5612527", "0.55811626", "0.5576874", "0.5556624", "0.55528504", "0.5547769", "0.55452394", "0.5517776", "0.5509997", "0.54984206", "0.54984206", "0.54984206", "0.5492571", "0.5492144", "0.5489836", "0.5487035", "0.5486429", "0.5467532", "0.54535985", "0.5451371", "0.5449346", "0.544154", "0.5440047", "0.5423318", "0.54179025", "0.5416404", "0.53961", "0.5388666", "0.5377855", "0.53679436", "0.536332", "0.53517807", "0.5347094", "0.53407305", "0.5329996", "0.5324012", "0.53228194", "0.5316844", "0.53021", "0.5301917", "0.52935994", "0.5292995", "0.52893466", "0.52840966", "0.52826333", "0.527438", "0.5270808", "0.5258004", "0.5257359", "0.5253596", "0.5253184", "0.5249218", "0.5244115", "0.5235709", "0.5233507", "0.5233432", "0.5229873", "0.5229709", "0.52257276", "0.52212954", "0.5219713", "0.5198571", "0.5197176", "0.518919", "0.51856726", "0.5184291", "0.518407", "0.51760393" ]
0.66200936
2
Initialize stores for the db
initializeStores() { this.stores.forEach((store) => { let [ver, storeDef] = store; console.log('Registering version %s of stores:\n%s', ver, Object.keys(storeDef).join(', ')); this.db.version(ver).stores(storeDef); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup_stores()\n{\n\t// Init Files \n\tmodels['Files'] = new IDBStore({\n\t storeName: 'Files',\n\t keyPath: 'id',\n\t dbVersion: site.config.indexeddb.Files.version,\n\t storePrefix: '',\n\t autoIncrement: true,\n\t\tindexes: site.config.indexeddb.Files.indexes,\t \n\t onStoreReady: get_files_data\n\t});\n}", "async initialize () {\n super.initialize()\n\n this.stores = _.mapValues(this.app.config.stores, (store, storeName) => {\n return {\n knex: knex(Object.assign({ }, store)),\n models: _.pickBy(this.app.models, { store: storeName }),\n migrate: store.migrate\n }\n })\n return this.migrate()\n }", "init() {\n if (this.__isInitialized) {\n return; // silently do nothing.\n }\n\n this.__isInitialized = true;\n let data = this.cursor.fetch();\n\n data.forEach(doc => {\n this.store[doc._id] = doc;\n });\n }", "init() {\n console.log('initializing store...')\n }", "initialiseStore(state) {\n\t\t\t// Check if the ID exists\n\t\t\tif(localStorage.getItem('store')) {\n\t\t\t\t// Replace the state object with the stored item\n\t\t\t\tthis.replaceState(\n\t\t\t\t\tObject.assign(state, JSON.parse(localStorage.getItem('store')))\n\t\t\t\t);\n\t\t\t}\n\t\t}", "init(options = {}) {\n const { store } = options;\n if (!store) throw new Error('Require store');\n this._store = store;\n }", "function init() {\n setStore();\n handleHistory();\n }", "initialiseStore (state) {\n if (localStorage.getItem('store')) {\n this.replaceState(\n Object.assign(state, JSON.parse(localStorage.getItem('store')))\n )\n }\n }", "function initData(callback) {\n initLanguage(); // set the system language if not set\n DB.loadAll(function() {\n if(getUsers() === null){\n setUsers(DB.users);\n console.log('storing users in localStorage');\n }\n if(getBeverages() === null){\n setBeverages(DB.beverages);\n console.log('Storing beverages in localstorage');\n }\n if(getOrders() === null){\n setOrders([]);\n }\n if(callback) callback();\n });\n}", "function initializeStore() {\r\n // Create the sqlite store\r\n store = new WindowsAzure.MobileServiceSqliteStore('store.db');\r\n\r\n // Define the table schema\r\n return store.defineTable({\r\n name: tableName,\r\n columnDefinitions: {\r\n id: 'string',\r\n score: 'number',\r\n }\r\n }).then(function() {\r\n // Initialize the sync context\r\n syncContext = client.getSyncContext();\r\n\r\n // Define an overly simplified push handler that discards\r\n // local changes whenever there is an error or conflict.\r\n // Note that a real world push handler will have to take action according\r\n // to the nature of conflict.\r\n syncContext.pushHandler = {\r\n onConflict: function (pushError) {\r\n return pushError.cancelAndDiscard();\r\n },\r\n onError: function (pushError) {\r\n return pushError.cancelAndDiscard();\r\n }\r\n };\r\n\r\n return syncContext.initialize(store);\r\n })\r\n .then(function() {\r\n scoreTable = client.getSyncTable(tableName);\r\n });\r\n }", "initialize(initProps) {\n this.bind(_appStore, this.onStoreUpdate.bind(this));\n }", "function initDatabases(callback) {\n db = {};\n\n db.games = new Datastore({\n filename: './databases/games.db',\n autoload: true\n });\n\n db.achievements = new Datastore({\n filename: './databases/achievements.db',\n autoload: true\n });\n\n db.activities = new Datastore({\n filename: './databases/activities.db',\n autoload: true\n });\n\n db.network = new Datastore({\n filename: './databases/network.db',\n autoload: true\n });\n\n db.messages = new Datastore({\n filename: './databases/messages.db',\n autoload: true\n });\n\n db.favorites = new Datastore({\n filename: './databases/favorites.db',\n autoload: true\n });\n\n // Find and Merge all New Achievements\n storeGet(null, \"achievements\", function(prevAchievements) {\n if (prevAchievements) {\n achievementHelpers.storeAchievementFiles(prevAchievements);\n }\n\n });\n\n}", "function getStores() {\n return [MainStore];\n}", "constructor(rootStore) {\n this.rootStore = rootStore;\n }", "initialiseStore(state) {\n\t\t\tif(localStorage.getItem(LOCAL_STORAGE_KEY)) {\n\t\t\t\t// Replace the state object with the stored item\n\t\t\t\tthis.replaceState(\n\t\t\t\t\tObject.assign(state, JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY)))\n\t\t\t\t);\n\t\t\t}\n\t\t}", "constructor(root, store) {\n this.root = root;\n this.store = store;\n this.init();\n }", "constructor() {\n this.initStore(this.constructor.fields());\n this.registerFields();\n }", "constructor(root, store) {\n this.root = root;\n this.store = store;\n init();\n }", "_initSchema() {\n this.version(1).stores({\n pages: 'url, *terms, *titleTerms, *urlTerms, domain',\n visits: '[time+url], url',\n bookmarks: 'url, time',\n tags: '[name+url], name, url',\n })\n\n // ... add versions/migration logic here\n\n // Set up model classes\n this.pages.mapToClass(Page)\n this.visits.mapToClass(Visit)\n this.bookmarks.mapToClass(Bookmark)\n this.tags.mapToClass(Tag)\n }", "function initialize(dir, callback) {\n\tif (store)\n\t\treturn callback(\"data store is already initialized\");\n\n\tvar ready = false;\n\tchokidar.watch(dir, {\n\t\tignored : /[\\/\\\\]\\./\n\t}).on('error', function(error) {\n\t\tlog.warn(\"Error watching %s : %s\", dir, error)\n\t}).on('ready', function() {\n\t\tload(dir, function(err) {\n\t\t\tif (err)\n\t\t\t\treturn callback(err);\n\t\t\tlog.info(\"data store loaded\");\n\t\t\tready = true;\n\t\t\tcallback(null);\n\t\t});\n\t}).on('all', function(event, path) {\n\t\tif ( !ready )\n\t\t\treturn;\n\t\tlog.debug({ event: event, path: path }, \"data store changed\");\n\t\tload(dir, function(err, result) {\n\t\t\tif (err)\n\t\t\t\tlog.err(err);\n\t\t\tlog.debug(\"data store reloaded\");\n\t\t});\n\t});\n}", "constructor() {\r\n super();\r\n this._store = {};\r\n }", "initStore (state, value) {\n state.$storage = value.storage;\n state.$electron = value.electron;\n }", "function initializeDatabase() {\n //Drop collections\n mTools.dropCollection(GlobalAttributes, \"GlobalAttributes\", {}, function(cbParams) { console.log(\"[Info] Collection GlobalAttributes dropped!\"); });\n try {\n mTools.dropCollection(User, \"Users\", {}, function(cbParams) { console.log(\"[Info] Collection Users dropped!\"); });\n } catch (e) {\n console.log(\"[Notice] Users collection not dropped.\");\n }\n\n //Load GlobalStats Objects\n let newGSArr = [];\n newGSArr.push(new BlankGlobalAttribute(-1, 0, true)); //Global Clicks\n newGSArr.push(new BlankGlobalAttribute(-2, 0, true)); //Global Level\n newGSArr.push(new BlankGlobalAttribute(-3, 0, false)); //Global Ascensions\n batchLoadDBObjects(GlobalAttributes, newGSArr);\n\n checkListening();\n}", "constructor() {\n this.#database = new Datastore({\n filename: \"./server/database/rooms.db\",\n autoload: true,\n });\n }", "static setup() {\n this.dbPromise = idb.open('mws-db', 2, upgradeDb => {\n switch (upgradeDb.oldVersion) {\n case 0:\n upgradeDb.createObjectStore('restaurants', { keyPath: 'id' });\n console.log('created db v1');\n case 1:\n let reviewsStore = upgradeDb.createObjectStore('reviews', { keyPath: 'id' });\n reviewsStore.createIndex('restaurant_id', 'restaurant_id', { unique: false });\n console.log('created db v2');\n }\n });\n }", "function initialize() {\n var db = getDatabase();\n db.transaction(\n function(tx) {\n // Create the settings table if it doesn't already exist\n // If the table exists, this is skipped\n tx.executeSql('CREATE TABLE IF NOT EXISTS units(name TEXT UNIQUE, quantity TEXT, value FLOAT)');\n });\n}", "async initializePage(context) {\n await context.getters.harvester.setStore(context)\n await context.getters.rich.setStore(context)\n await context.getters.timeline.setStore(context).initialFetch()\n }", "Store() {\n\n }", "function databaseInitialize() {\n zip_content_db = loki_db.getCollection(\"zipInfo\");\n if (zip_content_db === null) {\n zip_content_db = loki_db.addCollection(\"zipInfo\", { indices: ['filePath'] });\n }\n var entryCount = zip_content_db.count();\n console.log(\"[zipInfoDb] number of entries in database : \" + entryCount);\n}", "static async init () {\n if (!collections.STATION_COLL) {\n throw new Error('Missing env variable');\n }\n Station.COLLECTION = collections.STATION_COLL;\n Station.validator = new SchemaValidator();\n const instance = Mongo.instance();\n\n await Station.validator.init({ schemas: [schema] });\n\n Station.db = instance.getDb();\n }", "constructor(){\n this.dispatcher = this;\n this.stores = [];\n }", "function init() {\n db = window.openDatabase(DB_NAME, \"\", DB_TITLE, DB_BYTES);\n createTables();\n }", "function databaseInitialize() {\n /* var entries = db.getCollection(\"items\");\n if (entries === null) {\n entries = db.addCollection(\"items\");\n } */\n // kick off any program logic or start listening to external events\n runProgramLogic();\n}", "constructor(root, store) {\n this.root = root;\n this.store = store;\n this.items = this.store.cartItems;\n this.init();\n }", "initialise() {\n cLogger('Initialising data state');\n // listen for socket events\n socketManager.setListener(this);\n // load the users\n this.getAllUsers();\n // load the entries\n this.getAllEntries();\n }", "function initStories() {\n initDatabase();\n retrieveAllStories();\n}", "function vuexInit() {\n var options = this.$options; // store injection\n\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit() {\n var options = this.$options; // store injection\n\n if (options.store) {\n this.$store = typeof options.store === 'function' ? options.store() : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n\t var options = this.$options\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = typeof options.store === 'function'\n\t ? options.store()\n\t : options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "init() {\n this.knex = knex(this.dbConfig);\n this.bookshelf = bookshelf(this.knex);\n this.bookshelf.plugin('registry');\n this.initModels();\n }", "initUserStore (callback) {\n const userStore = new DataStore({\n isArray: false,\n // file: path.join(Config.storage.dirs.bound, Config.storage.files.boundUser),\n // tmpDir: path.join(Config.storage.dirs.tmpDir)\n file: path.join(homeDir, 'boundUser.json'),\n tmpDir: path.join(Config.volume.tmp)\n })\n\n userStore.once('Update', () => {\n return callback(null, userStore)\n })\n\n userStore.once('StateEntered', state => {\n if (state === 'Failed') {\n return callback(userStore.state.err)\n }\n })\n }", "reset() {\n factoryStore.set(this, new Map());\n recordStore.set(this, new Map());\n serializerStore.set(this, new Map());\n uuidStore.set(this, new Map());\n }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n\t var options = this.$options;\n\t // store injection\n\t if (options.store) {\n\t this.$store = options.store;\n\t } else if (options.parent && options.parent.$store) {\n\t this.$store = options.parent.$store;\n\t }\n\t }", "function vuexInit () {\n const options = this.$options // 获取vue的配置选项\n // store injection \n // 根实例是否有store配置\n if (options.store) {\n // 给根实例挂载$store属性\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store\n } else if (options.parent && options.parent.$store) {\n // 给子组件挂载$store属性\n this.$store = options.parent.$store\n }\n }", "function initDbs(){\n\ttasksDb = new nedb({ filename: 'db/tasks.db', autoload: true });\n\tstoriesDb = new nedb({ filename: 'db/stories.db', autoload: true });\n}", "async function init() {\n const store = await createStore()\n\n new Vue({\n store,\n render: h => h(App),\n }).$mount(\"#app\")\n}", "static get projectStores() {\n return {\n calendarManagerStore : {},\n\n resourceStore : {\n dataName : 'resources'\n },\n\n eventStore : {\n dataName : 'events'\n },\n\n dependencyStore : {\n dataName : 'dependencies'\n },\n\n assignmentStore : {\n dataName : 'assignments'\n }\n };\n }", "function Class() {\r\n // All construction is actually done in the init method\r\n if ( !initializing && this.init ) {\r\n // create new store\r\n this.init.apply(this, arguments);\r\n }\r\n }", "function createStore() {\n store.setItem('songs', JSON.stringify([]))\n}", "static getStores(props) {\n return [HeaderStore, UserStore]\n }", "constructor() { \r\n super(); // herda todas os metodos vindos do store\r\n }", "setStore(data) {\n //4 possible configurations for initalizing a store with data\n //1. Pass in objects with Atom\n //2. Pass in intialized atoms as an array with no type (we're responsible for inferring)\n //3. 1 but via CollectionStoreOf\n //4. 2 but via CollectionStoreOf\n if (data !== undefined && data !== null && data.length > 0) {\n //assume all data is the same type if no atom class is provided (meaning we can infer it directly, since just list of atoms) \n if (this._atomClass === undefined) {\n this.data = new Set(data);\n //use the first element from the provided list as a heuristic for the type of atomic data of the data source\n this._atomClass = data[0].type;\n } else {\n if (data[0] instanceof Atom) {\n this.data = new Set(data);\n } else {\n this.data = new Set(data.map(el => new this._atomClass(el)));\n }\n } \n } else {\n this.data = new Set();\n } \n //should emit an event for any handlers to act on\n this.fire();\n }", "setStore(data) {\n //4 possible configurations for initalizing a store with data\n //1. Pass in objects with Atom\n //2. Pass in intialized atoms as an array with no type (we're responsible for inferring)\n //3. 1 but via CollectionStoreOf\n //4. 2 but via CollectionStoreOf\n if (data !== undefined && data !== null && data.length > 0) {\n //assume all data is the same type if no atom class is provided (meaning we can infer it directly, since just list of atoms) \n if (this._atomClass === undefined) {\n this.data = new Set(data);\n //use the first element from the provided list as a heuristic for the type of atomic data of the data source\n this._atomClass = data[0].type;\n } else {\n if (data[0] instanceof Atom) {\n this.data = new Set(data);\n } else {\n this.data = new Set(data.map(el => new this._atomClass(el)));\n }\n } \n } else {\n this.data = new Set();\n } \n //should emit an event for any handlers to act on\n this.fire();\n }", "function DataStore() {}", "function DataStore() {}", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "addStore(store) {\n // keep a reference to the store to easy access\n this[store.constructor.name] = store\n // fetch all the store's state and put in the superStore\n for (let key in store.state) {\n Vue.set(this.state, key, store.state[key])\n }\n //override state pointer of the store with the global one -> make the store stateless\n store.state = this.state // -> is it dangerous?\n // register the store's reducer in the global dispacher\n store._dispachToken = this.dispatcher.register(store.reduce.bind(store))\n // take all the actions from the store and pass to them the dispacher and the store as a context\n Object.assign(this.actions, store.actions(this.dispatcher, store))\n // make a ref to the superStore\n store.sStore = this\n }", "function vuexInit () {\r\n var options = this.$options;\r\n // store injection\r\n if (options.store) {\r\n this.$store = typeof options.store === 'function'\r\n ? options.store()\r\n : options.store;\r\n } else if (options.parent && options.parent.$store) {\r\n this.$store = options.parent.$store;\r\n }\r\n }", "set stores(stores) {\n if (stores !== this.crudStores) {\n this.crudStores = stores;\n }\n }", "function dbInit() {\n window.modelcache = {};\n jsonEvalRegistry.register(\"dbmodel\", jsonDBCheck, jsonConvertRow);\n window.db = new PythonProxy(\"/storage/api/\");\n connectOnce(window.db, \"proxyready\", function () {\n var d = window.db.get_uidata();\n d.addCallback(function (uidata) {\n window.uiData = uidata;\n signal(window, \"dbready\");\n });\n }\n );\n}", "set stores(stores) {\n // debugger\n if (stores !== this.crudStores) {\n this.crudStores = stores;\n }\n }", "function vuexInit() {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "async init(){\n this.state = await this.genClassif(this.state);\n this.state = await this.genPlanets(this.state);\n this.state = await this.getPlanetIDs(this.state);\n this.state = await this.genPlanetoids(this.state);\n this.state = await this.getPlanetoidIDs(this.state);\n this.save();\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }", "function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }" ]
[ "0.7627842", "0.74474126", "0.7218285", "0.7168389", "0.7030366", "0.6853619", "0.6839941", "0.6811335", "0.67141503", "0.668069", "0.66200006", "0.6615841", "0.65716076", "0.64706916", "0.64464134", "0.64430267", "0.6414425", "0.63931113", "0.6374085", "0.63714373", "0.6364521", "0.6354357", "0.6343527", "0.6333009", "0.6327083", "0.62896836", "0.6265042", "0.62349504", "0.6217156", "0.6209801", "0.6205625", "0.6188525", "0.6183672", "0.61565864", "0.61531556", "0.6144265", "0.6134522", "0.6134522", "0.6123275", "0.6113576", "0.6110377", "0.6103732", "0.6101079", "0.60957104", "0.60957104", "0.60957104", "0.6095004", "0.6093281", "0.60795414", "0.6079448", "0.6056368", "0.6055279", "0.6041571", "0.60343474", "0.6033268", "0.6033268", "0.6027967", "0.6027967", "0.60192126", "0.601167", "0.600773", "0.59971315", "0.5993285", "0.5991652", "0.59912854", "0.5987076", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007", "0.59819007" ]
0.82220805
0
================================================================== ========================SELECTIONSORT============================= ================================================================== / The following selection sort code implementation can be found here
*selectsortGenerator(array) { for (var i = 0; i < array.length; ++i){ let min = i; for (var j = i + 1; j < array.length; ++j){ if (array[min] > array[j]){ min = j; } } if ( i !== min){ [array[i], array[min]] = [array[min], array[i]]; yield array; } } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSelectionSort(){\n\t \n\tvar that = {},\n\t\tspec = {};\n\t \n\t/**\n\t * Swaps two values in an array.\n\t * @param {Array} items The array containing the items.\n\t * @param {int} firstIndex Index of first item to swap.\n\t * @param {int} secondIndex Index of second item to swap.\n\t * @return {void}\n\t */\n\tspec.swap = function(items, firstIndex, secondIndex){\n\t\tvar temp = items[firstIndex];\n\t\titems[firstIndex] = items[secondIndex];\n\t\titems[secondIndex] = temp;\n\t}\n\t \n\t/**\n\t * A selection sort implementation in JavaScript. The array\n\t * is sorted in-place.\n\t * @param {Array} items An array of items to sort.\n\t * @return {Array} The sorted array.\n\t */\n\tthat.sort = function(items){\n\n\t\tvar len = items.length,\n\t\t\tmin, i, j;\n\n\t\tfor (i=0; i < len; i++){\n\t\t\n\t\t\t// set minimum to this position\n\t\t\tmin = i;\n\t\t\t\n\t\t\t// check the rest of the array to see if anything is smaller\n\t\t\tfor (j=i+1; j < len; j++){\n\t\t\t\tif (items[j] < items[min]){\n\t\t\t\t\tmin = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// if the minimum isn't in the position, swap it\n\t\t\tif (i != min){\n\t\t\t\tspec.swap(items, i, min);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn items;\n\t}\n\t\n\tthat.getStrategyName = function(){\n\t\treturn \"SelectionSort\";\n\t}\n\t\n\treturn that;\n\t\n}", "function selectionSort(arr){\n var minIdx, temp, \n len = arr.length;\n for(var i = 0; i < len; i++){\n minIdx = i;\n for(var j = i+1; j<len; j++){\n if(arr[j]<arr[minIdx]){\n minIdx = j;\n }\n }\n temp = arr[i];\n arr[i] = arr[minIdx];\n arr[minIdx] = temp;\n }\n return arr;\n}", "function selectionSort(arr){\n var minIdx, temp, \n len = arr.length;\n for(var i = 0; i < len; i++){\n minIdx = i;\n for(var j = i+1; j<len; j++){\n if(arr[j]<arr[minIdx]){\n minIdx = j;\n }\n }\n temp = arr[i];\n arr[i] = arr[minIdx];\n arr[minIdx] = temp;\n }\n return arr;\n}", "function selectionSort(arr) {\n for (let i = 0; i < arr.length; i++) {\n let minIdx = i;\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[j] < arr[minIdx]) {\n minIdx = j;\n }\n }\n let temp = arr[i];\n arr[i] = arr[minIdx];\n arr[minIdx] = temp;\n }\n}", "function sselectionSort(arr){\n for(var i = 0; i < arr.length; i++){\n var lowest = i;\n for(var j = i+1; j < arr.length; j++){\n if(arr[j] < arr[lowest]){\n lowest = j;\n }\n }\n if(i !== lowest){\n //SWAP!\n var temp = arr[i];\n arr[i] = arr[lowest];\n arr[lowest] = temp;\n }\n }\n return arr;\n}", "function selectionSort (array) {\n var arr = array;\n\tfor (var i = 0, l = arr.length; i < l; i++) {\n for (var j = i+1; j < l; j++) {\n if (arr[i] < arr[j]) { swap(arr, i, j); }\n }\n }\n\n return arr;\n}", "function selectionSort(arr) {\n let sv;\n for (let i = 0; i < arr.length; i++) {\n sv = i;\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[j] < arr[sv]) {\n sv = j;\n }\n }\n if (sv !== i) {\n [arr[i], arr[sv]] = [arr[sv], arr[i]];\n }\n }\n return arr;\n}", "function selectionSort(arr) {\n // your code here\n for (let i=1; i<arr.length; i++) {\n let minIdx = i-1;\n for (let j=i; j<arr.length; j++) {\n if (arr[j] < arr[minIdx]) minIdx = j; \n }\n swap(arr, i-1, minIdx);\n }\n}", "function selectionSort(arr) {\n\tlet min = 0;\n\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tmin = i;\n\t\tfor (let j = i + 1; j < arr.length; j++) {\n\t\t\tif (arr[min] >= arr[j]) min = j;\n\t\t}\n\t\t// Swap ES6 syntax, also only swaps if its not sorted already\n\t\tif (i !== min) [arr[i], arr[min]] = [arr[min], arr[i]];\n\t}\n\treturn arr;\n}", "function selectionSort(arr) {\n // loop through and compare element to the following items\n // in the array and find a smaller value\n for (let i = 0; i < arr.length; i++) {\n // make a variable to store minimum value\n let min = i;\n // loop for comparison (add one to the current index for comparisons)\n for (var j = i + 1; j < arr.length; j++) {\n // if found, store the new minimum index and finish loop\n if (arr[j] < arr[min]) {\n min = j;\n }\n }\n // if the minimum is not your starting index, swap it with the new min\n if (min !== i) {\n temp = arr[i];\n arr[i] = arr[min];\n arr[min] = temp;\n }\n }\n return arr;\n}", "function SelectionSort(arr){\n for (var i = 0; i < arr.length-1; i++){\n for (var k = i + 1; k < arr.length; k++){\n if (arr[k] < arr[i]){\n swap(k, i, arr);\n }\n }\n }\n return arr;\n }", "function selectionSort(arr) {\n let n=arr.length;\n for(var i=0;i<n;i++) {\n let min_idx=i;\n for(var j=i+1;j<n;j++) {\n if(arr[j]<arr[min_idx]) {\n min_idx=j;\n }\n }\n let tmp=arr[min_idx];\n arr[min_idx]=arr[i];\n arr[i]=tmp;\n }\n return arr;\n}", "function selectionSort(arr) {\n const swap = (arr, idx1, idx2) => {\n return ([arr[idx1], arr[idx2]] = [arr[idx2], arr[idx1]])\n }\n for (let i = 0; i < arr.length; i++) {\n // Store the first selection as the minimum value that the function has seen so far\n // the position of the smallest element we've seen so far\n let lowest = i\n // want to compare i to the value at the index in front of it, so j = i + 1\n for (let j = i + 1; j < arr.length; j++) {\n // check the value of lowest to the value at j\n // is arr[1] < arr[0] ? yes\n if (arr[j] < arr[lowest]) {\n // so we set lowest (0) to be j (1)\n // index 1 becomes the new index 0\n lowest = j\n }\n }\n if (i !== lowest) {\n swap(arr, i, lowest)\n }\n }\n\n return arr\n}", "function selectionSort(arr) {\n for (let i = 0; i < arr.length; i++) {\n let min = i;\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[min] > arr[j]) {\n min = j;\n }\n }\n let temp = arr[i];\n arr[i] = arr[min];\n arr[min] = temp;\n }\n return arr;\n}", "function selectionsort() {\n\tlet len = numbers.length,min;\n\t\tfor(let i = 0; i < len; i ++){\n\t\t\tmin = i; //set min val \n\t\t\tfor(let j = i+1; j < len; j ++){ //check to see if anything is smaller than min\n\t\t\t\tif(numbers[j] < numbers[min]){\n\t\t\t\t\tmin = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//setTimeout(() => {\n\t\t\t\tif(i != min){\n\t\t\t\t\tswap(numbers, i, min);\n\t\t\t\t}\n\t\t\t//},1);\n\t\t\t//if min isnt in the position, swap\n\t}\n}", "function selectionSort(list) {\n\tlet n = list.length\n\tfor (let i = 0; i < n - 1; i++) {\n\t\tminIndex = i\n\t\tfor (let j = i + 1; j < n; j++) {\n\t\t\tif (list[j] < list[minIndex]) {\n\t\t\t\tminIndex = j\n\t\t\t}\n\t\t}\n\t\tif (minIndex !== i) {\n\t\t\tswap(list, minIndex, i)\n\t\t}\n\t}\n}", "function selectionSort(input){\n for (let i = 0; i < input.length; i++) {\n let min = input[i];\n let minIndex = i;\n for (let j = i + 1; j < input.length; j++) {\n if (input[j] < min){\n min = input[j];\n minIndex = j;\n }\n }\n input[minIndex] = input[i];\n input[i] = min;\n }\n return input;\n}", "function selection_sort(arr) {\n for (let i = 0; i < arr.length; i++) {\n let minIndex = i;\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[j] < arr[minIndex]) {\n minIndex = j;\n }\n }\n // if (arr[minIndex] < arr[i]) swap(arr, i, minIndex);\n if (i !== minIndex) swap(arr, i, minIndex);\n }\n return arr;\n}", "function selectionSort(nums){\n for(var i=0; i < nums.length; i++){\n for(var j=1; j<nums.length; j++){\n var temp = nums[i]\n if(nums[0] > nums[1]){\n temp = nums[1];\n nums[1] = nums[0];\n nums[0] = temp;\n }\n if(nums[j] > nums[i]){\n temp = nums[j];\n nums[j] = nums[i];\n nums[i] = temp;\n }\n }\n }\n return nums\n}", "function selectionSort(arr) {\n var i, j;\n for ( i = 0; i < arr.length; i++) { // loop thru whole array\n\n var minIndex = i;\n for ( j = i + 1; j < arr.length; j++) { // find index of min element \n if ( arr[minIndex] > arr[j]) {\n minIndex = j;\n }\n }\n var temp = arr[i]; // move the min to the front \n arr[i] = arr[minIndex];\n arr[minIndex] = temp;\n }\n return arr;\n}", "function selectionSort(arr) {\n for(let i = 0; i < arr.length; i++){\n let indexOfMin = i;\n for(let j = i + 1; j < arr.length; j++){\n if(arr[j] < arr[indexOfMin]){\n indexOfMin = j;\n }\n }\n if(arr[indexOfMin] < arr[i] ){\n const save = arr[i];\n arr[i] = arr[indexOfMin];\n arr[indexOfMin] = save;\n }\n }\n return arr;\n}", "function selectionSort(arr) {\n for (let i = 0; i < arr.length; i++) {\n let indexOfMin = i;\n\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[j] < arr[indexOfMin]) {\n indexOfMin = j;\n }\n }\n\n if (indexOfMin !== i) {\n [arr[indexOfMin], arr[i]] = [arr[i], arr[indexOfMin]];\n }\n }\n\n return arr;\n}", "function selectionSort (array) {\n for (let i = 0; i < array.length; i++) {\n let minIdx = i;\n for (let j = i; j < array.length; j++) {\n if (array[j] < array[minIdx]) {\n minIdx = j;\n }\n }\n const temp = array[i];\n array[i] = array[minIdx];\n array[minIdx] = temp;\n }\n return array;\n}", "function selectionSort(array) {\n const swap = (i, j) => {\n const temp = array[i]\n array[i] = array[j]\n array[j] = temp\n }\n const len = array.length\n for (let i = 0; i < len - 1; i++) {\n let min = i\n for (let j = i + 1; j < len; j++) {\n if (array[j] < array[min]) {\n min = j\n }\n }\n if (min != i) {\n swap(i, min)\n }\n }\n return array\n}", "function selectionSort(array) {\n const length = array.length;\n for (let i=0; i< length; i++) {\n var minIndex = i;\n let temp = array[i]\n for (let j=i+1; j < length; j++) {\n if (array[j] < array[minIndex]) {\n minIndex = j\n }\n }\n array[i] = array[minIndex];\n array[minIndex] = temp;\n }\n return array;\n}", "function selectionSort(arr) {\n for (let i = 0; i < arr.length; i++) {\n let indexOfMin = i;\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[j] < arr[indexOfMin]) {\n indexOfMin = j;\n }\n }\n if (i !== indexOfMin) {\n const swap = arr[i];\n arr[i] = arr[indexOfMin];\n arr[indexOfMin] = swap;\n }\n }\n return arr;\n}", "function selectionSort2(array) {\n for (let i = 0; i < array.length - 1; i++) {\n let minIndex = i;\n for (let j = i + 1; j < array.length; j++) {\n if (array[j] < array[minIndex]) {\n minIndex = j;\n }\n }\n if (i !== minIndex) {\n swap(array, i, minIndex);\n }\n }\n}", "function selectionSort(arr) {\n // get the length of the arr and iterate twice through the arr\n let length = arr.length;\n for (let i = 0; i < length; i++) {\n // assume the min is 0\n let min = i;\n for (let j = i + 1; j < length; j++) {\n // if the arr at index 0 is greater than arr[j]\n // reset min\n if (arr[min] > arr[j]) {\n min = j;\n }\n // if the first ele is not the min\n // move current ele to the left\n if (!min == i) {\n let currentEle = arr[i];\n arr[i] = arr[min];\n arr[min] = currentEle;\n }\n }\n }\n // return sorted array\n return arr;\n}", "function selectionSort(arr){\n let min, minIdx;\n\n const swap = (arr, i1, i2) => {\n [arr[i1], arr[i2]] = [arr[i2], arr[i1]];\n };\n\n for(let i = 0; i < arr.length; i++){\n minIdx = i;\n min = arr[i];\n\n for(let j = i + 1; j < arr.length; j++){\n if(arr[j] < min) {\n min = arr[j];\n minIdx = j;\n };\n }\n\n if(minIdx !== i) swap(arr, i, minIdx);\n }\n return arr;\n}", "function selectionSort(arr) {\n for (let i = 0; i<arr.length; i++) {\n let min = i\n for (let j=i+1; j<arr.length; j++) {\n if (arr[j]<arr[min]) {\n min = j\n }\n }\n if (arr[min]<arr[i]) {\n [arr[i], arr[min]] = [arr[min], arr[i]]\n }\n }\n return arr\n}", "function selectionSort(array) {\n const swap = (array, index1, index2) => {\n [array[index1], array[index2]] = [array[index2], array[index1]]\n }\n for (let i = 0; i < array.length; i++) {\n let lowest = i // set first index as lowest first\n for (let j = i+1; j < array.length; j++) { // j should be one index ahead of i\n if (array[j] < array[lowest]) { // if index ahead is lower than array[i], \n lowest = j\n }\n }\n if (i !== lowest) swap(array, i, lowest)\n }\n return array\n}", "function selectionSort() { // declare the function\n var arrayLength = array.length; // store the length of the array in a local variable\n for (var index = 0; index < arrayLength - 1; index++) { // loop through the array\n var minNum = index; // assume the 1st index [0] is the minimum number in the array and store as local variable\n for (var comparisonIndex = index + 1; comparisonIndex < arrayLength; comparisonIndex++) {\n // line 10 comment: set the comparisonIndex to the current index + 1 (since we assume the 1st index [0] is the minimum number);\n // if the comparisonIndex is less than the array's length, iterate through the following code and then increase the comparisonIndex by 1\n if(array[comparisonIndex] < array[minNum]) { // if the array's comparisonIndex is less than the minNum index\n minNum = comparisonIndex; // set the minNum equal to the comparisonIndex\n }\n }\n if(minNum != index) { // if the minNum is NOT equal to the index\n var swapIndices = array[index]; // set that index to the variable swapIndices\n array[index] = array[minNum]; // set the index to the minNum index\n array[minNum] = swapIndices; // set the minNum index to the swapIndices variable\n }\n }\n console.log('selectionSort array:', array); // print out the sorted array to the console\n var sortedArray = array; // store the newly sorted array in a new variable for clarity's sake\n return sortedArray; // upon completion of running the function, return the sortedArray for access elsewhere in the program\n}", "function selectionSort(arr) {\n for (let i = 0; i < arr.length; i++) {\n let lowest = i\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[j] < arr[lowest]) lowest = j\n }\n if (i !== lowest) swap(arr, i, lowest)\n }\n return arr\n}", "function selectionSort(arr) {\n for (let i = 0; i < arr.length; i++) {\n let indexOfMin = i;\n\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[j] < arr[indexOfMin]) {\n indexOfMin = j;\n }\n }\n // swap logic\n if (indexOfMin !== i) {\n let lesser = arr[indexOfMin];\n arr[indexOfMin] = arr[i];\n arr[i] = lesser;\n }\n }\n\n return arr;\n}", "function selectionSort(arr) {\n let min;\n for (let i = 0; i < arr.length; i++) {\n min = i;\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[j] < arr[min]) {\n min = j;\n }\n }\n if (i !== min) {\n [arr[i], arr[min]] = [arr[min], arr[i]];\n }\n }\n return arr;\n}", "function selectionSort(array){\n\tlet len = array.length;\n\tlet k = 0;\n\twhile (k<len){\n\t\tlet i = k;\n\t\tlet minIndex = i;\n\t\twhile (i<len-1){\n\t\t\tif (array[i+1]<array[i]){\n\t\t\t\tminIndex = i+1;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\tswap(k, minIndex, array);\n\t\tconsole.log(array)\n\t\tk++;\n\t}\n\treturn array;\n}", "function selectionSort(numbers) {\n var length = numbers.length;\n for (var index = 0; index < length; index++) {\n var smallestNumIndex = index;\n for (var nextNumIndex = index + 1; nextNumIndex < length; nextNumIndex++) {\n if (numbers[nextNumIndex] < numbers[smallestNumIndex]) {\n smallestNumIndex = nextNumIndex;\n }\n }\n if (smallestNumIndex != index) {\n var currentNumber = numbers[index];\n numbers[index] = numbers[smallestNumIndex];\n numbers[smallestNumIndex] = currentNumber;\n }\n }\n return numbers;\n}", "function selectionSort(array){\n for(let i = 0; i < array.length - 1; ++i){\n let min = i;\n for(let j = i + 1; j < array.length; ++j){\n if(array[j] < array[min]){\n min = j;\n }\n }\n [array[min], array[i]] = [array[i], array[min]];\n }\n return array;\n}", "function selectionSort(array) {\n for (let i = 0; i < array.length; i++) {\n let minIndex = i;\n\n for (let j = i + 1; j < array.length; j++) {\n if (array[minIndex] > array[j]) {\n minIndex = j;\n }\n }\n\n swap(array, i, minIndex);\n }\n return array;\n}", "function selectionSort(input){\n var length = input.length;\n for (var i = 0; i < length - 1; i++) {\n //Number of passes\n var min = i; //min holds the current minimum number position for each pass; i holds the Initial min number\n for (var j = i + 1; j < length; j++) { //Note that j = i + 1 as we only need to go through unsorted array\n if (input[j] < input[min]) { //Compare the numbers\n min = j; //Change the current min number position if a smaller num is found\n }\n }\n if (min != i) {\n //After each pass, if the current min num != initial min num, exchange the position.\n //Swap the numbers \n var temp = input[i];\n input[i] = input[min];\n input[min] = temp;\n }\n }\n return input;\n}", "function selectionSort(arr){\n let lowestIndex\n const swapInArray = (arr, i, j) => [arr[i], arr[j]] = [arr[j], arr[i]]\n\n for (let i = 0; i < arr.length; i++) {\n lowestIndex = i\n\n for (let j = i; j < arr.length; j++) {\n if (arr[j] < arr[lowestIndex]) {\n lowestIndex = j\n }\n }\n\n if (i != lowestIndex) {\n swapInArray(arr,i,lowestIndex)\n }\n }\n return arr\n}", "function selectionSort(arr) {\n for (let i = 0; i < arr.length - 1; i++) { // N-1 iterations will be needed at most\n let min = i; // start with i as the index for the minimum value\n for (let j = i + 1; j < arr.length; j++) { // don't need to check the i index\n if (arr[j] < arr[min]) {\n min = j; // if some arr[j] is lesser than arr[i] set the min index to j\n }\n }\n if (arr[i] != arr[min]) {\n [arr[i], arr[min]] = [arr[min], arr[i]]; // swap the minimum value with the current i\n }\n }\n return arr;\n}", "function selectionSort(arr) {\n\tfor(var swapI = 0; swapI < arr.length - 1; swapI++) {\n\t\t// Holds the lowest found value on this pass\n\t\tvar lowNum = Infinity;\n\t\tvar lowI = swapI;\n\n\t\tfor(var scanI = swapI; scanI < arr.length; scanI++) {\n\t\t\tif(arr[scanI] < lowNum) {\n\t\t\t\tlowNum = arr[scanI];\n\t\t\t\tlowI = scanI;\n\t\t\t}\n\t\t}\n\n\t\t// Swap the low value with the beginning of the array\n\t\tarr[lowI] = arr[swapI];\n\t\tarr[swapI] = lowNum;\n\t}\n}", "function selectionSort(arr) {\n // your code here!\n // arr is an array of unsorted integers (i.e. [3, 5, 1])\n let length = arr.length;\n arr.map((e, i) => {\n let min = i; //store index of min value\n for (let j = i + 1; j < length; j++) {\n if (arr[min] > arr[j]) {\n min = j; //updating the index\n }\n }\n if (i !== min) {\n [arr[i], arr[min]] = [arr[min], arr[i]];\n }\n });\n return arr;\n}", "function selectionSort(array) {\n const swap = (arr, i1, i2) => [arr[i1], arr[i2]] = [arr[i2], arr[i1]];\n\n // loop arr\n for (let o = 0; o < array.length; o++) {\n // min tracker\n let min = o;\n let noSwap = true;\n // inner loop n update min index\n for (let i = o + 1; i < array.length; i++) {\n if (array[i] < array[min]) {\n min = i;\n noSwap = false;\n }\n }\n // end of loop we swap\n if (min !== o) {\n swap(array, o, min);\n }\n console.log('array', array, noSwap);\n if (noSwap) break;\n }\n // return arr\n return array;\n}", "_sortValues() {\n if (this.multiple) {\n const options = this.options.toArray();\n this._selectionModel.sort((a, b) => {\n return this.sortComparator ? this.sortComparator(a, b, options) :\n options.indexOf(a) - options.indexOf(b);\n });\n this.stateChanges.next();\n }\n }", "function selectionSort(arr) {\n let foundSmaller;\n for (let i = 0; i < arr.length; i++) {\n let lowest = i;\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[lowest] > arr[j]) {\n lowest = j;\n foundSmaller = true;\n }\n }\n if (foundSmaller) {\n let temp = arr[i];\n arr[i] = arr[lowest];\n arr[lowest] = temp;\n }\n }\n return arr;\n}", "function selectionSort(array) {\n if (array.length < 2) return array\n let smallest = 0\n let target = 1\n let count = 0\n while (target < array.length) {\n smallest = Math.min(array[smallest], array[target]) !== array[smallest] ? target : smallest\n target++\n if (target === array.length) {\n if (smallest === count) {\n break\n }\n let tmp = array[count]\n array[count] = array[smallest]\n array[smallest] = tmp\n smallest = count + 1\n target = smallest + 1\n count++\n }\n }\n return array\n}", "function selectionSort(arr) {\n // Selection Sort Algorithm\n // We loop through the array and find the min value.\n // Once we have the min value we place it at the front of the array.\n // Then we iterate through the array where the length of the array we iterate over is now n - 1,\n // since we're going to be iterating through all values except where the min value was just finished beng placed at.\n // Every iteration, our range of the array we're iterating over will shrink, finding the new min at each new sub array we're iterating over\n // and placing the new found in at the beginning of that sub array, until we reach the end.\n\n // We need to initialize the front pointer, i.\n let i = 0;\n\n // We need to loop over the array\n while (i < arr.length) {\n // We also need to initialize the traversing pointer, j.\n let j = i;\n // And we also need to rememeber the min value;\n let min = Infinity;\n\n while (j < arr.length) {\n const current = arr[j];\n min = Math.min(current, min);\n ++j;\n }\n // We also need to keep track of the index of min\n let minIndex = arr.indexOf(min);\n\n // once we get to this part of the algorithm, we'd have found the min in the sub array from i to arr.length\n // so then we just swap the elments at i and the index of min\n console.log(arr, arr[i], arr[minIndex]);\n // We swap the values at the beginning of our sub array and the element at minIndex.\n swap(i, minIndex, arr);\n // Then we increment i to adjust the window of out sub array.\n ++i;\n }\n}", "function selection_sort(){\n let i, j, p; \n\n for(i=0;i<data.length-1;i++){\n p =i;\n for( j =i+1;j<data.length;j++){\n if (data1[p] > data1[j]) {\n p=j;\n }\n if(p!=i){\n \n let temp = data1[i];\n data1[i] = data1[p];\n data1[p] = temp;\n }\n \n \n \n }\n draw_chart2();\n \n }\n \n draw_chart3();\n \n \n}", "function selectionSort(array){\n var minIndex;\n for(var i = 0; i < array.length; i++){\n minIndex = findIndexOfMinimum(array, i);\n swap(array, i, minIndex);\n }\n return array;\n}", "function selectionSort(arr){\n for(let i = 0; i< arr.length; i++){\n let smallest = i; //\n for(let j= i+ 1; j< arr.length; j++){\n if(arr[j] < arr[smallest]) { //i:0, j:1 7< 4\n smallest = j; //4\n }\n };//end of for loop \n if(i !== smallest){\n [arr[i], arr[smallest]] = [arr[smallest], arr[i]]\n }\n }\n return arr;\n}", "function selectionSort(arr) {\n let start = 0;\n while (start < arr.length) {\n let smallestIndex = -1;\n let smallest = Infinity;\n for (let j = start + 1; j < arr.length; j++) {\n if (arr[j] <= smallest) {\n smallest = arr[j];\n smallestIndex = j;\n }\n }\n let temp = arr[start];\n arr[start] = arr[smallestIndex];\n arr[smallestIndex] = temp;\n start++;\n }\n return arr;\n}", "function selectionSort(array) {\n const length = array.length;\n for (let i = 0; i < length; i++) {\n //set current index as minimum number\n let minimum = i;\n let temp = array[i];\n for (let j = i + 1; j < length; j++) {\n if (array[j] < array[minimum]) {\n //update minimum number if current is lower than what we had previously\n minimum = j;\n }\n }\n array[i] = array[minimum];\n array[minimum] = temp;\n }\n return array;\n}", "visualizeSelectionSort() {\n console.log(\"Selection Sort\");\n const array = this.state.array;\n array.forEach((element) => {\n element.visited = false; // if already sorted and clicked the sort function again... we just need to reset the visited flags\n });\n\n for (let i = 0; i < BAR_COUNT - 1; i++) {\n let minPos = i;\n for (let j = i + 1; j < BAR_COUNT; j++) {\n setTimeout(() => {\n if (array[minPos].number > array[j].number) {\n minPos = j;\n }\n let key = array[minPos];\n while (minPos > i) {\n array[minPos] = array[minPos - 1];\n minPos--;\n }\n array[i] = key;\n array[i].visited = true;\n this.setState({array:array,sorted:i === BAR_COUNT - 2 && j === BAR_COUNT - 1});\n }, i * SORTING_SPEED);\n }\n }\n }", "function selectionSort(nums){\n var counter = 0;\n for(var i = 0; i < nums.length; i++){\n var min = nums[i];\n var minIndex = i;\n for(var j = 0+i; j < nums.length; j++){\n if(min > nums[j]){\n min = nums[j];\n minIndex = j;\n console.log(\"min is now \" + min);\n }\n counter++;\n }\n nums[minIndex] = nums[i];\n nums[i] = min;\n }\n console.log(\"Function ran this many times: \" + counter);\n return nums;\n }", "function sortSelectedCSI()\n {\n //sort them properly\n var arrSelCSI = new Array();\n //store the selected csis in an array\n if (obj_selectedCSI != null && obj_selectedCSI.length >0)\n {\n for (var m=0; m<obj_selectedCSI.length; m++)\n {\n arrSelCSI[arrSelCSI.length] = new Array(obj_selectedCSI[m].value, obj_selectedCSI[m].text);\n }\n }\n if (arrSelCSI.length > 0)\n {\n obj_selectedCSI.length = 0; //empty the select list\n //loop through selCSI select list get the csis\n for (var k=0; k<csiArray.length; k++)\n {\n var selCSIid = csiArray[k][2];\n if (obj_selectedCS.selectedIndex >= 0)\n {\n var selCS_id = obj_selectedCS[obj_selectedCS.selectedIndex].value;\n var arrCSid = csiArray[k][0];\n //loop through above array to get the matching csis\n if (selCS_id == arrCSid)\n {\n for (var m=0; m<arrSelCSI.length; m++)\n {\n var arrCSIid = arrSelCSI[m][0];\n if (arrCSIid == selCSIid)\n {\n var idx = obj_selectedCSI.length;\n obj_selectedCSI[idx] = new Option(arrSelCSI[m][1], arrCSIid);\n //keep it selected\n if (obj_selCSI.selectedIndex >= 0)\n {\n if (obj_selCSI[obj_selCSI.selectedIndex].value == arrCSIid)\n obj_selectedCSI[idx].selected = true;\n }\n break;\n }\n }\n }\n }\n }\n }\n }", "function selectionSort(arr) {\n for(let i = 0; i < arr.length; i++) {\n var min = arr[i];\n // store minimum in a var\n if(arr[i] < arr[i+1]) {\n min = arr[i];\n }\n }\n return arr;\n}", "function selectionSort(arr){\n\n for( let i = 0; i < arr.length; i++){\n let smallest = i;\n for (let j = i+1; j < arr.length; j++) {\n\n if(arr[j] < arr[smallest]) {\n smallest = j;\n }\n };\n if(i !== smallest){\n [arr[i], arr[smallest]] = [arr[smallest], arr[i]]\n }\n \n }\n return arr;\n\n}", "function mySelectionSort(arr){\r\n let min = arr[0];\r\n for(let i = 0; i < arr.length; i++){\r\n \r\n if(arr[i] < min){\r\n min = arr[i];\r\n }\r\n }\r\n if(min !== arr[0]){\r\n let temp = arr[0];\r\n arr[0] = min;\r\n }\r\n}", "function selectionSort(set) {\n var size = set.length;\n\n // loop through each element\n for (var i = 0; i < size; i++) {\n // assumption: the location of the smallest value is the current index; initially 0\n var min_location = i;\n\n // find the location of the smallest value of the remaining elements\n // from j to size\n // initially, j = 1, then 2, etc\n // *** algorithmically similar to maxVal\n for (var j = i + 1; j < size; j++) {\n if (set[j] < set[min_location]) {\n min_location = j;\n }\n }\n // swap if the minimum value is not in the current value\n if (min_location != i) {\n var temp = set[i];\n set[i] = set[min_location];\n set[min_location] = temp;\n }\n }\n\n return set;\n}", "sort(predicate) {\n if (this._multiple && this.selected) {\n this._selected.sort(predicate);\n }\n }", "function selectionsortArray(arrayIn)\n{\n\tvar min = arrayIn[0],\n\t\tmax = arrayIn[arrayIn.length - 1],\n\t\tminindex = 0,\n\t\tmaxindex = arrayIn.length - 1;\n\n\tvar temp;\n\n\tfor(var i = 0; i < Math.floor((arrayIn.length - 1) / 2); i += 1)\n\t{\n\t\tmin = arrayIn[i];\n\t\tminindex = i;\n\t\tmax = arrayIn[arrayIn.length - 1 - i];\n\t\tmaxindex = arrayIn.length - 1 - i;\n\t\tfor(var j = i + 1; j < (arrayIn.length - i); j += 1)\n\t\t{\n\t\t\tif (arrayIn[j] < min)\n\t\t\t{\n\t\t\t\tmin = arrayIn[j];\n\t\t\t\tminindex = j;\n\t\t\t}\n\t\t\telse if (arrayIn[j] > max)\n\t\t\t{\n\t\t\t\tmax = arrayIn[j];\n\t\t\t\tmaxindex = j;\n\t\t\t}\n\t\t}\n\t\tif (minindex > i)\n\t\t{\n\t\t\ttemp = arrayIn[i];\n\t\t\tarrayIn[i] = arrayIn[minindex];\n\t\t\tarrayIn[minindex] = temp;\n\t\t}\n\t\tif (maxindex < arrayIn.length - 1 - i)\n\t\t{\n\t\t\ttemp = arrayIn[arrayIn.length - 1 - i];\n\t\t\tarrayIn[arrayIn.length - 1 - i] = arrayIn[maxindex];\n\t\t\tarrayIn[maxindex] = temp;\n\t\t}\n\t}\n\treturn arrayIn;\n}", "function selectionSort(list) {\n const result = [];\n\n while(list.length > 0) {\n let min = list[0];\n let index = 0;\n\n for(let i = 1; i < list.length; i++) {\n if(list[i] < min) {\n min = list[i];\n index = i;\n }\n\n // min = list[i] < min ? list[i] : min;\n // index = list[i] < min ? i : index;\n }\n\n result.push(min);\n list.splice(index, 1);\n console.log(list);\n console.log(result);\n }\n\n return result;\n}", "function selectionSort2015(arr) {\n const swap = (arr, idx1, idx2) => \n ([arr[idx1], arr[idx2]] = [arr[idx2], arr[idx1]]);\n\n for(let i = 0; i < arr.length; i++) {\n let min = i;\n for(let j = i + 1; j < arr.length; j++) {\n if(arr[j] < arr[min]) {\n min = j;\n }\n }\n //I need to learn about the arrow function.\n if(arr[min] !== arr[i]) swap(arr, i, min);\n }\n\n return arr;\n}", "function selectSort(arr){\r\n const len = arr.length;\r\n // define a variable to store the minimum index of current interval\r\n let minIndex;\r\n // i is the start point of current interval\r\n for(let i = 0; i < len - 1; i++){\r\n // init minIndex \r\n minIndex = i;\r\n // j is current interval's right limit\r\n for(let j = i; j < len; j++){\r\n // find the smallest data and update index of minIndex \r\n if(arr[j] < arr[minIndex]){\r\n minIndex = j;\r\n }\r\n }\r\n // if minIndex is not current head index, swap them\r\n if(minIndex !== i){\r\n [arr[i], arr[minIndex]] = [arr[minIndex], arr[i]];\r\n }\r\n }\r\n return arr;\r\n}", "function selectionSort(arr) {\n let idxOfMin;\n\n // Loop over entire array\n for (let i = 0; i < arr.length; i++) {\n let biggestGap = 0;\n let shouldSwap = false;\n\n // From index `i` + 1, find a smaller value, at index `k`.\n // We are searching through the \"right hand side\" of the array\n for (let k = i + 1; k < arr.length; k++) {\n const diff = arr[i] - arr[k];\n\n // Mark the index `k` where that smallest value is\n if (diff > biggestGap) {\n biggestGap = diff;\n idxOfMin = k;\n shouldSwap = true;\n }\n }\n\n // Back in the outter loop - perform a swap with `i` and `k`\n if (shouldSwap) {\n [arr[i], arr[idxOfMin]] = swap(arr[i], arr[idxOfMin]);\n }\n }\n\n return arr;\n}", "function AnimateSelectionSort() \n{ // This function is executed repeatedly via SetInterval()\n // Note: TargetTick is incremented with every call to this function \n \n Tick=0;\n // SelectionSort(A); \n SelectionSort_Rec(A,0) ;\n TargetTick++; \n}", "function selectionSort(arr) {\n const sorted = [];\n\n while (arr.length > 0) {\n const min = Math.min(...arr);\n const idx = arr.indexOf(min);\n\n sorted.push(min);\n arr.splice(idx, 1);\n }\n\n return sorted;\n}", "function sortSelect(selElem) {\r\n\tvar tmpAry = new Array();\r\n\tfor (var i=0;i<selElem.options.length;i++) {\r\n\t\ttmpAry[i] = new Array();\r\n\t\ttmpAry[i][0] = selElem.options[i].text;\r\n\t\ttmpAry[i][1] = selElem.options[i].value;\r\n\t}\r\n\ttmpAry.sort();\r\n\twhile (selElem.options.length > 0) {\r\n\t\tselElem.options[0] = null;\r\n\t}\r\n\tfor (var i=0;i<tmpAry.length;i++) {\r\n\t\tvar op = new Option(tmpAry[i][0], tmpAry[i][1]);\r\n\t\tselElem.options[i] = op;\r\n\t}\r\n\treturn;\r\n}", "function selectSort(list) {\n function sort(index) {\n if (list.length === 0 || index === list.length - 1) {\n return total;\n }\n var min = list.reduce(function(prev, curr, idx) { // only compare from index;\n return idx <= index ? list[index] : Math.min(prev, curr);\n });\n var minIndex = list.indexOf(min, index);\n if (minIndex > 0) {\n selects.push([index, list[minIndex], minIndex, list[index]]);\n var temp = list[index];\n list[index] = list[minIndex];\n list[minIndex] = temp;\n total++;\n } // else list[0] is next smallest;\n return sort(index + 1);\n }\n var total = 0;\n return sort(0);\n}", "sort(predicate) {\n if (this._multiple && this.selected) {\n this._selected.sort(predicate);\n }\n }", "sort(predicate) {\n if (this._multiple && this.selected) {\n this._selected.sort(predicate);\n }\n }", "sort() {\n let time = 0;\n this.toggleSortButton(time);\n\n switch (this.state.currSelection) {\n case MERGESORT:\n time = this.mergeSort();\n break;\n case QUICKSORT:\n time = this.quickSort();\n break;\n case HEAPSORT:\n time = this.heapSort();\n break;\n case BUBBLESORT:\n time = this.bubbleSort();\n break;\n default:\n break;\n }\n\n this.toggleSortButton(time);\n }", "function selection_sort(array, arrayLength){\n\n // temporary variable to store the position of minimum element\n var minimum;\n\n // reduces the effective size of the array by one in each iteration.\n for(var i = 0; i < arrayLength - 1; i++){\n\n // assuming the first element to be the minimum of the unsorted array .\n minimum = i;\n\n // gives the effective size of the unsorted array .\n for(var j = i + 1; j < arrayLength; j++){\n\n if(array[ j ] < array[ minimum ]){\n\n //finds the minimum element\n minimum = j;\n }\n }\n // putting minimum element on its proper position.\n swap(array, minimum, i);\n }\n\n console.log(array);\n}", "function selectionSetSorted(){\n setClass(nodes[selectionSmallest], 2, \"Default\");\n setClass(nodes[selectionCurrent], 2, \"Sorted\"); //sets the current node to \"sorted\" color\n addStep(\"Current Node \" + (selectionCurrent + 1) + \" is now sorted.\");\n sortedSwitchStep++;\n}", "function listsort(obj, by, num, cs) { /*updated from version 1.2*/\n\tobj = (typeof obj == \"string\") ? document.getElementById(obj) : obj;\n\tby = (parseInt(\"0\" + by) > 5) ? 0 : parseInt(\"0\" + by);\n\tif (obj.tagName.toLowerCase() != \"select\" && obj.length < 2)\n\t\treturn false;\n\tvar elements = new Array();\n\tfor (var i=0; i<obj.length; i++) {\n\t\telements[elements.length] = new Array((document.body.innerHTML ? obj[i].innerHTML : obj[i].text), obj[i].value, (obj[i].currentStyle ? obj[i].currentStyle.color : obj[i].style.color), (obj[i].currentStyle ? obj[i].currentStyle.backgroundColor : obj[i].style.backgroundColor), obj[i].className, obj[i].id, obj[i].selected);\n\t}\n\tsort2d(elements, by, num, cs);\n\tfor (i=0; i<obj.length; i++) {\n\t\tif (document.body.innerHTML) obj[i].innerHTML = elements[i][0];\n\t\telse obj[i].text = elements[i][0];\n\t\tobj[i].value = elements[i][1];\n\t\tobj[i].style.color = elements[i][2];\n\t\tobj[i].style.backgroundColor = elements[i][3];\n\t\tobj[i].className = elements[i][4];\n\t\tobj[i].id = elements[i][5];\n\t\tobj[i].selected = elements[i][6];\n\t}\n}", "function sortSelections(selections) {\n\t return [].concat((0, _toConsumableArray3['default'])(selections)).sort(function (a, b) {\n\t return a.kind === 'InlineFragment' || a.kind === 'Condition' ? 1 : b.kind === 'InlineFragment' || b.kind === 'Condition' ? -1 : 0;\n\t });\n\t}", "function selectionSort(array) {\n var states = [];\n var color = [];\n var data = array.slice();\n var n = data.length;\n\n states.push(new State(data.slice(), JSON.parse(JSON.stringify(color))));\n for (var i = 0; i < n - 1; i++) {\n var min = i;\n color[i] = \"#FFFF00\";\n states.push(new State(data.slice(), JSON.parse(JSON.stringify(color))));\n for (var j = i + 1; j < n; j++) {\n color[j] = \"#0000FF\";\n states.push(new State(data.slice(), JSON.parse(JSON.stringify(color))));\n if (data[j] < data[min]) {\n color[min] = null;\n min = j;\n color[j] = \"#FFFF00\";\n states.push(new State(data.slice(), JSON.parse(JSON.stringify(color))));\n } else {\n color[j] = null;\n }\n }\n color[n - 1] = null;\n states.push(new State(data.slice(), JSON.parse(JSON.stringify(color))));\n if (min != i) {\n var tmp = data[i];\n data[i] = data[min];\n data[min] = tmp;\n color[min] = null;\n }\n color[i] = \"#00FF00\";\n states.push(new State(data.slice(), JSON.parse(JSON.stringify(color))));\n }\n color[n - 1] = \"#00FF00\";\n states.push(new State(data.slice(), JSON.parse(JSON.stringify(color))));\n return states;\n}", "function selection_sort(array){\n var sorted_array=[];\n\n for(int i=0;i<array.length;i++){\n // Finds the smallest element in the array\n var smallest_index=find_smallest_number(array);\n // Adds the smallest element to new array\n sorted_array.push(array.splice(smallest_index,1)[0]);\n }\n return sorted_array;\n}", "function Sort() {}", "function selectionSortFirstTry(arr) {\n let min = [] // this was unnecessary\n for (let i=0; i<arr.length; i++) {\n min = [arr[i+1], i+1]\n for(let j=i+1; j<arr.length; j++) {\n if(arr[j]<min[0]) {\n min = [arr[j], j]\n }\n } \n if (min[0]<arr[i]) {\n [arr[i], arr[min[1]]] = [arr[min[1]], arr[i]]\n }\n }\n return arr\n}", "function findSort(){\n if(!started){\n startSort();\n }\n\n if(done)\n return;\n\n randomizeButton.disabled = true;\n\n let decision = sortSelector.value;\n switch(decision){\n case \"Selection\":\n selectionSort();\n break;\n case \"Quick\":\n quicksort();\n break;\n case \"Bubble\":\n bubblesort();\n break;\n case \"Insertion\":\n insertionSort();\n break;\n case \"Merge\":\n mergeSort();\n break;\n case \"Heap\":\n heapSort();\n break;\n case \"Bogo\":\n bogoSort();\n break;\n }\n\n \n}", "sortChange() {\n let choice = this.selector.value;\n switch(choice) {\n case \"1\":\n return this.sortAlpha();\n case \"2\":\n return this.sortAlpha(true);\n case \"3\":\n return this.sortDonation();\n case \"4\":\n return this.sortDonation(true);\n }\n }", "function startSort(){\n sortSelector.disabled = true; //freezes the sortSelector\n orderArray = getOrder(); //sets selectionOrder to be the current order of the nodes\n started = true;\n stepNum = 1; //reset the number of steps\n\n if(selected){setClass(selectedNode, 2, \"Default\");} //if a node is selected for manual switching, set it to default\n\n selected = false; //remove the selected Section for the Node\n \n}", "function sortBoxes(leftID, rightID){\n var ids = '#' + leftID;\n if (rightID != null) { ids = ids + ', #' + rightID; }\n var toSort = $(ids);\t\t\t\t\t\n\n toSort.find('option').selso({\n type: 'alpha', \n extract: function(o){ return $(o).text().toLowerCase(); } \n });\n\n // clear highlights\n $('#' + leftID + ', #' + rightID).find('option:selected').removeAttr('selected');\n }", "function selectionSort_Max_to_Left(arr) {\n var i, j;\n for ( i = 0; i < arr.length; i++) {\n var maxIndex = i;\n for ( j = i + 1; j < arr.length; j++) {\n if ( arr[maxIndex] < arr[j]) {\n maxIndex = j;\n }\n }\n var temp = arr[i];\n arr[i] = arr[maxIndex];\n arr[maxIndex] = temp;\n }\n return arr;\n}", "function selection_simulate() {\n var numbers = $(\"arrayinput\").value;\n var toBeSorted = numbers.split(\",\");\n if (toBeSorted.length >= 1) {\n var toBeSortedi = new Array();\n for (var q = 0; q < toBeSorted.length; q++) {\n toBeSortedi[q] = parseInt(toBeSorted[q]);\n }\n drawarray(toBeSortedi);\n selectionSort(toBeSortedi);\n }\n}", "sortDataset() {\n if (this.settings.disableClientSort) {\n this.restoreSortOrder = true;\n return;\n }\n\n if (this.settings.groupable && this.originalDataset) {\n this.settings.dataset = this.originalDataset;\n }\n const sort = this.sortFunction(this.sortColumn.sortId, this.sortColumn.sortAsc);\n\n this.saveDirtyRows();\n this.settings.dataset.sort(sort);\n this.setTreeDepth();\n this.restoreDirtyRows();\n\n // Resync the _selectedRows array\n if (this.settings.selectable) {\n this.syncDatasetWithSelectedRows();\n }\n }", "function sortFromOption(){\n // console.log(\"sortFromOption\");\n getSortMethod(nowArray);\n pageNumber = 1;\n changeDisplayAmount(displayType,1);\n}", "function runAlgo() {\n switch(sel.value()) { // Current value in the drop-down menu.\n case \"Bubble Sort\":\n bubbleSort(values);\n break;\n case \"Merge Sort\":\n mergeSort();\n break;\n case \"Quick Sort\":\n quickSort(values, 0, values.length - 1);\n break;\n case \"Radix Sort\":\n radixSort();\n break;\n case \"Insertion Sort\":\n insertionSort(0, values.length);\n break;\n case \"Selection Sort\":\n selectionSort();\n break;\n case \"Cocktail Sort\":\n cocktailSort();\n break;\n case \"Shell Sort\":\n shellSort();\n break;\n }\n}", "function sortValue(sel) {\n if(sel==\"0\"){\n if(archive.isArchiveAR) {\n arrayRow=archive.arrayRow.slice();\n }\n }\n else {\n let idCol = parseInt(sel);\n //selectColumn=idCol;\n if (!archive.isArchiveAR) {\n console.log(\"zapisywnie archiwum\");\n archive.arrayRow = arrayRow.slice();\n archive.isArchiveAR = true;\n }\n arrayRow.sort(function (a, b) {\n return a.arrayCell[idCol] - b.arrayCell[idCol];\n });\n }\n showData();\n}", "function sortby(picked) {\n // Based on what we picked, style spans and trigger sorting functions \n if (picked==1){$('#by-date').removeClass('sort-selected');$('#by-cat').addClass('sort-selected');catsort();}\n if (picked==0){$('#by-cat').removeClass('sort-selected');$('#by-date').addClass('sort-selected');datesort();}\n}", "function sortby(picked) {\n // Based on what we picked, style spans and trigger sorting functions \n if (picked==1){$('#by-date').removeClass('sort-selected');$('#by-cat').addClass('sort-selected');catsort();}\n if (picked==0){$('#by-cat').removeClass('sort-selected');$('#by-date').addClass('sort-selected');datesort();}\n}", "function quickSort() {}", "function sortSelect(select) {\n if (select.options.length > 1) {\n var tempArray = [];\n for (i = 0; i < select.options.length; i++) {\n tempArray[i] = [];\n tempArray[i][0] = select.options[i].text;\n tempArray[i][1] = select.options[i].value;\n }\n tempArray.sort();\n while (select.options.length > 0) {\n select.options[0] = null;\n }\n for (i = 0; i < tempArray.length; i++) {\n select.options[i] = new Option(tempArray[i][0], tempArray[i][1]);\n }\n return;\n }\n }", "function startSelection(){ \n sortedSwitchStep = 1; \n selectionStarted = true;\n selectionCurrent = 0; //reset the number of sorted so that we can use it again without refreshing\n selectionIndex = 1;\n selectionSmallest = 0;\n addStep(\"Node 1 is the first unsorted Array. Set Node 1 to \\\"smallest\\\".\");\n setClass(nodes[0], 2, \"Combined\");\n foundNewSorted = false;\n}", "function sortChoice() {\n var state = d3.selectAll(\"option\");\n var sort = d3.selectAll(\".checkbox\");\n\n if (sort[0][0].checked && state[0][0].selected) {\n var out = function (a, b) { return b.gdp_change - a.gdp_change; }\n return out;\n }\n else if (sort[0][0].checked && state[0][1].selected) {\n var out = function (a, b) { return b.income_change - a.income_change; }\n return out;\n }\n \n else if (sort[0][0].checked && state[0][2].selected) {\n var out = function (a, b) { return b.cpi_change - a.cpi_change; }\n return out;\n }\n\n else if (sort[0][0].checked && state[0][3].selected) {\n var out = function (a, b) { return b.sp_change - a.sp_change; }\n return out;\n }\n\n else if (sort[0][0].checked && state[0][4].selected) {\n var out = function (a, b) { return b.budget_change - a.budget_change; }\n return out;\n }\n\n else if (sort[0][0].checked && state[0][5].selected) {\n var out = function (a, b) { return b.budget_as_percentage - a.budget_as_percentage; }\n return out;\n }\n\n else if (sort[0][0].checked && state[0][6].selected) {\n var out = function (a, b) { return b.debt_change - a.debt_change; }\n return out;\n }\n\n else if (sort[0][0].checked && state[0][7].selected) {\n var out = function (a, b) { return b.unemployment_change - a.unemployment_change; }\n return out;\n }\n\n else if (sort[0][0].checked && state[0][8].selected) {\n var out = function (a, b) { return b.unemployment - a.unemployment; }\n return out;\n }\n\n else {\n var out = function (a, b) { return d3.ascending(a.term, b.term); }\n return out;\n }\n }", "_sortBy(array, selectors) {\n return array.concat().sort((a, b) => {\n for (let selector of selectors) {\n let reverse = selector.order ? -1 : 1;\n\n a = selector.value ? JP.query(a, selector.value)[0] : JP.query(a,selector)[0];\n b = selector.value ? JP.query(b, selector.value)[0] : JP.query(b,selector)[0];\n\n if (a.toUpperCase() > b.toUpperCase()) {\n return reverse;\n }\n if (a.toUpperCase() < b.toUpperCase()) {\n return -1 * reverse;\n }\n }\n return 0;\n });\n }", "changeSorting() {\n this.currentlySelectedOrder =\n (this.currentlySelectedColumn === this.columnName) ? !this.currentlySelectedOrder : false;\n this.currentlySelectedColumn = this.columnName;\n }", "function sortViewList() {\n var primarySort = document.getElementsByTagName(\"select\")[0].value;\n var hierarchy = [];\n if (primarySort === \"name\") { //hierarchy: name > category > price\n hierarchy = [\"name\", \"category\", \"price\"];\n } else if (primarySort === \"price\") { //hierarchy: price > name > category\n hierarchy = [\"price\", \"name\", \"category\"];\n } else if (primarySort === \"category\") { //hierarchy: category > name > price\n hierarchy = [\"category\", \"name\", \"price\"];\n }\n itemViewList = mergeSort(itemViewList, hierarchy);\n}" ]
[ "0.7714516", "0.7663314", "0.7590758", "0.7446182", "0.7402852", "0.73973596", "0.73851514", "0.7351114", "0.7350713", "0.7346228", "0.73411345", "0.7283086", "0.7277667", "0.72674704", "0.7259008", "0.7248383", "0.72382843", "0.72318846", "0.72291154", "0.7228415", "0.7207205", "0.71892154", "0.71856296", "0.71779585", "0.71760136", "0.7174638", "0.7166902", "0.71524864", "0.71474653", "0.71432203", "0.7113273", "0.7112921", "0.710659", "0.71007663", "0.70805633", "0.7069675", "0.7062487", "0.70314735", "0.7000779", "0.6998196", "0.6990719", "0.69865227", "0.69670486", "0.69626564", "0.692968", "0.69264007", "0.69076717", "0.6873356", "0.68380743", "0.6834463", "0.68065745", "0.6804396", "0.67985237", "0.6794644", "0.6771797", "0.67665535", "0.67594695", "0.67246485", "0.6712186", "0.67038447", "0.6674783", "0.66603786", "0.6612232", "0.6581259", "0.65787953", "0.65480876", "0.6538515", "0.64747775", "0.64744765", "0.6460243", "0.6456256", "0.6431466", "0.6431466", "0.6345242", "0.6333996", "0.63124985", "0.6294575", "0.62757677", "0.62675256", "0.6259095", "0.62214226", "0.615516", "0.6132569", "0.60802966", "0.6033765", "0.60223305", "0.6001491", "0.5953861", "0.59286416", "0.5928275", "0.58701473", "0.58512706", "0.5840948", "0.5840948", "0.5840743", "0.5829231", "0.5827097", "0.5813131", "0.58038354", "0.5802632", "0.57979184" ]
0.0
-1
Each enemy object is initially positioned off the grid (x) has a (y) position based on the argument that is passed in when Enemy is created has random speed shares the same visual asset
constructor(y) { this.x = -101; this.y = y; this.speed = Math.floor(Math.random() * 500) + 100; this.sprite = 'images/enemy-bug.png'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "spawn() {\n this.x = getRandomInt(0, 25) * this.grid;\n this.y = getRandomInt(0, 25) * this.grid;\n }", "constructor() {\n this.sprite = 'images/enemy-bug.png';\n this.x = 0;\n this.ranNumForLocation = Math.floor(Math.random() * 3);\n this.initialLocationArray = [48, 131, 214]\n this.y = this.initialLocationArray[this.ranNumForLocation];\n this.ranNumForSpeed = Math.floor(Math.random() * 8);\n this.speedArray = [100, 150, 200, 250, 300, 350, 400, 450, 500];\n this.speed = this.speedArray[this.ranNumForSpeed];\n this.row = null;\n this.col = 1;\n }", "constructor(x,y){\r\n this.sprite = 'images/enemy-bug.png';\r\n this.x = x;\r\n this.y = y;\r\n this.speed = 550 + (Math.random()*450); //Random Speed for enemy movements on X Axis.\r\n\r\n}", "function startingPositionZombie() {\n\n yZombiePos = Math.floor(Math.random() * 7);\n xZombiePos = Math.floor(Math.random() * 7);;\n}", "update(dt) {\n this.x += (level * fasterEnemySpeed) * dt;\n\n // When the enemy moves off the screen, the X and Y positions will be reset\n if (this.x > CANVAS_WIDTH) {\n this.x = randomX();\n this.y = randomY();\n }\n\n }", "update(dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n this.x += this.speed * dt;\n if (this.x > 550) {\n // moves enemy back to left side of screen when they reach the right\n this.x = -120;\n // random # sets/changes row enemy is in each time they reach the right side of the screen\n let random = Math.floor((Math.random() * 4) + 1);\n if (random < 2) {\n this.y = 60;\n }\n else if (random >= 2 && random < 3) {\n this.y = 143;\n }\n else {\n this.y = 226;\n }\n }\n }", "constructor() {\r\n this.w = 15;\r\n this.h = 9;\r\n this.x = Math.random() * width;\r\n \r\n // Make sure enemies are not cut off.\r\n this.x = this.x - this.w / 2 <= 0 ? this.x + this.w / 2 : \r\n this.x + this.w / 2 >= width ? this.x - this.w / 2 : this.x;\r\n this.y = -this.w / 2;\r\n }", "function spawnEnemy() {\n var enemyLocX = parseInt(Math.random() * 90);\n var enemyLocY = parseInt(Math.random() * 30);\n mapData[enemyLocX][enemyLocY] = 281; // write initial enemy position\n }", "update(dt) {\n this.x += (level * enemySpeed) * dt;\n\n // When the enemy moves off the screen, the X position will be reset\n if (this.x > CANVAS_WIDTH) {\n this.x = randomX();\n }\n\n }", "constructor(x, y, speed, startingSize) {\n // Position\n this.x = x;\n this.y = y;\n // Velocity and speed\n this.vx = 0;\n this.vy = 0;\n this.speed = speed;\n // Time properties for noise() function\n this.tx = random(0, 100); // To make x and y noise different\n this.ty = random(0, 100); // we use random starting values\n // Size properties\n this.startingSize = startingSize;\n this.size = startingSize;\n //healthProperties\n this.hitCount = 0;\n this.maxHitcount = enemyImage.length;\n // Display properties\n //**The enemy's images are stored in an array (script.js), and iterates through based\n //on its hitCount\n this.image;\n }", "function spawnEnemy() {\n var x;\n var y =-150;\n var index;\n x = Math.floor(Math.random()* (game.bgCanvas.width - Enemy.imagewidth));\n var index = Math.floor(Math.random()*game.wordBank.length);\n \n game.enemyArray.push(new Enemy());\n game.enemyArray[game.enemyArray.length - 1].init(x,y,index);\n \n \n}", "constructor() {\n // The image for the sprite\n this.sprite = 'images/enemy-bug.png';\n this.x = xStartPosEnemy;\n this.speed = speeds[Math.floor(Math.random() * 5)];\n }", "update(dt) {\n // multiplying the movements by the dt parameter will\n // ensure the game runs at the same speed for all computers.\n\n this.x += this.enemySpeed * dt ;\n if (this.x > 510 ){\n this.x = -102;\n this.y = posArray[Math.floor(Math.random() * posArray.length)];\n this.enemySpeed = enemySpeed[Math.floor(Math.random() * enemySpeed.length)];\n this.x += this.enemySpeed * dt ; \n }\n }", "function spawnEnemy() {\n r = getRandomInt(1, 25);\n if (r === 1) {\n newenemyY = getRandomInt(-300, -25);\n s = 1;\n new enemy(newenemyY, s);\n } else if (r === 2) {\n newenemyY = getRandomInt(800, 1050);\n s = -1;\n new enemy(newenemyY, s);\n }\n }", "function Enemy() {\n this.srcX = 131;\n this.srcY = 500;\n this.width = 128;\n this.height = 78;\n this.speed = 2;\n this.drawX = Math.floor(Math.random() * 1000) + gameWidth;\n this.drawY = Math.floor(Math.random() * 422);\n}", "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "sendToStartPos() {\n this.x = this.spawnX;\n this.y = this.spawnY;\n }", "constructor(){\n this.x; // This takes control of x-position of enemy\n this.y; // This takes control of y-position of enemy\n this.row; // This takes control of row of enemy\n this.col; // This takes control of column of player\n this.sprite; //This takes control of the image of enemy\n this.reset(); // Assigns value to all above parameters., Except of this.sprite , because it is set when player is selected via selection menu.\n }", "constructor(){\n\n this.col; // This takes control of column of enemy\n this.row; // This takes control of row of enemy\n this.speed; //This takes control of speed of enemy\n this.x; // This takes control of x-position of enemy\n this.y; // This takes control of y-position of enemy\n this.sprite = 'images/enemy-bug.png'; //This takes control of the image of enemy\n this.reset(); // Assigns value to all above parameters.\n}", "spawn(x, y, speedX, speedY, origin) {\n this.x = x;\n this.y = y;\n this.height = origin.height;\n this.width = origin.width;\n this.speedX = speedX;\n this.speedY = speedY;\n this.alive = true;\n this.timer = 0;\n this.T = Date.now();\n this.stepX = 0;\n this.stepY = 0;\n }", "function moveEnemy1() {\n posX = parseInt($(\"#enemy1\").css(\"left\"));\n $(\"#enemy1\").css(\"left\", posX - vel);\n $(\"#enemy1\").css(\"top\", posY);\n\n if (posX <= 0) {\n posY = parseInt(Math.random() * 334);\n $(\"#enemy1\").css(\"left\", 634);\n $(\"#enemy1\").css(\"top\", posY);\n }\n }", "move() {\n this.x = this.x + random(-2, 2);\n this.y = this.y + random(-2, 2);\n }", "move() {\n this.y = this.y +this.fallSpeed;\n if(this.y>height+100){\n \n this.y = -100;\n\n this.x = random(width);\n }\n \n }", "function setLoc() {\n xLoc = random(60, width - 60);\n yLoc = random(60, height - 60);\n}", "move() {\n this.x = this.x + random(-10,10);\n this.y = this.y + random(-10,10);\n }", "move() {\n this.x += random(-5, 5);\n this.y += random(-5, 5);\n }", "move(){\n this.x=this.x+random(-3,3)\n this.y=this.y+random(-3,3)\n }", "update(dt){\n this.x = this.x + this.speed * dt;\n // starting the enemy again randomly\n if (this.x > 700 ){\n this.x = -10\n }\n\n // Collison with enemy when two objects hit each others\n if (Math.abs(this.x - player.x) < 75 && Math.abs(this.y - player.y) < 77) {\n player.x = 202;\n player.y = 405;\n player.lives -= 1;\n }\n }", "move() {\n\n\t\tthis.x += random(-5, 5);\n\t\tthis.y += random(-5, 5);\n\n\t}", "constructor(){\n this.x = random(0, width); //x-coordinate is randomized\n this.y = random(0, -height/2);//y-coordinate is randomized as well\n }", "function spawnLocation() {\n // Breaking the entire canvas into a grid of tiles.\n let rows = width / tileSize;\n let cols = (height - 40) / tileSize;\n let xPos, yPos;\n let overlap = false;\n // To prevent an overlap of the food/barrier and the snake's body.\n do {\n xPos = Math.floor(Math.random() * rows) * tileSize;\n yPos = Math.floor(Math.random() * cols) * tileSize;\n overlap = elementsOverlap({ x: xPos, y: yPos });\n } while (overlap);\n return { x: xPos, y: yPos };\n}", "resetPosition() {\n this.x = this.posX[Math.floor(Math.random() * this.posX.length)];\n this.y = this.posY[Math.floor(Math.random() * this.posY.length)];\n }", "constructor() {\n this.positions = {\n x: Math.floor(Math.random() * Math.floor(window.innerWidth - 100)),\n y: Math.floor(Math.random() * Math.floor(window.innerHeight - 100))\n };\n this.identityNumber;\n this.isDead = false;\n }", "function spawn_enemy() {\n\tnum = Math.random()\n\t// console.log(\"enter: \" + num )\n\tvar spawnChance = .75;\t// 5% spawn chance\n\tif(num < spawnChance) {\n\t\t// console.log(\"enter2\")\n\t\t// choose random tile 5 tiles away for spawning\n\t\t// var offsets = [[3,4], [4,3], [0,5], [5,0]];\n\t\tvar offsetDirections = [1, -1];\n\n\t\t// var chosenOffset = offsets[Math.floor(Math.random() * 5)];\n\t\t\n\t\tnum1 = Math.floor(Math.random() * 2)\n\t\tnum2 = Math.floor(Math.random() * 2)\n\n\t\ttest_x = (Math.floor( Math.random() * 7 + 3))\n\t\ttest_y = (Math.floor( Math.random() * 7 + 3))\n\t\tconsole.log(test_x, \":\" , test_y)\n\t\tx_pos = test_x * offsetDirections[num1]\n\t\ty_pos = test_y * offsetDirections[num2]\n\t\t// console.log(chosenOffset[X] + \":\" + chosenOffset[Y])\n\t\t// chosenOffset[0] *= offsetDirections[num1];\n\t\t// chosenOffset[1] *= offsetDirections[num2];\n\t\t// console.log(\"offset x: \" + chosenOffset[X] +\" offset y: \" + chosenOffset[Y] )\n\n\t\t// add pokemon based on randomly calculated offset from player above (currently set to be 0 - 2 levels above average level of user's pokemon)\n\t\taddPokemonToMap(x_pos , y_pos, Math.floor(Math.random() * 151) + 1, getAvgLvl() + Math.floor(Math.random() * 3));\n\t\t// console.log([x_pos,y_pos])\n\t\t\n\t}\n}", "moveSpaceInvadersEnemies() {\n /*\n Van de izquierda a derecha\n mientras que la esquina derecha del enemigo de la derecha no colisione con el límite de la derecha\n sumas a x\n bajan\n sumas una fila a y \n van de derecha a izquierda\n mientras que la esquina izquierda del enemigo de la izquierda no colisione con el límite de la izquierda\n restas a x\n bajan\n sumas una fila a y \n REPITE hasta que un enemigo de la fila inferior colisione con player\n */\n\n this.spaceInvadersEnemiesShootsTimerId = setInterval(() => {\n /*\n Elegimos una columna aleatoria\n El último enemigo de esa columna \n Dispara\n\n 0 1 2 3\n ceil(rand*4) => [1, 4] -1 => [0, 3]\n */\n let shootColumn = Math.ceil(Math.random() * game.model.siEnemiesPerRow) - 1;\n let lastEnemy;\n for (let i = 0; i < game.model.siEnemies.length; i++) {\n let enemy = game.model.siEnemies[i][shootColumn];\n if (enemy && enemy.elem.style.display !== \"none\") {\n lastEnemy = enemy;\n } else {\n continue;\n }\n }\n\n if (lastEnemy)\n lastEnemy.shoot();\n }, 1500);\n\n for (let i = 0; i < game.model.siEnemies.length; i++) {\n for (let j = 0; j < game.model.siEnemies[i].length; j++) {\n let enemy = game.model.siEnemies[i][j];\n enemy.collisionable = true;\n enemy.elem.style.display = \"inline\";\n enemy.moveEnemyLeftToRight();\n }\n }\n }", "move() {\n\t\tthis.x = this.x + random(-2, 2);\n\t\tthis.y = this.y + random(-2, 2);\n\t\tthis.width = this.width + random(-3, 3);\n\t\tthis.height = this.height + random(-3, 3);\n\t}", "function addEnemy(gameCanvas) {\r\n /*Size of plants\r\n var height = 40;\r\n var width = 20;*/\r\n \r\n var height = 50;\r\n var width = 50;\r\n var colour = \"black\";\r\n var lineWidth = Math.floor(15 / 2);\r\n \r\n var startGridPoint = 32;\r\n \r\n cord = backgroundImg.aryPixelPos(startGridPoint); //Get the pixel location of the starting position 32\r\n \r\n /*Setting enemy location*/\r\n //enemy[0] = new physics(gameCanvas, width, height, 1, 210);\r\n enemy[0] = new physics(gameCanvas, width, height, cord[0], cord[1]);\r\n enemy[0].addImg(gameImage.loadedImg[\"wolf\"]);\r\n \r\n /*Save current location on the grid*/\r\n enemy[0].curGridLoc = startGridPoint;\r\n \r\n /*Enemy Direction*/\r\n enemy[0].dx = 1;\r\n enemy[0].dy = 0;\r\n \r\n /*Save enemy initial location*/\r\n pathE[pathECount] = {\r\n x: enemy[0].oldPosX + Math.floor(enemy[0].height/2), \r\n y: enemy[0].oldPosY + Math.floor(enemy[0].height/2),\r\n oX: enemy[0].oldPosX, \r\n oY: enemy[0].oldPosY,\r\n rbg: colour,\r\n width: lineWidth\r\n };\r\n \r\n pathECount++\r\n \r\n}", "function makeEnemy(i) {\n var enemy = {\n // id: 'asteroid.png',\n x: randx(),\n y: randy()\n };\n //console.log(enemy.x);\n return enemy;\n}", "spawns() {\n if (random(1) < 0.01) {\n // accelerates in y axis\n this.accelerations.push(new createVector(0, random(0.1, 1)));\n this.velocities.push(new createVector(0, 0));\n this.locations.push(new createVector(random(width), 0));\n this.diams.push(random(30, 50));\n }\n }", "initialSpawn() {\n\n if (this.spawns) {\n _.each(this.spawns, (spawn, spawnCoord) => {\n\n spawnCoord = parseInt(spawnCoord, 10);\n if (!_.isFinite(spawnCoord)) throw Err(`spawnCoord not a number: ${spawnCoord}`);\n\n const npc = _.find(Resources.npcs, (n) => n.sheet === spawn.id);\n if (!npc) { throw Err(`Could not find spawn unit: ${spawn.id}`); }\n\n const localY = parseInt(spawnCoord / Env.pageWidth, 10),\n localX = spawnCoord % Env.pageWidth;\n\n const entity = new Movable(npc.id, this, {\n position: {\n global: {\n x: (this.x + localX) * Env.tileSize,\n y: (this.y + localY) * Env.tileSize\n }\n }\n });\n\n this.Log(`Spawning spawn[${spawn.id}] at: (${localX}, ${localY})`, LOG_DEBUG);\n this.area.watchEntity(entity);\n this.addEntity(entity);\n });\n }\n }", "respawn(){\n this.x = this.orgX;\n this.y = this.orgY;\n let ang = random(-PI / 4, PI / 4) + (random(1) > 0.5 ? 0 : PI);\n this.xspeed = cos(ang) * this.speed;\n this.yspeed = sin(ang) * this.speed;\n }", "constructor(){\n this.x = random(0,width);\n this.y = random(0,height);\n this.r = random(1,8);\n this.xSpeed = random(-2,2);\n this.ySpeed = random(-1,1.5);\n }", "generateEnemy() {\n var sceneWidth = this.scene.sys.canvas.width;\n var sceneHeight = this.scene.sys.canvas.height;\n var side = GageLib.math.getRandom(0, 1);\n var x;\n var y = sceneHeight / 2;\n var randomSpawnWeight = GageLib.math.getRandom(1, this.totalSpawnWeight);\n var enemyType;\n // Picking an enemy type\n if (randomSpawnWeight >= this.totalSpawnWeight) {\n randomSpawnWeight = this.totalSpawnWeight;\n }\n for (var i = 0; i < this.enemyData.length; i++) {\n var enemy = this.enemyData[i];\n\n randomSpawnWeight -= enemy.spawnWeight;\n if (randomSpawnWeight <= 0) {\n enemyType = enemy;\n break;\n }\n }\n\n // Setting the x coord\n if (side >= 0.5) {\n x = GageLib.math.getRandom(sceneWidth * 1.05, sceneWidth * 1.2);\n } else {\n x = GageLib.math.getRandom(-sceneWidth * 0.05, -sceneWidth * 0.2);\n }\n\n // Create it\n this.createEnemy(x, y, enemyType.name);\n }", "function createEnemy(){\n\tvar enemy = arrow();\n\tenemy.spawn();\n\tenemy_positions[enemy.ident] = {\n\t\t\t\t\tleft:pixel_count_extractor($('#'+enemy.ident).css('left')),\n\t\t\t\t\ttop:pixel_count_extractor($('#'+enemy.ident).css('top'))\n\t\t\t\t\t};\n\tif(spawn){\n\t\tif(difficulty===\"easy\"){\n\t\t\tsetTimeout(createEnemy,500);\n\t\t\tconsole.log('easy')\n\t\t}\n\t\telse if(difficulty===\"medium\"){\n\t\t\tsetTimeout(createEnemy,350)\n\t\t\tconsole.log('medium')\n\t\t}\n\t\telse{\n\t\t\tsetTimeout(createEnemy,170)\n\t\t\tconsole.log('hard')\n\t\t}\n\t}\n}", "update(dt){\n //set the point when the enemy is outside the screen\n if (this.x > 5) {\n this.offscreen = true;\n }\n\n\t\tvar random = Math.floor(Math.random() * 5);\n\n\t\t//replace the enemy\n\t\tif (this.offscreen) {\n\t\t\tthis.x = -random;\n this.offscreen = false;\n\t\t} else {\n\t\t\tthis.x += dt;\n\t\t}\n }", "move() {\n var dirx = Math.random() > 0.5 ? 1 : -1;\n var diry = Math.random() > 0.5 ? 1 : -1;\n var L = int((Math.random() * 20));\n var L2 = int((Math.random() * 20));\n this.endx = this.posx + (L * dirx);\n this.endy = this.posy + (L2 * diry);\n }", "function createEnemies(){\r\n enemy1 = new Enemy(42,20);\r\n enemy2 = new Enemy(96,20);\r\n enemy3 = new Enemy(150,20);\r\n enemy4 = new Enemy(204,20);\r\n enemy5 = new Enemy(258,20);\r\n enemy6 = new Enemy(312,20);\r\n enemy7 = new Enemy(366,20);\r\n enemy8 = new Enemy(420,20);\r\n enemy9 = new Enemy(474,20);\r\n enemy10 = new Enemy(528,20);\r\n\r\n enemy11 = new Enemy(42,70);\r\n enemy12 = new Enemy(96,70);\r\n enemy13 = new Enemy(150,70);\r\n enemy14 = new Enemy(204,70);\r\n enemy15 = new Enemy(258,70);\r\n enemy16 = new Enemy(312,70);\r\n enemy17 = new Enemy(366,70);\r\n enemy18 = new Enemy(420,70);\r\n enemy19 = new Enemy(474,70);\r\n enemy20 = new Enemy(528,70);\r\n\r\n enemy21 = new Enemy(42,120);\r\n enemy22 = new Enemy(96,120);\r\n enemy23 = new Enemy(150,120);\r\n enemy24 = new Enemy(204,120);\r\n enemy25 = new Enemy(258,120);\r\n enemy26 = new Enemy(312,120);\r\n enemy27 = new Enemy(366,120);\r\n enemy28 = new Enemy(420,120);\r\n enemy29 = new Enemy(474,120);\r\n enemy30 = new Enemy(528,120);\r\n\r\n lowestY = enemy21.y + enemyHeight;\r\n}", "addEnemy() {\n var enemySpots = (GAME_WIDTH / ENEMY_WIDTH); //added +1 here to increase the array slots + 1\n var enemySpot;\n // Keep looping until we find a free enemy spot at random\n while (this.enemies[enemySpot]) {\n enemySpot = Math.floor(Math.random() * enemySpots);\n }\n\n this.enemies[enemySpot] = new Enemy(enemySpot * ENEMY_WIDTH); // did a - enemy width to start at x=0 - ENEMY_WIDTH\n //console.log(enemySpot * ENEMY_WIDTH);\n }", "constructor(){\n this.x = random(0,width);\n this.y = random(0,height);\n this.r = random(1,8);\n this.xSpeed = random(-0.5,0.5);\n this.ySpeed = random(-0.1,0.1);\n }", "addNewEnemy2(){\n do{\n this.y = 100*Math.floor(Math.random() * 10) + 10;\n if(this.y <=20) this.y = 20; \n } while (this.y > 1300);\n this.opt = 0;\n this.opt = (Math.random() > 0.5 ? 0 : 1000);\n this.x = this.opt;\n var enemy=this.enemies.create(this.x,this.y,\"enemy1\");\n \n if(this.opt == 0){\n enemy.setVelocityX(100);\n enemy.setFrame(3);\n }\n else {\n enemy.setVelocityX(-100);\n enemy.setFrame(1);\n }\n \n enemy.setScale(0.4);\n enemy.checkWorldBounds = true;\n enemy.outOfBoundsKill = true;\n enemy.setVelocityY(0);\n \n }", "update(dt){\n // Multiplying any movement by the dt parameter\n // will ensure the game runs at the same speed for all computers.\n\n this.x += this.speed * dt;\n // if x is gerater than the length of the canvas, reset pos to -100\n if(this.x > canvasWidth){\n this.x = -100;\n //generate a random number for the speed\n let randomSpeed = Math.floor(Math.random() * topEnemySpeed);\n this.speed = 100 + randomSpeed;\n }\n }", "addNewEnemy(){\n do{\n this.x = 100*Math.floor(Math.random() * 10) + 10;\n if(this.x <=20) this.x = 20;\n } while (this.x > 1000); \n this.y = 0;\n var enemy=this.enemies.create(this.x,this.y,\"enemy1\");\n \n enemy.setFrame(2);\n enemy.setScale(0.4);\n enemy.checkWorldBounds = true;\n enemy.outOfBoundsKill = true;\n enemy.setVelocityY(100);\n }", "spawnAt(x,y){\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\tif(this.body && this.body.x !== undefined && this.body.y !== undefined){\n\t\t\tthis.body.x = x;\n\t\t\tthis.body.y = y;\n\t\t}else{\n\t\t\tconsole.error(\"BaseItem::spawnAt: the item has not a body to be drawed\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this;\n\t}", "update(dt){\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n if (this.x <=510) {\n this.x += this.movement * dt;\n }\n\n else if (this.x > 510){\n if (this.y === 50){\n enemy50 = new Enemy(-100,50,Math.floor(Math.random() * 400)+ 150);\n allEnemies.splice(0,1,enemy50);\n }\n else if (this.y === 140){\n enemy140 = new Enemy(-100,140,Math.floor(Math.random() * 400)+ 150);\n allEnemies.splice(1,1,enemy140);\n }\n else if (this.y === 220){\n enemy220 = new Enemy(-100,220,Math.floor(Math.random() * 400)+ 150);\n allEnemies.splice(2,1,enemy220);\n }\n }\n\n // Check if player collisions the enemies, if a collision happened the game will start again\n // If the enemies are in the same rectangle of player then collision happened\n if ((this.x>=player.x-50 && this.x<=player.x+50) && ( this.y===player.y || this.y===player.y+10)){\n start();\n }\n }", "spawn_enemies(dt){\n if(this.enemy_pos.length < this.maxSpawn)\n {\n if(this.spawnTime >= this.spawnRate)\n {\n var angleOffset = Math.random()* 2* Math.PI;\n this.spawnAngle =angleOffset;\n let rand_index = Math.ceil(Math.random() * Math.floor(4));\n var new_pos = [this.spawnDistance, this.spawnAngle, this.spawnHeight, rand_index];\n this.enemy_pos.push(new_pos);\n this.spawnTime=0;\n }\n else\n {\n this.spawnTime+=dt;\n }\n \n \n }\n this.maxSpawn = Math.floor(this.score/30) + 15;\n this.spawnRate = Math.max(0.5, 2.0 - Math.floor(this.score/50)/6 );\n }", "update() {\n if (this.y > gameCanvas.canvasHeight * 2/3) {\n this.y = gameCanvas.canvasHeight * 2/3;\n }\n if (this.x > gameCanvas.canvasWidth * 4/5) {\n this.x = gameCanvas.canvasWidth * 4/5;\n }\n if (this.x < 0) {\n this.x = 0;\n }\n else if (this.y < 0) {\n this.x = (Math.floor(Math.random() * 5) *100);\n this.y = gameCanvas.canvasHeight * 4/5;\n }\n }", "function positionEntityRandomly(entity) {\n\n entity.x = generateRandomNumber(0, WIDTH);\n entity.y = generateRandomNumber(0, HEIGHT);\n\n }", "function spawnNewEnemy() {\n let newEnemy = new Enemy(random(0, width), random(0, cockpitVerticalMask), width * .30 / 100, 1);\n //put the new enemy at the beginning of the array(unshift), so it will be displayed behind oldest enemies\n enemies.unshift(newEnemy);\n}", "teleportToInitialPosition() {\n let coords = game.calculateCoordinatesByPosition(this.row, this.column);\n this.x = coords[0];\n this.y = coords[1];\n if (this.elem.style.display === \"none\") {\n this.elem.style.display = \"inline\";\n }\n if (!this.collisionable)\n this.collisionable = true;\n }", "generateEntities(player,bulk,x,y,path,speed) {\n if (player) { // generating single players\n return new Player(x,y,path,speed);\n }\n else {\n if (bulk) { // generating multiple enemies\n var val = 1;\n /*reassigning this as the reference is\n lost within functions*/\n var engine=this;\n /*\n Regulates the range of enemy generation\n to control unplayable number of enemies on\n screen\n */\n var range = buildRandomSequence(250,500,500)[0];\n this.generate = setInterval(function() {\n if (val===1) {\n var enemy1 = new Enemy(engine.canvas[0].width,250,\"img/images/enemy-bug-rev.png\",10);\n }\n if (val===2) {\n var enemy2 = new Enemy(0,330,\"img/images/enemy-bug.png\",10);\n }\n if (val===3) {\n var enemy3 = new Enemy(engine.canvas[0].width,410,\"img/images/enemy-bug-rev.png\",10);\n }\n val = shuffleArray(buildRandomSequence(1,4,3))[0];\n },range);\n }\n else { // generating single enemy\n var enemy = new Enemy(x,y,path,speed);\n }\n }\n }", "reset() {\n // x and y is the position of the enemy on the board, and parametrizes the centre of the\n // corresponding sprite.\n this.x = boardWidth / 2;\n this.y = spriteHeight / 2 + 4.5 * tileHeight;\n this.sprite = this.sprites[Math.floor(sampleInRange(0, 5))];\n }", "move()\n {\n if (abs(this.xPos - this.xDest) < 100)\n {\n this.xDest = random(10, width - 10);\n }\n let xDist = this.xDest - this.xPos;\n this.xPos += this.speed * xDist;\n }", "function initEnemy() {\n var enemyCoordinate =[];\n switch (levelNow) {\n case 0 :\n enemies = [\n createEnemy.shotingOn(520, 160),\n createEnemy.shotingOn(1400, 80),\n createEnemy.shotingOn(1966, 416),\n createEnemy.shotingOn(2170, 148),\n createEnemy.shotingOn(3040, 416),\n createEnemy.shotingOn(3400, 416),\n createEnemy.shotingOn(3760, 288),\n createEnemy.shotingOn(3805, 48),\n\n createEnemy.simpleOn(842, 416).thatMovesOn(760, 908),\n createEnemy.simpleOn(1550, 416).thatMovesOn(1400, 1730),\n createEnemy.simpleOn(1750, 416).thatMovesOn(1700, 1950),\n createEnemy.simpleOn(2370, 148).thatMovesOn(2150, 2450),\n createEnemy.simpleOn(3250, 416).thatMovesOn(3100, 3350),\n createEnemy.heavyOn(3550, 416).thatMovesOn(3400, 3650).withHelmet(),\n\n createEnemy.simpleOn(3940, 416).thatMovesOn(3860, 4085),\n createEnemy.heavyOn(3880, 416).thatMovesOn(3860, 4085).withHelmet(),\n createEnemy.heavyOn(4040, 416).thatMovesOn(3860, 4085).withHelmet(),\n ];\n break;\n case 1: enemies =[\n createEnemy.heavyOn(425, 160).thatMovesOn(250, 560).withHelmet(),\n\n createEnemy.shotingOn(900, 160),\n createEnemy.heavyOn(900, 160).thatMovesOn(800, 960).withShield(),\n\n createEnemy.heavyOn(1480, 160).thatMovesOn(1390, 1580).withHelmet(),\n\n createEnemy.shotingOn(2290, 160),\n\n createEnemy.shotingOn(2800, 160),\n createEnemy.shotingOn(2900, 160),\n createEnemy.heavyOn(2900, 160).thatMovesOn(2600, 3000).withFullArmor(),\n createEnemy.heavyOn(2700, 160).thatMovesOn(2600, 3000).withFullArmor(),\n \n\n createEnemy.heavyOn(2580, 417).thatMovesOn(2550, 2666).withShield(),\n createEnemy.heavyOn(2650, 417).thatMovesOn(2550, 2666).withShield(),\n\n \n createEnemy.heavyOn(3600, 160).thatMovesOn(3550, 4070).withFullArmor(),\n createEnemy.shotingOn(3550, 160),\n createEnemy.heavyOn(3700, 160).thatMovesOn(3550, 4070).withFullArmor(),\n createEnemy.shotingOn(3750, 160),\n createEnemy.heavyOn(3800, 160).thatMovesOn(3550, 4070).withFullArmor(),\n createEnemy.shotingOn(3850, 160),\n\n\n createEnemy.shotingOn(3165, 305),\n\n createEnemy.simpleOn(425, 417).thatMovesOn(250, 560),\n\n createEnemy.simpleOn(966, 417).thatMovesOn(809, 1100),\n\n createEnemy.heavyOn(850, 417).thatMovesOn(809, 1100).withHelmet(),\n\n createEnemy.heavyOn(1070, 417).thatMovesOn(1000, 1100).withHelmet(),\n createEnemy.heavyOn(1995, 417).thatMovesOn(1930, 2040).withHelmet(),\n \n createEnemy.shotingOn(1500, 417),\n createEnemy.shotingOn(1600, 417),\n createEnemy.shotingOn(1700, 417),\n\n\n createEnemy.simpleOn(2950, 417).thatMovesOn(2920, 3160),\n createEnemy.heavyOn(3000, 417).thatMovesOn(2920, 3160).withHelmet(),\n createEnemy.heavyOn(3050, 417).thatMovesOn(2920, 3160).withShield(),\n createEnemy.heavyOn(3100, 417).thatMovesOn(2920, 3160).withFullArmor(),\n\n\n\n ]; break;\n case 2: enemies =[\n createEnemy.shotingOn(525, 320),\n createEnemy.shotingOn(405, 145),\n createEnemy.shotingOn(1920, 145),\n createEnemy.shotingOn(3160, 145),\n\n\n createEnemy.flyingOn(871, 73).thatMovesHorizontalOn(771, 971),\n createEnemy.flyingOn(1616, 325).thatMovesHorizontalOn(1516, 1716),\n createEnemy.flyingOn(2215, 83).thatMovesHorizontalOn(2115, 2315),\n createEnemy.flyingOn(2265, 338).thatMovesHorizontalOn(2115, 2365),\n createEnemy.flyingOn(3800, 100).thatMovesHorizontalOn(3700, 3900),\n createEnemy.flyingOn(1155, 255).thatMovesVerticalOn(155, 355),\n createEnemy.flyingOn(2665, 340).thatMovesVerticalOn(240, 440),\n\n createEnemy.heavyOn(2140, 417).thatMovesOn(2036, 2240).withFullArmor(),\n createEnemy.heavyOn(2040, 417).thatMovesOn(2036, 2240).withFullArmor(),\n\n createEnemy.simpleOn(3000, 417).thatMovesOn(2941, 3100),\n createEnemy.heavyOn(3100, 417).thatMovesOn(2941, 3200).withHelmet(),\n createEnemy.heavyOn(3200, 417).thatMovesOn(3100, 3300).withShield(),\n createEnemy.heavyOn(3300, 417).thatMovesOn(3200, 3400).withFullArmor(),\n createEnemy.heavyOn(3500, 417).thatMovesOn(3400, 3700).withShield(),\n createEnemy.heavyOn(3650, 417).thatMovesOn(3500, 3800).withFullArmor(),\n createEnemy.shotingOn(3400, 417),\n createEnemy.shotingOn(3700, 417),\n \n ]; break;\n default:\n boss = new BossMed(384, 210);\n }\n\n enemies\n \n}", "update (dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n this.x += this.speed * dt;\n // relocate enemies at the start when they cross the board\n if (this.x >= 505) {\n this.x = -60;\n // set random speed for each enemy. It gets faster as the player earns points (lives) in the game.\n if (gameLevel == 1) {\n this.speed = Math.floor( (Math.random() * 250) + 150 );\n }\n if (gameLevel == 2) {\n this.speed = Math.floor( (Math.random() * 350) + 200 );\n }\n if (gameLevel == 3) {\n this.speed = Math.floor( (Math.random() * 350) + 250 );\n }\n if (gameLevel == 4) {\n this.speed = Math.floor( (Math.random() * 450) + 300 );\n }\n }\n this.checkForCollision();\n }", "function createEnemy(x, y)\n{\t\n\tvar enemy = enemies.create(x, y, 'enemy');\n\tenemy.animations.add('left', [0, 1, 2, 3, 4, 5], 10, true);\n\tenemy.animations.add('right', [6, 7, 8, 9, 10, 11], 10, true);\n\tenemy.animations.add('stunLeft', [12, 13, 12, 13, 12, 13], 10, true);\n\tenemy.animations.add('stunRight', [14, 15, 14, 15, 14, 15], 10, true);\n\tgame.physics.arcade.enable(enemy);\n\n\t//enemy can't go off world bounds\n\tenemy.body.collideWorldBounds = true;\n\n\tenemy.body.gravity.y = 350;\n\tenemy.direction = game.rnd.integerInRange(0,1) * 2 - 1;\n\t\n\tif(enemy.direction > 0){\n\t\tenemy.animations.play('right');\n\t}\n\telse{\n\t\tenemy.animations.play('left');\n\t}\n\n\tenemy.isStunned = false;\n\tenemy.stunnedTime = 5000;\n\tenemy.spawnTime = 7500;\n\n\t//set animations\n\t\n}", "function createEnemies() {\n //\n // Create 10 enemies at varying velocities and\n // positions\n //\n for (var i = 1; i < 11; i++) {\n\tvar newEnemy = new Enemy();\n\t//newEnemy.x = getRandomInt(0,ctx.canvas.width - \n\tnewEnemy.x = getRandomInt(0,505 - \n\t newEnemy.width);\n\t// Center enemy on stone tile.\n\tnewEnemy.y = canvasOffset + getRandomInt(1,4)*tileHeight\n\t + 5;\n\tnewEnemy.velocity_x = getRandomInt(20,50);\n\tallEnemies.push(newEnemy);\n }\n}", "function addEnemy() { \n // Variables to store the X position of the spawn object\n // See image below\n var x1 = transform.position.x - GetComponent.<Renderer>().bounds.size.x/2;\n var x2 = transform.position.x + GetComponent.<Renderer>().bounds.size.x/2;\n\n // Randomly pick a point within the spawn object\n var spawnPoint = new Vector2(Random.Range(x1, x2), transform.position.y);\n\tInstantiate(enemy, spawnPoint, Quaternion.identity);\n // Create an enemy at the 'spawnPoint' position\n if (end_game) {\n \t\tCancelInvoke(\"addEnemy\");\n \t}\n}", "update() {\n this.pos1 = Math.floor(this.y);\n this.pos2 = Math.floor(this.x);\n this.speed = mappedImage[this.pos1][this.pos2].cellBrightness;\n let movement = 2.5 - this.speed + this.velocity;\n // console.log(this.speed);\n this.y += movement;\n\n // Give it a random position and check if it has reached the end of the canvas.\n this.y += this.velocity;\n if (this.y >= canvas.height) {\n this.y = 0;\n this.x = Math.random() * canvas.width;\n }\n }", "function assignNewPosition() {\n\tvar pos = {};\n\tdo {\n\t\tpos.x = Math.floor(Math.random() * gridW);\n\t\tpos.y = Math.floor(Math.random() * gridH);\n\t} while (filledPositions[pos.x][pos.y]);\n\t\n\tfilledPositions[pos.x][pos.y] = true;\n\t\n\tpos.x=pos.x*40+30+Math.floor(Math.random()*26-13);\n\tpos.y=pos.y*40+30+Math.floor(Math.random()*26-13);\n\t\n\treturn pos;\n}", "function randomSpawnLocation(width, height, tileSize) {\n\n let xPos;\n let yPos;\n \n // Breaking the entire canvas into a grid of tiles.\n let rows = width / tileSize;\n let cols = height / tileSize;\n\n xPos = Math.floor(Math.random() * rows) * tileSize;\n yPos = Math.floor(Math.random() * 0.5*cols) * tileSize;\n\n return { x: xPos, y: yPos };\n\n}", "update(dt){\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n this.x += this.speed * dt;\n\n //Updates the Enemy location (you need to implement)\n if(this.x > gameCanvas.canvasWidth){\n this.x =-100;\n this.speed= (Math.floor(Math.random() * 200) + 50);\n }\n\n //Handles collision with the Player (you need to implement)\n if ((player.x + 80 > this.x) && (player.x < this.x + 80) &&\n (player.y + 60 > this.y) && (player.y < this.y + 60)\n ){\n player.x = Math.floor(Math.random() * 5)*100;\n player.y = 400;\n };\n }", "placeObjective() {\n if (this.team === 1) {\n this.x = 14;\n this.y = 1;\n } else if (this.team === 2) {\n this.x = 14;\n this.y = 37;\n }\n }", "setRandomSpawnPoint() {\n // leer\n }", "function EnemyMech(x, y) {\n //default value for the sprite key\n this.spriteName = 'enemyMech';\n //storage for the sprite\n this.sprite = null;\n //score 'bounty'\n this.score = 100;\n //grid x position\n this.x = x;\n //grid y position\n this.y = y;\n //pixel x location\n this.truex = hexGrid.hexTiles[x][y].truex;\n //pixel y location\n this.truey = hexGrid.hexTiles[x][y].truey;\n //team it belongs to\n this.team = teams.enemy;\n //range of weapons\n this.range = 3;\n //health of enemy\n this.health = 2;\n //array to store health tiles\n this.healthSprites = [];\n //bool if action is taken\n this.exhausted = false;\n //called each enemy turn\n this.routine = function () {\n //move randomly to a valid adjacent tile\n EnemyMove(this);\n //shoot a player in range\n EnemyShoot(this);\n }\n this.clickEvent = function() {\n \n }\n //called when sprite is first drawn\n this.draw = function() {\n this.sprite = game.add.sprite(this.truex, this.truey, this.spriteName);\n this.sprite.anchor.setTo(0.5);\n this.sprite.scale.setTo(MECHSCALE);\n this.drawHealth();\n }\n //draws the health tiles\n this.drawHealth = function() {\n for (i=0; i < this.healthSprites.length; i++) {\n this.healthSprites[i].destroy();\n }\n this.healthSprites = [];\n for (i=0; i < this.health; i++) {\n var spriteWidth = 8;\n var healthSprite = game.add.sprite(this.truex + (spriteWidth * i) - (this.health * (spriteWidth / 2)) + spriteWidth / 2, this.truey - 30, 'health');\n healthSprite.anchor.setTo(0.5);\n healthSprite.scale.setTo(HEALTHSCALE);\n this.healthSprites.push(healthSprite);\n }\n }\n //function to move the unit to a position\n this.changePosition = function(x, y) {\n var oldx = this.x;\n var oldy = this.y;\n this.x = x;\n this.y = y;\n this.truex = hexGrid.hexTiles[x][y].truex;\n this.truey = hexGrid.hexTiles[x][y].truey;\n this.sprite.x = this.truex;\n this.sprite.y = this.truey;\n hexGrid.hexTiles[x][y].mech = this;\n hexGrid.hexTiles[oldx][oldy].mech = null;\n this.drawHealth();\n }\n ///called when mech is destroyed\n this.destroy = function() {\n score.addScore(this.score);\n this.sprite.destroy();\n for (i=0; i < this.healthSprites.length; i++) {\n this.healthSprites[i].destroy();\n }\n hexGrid.hexTiles[this.x][this.y].mech = null;\n remove(enemies, this);\n }\n //assigns itself to the mech field of the tile it is on\n hexGrid.hexTiles[x][y].mech = this;\n //adds itself to the active enemy array\n enemies.push(this);\n}", "function randomEnemy() {\n var row = getRandomIntInclusive(2, 4);\n var speed = getRandomIntInclusive(50, 500);\n allEnemies.push(new Enemy(0, row, speed));\n}", "function render() {\n enemyLaunchTimer = game.time.events.add(game.rnd.integerInRange(min_enemy_spacing, max_enemy_spacing), enemyLaunchTimer);\n }", "generateEnemies() {\n for (let i = 0; i < gameData.level.enemies.length; i++) {\n const enemy = gameData.level.enemies[i];\n enemy.spawnTime = gameData.level.spawnRate * (i + 1) + (enemy.wave * 600)\n enemy.gameObject = this.add.sprite(0, 0, enemy.type)\n enemy.gameObject.originalIndex = i\n enemy.gameObject.health = enemy.health\n enemy.gameObject.currencyValue = enemy.currencyValue\n enemy.gameObject.anchor.set(1, 1)\n gameState.spawnableEnemies.push(enemy)\n }\n }", "function spawnEnemy() {\n if (levelCount == 1) {\n enemyTimer = setInterval(() => {\n const radius = Math.random() * 100 + 55;\n let x;\n let y;\n if (Math.random() < 0.5) {\n x = Math.random() < 0.5 ? 0 - radius * Math.PI : canvas.width + radius * Math.PI;\n y = Math.random() * canvas.height;\n } else {\n x = Math.random() * canvas.width;\n y = Math.random() < 0.5 ? 0 - radius * Math.PI : canvas.height + radius * Math.PI;\n }\n\n const angle = Math.atan2(center.y - y, center.x - x);\n const speed = {\n x: Math.cos(angle),\n y: Math.sin(angle)\n };\n\n\n enemies.push(new Enemy(x, y, radius, speed));\n }, 2000);\n } else if (levelCount == 2) {\n enemyTimer = setInterval(() => {\n const radius = Math.random() * 100 + 55;\n let x;\n let y;\n if (Math.random() < 0.5) {\n x = Math.random() < 0.5 ? 0 - radius * Math.PI : canvas.width + radius * Math.PI;\n y = Math.random() * canvas.height;\n } else {\n x = Math.random() * canvas.width;\n y = Math.random() < 0.5 ? 0 - radius * Math.PI : canvas.height + radius * Math.PI;\n }\n\n const angle = Math.atan2(center.y - y, center.x - x);\n const speed = {\n x: Math.cos(angle),\n y: Math.sin(angle)\n };\n\n\n enemies.push(new Enemy(x, y, radius, speed));\n }, 1000);\n }\n}", "update (dt) {\n this.x += this.speed * dt;\n this.position = [[this.x - 40, this.x + 40], [this.y - 15, this.y + 15]];\n\n /* when enemys move off canvas, this resets their position and speed ta random number */\n if (this.x > 550) {\n this.x = -100;\n this.speed = 150 + (gameVar.speedOfGame * (Math.floor(Math.random() * 300)));\n this.y = [65, 145, 225][Math.floor(Math.random() * 3)]\n }\n }", "place() { \n\n //decides the random direction of the spot\n var randomDirection = floor(random(0,4));\n\n //alter this placement & direction based on the direction\n if(randomDirection === 0) { //east\n this.x = 0;\n this.y = (floor(random(0,3)) * (platformSize + 10) + HEIGHT/2 - movement);\n this.direction = 0;\n } else if(randomDirection === 1) { //west\n this.x = WIDTH;\n this.y = (floor(random(0,3)) * (platformSize + 10) + HEIGHT/2 - movement);\n this.direction = 1;\n } else if(randomDirection === 2) { //south\n this.x = (floor(random(0,3)) * (platformSize + 10) + WIDTH/2 - movement);\n this.y = 0;\n this.direction = 2;\n } else if(randomDirection === 3) { //north\n this.x = (floor(random(0,3)) * (platformSize + 10) + WIDTH/2 - movement);\n this.y = HEIGHT;\n this.direction = 3;\n }\n }", "move() {\n // Set velocity via noise()\n this.vx = map(noise(this.tx), 0, 1, -this.speed, this.speed);\n this.vy = map(noise(this.ty), 0, 1, -this.speed, this.speed);\n\n if (this.x + this.vx < 0 + this.size / 2 || this.x + this.vx > width - this.size / 2) {\n this.vx = -this.vx;\n }\n\n if (this.y + this.vy < 0 + this.size || this.y + this.vy > cockpitVerticalMask - this.size) {\n //this.speed = -this.speed;\n this.vy = -this.vy;\n }\n\n // Update position\n this.x += this.vx;\n this.y += this.vy;\n // Update time properties\n this.tx += 0.01;\n this.ty += 0.01;\n //increases enemy's size every frame,\n this.size += this.speed / 10;\n //constrain enemies on screen\n this.x = constrain(this.x, 0, width);\n this.y = constrain(this.y, 0, height * 75 / 100);\n }", "function createGrid(startingPosition) {\n for (let i = 0; i < cellCount; i++) {\n const cell = document.createElement('div')\n grid.appendChild(cell)\n cells.push(cell)\n }\n \n playerPosition = 487\n cells[playerPosition].classList.add('sprite')\n enemyA.position = 337\n cells[enemyA.position].classList.add('enemy1')\n enemyB.position = 335\n cells[enemyB.position].classList.add('enemy2')\n enemyC.position = 339\n cells[enemyC.position].classList.add('enemy3')\n enemyD.position = 338\n cells[enemyD.position].classList.add('enemy4')\n }", "step(){\n\t\tvar min_distance_player = null;\n\t\tvar min_distance = Infinity;\n\t\tfor (let playerid in this.stage.players){\n\t\t\tlet distance = (this.stage.players[playerid].x - this.x)**2 + (this.stage.players[playerid].y - this.y)**2;\n\t\t\tif (distance < min_distance){\n\t\t\t\tmin_distance = distance;\n\t\t\t\tmin_distance_player = this.stage.players[playerid];\n\t\t\t}\n\t\t}\n\n\t\tif (min_distance_player === null){ // there is no player so the enemy moves randomly\n\t\t\tvar random_value = Math.random();\n\t\t\tif (random_value < 0.2){\n\t\t\t\tthis.velocity = new Pair(this.speed,0);\n\t\t\t} else if (random_value >= 0.2 && random_value< 0.4){\n\t\t\t\tthis.velocity = new Pair(-this.speed,0);\n\t\t\t} else if (random_value >= 0.4 && random_value < 0.6){\n\t\t\t\tthis.velocity = new Pair(0,0);\n\t\t\t} else if (random_value >= 0.6 && random_value < 0.8){\n\t\t\t\tthis.velocity = new Pair(0,this.speed);\n\t\t\t} else{\n\t\t\t\tthis.velocity = new Pair(0,-this.speed);\n\t\t\t} \n\t\n\t\t\tsuper.step(); // move the enemy and check if it overlaps with anything\n\t\t\treturn;\n\t\t}\n\n\t\tvar x_distance = this.x - min_distance_player.x;\n\t\tvar y_distance = this.y - min_distance_player.y;\n\n\t\t// check which direction the enemy should go since enemy should always move towards the player\n\t\tvar x_velocity = 0;\n\t\tvar y_velocity = 0;\n\t\t// assign the velocity so the enemy can move to the player\n\t\tif (y_distance > 0){ // enemy is below the player\n\t\t\ty_velocity = -this.speed;\n\t\t} else if (y_distance < 0){ // enemy is above the player\n\t\t\ty_velocity = this.speed;\n\t\t}\n\t\tif (x_distance > 0){ // enemy is to the right of the player\n\t\t\tx_velocity = -this.speed;\n\t\t} else if (x_distance < 0){ // enemy is to the left of the player\n\t\t\tx_velocity = this.speed;\n\t\t}\n\t\tthis.velocity = new Pair(x_velocity,y_velocity);\n\n\t\tsuper.step(); // move the enemy and check if it overlaps with anything\n\n\t\tif (this.cooldown_remaining <= 0){\n\t\t\t// the cooldown has finished so the enemy should fire towards player\n\t\t\tsuper.fire(min_distance_player.x, min_distance_player.y);\n\t\t\tthis.cooldown_remaining = this.cooldown; // reset the cooldown so the enemy can fire again later\n\t\t} else{\n\t\t\t// the cooldown hasn't finished yet\n\t\t\tthis.cooldown_remaining -= 1;\n\t\t}\n\t}", "respawn(){\n this.x = random(this.minX + this.width/2, this.maxX - this.width/2);\n this.y = random(this.minY + this.height/2, this.maxY - this.height/2);\n }", "constructor(x, y, speed) {\n super();\n this.sprite += 'enemy-bug.png';\n this.x = x;\n this.y = y;\n this.speed = speed;\n }", "drip() {\n this.y += this.fallSpeed;\n if (this.y > height) {\n this.y = 0;\n this.x = random(width);\n }\n }", "start() {\n this.moveDelta = 0;\n this.dead = false;\n this.spawnPosition = this.node.position2D;\n this.node.roll(180);\n this.node.scale2D = [0.65, 0.65];\n\n this.dir = (Math.random() > 0.5);\n\n this.subscribeToEvent('onEnemyHit', this.onHit);\n }", "moveSprite() {\r\n // Each frame minuses the z position based on speed\r\n this.z = this.z - speed / 2;\r\n // If object reaches the top of canvas z index (0) this resets z value to the very back of canvas\r\n if (this.z <= 0) {\r\n this.z = cnvsWidth;\r\n // Enables Sprite to travel towards player ship initial start position to prevent bug\r\n if (Math.random() < 0.02) {\r\n this.randomX = 0;\r\n this.randomY = 9;\r\n } else {\r\n // Ensures positions stay random each time a new array object is instanciated\r\n this.randomX = notZeroRange(-10, 10);\r\n this.randomY = notZeroRange(-10, 10);\r\n }\r\n }\r\n }", "function setupEnemy (enemy) {\n\t\n\t\tenemy.anchor.x = 0.5;\n\t\tenemy.anchor.y = 0.5;\n\t\tenemy.animations.add('explosion');\n\t}", "constructor(speed, rowOnAsset, row, col, pointsWhenKilled = 15, dim_x = 16, dim_y = 16) {\n\t\t//which y position on asset png is player/monster\n\t\tthis.idle = false; //is character currently moving?\n\n\t\tthis.moveSpeed = speed; // movespeed is the value to modify\n\t\t// speed is the calculated value from movespeed to make character move in the correct speed\n\t\tthis.speed = Math.round((6.66666666667 * GAME_SPEED) / this.moveSpeed);\n\n\t\tthis.pointsWhenKilled = pointsWhenKilled; //how many points does a player get when he kills this character\n\n\t\tthis.position = {\n\t\t\trow: row, //row on matrix (number of rows equals number of vertical tiles)\n\t\t\tcol: col,\n\t\t\tpix_x: col * tileSize, //current position in pixel on canvas. later, this is used to calc the offset\n\t\t\tpix_y: row * tileSize,\n\t\t};\n\n\t\tthis.direction = new Array(5); //up, down, right\n\n\t\t//up\n\t\tthis.direction[0] = new Array(3);\n\t\tthis.direction[0][0] = new AnimationFrame(0, rowOnAsset, dim_x, dim_y); //idle\n\t\tthis.direction[0][1] = new AnimationFrame(8 * dim_x, rowOnAsset, dim_x, dim_y); //animation up #1\n\t\tthis.direction[0][2] = new AnimationFrame(9 * dim_x, rowOnAsset, dim_x, dim_y); //animation up #\n\n\t\t//down\n\t\tthis.direction[1] = new Array(3);\n\t\tthis.direction[1][0] = new AnimationFrame(1 * dim_x, rowOnAsset, dim_x, dim_y); //idle\n\t\tthis.direction[1][1] = new AnimationFrame(2 * dim_x, rowOnAsset, dim_x, dim_y); //animation down #1\n\t\tthis.direction[1][2] = new AnimationFrame(3 * dim_x, rowOnAsset, dim_x, dim_y); //animation down #2\n\n\t\t//right\n\t\tthis.direction[2] = new Array(4);\n\t\tthis.direction[2][0] = new AnimationFrame(4 * dim_x, rowOnAsset, dim_x, dim_y); //idle\n\t\tthis.direction[2][1] = new AnimationFrame(5 * dim_x, rowOnAsset, dim_x, dim_y); //animation right #1\n\t\tthis.direction[2][2] = new AnimationFrame(6 * dim_x, rowOnAsset, dim_x, dim_y); //animation right #2\n\t\tthis.direction[2][3] = new AnimationFrame(7 * dim_x, rowOnAsset, dim_x, dim_y); //animation right #3\n\n\t\t//left\n\t\tthis.direction[3] = new Array(4);\n\t\tthis.direction[3][0] = new AnimationFrame(10 * dim_x, rowOnAsset, dim_x, dim_y); //idle\n\t\tthis.direction[3][1] = new AnimationFrame(11 * dim_x, rowOnAsset, dim_x, dim_y); //animation left #1\n\t\tthis.direction[3][2] = new AnimationFrame(12 * dim_x, rowOnAsset, dim_x, dim_y); //animation left #2\n\t\tthis.direction[3][3] = new AnimationFrame(13 * dim_x, rowOnAsset, dim_x, dim_y); //animation left #3\n\n\t\t// empty tile, for if a player has died, but the game still goes on\n\t\tthis.direction[4] = new Array(1);\n\t\tthis.direction[4][0] = new AnimationFrame(1 * dim_x, 18 * 16, dim_x, dim_y);\n\n\t\tthis.last_direction = DIRECTION.UP; //up per default\n\t\tthis.tick = 0; //used for calculating wich animation is displayed\n\t\tthis.frame_cnt = -1; //used for calculation of pixel offset when moving\n\n\t}", "move() {\n let r = random(0, 1);\n if (r < this.jitteriness) {\n this.vx = random(-this.speed, this.speed);\n this.vy = random(-this.speed, this.speed);\n }\n\n this.x = this.x + this.vx;\n this.y = this.y + this.vy;\n\n this.x = constrain(this.x, 0, width);\n this.y = constrain(this.y, height/5, height);\n }", "constructor(x,y,speed) {\n this.x = x;\n this.y = y;\n this.speed = speed;\n this.sprite = 'images/enemy-bug.png';\n }", "function randomObjectsPosition(){\n scope.css3dObjects.forEach(function(obj){\n if(!obj)return;\n var x=(random()*2-1)*scope.screenInfo.zoneWidth;\n var y=(random()*2-1)*scope.screenInfo.zoneHeight;\n if(x>scope.screenInfo.zoneWidth/2)x+=scope.screenInfo.zoneWidth;\n if(x<scope.screenInfo.zoneWidth/2)x-=scope.screenInfo.zoneWidth;\n if(y>scope.screenInfo.zoneHeight/2)y+=scope.screenInfo.zoneHeight;\n if(y<scope.screenInfo.zoneHeight/2)y-=scope.screenInfo.zoneHeight;\n obj.position.x=x;\n obj.position.y=y;\n });\n }", "resetEnemy() {\n this.x = this.setPropertyX(6, 1, globals.stepX);\n this.y = this.setPropertyY(1, 4, globals.stepY);\n this.speed = this.setPropertySpeed(100, 500);\n }", "function randomlyPlace( obj ) {\n var i = Math.floor( Math.random() * gridSize );\n var j = Math.floor( Math.random() * gridSize );\n\n //if we picked an unwalkable/occupied cell, reroll\n while( grid[i][j].walkable == false || grid[i][j].occupiedBy != null ) {\n var i = Math.floor( Math.random() * gridSize );\n var j = Math.floor( Math.random() * gridSize );\n }\n\n grid[i][j].occupiedBy = obj;\n obj.x = grid[i][j].x;\n obj.y = grid[i][j].y;\n obj.i = i;\n obj.j = j;\n}", "function CreateNewFastEnemy(intBaseYPosition)\n{\n let enemy = new Enemy(objEnemy2Sprite, intBaseYPosition, 1, 5, 50);\n //Add it to the game objects array\n arr_enemyObjects.push(enemy);\n}", "constructor() {\n this.x = random(0, width);\n this.y = random(0, height);\n this.r = 10;\n this.xSpeed = random(-2, 2);\n this.ySpeed = random(-2, 2);\n }", "update(dt) {\n if (this.x < 505) {//it checks that enemies should not move outside\n this.x += this.speed * dt; // speed muliply by delta time\n }\n else {//this resets enemy's location to -101(initial)\n this.x = -101;\n }\n }", "function setEnemiesPosition(area,enemies,shiftY){\r\n\tlet count=enemies.length;\r\n\tlet startX=area.canvas.width;\t\r\n\tlet startY=(area.canvas.height/2+shiftY/2)-(enemies[0].height+shiftY)*count/2;\r\n\t\r\n\tfor(let i=0;i<count;i++){\r\n\t\tenemies[i].x=startX;\r\n\t\tenemies[i].y=startY+(enemies[i].height+shiftY)*i;\r\n\t\tenemies[i].angle=180;\r\n\t\tenemies[i].updatePath();\r\n\t}\t\r\n}" ]
[ "0.782654", "0.7731306", "0.75026274", "0.74053746", "0.73715824", "0.73372144", "0.7180224", "0.7119952", "0.70719016", "0.7048314", "0.7031732", "0.6995857", "0.69722766", "0.694108", "0.693902", "0.6909294", "0.6909294", "0.6904129", "0.6901393", "0.6895686", "0.688524", "0.6877818", "0.6868195", "0.68407583", "0.68178654", "0.68087125", "0.6808069", "0.67772996", "0.6768653", "0.6753488", "0.67502403", "0.674332", "0.674274", "0.6732733", "0.67183024", "0.6716514", "0.6716226", "0.67145663", "0.67031354", "0.6700958", "0.6695519", "0.6673218", "0.6669737", "0.66612506", "0.66590947", "0.6646007", "0.6644357", "0.6633527", "0.6618346", "0.6617497", "0.66162694", "0.66124547", "0.66103834", "0.6599227", "0.6591435", "0.6572719", "0.6570057", "0.65598744", "0.6554015", "0.65516", "0.65415686", "0.6536854", "0.65206194", "0.6520592", "0.65165293", "0.650796", "0.64974254", "0.6497208", "0.64935184", "0.64905864", "0.64867777", "0.6486328", "0.64803946", "0.6470692", "0.6467994", "0.6465693", "0.6464582", "0.64639246", "0.64633244", "0.64527845", "0.64456415", "0.6443235", "0.6442504", "0.64421946", "0.6441029", "0.6422381", "0.64208794", "0.6420863", "0.64160657", "0.64127827", "0.64119107", "0.6411831", "0.64102453", "0.6401049", "0.64005923", "0.63982564", "0.63906395", "0.6389479", "0.6389221", "0.6385996" ]
0.71820265
6
draw the enemy on the screen
render(){ ctx.drawImage(Resources.get(this.sprite), this.x, this.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawEnemy(EnemyX,EnemyY){\n image(Enemy,EnemyX,EnemyY,50,50);\n}", "draw() {\n ctx.fillStyle = this.color\n ctx.shadowColor = this.color\n ctx.shadowBlur = 30\n ctx.fillRect(this.pos.x, this.pos.y, this.size.w, this.size.h)\n\n if (this.color === this.hitColor) {\n setTimeout(() => {\n this.color = this.defaultColor // sets the color of the enemy to normal after 100 ms\n }, 100)\n }\n\n ctx.closePath()\n }", "draw() {\n this.drawExistingEntities();\n this.disableEntities();\n this.blockHeroMovement();\n this.killedEnemiesCounter();\n }", "function draw() {\n if (isRunning) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n const enemyStyle = '#ff0000';\n drawRect(randomEnemyX, dy, 50, enemyHeight, enemyStyle);\n drawPlayer();\n\n if ((playerX == randomEnemyX)\n && (dy >= canvas.height - playerHeight - enemyHeight)) {\n gameOver();\n }\n\n if (dy <= canvas.height) {\n dy = dy + 1;\n } else {\n marcaPonto(1);\n drawScore();\n\n if (score % 4 == 0) {\n changeControls();\n }\n\n dy = 1;\n randomEnemyX = getEnemyX();\n }\n}\n}", "function drawScreen() {\n clearScreen()\n updateEnemyPosition()\n checkforCollisions()\n winningCollision()\n drawCharacter()\n}", "draw() {\n if (this.waves.lives == 0) {\n this.ctx.fillStyle = colours.flat_davys_grey;\n this.ctx.fillRect(0, 0, this.size.x, this.size.y);\n this.ctx.fillStyle = colours.flat_electric_blue;\n this.ctx.font = (this.wallSize) + 'px \"Press Start 2P\"';\n this.ctx.fillText('GAME OVER ', this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2);\n this.ctx.font = (this.wallSize)/2 + 'px \"Press Start 2P\"';\n this.ctx.fillText('You reached wave ' + (this.waves.waveNo - 1), this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2 + this.wallSize);\n let enemy = new Sprite (\n this.canvas,\n this.ctx,\n new Vector((this.canvas.width/2) - this.wallSize * 2.5, this.wallSize * 3), // position\n new Vector(0, 0),\n new Vector(this.wallSize * 5, this.wallSize * 5), // size\n new Spritesheet(images.enemy),\n [0, 11]\n );\n enemy.draw();\n document.getElementById('Game').classList.add(\"hide\");\n document.getElementById('GameOver').classList.remove(\"hide\");\n } else {\n this.walls.forEach(sprite => sprite.draw());\n // this.enemywalls.forEach(sprite => sprite.draw());\n this.towers.forEach(sprite => sprite.draw());\n if (this.wavesStart)\n this.waves.draw();\n this.moveTower.draw();\n }\n }", "draw() {\n context2d.fillStyle = 'black';\n context2d.fillRect(0, 0, this.width, this.height);\n\n this.currentScene.draw();\n\n this.gameManager.drawHUD();\n }", "function drawEnemy(){\n\tfor(let i=0;i<enemyArr.length; i++){\n\n\t\tif(enemyArr[i].name === 'redFregat'){\n\t\t\tif(enemyArr[i].y >= enemyArr[i].yPos){\n\t\t\t\tenemyArr[i].speedY = 0;\n\t\t\t\tif(enemyArr[i].speedX === 0){\n\t\t\t\t\tenemyArr[i].speedX = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tenemyArr[i].x += enemyArr[i].speedX;\n\t\tenemyArr[i].y += enemyArr[i].speedY;\n\t\tif (enemyArr[i].name != 'redFregatBoss'){\n\t\t\tif(enemyArr[i].x + enemyArr[i].width >=500 || enemyArr[i].x <=0){\n\t\t\t\tenemyArr[i].speedX *= -1;\n\t\t\t}\n\t\t}\n\n\t\t//Drawing ship enemy============================\n\t\t\tenemyArr[i].N_x += 0.2;\n\t\t\tship_01()\n\n\t\t//Drawing ship enemy============================\n\n\t\t//Drawing AsteroidRed enemy============================\n\t\t\t\n\t\t\tasteroidDraw()\n\n\t\t//Drawing AsteroidRed enemy============================\n\n\n\t\t//Drawing redShip Freg Lazer enemy============================\n\t\t\t\tif(enemyArr[i].name === 'redShip'){\n\n\t\t\t\t\tenemyArr[i].fire++;\n\n\t\t\t\t\tif(enemyArr[i].fire%80 === 0){\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+10, (enemyArr[i].y+enemyArr[i].height) , 0, 3, 10, 15,'enemyLazer', 1)\n\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\tif(enemyArr[i].name === 'redFregat'){\n\n\t\t\t\t\tenemyArr[i].fire++;\n\n\t\t\t\t\tif(enemyArr[i].fire%160 === 0){\n\n\t\t\t\t\t\tlet firstL;\n\t\t\t\t\t\tif(enemyArr[i].x+10 > hero.x){\n\t\t\t\t\t\t\tfirstL = randomNum(-2, -1)\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfirstL = randomNum(1, 2)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+10, (enemyArr[i].y+enemyArr[i].height) , firstL, 2, 10, 15,'enemyLazer', 1)\n\n\t\t\t\t\t\tlet secondL;\n\t\t\t\t\t\tif(enemyArr[i].x+10 > hero.x){\n\t\t\t\t\t\t\tsecondL = randomNum(-2, -1)\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tsecondL = randomNum(1, 2)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+70, (enemyArr[i].y+enemyArr[i].height) , secondL, 2, 10, 15,'enemyLazer', 1)\n\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\tredShipFregLazer()\n\t\t//Drawing redShip Freg Lazer enemy============================\n\n\t\t//delete enemy from array===================\n\t\tif( enemyArr[i].y >=300 || enemyArr[i].y < -50 || enemyArr[i].x >=520 || enemyArr[i].x < -10){\n\n\t\t\tenDead = true;\n\t\t\tif(enDead){\n\t\t\t\tenemyArr.splice(i, 1);\n\n\t\t\t}\n\t\t}\n\t\t//delete enemy from array===================\n\t}\n}", "drawPlayer() {\n ctx.fillStyle = this.sprite;\n ctx.fillRect(this.positionX, this.positionY, this.height, this.width);\n }", "function draw()\n{\n translate(400, 300);\n if (j == 1 && orderArr.length == 1)\n {\n draw_enemy(orderArr[0]);\n }\n if( frameCount % 6 == 0 && j < orderArr.length)\n {\n if (j == 1)\n {\n draw_enemy(orderArr[0]);\n }\n push();\n stroke(0, 0, 255, 90);\n strokeWeight(4);\n lastEnemy = orderArr[j-1];\n enemy = orderArr[j];\n x = lastEnemy.pos.x;\n y = lastEnemy.pos.y;\n x1 = enemy.pos.x;\n y1 = enemy.pos.y;\n line(x,y,x1,y1);\n draw_enemy(lastEnemy);\n draw_enemy(enemy);\n pop();\n ++j;\n }\n}", "function _draw(ctx){\r\n\t\t// the _draw() method renders all of our game objects on the stage\r\n\t\t// for now we just have single object (our ship)\r\n\t\tship.draw(ctx);\r\n\t}", "function draw() {\n\tbackground(0, 204, 0); // Background color\n\timageMode(CENTER); // Expands the image from the center of the coordinate it'll be located from\n\timage(stageBackground, width / 2, height / 2, width, height); // Stage the background to expand in the center and fit the canvas width and height\n\ttextTemplate.displayScore(); // Displays the score on screen, will increment by 100 everytime an enemy is killed\n\tdisplayFrequency();\n\n\tvirus.virusX -= virus.virusSpeed; // Virus move towards the left\n\n\t// If the shoot button has been pressed it'll display the bullet\n\tif (bullet.shootButton === true) {\n\t\t// Causes the bullet to be displayed\n\t\tbullet.display();\n\t}\n\t// Have to be displayed below if statement above otherwise bullet will display ontop of megaman\n\timage(imgMegaman, megaman.megamanX, megaman.megamanY, 100, 100); // Displays megaman based on coordinates\n\timage(imgVirus, virus.virusX, virus.virusY, 100, 100); // Displays the virus enemy based on coordinates\n\n\tbulletHitEnemy(); // Uses the custom built function for what happens when the bullet hits the enemy\n\n\t// This if statement makes the virus automatically change it's sprite as it moves\n\t// if (round(virus.virusX) - virus.virusX === 0.5) {\n\t// \timgVirus = loadImage(stage.stageVirusDefault[0]);\n\t// } else {\n\t// \timgVirus = loadImage(stage.stageVirusAction[0]);\n\t// }\n\n\t// I use this if statement to show print to console the position of my mouse location when the mouse is pressed\n\t// if (mouseIsPressed) {\n\t// \tprint(`x: ${mouseX} y: ${mouseY}`);\n\t// }\n}", "drawExistingEnemies() {\n const enemies = this.enemiesManager.entitiesDisplayed;\n for (let index = 0; index < enemies.length; index++) {\n enemies[index].draw(this.ctx);\n }\n }", "Draw(){\n\t\tthis.context.beginPath();\n\t\tthis.context.fillRect(this.posX, this.posY, this.width, this.height);\n\t\tthis.context.closePath();\n }", "draw() {\n let sprite = this.sprite;\n if (sprite == null)\n return;\n ctx.drawImage(sprite.sprite, sprite.animationFrame * sprite.width, 0, sprite.width, sprite.height, this.rect.x + sprite.xOffset, this.rect.y + sprite.yOffset, this.rect.width * sprite.xStretch, this.rect.height * sprite.yStretch);\n if (Entity.showEntityRects) {\n ctx.beginPath();\n ctx.lineWidth = \"5\";\n ctx.strokeStyle = \"#00ff00\";\n ctx.rect(this.rect.x, this.rect.y, this.rect.width, this.rect.height);\n ctx.stroke();\n }\n }", "function EnemyChar() {\r\n this.width = enemySize;\r\n this.height = enemySize;\r\n this.xPos = canvas.width - enemySize; // print outside the screen\r\n this.yPos = canvas.height - enemySize;\r\n}", "function Enemy() {\n this.srcX = 131;\n this.srcY = 500;\n this.width = 128;\n this.height = 78;\n this.speed = 2;\n this.drawX = Math.floor(Math.random() * 1000) + gameWidth;\n this.drawY = Math.floor(Math.random() * 422);\n}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // drawCharacters();\n\n // don't draw them on first few screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ) {\n ;\n }\n else {\n //drawCharacters();\n }\n \n // draw the p5.clickables, in front of the mazes but behind the sprites\n clickablesManager.draw();\n}", "function drawElements(){\r\n // console.log(\"drawElements CALLED\")\r\n // console.log(`player.x = ${player.x} - - - player Y = ${player.y}`)\r\n \r\n ctx.rect(player.x, player.y, 40, 40);\r\n ctx.stroke()\r\n}", "function draw(){\n ctx.fillStyle = \"black\";\n ctx.clearRect(0,0, 1200, 300);\n ctx.beginPath();\n ctx.fillRect(0, 0, 1000, 400);\n //Call function for robot head drawing\n robotHead();\n // Draw mountain range in background\n mountainRange();\n targetDraw();\n if(monster == 1){\n\tmonster1();\n }\n if(monster == 2){\n\tmonster2();\n }\n if(monster == 3){\n\tmonster3();\n }\n screenText();\n ctx.strokeStyle = 'white';\n ctx.stroke();\n // call draw livebars function\n livebars();\n}", "function paintEnemies(enemies) {\n enemies.forEach(function (enemy) {\n enemy.y += 5;\n enemy.x += getRandomInt(-15, 15);\n\n // Paint only if not dead\n if (!enemy.isDead) {\n paintTriangle(enemy.x, enemy.y, 20, '#ff0000', 'down');\n }\n\n // Paint enemy shots\n enemy.shots.forEach(function (shot) {\n shot.y += SHOOTING_SPEED; // Enemy shots go down\n paintTriangle(shot.x, shot.y, 5, '#00ffff', 'down');\n });\n });\n}", "draw(ctx) {\n if (this.walkingRight) {\n this.walkRightAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.walkingLeft) {\n this.walkLeftAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.walkingForward) {\n this.walkForwardAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.walkingDownward) {\n this.walkDownwardAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.shooting) {\n this.shootBolt(ctx);\n }\n else if (this.raising) {\n this.raiseShield(ctx);\n }\n else if (this.swinging) {\n this.swingSword(ctx);\n }\n else if (this.casting) {\n this.castSpell(ctx);\n }\n else {\n this.standStill(ctx);\n }\n\n Entity.prototype.draw.call(this);\n }", "function draw() {\n\t\t\t\tctx.fillStyle = \"black\";\n\t\t\t\tctx.fillRect(0,0,canvasWidth, canvasHeight);\n\t\t\t\tplayer.draw();\n\t\t\t\tcomputer.draw();\n\t\t\t\tball.draw();\n\t\t\t}", "function draw() {\n // menggambar dicanvas sekaligus aksi\n drawShip();\n drawEnemy();\n drawPeluru();\n \n // aksi tembak\n tembak();\n \n // update score & lives board\n update();\n}", "draw(ctx) {\n let xOffset = 0;\n let yOffset = 0;\n if (this.dead) {\n if (this.deadAudio) {\n ASSET_MANAGER.playAsset(\"./audio/player_death.mp3\")\n this.deadAudio = false;\n }\n\n if (this.weapon === 0 && this.facing === 0) {\n xOffset = -45;\n yOffset = -23;\n } else if (this.weapon === 0 && this.facing === 1) {\n xOffset = -35;\n yOffset = -20;\n } else if (this.weapon === 1 && this.facing === 0) {\n xOffset = -75;\n yOffset = -45;\n } else if (this.weapon === 1 && this.facing === 1) {\n xOffset = -0;\n yOffset = -42;\n } else if (this.weapon === 2 && this.facing === 0) {\n xOffset = -65;\n yOffset = -40;\n } else if (this.weapon === 2 && this.facing === 1) {\n xOffset = -30;\n yOffset = -30;\n\n }\n if (this.facing === 0) {\n this.deadAnimR[this.weapon].drawFrame(this.game.clockTick, ctx, this.x - this.game.camera.x + xOffset,\n this.y - this.game.camera.y + yOffset, 1);\n } else {\n this.deadAnimL[this.weapon].drawFrame(this.game.clockTick, ctx, this.x - this.game.camera.x + xOffset,\n this.y - this.game.camera.y + yOffset, 1);\n }\n } else {\n if (this.weapon === 0) {\n xOffset = 0;\n yOffset = 0;\n } else if (this.weapon === 1) {\n if (this.state === 0) {\n if (this.facing === 1) yOffset = 1;\n this.facing === 0 ? xOffset = 0 : xOffset = -27;\n } else if (this.state === 1 && this.facing === 1) {\n xOffset = -15;\n yOffset = 0;\n } else if (this.state === 2 && this.facing === 0) {\n xOffset = -18;\n yOffset = -15;\n } else if (this.state === 2 && this.facing === 1) {\n xOffset = -68;\n yOffset = -15;\n } else if (this.state === 3 && this.facing === 1) {\n xOffset = -45;\n yOffset = 0;\n } else if (this.state === 4 && this.facing === 1) {\n xOffset = -20;\n yOffset = -5;\n }\n } else { //if bow\n //console.log(this.facing + \" \" + this.state);\n if (this.state === 0) {\n yOffset = 1;\n this.facing === 0 ? xOffset = 0 : xOffset = 0;\n } else if (this.state === 2) {\n this.facing === 0 ? xOffset = 0 : xOffset = -7;\n } else if (this.state === 4) {\n yOffset = 5;\n }\n\n }\n yOffset -= 5;\n this.animations[this.state][this.facing][this.weapon].drawFrame(this.game.clockTick, ctx,\n this.x - this.game.camera.x + xOffset, this.y - this.game.camera.y + yOffset, 1);\n\n }\n\n if (PARAMS.DEBUG) {\n // ctx.strokeStyle = 'Red';\n // ctx.strokeRect(this.BB.x - this.game.camera.x, this.BB.y - this.game.camera.y, this.BB.width, this.BB.height);\n ctx.strokeStyle = 'Blue';\n ctx.strokeRect(this.ABB.x - this.game.camera.x, this.ABB.y - this.game.camera.y, this.ABB.width, this.ABB.height);\n\n } else if (this.weapon === 2) {\n ctx.strokeStyle = 'White';\n //ctx.arc()\n ctx.strokeRect(this.ABB.x - this.game.camera.x, this.ABB.y - this.game.camera.y, this.ABB.width, .25);\n }\n }", "function draw(){\ncanCon.clearRect(0, 0, canCon.width, canCon.height);\n\n//stuff to draw\nbearer.draw();\nshield.draw();\n\n// draw Backscatter Buster Shots\nfor(var index = 0; index < playerPro.length; index++){\n playerPro[index].draw();\n}\n\n// draw enemies\nfor(var index = 0; index < enemies.length; index++){\n enemies[index].draw();\n}\n\n// draw enemy projectiles\nfor(var index = 0; index < enemyPro.length; index++){\n enemyPro[index].draw();\n}\n\n// draw HUD over everything\nScoreDisplay.draw();\nHealthDisplay.draw();\n}", "function draw(){\r\n ctx.globalAlpha = 1;\r\n ctx.clearRect(0,0,_WIDTH,_HEIGHT);\r\n //DRAW BG\r\n ctx.drawImage(_BG,0,0);\r\n //DRAW ENEMY PATH\r\n if(DRAWPATHFLAG==1){\r\n\t ctx.beginPath();\r\n\t ctx.moveTo(_DESTARRAY[0][0],_DESTARRAY[0][1]);\r\n\t for(var i=0;i<_DESTARRAY.length;i++){\r\n\t\t ctx.lineTo(_DESTARRAY[i][0],_DESTARRAY[i][1]);\r\n\t }\r\n\t ctx.stroke();\r\n\t ctx.fillStyle = \"rgba(0,0,0,0.4)\";\r\n \t\tif(_POLYARRAY.length > 0){\r\n \t\t ctx.beginPath();\r\n\t\t ctx.moveTo(_POLYARRAY[0][0],_POLYARRAY[0][1]);\r\n\t\t for(var i=0;i<_POLYARRAY.length;i++){\r\n\t\t\t ctx.lineTo(_POLYARRAY[i][0],_POLYARRAY[i][1]);\r\n \t\t }\r\n \t\t ctx.closePath();\r\n \t\t ctx.fill();\r\n \t\t}\r\n }\r\n \r\n \r\n\t \r\n \r\n //Handle towers\r\n for(var i=0;i<allTowers.length;i++){\r\n\tvar collide = 0;//stores collision info\r\n allTowers[i].draw();\r\n\t//Handle tower bullets\r\n\tfor(var i2=0;i2<allTowers[i].allBullets.length;i2++){\r\n\t //Propel bullets\r\n\t allTowers[i].allBullets[i2].shootTowards();\r\n\t //Clean up bullets\r\n\t collide = allTowers[i].detectBulletCollision(i2,allEnemies);\r\n\t if(allTowers[i].allBullets[i2].x>=_WIDTH || allTowers[i].allBullets[i2].x<=0 || allTowers[i].allBullets[i2].y>=_HEIGHT || allTowers[i].allBullets[i2].y<=0 || collide>-1 || collide==-2){\r\n\t\tif(collide>-1){\r\n\t\t\tallEnemies[collide].health-=allTowers[i].damage;\r\n\t\t}\r\n\t allTowers[i].allBullets.splice(i2,1);\r\n\t }\r\n\t}\r\n }//End handling of towers\r\n \r\n //Handle enemies\r\n for(var i=0;i<allEnemies.length;i++){\r\n\t if(allEnemies[i].x>_WIDTH || allEnemies[i].x<0 || allEnemies[i].y>_HEIGHT || allEnemies[i].y<0){\r\n\t allEnemies.splice(i,1);\r\n\t\tplayer.health-=10;\r\n\t }\t\t \r\n\t if(allEnemies[i].health<=0){\r\n\t\tplayer.money+=allEnemies[i].reward;\r\n\t\tallEnemies.splice(i,1);\r\n\t }\r\n\t allEnemies[i].draw(); \t \r\n }//End handling of enemies\r\n \r\n for(var i=0;i<towerButtons.length;i++){\r\n\t towerButtons[i].draw();\r\n }\r\n if(selectedTower==-1)\r\n button[2].fill = \"rgba(240,0,50,.6)\";\r\n else\r\n button[2].fill = \"rgba(0,0,0,1)\";\r\n for(var i=2;i<button.length;i++){\r\n\t button[i].draw();\r\n }\r\n button[0].text = _ESPEED;\r\n button[1].text = _ESPEED\r\n button[0].draw();\r\n button[1].draw();\r\n \r\n //Draw upgrade buttons\r\n for(var i=0;i<allTowers.length;i++){\r\n\tfor(var i2=0;i2<allTowers[i].upgradeButtons.length;i2++){\r\n\t\tif(allTowers[i].upgradeButtons[i2].value.cost > player.money){\r\n\t\t allTowers[i].upgradeButtons[i2].fill = \"rgba(255,10,10,.6)\";\r\n\t\t}else\r\n\t\t allTowers[i].upgradeButtons[i2].fill = \"rgba(10,20,200,.8)\";\r\n\t\tif(allTowers[i].rangeFlag == 1)\r\n\t\tallTowers[i].upgradeButtons[i2].draw();\r\n\t}\r\n }\r\n \r\n //Draw player stats\r\n ctx.font = \"bold 12px sans-serif\";\r\n ctx.fillText(\"Health: \"+player.health, 0, 20);\r\n ctx.fillText(\"Money: \"+player.money, 0, 40)\r\n ctx.fillText(\"Next Wave: \"+waveTime,0,60);\r\n ctx.fillText(\"Wave: \"+_WAVECOUNT+\"/\"+_WAVE.length,0,80);\r\n\r\n //Draw building preview\r\n ctx.globalAlpha = 0.5;\r\n if(!notInPolygon(_MOUSEX,_MOUSEY)&&_CURRTOWER!=\"\"||player.money<_CURRTOWER.cost){\r\n ctx.fillStyle=\"rgba(255,20,20,1)\";\r\n ctx.fillRect(_MOUSEX-(_CURRTOWER.width/2),_MOUSEY-(_CURRTOWER.height/2),_CURRTOWER.width,_CURRTOWER.height);\r\n ctx.fillStyle=\"rgba(0,0,0,1)\";\r\n }\r\n ctx.drawImage(_CURRTOWER.img,_MOUSEX-(_CURRTOWER.width/2),_MOUSEY-(_CURRTOWER.height/2));\r\n \r\n}", "function draw(){\n\tif(gameOn){\n\t\tupdate();\n\t\tmonsterFun();\n\t\tnewMonsterFun();\n\t}\n\t\n\tcontext.drawImage(backgroundImage, 0,0);\n\tcontext.drawImage(hero, heroLocation.x, heroLocation.y);\n\tcontext.drawImage(monster, monsterLocation.x, monsterLocation.y);\n\n\tif (hero.bombPlace == true){\n\t\tcontext.drawImage(bomb, bombLocation.x, bombLocation.y);\n\t}\n\tif (hero.bombTimer == true){\n\t\thero.bombTimer = false;\n\t\tsetTimeout(function(){\n\t\t\thero.bombPlace = false;\n\t\t}, 6000);\n\t\t\n\t}\n\tif (hero.explosion == true){\n\t\tcontext.drawImage(explosion, bombLocation.x, bombLocation.y);\n\t\tbombLocation.x = 900;\n\t\tbombLocation.y = 900;\n\t\thero.explosion = false;\n\t\tnewMonsterLocation.spawn = true;\n\t\t// setTimeout(function(){\n\t\t// \thero.explosion = false;\n\t\t// }, 1000);\n\t}\n\tif (newMonsterLocation.spawn == true){\n\t\tcontext.drawImage(newMonster, newMonsterLocation.x, newMonsterLocation.y);\n\t}\n\trequestAnimationFrame(draw);\n}", "function drawShooting(x, y){\n graphics.fillRect(x, y, 10, 5);\n graphics.fillStyle = \"Red\";\n //graphics.fillRect(225, 480, 15, 15);\n //graphics.fillRect(x, y, 15, 15);\n }", "function draw() {\n\tctx.clearRect(0, 0, WIDTH, HEIGHT);\n\tctx.fillStyle = \"rgba(0,0,0,0)\";\n\tctx.fillRect(0, 0, WIDTH, HEIGHT);\n\tctx.save();\n\tctx.fillStyle = \"#fff\";\n\tplayer.draw();\n\tdrawlist(bullets);\n\tdrawlist(enemies);\n\tctx.fillStyle = \"blue\";\n\tctx.font = \"25px Helvetica\";\n\tctx.fillText(\"SCORE: \" + score, 10, 30);\n\tif (player.dead) {\n\t ctx.fillStyle = \"red\";\n ctx.font = \"35px Helvetica\";\n ctx.fillText(\"Game Over!\", WIDTH/2 - ctx.measureText(\"Game Over!\").width/2, (HEIGHT)/1.35);\n ctx.font = \"30px Helvetica\";\n ctx.fillText(\"press 'R' to play again\", WIDTH/2 - ctx.measureText(\"press 'R' to play again\").width/2, (HEIGHT)/1.25);\n };\n\tctx.restore();\n}", "function draw() {}", "function draw() {}", "function drawChar(){\r\n\t\t\r\n\t\tgc.beginPath();\r\n\t\tgc.rect(player.x, player.y, player.w, player.h);\r\n\t\tgc.fillStyle = playerColour;\r\n\t\tgc.fill();\r\n\t\tgc.closePath();\r\n\t\t\r\n\t}", "draw() {\n\n spiel.ctx.beginPath();\n spiel.ctx.fillStyle = \"ghostwhite\";\n spiel.ctx.fillRect(this.posX, this.posY, this.height, this.width);\n\n spiel.ctx.closePath();\n }", "function draw() {\n\t//clear the board\n\tctx.clearRect(0, 0, canvas[0].width, canvas[0].height);\n\n\t//draw the player\n\tplayer.draw(ctx);\n\n\t//draw the turrets\n\t$.each(turrets, function(i,turr) {\n\t\tturr.draw(ctx);\n\t});\n\n\t//draw the projectiles\n\t$.each(projectiles, function(i,proj) {\n\t\tproj.draw(ctx);\n\t});\n\n\t//draw the effects\n\t//make sure damaging effects are on top\n\tvar damagingEffects = [];\n\t$.each(effects, function(i,eff) {\n\t\tif (eff.getDoesDamage()) {\n\t\t\tdamagingEffects.push(eff);\n\t\t} else {\n\t\t\teff.draw(ctx);\n\t\t}\n\t});\n\n\t$.each(damagingEffects, function(i,eff) {\n\t\teff.draw(ctx);\n\t});\n}", "update(dt) {\n this.x += (level * enemySpeed) * dt;\n\n // When the enemy moves off the screen, the X position will be reset\n if (this.x > CANVAS_WIDTH) {\n this.x = randomX();\n }\n\n }", "update(dt) {\n this.x += (level * fasterEnemySpeed) * dt;\n\n // When the enemy moves off the screen, the X and Y positions will be reset\n if (this.x > CANVAS_WIDTH) {\n this.x = randomX();\n this.y = randomY();\n }\n\n }", "function Enemy (width, height, color, x, y){\n //set the current active enemy to true\n this.active = true;\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y;\n this.xVelocity = 1;\n //keep enemies in bounds\n this.inBounds = function(){\n return this.x >= 0 && this.x <= 6656\n && this.y >= 0 && this.y <= 468;\n };\n this.image= './images/enemy.png';\n this.draw = function (){\n const enemyImg = new Image();\n enemyImg.src = this.image;\n ctx.drawImage(enemyImg, this.x, this.y, this.width, this.height)\n },\n this.update = function (){\n //enemy starts at position x which changes negatively\n this.x -= this.xVelocity;\n this.xVelocity = 1; \n this.active = this.active && this.inBounds();\n };\n this.die = function(){\n this.active = false;\n };\n \n }", "draw(ctx) {\n if (Math.round(parseFloat(this.floatY) * 10) > 50) {\n this.step = -.1\n }\n else if (Math.round(parseFloat(this.floatY) * 10) < -50) {\n this.step = +.1\n }\n if (!this.drank) {\n ctx.drawImage(this.imagesheet, 0, 0, 50, 65, this.x - this.game.camera.x, this.y - this.game.camera.y + this.floatY, this.w, this.h);\n }\n if (PARAMS.DEBUG) {\n if (PARAMS.DEBUG) {\n ctx.strokeStyle = 'Red';\n ctx.strokeRect(this.BB.x - this.game.camera.x, this.BB.y - this.game.camera.y + this.floatY, this.BB.width, this.BB.height);\n }\n }\n }", "function draw() {\n background(0);\n for (let i = 0; i < agents.length; i++) {\n agents[i].update();\n agents[i].display();\n }\n\n for (let i = 1; i < agents.length; i++) {\n\n if (agents[0].collide(agents[i])) {\n agents[0].eat(agents[i]);\n }\n}\n\n}", "function Enemy() {\n var percentFire = .01;\n var chance = 0;\n this.alive = false;\n /*\n * Sets the Enemy values\n */\n this.spawn = function (x, y, speed) {\n this.x = x;\n this.y = y;\n this.speed = speed;\n this.speedX = 0;\n this.speedY = speed;\n this.alive = true;\n this.leftEdge = this.x - 90;\n this.rightEdge = this.x + 90;\n this.bottomEdge = this.y + 140;\n };\n /*\n * Move the enemy\n */\n this.draw = function () {\n this.context.clearRect(this.x - 1, this.y, this.width + 1, this.height);\n this.x += this.speedX;\n this.y += this.speedY;\n if (this.x <= this.leftEdge) {\n this.speedX = this.speed;\n } else if (this.x >= this.rightEdge + this.width) {\n this.speedX = -this.speed;\n } else if (this.y >= this.bottomEdge) {\n this.speed = 1.5;\n this.speedY = 0;\n this.y -= 5;\n this.speedX = -this.speed;\n }\n this.context.drawImage(imageRepository.enemy, this.x, this.y);\n // Enemy has a chance to shoot every movement\n chance = Math.floor(Math.random() * 101);\n if (chance / 100 < percentFire) {\n this.fire();\n }\n };\n /*\n * Fires a bullet\n */\n this.fire = function () {\n game.enemyBulletPool.get(this.x + this.width / 2, this.y + this.height, -2.5);\n }\n /*\n * Resets the enemy values\n */\n this.clear = function () {\n this.x = 0;\n this.y = 0;\n this.speed = 0;\n this.speedX = 0;\n this.speedY = 0;\n this.alive = false;\n };\n}", "update(dt){\n //set the point when the enemy is outside the screen\n if (this.x > 5) {\n this.offscreen = true;\n }\n\n\t\tvar random = Math.floor(Math.random() * 5);\n\n\t\t//replace the enemy\n\t\tif (this.offscreen) {\n\t\t\tthis.x = -random;\n this.offscreen = false;\n\t\t} else {\n\t\t\tthis.x += dt;\n\t\t}\n }", "function draw() {\r\n\r\n // draw game background\r\n display.fill('white');\r\n\r\n // draw game map\r\n drawMap();\r\n\r\n // draw potential tower if player is dragging a tower\r\n if (controller.dragging && controller.isMouseInCanvas()) {\r\n drawNewTower();\r\n };\r\n\r\n // display buffer\r\n display.draw(); \r\n}", "function canvasTurn() {\n /* Ensuring that object do not go over the canvas */\n if (this.x >= (canvas.width - this.width)) { //transporting enemy from the right side of canvas to left side.\n this.x = 0;\n }\n if (this.y >= (canvas.height - this.height)) { //transporting enemy from the botton side of canvas to up side.\n this.y = 0;\n }\n if (this.x < 0) { //transporting enemy from the left side of canvas to right side.\n this.x = canvas.width - this.width;\n }\n if (this.y < 0) { //transporting enemy from the up side of canvas to botton side.\n this.y = canvas.height - this.height;\n }\n}", "function Enemy() {\n this.speed = 1;\n this.word;\n \n \n this.draw = function() {\n \n // Update moved location\n this.y += this.speed;\n // Draw\n this.context.drawImage(this.word.img, this.x, this.y);\n };\n \n this.init = function(x,y, index) {\n this.x=x;\n this.y=y;\n this.word = game.wordBank[index];\n\tgame.wordBank.splice(index, 1);\n };\n}", "function drawEverything() {\n\tcolorRect(0,0,canvas.width,canvas.height,\"black\"); // background screen size and color\n\tcolorRect(player1X,player1Y,PLAYER_WIDTH,PLAYER_HEIGHT,\"green\"); // player\n\tcolorRect(enemy1X,enemy1Y,ENEMY_1_WIDTH,ENEMY_1_HEIGHT,\"red\"); // enemy 1\n\t\n\tcanvasContext.font=\"26px Helvetica\";\n\tcanvasContext.fillStyle=\"white\";\n\tcanvasContext.fillText((\"Time: \" + time.toString()), 25, 50); \n\n}", "draw(){\n \n \n \n image(this.spriteSheet, this.charX, this.charY, this.frameWidth*1.5, this.frameHeight*1.5, this.currentFrameX, this.currentFrameY, this.frameWidth, this.frameHeight);\n }", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // draw the p5.clickables, in front of the mazes but behind the sprites \n clickablesManager.draw();\n\n // No avatar for Splash screen or Instructions screen\n if( adventureManager.getStateName() !== \"Splash\" && \n adventureManager.getStateName() !== \"Instructions\" ) {\n \n // responds to keydowns\n moveSprite();\n\n // this is a function of p5.js, not of this sketch\n drawSprite(playerSprite);\n } \n}", "function draw_die(context){\n context.fillStyle = \"#003399\";\n context.beginPath();\n context.moveTo(ball_visual.centre_x, ball_visual.centre_y - 75);\n context.lineTo(ball_visual.centre_x + 70, ball_visual.centre_y + 50);\n context.lineTo(ball_visual.centre_x - 70, ball_visual.centre_y + 50);\n context.fill();\n}", "draw(ctx){\n ctx.save();\n ctx.fillStyle = \"green\";\n ctx.fillRect(this.x-this.width/2,this.y-this.height/2,this.width,this.height);\n ctx.restore();\n }", "function draw() {\n // A pink background\n image(bgimg2, 400, 250)\n\n // Default the avatar's velocity to 0 in case no key is pressed this frame\n avatarVX = 0;\n avatarVY = 0;\n\n // Check which keys are down and set the avatar's velocity based on its\n // speed appropriately\n\n // Left and right\n if (keyIsDown(LEFT_ARROW)) {\n avatarVX = -avatarSpeed;\n }\n else if (keyIsDown(RIGHT_ARROW)) {\n avatarVX = avatarSpeed;\n }\n\n // Up and down (separate if-statements so you can move vertically and\n // horizontally at the same time)\n if (keyIsDown(UP_ARROW)) {\n avatarVY = -avatarSpeed;\n }\n else if (keyIsDown(DOWN_ARROW)) {\n avatarVY = avatarSpeed;\n }\n\n // Move the avatar according to its calculated velocity\n avatarX = avatarX + avatarVX;\n avatarY = avatarY + avatarVY;\n\n // The enemy always moves at enemySpeed\n enemyVX = enemySpeed;\n // Update the enemy's position based on its velocity\n enemyX = enemyX + enemyVX;\n\n // Check if the enemy and avatar overlap - if they do the player loses\n // We do this by checking if the distance between the centre of the enemy\n // and the centre of the avatar is less that their combined radii\n if (dist(enemyX,enemyY,avatarX,avatarY) < enemySize/2 + avatarSize/2) {\n // Reset the enemy's position\n enemyX = 0;\n enemyY = random(0,height);\n // Reset the avatar's position\n avatarX = width/2;\n avatarY = height/2;\n // Reset the dodge counter\n dodges = 0;\n }\n\n // Check if the avatar has gone off the screen (cheating!)\n if (avatarX < 0 || avatarX > width || avatarY < 0 || avatarY > height) {\n // If they went off the screen they lose in the same way as above.\n console.log(\"YOU LOSE!\");\n enemyX = 0;\n enemyY = random(0,height);\n avatarX = width/2;\n avatarY = height/2;\n dodges = 0;\n }\n\n // Check if the enemy has moved all the way across the screen\n if (enemyX > width) {\n // This means the player dodged so update its dodge statistic\n dodges = dodges + 1;\n // Tell them how many dodges they have made\n console.log(dodges + \" DODGES!\");\n // Reset the enemy's position to the left at a random height\n enemyX = 0;\n\n //changed the spawn location of a successful dodge to make it so the enemy will spawn at the avatar's current Y position.... It will ALWAYS go after you!\n enemyY = avatarY;\n\n //Enemy size will increase according to how many successful dodges there are\n enemySize = 70+dodges*10;\n\n //enemy speed will multiply according to how many successful dodges there are\n enemySpeed = 5+dodges;\n }\n\n//background will change if dodge score reachs 5..... or more (if you avoid more than 10, you're going to hell)\n\n if(dodges>=5){\n image(bgimg3, 400,250);\n }\n\n if(dodges>=10){\n image(bgimg, 400, 250);\n }\n\n//will display total number of dodges when the enemy's speed = 0, aka when it resets (amount of responsibilities avoided)\n if(enemySpeed===0){\n\n }\n else{dodgesScore=\"# of responsibilities you have avoided: \" + dodges;}\n textSize(15+dodges);\n fill(255); //white font\n text(dodgesScore,20,50);\n\n // Display the number of successful dodges in the console\n console.log(dodges);\n\n // The player is a student\n image(student,avatarX,avatarY,avatarSize,avatarSize);\n\n // The enemy is are books.... responsibilities\n image(books,enemyX,enemyY,enemySize,enemySize);\n\n}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n clickablesManager.draw();\n\n for( let i = 0; i < clickables.length; i++ ) {\n clickables[i].visible = false;\n }\n\n if( gDebugMode == true ) {\n drawDebugInfo();\n }\n}", "drawExistingEntities() {\n this.drawExistingBullets();\n this.drawExistingEnemies();\n this.hero.draw(this.ctx);\n }", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "drawSelf(theCanvas, user, theGame) {\n theCanvas.clearEnemy(this);\n this.playerInVicinity(user);\n if (!this.playerIsSeen) {\n let enemyDirection = this.direction % 4;\n if (enemyDirection === 0 && (this.id === 0 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x, this.y + 35)) {\n this.y += 5;\n this.currDirection = \"S\";\n } else {\n if (this.id === 0) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (enemyDirection === 1 && (this.id === 5 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x + 35, this.y)) {\n this.x += 5;\n this.currDirection = \"E\";\n } else {\n if (this.id === 5) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingRight[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (enemyDirection === 2 && (this.id === 0 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x, this.y - 15)) {\n this.y -= 5;\n this.currDirection = \"N\";\n } else {\n if (this.id === 0) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingUp[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (enemyDirection === 3 && (this.id === 5 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x - 15, this.y)) {\n this.x -= 5;\n this.currDirection = \"W\";\n } else {\n if (this.id === 5) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingLeft[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }\n\n //changes behavior of enemy once player is in distance\n } else {\n if (user.x === this.x || user.x === this.x + 5 || user.x === this.x - 5) {\n if(user.y > this.y){\n this.currDirection = 'S';\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else{\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingUp[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n this.currDirection = 'N'\n }\n this.attackPlayer(user, theGame);\n \n } else if(user.y === this.y || user.y === this.y + 5 || user.y === this.y - 5){\n if(user.x > this.x){\n this.currDirection = 'E';\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingRight[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else{\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingLeft[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n this.currDirection = 'W'\n }\n this.attackPlayer(user, theGame);\n }else{\n if (user.x > this.x && !theCanvas.detectLine(this.x + 35, this.y) && !theCanvas.detectLine(this.x, this.y + 40) && !theCanvas.detectLine(this.x, this.y + 45)) {\n this.x += 5;\n this.currDirection = \"E\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingRight[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (\n user.y < this.y &&\n !theCanvas.detectLine(this.x, this.y - 15)\n ) {\n this.y -= 5;\n this.currDirection = \"N\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingUp[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else if (\n user.x < this.x &&\n !theCanvas.detectLine(this.x - 15, this.y)\n ) {\n this.x -= 5;\n this.currDirection = \"W\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingLeft[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (\n user.y > this.y &&\n !theCanvas.detectLine(this.x, this.y + 35) && !theCanvas.detectLine(this.x, this.y + 40) && !theCanvas.detectLine(this.x, this.y + 45)\n ) {\n this.y += 5;\n this.currDirection = \"S\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else{\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }\n }\n }\n }", "function drawEverything(){\n myGameArea.clear();\n //draw moving background\n drawBackground();\n //add the new position of the bullet to the update step\n playerBullets.forEach(function(bullet){\n bullet.update();\n });\n playerBullets.forEach(function(bullet){\n bullet.draw();\n });\n //filter the list of bullet to only add the active bullets\n playerBullets = playerBullets.filter(function(bullet){\n return bullet.active;\n });\n //add the new enemy to the array of enemies\n enemies.forEach(function(enemy){\n enemy.update();\n });\n // filter the list of enemies\n enemies = enemies.filter(function(enemy){\n return enemy.active;\n })\n enemies.forEach(function(enemy){\n enemy.draw();\n });\n \n player.newPos();\n player.update();\n // myGameArea.score();\n \n \n }", "function draw(){\n background(0);\n moveBullet();\n drawGame();\n ellipse(x, y, 50, 50);\n if (keyIsDown(LEFT_ARROW)) {\n if(x>25){\n x -=5;\n }\n \n }\n \n if (keyIsDown(RIGHT_ARROW)) {\n \n if(x+30 <600){\n x +=5;\n }\n\n }\n if (keyIsDown(UP_ARROW)){\n bullets.push([x, y]);\n }\n for(let i=0; i<14;i++){\n e[i].drawEnemy();\n e[i].moveEnemy(); \n }\n}", "function draw() {\r\n requestAnimationFrame(draw);\r\n if (numberOfMissiles < 50) {\r\n missileGeneration();\r\n }\r\n moveMissile();\r\n TWEEN.update();\r\n renderer.render(scene,camera);\r\n}", "function draw() {\n background(100, 100, 200);\n drawBorder();\n\n if (!gameOver) {\n handleInput();\n\n movePlayer();\n moveEnemies();\n movePrey();\n\n updateHealth();\n checkCollisions();\n\n drawPrey();\n drawEnemies();\n drawPlayer();\n } else {\n showGameOver();\n }\n}", "function Enemy(x, y, r ,g, b, s, range)\n{\n this.x = x;\n this.y = y;\n this.r = r;\n this.g = g;\n this.b = b;\n this.s = s;\n this.range = range;\n this.currentX = x;\n this.inc = 1;\n \n this.update = function()\n {\n this.currentX += this.inc; \n if(this.currentX >= this.x + this.range)\n {\n this.inc = -1;\n }\n else if(this.currentX < this.x)\n {\n this.inc = 1;\n }\n };\n \n this.draw = function()\n {\n this.update();\n push();\n translate(this.currentX, this.y);\n \n scale(this.s); // Set the scale\n var c = color(this.r, this.g, this.b);\n stroke(c); // Set the body colour\n strokeWeight(70);\n line(0, -35, 0, -65); // Body\n noStroke();\n fill(255 - this.g); //face\n ellipse(-17.5, -65, 35, 35); // Left eye dome\n ellipse(17.5, -65, 35, 35); // Right eye dome\n arc(0, -65, 70, 70, 0, PI); // Chin\n fill(this.g);\n ellipse(-14, -65, 8, 8); // Left eye\n ellipse(14, -65, 8, 8); // Right eye\n quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak\n pop();\n \n };\n this.checkContact = function(gc_x, gc_y)\n {\n var d = dist(gc_x, gc_y, this.currentX, this.y); \n if(d < 20)\n { \n if(lives != 0){\n lives -= 1;\n } \n player.isDead = true;\n deathSound.setVolume(0.1);\n deathSound.play();\n return true;\n } \n return false;\n }\n}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // Only draw scorecard on certain screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ||\n adventureManager.getStateName() === \"Four\" ||\n adventureManager.getStateName() === \"Five\" ||\n adventureManager.getStateName() === \"Eight\" ||\n adventureManager.getStateName() === \"Eleven\") {\n ;\n }\n else {\n stressCard.draw();\n }\n\n // draw the p5.clickables in front\n clickablesManager.draw();\n}", "function drawPlayer () {\r\n rect(player.x, player.y, player.w, player.h, player.col, \"fill\");\r\n}", "draw(){\n if (this.alive === true) image(this.spriteSheet, this.x, this.y, this.frameWidth*1.5, this.frameHeight*1.5, this.currentFrameX, this.currentFrameY, this.frameWidth, this.frameHeight);\n }", "render(cam){\n //get the position that the camera sees\n let x = this.x - cam.x + canvas.width/2;\n let y = this.y - cam.y + canvas.height/2;\n\n //draw the enemy\n if (!this.walking){\n c.drawImage(this.images[this.dir-1][2],x-this.width,y-this.height,this.width*2,this.height*2);\n }\n else{\n c.drawImage(this.images[this.dir-1][this.animation],x-this.width,y-this.height,this.width*2,this.height*2);\n if (time > this.animation_cooldown){\n this.animation_cooldown = time+200;\n if (this.animation == 1){\n this.animation = 0;\n }\n else{\n this.animation = 1;\n }\n }\n }\n\n //if recently damaged\n if (this.show_health){\n //display health\n progress_bar(this.health,this.max_health, x-this.width/2, y-(this.height/2+10), this.width, this.height/10, '#BB0000', '#000000')\n }\n }", "function draw() {\n\n\t//clear the canvas\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\n\t//draw the ball\n\tdrawPaddle();\n\tdrawBall();\n\tdrawScore();\n\n\t//advance the ball\n\tx += dx;\n\ty += dy;\n\n\tif (downPressed && paddleY < canvas.height - paddleHeight) {\n\t\tpaddleY += paddledY;\n\t} else if (upPressed && paddleY > 0) {\n\t\tpaddleY -= paddledY;\n\t}\n\n\tif ((enemyY + paddleHeight) < canvas.height) {\n\t\tif (enemyY < y) {\n\t\t\tenemyY += enemyDy;\n\t\t}\n\n\t}\n\t//if the enemy is bellow 0\n\tif (enemyY > 0) {\n\t\t//if the enemy is bellow the ball.\n\t\tif (enemyY > y) {\n\t\t\tenemyY -= enemyDy;\n\t\t}\n\n\t}\n\n\tcheckCollision();\n\tcheckScore();\n}", "function draw() {\n //~~~ intro 1 ~~~//\n if (gameState === \"intro1\") {\n // play the ambient sound effect\n ambience.play();\n //display the screen\n introScreen1.display();\n\n //~~~ intro 2 ~~~//\n } else if (gameState === \"intro2\") {\n // play the ambient sound effect\n ambience.play();\n //play the siren sound effect\n siren.play();\n //display the screen\n introScreen2.display();\n\n //~~~ playing ~~~//\n } else if (gameState === \"playing\") {\n ambience.play();\n //display the background image\n background(backgroundImage);\n //display the destination planet\n planetAmazon.display();\n //display the enemies\n displayEnemies();\n //display the explosions\n displayExplosions();\n // Handle movment of the player\n player.move();\n // display the phazers, and check for collision with enemies\n handlePhazers();\n //detects if player has collided with enemy\n player.detectCollision();\n //displays the player's crosshairs, and the ship\n player.display();\n\n\n //~~~ game Over ~~~//\n } else if (gameState === \"gameOver\") {\n //play the gameover bells\n gameOverBells.play();\n //play the evil evilLaugh\n evilLaugh.play();\n //display the game over screen\n gameOverScreen.display();\n //remove any stray enemies\n for (let e = 0; e < enemies.length; e++) {\n enemies.splice(e, 1);\n }\n }\n\n //~~~ game won ~~~//\n else if (gameState === \"gameWon\") {\n gameWonScreen.display()\n //remove any stray enemies\n for (let e = 0; e < enemies.length; e++) {\n enemies.splice(e, 1);\n console.log(enemies.length);\n }\n }\n}", "draw()\n {\n this.ctx.clearRect(0, 0, this.surfaceWidth, this.surfaceHeight);\n this.ctx.save();\n for (let i = 0; i < this.entities.length; i++)\n {\n this.entities[i].draw(this.ctx);\n }\n this.ctx.restore();\n }", "function renderEntities() { \n allEnemies.forEach(function(enemy) {\n enemy.render();\n }); \n\n player.render();\n }", "function drawEnemies() {\n\n for (i = 0; i < numberOfEnemies; i++) {\n\n fill(enemyFill, enemyHealth);\n ellipse(enemyX[i], enemyY[i], enemyRadius * 2);\n\n }\n}", "function draw() {\n computeBoardSize(board);\n\n context.drawImage(\n this,\n current_x_offset,\n current_y_offset,\n board.width,\n board.height\n );\n\n positionPlayer();\n clearBlinkers();\n\n for (let i of allObjects) {\n if (isInView(i.x, i.y) && !i.completed) {\n const [x, y] = normalize_image_position(i.x, i.y);\n createBlinker(x, y, i.isGold);\n }\n }\n }", "function draw() {\n background(0);\n updateLasers();\n ship.draw();\n ship.update();\n ship.turn();\n ship.edges();\n}", "draw() {\n\n // only display the dirt if it is visible... \n if (this.visible){\n\n ctxDATA.fillStyle = this.color; \n ctxDATA.fillRect(this.x, this.y, this.w, this.h);\n \n // end of visibility check \n }\n\n // end of the draw method for the Dirt \n }", "draw(context) {\r\n\r\n var x = this.sprite.x_pos + this.sprite.x_offset;\r\n var y = this.sprite.y_pos + this.sprite.y_offset;\r\n\r\n context.fillStyle = '#ffffff';\r\n\r\n if (this.sprite.debug) {\r\n if (this.ghost.direction_current != null && this.ghost.direction_future != undefined) {\r\n context.fillText('Direction Current=' + this.ghost.direction_current.name, x + 20 + this.sprite.width, y + 40);\r\n context.fillText('Direction Future=' + this.ghost.direction_future.name, x + 20 + this.sprite.width, y + 60);\r\n }\r\n }\r\n //context.fillText('Target', 300, 280);\r\n super.draw(context);\r\n\r\n }", "function Enemy()\n{\n\tvar percentFire = .01; //controls how many bullets are fired\n\tvar chance = 0;\n\tthis.alive = false;\n\tthis.collidableWith = \"bullet\";\n\tthis.type = \"enemy\";\n\t/*\n\t * Sets the Enemy values\n\t */\n\tthis.spawn = function(x, y, speed)\n {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.speed = speed;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = speed;\n\t\tthis.alive = true;\n\t\tthis.lives = 2;\n\t\tthis.leftEdge = this.x - 100;\n\t\tthis.rightEdge = this.x;\n\t\tthis.bottomEdge = this.y + 140;\n\t};\n\t/*\n\t * Move the enemy\n\t */\n\tthis.draw = function()\n {\n\t\tthis.context.clearRect(this.x-1, this.y, this.width+1, this.height);\n\t\tthis.x += this.speedX;\n\t\tthis.y += this.speedY;\n\t\tif (this.x <= this.leftEdge)\n {\n\t\t\tthis.speedX = this.speed;\n\t\t}\n\t\telse if (this.x >= this.rightEdge + this.width)\n {\n\t\t\tthis.speedX = -this.speed;\n\t\t}\n\t\telse if (this.y >= this.bottomEdge)\n {\n\t\t\tthis.speed = 4;\n\t\t\tthis.speedY = 0;\n\t\t\tthis.y -= 5;\n\t\t\tthis.speedX = -this.speed;\n\t\t}\n if (!this.isColliding)\n {\n\t\t\tthis.context.drawImage(imageRepository.enemy, this.x, this.y);\n\n\t\t\t// Enemy has a chance to shoot every movement\n\t\t\tchance = Math.floor(Math.random()*101);\n\t\t\tif (chance/100 < percentFire)\n {\n\t\t\t\tthis.fire();\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t\telse if(this.isColliding && this.lives > 0)\n {\n\t\t\tthis.lives--;\n\t\t\tthis.isColliding = false;\n\t\t}\n\t\telse if(this.isColliding && this.lives == 0)\n {\n game.playerScore += 20;\n game.explosion.get();\n\t\t\treturn true;\n\t\t}\n\t};\n\t/*\n\t * Fires a bullet\n\t */\n\tthis.fire = function() {\n\t\tgame.enemyLaser.get();\n\t\tgame.enemyBulletPool.get(this.x+this.width/2, this.y+this.height, -2.5);\n\t}\n\t/*\n\t * Resets the enemy values\n\t */\n\tthis.clear = function() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.speed = 0;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = 0;\n\t\tthis.alive = false;\n this.isColliding = false;\n\t};\n}", "function enemys()\r\n {\r\n // potential enemy\r\n fill(300, 150, 100);\r\n // draw the shape\r\n fill(\"red\");\r\n rect(210, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(235, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(225, shapeY, 15, 15);\r\n ellipse(245, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(245, shapeY, 10, 10);\r\n ellipse(225, shapeY, 10, 10);\r\n\r\n\r\n // Enemy 2\r\n fill(\"purple\");\r\n rect(310, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(335, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(325, shapeY, 15, 15);\r\n ellipse(345, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(345, shapeY, 10, 10);\r\n ellipse(325, shapeY, 10, 10);\r\n\r\n\r\n // Enemy 3\r\n fill(\"orange\");\r\n rect(110, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(135, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(125, shapeY, 15, 15);\r\n ellipse(145, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(145, shapeY, 10, 10);\r\n ellipse(125, shapeY, 10, 10);\r\n\r\n // get a random speed when the it first starts\r\n shapeXSpeed = Math.floor(Math.random() * (Math.floor(Math.random() * 5)) + 1);\r\n shapeYSpeed = Math.floor(Math.random() * (Math.floor(Math.random() * 5)) + 1);\r\n\r\n // move the shape\r\n shapeX += shapeXSpeed;\r\n shapeY += shapeYSpeed;\r\n }", "function displayEnemy(x, y, text) {\n var pos = document.getElementById(x + y)\n pos.innerHTML = text\n // console.log(`Enemy Loaded: ${text}`);\n }", "function Invasion(){\n \n\t\tfor(var i = AlienToShoot() ; i < Enemyx.length; i++){\n \n\t\t\tif(AlienToShoot() <= 40 ){\n\t\t\t\tEnemyShoot[i] == true\n\t\t\t\n\t\t\t}\n\n\t\t\tif(EnemyShoot[i] == true){\n\n \n\t\t\t\t\tctx.fillStyle = 'red';\n\t\t\t\t\tctx.fillRect(EnemyLx[i] + 13, EnemyLy[i] + 13 , 5, 10);\n\t\t\t\t\tEnemyLy[i] += 15;\n\t\t\t\t}\n\t\t\t\tif(EnemyLy[i] >= 460){\n\t\t\t\t\tEnemyShoot[i] = false;\n\t\t\t\t}\n\t\t\t\tif(EnemyLy[i] >= 460 && EnemyShoot[i] == false){\n\t\t\t\t\t\tEnemyLy[i] = 300000;\n\t\t\t\t\t\tEnemyLy[i] -= 0;\n\t\t\t\t}\n \n\t\t}\n\t}", "function draw() {\n context.fillStyle = '#212121';\n context.fillRect(0, 0, canvas.width, canvas.height);\n \n drawMatrix(arena, {x: 0, y:0});\n drawMatrix(player.matrix, player.pos); \n}", "draw()\n {\n Renderer.drawImage(this.tex.texture, this.tex.width, this.tex.height, 0, 0, this.tex.width, this.tex.height, this.x, this.y, this.width, this.height);\n }", "function enemy(x,y){\n this.width = 64;\n this.height = 64;\n id=\"enemy1\";\n type=\"motion\";\n layer=2;\n var tags=[\"damaging\",\"enemy\"];\n Entity.call(this,x,y,id,layer,type,tags);\n this.wentUp=false;\n this.yVel=0;\n this.hp=100;\n this.flashFrames=0;\n this.facing=\"left\";\n this.update = function(){\n this.wentUp=false;\n if(this.flashFrames>0){\n this.flashFrames=this.flashFrames-1;\n }\n distance=getDistance(this, game.currentLevelData.playerRef);\n if(this.hp<=0){\n playASound(\"soundEffects/slimeEnemyDeath.mp3\")\n this.remove();\n }\n if(distance<=500){\n this.yVel=this.yVel+1\n if(this.yVel>30){\n (this.yVel=30);\n }\n this.y=this.y+this.yVel;\n if(player.x-this.x <= 0){\n this.x=this.x-3;\n this.facing=\"left\";\n }\n else{\n this.x=this.x+3;\n this.facing=\"right\";\n }\n }\n }\n this.draw = function(){\n if(this.flashFrames%2==0){\n if(this.facing==\"left\"){\n var img = ImageAtlas[this.id];\n ctx.drawImage(\n img, // image\n 600+(this.x-player.x), // target x\n 330+(this.y-player.y), // target y\n 64, // target width\n 64 // target height\n );\n }\n else{\n var img = ImageAtlas[enemy1RKey];\n ctx.drawImage(\n img, // image\n 600+(this.x-player.x), // target x\n 330+(this.y-player.y), // target y\n 64, // target width\n 64 // target height\n );\n } \n }\n }\n this.collision = function(entityC){\n entitySide=checkSide(this,entityC);\n if(entityC.tags.includes(\"block\")){\n sideColided=checkSide(this , entityC)\n if(sideColided==\"bottom\"){\n this.y=entityC.y-64;\n this.yVel=0;\n }\n if(sideColided==\"top\"){\n this.y=entityC.y+64;\n }\n if(sideColided==\"left\"){\n if(this.wentUp==false && game.currentLevelData.playerRef.y<=this.y+5){\n this.y=this.y-15;\n this.wentUp=true;\n }\n this.x=entityC.x+64;\n }\n if(sideColided==\"right\"){\n if(this.wentUp==false && game.currentLevelData.playerRef.y<=this.y+5){\n this.y=this.y-15;\n this.wentUp=true;\n }\n this.x=entityC.x-64;\n }\n }\n if(entityC.tags.includes(\"ladder\")){\n if(game.currentLevelData.playerRef.y<=this.y){\n if(this.wentUp==false){\n this.y=this.y-15;\n this.wentUp=true;\n }\n }\n if(game.currentLevelData.playerRef.y>=this.y){\n this.y=this.y+5;\n }\n this.y=this.y+1;\n }\n if(entityC.id.includes(\"water\")){\n if(game.currentLevelData.playerRef.y<=this.y){\n if(this.wentUp==false){\n this.y=this.y-15;\n this.wentUp=true;\n }\n }\n }\n }\n}", "function draw() {\r\n if(backgroundImg)\r\n background(backgroundImg);\r\n //background(40);\r\n console.log(monster1.y);\r\n Engine.update(engine);\r\n arrow.display();\r\n slingshot.display();\r\n slingshot1.display();\r\n speed(monster1,ground1);\r\n speed(monster2,ground2);\r\n speed(monster3,ground3);\r\n speed(monster4,ground4);\r\n speed(monster5,ground5);\r\n speed(monster6,ground6);\r\n\r\n\r\n //TEXT INSTRUCTIONS\r\n textSize(24);\r\n fill(\"red\");\r\n text(\"Arrows Used: \"+arrowScore,30,50);\r\n text(\"/6\",195,50); \r\n text(\"Monsters Hit: \"+monsterScore,30,90);\r\n if(arrowScore===6&&monsterScore<6){\r\n textSize(36);\r\n text(\"All Arrows Used!\",500,400);\r\n text(\"Refresh to Play Again!\",450,450);\r\n }\r\n if(arrowScore<=6&&monsterScore===6){\r\n textSize(64);\r\n text(\"YOU WIN!\",500,400);\r\n }\r\n //TEXT INSTRUCTIONS END\r\n drawSprites(); \r\n}", "draw() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n // display problem\n this.drawProblem()\n // display input field\n if (this.input) {\n this.input._value = ''\n }\n \n this.drawInputField()\n\n // draw attacks\n this.attacks.draw(this.ctx, this.attackIndex)\n\n // draw player data\n this.player.drawPlayerData(this.ctx)\n // draw computer data\n this.computer.drawComputerData(this.ctx)\n \n }", "function draw()\n{\n\tdraw_sprite(canvas, mirror, 300, 30);\n\tdraw_sprite(canvas, nam, nam_x, man_y);\n\tif (draw_text) textout_centre(canvas, font, \"you suck\", 400, 60+man_x/5, font_size, makecol(100,0,0));\n\tif (draw_text) textout_centre(canvas, font, \"& are stupid\", 400, 150+man_x/5, font_size, makecol(100,0,0));\n\tif (draw_alt_text) textout_centre(canvas, font, \"believe in\", 400, 150, 8, makecol(128, 200, 255));\n\tif (draw_alt_text) textout_centre(canvas, font, \"yourself\", 400, 190, 8, makecol(128, 200, 255));\n\tdraw_sprite(canvas, not_mirror, 0, 0);\n\tdraw_sprite(canvas, man, man_x, man_y);\n}", "draw(context){\n if(this.depth < this.maxDepth){\n context.drawImage(this.buffer, 0, Math.ceil(this.depth));\n if(this.creature){\n this.drawSprite(context);\n //context.strokeStyle = this.creature.type === \"plant\" ? '#008000':'#f00'; // some color/style\n //context.lineWidth = 2; // thickness\n //context.strokeRect(x, y, 32, 32);\n }\n }\n //context.fillText(this.name, this.center.x - 20, this.center.y + 10);\n }", "function draw() {\n // clears the canvas before drawing\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawText('white', \"24px Helvetica\", \"left\", \"top\", \"Points: \" + POINTS, 0, 0);\n drawText('white', \"24px Helvetica\", \"left\", \"top\", \"\" + powername, 0, 745);\n\n //drawing sprites\n player.draw();\n for (let b of balls) {\n b.draw();\n }\n for (let p of powerups) {\n p.draw();\n }\n for (let w of walls) {\n w.draw();\n }\n for (let m of mobs1) {\n m.draw();\n }\n}", "draw(g, x, y, friendo) {\n this.anim.draw(g, x, y, friendo)\n }", "function Enemy() {\n\tvar percentFire = 0.0001;\n\tvar chance = 0;\n\tthis.alive = false;\n\tthis.collidableWith = \"bullet\";\n\tthis.type = \"enemy\";\n\n\tthis.spawn= function(x,y,speed) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.speed = speed;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = 2;\n\t\tthis.alive = true;\n\t\tthis.leftEdge = this.x -200;\n\t\tthis.rightEdge = this.x + 100;\n\t\tthis.bottomEdge = this.y + this.height*5 + 30;\n\t};\n\t/**\n\t\tMove the enemy\n\t*/\n\tthis.draw = function() {\n\t\tthis.ctx.clearRect(this.x-1,this.y,this.width+1,this.height);\n\t\tthis.x += this.speedX;\n\t\tthis.y += this.speedY;\n\t\tif (this.x <= this.leftEdge) {\n\t\t\tthis.speedX = this.speed;\n\t\t} else if (this.x >= this.rightEdge + this.canvasWidth) {\n\t\t\tthis.speedX = -this.speed;\n\t\t} else if (this.y >= this.bottomEdge) {\n\t\t\tthis.speedY = 0;\n\t\t\tthis.y -= 5;\n\t\t\tthis.speedX = -this.speed;\n\t\t}\n\n\t\tif (!this.isColliding) {\n\t\t\tthis.ctx.drawImage(imgRepo.enemy, this.x,this.y);\n\t\t\t//Enemy has a chance to shoot everytime it moves\n\t\t\tchance = Math.floor(Math.random()*101);\n\t\t\tif (chance/100 <= percentFire) {\n\t\t\t\tthis.fire();\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tgame.playerScore += 10;\n\t\t\tgame.explosion.get();\n\t\t\treturn true;\n\t\t}\n\t};\n\n\t/**\n\t\tFire a bullet\n\t*/\n\tthis.fire = function() {\n\t\t//Grab a bullet and place it at the center of the ships \n\t\t//position and at the front. It's negative speed because we want to go down the screen.\n\t\tgame.enemyBulletPool.get(this.x+this.width/2,this.y+this.height, -2.5);\n\t}\n\t/**\n\t\tClear and reset the position of the enemy\n\t*/\n\tthis.clear = function() {\n\t\tthis.x = 0;\n\t\tthis.y =0;\n\t\tthis.speed = 0;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = 0;\n\t\tthis.alive = false;\n\t\tthis.isColliding = false;\n\t}\n}", "function Enemy(x,y,range)\n{\n\n //Local variables for the enemy character. \n this.x = x;\n this.y = y;\n this.range = range;\n this.current_x = x;\n this.incr = 1;\n\n //Constructor function that draws the enemy character.\n\n this.draw = function()\n {\n fill(0);\n ellipse(this.current_x, this.y -25, 50);\n fill(255,0,0);\n ellipse(this.current_x -8,this.y -25, 10);\n ellipse(this.current_x +8,this.y -25, 10);\n rect(this.current_x +5, this.y -50, 5);\n \n }\n\n //Updates position of the enemy character and makes it move on it's own.\n\n this.update = function()\n {\n this.current_x += this.incr;\n if(this.current_x < this.x)\n {\n this.incr = 1.5; \n }\n else if(this.current_x > this.x + this.range)\n {\n this.incr = -1.5;\n }\n\n }\n\n this.isContact = function(gc_x, gc_y)\n {\n //This function will return true if game character makes contact.\n\n var distance = dist(gc_x, gc_y, this.current_x, this.y);\n\n if(distance < 25)\n {\n return true;\n }\n\n return false;\n }\n}", "function draw(){\t\n\trequestAnimationFrame(draw); //allows for maximum use of the hardwares potential\n}", "function createEnemy(x, y) {\n var enemy = game.createGameItem('enemy',25);\n enemy.x = x;\n enemy.y = groundY-50;\n game.addGameItem(enemy);\n var enemyImage = draw.bitmap('img/bad guy clock.png');\n enemy.addChild(enemyImage);\n enemyImage.x = -25;\n enemyImage.y = -25;\n enemy.velocityX = -4;\n enemyImage.scaleX=.08;\n enemyImage.scaleY=.08;\n enemy.onPlayerCollision = function() {\n game.changeIntegrity(-30);\n enemy.shrink();\n console.log('Halle got smacked lol');\n };\n enemy.onProjectileCollision = function() {\n console.log('Halle did the smacking lol');\n game.increaseScore(50);\n enemy.fadeOut();\n };\n }", "function render() {\n enemyLaunchTimer = game.time.events.add(game.rnd.integerInRange(min_enemy_spacing, max_enemy_spacing), enemyLaunchTimer);\n }", "renderPlayer() {\r\n this.ctx.beginPath();\r\n this.ctx.arc(this.posX, this.posY, 40, 0, 2 * Math.PI);\r\n this.ctx.stroke();\r\n }", "draw(){\n\t\tif(this.dead === false){\n\t\t\tpush();\n\t\t\ttranslate(this.loc.x, this.loc.y);\n\t\t\tlet angle = this.vel.heading();\n\t\t\trotate(angle);\n\t\t\t//rotate(this.angle);\n\t\t\t//rectMode(RADIUS);\n\t\t\tfill(255, 0, 0);\n\t\t\tnoStroke();\n\t\t\t//rect(0,0, 14, 14);\n\t\t\ttriangle(20, 0, -10, 14, -10, -14);\n\t\t\tpop();\n\t\t}\n\t}", "function createEnemy(x,y){\n var enemy = game.createGameItem('enemy',25);\n var redSquare = draw.bitmap('img/dogenemy.png');\n redSquare.x = -25;\n redSquare.y = -25;\n redSquare.scaleX = 0.2;\n redSquare.scaleY = 0.2;\n enemy.addChild(redSquare);\n \n enemy.x = x;\n enemy.y = y;\n \n game.addGameItem(enemy);\n enemy.velocityX = -3;\n enemy.onPlayerCollision = function() {\n console.log('The enemy has hit Halle');\n game.changeIntegrity(-10);\n game.increaseScore(100);\n enemy.fadeOut();\n };\n enemy.onProjectileCollision = function() {\n console.log('Halle has hit the enemy');\n enemy.fadeOut();\n };\n}", "function draw() {\n var isHit = false; // Initialize to false\n background(0);\n drawTerrain();\n\n wallManager(); // Add and remove walls as they enter and leave the screen.\n \n // Update all walls position and draw.\n for (let i=0; i<walls.length; i++) {\n walls[i].move();\n walls[i].draw();\n isHit |= walls[i].isHitBy(trump); // True if hit by any wall.\n }\n trump.DEBUG = isHit; // Show debug overlay when hit.\n if (isHit) {trump.deathEvent();} // Perform Death functions and sounds.\n \n trump.applyGravity();\n trump.draw();\n}", "function render() {\n ctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\n // draw background\n background.draw(ctx);\n\n // draw earth\n earth.draw(ctx);\n moon.draw(ctx);\n\n\n // draw asteroids\n //asteroid_1.update();\n //asteroid_1.draw(ctx);\n //asteroid_2.draw(ctx);\n\n //bullet.draw(ctx);\n\n // explosion\n //explosion.draw(ctx);\n\n\n}", "render() {\n\t\tif(this.getHealth() <= 0)\n\t\t\treturn;\n\n\t\tlet tank = this.getMapping();\n\t\tthis.term.bold();\n\t\tthis.term.red();\n\n\t\tif (!this.enemy) {\n\t\t\tthis.term.green();\n\t\t}\n\n\t\t// terminal coordinates are [1,1 - width,height]\n\t\tfor (let i = 0; i < tank.length; i++) {\n\t\t\tfor (let j = 0; j < tank[i].length; j++) {\n\t\t\t\tthis.term.moveTo(this.x + j + 1, this.y + i + 1, tank[i][j]);\n\t\t\t}\n\t\t}\n\n\t\tthis.term.styleReset();\n\t}", "function draw()\n{\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.drawImage(playerStickman,240,100);\n context.drawImage(enemyStickman,1280,100);\n context.drawImage(playerFace,240,100);\n \n context.drawImage(enemyFace,1280,100);\n \n //context.drawImage(enemyHead,1280,100);\n \n \n //fire element\n //context.beginPath();\n //context.arc(200, 785, 40, 0, 2 * Math.PI);\n //context.lineWidth = 5;\n //context.stroke();\n //context.closePath();\n //air element\n //context.beginPath();\n //context.arc(320, 785, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //water element\n //context.beginPath();\n //context.arc(440, 785, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n \n //earth element\n //context.beginPath();\n //context.arc(560, 785, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //player head\n //context.beginPath();\n //context.arc(372, 250, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //timer\n context.beginPath();\n context.arc(950, 120, 60, 0, 2 * Math.PI);\n context.stroke();\n context.closePath();\n //enemy head\n //context.beginPath();\n //context.arc(1500, 250, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //middle line\n context.beginPath();\n context.moveTo(950, 250);\n context.lineTo(950,900);\n context.stroke();\n //context.lineWidth = 10;\n context.closePath();\n //enemyElement;\n //window.onload = enemyElement;\n context.font=\"16pt Arial\";\n context.strokeText(timer, 50,101);\n\n}", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.rect(this.position.x - width/2, this.position.y - width/2, width, width);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "draw() {\n noStroke();\n if (this.color) {\n fill(this.color.x, this.color.y, this.color.z);\n } else {\n fill(0);\n }\n rect(this.pos.x, this.pos.y, this.w, this.h);\n }" ]
[ "0.7704279", "0.76720333", "0.75942516", "0.75852585", "0.7545957", "0.73656297", "0.7299305", "0.7139672", "0.7126999", "0.710894", "0.7098004", "0.7076215", "0.70599836", "0.703447", "0.69608325", "0.6957194", "0.69456416", "0.69164747", "0.69161505", "0.6909478", "0.689721", "0.6895071", "0.6861181", "0.68566567", "0.6845041", "0.68267965", "0.68199056", "0.67908835", "0.6784292", "0.6782088", "0.6775721", "0.6775721", "0.67653143", "0.6761288", "0.67392474", "0.67373544", "0.6734942", "0.67322296", "0.67257154", "0.6723996", "0.67144424", "0.67004377", "0.66934764", "0.6693108", "0.6684523", "0.668268", "0.6680092", "0.66727793", "0.6651626", "0.66443706", "0.663808", "0.66352963", "0.66298646", "0.6628547", "0.6628547", "0.6628161", "0.6625679", "0.6620013", "0.66179997", "0.66103315", "0.6608321", "0.66036123", "0.6603552", "0.660013", "0.659907", "0.6593706", "0.65815234", "0.6581507", "0.6580461", "0.65769666", "0.65702784", "0.6565653", "0.65613925", "0.65586686", "0.6558179", "0.6556464", "0.65480995", "0.6544207", "0.6538474", "0.6538095", "0.6535923", "0.6535728", "0.6525501", "0.65247077", "0.65239453", "0.6521432", "0.6520944", "0.65199095", "0.6507554", "0.6506828", "0.650609", "0.64971185", "0.6494351", "0.6493609", "0.64818275", "0.6481684", "0.6479694", "0.6479485", "0.64752215", "0.6468593", "0.64684147" ]
0.0
-1
Player object is positioned at specified location
constructor() { this.x = 202; this.y = 395; this.sprite = 'images/char-boy.png'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setPosition(id, x, y) {\n var player = this.players.find((p) => p.id === id);\n player.x = x;\n player.y = y;\n }", "setPosition() {\r\n if (!this.object) return;\r\n this.updatePosition();\r\n }", "updatePos() {\n if (this.x != this.player.x || this.y != this.player.y) {\n this.x = this.player.x;\n this.y = this.player.y;\n }\n }", "setPosition(x, y) {\n this.pos.x = x;\n this.pos.y = y;\n }", "function set_player_loc(x, y) {\n player['x'] = x;\n player['newx'] = x;\n player['y'] = y;\n player['newy'] = y\n}", "function setPlayerPosition() {\n $('#player')\n .css('margin-top', player.top)\n .css('margin-left', player.left)\n}", "sendToStartPos() {\n this.x = this.spawnX;\n this.y = this.spawnY;\n }", "function setPlayerPosition(x,y){\n playerPosition={x,y};\n}", "setPosition(x, y) {\n this.x = x;\n this.y = y;\n }", "setPosition(x, y) {\n this.x = x\n this.y = y\n }", "function go_to_pos(current_pos) {\n\t\n if (current_pos < 0) current_pos = 0;\n if (current_pos > 2) current_pos = 2;\n // set player position\n player_pos = current_pos;\n\n position = {x: 0, y: 0, z: 0}\n if (player_pos == 0) position.x = POSITION_X_LEFT;\n else if (player_pos == 1) position.x = POSITION_X_CENTER;\n else position.x = POSITION_X_RIGHT;\n document.getElementById('player').setAttribute('position', position);\n}", "function updatePosition(object) {\n object.x += object.vx;\n object.y += object.vy;\n}", "TeleportPlayer(x,y){\n this.player.body.x=x;\n this.player.body.y=y;\n }", "setPosition(x, y) {\n this.x = x;\n this.y = y;\n this.sprite.position.set(this.x, this.y);\n }", "function placePlayer() {\n player.position = {\n row: Math.floor(board.length / 2),\n column: Math.floor(board[0].length / 2),\n };\n getPlayerPosition().push(player);\n}", "spawnPlayer() {\n return this._getLocationInArea('player_spawn')\n }", "movePlayer() {\r\n const cellX = ~~$(this).get(0).dataset.x;\r\n const cellY = ~~$(this).get(0).dataset.y;\r\n const _map = this.map;\r\n _map.game.currentPlayer.moveTo(this, cellX, cellY);\r\n }", "function playerPos()\r\n{\r\n\tposX = positionX + \"px\";\r\n\tposY = positionY + \"px\";\r\n\tPLAYER.style.top = posY;\r\n\tPLAYER.style.left = posX;\r\n}", "function updatePlayerPosition() {\n avatar.x = mouseX;\n avatar.y = mouseY;\n avatar.currentSize = avatar.currentSize - SHRINK;\n avatar.currentSize = constrain(avatar.currentSize,0,avatar.maxSize);\n if (avatar.currentSize === 0) {\n avatar.isPlayerAlive = false;\n }\n else {\n avatar.isPlayerAlive = true;\n }\n}", "function setPosition(object, x, y)\n{\n this.object = object;\n this.x = x || null;\n this.y = y || null;\n if (this.x != null);\n\n {\n this.object.position.x = this.x;\n }\n\n if (this.y != null);\n\n {\n this.object.position.y = this.y;\n }\n\n}", "function positionCamera(obj)\r\n{\r\n camera.lookAt(obj.position);\r\n camera.updateProjectionMatrix();\r\n}", "setFrom(pos)\n\t{\n\t\tthis.x = pos.x;\n\t\tthis.y = pos.y;\n\t\tthis.worldSpace = pos.worldSpace;\n\t}", "setPosition(x, y) {\n if (x instanceof p5.Vector) this.position.set(x.x, x.y);\n else this.position.set(x, y);\n }", "setAbsolutePosition(posX, posY) {\n this.position = { x: posX, y: posY };\n }", "teleportToInitialPosition() {\n let coords = game.calculateCoordinatesByPosition(this.row, this.column);\n this.x = coords[0];\n this.y = coords[1];\n if (this.elem.style.display === \"none\") {\n this.elem.style.display = \"inline\";\n }\n if (!this.collisionable)\n this.collisionable = true;\n }", "setPosition(position)\n {\n this.position = position;\n }", "function randomObjectsPosition(){\n scope.css3dObjects.forEach(function(obj){\n if(!obj)return;\n var x=(random()*2-1)*scope.screenInfo.zoneWidth;\n var y=(random()*2-1)*scope.screenInfo.zoneHeight;\n if(x>scope.screenInfo.zoneWidth/2)x+=scope.screenInfo.zoneWidth;\n if(x<scope.screenInfo.zoneWidth/2)x-=scope.screenInfo.zoneWidth;\n if(y>scope.screenInfo.zoneHeight/2)y+=scope.screenInfo.zoneHeight;\n if(y<scope.screenInfo.zoneHeight/2)y-=scope.screenInfo.zoneHeight;\n obj.position.x=x;\n obj.position.y=y;\n });\n }", "function movePlayer() {\n screenWarping(\"player\");\n playerX += playerVX;\n playerY += playerVY;\n}", "setPosition(position) {\n this.position = position;\n }", "public function act(){\n\t\tmodel.transform.localPosition = relativePosition;\n\t\t//Does nothing\n\t}", "update () {\n this.position = [this.x, this.y];\n }", "function dead() \n{\n player.setPosition(80, 500);\n}", "function positionLayer() {\r\n\t\r\n\tvar placeX = 300;\r\n\tvar placeY = 300;\r\n\t\r\n\t//get final placement\r\n\tplaceX = horizontalPlacement();\r\n\tplaceY = verticalPlacement();\r\n\t\r\n\t//Move the object\r\n\tv_layer.style.left = placeX + 'px';\r\n\tv_layer.style.top = placeY + 'px';\r\n}", "function Update () \n\t{\n\t\t//Get the position\n\t\ttargetPos = this.transform.position;\n\t\ttargetPos.y = target.position.y;\n\t\ttargetPos.x = target.position.x - 12;\n\t\t//Go to the position\n\t\tthis.transform.position = targetPos;\n\t}", "function movePlayer(player, location) {\n\t\tvar p = Processing.getInstanceById('game');\n\t\t//console.log(player);\n\t\tp.setPosition(player.id, player.location.lat, player.location.lng, player.location.or);\t\n\t\t//console.log(location);\n\t\t//console.log(player.nickname + \" \" + location.lat + \" \" + location.lng + \" \" + player.location.or);\n\n\t}", "setPosition(x,y,z=this.position.z){\n this.position.x = x;\n this.position.y = y;\n this.position.z = z;\n }", "function getPlayerPosition(){\n return playerPosition; \n}", "setPosition(newPos) {\n let difference = p5.Vector.sub(newPos, this.pixelCenter);\n difference.rotate(-this.body.angle);\n\n this.x += difference.x;\n this.y += difference.y;\n this.setCenter();\n this.setShape();\n this.resetFixture();\n }", "function teleport(x,y){\n player.x = x;\n player.y = y;\n cameraX = 0;\n cameraY = 0;\n speedY = 0;\n speedX = 0;\n}", "newPos() {\n this.x += this.speedX;\n this.y += this.speedY + this.gravity;\n this.hitBottom();\n this.update();\n }", "newPos() {\n this.x += this.speedX;\n this.y += this.speedY + this.gravity;\n this.hitBottom();\n this.update();\n }", "function getPosition(){\n\n // 抓點擊的位置 與開始時 個別掛上去\n var eTarget = event.target;\n var index = eTarget.getAttribute(\"aria-position\");\n var getStartT = eTarget.getAttribute(\"aria-time\");\n\n // if抓到不是unit 抓爸爸 重新抓位置跟開始時間\n var posClassName = eTarget.className \n if(posClassName != \"unit\"){\n posClassName = eTarget.parentNode;\n index = posClassName.getAttribute(\"aria-position\");\n getStartT = posClassName.getAttribute(\"aria-time\");\n } \n\n // < 650 時, 不作清除 focus & 掛 focus style\n if(document.body.clientWidth >= 650){\n cleanFocus();\n var site = document.getElementsByClassName(\"unit\")[index];\n site.classList.add(\"focusOption\");\n }\n\n player.currentTime(getStartT);\n player.play(); \n\n if(document.body.clientWidth >= 650){\n // 卷軸 跟著\n scrollMove(index);\n // 最後兩個 移到最底下\n if( index >= cueLength - 2 ){\n playlistBlock.scrollTop = playlistBlock.scrollHeight;\n }\n }else{\n closeX();\n }\n }", "update() {\n // initialize next move\n let nextPosition = this.getNextPosition();\n // if next position is not blocked by an object\n if (this.isPositionFree(nextPosition)) {\n this.position.x = nextPosition.x;\n this.position.y = nextPosition.y;\n\n // if successful, send movement to server\n this.game.broadcastPosition({id: this.id, x: this.position.x, y: this.position.y, direction: this.direction});\n }\n\n }", "_movePlayerToPosition (data) {\n if (this.playersData[data.player]) {\n this.playersData[data.player].moveToPosition(data.position);\n } else {\n console.log(\"Player not found\", data.player);\n }\n }", "position(obj, coord) {\n let x = coord[0];\n let y = coord[1];\n this.grid[x][y] = obj;\n }", "function SetPosition(){\r\n\tvar ratio = window.innerWidth / window.innerHeight;\r\n\tleftAmt = ratio/0.005;\r\n\ttopAmt = parseInt(window.innerHeight*0.789);\r\n\tdocument.getElementById(\"player\").style.left=ratio/0.005 + \"px\";\r\n\tpositionY = topAmt-200;\r\n\t\r\n\t//if the game hasnt started move the starting block to match the players position\r\n\tif(started == false){\r\n\t\tif(document.getElementById(\"startBlock\") != null){\r\n\t\t\tdocument.getElementById(\"startBlock\").style.left=ratio/0.005 + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(ratio < 1.236){\r\n\t\tdocument.getElementById(\"tutorial\").innerHTML=\"Tap to start\";\r\n\t} else {\r\n\t\tdocument.getElementById(\"tutorial\").innerHTML=\"Click or space to start\";\r\n\t}\r\n}", "function Position (x, y) {\n this.x = x;\n this.y = y;\n this.position = this;\n}", "function positionUpdater(player, oldY, oldX) {\n mapArrays[player.y + oldY][player.x + oldX].playerHere = false;\n mapArrays[player.y][player.x].playerHere = true;\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 }", "get_position() {\r\n return {\r\n x_pos: this.sprite.x_pos,\r\n y_pos: this.sprite.y_pos\r\n };\r\n }", "function playerObject(){\n this.x = 50\n this.y = 100\n\n this.speed = 5\n\n this.lenth = 30\n this.height = 10\n this.dirleft = false\n\n this.display = function(){\n\t\tif (mouseY < 200) {\n\t\t\timage (up,this.x, this.y + this.height - 25 , 50,50);\n\t\t}\n\t\tif (mouseY > 200 && mouseY < 400){\n\t\t\t\timage(middle,this.x, this.y + this.height - 25 , 50,50);\n\t\t}\n\t\tif (mouseY > 400) {\n\t\t\timage (down,this.x, this.y + this.height - 25 , 50,50);\n\t\t}\n }\n this.move = function(){\n if(keyIsDown(83) && this.y < height-80){\n this.y = this.y + this.speed\n }\n if(keyIsDown(87) && this.y > 80){\n this.y = this.y - this.speed\n }\n }\n}", "SetPlayerPosition(playerX, playerY) {\n const playerPosition = this.m_player.GetTransform().p;\n const currentPlayerX = [0];\n const currentPlayerY = [0];\n Fracker.WorldToTile(playerPosition, currentPlayerX, currentPlayerY);\n playerX = b2.Clamp(playerX, 0, FrackerSettings.k_worldWidthTiles - 1);\n playerY = b2.Clamp(playerY, 0, FrackerSettings.k_worldHeightTiles - 1);\n // Only update if the player has moved and isn't attempting to\n // move through the well.\n if (this.GetMaterial(playerX, playerY) !== Fracker_Material.WELL &&\n (currentPlayerX[0] !== playerX ||\n currentPlayerY[0] !== playerY)) {\n // Try to deploy any fracking fluid that was charging.\n this.DeployFrackingFluid();\n // Move the player.\n this.m_player.SetTransformVec(Fracker.TileToWorld(playerX, playerY), 0);\n }\n }", "getPlayerPosition() {\n return this.player.position;\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 spawnPlayerPosition(player, gameSession) {\n var min=0; \n var max=3; \n var posX = Math.floor(Math.random() * (+max - +min)) + +min;\n var posY = Math.floor(Math.random() * (+max - +min)) + +min;\n this.player = player;\n this.gameSession = gameSession;\n this.player.position_X = posX;\n this.player.position_Y = posY;\n if(this.player.playerId == gameSession.player1){\n this.player.idle = true;\n }else if(this.player.playerId == gameSession.player2){\n this.player.idle = false;\n }\n return this.player;\n}", "updatePlayerPosition(player, newPos) { //7-1\n const x = parseInt(newPos.charAt(0));\n const y = parseInt(newPos.charAt(newPos.length - 1));\n player.x = x;\n player.y = y;\n }", "function showPosition(position) {\n movieAndDinnerObject.lat = position.coords.latitude;\n movieAndDinnerObject.long = position.coords.longitude;\n }", "constructor() {\n // declare position variables\n this.xPos = 250;\n this.yPos = 250;\n\n // which graphic should the player be using right now?\n this.myGraphic = user_left;\n }", "function setPosition() {\r\n\t\t if (container) {\r\n\t\t if (x < container.left) {\r\n\t\t x = container.left;\r\n\t\t } else if (x > container.right - width) {\r\n\t\t x = container.right - width;\r\n\t\t }\r\n\t\t if (y < container.top) {\r\n\t\t y = container.top;\r\n\t\t } else if (y > container.bottom - height) {\r\n\t\t y = container.bottom - height;\r\n\t\t }\r\n\t\t }\r\n\r\n\t\t }", "move(x,y){\n this.position.x += x;\n this.position.y += y;\n }", "placeObjective() {\n if (this.team === 1) {\n this.x = 14;\n this.y = 1;\n } else if (this.team === 2) {\n this.x = 14;\n this.y = 37;\n }\n }", "function setPosition() {\n if (container) {\n if (x < container.left) {\n x = container.left;\n } else if (x > container.right - width) {\n x = container.right - width;\n }\n if (y < container.top) {\n y = container.top;\n } else if (y > container.bottom - height) {\n y = container.bottom - height;\n }\n }\n\n elem.css({\n top: y + 'px',\n left: x + 'px'\n });\n }", "update(viewX, viewY) {\n this.sprite.position.set(this.x - viewX, this.y - viewY);\n }", "function Position() {\n this.x = 0;\n this.y = 0;\n}", "setPosition(vector) {\n\t\tthis.position = vector\n\t}", "function Start () {\n\tsetSpawnPositions();\n}", "get position() { return this._position; }", "get position() { return this._position; }", "function Position(x,y){\n this.x = x;\n this.y = y;\n}", "function Position(x,y){\n this.x = x;\n this.y = y;\n}", "function onPlayerMove(id, position) {\n\taoi_st.update(id, position.x, position.y);\n}", "setPosition(newPos) {\n let difference = p5.Vector.sub(newPos, this.pixelCenter);\n difference.rotate(-this.body.angle);\n this.x += difference.x;\n this.y += difference.y;\n this.center = createVector(this.x + this.w / 2, this.y + this.h / 2);\n this.calculateVectorsAndSetShape();\n this.resetFixture();\n }", "move(){\n this.x=this.x+random(-3,3)\n this.y=this.y+random(-3,3)\n }", "function decidePlayerStartPos() {\n if(currentRoom === 0) {\n myGamePiece.x = myGameArea.canvas.width - (2 * door2.width + 1);\n myGamePiece.y = myGameArea.canvas.height/2 - myGamePiece.height;\n }\n else if(currentRoom === 1) {\n myGamePiece.x = door1.width + 1;\n myGamePiece.y = myGameArea.canvas.height/2 - myGamePiece.height;\n }\n}", "function e_updateCenter(){ //function to update center of player sprite.\n this.centerx = this.x + 16;\n this.centery = this.y + 16;\n}", "function printCoordinates() {\n console.log(_this.playerobject.assetgroup.position.x);\n console.log(_this.playerobject.assetgroup.position.y);\n\n _this.checkOutOfBounds();\n }", "setPosition(newPos) {\n let difference = p5.Vector.sub(newPos, this.pixelCenter);\n let unchangedDifference = p5.Vector.sub(newPos, this.pixelCenter);\n difference.rotate(-this.body.angle);\n\n for (let i = 0; i < this.pixelVectorPositions.length; i++) {\n this.pixelVectorPositions[i].x += difference.x;\n this.pixelVectorPositions[i].y += difference.y;\n }\n\n this.setCenter();\n this.setPixelCenter();\n this.setShape();\n\n for (let f of this.fixtures) {\n f.setPosition(p5.Vector.add(unchangedDifference, f.pixelCenter));\n }\n }", "get position() {\n\t\treturn this._position.object;\n\t}", "function Position(x, y){\n this.x = x;\n this.y = y;\n}", "moveTo(x, y) {\n this.x = x;\n this.y = y;\n }", "place() { \n\n //decides the random direction of the spot\n var randomDirection = floor(random(0,4));\n\n //alter this placement & direction based on the direction\n if(randomDirection === 0) { //east\n this.x = 0;\n this.y = (floor(random(0,3)) * (platformSize + 10) + HEIGHT/2 - movement);\n this.direction = 0;\n } else if(randomDirection === 1) { //west\n this.x = WIDTH;\n this.y = (floor(random(0,3)) * (platformSize + 10) + HEIGHT/2 - movement);\n this.direction = 1;\n } else if(randomDirection === 2) { //south\n this.x = (floor(random(0,3)) * (platformSize + 10) + WIDTH/2 - movement);\n this.y = 0;\n this.direction = 2;\n } else if(randomDirection === 3) { //north\n this.x = (floor(random(0,3)) * (platformSize + 10) + WIDTH/2 - movement);\n this.y = HEIGHT;\n this.direction = 3;\n }\n }", "move(position = Vector.zero) {\n this.x = position.x;\n this.y = position.y;\n }", "function updatePosition(x, y) {\n queen.position.xcor = x;\n queen.position.ycor = y;\n}", "function spawnLocation(xPos, yPos) {\n \n return { x: xPos, y: yPos };\n\n}", "setPosition(newPos) {\n let difference = p5.Vector.sub(newPos, this.pixelCenter);\n difference.rotate(-this.body.angle);\n\n for (var i = 0; i < this.pixelVectorPositions.length; i++) {\n this.pixelVectorPositions[i].x += difference.x;\n this.pixelVectorPositions[i].y += difference.y;\n }\n\n this.setCenter();\n this.setShape();\n this.resetFixture();\n }", "function setLoc() {\n xLoc = random(60, width - 60);\n yLoc = random(60, height - 60);\n}", "function position () {\n var posX = Math.random()\n var posY = Math.random()\n\n return {\n getPosX: function () {\n return posX\n },\n getPosY: function () {\n return posY\n }\n }\n }", "set_position(x, y) {\r\n\r\n if (typeof(x) != 'undefined' && x != null)\r\n this.sprite.x_pos = x;\r\n\r\n if (typeof(y) != 'undefined' && y != null) \r\n this.sprite.y_pos = y;\r\n }", "movePlayer() {\r\n this.ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n this.drawText();\r\n this.posY = this.posY + this.speed * this.inputY;\r\n this.posX = this.posX + this.speed * this.inputX;\r\n this.renderPlayer();\r\n }", "constructor() {\n this.position = {\n x: 0,\n y: 0,\n };\n }", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\n }", "SetRelativeLocation(z, y, x) {\n this.CurrentLocation.Z += z;\n this.CurrentLocation.Y += y;\n this.CurrentLocation.X += x;\n }", "function updatePlayerPos(player) {\n c.beginPath();\n c.arc(player.coords.x, player.coords.y, player.\n radius, 0, Math.PI * 2, false);\n c.fillStyle = player.color;\n c.fill();\n}", "function onCollisionResetPositionTo(posx, posy){\n if($(\"#player\").collision(\".obstacleBody,.\"+$.gQ.groupCssClass).length > 0){\n $(\"#player\").x(posx);\n $(\"#player\").y(posy);\n }\n}", "setPosition(position) {\n // const nx = position.screen.x - 29;\n const nx = position.screen.x;\n const ny = position.screen.y - 187;\n // const nx = position.screen.x - 21;\n // const ny = position.screen.y - 60;\n this.element.style.transform = `translate(${nx.toFixed(1)}px, ${ny.toFixed(0)}px)`;\n this.element.style.zIndex = Math.round(100000 * position.screen.y);\n\n if (position.world.similarityToCameraVector < 0.3) {\n this.element.classList.add('hidden');\n } else {\n this.element.classList.remove('hidden');\n }\n }", "function p_updateCenter() { //function to update center of player sprite.\n this.centerx = this.x + 16;\n this.centery = this.y + 16;\n}", "function setPlayer(stage) {\n\t\tvar offSet = playerIndexY%2 == 0 ? 0 : 32;\t\t\n\t\tplayerContainer.x = offSet + playerIndexX * 64;\n\t\tplayerContainer.y = playerIndexY * 16;\n\t\tstage.addChild(playerContainer);\n\t}", "function Position (x, y) \n{\n\tthis.x = x;\n\tthis.y = y;\n}", "function movePlayer() {\n p1.render();\n p1.move();\n}", "update(x, y){\n this.location.x = x\n this.location.y = y\n }", "updatePosition() {\n this.position = Utils.convertToEntityPosition(this.bmp);\n }" ]
[ "0.73699987", "0.7334482", "0.713046", "0.704099", "0.69819117", "0.6965149", "0.6963683", "0.6925274", "0.6876897", "0.68697155", "0.6784495", "0.6746055", "0.6725345", "0.66893023", "0.66869664", "0.66675293", "0.6663048", "0.6660678", "0.6611956", "0.66019565", "0.6578146", "0.6568969", "0.6550729", "0.6544923", "0.6527892", "0.6523488", "0.6522067", "0.651868", "0.65119964", "0.650664", "0.6466572", "0.6466057", "0.6457732", "0.6451063", "0.6447731", "0.64470637", "0.64285004", "0.64246494", "0.6423466", "0.6385572", "0.6385572", "0.63800997", "0.6375499", "0.6361264", "0.63479847", "0.6327733", "0.6321634", "0.6319574", "0.6317425", "0.6309105", "0.6279212", "0.6272493", "0.62581575", "0.62538886", "0.6252565", "0.624738", "0.62419844", "0.6239723", "0.62390536", "0.62370956", "0.6231127", "0.622037", "0.6213534", "0.620832", "0.62039864", "0.6196272", "0.6193449", "0.6193449", "0.61910146", "0.61910146", "0.61899483", "0.6184522", "0.61828285", "0.61756295", "0.61721087", "0.6169724", "0.61668146", "0.616281", "0.6160672", "0.6153738", "0.6153313", "0.6153211", "0.61444384", "0.61421996", "0.6134722", "0.61308247", "0.61259377", "0.6121821", "0.6115804", "0.6114426", "0.61120754", "0.6111554", "0.6110536", "0.6109759", "0.6109553", "0.6105502", "0.61040884", "0.6102762", "0.60975164", "0.60950977", "0.60937524" ]
0.0
-1
draw the enemy on the screen
render() { ctx.drawImage(Resources.get(this.sprite), this.x, this.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawEnemy(EnemyX,EnemyY){\n image(Enemy,EnemyX,EnemyY,50,50);\n}", "draw() {\n ctx.fillStyle = this.color\n ctx.shadowColor = this.color\n ctx.shadowBlur = 30\n ctx.fillRect(this.pos.x, this.pos.y, this.size.w, this.size.h)\n\n if (this.color === this.hitColor) {\n setTimeout(() => {\n this.color = this.defaultColor // sets the color of the enemy to normal after 100 ms\n }, 100)\n }\n\n ctx.closePath()\n }", "draw() {\n this.drawExistingEntities();\n this.disableEntities();\n this.blockHeroMovement();\n this.killedEnemiesCounter();\n }", "function draw() {\n if (isRunning) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n const enemyStyle = '#ff0000';\n drawRect(randomEnemyX, dy, 50, enemyHeight, enemyStyle);\n drawPlayer();\n\n if ((playerX == randomEnemyX)\n && (dy >= canvas.height - playerHeight - enemyHeight)) {\n gameOver();\n }\n\n if (dy <= canvas.height) {\n dy = dy + 1;\n } else {\n marcaPonto(1);\n drawScore();\n\n if (score % 4 == 0) {\n changeControls();\n }\n\n dy = 1;\n randomEnemyX = getEnemyX();\n }\n}\n}", "function drawScreen() {\n clearScreen()\n updateEnemyPosition()\n checkforCollisions()\n winningCollision()\n drawCharacter()\n}", "draw() {\n if (this.waves.lives == 0) {\n this.ctx.fillStyle = colours.flat_davys_grey;\n this.ctx.fillRect(0, 0, this.size.x, this.size.y);\n this.ctx.fillStyle = colours.flat_electric_blue;\n this.ctx.font = (this.wallSize) + 'px \"Press Start 2P\"';\n this.ctx.fillText('GAME OVER ', this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2);\n this.ctx.font = (this.wallSize)/2 + 'px \"Press Start 2P\"';\n this.ctx.fillText('You reached wave ' + (this.waves.waveNo - 1), this.canvas.width / 2 - this.wallSize * 4, this.canvas.height / 2 + this.wallSize);\n let enemy = new Sprite (\n this.canvas,\n this.ctx,\n new Vector((this.canvas.width/2) - this.wallSize * 2.5, this.wallSize * 3), // position\n new Vector(0, 0),\n new Vector(this.wallSize * 5, this.wallSize * 5), // size\n new Spritesheet(images.enemy),\n [0, 11]\n );\n enemy.draw();\n document.getElementById('Game').classList.add(\"hide\");\n document.getElementById('GameOver').classList.remove(\"hide\");\n } else {\n this.walls.forEach(sprite => sprite.draw());\n // this.enemywalls.forEach(sprite => sprite.draw());\n this.towers.forEach(sprite => sprite.draw());\n if (this.wavesStart)\n this.waves.draw();\n this.moveTower.draw();\n }\n }", "draw() {\n context2d.fillStyle = 'black';\n context2d.fillRect(0, 0, this.width, this.height);\n\n this.currentScene.draw();\n\n this.gameManager.drawHUD();\n }", "function drawEnemy(){\n\tfor(let i=0;i<enemyArr.length; i++){\n\n\t\tif(enemyArr[i].name === 'redFregat'){\n\t\t\tif(enemyArr[i].y >= enemyArr[i].yPos){\n\t\t\t\tenemyArr[i].speedY = 0;\n\t\t\t\tif(enemyArr[i].speedX === 0){\n\t\t\t\t\tenemyArr[i].speedX = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tenemyArr[i].x += enemyArr[i].speedX;\n\t\tenemyArr[i].y += enemyArr[i].speedY;\n\t\tif (enemyArr[i].name != 'redFregatBoss'){\n\t\t\tif(enemyArr[i].x + enemyArr[i].width >=500 || enemyArr[i].x <=0){\n\t\t\t\tenemyArr[i].speedX *= -1;\n\t\t\t}\n\t\t}\n\n\t\t//Drawing ship enemy============================\n\t\t\tenemyArr[i].N_x += 0.2;\n\t\t\tship_01()\n\n\t\t//Drawing ship enemy============================\n\n\t\t//Drawing AsteroidRed enemy============================\n\t\t\t\n\t\t\tasteroidDraw()\n\n\t\t//Drawing AsteroidRed enemy============================\n\n\n\t\t//Drawing redShip Freg Lazer enemy============================\n\t\t\t\tif(enemyArr[i].name === 'redShip'){\n\n\t\t\t\t\tenemyArr[i].fire++;\n\n\t\t\t\t\tif(enemyArr[i].fire%80 === 0){\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+10, (enemyArr[i].y+enemyArr[i].height) , 0, 3, 10, 15,'enemyLazer', 1)\n\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t\n\n\t\t\t\tif(enemyArr[i].name === 'redFregat'){\n\n\t\t\t\t\tenemyArr[i].fire++;\n\n\t\t\t\t\tif(enemyArr[i].fire%160 === 0){\n\n\t\t\t\t\t\tlet firstL;\n\t\t\t\t\t\tif(enemyArr[i].x+10 > hero.x){\n\t\t\t\t\t\t\tfirstL = randomNum(-2, -1)\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tfirstL = randomNum(1, 2)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+10, (enemyArr[i].y+enemyArr[i].height) , firstL, 2, 10, 15,'enemyLazer', 1)\n\n\t\t\t\t\t\tlet secondL;\n\t\t\t\t\t\tif(enemyArr[i].x+10 > hero.x){\n\t\t\t\t\t\t\tsecondL = randomNum(-2, -1)\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tsecondL = randomNum(1, 2)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taddEnemyLazer(enemyLazerImg, enemyArr[i].x+70, (enemyArr[i].y+enemyArr[i].height) , secondL, 2, 10, 15,'enemyLazer', 1)\n\t\t\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\n\t\t\t\tredShipFregLazer()\n\t\t//Drawing redShip Freg Lazer enemy============================\n\n\t\t//delete enemy from array===================\n\t\tif( enemyArr[i].y >=300 || enemyArr[i].y < -50 || enemyArr[i].x >=520 || enemyArr[i].x < -10){\n\n\t\t\tenDead = true;\n\t\t\tif(enDead){\n\t\t\t\tenemyArr.splice(i, 1);\n\n\t\t\t}\n\t\t}\n\t\t//delete enemy from array===================\n\t}\n}", "drawPlayer() {\n ctx.fillStyle = this.sprite;\n ctx.fillRect(this.positionX, this.positionY, this.height, this.width);\n }", "function draw()\n{\n translate(400, 300);\n if (j == 1 && orderArr.length == 1)\n {\n draw_enemy(orderArr[0]);\n }\n if( frameCount % 6 == 0 && j < orderArr.length)\n {\n if (j == 1)\n {\n draw_enemy(orderArr[0]);\n }\n push();\n stroke(0, 0, 255, 90);\n strokeWeight(4);\n lastEnemy = orderArr[j-1];\n enemy = orderArr[j];\n x = lastEnemy.pos.x;\n y = lastEnemy.pos.y;\n x1 = enemy.pos.x;\n y1 = enemy.pos.y;\n line(x,y,x1,y1);\n draw_enemy(lastEnemy);\n draw_enemy(enemy);\n pop();\n ++j;\n }\n}", "function _draw(ctx){\r\n\t\t// the _draw() method renders all of our game objects on the stage\r\n\t\t// for now we just have single object (our ship)\r\n\t\tship.draw(ctx);\r\n\t}", "function draw() {\n\tbackground(0, 204, 0); // Background color\n\timageMode(CENTER); // Expands the image from the center of the coordinate it'll be located from\n\timage(stageBackground, width / 2, height / 2, width, height); // Stage the background to expand in the center and fit the canvas width and height\n\ttextTemplate.displayScore(); // Displays the score on screen, will increment by 100 everytime an enemy is killed\n\tdisplayFrequency();\n\n\tvirus.virusX -= virus.virusSpeed; // Virus move towards the left\n\n\t// If the shoot button has been pressed it'll display the bullet\n\tif (bullet.shootButton === true) {\n\t\t// Causes the bullet to be displayed\n\t\tbullet.display();\n\t}\n\t// Have to be displayed below if statement above otherwise bullet will display ontop of megaman\n\timage(imgMegaman, megaman.megamanX, megaman.megamanY, 100, 100); // Displays megaman based on coordinates\n\timage(imgVirus, virus.virusX, virus.virusY, 100, 100); // Displays the virus enemy based on coordinates\n\n\tbulletHitEnemy(); // Uses the custom built function for what happens when the bullet hits the enemy\n\n\t// This if statement makes the virus automatically change it's sprite as it moves\n\t// if (round(virus.virusX) - virus.virusX === 0.5) {\n\t// \timgVirus = loadImage(stage.stageVirusDefault[0]);\n\t// } else {\n\t// \timgVirus = loadImage(stage.stageVirusAction[0]);\n\t// }\n\n\t// I use this if statement to show print to console the position of my mouse location when the mouse is pressed\n\t// if (mouseIsPressed) {\n\t// \tprint(`x: ${mouseX} y: ${mouseY}`);\n\t// }\n}", "drawExistingEnemies() {\n const enemies = this.enemiesManager.entitiesDisplayed;\n for (let index = 0; index < enemies.length; index++) {\n enemies[index].draw(this.ctx);\n }\n }", "Draw(){\n\t\tthis.context.beginPath();\n\t\tthis.context.fillRect(this.posX, this.posY, this.width, this.height);\n\t\tthis.context.closePath();\n }", "draw() {\n let sprite = this.sprite;\n if (sprite == null)\n return;\n ctx.drawImage(sprite.sprite, sprite.animationFrame * sprite.width, 0, sprite.width, sprite.height, this.rect.x + sprite.xOffset, this.rect.y + sprite.yOffset, this.rect.width * sprite.xStretch, this.rect.height * sprite.yStretch);\n if (Entity.showEntityRects) {\n ctx.beginPath();\n ctx.lineWidth = \"5\";\n ctx.strokeStyle = \"#00ff00\";\n ctx.rect(this.rect.x, this.rect.y, this.rect.width, this.rect.height);\n ctx.stroke();\n }\n }", "function EnemyChar() {\r\n this.width = enemySize;\r\n this.height = enemySize;\r\n this.xPos = canvas.width - enemySize; // print outside the screen\r\n this.yPos = canvas.height - enemySize;\r\n}", "function Enemy() {\n this.srcX = 131;\n this.srcY = 500;\n this.width = 128;\n this.height = 78;\n this.speed = 2;\n this.drawX = Math.floor(Math.random() * 1000) + gameWidth;\n this.drawY = Math.floor(Math.random() * 422);\n}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // drawCharacters();\n\n // don't draw them on first few screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ) {\n ;\n }\n else {\n //drawCharacters();\n }\n \n // draw the p5.clickables, in front of the mazes but behind the sprites\n clickablesManager.draw();\n}", "function drawElements(){\r\n // console.log(\"drawElements CALLED\")\r\n // console.log(`player.x = ${player.x} - - - player Y = ${player.y}`)\r\n \r\n ctx.rect(player.x, player.y, 40, 40);\r\n ctx.stroke()\r\n}", "function draw(){\n ctx.fillStyle = \"black\";\n ctx.clearRect(0,0, 1200, 300);\n ctx.beginPath();\n ctx.fillRect(0, 0, 1000, 400);\n //Call function for robot head drawing\n robotHead();\n // Draw mountain range in background\n mountainRange();\n targetDraw();\n if(monster == 1){\n\tmonster1();\n }\n if(monster == 2){\n\tmonster2();\n }\n if(monster == 3){\n\tmonster3();\n }\n screenText();\n ctx.strokeStyle = 'white';\n ctx.stroke();\n // call draw livebars function\n livebars();\n}", "function paintEnemies(enemies) {\n enemies.forEach(function (enemy) {\n enemy.y += 5;\n enemy.x += getRandomInt(-15, 15);\n\n // Paint only if not dead\n if (!enemy.isDead) {\n paintTriangle(enemy.x, enemy.y, 20, '#ff0000', 'down');\n }\n\n // Paint enemy shots\n enemy.shots.forEach(function (shot) {\n shot.y += SHOOTING_SPEED; // Enemy shots go down\n paintTriangle(shot.x, shot.y, 5, '#00ffff', 'down');\n });\n });\n}", "draw(ctx) {\n if (this.walkingRight) {\n this.walkRightAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.walkingLeft) {\n this.walkLeftAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.walkingForward) {\n this.walkForwardAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.walkingDownward) {\n this.walkDownwardAnimation.drawFrame(this.game, this.game.clockTick, ctx, this.x, this.y, 1);\n }\n else if (this.shooting) {\n this.shootBolt(ctx);\n }\n else if (this.raising) {\n this.raiseShield(ctx);\n }\n else if (this.swinging) {\n this.swingSword(ctx);\n }\n else if (this.casting) {\n this.castSpell(ctx);\n }\n else {\n this.standStill(ctx);\n }\n\n Entity.prototype.draw.call(this);\n }", "function draw() {\n\t\t\t\tctx.fillStyle = \"black\";\n\t\t\t\tctx.fillRect(0,0,canvasWidth, canvasHeight);\n\t\t\t\tplayer.draw();\n\t\t\t\tcomputer.draw();\n\t\t\t\tball.draw();\n\t\t\t}", "function draw() {\n // menggambar dicanvas sekaligus aksi\n drawShip();\n drawEnemy();\n drawPeluru();\n \n // aksi tembak\n tembak();\n \n // update score & lives board\n update();\n}", "draw(ctx) {\n let xOffset = 0;\n let yOffset = 0;\n if (this.dead) {\n if (this.deadAudio) {\n ASSET_MANAGER.playAsset(\"./audio/player_death.mp3\")\n this.deadAudio = false;\n }\n\n if (this.weapon === 0 && this.facing === 0) {\n xOffset = -45;\n yOffset = -23;\n } else if (this.weapon === 0 && this.facing === 1) {\n xOffset = -35;\n yOffset = -20;\n } else if (this.weapon === 1 && this.facing === 0) {\n xOffset = -75;\n yOffset = -45;\n } else if (this.weapon === 1 && this.facing === 1) {\n xOffset = -0;\n yOffset = -42;\n } else if (this.weapon === 2 && this.facing === 0) {\n xOffset = -65;\n yOffset = -40;\n } else if (this.weapon === 2 && this.facing === 1) {\n xOffset = -30;\n yOffset = -30;\n\n }\n if (this.facing === 0) {\n this.deadAnimR[this.weapon].drawFrame(this.game.clockTick, ctx, this.x - this.game.camera.x + xOffset,\n this.y - this.game.camera.y + yOffset, 1);\n } else {\n this.deadAnimL[this.weapon].drawFrame(this.game.clockTick, ctx, this.x - this.game.camera.x + xOffset,\n this.y - this.game.camera.y + yOffset, 1);\n }\n } else {\n if (this.weapon === 0) {\n xOffset = 0;\n yOffset = 0;\n } else if (this.weapon === 1) {\n if (this.state === 0) {\n if (this.facing === 1) yOffset = 1;\n this.facing === 0 ? xOffset = 0 : xOffset = -27;\n } else if (this.state === 1 && this.facing === 1) {\n xOffset = -15;\n yOffset = 0;\n } else if (this.state === 2 && this.facing === 0) {\n xOffset = -18;\n yOffset = -15;\n } else if (this.state === 2 && this.facing === 1) {\n xOffset = -68;\n yOffset = -15;\n } else if (this.state === 3 && this.facing === 1) {\n xOffset = -45;\n yOffset = 0;\n } else if (this.state === 4 && this.facing === 1) {\n xOffset = -20;\n yOffset = -5;\n }\n } else { //if bow\n //console.log(this.facing + \" \" + this.state);\n if (this.state === 0) {\n yOffset = 1;\n this.facing === 0 ? xOffset = 0 : xOffset = 0;\n } else if (this.state === 2) {\n this.facing === 0 ? xOffset = 0 : xOffset = -7;\n } else if (this.state === 4) {\n yOffset = 5;\n }\n\n }\n yOffset -= 5;\n this.animations[this.state][this.facing][this.weapon].drawFrame(this.game.clockTick, ctx,\n this.x - this.game.camera.x + xOffset, this.y - this.game.camera.y + yOffset, 1);\n\n }\n\n if (PARAMS.DEBUG) {\n // ctx.strokeStyle = 'Red';\n // ctx.strokeRect(this.BB.x - this.game.camera.x, this.BB.y - this.game.camera.y, this.BB.width, this.BB.height);\n ctx.strokeStyle = 'Blue';\n ctx.strokeRect(this.ABB.x - this.game.camera.x, this.ABB.y - this.game.camera.y, this.ABB.width, this.ABB.height);\n\n } else if (this.weapon === 2) {\n ctx.strokeStyle = 'White';\n //ctx.arc()\n ctx.strokeRect(this.ABB.x - this.game.camera.x, this.ABB.y - this.game.camera.y, this.ABB.width, .25);\n }\n }", "function draw(){\ncanCon.clearRect(0, 0, canCon.width, canCon.height);\n\n//stuff to draw\nbearer.draw();\nshield.draw();\n\n// draw Backscatter Buster Shots\nfor(var index = 0; index < playerPro.length; index++){\n playerPro[index].draw();\n}\n\n// draw enemies\nfor(var index = 0; index < enemies.length; index++){\n enemies[index].draw();\n}\n\n// draw enemy projectiles\nfor(var index = 0; index < enemyPro.length; index++){\n enemyPro[index].draw();\n}\n\n// draw HUD over everything\nScoreDisplay.draw();\nHealthDisplay.draw();\n}", "function draw(){\r\n ctx.globalAlpha = 1;\r\n ctx.clearRect(0,0,_WIDTH,_HEIGHT);\r\n //DRAW BG\r\n ctx.drawImage(_BG,0,0);\r\n //DRAW ENEMY PATH\r\n if(DRAWPATHFLAG==1){\r\n\t ctx.beginPath();\r\n\t ctx.moveTo(_DESTARRAY[0][0],_DESTARRAY[0][1]);\r\n\t for(var i=0;i<_DESTARRAY.length;i++){\r\n\t\t ctx.lineTo(_DESTARRAY[i][0],_DESTARRAY[i][1]);\r\n\t }\r\n\t ctx.stroke();\r\n\t ctx.fillStyle = \"rgba(0,0,0,0.4)\";\r\n \t\tif(_POLYARRAY.length > 0){\r\n \t\t ctx.beginPath();\r\n\t\t ctx.moveTo(_POLYARRAY[0][0],_POLYARRAY[0][1]);\r\n\t\t for(var i=0;i<_POLYARRAY.length;i++){\r\n\t\t\t ctx.lineTo(_POLYARRAY[i][0],_POLYARRAY[i][1]);\r\n \t\t }\r\n \t\t ctx.closePath();\r\n \t\t ctx.fill();\r\n \t\t}\r\n }\r\n \r\n \r\n\t \r\n \r\n //Handle towers\r\n for(var i=0;i<allTowers.length;i++){\r\n\tvar collide = 0;//stores collision info\r\n allTowers[i].draw();\r\n\t//Handle tower bullets\r\n\tfor(var i2=0;i2<allTowers[i].allBullets.length;i2++){\r\n\t //Propel bullets\r\n\t allTowers[i].allBullets[i2].shootTowards();\r\n\t //Clean up bullets\r\n\t collide = allTowers[i].detectBulletCollision(i2,allEnemies);\r\n\t if(allTowers[i].allBullets[i2].x>=_WIDTH || allTowers[i].allBullets[i2].x<=0 || allTowers[i].allBullets[i2].y>=_HEIGHT || allTowers[i].allBullets[i2].y<=0 || collide>-1 || collide==-2){\r\n\t\tif(collide>-1){\r\n\t\t\tallEnemies[collide].health-=allTowers[i].damage;\r\n\t\t}\r\n\t allTowers[i].allBullets.splice(i2,1);\r\n\t }\r\n\t}\r\n }//End handling of towers\r\n \r\n //Handle enemies\r\n for(var i=0;i<allEnemies.length;i++){\r\n\t if(allEnemies[i].x>_WIDTH || allEnemies[i].x<0 || allEnemies[i].y>_HEIGHT || allEnemies[i].y<0){\r\n\t allEnemies.splice(i,1);\r\n\t\tplayer.health-=10;\r\n\t }\t\t \r\n\t if(allEnemies[i].health<=0){\r\n\t\tplayer.money+=allEnemies[i].reward;\r\n\t\tallEnemies.splice(i,1);\r\n\t }\r\n\t allEnemies[i].draw(); \t \r\n }//End handling of enemies\r\n \r\n for(var i=0;i<towerButtons.length;i++){\r\n\t towerButtons[i].draw();\r\n }\r\n if(selectedTower==-1)\r\n button[2].fill = \"rgba(240,0,50,.6)\";\r\n else\r\n button[2].fill = \"rgba(0,0,0,1)\";\r\n for(var i=2;i<button.length;i++){\r\n\t button[i].draw();\r\n }\r\n button[0].text = _ESPEED;\r\n button[1].text = _ESPEED\r\n button[0].draw();\r\n button[1].draw();\r\n \r\n //Draw upgrade buttons\r\n for(var i=0;i<allTowers.length;i++){\r\n\tfor(var i2=0;i2<allTowers[i].upgradeButtons.length;i2++){\r\n\t\tif(allTowers[i].upgradeButtons[i2].value.cost > player.money){\r\n\t\t allTowers[i].upgradeButtons[i2].fill = \"rgba(255,10,10,.6)\";\r\n\t\t}else\r\n\t\t allTowers[i].upgradeButtons[i2].fill = \"rgba(10,20,200,.8)\";\r\n\t\tif(allTowers[i].rangeFlag == 1)\r\n\t\tallTowers[i].upgradeButtons[i2].draw();\r\n\t}\r\n }\r\n \r\n //Draw player stats\r\n ctx.font = \"bold 12px sans-serif\";\r\n ctx.fillText(\"Health: \"+player.health, 0, 20);\r\n ctx.fillText(\"Money: \"+player.money, 0, 40)\r\n ctx.fillText(\"Next Wave: \"+waveTime,0,60);\r\n ctx.fillText(\"Wave: \"+_WAVECOUNT+\"/\"+_WAVE.length,0,80);\r\n\r\n //Draw building preview\r\n ctx.globalAlpha = 0.5;\r\n if(!notInPolygon(_MOUSEX,_MOUSEY)&&_CURRTOWER!=\"\"||player.money<_CURRTOWER.cost){\r\n ctx.fillStyle=\"rgba(255,20,20,1)\";\r\n ctx.fillRect(_MOUSEX-(_CURRTOWER.width/2),_MOUSEY-(_CURRTOWER.height/2),_CURRTOWER.width,_CURRTOWER.height);\r\n ctx.fillStyle=\"rgba(0,0,0,1)\";\r\n }\r\n ctx.drawImage(_CURRTOWER.img,_MOUSEX-(_CURRTOWER.width/2),_MOUSEY-(_CURRTOWER.height/2));\r\n \r\n}", "function draw(){\n\tif(gameOn){\n\t\tupdate();\n\t\tmonsterFun();\n\t\tnewMonsterFun();\n\t}\n\t\n\tcontext.drawImage(backgroundImage, 0,0);\n\tcontext.drawImage(hero, heroLocation.x, heroLocation.y);\n\tcontext.drawImage(monster, monsterLocation.x, monsterLocation.y);\n\n\tif (hero.bombPlace == true){\n\t\tcontext.drawImage(bomb, bombLocation.x, bombLocation.y);\n\t}\n\tif (hero.bombTimer == true){\n\t\thero.bombTimer = false;\n\t\tsetTimeout(function(){\n\t\t\thero.bombPlace = false;\n\t\t}, 6000);\n\t\t\n\t}\n\tif (hero.explosion == true){\n\t\tcontext.drawImage(explosion, bombLocation.x, bombLocation.y);\n\t\tbombLocation.x = 900;\n\t\tbombLocation.y = 900;\n\t\thero.explosion = false;\n\t\tnewMonsterLocation.spawn = true;\n\t\t// setTimeout(function(){\n\t\t// \thero.explosion = false;\n\t\t// }, 1000);\n\t}\n\tif (newMonsterLocation.spawn == true){\n\t\tcontext.drawImage(newMonster, newMonsterLocation.x, newMonsterLocation.y);\n\t}\n\trequestAnimationFrame(draw);\n}", "function drawShooting(x, y){\n graphics.fillRect(x, y, 10, 5);\n graphics.fillStyle = \"Red\";\n //graphics.fillRect(225, 480, 15, 15);\n //graphics.fillRect(x, y, 15, 15);\n }", "function draw() {\n\tctx.clearRect(0, 0, WIDTH, HEIGHT);\n\tctx.fillStyle = \"rgba(0,0,0,0)\";\n\tctx.fillRect(0, 0, WIDTH, HEIGHT);\n\tctx.save();\n\tctx.fillStyle = \"#fff\";\n\tplayer.draw();\n\tdrawlist(bullets);\n\tdrawlist(enemies);\n\tctx.fillStyle = \"blue\";\n\tctx.font = \"25px Helvetica\";\n\tctx.fillText(\"SCORE: \" + score, 10, 30);\n\tif (player.dead) {\n\t ctx.fillStyle = \"red\";\n ctx.font = \"35px Helvetica\";\n ctx.fillText(\"Game Over!\", WIDTH/2 - ctx.measureText(\"Game Over!\").width/2, (HEIGHT)/1.35);\n ctx.font = \"30px Helvetica\";\n ctx.fillText(\"press 'R' to play again\", WIDTH/2 - ctx.measureText(\"press 'R' to play again\").width/2, (HEIGHT)/1.25);\n };\n\tctx.restore();\n}", "function draw() {}", "function draw() {}", "function drawChar(){\r\n\t\t\r\n\t\tgc.beginPath();\r\n\t\tgc.rect(player.x, player.y, player.w, player.h);\r\n\t\tgc.fillStyle = playerColour;\r\n\t\tgc.fill();\r\n\t\tgc.closePath();\r\n\t\t\r\n\t}", "draw() {\n\n spiel.ctx.beginPath();\n spiel.ctx.fillStyle = \"ghostwhite\";\n spiel.ctx.fillRect(this.posX, this.posY, this.height, this.width);\n\n spiel.ctx.closePath();\n }", "function draw() {\n\t//clear the board\n\tctx.clearRect(0, 0, canvas[0].width, canvas[0].height);\n\n\t//draw the player\n\tplayer.draw(ctx);\n\n\t//draw the turrets\n\t$.each(turrets, function(i,turr) {\n\t\tturr.draw(ctx);\n\t});\n\n\t//draw the projectiles\n\t$.each(projectiles, function(i,proj) {\n\t\tproj.draw(ctx);\n\t});\n\n\t//draw the effects\n\t//make sure damaging effects are on top\n\tvar damagingEffects = [];\n\t$.each(effects, function(i,eff) {\n\t\tif (eff.getDoesDamage()) {\n\t\t\tdamagingEffects.push(eff);\n\t\t} else {\n\t\t\teff.draw(ctx);\n\t\t}\n\t});\n\n\t$.each(damagingEffects, function(i,eff) {\n\t\teff.draw(ctx);\n\t});\n}", "update(dt) {\n this.x += (level * enemySpeed) * dt;\n\n // When the enemy moves off the screen, the X position will be reset\n if (this.x > CANVAS_WIDTH) {\n this.x = randomX();\n }\n\n }", "update(dt) {\n this.x += (level * fasterEnemySpeed) * dt;\n\n // When the enemy moves off the screen, the X and Y positions will be reset\n if (this.x > CANVAS_WIDTH) {\n this.x = randomX();\n this.y = randomY();\n }\n\n }", "function Enemy (width, height, color, x, y){\n //set the current active enemy to true\n this.active = true;\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y;\n this.xVelocity = 1;\n //keep enemies in bounds\n this.inBounds = function(){\n return this.x >= 0 && this.x <= 6656\n && this.y >= 0 && this.y <= 468;\n };\n this.image= './images/enemy.png';\n this.draw = function (){\n const enemyImg = new Image();\n enemyImg.src = this.image;\n ctx.drawImage(enemyImg, this.x, this.y, this.width, this.height)\n },\n this.update = function (){\n //enemy starts at position x which changes negatively\n this.x -= this.xVelocity;\n this.xVelocity = 1; \n this.active = this.active && this.inBounds();\n };\n this.die = function(){\n this.active = false;\n };\n \n }", "draw(ctx) {\n if (Math.round(parseFloat(this.floatY) * 10) > 50) {\n this.step = -.1\n }\n else if (Math.round(parseFloat(this.floatY) * 10) < -50) {\n this.step = +.1\n }\n if (!this.drank) {\n ctx.drawImage(this.imagesheet, 0, 0, 50, 65, this.x - this.game.camera.x, this.y - this.game.camera.y + this.floatY, this.w, this.h);\n }\n if (PARAMS.DEBUG) {\n if (PARAMS.DEBUG) {\n ctx.strokeStyle = 'Red';\n ctx.strokeRect(this.BB.x - this.game.camera.x, this.BB.y - this.game.camera.y + this.floatY, this.BB.width, this.BB.height);\n }\n }\n }", "function draw() {\n background(0);\n for (let i = 0; i < agents.length; i++) {\n agents[i].update();\n agents[i].display();\n }\n\n for (let i = 1; i < agents.length; i++) {\n\n if (agents[0].collide(agents[i])) {\n agents[0].eat(agents[i]);\n }\n}\n\n}", "function Enemy() {\n var percentFire = .01;\n var chance = 0;\n this.alive = false;\n /*\n * Sets the Enemy values\n */\n this.spawn = function (x, y, speed) {\n this.x = x;\n this.y = y;\n this.speed = speed;\n this.speedX = 0;\n this.speedY = speed;\n this.alive = true;\n this.leftEdge = this.x - 90;\n this.rightEdge = this.x + 90;\n this.bottomEdge = this.y + 140;\n };\n /*\n * Move the enemy\n */\n this.draw = function () {\n this.context.clearRect(this.x - 1, this.y, this.width + 1, this.height);\n this.x += this.speedX;\n this.y += this.speedY;\n if (this.x <= this.leftEdge) {\n this.speedX = this.speed;\n } else if (this.x >= this.rightEdge + this.width) {\n this.speedX = -this.speed;\n } else if (this.y >= this.bottomEdge) {\n this.speed = 1.5;\n this.speedY = 0;\n this.y -= 5;\n this.speedX = -this.speed;\n }\n this.context.drawImage(imageRepository.enemy, this.x, this.y);\n // Enemy has a chance to shoot every movement\n chance = Math.floor(Math.random() * 101);\n if (chance / 100 < percentFire) {\n this.fire();\n }\n };\n /*\n * Fires a bullet\n */\n this.fire = function () {\n game.enemyBulletPool.get(this.x + this.width / 2, this.y + this.height, -2.5);\n }\n /*\n * Resets the enemy values\n */\n this.clear = function () {\n this.x = 0;\n this.y = 0;\n this.speed = 0;\n this.speedX = 0;\n this.speedY = 0;\n this.alive = false;\n };\n}", "update(dt){\n //set the point when the enemy is outside the screen\n if (this.x > 5) {\n this.offscreen = true;\n }\n\n\t\tvar random = Math.floor(Math.random() * 5);\n\n\t\t//replace the enemy\n\t\tif (this.offscreen) {\n\t\t\tthis.x = -random;\n this.offscreen = false;\n\t\t} else {\n\t\t\tthis.x += dt;\n\t\t}\n }", "function draw() {\r\n\r\n // draw game background\r\n display.fill('white');\r\n\r\n // draw game map\r\n drawMap();\r\n\r\n // draw potential tower if player is dragging a tower\r\n if (controller.dragging && controller.isMouseInCanvas()) {\r\n drawNewTower();\r\n };\r\n\r\n // display buffer\r\n display.draw(); \r\n}", "function canvasTurn() {\n /* Ensuring that object do not go over the canvas */\n if (this.x >= (canvas.width - this.width)) { //transporting enemy from the right side of canvas to left side.\n this.x = 0;\n }\n if (this.y >= (canvas.height - this.height)) { //transporting enemy from the botton side of canvas to up side.\n this.y = 0;\n }\n if (this.x < 0) { //transporting enemy from the left side of canvas to right side.\n this.x = canvas.width - this.width;\n }\n if (this.y < 0) { //transporting enemy from the up side of canvas to botton side.\n this.y = canvas.height - this.height;\n }\n}", "function Enemy() {\n this.speed = 1;\n this.word;\n \n \n this.draw = function() {\n \n // Update moved location\n this.y += this.speed;\n // Draw\n this.context.drawImage(this.word.img, this.x, this.y);\n };\n \n this.init = function(x,y, index) {\n this.x=x;\n this.y=y;\n this.word = game.wordBank[index];\n\tgame.wordBank.splice(index, 1);\n };\n}", "function drawEverything() {\n\tcolorRect(0,0,canvas.width,canvas.height,\"black\"); // background screen size and color\n\tcolorRect(player1X,player1Y,PLAYER_WIDTH,PLAYER_HEIGHT,\"green\"); // player\n\tcolorRect(enemy1X,enemy1Y,ENEMY_1_WIDTH,ENEMY_1_HEIGHT,\"red\"); // enemy 1\n\t\n\tcanvasContext.font=\"26px Helvetica\";\n\tcanvasContext.fillStyle=\"white\";\n\tcanvasContext.fillText((\"Time: \" + time.toString()), 25, 50); \n\n}", "draw(){\n \n \n \n image(this.spriteSheet, this.charX, this.charY, this.frameWidth*1.5, this.frameHeight*1.5, this.currentFrameX, this.currentFrameY, this.frameWidth, this.frameHeight);\n }", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // draw the p5.clickables, in front of the mazes but behind the sprites \n clickablesManager.draw();\n\n // No avatar for Splash screen or Instructions screen\n if( adventureManager.getStateName() !== \"Splash\" && \n adventureManager.getStateName() !== \"Instructions\" ) {\n \n // responds to keydowns\n moveSprite();\n\n // this is a function of p5.js, not of this sketch\n drawSprite(playerSprite);\n } \n}", "function draw_die(context){\n context.fillStyle = \"#003399\";\n context.beginPath();\n context.moveTo(ball_visual.centre_x, ball_visual.centre_y - 75);\n context.lineTo(ball_visual.centre_x + 70, ball_visual.centre_y + 50);\n context.lineTo(ball_visual.centre_x - 70, ball_visual.centre_y + 50);\n context.fill();\n}", "draw(ctx){\n ctx.save();\n ctx.fillStyle = \"green\";\n ctx.fillRect(this.x-this.width/2,this.y-this.height/2,this.width,this.height);\n ctx.restore();\n }", "function draw() {\n // A pink background\n image(bgimg2, 400, 250)\n\n // Default the avatar's velocity to 0 in case no key is pressed this frame\n avatarVX = 0;\n avatarVY = 0;\n\n // Check which keys are down and set the avatar's velocity based on its\n // speed appropriately\n\n // Left and right\n if (keyIsDown(LEFT_ARROW)) {\n avatarVX = -avatarSpeed;\n }\n else if (keyIsDown(RIGHT_ARROW)) {\n avatarVX = avatarSpeed;\n }\n\n // Up and down (separate if-statements so you can move vertically and\n // horizontally at the same time)\n if (keyIsDown(UP_ARROW)) {\n avatarVY = -avatarSpeed;\n }\n else if (keyIsDown(DOWN_ARROW)) {\n avatarVY = avatarSpeed;\n }\n\n // Move the avatar according to its calculated velocity\n avatarX = avatarX + avatarVX;\n avatarY = avatarY + avatarVY;\n\n // The enemy always moves at enemySpeed\n enemyVX = enemySpeed;\n // Update the enemy's position based on its velocity\n enemyX = enemyX + enemyVX;\n\n // Check if the enemy and avatar overlap - if they do the player loses\n // We do this by checking if the distance between the centre of the enemy\n // and the centre of the avatar is less that their combined radii\n if (dist(enemyX,enemyY,avatarX,avatarY) < enemySize/2 + avatarSize/2) {\n // Reset the enemy's position\n enemyX = 0;\n enemyY = random(0,height);\n // Reset the avatar's position\n avatarX = width/2;\n avatarY = height/2;\n // Reset the dodge counter\n dodges = 0;\n }\n\n // Check if the avatar has gone off the screen (cheating!)\n if (avatarX < 0 || avatarX > width || avatarY < 0 || avatarY > height) {\n // If they went off the screen they lose in the same way as above.\n console.log(\"YOU LOSE!\");\n enemyX = 0;\n enemyY = random(0,height);\n avatarX = width/2;\n avatarY = height/2;\n dodges = 0;\n }\n\n // Check if the enemy has moved all the way across the screen\n if (enemyX > width) {\n // This means the player dodged so update its dodge statistic\n dodges = dodges + 1;\n // Tell them how many dodges they have made\n console.log(dodges + \" DODGES!\");\n // Reset the enemy's position to the left at a random height\n enemyX = 0;\n\n //changed the spawn location of a successful dodge to make it so the enemy will spawn at the avatar's current Y position.... It will ALWAYS go after you!\n enemyY = avatarY;\n\n //Enemy size will increase according to how many successful dodges there are\n enemySize = 70+dodges*10;\n\n //enemy speed will multiply according to how many successful dodges there are\n enemySpeed = 5+dodges;\n }\n\n//background will change if dodge score reachs 5..... or more (if you avoid more than 10, you're going to hell)\n\n if(dodges>=5){\n image(bgimg3, 400,250);\n }\n\n if(dodges>=10){\n image(bgimg, 400, 250);\n }\n\n//will display total number of dodges when the enemy's speed = 0, aka when it resets (amount of responsibilities avoided)\n if(enemySpeed===0){\n\n }\n else{dodgesScore=\"# of responsibilities you have avoided: \" + dodges;}\n textSize(15+dodges);\n fill(255); //white font\n text(dodgesScore,20,50);\n\n // Display the number of successful dodges in the console\n console.log(dodges);\n\n // The player is a student\n image(student,avatarX,avatarY,avatarSize,avatarSize);\n\n // The enemy is are books.... responsibilities\n image(books,enemyX,enemyY,enemySize,enemySize);\n\n}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n clickablesManager.draw();\n\n for( let i = 0; i < clickables.length; i++ ) {\n clickables[i].visible = false;\n }\n\n if( gDebugMode == true ) {\n drawDebugInfo();\n }\n}", "drawExistingEntities() {\n this.drawExistingBullets();\n this.drawExistingEnemies();\n this.hero.draw(this.ctx);\n }", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "drawSelf(theCanvas, user, theGame) {\n theCanvas.clearEnemy(this);\n this.playerInVicinity(user);\n if (!this.playerIsSeen) {\n let enemyDirection = this.direction % 4;\n if (enemyDirection === 0 && (this.id === 0 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x, this.y + 35)) {\n this.y += 5;\n this.currDirection = \"S\";\n } else {\n if (this.id === 0) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (enemyDirection === 1 && (this.id === 5 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x + 35, this.y)) {\n this.x += 5;\n this.currDirection = \"E\";\n } else {\n if (this.id === 5) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingRight[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (enemyDirection === 2 && (this.id === 0 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x, this.y - 15)) {\n this.y -= 5;\n this.currDirection = \"N\";\n } else {\n if (this.id === 0) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingUp[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (enemyDirection === 3 && (this.id === 5 || this.id === 4)) {\n if (!theCanvas.detectLine(this.x - 15, this.y)) {\n this.x -= 5;\n this.currDirection = \"W\";\n } else {\n if (this.id === 5) {\n this.direction += 2;\n } else {\n this.direction++;\n }\n }\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingLeft[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }\n\n //changes behavior of enemy once player is in distance\n } else {\n if (user.x === this.x || user.x === this.x + 5 || user.x === this.x - 5) {\n if(user.y > this.y){\n this.currDirection = 'S';\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else{\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingUp[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n this.currDirection = 'N'\n }\n this.attackPlayer(user, theGame);\n \n } else if(user.y === this.y || user.y === this.y + 5 || user.y === this.y - 5){\n if(user.x > this.x){\n this.currDirection = 'E';\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingRight[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else{\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingLeft[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n this.currDirection = 'W'\n }\n this.attackPlayer(user, theGame);\n }else{\n if (user.x > this.x && !theCanvas.detectLine(this.x + 35, this.y) && !theCanvas.detectLine(this.x, this.y + 40) && !theCanvas.detectLine(this.x, this.y + 45)) {\n this.x += 5;\n this.currDirection = \"E\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingRight[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (\n user.y < this.y &&\n !theCanvas.detectLine(this.x, this.y - 15)\n ) {\n this.y -= 5;\n this.currDirection = \"N\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingUp[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else if (\n user.x < this.x &&\n !theCanvas.detectLine(this.x - 15, this.y)\n ) {\n this.x -= 5;\n this.currDirection = \"W\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingLeft[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n } else if (\n user.y > this.y &&\n !theCanvas.detectLine(this.x, this.y + 35) && !theCanvas.detectLine(this.x, this.y + 40) && !theCanvas.detectLine(this.x, this.y + 45)\n ) {\n this.y += 5;\n this.currDirection = \"S\";\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }else{\n let currIndexOfEnemy = this.indexOfImage % 4;\n let img = this.enemyMovingDown[currIndexOfEnemy];\n theCanvas.drawEnemy(img, this);\n }\n }\n }\n }", "function drawEverything(){\n myGameArea.clear();\n //draw moving background\n drawBackground();\n //add the new position of the bullet to the update step\n playerBullets.forEach(function(bullet){\n bullet.update();\n });\n playerBullets.forEach(function(bullet){\n bullet.draw();\n });\n //filter the list of bullet to only add the active bullets\n playerBullets = playerBullets.filter(function(bullet){\n return bullet.active;\n });\n //add the new enemy to the array of enemies\n enemies.forEach(function(enemy){\n enemy.update();\n });\n // filter the list of enemies\n enemies = enemies.filter(function(enemy){\n return enemy.active;\n })\n enemies.forEach(function(enemy){\n enemy.draw();\n });\n \n player.newPos();\n player.update();\n // myGameArea.score();\n \n \n }", "function draw(){\n background(0);\n moveBullet();\n drawGame();\n ellipse(x, y, 50, 50);\n if (keyIsDown(LEFT_ARROW)) {\n if(x>25){\n x -=5;\n }\n \n }\n \n if (keyIsDown(RIGHT_ARROW)) {\n \n if(x+30 <600){\n x +=5;\n }\n\n }\n if (keyIsDown(UP_ARROW)){\n bullets.push([x, y]);\n }\n for(let i=0; i<14;i++){\n e[i].drawEnemy();\n e[i].moveEnemy(); \n }\n}", "function draw() {\r\n requestAnimationFrame(draw);\r\n if (numberOfMissiles < 50) {\r\n missileGeneration();\r\n }\r\n moveMissile();\r\n TWEEN.update();\r\n renderer.render(scene,camera);\r\n}", "function draw() {\n background(100, 100, 200);\n drawBorder();\n\n if (!gameOver) {\n handleInput();\n\n movePlayer();\n moveEnemies();\n movePrey();\n\n updateHealth();\n checkCollisions();\n\n drawPrey();\n drawEnemies();\n drawPlayer();\n } else {\n showGameOver();\n }\n}", "function Enemy(x, y, r ,g, b, s, range)\n{\n this.x = x;\n this.y = y;\n this.r = r;\n this.g = g;\n this.b = b;\n this.s = s;\n this.range = range;\n this.currentX = x;\n this.inc = 1;\n \n this.update = function()\n {\n this.currentX += this.inc; \n if(this.currentX >= this.x + this.range)\n {\n this.inc = -1;\n }\n else if(this.currentX < this.x)\n {\n this.inc = 1;\n }\n };\n \n this.draw = function()\n {\n this.update();\n push();\n translate(this.currentX, this.y);\n \n scale(this.s); // Set the scale\n var c = color(this.r, this.g, this.b);\n stroke(c); // Set the body colour\n strokeWeight(70);\n line(0, -35, 0, -65); // Body\n noStroke();\n fill(255 - this.g); //face\n ellipse(-17.5, -65, 35, 35); // Left eye dome\n ellipse(17.5, -65, 35, 35); // Right eye dome\n arc(0, -65, 70, 70, 0, PI); // Chin\n fill(this.g);\n ellipse(-14, -65, 8, 8); // Left eye\n ellipse(14, -65, 8, 8); // Right eye\n quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak\n pop();\n \n };\n this.checkContact = function(gc_x, gc_y)\n {\n var d = dist(gc_x, gc_y, this.currentX, this.y); \n if(d < 20)\n { \n if(lives != 0){\n lives -= 1;\n } \n player.isDead = true;\n deathSound.setVolume(0.1);\n deathSound.play();\n return true;\n } \n return false;\n }\n}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // Only draw scorecard on certain screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ||\n adventureManager.getStateName() === \"Four\" ||\n adventureManager.getStateName() === \"Five\" ||\n adventureManager.getStateName() === \"Eight\" ||\n adventureManager.getStateName() === \"Eleven\") {\n ;\n }\n else {\n stressCard.draw();\n }\n\n // draw the p5.clickables in front\n clickablesManager.draw();\n}", "function drawPlayer () {\r\n rect(player.x, player.y, player.w, player.h, player.col, \"fill\");\r\n}", "draw(){\n if (this.alive === true) image(this.spriteSheet, this.x, this.y, this.frameWidth*1.5, this.frameHeight*1.5, this.currentFrameX, this.currentFrameY, this.frameWidth, this.frameHeight);\n }", "render(cam){\n //get the position that the camera sees\n let x = this.x - cam.x + canvas.width/2;\n let y = this.y - cam.y + canvas.height/2;\n\n //draw the enemy\n if (!this.walking){\n c.drawImage(this.images[this.dir-1][2],x-this.width,y-this.height,this.width*2,this.height*2);\n }\n else{\n c.drawImage(this.images[this.dir-1][this.animation],x-this.width,y-this.height,this.width*2,this.height*2);\n if (time > this.animation_cooldown){\n this.animation_cooldown = time+200;\n if (this.animation == 1){\n this.animation = 0;\n }\n else{\n this.animation = 1;\n }\n }\n }\n\n //if recently damaged\n if (this.show_health){\n //display health\n progress_bar(this.health,this.max_health, x-this.width/2, y-(this.height/2+10), this.width, this.height/10, '#BB0000', '#000000')\n }\n }", "function draw() {\n\n\t//clear the canvas\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\n\t//draw the ball\n\tdrawPaddle();\n\tdrawBall();\n\tdrawScore();\n\n\t//advance the ball\n\tx += dx;\n\ty += dy;\n\n\tif (downPressed && paddleY < canvas.height - paddleHeight) {\n\t\tpaddleY += paddledY;\n\t} else if (upPressed && paddleY > 0) {\n\t\tpaddleY -= paddledY;\n\t}\n\n\tif ((enemyY + paddleHeight) < canvas.height) {\n\t\tif (enemyY < y) {\n\t\t\tenemyY += enemyDy;\n\t\t}\n\n\t}\n\t//if the enemy is bellow 0\n\tif (enemyY > 0) {\n\t\t//if the enemy is bellow the ball.\n\t\tif (enemyY > y) {\n\t\t\tenemyY -= enemyDy;\n\t\t}\n\n\t}\n\n\tcheckCollision();\n\tcheckScore();\n}", "function draw() {\n //~~~ intro 1 ~~~//\n if (gameState === \"intro1\") {\n // play the ambient sound effect\n ambience.play();\n //display the screen\n introScreen1.display();\n\n //~~~ intro 2 ~~~//\n } else if (gameState === \"intro2\") {\n // play the ambient sound effect\n ambience.play();\n //play the siren sound effect\n siren.play();\n //display the screen\n introScreen2.display();\n\n //~~~ playing ~~~//\n } else if (gameState === \"playing\") {\n ambience.play();\n //display the background image\n background(backgroundImage);\n //display the destination planet\n planetAmazon.display();\n //display the enemies\n displayEnemies();\n //display the explosions\n displayExplosions();\n // Handle movment of the player\n player.move();\n // display the phazers, and check for collision with enemies\n handlePhazers();\n //detects if player has collided with enemy\n player.detectCollision();\n //displays the player's crosshairs, and the ship\n player.display();\n\n\n //~~~ game Over ~~~//\n } else if (gameState === \"gameOver\") {\n //play the gameover bells\n gameOverBells.play();\n //play the evil evilLaugh\n evilLaugh.play();\n //display the game over screen\n gameOverScreen.display();\n //remove any stray enemies\n for (let e = 0; e < enemies.length; e++) {\n enemies.splice(e, 1);\n }\n }\n\n //~~~ game won ~~~//\n else if (gameState === \"gameWon\") {\n gameWonScreen.display()\n //remove any stray enemies\n for (let e = 0; e < enemies.length; e++) {\n enemies.splice(e, 1);\n console.log(enemies.length);\n }\n }\n}", "draw()\n {\n this.ctx.clearRect(0, 0, this.surfaceWidth, this.surfaceHeight);\n this.ctx.save();\n for (let i = 0; i < this.entities.length; i++)\n {\n this.entities[i].draw(this.ctx);\n }\n this.ctx.restore();\n }", "function renderEntities() { \n allEnemies.forEach(function(enemy) {\n enemy.render();\n }); \n\n player.render();\n }", "function drawEnemies() {\n\n for (i = 0; i < numberOfEnemies; i++) {\n\n fill(enemyFill, enemyHealth);\n ellipse(enemyX[i], enemyY[i], enemyRadius * 2);\n\n }\n}", "function draw() {\n computeBoardSize(board);\n\n context.drawImage(\n this,\n current_x_offset,\n current_y_offset,\n board.width,\n board.height\n );\n\n positionPlayer();\n clearBlinkers();\n\n for (let i of allObjects) {\n if (isInView(i.x, i.y) && !i.completed) {\n const [x, y] = normalize_image_position(i.x, i.y);\n createBlinker(x, y, i.isGold);\n }\n }\n }", "function draw() {\n background(0);\n updateLasers();\n ship.draw();\n ship.update();\n ship.turn();\n ship.edges();\n}", "draw() {\n\n // only display the dirt if it is visible... \n if (this.visible){\n\n ctxDATA.fillStyle = this.color; \n ctxDATA.fillRect(this.x, this.y, this.w, this.h);\n \n // end of visibility check \n }\n\n // end of the draw method for the Dirt \n }", "draw(context) {\r\n\r\n var x = this.sprite.x_pos + this.sprite.x_offset;\r\n var y = this.sprite.y_pos + this.sprite.y_offset;\r\n\r\n context.fillStyle = '#ffffff';\r\n\r\n if (this.sprite.debug) {\r\n if (this.ghost.direction_current != null && this.ghost.direction_future != undefined) {\r\n context.fillText('Direction Current=' + this.ghost.direction_current.name, x + 20 + this.sprite.width, y + 40);\r\n context.fillText('Direction Future=' + this.ghost.direction_future.name, x + 20 + this.sprite.width, y + 60);\r\n }\r\n }\r\n //context.fillText('Target', 300, 280);\r\n super.draw(context);\r\n\r\n }", "function Enemy()\n{\n\tvar percentFire = .01; //controls how many bullets are fired\n\tvar chance = 0;\n\tthis.alive = false;\n\tthis.collidableWith = \"bullet\";\n\tthis.type = \"enemy\";\n\t/*\n\t * Sets the Enemy values\n\t */\n\tthis.spawn = function(x, y, speed)\n {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.speed = speed;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = speed;\n\t\tthis.alive = true;\n\t\tthis.lives = 2;\n\t\tthis.leftEdge = this.x - 100;\n\t\tthis.rightEdge = this.x;\n\t\tthis.bottomEdge = this.y + 140;\n\t};\n\t/*\n\t * Move the enemy\n\t */\n\tthis.draw = function()\n {\n\t\tthis.context.clearRect(this.x-1, this.y, this.width+1, this.height);\n\t\tthis.x += this.speedX;\n\t\tthis.y += this.speedY;\n\t\tif (this.x <= this.leftEdge)\n {\n\t\t\tthis.speedX = this.speed;\n\t\t}\n\t\telse if (this.x >= this.rightEdge + this.width)\n {\n\t\t\tthis.speedX = -this.speed;\n\t\t}\n\t\telse if (this.y >= this.bottomEdge)\n {\n\t\t\tthis.speed = 4;\n\t\t\tthis.speedY = 0;\n\t\t\tthis.y -= 5;\n\t\t\tthis.speedX = -this.speed;\n\t\t}\n if (!this.isColliding)\n {\n\t\t\tthis.context.drawImage(imageRepository.enemy, this.x, this.y);\n\n\t\t\t// Enemy has a chance to shoot every movement\n\t\t\tchance = Math.floor(Math.random()*101);\n\t\t\tif (chance/100 < percentFire)\n {\n\t\t\t\tthis.fire();\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t\telse if(this.isColliding && this.lives > 0)\n {\n\t\t\tthis.lives--;\n\t\t\tthis.isColliding = false;\n\t\t}\n\t\telse if(this.isColliding && this.lives == 0)\n {\n game.playerScore += 20;\n game.explosion.get();\n\t\t\treturn true;\n\t\t}\n\t};\n\t/*\n\t * Fires a bullet\n\t */\n\tthis.fire = function() {\n\t\tgame.enemyLaser.get();\n\t\tgame.enemyBulletPool.get(this.x+this.width/2, this.y+this.height, -2.5);\n\t}\n\t/*\n\t * Resets the enemy values\n\t */\n\tthis.clear = function() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.speed = 0;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = 0;\n\t\tthis.alive = false;\n this.isColliding = false;\n\t};\n}", "function enemys()\r\n {\r\n // potential enemy\r\n fill(300, 150, 100);\r\n // draw the shape\r\n fill(\"red\");\r\n rect(210, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(235, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(225, shapeY, 15, 15);\r\n ellipse(245, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(245, shapeY, 10, 10);\r\n ellipse(225, shapeY, 10, 10);\r\n\r\n\r\n // Enemy 2\r\n fill(\"purple\");\r\n rect(310, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(335, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(325, shapeY, 15, 15);\r\n ellipse(345, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(345, shapeY, 10, 10);\r\n ellipse(325, shapeY, 10, 10);\r\n\r\n\r\n // Enemy 3\r\n fill(\"orange\");\r\n rect(110, shapeY, 50, 25); //bottom half of ghost\r\n ellipse(135, shapeY, 50, 50); //top half of ghost\r\n fill(\"white\"); //eye whites\r\n ellipse(125, shapeY, 15, 15);\r\n ellipse(145, shapeY, 15, 15);\r\n fill(\"blue\");//blue part of eyes\r\n ellipse(145, shapeY, 10, 10);\r\n ellipse(125, shapeY, 10, 10);\r\n\r\n // get a random speed when the it first starts\r\n shapeXSpeed = Math.floor(Math.random() * (Math.floor(Math.random() * 5)) + 1);\r\n shapeYSpeed = Math.floor(Math.random() * (Math.floor(Math.random() * 5)) + 1);\r\n\r\n // move the shape\r\n shapeX += shapeXSpeed;\r\n shapeY += shapeYSpeed;\r\n }", "function displayEnemy(x, y, text) {\n var pos = document.getElementById(x + y)\n pos.innerHTML = text\n // console.log(`Enemy Loaded: ${text}`);\n }", "function Invasion(){\n \n\t\tfor(var i = AlienToShoot() ; i < Enemyx.length; i++){\n \n\t\t\tif(AlienToShoot() <= 40 ){\n\t\t\t\tEnemyShoot[i] == true\n\t\t\t\n\t\t\t}\n\n\t\t\tif(EnemyShoot[i] == true){\n\n \n\t\t\t\t\tctx.fillStyle = 'red';\n\t\t\t\t\tctx.fillRect(EnemyLx[i] + 13, EnemyLy[i] + 13 , 5, 10);\n\t\t\t\t\tEnemyLy[i] += 15;\n\t\t\t\t}\n\t\t\t\tif(EnemyLy[i] >= 460){\n\t\t\t\t\tEnemyShoot[i] = false;\n\t\t\t\t}\n\t\t\t\tif(EnemyLy[i] >= 460 && EnemyShoot[i] == false){\n\t\t\t\t\t\tEnemyLy[i] = 300000;\n\t\t\t\t\t\tEnemyLy[i] -= 0;\n\t\t\t\t}\n \n\t\t}\n\t}", "function draw() {\n context.fillStyle = '#212121';\n context.fillRect(0, 0, canvas.width, canvas.height);\n \n drawMatrix(arena, {x: 0, y:0});\n drawMatrix(player.matrix, player.pos); \n}", "draw()\n {\n Renderer.drawImage(this.tex.texture, this.tex.width, this.tex.height, 0, 0, this.tex.width, this.tex.height, this.x, this.y, this.width, this.height);\n }", "function enemy(x,y){\n this.width = 64;\n this.height = 64;\n id=\"enemy1\";\n type=\"motion\";\n layer=2;\n var tags=[\"damaging\",\"enemy\"];\n Entity.call(this,x,y,id,layer,type,tags);\n this.wentUp=false;\n this.yVel=0;\n this.hp=100;\n this.flashFrames=0;\n this.facing=\"left\";\n this.update = function(){\n this.wentUp=false;\n if(this.flashFrames>0){\n this.flashFrames=this.flashFrames-1;\n }\n distance=getDistance(this, game.currentLevelData.playerRef);\n if(this.hp<=0){\n playASound(\"soundEffects/slimeEnemyDeath.mp3\")\n this.remove();\n }\n if(distance<=500){\n this.yVel=this.yVel+1\n if(this.yVel>30){\n (this.yVel=30);\n }\n this.y=this.y+this.yVel;\n if(player.x-this.x <= 0){\n this.x=this.x-3;\n this.facing=\"left\";\n }\n else{\n this.x=this.x+3;\n this.facing=\"right\";\n }\n }\n }\n this.draw = function(){\n if(this.flashFrames%2==0){\n if(this.facing==\"left\"){\n var img = ImageAtlas[this.id];\n ctx.drawImage(\n img, // image\n 600+(this.x-player.x), // target x\n 330+(this.y-player.y), // target y\n 64, // target width\n 64 // target height\n );\n }\n else{\n var img = ImageAtlas[enemy1RKey];\n ctx.drawImage(\n img, // image\n 600+(this.x-player.x), // target x\n 330+(this.y-player.y), // target y\n 64, // target width\n 64 // target height\n );\n } \n }\n }\n this.collision = function(entityC){\n entitySide=checkSide(this,entityC);\n if(entityC.tags.includes(\"block\")){\n sideColided=checkSide(this , entityC)\n if(sideColided==\"bottom\"){\n this.y=entityC.y-64;\n this.yVel=0;\n }\n if(sideColided==\"top\"){\n this.y=entityC.y+64;\n }\n if(sideColided==\"left\"){\n if(this.wentUp==false && game.currentLevelData.playerRef.y<=this.y+5){\n this.y=this.y-15;\n this.wentUp=true;\n }\n this.x=entityC.x+64;\n }\n if(sideColided==\"right\"){\n if(this.wentUp==false && game.currentLevelData.playerRef.y<=this.y+5){\n this.y=this.y-15;\n this.wentUp=true;\n }\n this.x=entityC.x-64;\n }\n }\n if(entityC.tags.includes(\"ladder\")){\n if(game.currentLevelData.playerRef.y<=this.y){\n if(this.wentUp==false){\n this.y=this.y-15;\n this.wentUp=true;\n }\n }\n if(game.currentLevelData.playerRef.y>=this.y){\n this.y=this.y+5;\n }\n this.y=this.y+1;\n }\n if(entityC.id.includes(\"water\")){\n if(game.currentLevelData.playerRef.y<=this.y){\n if(this.wentUp==false){\n this.y=this.y-15;\n this.wentUp=true;\n }\n }\n }\n }\n}", "function draw() {\r\n if(backgroundImg)\r\n background(backgroundImg);\r\n //background(40);\r\n console.log(monster1.y);\r\n Engine.update(engine);\r\n arrow.display();\r\n slingshot.display();\r\n slingshot1.display();\r\n speed(monster1,ground1);\r\n speed(monster2,ground2);\r\n speed(monster3,ground3);\r\n speed(monster4,ground4);\r\n speed(monster5,ground5);\r\n speed(monster6,ground6);\r\n\r\n\r\n //TEXT INSTRUCTIONS\r\n textSize(24);\r\n fill(\"red\");\r\n text(\"Arrows Used: \"+arrowScore,30,50);\r\n text(\"/6\",195,50); \r\n text(\"Monsters Hit: \"+monsterScore,30,90);\r\n if(arrowScore===6&&monsterScore<6){\r\n textSize(36);\r\n text(\"All Arrows Used!\",500,400);\r\n text(\"Refresh to Play Again!\",450,450);\r\n }\r\n if(arrowScore<=6&&monsterScore===6){\r\n textSize(64);\r\n text(\"YOU WIN!\",500,400);\r\n }\r\n //TEXT INSTRUCTIONS END\r\n drawSprites(); \r\n}", "draw() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n // display problem\n this.drawProblem()\n // display input field\n if (this.input) {\n this.input._value = ''\n }\n \n this.drawInputField()\n\n // draw attacks\n this.attacks.draw(this.ctx, this.attackIndex)\n\n // draw player data\n this.player.drawPlayerData(this.ctx)\n // draw computer data\n this.computer.drawComputerData(this.ctx)\n \n }", "function draw()\n{\n\tdraw_sprite(canvas, mirror, 300, 30);\n\tdraw_sprite(canvas, nam, nam_x, man_y);\n\tif (draw_text) textout_centre(canvas, font, \"you suck\", 400, 60+man_x/5, font_size, makecol(100,0,0));\n\tif (draw_text) textout_centre(canvas, font, \"& are stupid\", 400, 150+man_x/5, font_size, makecol(100,0,0));\n\tif (draw_alt_text) textout_centre(canvas, font, \"believe in\", 400, 150, 8, makecol(128, 200, 255));\n\tif (draw_alt_text) textout_centre(canvas, font, \"yourself\", 400, 190, 8, makecol(128, 200, 255));\n\tdraw_sprite(canvas, not_mirror, 0, 0);\n\tdraw_sprite(canvas, man, man_x, man_y);\n}", "draw(context){\n if(this.depth < this.maxDepth){\n context.drawImage(this.buffer, 0, Math.ceil(this.depth));\n if(this.creature){\n this.drawSprite(context);\n //context.strokeStyle = this.creature.type === \"plant\" ? '#008000':'#f00'; // some color/style\n //context.lineWidth = 2; // thickness\n //context.strokeRect(x, y, 32, 32);\n }\n }\n //context.fillText(this.name, this.center.x - 20, this.center.y + 10);\n }", "function draw() {\n // clears the canvas before drawing\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawText('white', \"24px Helvetica\", \"left\", \"top\", \"Points: \" + POINTS, 0, 0);\n drawText('white', \"24px Helvetica\", \"left\", \"top\", \"\" + powername, 0, 745);\n\n //drawing sprites\n player.draw();\n for (let b of balls) {\n b.draw();\n }\n for (let p of powerups) {\n p.draw();\n }\n for (let w of walls) {\n w.draw();\n }\n for (let m of mobs1) {\n m.draw();\n }\n}", "draw(g, x, y, friendo) {\n this.anim.draw(g, x, y, friendo)\n }", "function Enemy() {\n\tvar percentFire = 0.0001;\n\tvar chance = 0;\n\tthis.alive = false;\n\tthis.collidableWith = \"bullet\";\n\tthis.type = \"enemy\";\n\n\tthis.spawn= function(x,y,speed) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.speed = speed;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = 2;\n\t\tthis.alive = true;\n\t\tthis.leftEdge = this.x -200;\n\t\tthis.rightEdge = this.x + 100;\n\t\tthis.bottomEdge = this.y + this.height*5 + 30;\n\t};\n\t/**\n\t\tMove the enemy\n\t*/\n\tthis.draw = function() {\n\t\tthis.ctx.clearRect(this.x-1,this.y,this.width+1,this.height);\n\t\tthis.x += this.speedX;\n\t\tthis.y += this.speedY;\n\t\tif (this.x <= this.leftEdge) {\n\t\t\tthis.speedX = this.speed;\n\t\t} else if (this.x >= this.rightEdge + this.canvasWidth) {\n\t\t\tthis.speedX = -this.speed;\n\t\t} else if (this.y >= this.bottomEdge) {\n\t\t\tthis.speedY = 0;\n\t\t\tthis.y -= 5;\n\t\t\tthis.speedX = -this.speed;\n\t\t}\n\n\t\tif (!this.isColliding) {\n\t\t\tthis.ctx.drawImage(imgRepo.enemy, this.x,this.y);\n\t\t\t//Enemy has a chance to shoot everytime it moves\n\t\t\tchance = Math.floor(Math.random()*101);\n\t\t\tif (chance/100 <= percentFire) {\n\t\t\t\tthis.fire();\n\t\t\t}\n\t\t\treturn false;\n\t\t} else {\n\t\t\tgame.playerScore += 10;\n\t\t\tgame.explosion.get();\n\t\t\treturn true;\n\t\t}\n\t};\n\n\t/**\n\t\tFire a bullet\n\t*/\n\tthis.fire = function() {\n\t\t//Grab a bullet and place it at the center of the ships \n\t\t//position and at the front. It's negative speed because we want to go down the screen.\n\t\tgame.enemyBulletPool.get(this.x+this.width/2,this.y+this.height, -2.5);\n\t}\n\t/**\n\t\tClear and reset the position of the enemy\n\t*/\n\tthis.clear = function() {\n\t\tthis.x = 0;\n\t\tthis.y =0;\n\t\tthis.speed = 0;\n\t\tthis.speedX = 0;\n\t\tthis.speedY = 0;\n\t\tthis.alive = false;\n\t\tthis.isColliding = false;\n\t}\n}", "function Enemy(x,y,range)\n{\n\n //Local variables for the enemy character. \n this.x = x;\n this.y = y;\n this.range = range;\n this.current_x = x;\n this.incr = 1;\n\n //Constructor function that draws the enemy character.\n\n this.draw = function()\n {\n fill(0);\n ellipse(this.current_x, this.y -25, 50);\n fill(255,0,0);\n ellipse(this.current_x -8,this.y -25, 10);\n ellipse(this.current_x +8,this.y -25, 10);\n rect(this.current_x +5, this.y -50, 5);\n \n }\n\n //Updates position of the enemy character and makes it move on it's own.\n\n this.update = function()\n {\n this.current_x += this.incr;\n if(this.current_x < this.x)\n {\n this.incr = 1.5; \n }\n else if(this.current_x > this.x + this.range)\n {\n this.incr = -1.5;\n }\n\n }\n\n this.isContact = function(gc_x, gc_y)\n {\n //This function will return true if game character makes contact.\n\n var distance = dist(gc_x, gc_y, this.current_x, this.y);\n\n if(distance < 25)\n {\n return true;\n }\n\n return false;\n }\n}", "function draw(){\t\n\trequestAnimationFrame(draw); //allows for maximum use of the hardwares potential\n}", "function createEnemy(x, y) {\n var enemy = game.createGameItem('enemy',25);\n enemy.x = x;\n enemy.y = groundY-50;\n game.addGameItem(enemy);\n var enemyImage = draw.bitmap('img/bad guy clock.png');\n enemy.addChild(enemyImage);\n enemyImage.x = -25;\n enemyImage.y = -25;\n enemy.velocityX = -4;\n enemyImage.scaleX=.08;\n enemyImage.scaleY=.08;\n enemy.onPlayerCollision = function() {\n game.changeIntegrity(-30);\n enemy.shrink();\n console.log('Halle got smacked lol');\n };\n enemy.onProjectileCollision = function() {\n console.log('Halle did the smacking lol');\n game.increaseScore(50);\n enemy.fadeOut();\n };\n }", "function render() {\n enemyLaunchTimer = game.time.events.add(game.rnd.integerInRange(min_enemy_spacing, max_enemy_spacing), enemyLaunchTimer);\n }", "renderPlayer() {\r\n this.ctx.beginPath();\r\n this.ctx.arc(this.posX, this.posY, 40, 0, 2 * Math.PI);\r\n this.ctx.stroke();\r\n }", "draw(){\n\t\tif(this.dead === false){\n\t\t\tpush();\n\t\t\ttranslate(this.loc.x, this.loc.y);\n\t\t\tlet angle = this.vel.heading();\n\t\t\trotate(angle);\n\t\t\t//rotate(this.angle);\n\t\t\t//rectMode(RADIUS);\n\t\t\tfill(255, 0, 0);\n\t\t\tnoStroke();\n\t\t\t//rect(0,0, 14, 14);\n\t\t\ttriangle(20, 0, -10, 14, -10, -14);\n\t\t\tpop();\n\t\t}\n\t}", "function createEnemy(x,y){\n var enemy = game.createGameItem('enemy',25);\n var redSquare = draw.bitmap('img/dogenemy.png');\n redSquare.x = -25;\n redSquare.y = -25;\n redSquare.scaleX = 0.2;\n redSquare.scaleY = 0.2;\n enemy.addChild(redSquare);\n \n enemy.x = x;\n enemy.y = y;\n \n game.addGameItem(enemy);\n enemy.velocityX = -3;\n enemy.onPlayerCollision = function() {\n console.log('The enemy has hit Halle');\n game.changeIntegrity(-10);\n game.increaseScore(100);\n enemy.fadeOut();\n };\n enemy.onProjectileCollision = function() {\n console.log('Halle has hit the enemy');\n enemy.fadeOut();\n };\n}", "function draw() {\n var isHit = false; // Initialize to false\n background(0);\n drawTerrain();\n\n wallManager(); // Add and remove walls as they enter and leave the screen.\n \n // Update all walls position and draw.\n for (let i=0; i<walls.length; i++) {\n walls[i].move();\n walls[i].draw();\n isHit |= walls[i].isHitBy(trump); // True if hit by any wall.\n }\n trump.DEBUG = isHit; // Show debug overlay when hit.\n if (isHit) {trump.deathEvent();} // Perform Death functions and sounds.\n \n trump.applyGravity();\n trump.draw();\n}", "function render() {\n ctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\n // draw background\n background.draw(ctx);\n\n // draw earth\n earth.draw(ctx);\n moon.draw(ctx);\n\n\n // draw asteroids\n //asteroid_1.update();\n //asteroid_1.draw(ctx);\n //asteroid_2.draw(ctx);\n\n //bullet.draw(ctx);\n\n // explosion\n //explosion.draw(ctx);\n\n\n}", "render() {\n\t\tif(this.getHealth() <= 0)\n\t\t\treturn;\n\n\t\tlet tank = this.getMapping();\n\t\tthis.term.bold();\n\t\tthis.term.red();\n\n\t\tif (!this.enemy) {\n\t\t\tthis.term.green();\n\t\t}\n\n\t\t// terminal coordinates are [1,1 - width,height]\n\t\tfor (let i = 0; i < tank.length; i++) {\n\t\t\tfor (let j = 0; j < tank[i].length; j++) {\n\t\t\t\tthis.term.moveTo(this.x + j + 1, this.y + i + 1, tank[i][j]);\n\t\t\t}\n\t\t}\n\n\t\tthis.term.styleReset();\n\t}", "function draw()\n{\n context.clearRect(0, 0, canvas.width, canvas.height);\n context.drawImage(playerStickman,240,100);\n context.drawImage(enemyStickman,1280,100);\n context.drawImage(playerFace,240,100);\n \n context.drawImage(enemyFace,1280,100);\n \n //context.drawImage(enemyHead,1280,100);\n \n \n //fire element\n //context.beginPath();\n //context.arc(200, 785, 40, 0, 2 * Math.PI);\n //context.lineWidth = 5;\n //context.stroke();\n //context.closePath();\n //air element\n //context.beginPath();\n //context.arc(320, 785, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //water element\n //context.beginPath();\n //context.arc(440, 785, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n \n //earth element\n //context.beginPath();\n //context.arc(560, 785, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //player head\n //context.beginPath();\n //context.arc(372, 250, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //timer\n context.beginPath();\n context.arc(950, 120, 60, 0, 2 * Math.PI);\n context.stroke();\n context.closePath();\n //enemy head\n //context.beginPath();\n //context.arc(1500, 250, 40, 0, 2 * Math.PI);\n //context.stroke();\n //context.closePath();\n //middle line\n context.beginPath();\n context.moveTo(950, 250);\n context.lineTo(950,900);\n context.stroke();\n //context.lineWidth = 10;\n context.closePath();\n //enemyElement;\n //window.onload = enemyElement;\n context.font=\"16pt Arial\";\n context.strokeText(timer, 50,101);\n\n}", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.rect(this.position.x - width/2, this.position.y - width/2, width, width);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "draw() {\n noStroke();\n if (this.color) {\n fill(this.color.x, this.color.y, this.color.z);\n } else {\n fill(0);\n }\n rect(this.pos.x, this.pos.y, this.w, this.h);\n }" ]
[ "0.7704279", "0.76720333", "0.75942516", "0.75852585", "0.7545957", "0.73656297", "0.7299305", "0.7139672", "0.7126999", "0.710894", "0.7098004", "0.7076215", "0.70599836", "0.703447", "0.69608325", "0.6957194", "0.69456416", "0.69164747", "0.69161505", "0.6909478", "0.689721", "0.6895071", "0.6861181", "0.68566567", "0.6845041", "0.68267965", "0.68199056", "0.67908835", "0.6784292", "0.6782088", "0.6775721", "0.6775721", "0.67653143", "0.6761288", "0.67392474", "0.67373544", "0.6734942", "0.67322296", "0.67257154", "0.6723996", "0.67144424", "0.67004377", "0.66934764", "0.6693108", "0.6684523", "0.668268", "0.6680092", "0.66727793", "0.6651626", "0.66443706", "0.663808", "0.66352963", "0.66298646", "0.6628547", "0.6628547", "0.6628161", "0.6625679", "0.6620013", "0.66179997", "0.66103315", "0.6608321", "0.66036123", "0.6603552", "0.660013", "0.659907", "0.6593706", "0.65815234", "0.6581507", "0.6580461", "0.65769666", "0.65702784", "0.6565653", "0.65613925", "0.65586686", "0.6558179", "0.6556464", "0.65480995", "0.6544207", "0.6538474", "0.6538095", "0.6535923", "0.6535728", "0.6525501", "0.65247077", "0.65239453", "0.6521432", "0.6520944", "0.65199095", "0.6507554", "0.6506828", "0.650609", "0.64971185", "0.6494351", "0.6493609", "0.64818275", "0.6481684", "0.6479694", "0.6479485", "0.64752215", "0.6468593", "0.64684147" ]
0.0
-1
defines arrow key control for the player and does not allow player move off the grid
handleInput(key) { if (this.x > 0 && key === 'left') { this.x -= 101; } if (this.x < 404 && key === 'right') { this.x += 101; } if (this.y > 0 && key === 'up') { this.y -= 83; } if (this.y < 395 && key === 'down') { this.y += 83; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyControl(event) {\n if (event.keyCode == 37 && buttonPressed != true && gameOver != true) {\n keyPressed = true;\n p.moveLeft();\n } else if (event.keyCode == 38 && buttonPressed != true && gameOver != true) {\n keyPressed = true;\n p.rotate();\n rotateSound.play();\n } else if (event.keyCode == 39 && buttonPressed != true && gameOver != true) {\n keyPressed = true;\n p.moveRight();\n } else if (event.keyCode == 40 && buttonPressed != true && gameOver != true) {\n keyPressed = true;\n p.moveDown();\n }\n }", "function control (e){\r\n if(e.keyCode ===37){\r\n moveLeft()\r\n \r\n }else if (e.keyCode === 38){\r\n rotate()\r\n }else if(e.keyCode=== 39){\r\n moveRight()\r\n }else if(e.keyCode===40){\r\n moveDown()\r\n }\r\n}", "function control(e) {\n //Remove snake from current squares\n squares[currentIndex].classList.remove(\"snake\");\n\n //Check which key is pressed\n if(e.keyCode === 39) {\n direction = 1;\n } else if(e.keyCode === 38) {\n direction = -width;\n } else if(e.keyCode === 37) {\n direction = -1;\n } else if(e.keyCode === 40) {\n direction = +width;\n }\n}", "function control(e) {\n\n // Remove class from squares\n squares[currentIndex].classList.remove('snake');\n\n // Check for movement key input\n if (e.keyCode === 39) {\n\n // Pressing the right arrow\n direction = 1;\n\n } else if (e.keyCode === 38) {\n\n // Pressing the up arrow\n direction = -width;\n\n } else if (e.keyCode === 37) {\n\n // Pressing the left arrow\n direction = -1;\n\n } else if (e.keyCode === 40) {\n\n // Pressing the down arrow\n direction = +width;\n }\n }", "function control (e) {\n if (document.getElementById('pause-button')) {\n if (e.keyCode === 37) {\n moveLeft()\n } else if (e.keyCode === 38) {\n rotate()\n } else if (e.keyCode === 39) {\n moveRight()\n } else if (e.keyCode === 40) {\n moveDown()\n }\n }\n }", "function control(e) {\r\n if (e.keyCode === 37) {\r\n moveLeft();\r\n } else if (e.keyCode === 38) {\r\n rotate();\r\n } else if (e.keyCode === 39) {\r\n moveRight();\r\n } else if (e.keyCode === 40) {\r\n moveDown();\r\n }\r\n }", "function control(e) {\n\t\tsquares_div[currentIndex].classList.remove('snake'); // we are removing class of snake\n\n\t\tswitch (e.keyCode) {\n\t\t\tcase 38:\n\t\t\t\tdirection = -width;\n\t\t\t\tbreak;\n\t\t\tcase 39:\n\t\t\t\tdirection = 1;\n\t\t\t\tbreak;\n\t\t\tcase 40:\n\t\t\t\tdirection = +width;\n\t\t\t\tbreak;\n\t\t\tcase 37:\n\t\t\t\tdirection = -1;\n\t\t}\n\t}", "function control(e){\n if(e.keyCode === 37){\n moveLeft();\n }else if(e.keyCode ===38){\n rotate();\n }else if(e.keyCode === 39){\n moveRight();\n }else if(e.keyCode === 40){\n moveDown();\n }\n }", "function control(e){\n if(e.keyCode === 37)\n {\n moveLeft();\n }\n\n else if(e.keyCode === 39)\n {\n moveRight();\n }\n else if(e.keyCode === 38)\n {\n rotate();\n }\n else if(e.keyCode === 40)\n {\n moveDown();\n }\n }", "function control (e) {\n if (e.keyCode === 37 || e.keyCode === 65) moveLeft()\n if (e.keyCode === 39 || e.keyCode === 68) moveRight()\n if (e. keyCode === 38 || e.keyCode === 87) rotate()\n if (e.keyCode === 40 || e.keyCode == 83) moveDown()\n }", "function keyControls(){\n \n if(keyWentDown (RIGHT_ARROW)){\n chrono.velocityX=10 \n }\n if(keyWentUp(RIGHT_ARROW)){\n chrono.velocityX=0\n }\n if(chrono.y >-100){\n if(keyDown(\"space\")){\n chrono.velocityY=-4\n }\n }\n \n \n}", "function onKeyDown(event) {\n\tif (paused) return;\n\tlet keyCode = event.which;\n\tswitch (keyCode) {\n\tcase 87: // W\n\tcase 38: // UP Arrow\n\t\tmovePlayer(directionX.NULL, directionZ.UP);\n\t\tbreak;\n\tcase 83: // S\n\tcase 40: // DOWN Arrow\n\t\tmovePlayer(directionX.NULL, directionZ.DOWN);\n\t\tbreak;\n\tcase 65: // A\n\tcase 37: // LEFT Arrow\n\t\tmovePlayer(directionX.LEFT, directionZ.NULL);\n\t\tbreak;\n\tcase 68: // D\n\tcase 39: // RIGHT Arrow\n\t\tmovePlayer(directionX.RIGHT, directionZ.NULL);\n\t\tbreak;\n\t}\n\treturn;\n}", "function control(e) {\n if (e.keyCode === 37) {\n moveLeft();\n } else if (e.keyCode === 38) {\n rotate();\n } else if (e.keyCode === 39) {\n moveRight();\n } else if (e.keyCode === 40) {\n moveDown();\n }\n }", "function control(e) {\n if (e.keyCode === 37) {\n moveLeft();\n } else if (e.keyCode === 38) {\n rotate();\n } else if (e.keyCode === 39) {\n moveRight();\n } else if (e.keyCode === 40) {\n moveDown();\n }\n}", "function control(e) {\n switch(e.keyCode) {\n case 65:\n moveLeft();\n break;\n case 68: \n moveRight();\n break;\n case 87: \n rotate();\n break;\n case 83: \n moveDown();\n break;\n default:\n\n }\n }", "function keyPressed() {\r\n\t//if the right arrow is pressed, Mario will move to the right\r\n\tif (keyCode == RIGHT_ARROW) {\r\n\t\tposX += 25;\r\n\t}\r\n\t//if the left arrow is pressed, Mario will move to the left\r\n\telse if (keyCode == LEFT_ARROW) {\r\n\t\tposX -= 25;\r\n\t}\r\n\t//if the up arrow is pressed, Mario will move up \r\n\telse if (keyCode == UP_ARROW) {\r\n\t\t//when the up button is pressed he will jump\r\n\t\tposY -= 75;\r\n\t}\r\n\t//if the down arrow is pressed, Mario will move down\r\n\telse if (keyCode == DOWN_ARROW) {\r\n\t\tposY += 25;\r\n\t}\r\n}", "function control(e) {\n if(e.keyCode === 37) {\n curP.moveLeft();\n } else if (e.keyCode === 39) {\n curP.moveRight();\n } else if (e.keyCode === 40) {\n curP.softDrop();\n }\n}", "function handleKey(event){ \n switch (event.code){\n case 'ArrowRight':\n playerOne.moveRight() \n break\n case 'ArrowLeft':\n playerOne.moveLeft() \n break \n case 'ArrowUp':\n playerOne.moveUp() \n break\n case 'ArrowDown':\n playerOne.moveDown() \n break\n }\n }", "function handleKey(event) {\n\n\tvar i = gGamerPos.i;\n\tvar j = gGamerPos.j;\n\n\t\n\t// if (i === 0 || i === gBoard.length - 1 || j === 0 || j === gBoard[0].length - 1) {\n\t// \tisBorderPos = true;\n\t// \ti = Math.abs(i - gBoard.length);\n\t// \tj = Math.abs(j - gBoard[0].length);\n\t// }\n\n\tswitch (event.key) {\n\n\t\tcase 'ArrowLeft':\n\t\t\tmoveTo(i, j - 1);\n\t\t\tbreak;\n\t\tcase 'ArrowRight':\n\t\t\tmoveTo(i, j + 1);\n\t\t\tbreak;\n\t\tcase 'ArrowUp':\n\t\t\tmoveTo(i - 1, j);\n\t\t\tbreak;\n\t\tcase 'ArrowDown':\n\t\t\tmoveTo(i + 1, j);\n\t\t\tbreak;\n\t}\n\n\n}", "function control(e) {\n if(e.keyCode === 37) {\n moveLeft()\n } else if (e.keyCode === 38) {\n rotate()\n }\n else if (e.keyCode === 39) {\n moveRight()\n }\n else if (e.keyCode === 40) {\n moveDown()\n }\n}", "function control(e)\r\n {\r\n if(e.keyCode === 37)\r\n {\r\n moveLeft()\r\n }\r\n else if(e.keyCode === 38)\r\n {\r\n rotate()\r\n }\r\n else if(e.keyCode === 39)\r\n {\r\n moveRight()\r\n }\r\n else if(e.keyCode === 40)\r\n {\r\n moveDown()\r\n }\r\n }", "function control(e) {\n switch(e.keyCode) {\n case 37:\n moveLeft()\n break\n case 38:\n rotate()\n break\n case 39:\n moveRight()\n break\n case 40:\n moveDown()\n break\n }\n }", "function control(e) {\n if(e.keyCode === 37) {\n moveLeft()\n } else if (e.keyCode === 38) {\n rotate()\n } else if (e.keyCode === 39) {\n moveRight()\n } else if (e.keyCode === 40) {\n moveDown()\n }\n}", "function control(e) {\n if(e.keyCode === 37) {\n keyLeft()\n } else if (e.keyCode === 38) {\n keyUp()\n } else if (e.keyCode === 39) {\n keyRight()\n } else if (e.keyCode === 40) {\n keyDown()\n }\n }", "function keydownEventHandler(e) {\n // key movement for player up, down, left, right\n if (e.keyCode == 87) { // W key\n playerUp = true;\n }\n if (e.keyCode == 83) { // S key\n playerDown = true;\n }\n if (e.keyCode == 65) { // A key\n playerLeft = true;\n }\n if (e.keyCode == 68) { // D key\n playerRight = true;\n }\n}", "function onKeyUp(event) {\n\n switch (event.key) {\n\n case \"ArrowLeft\":\n moveLeft = false;\n break;\n case \"ArrowRight\":\n moveRight = false;\n break;\n \n default:\n break;\n\n } \n\n}", "function keyPressed(e) {\n if (e.keyCode == 90) {\n controlBlock.ascend = true;\n } else if (e.keyCode == 83) {\n controlBlock.descend = true;\n }\n\n if (e.keyCode == 38) {\n opponentBlock.ascend = true;\n } else if (e.keyCode == 40) {\n opponentBlock.descend = true;\n }\n}", "function movePlayer(e) {\n switch (e.key) {\n case \"a\":\n //If the bottom left of the player box = 0 it will stop moving to the left\n if (playerCurrentPosition[0] > 0) {\n //10 is subtracted from the xAxis when a is pressed\n playerCurrentPosition[0] -= 10;\n player.style.left = playerCurrentPosition[0] + \"px\";\n //draw the new position of the player\n drawPlayer();\n //break out of the switch and listen for more key presses\n }\n break;\n\n case \"d\":\n //if the bottom left + the player width is equal to the board width it will stop moving to the right\n if (playerCurrentPosition[0] < boardWidth - playerWidth) {\n //10 is added to the xAxis when d is pressed\n playerCurrentPosition[0] += 10;\n player.style.left = playerCurrentPosition[0] + \"px\";\n drawPlayer();\n }\n break;\n }\n}", "function keyupEventHandler(e) {\n if (e.keyCode == 87) { // W key\n playerUp = false;\n }\n if (e.keyCode == 83) { // S key\n playerDown = false;\n }\n if (e.keyCode == 65) { // A key\n playerLeft = false;\n }\n if (e.keyCode == 68) { // D key\n playerRight = false;\n }\n}", "function checkKeyPressUp(e)\r\n{\r\n\tcheckPlayer();\r\n\tif (e.which == 65 || e.keyCode == 65 || e.which == 68 || e.keyCode == 68 || e.which == 83 || e.keyCode == 83 || e.which == 32 || e.keyCode == 32)\r\n\t{\r\n\t\tif(PlayerFace == WALKING_RIGHT)\r\n\t\t{\r\n\t\t\tPLAYER.src = IDLE_RIGHT;\r\n\t\t\trightKey = false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(PlayerFace == WALKING_LEFT)\r\n\t\t\t{\r\n\t\t\t\tPLAYER.src = IDLE_LEFT;\r\n\t\t\t\tleftKey = false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(PlayerFace == BLOCKING_LEFT)\r\n\t\t\t\t{\r\n\t\t\t\t\tPLAYER.src = IDLE_LEFT;\r\n\t\t\t\t\tblockKey = false;\r\n\t\t\t\t\t//positionY += 1;\r\n\t\t\t\t\tpositionX -= 1;\r\n\t\t\t\t\tplayerPos();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif(PlayerFace == BLOCKING_RIGHT)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tPLAYER.src = IDLE_RIGHT;\r\n\t\t\t\t\t\tblockKey = false;\r\n\t\t\t\t\t\t//positionY += 1;\r\n\t\t\t\t\t\tpositionX += 5;\r\n\t\t\t\t\t\tplayerPos();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(PlayerFace == ATTACKING_LEFT)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tPLAYER.src = IDLE_LEFT;\r\n\t\t\t\t\t\t\tpositionX += 41;\r\n\t\t\t\t\t\t\tplayerPos();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(PlayerFace == ATTACKING_RIGHT)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tPLAYER.src = IDLE_RIGHT;\r\n\t\t\t\t\t\t\t\tpositionX += 41;\r\n\t\t\t\t\t\t\t\tplayerPos();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "MoveKey() {}", "function setGameControls() {\n\n function eventHandler(event) {\n\n // Prevent arrows from moving the page around\n if(event.keyCode && [32, 37, 38, 39, 40].indexOf(event.keyCode) > -1) {\n event.preventDefault();\n }\n \n var token = event.keyCode ? event.keyCode : event.target.id;\n switch (token) {\n case \"d-pad-left\":\n moveInterval = setInterval(function() { movePlayer(\"left\") }, 100);\n case 37:\n case 65:\n // D-pad left, left arrow, keyboard \"a\" button\n movePlayer(\"left\");\n break;\n case \"d-pad-up\":\n moveInterval = setInterval(function() { movePlayer(\"up\"); }, 100);\n case 38:\n case 87:\n // D-pad up, up arrow, keyboard \"w\" button\n movePlayer(\"up\");\n break;\n case \"d-pad-right\":\n moveInterval = setInterval(function() { movePlayer(\"right\"); }, 100);\n case 39:\n case 68:\n // D-pad right, right arrow, keyboard \"d\" button\n movePlayer(\"right\");\n break;\n case \"d-pad-down\":\n moveInterval = setInterval(function() { movePlayer(\"down\"); }, 100);\n case 40:\n case 83:\n //D-pad down, down arrow, keyboard \"s\" button\n movePlayer(\"down\");\n break;\n case \"a-button\":\n case 75:\n // a-button, keyboard \"k\" button\n if (playerState !== \"locked\") {\n interactOrSelect();\n } else {\n cancelOrBack();\n }\n break;\n case \"b-button\":\n case 76:\n // b-button, keyboard \"l\" button\n cancelOrBack();\n break;\n case \"select\":\n case 71:\n // select, keyboard \"g\" button\n console.log(\"The select button was pressed\");\n break;\n case \"start\":\n case 72:\n // start, keyboard \"h\" button\n console.log(\"The start button was pressed\");\n break;\n default:\n }; \n }\n\n $(document).on(\"keydown\", eventHandler);\n $(document).on(\"mousedown\", eventHandler);\n\n $(document).on(\"keyup\", function(event) {\n var gameButtons = [37, 65, 38, 87, 39, 68, 40, 83];\n if (gameButtons.includes(event.keyCode) && playerState === \"walking\") {\n playerState = \"standing\";\n walkingAnimation(playerDirection);\n }\n });\n\n $(document).on(\"mouseup\", function(event) {\n clearInterval(moveInterval);\n if (playerState === \"walking\") {\n playerState = \"standing\";\n walkingAnimation(playerDirection);\n }\n });\n}", "function control(e) {\n if(e.keyCode === 39) {\n moveRight();\n } else if(e.keyCode === 38) {\n rotate();\n } else if(e.keyCode === 37) {\n moveLeft();\n } else if(e.keyCode === 40) {\n moveDown();\n }\n }", "function control(e) {\r\n squares[currentIndex].classList.remove(\"snake\") //REMOVES THE CLASS OF SNAKE\r\n\r\n if (e.keyCode === 39){\r\n direction = 1 // RIGHT ARROW MOVES SNAKE RIGHT 1 DIV\r\n } else if (e.keyCode === 38){\r\n direction = -width // UP ARROW MOVES SNAKE UP BY MAKING SNAKE GO BACK 10 DIVS\r\n } else if(e.keyCode === 37){\r\n direction = -1 // LEFT ARROW MOVES SNAKE LEFT 1 DIV\r\n } else if(e.keyCode === 40){\r\n direction = +width //DOWN MOVES SNAKE DOWN BY 10 DIVS FROM CURRENT POSITION \r\n }\r\n }", "function control(e){\r\n squares[currentIndex].classList.remove('snake'); // remove the snake from all the classes\r\n\r\n if(e.keyCode === 39){\r\n direction = 1; // press right\r\n }\r\n else if(e.keyCode === 38){\r\n direction = -width; //press up\r\n }\r\n else if(e.keyCode === 37){\r\n direction = -1; //press left\r\n }\r\n else if(e.keyCode === 40){\r\n direction = +width; // press down\r\n }\r\n }", "function keysPressed(e){\n //store an entry for every key pressed\n keys[e.keyCode] = true;\n //left key pressed\n if ((keys[37]) && canMove(player.x-1, player.y)){\n player.x--;\n }\n //right key pressed\n if ((keys[39]) && canMove(player.x+1, player.y)){\n player.x++;\n }\n //up key pressed\n if ((keys[38]) && canMove(player.x, player.y-1)){\n player.y--;\n }\n // down key pressed\n if ((keys[40]) && canMove(player.x, player.y+1)){\n player.y++;\n }\n\n //Stop the page from using the default input of keyboard inputs\n e.preventDefault();\n // calls the draw function to draw the movement\n draw();\n }", "function setUpControl(){\n $(document).keydown( (e) => {\n switch (e.which) {\n case 27:\n if (gameStarted)\n togglePause()\n break\n case 37:\n case 65:\n if (!gameStarted || next.dir != RIGHT){\n next = { dir: LEFT, x: -1, y: 0 }\n startGame()\n }\n break\n case 38:\n case 87:\n if (!gameStarted || next.dir != DOWN){\n next = { dir: UP, x: 0, y: -1 }\n startGame()\n }\n break\n case 39:\n case 68:\n if (!gameStarted || next.dir != LEFT){\n next = { dir: RIGHT, x: 1, y: 0 }\n startGame()\n }\n break\n case 40:\n case 83:\n if (!gameStarted || next.dir != UP){\n next = { dir: DOWN, x: 0, y: 1 }\n startGame()\n }\n break\n }\n })\n}", "function control(e) {\n squares[currentIndex].classList.remove('snake') // removes the classlists for snake betwwen each move, prevents the snake from appearing to be left behind\n\n if(e.keyCode === 39) {\n direction = 1 //if we press the right arrow on our keyboard, the snake will go right one div in the grid\n } else if (e.keyCode === 38) {\n direction = -width // if we press the up arrow, the snake will go back ten divs, appearing to go up\n } else if (e.keyCode === 37) {\n direction = -1 // if we press left, the snake will go left one div in the grid\n } else if (e.keyCode === 40) {\n direction = +width //if we press down, the snake head will instantly appear in the div ten divs from where you are now\n }\n }", "function control(e) {\n //removing snake from a square\n squares[currentIndex].classList.remove('snake')\n\n //movement of the snake\n if(e.keyCode === 39) {\n direction = 1 // move the snake to the right if right arrow is pressed\n } else if (e.keyCode === 38) {\n direction = -width // move the snake up one width if the up arrow is pressed\n } else if (e.keyCode === 37) {\n direction = -1 // move the snake to the left if left arrow is pressed\n } else if (e.keyCode === 40) {\n direction = width // if down arrow is pressed move the snake down one width\n }\n\n\n }", "movePaddle() {\n // If right arrow key is pressed\n if (this.rightPressed) {\n this.paddle.X += 4;\n // If left arrow key is pressed\n } else if (this.leftPressed) {\n this.paddle.X -= 4;\n }\n }", "function inputrelease(e){\n\tlet code = e.keyCode;\n\tif(code == 38) // Up arrow\n\t{\n\t\tplayer.vel = 0;\n\t}\n\telse if(code == 40) // Down arrow\n\t{\n\t\tplayer.vel = 0;\n\t}\n}", "function control(event) {\n if(event.keyCode === 37) {\n moveLeft();\n } else if (event.keyCode === 38) {\n rotate();\n } else if (event.keyCode === 39) {\n moveRight();\n } else if (event.keyCode === 40) {\n moveDown();\n }\n }", "function playerMove( e, obj ) {\n var s = e.key.toLowerCase();\n //move left\n if( s == \"arrowleft\" ) {\n if( gridCellEmpty( obj.i-1, obj.j ) ) {\n putObjInCell( obj, obj.i-1, obj.j );\n //don't want to get input again until it's our turn again\n engine.unbindEvents( agents[currentAgent] );\n incrementCurrentAgent();\n }\n }\n //move right\n else if ( s == \"arrowright\" ) {\n if( gridCellEmpty( obj.i+1, obj.j ) ) {\n putObjInCell( obj, obj.i+1, obj.j );\n //don't want to get input again until it's our turn again\n engine.unbindEvents( agents[currentAgent] );\n incrementCurrentAgent();\n }\n }\n //move up\n else if ( s == \"arrowup\" ) {\n if( gridCellEmpty( obj.i, obj.j-1 ) ) {\n putObjInCell( obj, obj.i, obj.j-1 );\n //don't want to get input again until it's our turn again\n engine.unbindEvents( agents[currentAgent] );\n incrementCurrentAgent();\n }\n }\n //move down\n else if ( s == \"arrowdown\" ) {\n if( gridCellEmpty( obj.i, obj.j+1 ) ) {\n putObjInCell( obj, obj.i, obj.j+1 );\n //don't want to get input again until it's our turn again\n engine.unbindEvents( agents[currentAgent] );\n incrementCurrentAgent();\n }\n }\n else if ( s == \" \" ) {\n //pass your turn\n //don't want to get input again until it's our turn again\n engine.unbindEvents( agents[currentAgent] );\n incrementCurrentAgent();\n }\n}", "function control(e) {\n\n switch (e.keyCode) {\n case 39: // a la derecha\n direction = 1\n break;\n case 38: //hacia arriba\n direction = -width\n break;\n case 40: //hacia abajo\n direction= width\n break;\n case 37: // a la izquierda\n direction = -1\n break;\n default:\n break;\n }\n}", "function controls(e) {\n if (e.keyCode === 37) {\n moveLeft();\n } else if (e.keyCode === 38) {\n rotate();\n } else if (e.keyCode === 39) {\n moveRight();\n } else if (e.keyCode === 40) {\n moveDown();\n }\n }", "function onKeyDown(evt) {\r\n switch (evt.keyCode) {\r\n case 39: KEY_ARROW_RIGHT = true; break;\r\n case 37: KEY_ARROW_LEFT = true; break;\r\n case 38: KEY_ARROW_UP = true; break;\r\n case 40: KEY_ARROW_DOWN = true; break;\r\n case 16: KEY_SHIFT = true; break;\r\n }\r\n}", "function handleKey(event) {\r\n\tvar i = gGamerPos.i;\r\n\tvar j = gGamerPos.j;\r\n\r\n\r\n\tswitch (event.key) {\r\n\t\tcase 'ArrowLeft':\r\n\t\t\tmoveTo(i, j - 1);\r\n\t\t\tbreak;\r\n\t\tcase 'ArrowRight':\r\n\t\t\tmoveTo(i, j + 1);\r\n\t\t\tbreak;\r\n\t\tcase 'ArrowUp':\r\n\t\t\tmoveTo(i - 1, j);\r\n\t\t\tbreak;\r\n\t\tcase 'ArrowDown':\r\n\t\t\tmoveTo(i + 1, j);\r\n\t\t\tbreak;\r\n\t}\r\n}", "function onKeyDown(event) {\n if (event.keyCode == 90) { // z\n controls.resetSensor();\n }\n if (event.keyCode == 87) {\n walking = true;\n }\n}", "function handleKey(event) {\r\n\r\n var i = gGamerPos.i;\r\n var j = gGamerPos.j;\r\n\r\n switch (event.key) {\r\n case \"ArrowLeft\":\r\n\t\tif(gBoard[5][0].gameElement === GAMER){\r\n\t\t\tmoveTo(5,11)\r\n\t\t}else{ \r\n moveTo(i, j - 1);}\r\n break;\r\n case \"ArrowRight\":\r\n\t\tif(gBoard[5][11].gameElement === GAMER){\r\n\t\t\tmoveTo(5,0);\r\n\t\t}else{ \r\n moveTo(i, j + 1);}\r\n break;\r\n case \"ArrowUp\":\r\n if (gBoard[0][5].gameElement === GAMER) {\r\n\t\t moveTo(9, 5);\r\n\t\t}else {\r\n\t\t\tmoveTo(i - 1, j);\r\n\t\t}\r\n break;\r\n case \"ArrowDown\":\r\n\t\tif (gBoard[9][5].gameElement === GAMER) {\r\n\t\t\tmoveTo(0, 5);\r\n\t\t }else {\r\n moveTo(i + 1, j);}\r\n break;\r\n }\r\n}", "function keyDownEvent(e) {\n switch (e.keyCode) {\n case 37:\n nextX = -1;\n nextY = 0;\n break;\n case 38:\n nextX = 0;\n nextY = -1;\n break;\n case 39:\n nextX = 1;\n nextY = 0;\n break;\n case 40:\n nextX = 0;\n nextY = 1;\n break;\n case 32:\n if (gameActive == true) {\n pauseGame();\n }\n else {\n gameControl = startGame(x);\n }\n break;\n }\n}", "handleInput(key) {\n //factor to move in x = 100\n //factor to move in y = 85\n if(this.live){ \n switch(key) {\n case 'left':\n (this.x - 100 >= 0) ? this.x -=100 : false;\n break;\n case 'right':\n (this.x + 100 < 500) ? this.x +=100 : false;\n break;\n case 'up':\n (this.y - 85 >= -15) ? this.y -=85 : false;\n break;\n case 'down':\n (this.y + 85 <= 410) ? this.y +=85 : false;\n break;\n default:\n false;\n }\n } else if(key == 'esc'){\n this.reset();\n }\n }", "function move(keyEvent) {\n if (37 in keyEvent) { //User pressed left key\n player.headdirection = 64;\n }\n if (38 in keyEvent) { //User pressed up key\n player.headdirection = 96;\n }\n if (39 in keyEvent) { //User pressed right key\n player.headdirection = 0;\n }\n if (40 in keyEvent) { //User pressed down key\n player.headdirection = 32;\n }\n}", "function control(e){\n\n switch (e.keyCode) {\n case 40: // DOWN\n \n //movePacMan(28)\n movePacManModulusStyle(width)\n break\n\n case 38: // UP\n \n //movePacMan(-28)\n movePacManModulusStyle(-width)\n break\n\n case 37: // LEFT\n \n //movePacMan(-1)\n movePacManModulusStyle(-1)\n break\n\n case 39: // RIGHT\n \n //movePacMan(1)\n movePacManModulusStyle(1)\n break\n }\n\n checkPacDot()\n}", "function handleKey(event) {\n\n\tvar i = gGamerPos.i;\n\tvar j = gGamerPos.j;\n\n\n\tswitch (event.key) {\n\t\tcase 'ArrowLeft':\n\t\t\tif (j === 0) moveTo(i, gBoard[0].length - 1);\n\t\t\telse moveTo(i, j - 1);\n\t\t\tbreak;\n\t\tcase 'ArrowRight':\n\t\t\tif (j === gBoard[0].length - 1) moveTo(i, 0);\n\t\t\telse moveTo(i, j + 1);\n\t\t\tbreak;\n\t\tcase 'ArrowUp':\n\t\t\tif (i === 0) moveTo(gBoard.length - 1, j);\n\t\t\telse moveTo(i - 1, j);\n\t\t\tbreak;\n\t\tcase 'ArrowDown':\n\t\t\tif (i === gBoard.length - 1) moveTo(0, j);\n\t\t\telse moveTo(i + 1, j);\n\t\t\tbreak;\n\n\t}\n\n}", "function control(e) {\n //37 is the keycode for the left on the d-pad.\n if(e.keyCode === 37) {\n moveLeft();\n }\n else if(e.keyCode === 38) {\n rotate();\n }\n else if(e.keyCode === 39) {\n moveRight();\n }\n else if(e.keyCode === 40) {\n moveDown();\n };\n }", "function keyDownHandler(e) {\r\n switch (e.key) {\r\n case \"ArrowUp\":\r\n rocket1.moveUp(10);\r\n break;\r\n case \"ArrowDown\":\r\n rocket1.moveDown(10);\r\n break;\r\n case \"ArrowRight\":\r\n rocket1.moveRight(10);\r\n break;\r\n case \"ArrowLeft\":\r\n rocket1.moveLeft(10);\r\n break;\r\n }\r\n }", "handleInput(arrow) {\n if (arrow === 'left' && player.x > 0) {\n this.x -= this.moveX;\n //console.log('left');\n } else if (arrow === 'right' && player.x < 404) {\n this.x += this.moveX;\n //console.log('right');\n } else if (arrow === 'down' && player.y < 392) {\n this.y += this.moveY;\n //console.log(player.y);\n } else if ((arrow === 'up' && player.y > 0)) {\n this.y -= this.moveY;\n //console.log('up');\n }\n }", "function keyPressed(){\n if (key == ' '){\n gridActive = !gridActive;\n }\n if (key == 'w' || key == 'W'){\n yVelocity -= 1;\n }\n if (key == 's' || key == 'S'){\n yVelocity += 1;\n }\n if (key == 'a' || key == 'A'){\n xVelocity -= 1;\n }\n if (key == 'd' || key == 'D'){\n xVelocity += 1;\n }\n}", "move(){\n if (keyIsDown (LEFT_ARROW) ) {\n this.pos.x -= this.speed;\n } \n if (keyIsDown(RIGHT_ARROW) ) {\n this.pos.x += this.speed;\n } \n if (keyIsDown (UP_ARROW) ) {\n this.pos.y -= this.speed;\n } \n if (keyIsDown (DOWN_ARROW) ) {\n this.pos.y += this.speed;\n }\n }", "function keyPressed() {\n if (keyCode === LEFT_ARROW){\n paddle.moveLeft();\n } else if (keyCode === RIGHT_ARROW){\n paddle.moveRight();\n }\n}", "function checkKey(e) {\n if (e.keyCode === 87) controls.moveUp = true;\n else if (e.keyCode === 83) controls.moveDown = true;\n else if (e.keyCode === 65) controls.moveLeft = true;\n else if (e.keyCode === 68) controls.moveRight = true;\n else if (e.keyCode === 38) controls.faceUp = true;\n else if (e.keyCode === 40) controls.faceDown = true;\n else if (e.keyCode === 37) controls.faceLeft = true;\n else if (e.keyCode === 39) controls.faceRight = true;\n else if (e.keyCode === 32) controls.shoot = true;\n}", "function controls(){\n\tdocument.addEventListener(\"keydown\", onDocumentKeyDown, false);\n\tfunction onDocumentKeyDown(event) {\n\t var keyCode = event.which;\n\t \n\t if (keyCode == 40 && animating == false) {//down\n\t \tresetToPlayerPOV();\n\t \tif(playerDirection.equals(new THREE.Vector2(0,-playerViewDistance)))//North\n\t \t{\n\t \t\tplayerDirection.set(0,playerViewDistance);//South\n\t \t}else if(playerDirection.equals(new THREE.Vector2(playerViewDistance,0)))//East\n\t \t{\n\t \t\tplayerDirection.set(-playerViewDistance,0);//West\n\t \t}else if(playerDirection.equals(new THREE.Vector2(0,playerViewDistance)))//South\n\t \t{\n\t \t\tplayerDirection.set(0,-playerViewDistance);//North\n\t \t}else if(playerDirection.equals(new THREE.Vector2(-playerViewDistance,0)))//West\n\t \t{\n\t \t\tplayerDirection.set(playerViewDistance,0);//East\n\t \t}\n\t \trotateCamera(playerDirection.getComponent(0),playerDirection.getComponent(1));\n\t } else if (keyCode == 37 && animating == false) {//left\n\t \tresetToPlayerPOV();\n\t \tif(playerDirection.equals(new THREE.Vector2(0,-playerViewDistance)))//North\n\t \t{\n\t \t\tplayerDirection.set(-playerViewDistance,0);//West\n\t \t}else if(playerDirection.equals(new THREE.Vector2(playerViewDistance,0)))//East\n\t \t{\n\t \t\tplayerDirection.set(0,-playerViewDistance);//North\n\t \t}else if(playerDirection.equals(new THREE.Vector2(0,playerViewDistance)))//South\n\t \t{\n\t \t\tplayerDirection.set(playerViewDistance,0);//East\n\t \t}else if(playerDirection.equals(new THREE.Vector2(-playerViewDistance,0)))//West\n\t \t{\n\t \t\tplayerDirection.set(0,playerViewDistance);//South\n\t \t}\n\t \trotateCamera(playerDirection.getComponent(0),playerDirection.getComponent(1));\n\t } else if (keyCode == 38 && animating == false) {//up\n\t \tif(playerToMirrorPOV == true)\n \t\t{\n \t\t\tresetToPlayerPOV();\n \t\t}else{\n \t\t\tresetToMirrorPOV();\n \t\t}\n\t } else if (keyCode == 39 && animating == false) {//right\n\t \tresetToPlayerPOV();\n\t \tif(playerDirection.equals(new THREE.Vector2(0,-playerViewDistance)))//North\n\t \t{\n\t \t\tplayerDirection.set(playerViewDistance,0);//East\n\t \t}else if(playerDirection.equals(new THREE.Vector2(playerViewDistance,0)))//East\n\t \t{\n\t \t\tplayerDirection.set(0,playerViewDistance);//South\n\t \t}else if(playerDirection.equals(new THREE.Vector2(0,playerViewDistance)))//South\n\t \t{\n\t \t\tplayerDirection.set(-playerViewDistance,0);//West\n\t \t}else if(playerDirection.equals(new THREE.Vector2(-playerViewDistance,0)))//West\n\t \t{\n\t \t\tplayerDirection.set(0,-playerViewDistance);//North\n\t \t}\n\t \trotateCamera(playerDirection.getComponent(0),playerDirection.getComponent(1));\n\t } else if (keyCode == 86) { //\"v\"\n\t \t//Top down view of the area\n\t \tif(animating == false){\n\t \t\tif(topDownPOV == true)\n\t \t\t{\n\t \t\t\tresetToPlayerPOV();\n\t \t\t}else{\n\t \t\t\tresetToTopDownPOV();\n\t \t\t}\n\t \t}\n\t } else if (keyCode == 32 && animating == false) { // spacebar\n\t \t//move player\n\t \tresetToPlayerPOV();\n\t \tdeterminePlayerMovement();\n\t }else if (keyCode == 81 && animating == false){ // q\n\t \t//cheat\n\t \tcurrentLevel++;\n\t\t\tif(currentLevel >= MAXLEVEL)\n\t\t\t{\n\t\t\t\tclearMap();\n\t\t\t\talert(\"Congratulations, you are officially rich (Not in your real dimension)\");\n\t\t\t}else{\n\t\t\t\tclearMap();\n\t\t\t\tgenerateMapLevel(currentLevel);\n\t\t\t\tcreateLevel(currentLevel);\n\t\t\t}\n\t }else if (keyCode == 68 && animating == false){ //d = drill\n\t \t//drill\n\t \tattemptDrill();\n\t }else if (keyCode == 82 && animating == false){ // r\n\t \t//reset level\n\t \talert(\"Another pay day has been lost\")\n\t\t\tclearMap();\n\t\t\tgenerateMapLevel(currentLevel);\n\t\t\tcreateLevel(currentLevel);\n\t }else if (keyCode == 8 && welcomePageUp == true){ // backspace\n\t \tscene.remove(welcomeObject);\n\t \twelcomeObject = null;\n\t \twelcomePageUp = false;\n\t }\n\t};\n}", "function control(e) {\n if (gameOver) return;\n var action = \"\";\n switch (e.keyCode) {\n case 39:\n // Right\n action = \"RIGHT\";\n performMove(action);\n break;\n\n case 38:\n // Up\n action = \"UP\";\n performMove(action);\n break;\n\n case 37:\n // Left\n action = \"LEFT\";\n performMove(action);\n break;\n\n case 40:\n //DOWN\n action = \"DOWN\";\n performMove(action);\n break;\n }\n\n if (debug) alert(action);\n } // control(e)", "function pressArrowKeys (event) {\n // console.log(event.keyCode);\n if (!gameStarted || changingTurn) { \n return; \n }\n\n let isFightMode = canFight(currentPlayer, otherPlayer);\n console.log(\"isFightMode: \" + isFightMode);\n if (isFightMode) {\n fightMode(event.keyCode)\n }else{\n boardMode(event.keyCode)\n }\n\n drawGame();\n}", "function keyup(evt) {\r\n // Get the key code\r\n var keyCode = (evt.keyCode)? evt.keyCode : evt.getKeyCode();\r\n\r\n switch (keyCode) {\r\n case \"A\".charCodeAt(0):\r\n if (player.motion == motionType.LEFT) player.motion = motionType.NONE;\r\n break;\r\n\r\n case \"D\".charCodeAt(0):\r\n if (player.motion == motionType.RIGHT) player.motion = motionType.NONE;\r\n break;\r\n }\r\n}", "function keyup(evt) {\r\n // Get the key code\r\n var keyCode = (evt.keyCode)? evt.keyCode : evt.getKeyCode();\r\n\r\n switch (keyCode) {\r\n case \"A\".charCodeAt(0):\r\n if (player.motion == motionType.LEFT) player.motion = motionType.NONE;\r\n break;\r\n\r\n case \"D\".charCodeAt(0):\r\n if (player.motion == motionType.RIGHT) player.motion = motionType.NONE;\r\n break;\r\n }\r\n}", "move(){\r\n if(keyDown(UP_ARROW)){\r\n this.harry.y = this.harry.y - 10;\r\n }\r\n if(keyDown(DOWN_ARROW)){\r\n this.harry.y = this.harry.y + 10;\r\n }\r\n if(keyDown(RIGHT_ARROW)){\r\n this.harry.x = this.harry.x + 10;\r\n }\r\n if(keyDown(LEFT_ARROW)){\r\n this.harry.x = this.harry.x - 10;\r\n }\r\n \r\n }", "function handleKeys() {\r\n\r\n if (currentlyPressedKeys[90]) { //make camera roll to left\r\n // Left cursor key or A\r\n\t teapot_turn += 0.05;\r\n }\r\n else if (currentlyPressedKeys[88]) {\r\n // Up cursor key or W\r\n background_turn += 0.05;\r\n }\r\n\r\n\r\n}", "function handleKey(event) {\n\tvar i = gGamerPos.i;\n\tvar j = gGamerPos.j;\n\n\tvar leftWindow = gWindowsPos[0].pos;\n\tvar rightWindow = gWindowsPos[1].pos;\n\tvar upWindow = gWindowsPos[2].pos;\n\tvar downWindow = gWindowsPos[3].pos;\n\n\t//arrowLeft\n\tif (event.key === 'ArrowLeft') {\n\t\tif (leftWindow.i === i && leftWindow.j === j) {\n\t\t\tmoveTo(leftWindow.matchI,leftWindow.matchJ);\n\t\t} else {\n\t\t\tmoveTo(i, j - 1);\n\t\t}\n\t}\n\n\t//arrowRight\n\tif (event.key === 'ArrowRight') {\n\t\tif (rightWindow.i === i && rightWindow.j === j) {\n\t\t\tmoveTo(rightWindow.matchI,rightWindow.matchJ);\n\t\t} else {\n\t\t\t\tmoveTo(i, j + 1);\n\t\t}\n\t}\n\t\n\t//arrowUp\n\tif (event.key === 'ArrowUp') {\n\t\tif (upWindow.i === i && upWindow.j === j) {\n\t\t\tmoveTo(upWindow.matchI,upWindow.matchJ);\n\t\t} else {\t\n\t\t\tmoveTo(i - 1, j);\n\t\t}\n\t}\n\n\t//arrowDown\n\tif (event.key === 'ArrowDown') {\n\t\tif (downWindow.i === i && downWindow.j === j) {\n\t\t\tmoveTo(downWindow.matchI,downWindow.matchJ);\n\t\t} else {\n\t\t\tmoveTo(i + 1, j);\n\t\t}\n\t}\n}", "function input() {\n if(65 in keysDown) {\n if (getTile((player.x - player.speed) + 1, player.y + 16) !== \"1\") { //If player runs into a wall, they will not be allowed to go through it.\n player.x -= 3; //when \"A\" is pressed on keyboard, move player 3 pixels to left.\n }\n }\n if(68 in keysDown) {\n if (getTile(((player.x + player.width) + player.speed) - 1, player.y + 16) !== \"1\") { //If player runs into a wall, they will not be allowed to go through it.\n player.x += 3; //when \"D\" is pressed on keyboard, move player 3 pixels to right.\n }\n }\n if(87 in keysDown && player.yke === 0) {\n if(getTile(player.x, player.y -1) !== \"1\" && getTile(player.x + 32, player.y -1) !== \"1\") {\n player.yke += 8;\n }\n } \n}", "function CONTROL(event) {\n // 37 corresponds to left arrow\n if (event.keyCode == 37) {\n p.moveLeft()\n dropStart = Date.now()\n // 38 corresponds to left arrow\n } else if (event.keyCode == 38) {\n p.rotate()\n dropStart = Date.now()\n // 39 corresponds to left arrow\n } else if (event.keyCode == 39) {\n p.moveRight()\n dropStart = Date.now()\n // 40 corresponds to left arrow\n } else if (event.keyCode == 40) {\n p.moveDown()\n // dropStart = Date.now()\n }\n}", "function CONTROL(event) {\r\n if (event.keyCode == 37) {\r\n p.moveLeft();\r\n //dropStart = Date.now();\r\n } else if (event.keyCode == 38) {\r\n p.rotate();\r\n //dropStart = Date.now();\r\n } else if (event.keyCode == 39) {\r\n p.moveRight();\r\n //dropStart = Date.now();\r\n } else if (event.keyCode == 40) {\r\n p.moveDown();\r\n }\r\n}", "move() {\n // figure out which key was pressed\n if (keyIsDown(LEFT_ARROW)) {\n this.xPos -= 5;\n this.myGraphic = user_left;\n }\n if (keyIsDown(RIGHT_ARROW)) {\n this.xPos += 5;\n this.myGraphic = user_right;\n }\n if (keyIsDown(UP_ARROW)) {\n this.yPos -= 5;\n }\n if (keyIsDown(DOWN_ARROW)) {\n this.yPos += 5;\n }\n }", "function keydown(e) {\r\n if (e.keyCode == \"38\") {\r\n // called the function according to the requirement\r\n moveup();\r\n } else if (e.keyCode == \"40\") {\r\n movedown();\r\n } else if (e.keyCode == \"37\") {\r\n moveleft();\r\n } else if (e.keyCode == \"39\") {\r\n moveright();\r\n }\r\n}", "function handleKey(event) {\r\n\r\n\tvar i = gGamerPos.i;\r\n\tvar j = gGamerPos.j;\r\n\tconsole.log('ev', event);\r\n\r\n\tswitch (event.key) {\r\n\t\tcase 'ArrowLeft':\r\n\t\t\tif (i === 5 && j === 0) moveTo(5, 9)\r\n\t\t\telse moveTo(i, j - 1);\r\n\t\t\tbreak;\r\n\t\tcase 'ArrowRight':\r\n\t\t\tif (i === 5 && j === 11) moveTo(5, 0)\r\n\t\t\telse moveTo(i, j + 1);\r\n\t\t\tbreak;\r\n\t\tcase 'ArrowUp':\r\n\t\t\tif (i === 0 && j === 5) moveTo(9, 5)\r\n\t\t\telse moveTo(i - 1, j);\r\n\t\t\tbreak;\r\n\t\tcase 'ArrowDown':\r\n\t\t\tif (i === 9 && j === 5) moveTo(0, 5)\r\n\t\t\telse moveTo(i + 1, j);\r\n\t\t\tbreak;\r\n\t}\r\n\r\n}", "function keyup(evt) {\n // Get the key code\n var keyCode = (evt.keyCode)? evt.keyCode : evt.getKeyCode();\n\n switch (keyCode) {\n case \"A\".charCodeAt(0):\n if (player.motion == motionType.LEFT) player.motion = motionType.NONE;\n break;\n\n case \"D\".charCodeAt(0):\n if (player.motion == motionType.RIGHT) player.motion = motionType.NONE;\n break;\n }\n}", "function handleKey(event) {\n\n\tvar i = gGamerPos.i;\n\tvar j = gGamerPos.j;\n\n\n\tswitch (event.key) {\n\t\tcase 'ArrowLeft':\n\t\t\tmoveTo(i, j - 1);\n\t\t\tbreak;\n\t\tcase 'ArrowRight':\n\t\t\tmoveTo(i, j + 1);\n\t\t\tbreak;\n\t\tcase 'ArrowUp':\n\t\t\tmoveTo(i - 1, j);\n\t\t\tbreak;\n\t\tcase 'ArrowDown':\n\t\t\tmoveTo(i + 1, j);\n\t\t\tbreak;\n\n\t}\n\n}", "function keyup(e) {\r\n player.dx = 0;\r\n player.dy = 0;\r\n}", "function keys(e) {\n const allowedKeys = {\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down'\n };\n // Send keys to Player.handleInput() method\n player.handleInput(allowedKeys[e.keyCode]);\n}", "function movement() {\r\n if (cursors.left.isDown) {\r\n player.body.velocity.x = -150;\r\n keyLeftPressed.animations.play(\"leftArrow\");\r\n }\r\n if (cursors.right.isDown) {\r\n player.body.velocity.x = 150;\r\n keyRightPressed.animations.play(\"rightArrow\");\r\n }\r\n\r\n if (player.body.velocity.x > 0) {\r\n player.animations.play(\"right\");\r\n } else if (player.body.velocity.x < 0) {\r\n player.animations.play(\"left\");\r\n } else {\r\n player.animations.play(\"turn\");\r\n }\r\n if (cursors.up.isDown && player.body.onFloor()) {\r\n player.body.velocity.y = -290;\r\n keyUpPressed.animations.play(\"upArrow\");\r\n jumpSound.play();\r\n jumpSound.volume = 0.15;\r\n }\r\n }", "function playerOneKeyDownHandler(e) {\n if(e.keyCode == 87) {\n playerOneUpPressed = true;\n }\n else if(e.keyCode == 83) {\n playerOneDownPressed = true;\n }\n}", "arrowControl(sprite, speed) {\n\n if (speed === undefined) {\n throw new Error(\"Please supply the arrowControl method with the speed at which you want the sprite to move\");\n }\n\n let upArrow = this.keyboard(38),\n rightArrow = this.keyboard(39),\n downArrow = this.keyboard(40),\n leftArrow = this.keyboard(37);\n\n //Assign key `press` methods\n leftArrow.press = () => {\n //Change the sprite's velocity when the key is pressed\n sprite.vx = -speed;\n sprite.vy = 0;\n };\n leftArrow.release = () => {\n //If the left arrow has been released, and the right arrow isn't down,\n //and the sprite isn't moving vertically: \n //Stop the sprite\n if (!rightArrow.isDown && sprite.vy === 0) {\n sprite.vx = 0;\n }\n };\n upArrow.press = () => {\n sprite.vy = -speed;\n sprite.vx = 0;\n };\n upArrow.release = () => {\n if (!downArrow.isDown && sprite.vx === 0) {\n sprite.vy = 0;\n }\n };\n rightArrow.press = () => {\n sprite.vx = speed;\n sprite.vy = 0;\n };\n rightArrow.release = () => {\n if (!leftArrow.isDown && sprite.vy === 0) {\n sprite.vx = 0;\n }\n };\n downArrow.press = () => {\n sprite.vy = speed;\n sprite.vx = 0;\n };\n downArrow.release = () => {\n if (!upArrow.isDown && sprite.vx === 0) {\n sprite.vy = 0;\n }\n };\n }", "function checkKey(e) {\n\n e = e || window.event;\n\n if (e.keyCode == '37') {\n // left arrow\n if (racket.position.x > -(variables.planeWidth / 2 - variables.racketWidth / 2)) { //set the boundary so that the racket wouldn't go outside the field\n\n racket.position.x += -0.5; //move the racket by 0.5 when arrow key is pressed\n\n boundary3 = racket.position.x - 0.5;\n boundary4 = racket.position.x + 0.5;\n }\n }\n else if (e.keyCode == '39') {\n // right arrow\n if (racket.position.x < variables.planeWidth / 2 - variables.racketWidth / 2) { //set the boundary so that the racket wouldn't go outside the field\n\n racket.position.x += 0.5;//move the racket by 0.5 when arrow key is pressed\n\n boundary3 = racket.position.x - 0.5;\n boundary4 = racket.position.x + 0.5;\n }\n }\n }", "function onkey(event) {\n\n if (!(event.metaKey || event.altKey || event.ctrlKey)) {\n event.preventDefault();\n }\n\n if (event.charCode == 'z'.charCodeAt(0)) { // z\n controls.zeroSensor();\n } else if (event.charCode == 'f'.charCodeAt(0)) { // f\n effect.setFullScreen( true );\n } else if (event.charCode == 'w'.charCodeAt(0)) { // w - move a row up\n animator.changeRow( -1 );\n currentRow -= 1;\n } else if (event.charCode == 's'.charCodeAt(0)) { // s - move a row down\n animator.changeRow( 1 );\n currentRow += 1;\n } else if (event.charCode == 'a'.charCodeAt(0)) { // a - spin row left\n animator.spinRow( -1 );\n } else if (event.charCode == 'd'.charCodeAt(0)) { // d - spin row right\n animator.spinRow( 1 );\n }\n}", "function keyUpHandler(e) {\n // If right arrow key is pressed\n if (e.keyCode === 39) {\n gameClass.rightPressed = false;\n // If left arrow key is pressed\n } else if (e.keyCode === 37) {\n gameClass.leftPressed = false;\n }\n}", "arrowKeys(dir) {\n\n this.x += dir;\n if (this.checkSides() && this.checkBox(this.x, this.y)) {\n this.checkGhost();\n this.render();\n } else {\n this.x -= dir;\n }\n\n }", "registerMoving() {\n\n // window.addEventListener(\"keydown\", (e) => {\n // if (e.key === \"keydown\") {\n // return true;\n // } else {\n // return false;\n // }\n // })\n window.addEventListener(\"keydown\", (e) => {\n let playerDom = this.gameContainer.children[0];\n let x = parseInt(playerDom.style.left);\n let y = parseInt(playerDom.style.top);\n let modifier = 20;\n switch (e.key) {\n\n case \"ArrowUp\":\n console.log(\"move up\")\n y = y - modifier;\n break\n case \"ArrowDown\":\n console.log(\"move down\");\n y = y + modifier;\n break\n case \"ArrowLeft\":\n console.log(\"move left\")\n x = x - modifier;\n break\n case \"ArrowRight\":\n console.log(\"move right\")\n x = x + modifier;\n break\n }\n\n if (this.checkIfPlayerIsOutsideOfContainer(x, y) === true) {\n this.movePlayerHtml(e.key)\n }\n })\n\n }", "handleInput(keycode) {\n if (keycode !== undefined && player.moves === true) {\n key = keycode;\n }\n }", "function keydown_fn(e) {\n if (e.key != 'F12' && e.key != 'F5') e.preventDefault()\n if (e.key === 'ArrowLeft') {\n gameBoard.moveLeftCurrent()\n if (!end) update()\n }\n else if (e.key === 'ArrowRight') {\n gameBoard.moveRightCurrent()\n if (!end) update()\n }\n else if (e.key === 'ArrowDown') {\n gameBoard.moveDownCurrent()\n if (!end) update()\n }\n else if (e.key === 'ArrowUp') {\n gameBoard.swapHeld()\n if (!end) update()\n }\n else if (e.key === ' ') {\n gameBoard.rotateCurrent()\n if (!end) update()\n }\n}", "function checkKeyPress(e) {\n e = e || window.event;\n if (e.keyCode == \"37\" && leftPos > playerPixels[0]) {\n movePlayer(-movementAmount, -1);\n } else if (e.keyCode == \"39\" && leftPos < playerPixels[2]) {\n movePlayer(movementAmount, 1);\n }\n}", "function keydown(e) {\r\n if(e.keyCode==39){\r\n if (paddle.x == canvas.width - paddle.w){\r\n paddle.x=canvas.width - paddle.w;\r\n } else {\r\n paddle.x += paddle.speed;\r\n draw();\r\n }\r\n\r\n } else if (e.keyCode==37){\r\n if (paddle.x == 0){\r\n paddle.x=0;\r\n } else {\r\n paddle.x -= paddle.speed;\r\n draw();\r\n }\r\n } \r\n}", "function moveSprite() {\n if(keyIsDown(RIGHT_ARROW))\n playerSprite.velocity.x = 10;\n else if(keyIsDown(LEFT_ARROW))\n playerSprite.velocity.x = -10;\n else\n playerSprite.velocity.x = 0;\n\n if(keyIsDown(DOWN_ARROW))\n playerSprite.velocity.y = 10;\n else if(keyIsDown(UP_ARROW))\n playerSprite.velocity.y = -10;\n else\n playerSprite.velocity.y = 0;\n}", "function keyPressed() {\n\n // If up arrow is pressed (player two)\n if (keyCode === UP_ARROW) {\n playerTwo.direction(0, -5);\n\n // if down arrow is pressed (player two)\n } else if (keyCode === DOWN_ARROW) {\n playerTwo.direction(0, 5);\n\n // if \"W\" is pressed (player one)\n } else if (keyCode === 87) {\n\n playerOne.direction(0, -5);\n\n // if \"S\" is pressed (player two)\n } else if (keyCode === 83) {\n\n playerOne.direction(0, 5);\n }\n}", "function keyUpHandler(e) {\n // If right arrow key is pressed\n if (e.keyCode === 39) {\n gameClass.rightPressed = false;\n // If left arrow key is pressed\n } else if (e.keyCode === 37) {\n gameClass.leftPressed = false;\n }\n\n // If 'a' key is pressed\n if (e.keyCode === 65) {\n gameClass.aPressed = false;\n // If 'd key is pressed\n } else if (e.keyCode === 68) {\n gameClass.dPressed = false;\n }\n}", "function onKeyDown(event) {\n\n // console.log(event);\n\n switch (event.key) {\n\n case \"ArrowLeft\":\n moveLeft = true;\n break;\n case \"ArrowRight\":\n moveRight = true;\n break;\n \n default:\n break;\n\n }\n\n}", "function keyPressed () {\n if (activePiece.x <= 25 && key === 'ArrowLeft') {\n activePiece.boundary();\n }\n if (activePiece.x > 25 && key === 'ArrowLeft') {\n activePiece.shiftLeft();\n }\n if (activePiece.x >= 225 && key === 'ArrowRight') {\n activePiece.boundary();\n }\n if (activePiece.x < 225 && key === 'ArrowRight') {\n activePiece.shiftRight();\n }\n if (key === 'ArrowUp') {\n i++\n }\n if (i > 3) {\n i = 0\n }\n console.log(i + \" \" + key)\n}", "function handleKey(e) {\n if(e.key.includes('Arrow')) {\n e.preventDefault();\n draw({ key : e.key }); \n }\n}", "function handleKey(e){\n if(e.key.includes('Arrow')){\n e.preventDefault();\n console.log(e.key);\n draw({key: e.key});\n console.log('HANDLING KEY');\n }\n}", "function handleInteractions() {\n\tif (keys[38] || keys[87]) { //Up arrow\n\t\tplayer.move(0,-2);\n\t}\n\tif (keys[37] || keys[65]) { //Left Arrow\n\t\tplayer.move(-2,0);\n\t}\n\tif (keys[39] || keys[68]) { //right arrow\n\t\tplayer.move(2,0);\n\t}\n\tif (keys [40] || keys[83]) { //down arrow\n\t\tplayer.move(0,2);\n\t}\n\tif (keys [32]) { //spacebar\n\t\t\n\t}\n\tif (keys[69]) { //e\n\t\tplayer.use();\n\t}\n\tif (keys[70]) { //f\n\t\t\n\t}\n\tif (keys[71]) { //g\n\t\t\n\t}\n\tif (keys[82]) { //r\n\t\t\n\t}\n\n}", "function control(e) {\n if (e.keyCode == \"38\" || e.keyCode == \"32\") {\n if (!isJump) {\n isJump = true;\n jump();\n }\n }\n }", "function moveSprite() {\n if(keyIsDown(RIGHT_ARROW))\n playerSprite.velocity.x = 10;\n else if(keyIsDown(LEFT_ARROW))\n playerSprite.velocity.x = -10;\n else\n playerSprite.velocity.x = 0;\n\n if(keyIsDown(DOWN_ARROW))\n playerSprite.velocity.y = 10;\n else if(keyIsDown(UP_ARROW))\n playerSprite.velocity.y = -10;\n else\n playerSprite.velocity.y = 0;\n}" ]
[ "0.7242808", "0.7226124", "0.7189559", "0.718607", "0.7185699", "0.7132175", "0.7127608", "0.7122507", "0.7108894", "0.7100371", "0.709188", "0.7053857", "0.70507723", "0.7040564", "0.7033617", "0.70234364", "0.69897056", "0.69830483", "0.69816273", "0.69790155", "0.6967903", "0.69609267", "0.6957926", "0.6956963", "0.69448745", "0.6938309", "0.6923207", "0.69223195", "0.6917333", "0.6901714", "0.689253", "0.68698084", "0.6858737", "0.6858329", "0.6852214", "0.6851129", "0.68416023", "0.68366957", "0.6830145", "0.6820103", "0.6790472", "0.6789782", "0.67806333", "0.67756355", "0.6772444", "0.6770703", "0.6770121", "0.67651534", "0.674602", "0.6710732", "0.66989064", "0.6695916", "0.6695884", "0.6689355", "0.6689192", "0.66866183", "0.66818976", "0.6679497", "0.66788805", "0.66673684", "0.6665721", "0.6662316", "0.6661505", "0.66533244", "0.66425556", "0.66425556", "0.664072", "0.66358095", "0.66267127", "0.6626034", "0.6619017", "0.6615153", "0.66149706", "0.661328", "0.66020787", "0.65973526", "0.65923357", "0.65809107", "0.6579977", "0.6579343", "0.65728635", "0.6567439", "0.65629226", "0.6560094", "0.6556409", "0.65563285", "0.6553839", "0.65515596", "0.65499073", "0.65494347", "0.65468913", "0.6542652", "0.65395135", "0.65381706", "0.6528259", "0.65246934", "0.65168333", "0.6511354", "0.6510221", "0.650922", "0.64990014" ]
0.0
-1
Given a position in the DOM, look for children elements which comprise a boolean expression. Using all of those found with content, return a filter string which represents them.
function walkTreeForFilterStrings(basicNode) { var groupValues, node = $(basicNode); if (node.hasClass("filter-value") && node.val().length > 0) { return node.attr('name') + ' eq "' + node.val().replace('"', '\\"') + '"'; } else if (node.hasClass("filter-group")) { groupValues = _.chain(node.find(">.form-group>.filter-value, >.filter-group")).map(walkTreeForFilterStrings).filter(function (value) { return value.length > 0; }).value(); if (groupValues.length === 0) { return ""; } else if (groupValues.length === 1) { return groupValues[0]; } if (node.hasClass("filter-or")) { return "(" + groupValues.join(" OR ") + ")"; } else { return "(" + groupValues.join(" AND ") + ")"; } } else { return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function elementChildren(children, predicate = () => true) {\n return react__WEBPACK_IMPORTED_MODULE_0__[\"Children\"].toArray(children).filter(child => /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__[\"isValidElement\"])(child) && predicate(child));\n}", "function elementChildren(children, predicate) {\n if (predicate === void 0) { predicate = function () { return true; }; }\n return Children.toArray(children).filter(function (child) { return isValidElement(child) && predicate(child); });\n}", "function elementChildren(children, predicate) {\n if (predicate === void 0) {\n predicate = function () {\n return true;\n };\n }\n\n return Children.toArray(children).filter(function (child) {\n return isValidElement(child) && predicate(child);\n });\n}", "async function filterChildren(children) {\n // frameset -> go deeper on all children\n const child_arr = [...children]; // children isn't actually an array with all the functions \n\n const child_arr_deep_results = await Promise.all(child_arr.map(async (cur, i, arr) => {\n return await textEleSearch(tester, cur, options);\n }));\n\n return child_arr_deep_results.filter((cur, i, arr) => {\n return cur !== undefined;\n });\n }", "_areChildrenFiltered(data) {\r\n if (data.leaf) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < data.children.length; i++) {\r\n if (data.children[i].$.filtered !== false) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }", "getHasAnyText(filterMask) {\n return this._node.eachCompare(this._node.all, (element) => element.currently.hasAnyText(), filterMask, true);\n }", "function queryTextAll(parentEl, text, comparison = \"equals\") {\n \n if (\n parentEl == null\n || parentEl instanceof HTMLDocument\n || parentEl instanceof Window\n ) {\n parentEl = document.body;\n }\n \n let argsAreValid = !(\n !(parentEl instanceof HTMLElement)\n || !text\n || ![\"equals\", \"includes\"].includes(comparison)\n );\n if (!argsAreValid) {\n return [];\n }\n \n let matches = [];\n \n let nodes = Array.from(parentEl.childNodes);\n \n let textNodes = nodes.filter(node => node.nodeName == \"#text\");\n textNodes.forEach(node => {\n if (comparison == \"equals\") {\n if (node.textContent && node.textContent.trim() == text) {\n matches.push(node.parentElement);\n }\n }\n else if (comparison == \"includes\") {\n if (nodes.textContent && nodes.textContent.includes(text)) {\n matches.push(node.parentElement);\n }\n }\n });\n \n let elemNodes = nodes.filter(node => ![\n \"#comment\",\n \"#text\",\n \"SCRIPT\",\n \"IFRAME\",\n ].includes(node.nodeName));\n elemNodes.forEach(node => {\n let match = queryText(node, text, comparison);\n if (match) {\n matches = matches.concat(match);\n }\n });\n \n return matches;\n}", "hasAnyText(filterMask) {\n return this._node.eachCheck(this._node.all, (element) => element.currently.hasAnyText(), filterMask, true);\n }", "function filtered (input){\n Array.from(list.children).filter((arr)=>{\n return !arr.textContent.includes(input);\n }).forEach((arr)=>{\n arr.classList.add('filtered');\n });\n\n Array.from(list.children).filter((arr)=>{\n return arr.textContent.includes(input);\n}).forEach((arr)=>{\n arr.classList.remove('filtered');\n});\n}", "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode(node);\n if (debugNode) {\n if (elementsOnly && (debugNode instanceof DebugElement) && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "function PositionContentSearcher(rootNode, position) {\n this.rootNode = rootNode;\n this.position = position;\n // The cached text before position that has been read so far\n this.text = '';\n // All inline elements before position that have been read so far\n this.inlineElements = [];\n }", "getHasAnyDirectText(filterMask) {\n return this._node.eachCompare(this._node.all, (element) => element.currently.hasAnyDirectText(), filterMask, true);\n }", "validContent(content) {\n let result = this.contentMatch.matchFragment(content);\n if (!result || !result.validEnd)\n return false;\n for (let i = 0; i < content.childCount; i++)\n if (!this.allowsMarks(content.child(i).marks))\n return false;\n return true;\n }", "get childElements() {\n return this.childNodes.filter(isElement);\n }", "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n const nodes = parentNode.childNodes;\n const length = nodes.length;\n for (let i = 0; i < length; i++) {\n const node = nodes[i];\n const debugNode = getDebugNode$1(node);\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n else if (!elementsOnly && predicate(debugNode) &&\n matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "function _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildren(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n var nodes = parentNode.childNodes;\n var length = nodes.length;\n\n for (var i = 0; i < length; i++) {\n var node = nodes[i];\n var debugNode = getDebugNode$1(node);\n\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n } else if (!elementsOnly && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n }", "function _queryNativeNodeDescendants(parentNode, predicate, matches, elementsOnly) {\n var nodes = parentNode.childNodes;\n var length = nodes.length;\n\n for (var i = 0; i < length; i++) {\n var node = nodes[i];\n var debugNode = getDebugNode$1(node);\n\n if (debugNode) {\n if (elementsOnly && debugNode instanceof DebugElement__POST_R3__ && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n } else if (!elementsOnly && predicate(debugNode) && matches.indexOf(debugNode) === -1) {\n matches.push(debugNode);\n }\n\n _queryNativeNodeDescendants(node, predicate, matches, elementsOnly);\n }\n }\n}", "hasAnyDirectText(filterMask) {\n return this._node.eachCheck(this._node.all, (element) => element.currently.hasAnyDirectText(), filterMask, true);\n }", "getHasAnyText(filterMask) {\n return this.eachCompare(this.all, (element) => element.currently.hasAnyText(), filterMask, true);\n }", "function filterAll(node) {\n var count = 0;\n if (node && node.hasChildNodes()) {\n for (let i = 0; i < node.childNodes.length; i++) {\n count += filterAll(node.childNodes[i]); // recurse on child nodes\n }\n }\n\n // only filter the node after all its children have been filtered\n count += filter(node, count); \n return count;\n}", "domChildren() {\n return Array.from(this.children).filter(child => !child.hasAttribute(\"hidden\"));\n }", "someChildren(callback) {\n return this.childElements.some(visit);\n function visit(node) {\n if (callback(node)) {\n return true;\n }\n else {\n return node.childElements.some(visit);\n }\n }\n }", "function hasTemplateContent(node) {\n\n // Check the param state\n if ((node == undefined) || (node == null) || (node == '') || (node.children == undefined) || (node.children.length == 0))\n return false;\n\n // Loop over the children\n for (var i = 0; i < node.children.length; i++) {\n\n // Establish the name\n var name = getNodeName(node.children[i]);\n\n // Check the node name\n if ((name == \"IF\") ||\n (name == \"ELSEIF\") ||\n (name == \"ELSE\") ||\n (name == \"FOR\") ||\n (name == \"WITH\"))\n return true;\n\n if (hasTemplateContent(node.children[i]) == true)\n return true;\n\n }\n\n // Return\n return false;\n\n }", "function _queryAllR3(parentElement, predicate, matches, elementsOnly) {\n var context = loadLContext(parentElement.nativeNode);\n var parentTNode = context.lView[TVIEW].data[context.nodeIndex];\n _queryNodeChildrenR3(parentTNode, context.lView, predicate, matches, elementsOnly, parentElement.nativeNode);\n}", "function filter(filter_type, choices) {\n window.recipes.forEach(recipe => {\n if (choices.length === 0) {\n recipe[`${filter_type}`] = true;\n }\n if (filter_type === 'weather') {\n let recipeProperties = recipe.getElementsByTagName('ul')[0].children;\n for (let i = 0; i < recipeProperties.length; i++) {\n if (choices.length === 0) {\n recipe[`${filter_type}`] = true;\n } else {\n for (let j = 0; j < choices.length; j++) {\n if (recipeProperties[i].innerHTML === choices[j]) {\n recipe[`${filter_type}`] = true;\n }\n }\n }\n }\n } else {\n for (let i = 0; i < choices.length; i++) {\n var typeTag = recipe.getElementsByClassName(`${choices[i]}`);\n if (typeTag.length === 1) {\n recipe[`${filter_type}`] = true;\n }\n if (filter_type === 'diet') {\n if (choices[i] === 'Everything') {\n recipe[`${filter_type}`] = true;\n }\n }\n }\n }\n })\n}", "getChildren(n) {\r\n if (n) {\r\n return n.children.filter(\r\n child => Boolean( child )\r\n )\r\n }\r\n else {\r\n return []\r\n }\r\n }", "function findIfFilters(filter_type) {\n let choices = [];\n const checkboxes = document.getElementById(`${filter_type}-filter`).getElementsByTagName('input');\n for (let i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked === true) {\n choices.push(checkboxes[i].parentElement.textContent.slice(2));\n }\n }\n return choices;\n}", "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n\n return allMatches;\n } // Attributes", "everyChildren(callback) {\n return this.childElements.every(visit);\n function visit(node) {\n if (!callback(node)) {\n return false;\n }\n return node.childElements.every(visit);\n }\n }", "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n\n return allMatches;\n }", "function listarFiltros() {\n var filtros = [];\n for (let i = 0; i < elementoListaFiltro.children.length; i++) {\n let elementoLista = elementoListaFiltro.children.item(i);\n let elementoCheckBox = elementoLista.children.item(0);\n\n if (elementoCheckBox.type === 'checkbox') {\n filtros.push(elementoCheckBox);\n }\n }\n return filtros;\n}", "function getEffectiveTextNodes(range, context) {\r\n return range.getNodes([3], function(node) {\r\n return isEffectivelyContained(node, range) && !isIgnoredNode(node, context.options);\r\n });\r\n }", "function findAll$1(test, nodes) {\n var _a;\n var result = [];\n var stack = nodes.filter(domhandler_1$3.isTag);\n var elem;\n while (elem = stack.shift()) {\n var children = (_a = elem.children) === null || _a === void 0 ? void 0 : _a.filter(domhandler_1$3.isTag);\n if (children && children.length > 0) {\n stack.unshift.apply(stack, children);\n }\n if (test(elem))\n result.push(elem);\n }\n return result;\n}", "function findAll(test, nodes) {\n var _a;\n var result = [];\n var stack = nodes.filter(tagtypes_1.isTag);\n var elem;\n while ((elem = stack.shift())) {\n var children =\n (_a = elem.children) === null || _a === void 0\n ? void 0\n : _a.filter(tagtypes_1.isTag);\n if (children && children.length > 0) {\n stack.unshift.apply(stack, children);\n }\n if (test(elem)) result.push(elem);\n }\n return result;\n }", "get hasVisibleChildren() {}", "getContainsText(text) {\n return this._node.eachCompare(this._node.all, (element, expected) => element.currently.containsText(expected), text);\n }", "function findAll(test, nodes) {\n var _a;\n\n var result = [];\n var stack = nodes.filter(domhandler_1.isTag);\n var elem;\n\n while (elem = stack.shift()) {\n var children = (_a = elem.children) === null || _a === void 0 ? void 0 : _a.filter(domhandler_1.isTag);\n\n if (children && children.length > 0) {\n stack.unshift.apply(stack, children);\n }\n\n if (test(elem)) result.push(elem);\n }\n\n return result;\n}", "function findAll(test, nodes) {\n var _a;\n var result = [];\n var stack = nodes.filter(tagtypes.isTag);\n var elem;\n while ((elem = stack.shift())) {\n var children = (_a = elem.children) === null || _a === void 0 ? void 0 : _a.filter(tagtypes.isTag);\n if (children && children.length > 0) {\n stack.unshift.apply(stack, children);\n }\n if (test(elem))\n result.push(elem);\n }\n return result;\n}", "getHasAnyDirectText(filterMask) {\n return this.eachCompare(this.all, (element) => element.currently.hasAnyDirectText(), filterMask, true);\n }", "function findElementsContainingText(query, content) {\n\n var results = []; // array to hold results\n\n // workout which property to use to get inner text\n var txtProp = ('textContent' in document) ? 'textContent' : 'innerText';\n\n // get the list of elements to inspect\n var elements = document.querySelectorAll(query);\n\n for (var i = 0, l = elements.length; i < l; i++) {\n if (elements[i][txtProp].trim() === content.trim()) {\n results.push(elements[i]);\n }\n }\n\n return results;\n }", "function test5() {\n // WRONG\n console.log($('li:has(em).not'));\n}", "function filterType() {\r\n const filterButtonText = this.textContent.toLowerCase(); //Takes text value from filter button\r\n const liFilterNodeList = document.querySelectorAll('li'); //Selects all list items\r\n const liFilterArray = [...liFilterNodeList]; //Converts NodeList to Array\r\n\r\n function filterTypes(type) {\r\n const typesNodeList = type.querySelectorAll('.pokemon-type');\r\n const typesArray = [...typesNodeList];\r\n\r\n //Function stops and returns full array\r\n if (filterButtonText === \"all\") {\r\n return typesArray;\r\n }\r\n\r\n //If button text = type text then filter works\r\n for (let i = 0; i < typesArray.length; i++) {\r\n if (typesArray[i].textContent == filterButtonText) {\r\n return typesArray[i];\r\n }\r\n }\r\n }\r\n\r\n let results = [];\r\n results = liFilterArray.filter(filterTypes); //Adds filtered values to empty array\r\n\r\n //Function compares filtered items to full array and leaves items which are ===\r\n function compare(arr1, arr2) {\r\n arr1.forEach(function (a1) {\r\n a1.style.display = 'none';\r\n arr2.forEach(function (a2) {\r\n if (a1 === a2) {\r\n a1.style.display = '';\r\n }\r\n })\r\n })\r\n }\r\n\r\n compare(liFilterArray, results);\r\n}", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n const childView = lContainer[i];\n const firstChild = childView[TVIEW].firstChild;\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function findAll(test, nodes) {\n var _a;\n var result = [];\n var stack = nodes.filter(tagtypes_1.isTag);\n var elem;\n while ((elem = stack.shift())) {\n var children = (_a = elem.children) === null || _a === void 0 ? void 0 : _a.filter(tagtypes_1.isTag);\n if (children && children.length > 0) {\n stack.unshift.apply(stack, children);\n }\n if (test(elem))\n result.push(elem);\n }\n return result;\n}", "containsText(text) {\n return this._node.eachCheck(this._node.all, (element, expected) => element.currently.containsText(expected), text);\n }", "function findAll(test, nodes) {\n var _a;\n var result = [];\n var stack = nodes.filter(domhandler_1.isTag);\n var elem;\n while ((elem = stack.shift())) {\n var children = (_a = elem.children) === null || _a === void 0 ? void 0 : _a.filter(domhandler_1.isTag);\n if (children && children.length > 0) {\n stack.unshift.apply(stack, children);\n }\n if (test(elem))\n result.push(elem);\n }\n return result;\n}", "function findAll(test, nodes) {\n var _a;\n var result = [];\n var stack = nodes.filter(domhandler_1.isTag);\n var elem;\n while ((elem = stack.shift())) {\n var children = (_a = elem.children) === null || _a === void 0 ? void 0 : _a.filter(domhandler_1.isTag);\n if (children && children.length > 0) {\n stack.unshift.apply(stack, children);\n }\n if (test(elem))\n result.push(elem);\n }\n return result;\n}", "function findAll(test, nodes) {\n var _a;\n var result = [];\n var stack = nodes.filter(domhandler_1.isTag);\n var elem;\n while ((elem = stack.shift())) {\n var children = (_a = elem.children) === null || _a === void 0 ? void 0 : _a.filter(domhandler_1.isTag);\n if (children && children.length > 0) {\n stack.unshift.apply(stack, children);\n }\n if (test(elem))\n result.push(elem);\n }\n return result;\n}", "function searchChildren(children) {\n const results = [];\n\n for (let index = 0; index < children.length; index++) {\n const child = children[index];\n\n if (child.isActive && child.isDependent) {\n results.push(child);\n } else {\n results.push(...searchChildren(child.$children));\n }\n }\n\n return results;\n}", "function searchChildren(children) {\n const results = [];\n\n for (let index = 0; index < children.length; index++) {\n const child = children[index];\n\n if (child.isActive && child.isDependent) {\n results.push(child);\n } else {\n results.push(...searchChildren(child.$children));\n }\n }\n\n return results;\n}", "function searchChildren(children) {\n const results = [];\n\n for (let index = 0; index < children.length; index++) {\n const child = children[index];\n\n if (child.isActive && child.isDependent) {\n results.push(child);\n } else {\n results.push(...searchChildren(child.$children));\n }\n }\n\n return results;\n}", "function checkChildren(str) {\n jq('.' + str).each(function() {\n jq(this).attr(\"checked\", true);\n });\n}", "findAll(qs) {\n if (!this.element) return false;\n return Array.from(this.element.querySelectorAll(qs)).map((e) => enrich(e));\n }", "function parse_BooleanExpr() {\n tree.addNode('BooleanExpr', 'branch');\n if (foundTokensCopy[parseCounter][0] == '(') {\n match('(', parseCounter);\n parseCounter++;\n parse_Expr();\n //tree.endChildren();\n\n parse_boolop();\n //tree.endChildren();\n\n parse_Expr();\n //tree.endChildren();\n\n match(')', parseCounter);\n parseCounter++;\n } else {\n parse_boolval();\n //tree.endChildren();\n\n\n }\n tree.endChildren();\n\n}", "getIf(...nodeSelector) {\n let selectorStage = this.childNodes;\n for (let cnt = 0; cnt < nodeSelector.length; cnt++) {\n selectorStage = selectorStage.filterSelector(nodeSelector[cnt]);\n if (selectorStage.isAbsent()) {\n return selectorStage;\n }\n }\n return selectorStage;\n }", "getIf(...nodeSelector) {\n let selectorStage = this.childNodes;\n for (let cnt = 0; cnt < nodeSelector.length; cnt++) {\n selectorStage = selectorStage.filterSelector(nodeSelector[cnt]);\n if (selectorStage.isAbsent()) {\n return selectorStage;\n }\n }\n return selectorStage;\n }", "function isInsideJsxElementOrAttribute(sourceFile, position) {\n var token = getTokenAtPosition(sourceFile, position);\n if (!token) {\n return false;\n }\n if (token.kind === 244 /* JsxText */) {\n return true;\n }\n // <div>Hello |</div>\n if (token.kind === 25 /* LessThanToken */ && token.parent.kind === 244 /* JsxText */) {\n return true;\n }\n // <div> { | </div> or <div a={| </div>\n if (token.kind === 25 /* LessThanToken */ && token.parent.kind === 248 /* JsxExpression */) {\n return true;\n }\n // <div> {\n // |\n // } < /div>\n if (token && token.kind === 16 /* CloseBraceToken */ && token.parent.kind === 248 /* JsxExpression */) {\n return true;\n }\n // <div>|</div>\n if (token.kind === 25 /* LessThanToken */ && token.parent.kind === 245 /* JsxClosingElement */) {\n return true;\n }\n return false;\n }", "function setupXMLfilter() {\n return function hideXML(str) {\n // login wall-of-text:\n str = str.replace(/<mode id=\"GAME\"\\/>.*<\\/settings>/g, '')\n const spellsMatch = str.match(\n /^([\\s\\S\\r\\n]*)<pushStream id=\"percWindow\"\\/>[^<]+<popStream\\/>([\\s\\S\\r\\n]*)$/\n )\n if (spellsMatch) str = spellsMatch[1] + spellsMatch[2]\n str = str.replace(/<inv id='stow'>[^<]*<\\/inv>/g, '')\n str = str.replace(/<pushStream id='inv'\\/>[^<]*<popStream\\/>/gm, '')\n str = str.replace(/<clearStream id='inv' ifClosed='[^']*'\\/>/g, '')\n str = str.replace(/<right>[^<]*<\\/right>/g, '')\n str = str.replace(/<left>[^<]*<\\/left>/g, '')\n str = str.replace(/<clearStream id=\"percWindow\"\\/>/g, '')\n str = str.replace(/<clearContainer id=.\\S+.\\/>/g, '')\n str = str.replace(/<prompt.*<\\/prompt>/g, '')\n str = str.replace(/<spell.*<\\/spell>/g, '')\n str = str.replace(/<component.*\\/component>/g, '')\n str = str.replace(/<resource picture=\"\\d+\"\\/>/g, '')\n // Comment this for roomnames!\n str = str.replace(/<style id=\"roomName\" \\/>/g, '')\n str = str.replace(/<style id=\"\"\\/>/g, '')\n str = str.replace(/<preset id='roomDesc'>/g, '')\n str = str.replace(/<\\/preset>/g, '')\n str = str.replace(/<\\/?d>/g, '')\n str = str.replace(/<compass>.*<\\/compass>/g, '')\n str = str.replace(/<nav\\/>/g, '')\n str = str.replace(/<castTime value='\\d+'\\/>/g, '')\n str = str.replace(/<streamWindow .+\\/>/g, '')\n str = str.replace(/<right.*<\\/right>/g, '')\n str = str.replace(/<left.*<\\/left>/g, '')\n str = str.replace(/<inv id=.\\S+.>[^<]*<\\/inv>/g, '')\n str = str.replace(/<d cmd=\"\\S*\">/g, '') // useful for later, this is a command link\n str = str.replace(/<roundTime value='\\d+'\\/>/g, '')\n str = str.replace(/<dialogData id='minivitals'>[\\s\\S]+<\\/dialogData>/g, '')\n str = str.replace(/<castTime value='\\d+'\\/>/g, '')\n str = str.replace(/<playerID id='\\d+'\\/>/g, '')\n str = str.replace(/<settingsInfo[^\\/]+instance='\\w+'\\/>/g, '')\n str = str.replace(/<pushStream id=\"logons\"\\/>[^<]*<popStream\\/>/g, '')\n str = str.replace(/^\\s*$/gm, '') // empty lines\n str = str.replace(/^\\s*&lt;/, '<') // beginning of attack\n console.log('returning str:', str)\n return str\n }\n}", "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n return allMatches;\n }", "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n return allMatches;\n }", "get hasChildren() {}", "function filterByAttendant(){\n // get the value of the filter box\n var filter=document.getElementById(\"filter-attendant\").value.toLowerCase();\n\n // identify the element containers t be displayed if search text is found\n var products=document.getElementsByClassName(\"tbl-product-row\");\n\n // iterate through the array of products searching for the keywords\n\n for(i=0;i<products.length;i++){\n if(products[i].innerText.toLowerCase().includes(filter)){\n // show the ones that contain keywords.\n products[i].style.display=\"block\";\n }\n else{\n // hide those that dont contain the keywords\n products[i].style.display=\"none\";\n }\n }\n}", "_generateHTMLStructureFromFlatValue() {\n const that = this,\n fragment = document.createDocumentFragment();\n\n if (!that._valueFlat || that._valueFlat.length === 0) {\n return;\n }\n\n for (let i = 0; i < that._valueFlat.length; i++) {\n const item = that._valueFlat[i],\n customOperation = that.customOperations ? that.customOperations.find(operation => operation.name === item.data[1]) : false,\n parentGroupHTMLcontainer = item.parentId ? (that.shadowRoot || that).querySelector('[node-id=\"' + item.parentId + '\"]').\n querySelector('.jqx-filter-group-condition-container') : that.$.contentContainer;\n\n if (item.type === 'group') {\n const groupContainerBlock = document.createElement('div'),\n groupOperatorBlock = that._filterGroupRow(item.data),\n groupConditionsContainerBlock = document.createElement('div');\n\n groupContainerBlock.className = 'jqx-filter-group';\n groupConditionsContainerBlock.className = 'jqx-filter-group-condition-container';\n groupContainerBlock.appendChild(groupOperatorBlock);\n groupContainerBlock.appendChild(groupConditionsContainerBlock);\n fragment.appendChild(groupContainerBlock);\n\n groupContainerBlock.setAttribute('node-id', item.nodeId);\n that._valueFlat[i].htmlNode = groupContainerBlock;\n\n if (that._isMaxLevelExceeded(item.nodeId + '.0')) {\n groupContainerBlock.setAttribute('max-level', '');\n }\n }\n else {\n const condition = that._newFilterConditionRow(item.data);\n\n condition.setAttribute('node-id', item.nodeId);\n fragment.appendChild(condition);\n that._valueFlat[i].htmlNode = condition;\n\n if (['isblank', 'isnotblank'].indexOf(item.data[1]) !== -1 || (customOperation && customOperation.hideValue)) {\n condition.children[3].classList.add('jqx-hidden');\n }\n }\n\n parentGroupHTMLcontainer.appendChild(fragment);\n }\n }", "hasValidChildren() {\n const children = this.children;\n if (children.length <= 1) {\n return true;\n }\n // There are more 2 or more children - they must have conditions\n for (const child of children) {\n if (!child.condition) {\n return false;\n }\n }\n return true;\n }", "function queryInsignificantBranches(_ref) {\n var context = _ref.context,\n filter = _ref.filter;\n\n var containsFilteredElement = function containsFilteredElement(node) {\n var containsNode = (0, _comparePosition.getParentComparator)({ parent: node });\n return filter.some(containsNode);\n };\n\n // We'd use a Set() for this, if we could\n var insiginificantBranches = [];\n\n // see https://developer.mozilla.org/en-US/docs/Web/API/NodeFilter\n var CollectInsignificantBranchesFilter = function CollectInsignificantBranchesFilter(node) {\n if (filter.some(function (element) {\n return node === element;\n })) {\n // we've hit a filtered element and can ignore its children\n return NodeFilter.FILTER_REJECT;\n }\n\n if (containsFilteredElement(node)) {\n // we've hit a significant tree, so we'll have to keep investigating\n return NodeFilter.FILTER_ACCEPT;\n }\n\n // we've found an insignificant tree\n insiginificantBranches.push(node);\n return NodeFilter.FILTER_REJECT;\n };\n // IE requires a function, Browsers require {acceptNode: function}\n // see https://www.bennadel.com/blog/2607-finding-html-comment-nodes-in-the-dom-using-treewalker.htm\n CollectInsignificantBranchesFilter.acceptNode = CollectInsignificantBranchesFilter;\n\n var _document = (0, _getDocument2.default)(context);\n // see https://developer.mozilla.org/en-US/docs/Web/API/Document/createTreeWalker\n var walker = _document.createTreeWalker(\n // root element to start search in\n context,\n // element type filter\n NodeFilter.SHOW_ELEMENT,\n // custom NodeFilter filter\n CollectInsignificantBranchesFilter,\n // deprecated, but IE requires it\n false);\n\n while (walker.nextNode()) {\n // collection things is happening through the filter method\n }\n\n return insiginificantBranches;\n}", "function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, rootNativeNode) {\n ngDevMode && assertTNodeForLView(tNode, lView);\n const nativeNode = getNativeByTNodeOrNull(tNode, lView);\n // For each type of TNode, specific logic is executed.\n if (tNode.type & (3 /* AnyRNode */ | 8 /* ElementContainer */)) {\n // Case 1: the TNode is an element\n // The native node has to be checked.\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n if (isComponentHost(tNode)) {\n // If the element is the host of a component, then all nodes in its view have to be processed.\n // Note: the component's content (tNode.child) will be processed from the insertion points.\n const componentView = getComponentLViewByIndex(tNode.index, lView);\n if (componentView && componentView[TVIEW].firstChild) {\n _queryNodeChildren(componentView[TVIEW].firstChild, componentView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else {\n if (tNode.child) {\n // Otherwise, its children have to be processed.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We also have to query the DOM directly in order to catch elements inserted through\n // Renderer2. Note that this is __not__ optimal, because we're walking similar trees multiple\n // times. ViewEngine could do it more efficiently, because all the insertions go through\n // Renderer2, however that's not the case in Ivy. This approach is being used because:\n // 1. Matching the ViewEngine behavior would mean potentially introducing a depedency\n // from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.\n // 2. We would have to make `Renderer3` \"know\" about debug nodes.\n // 3. It allows us to capture nodes that were inserted directly via the DOM.\n nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);\n }\n // In all cases, if a dynamic container exists for this node, each view inside it has to be\n // processed.\n const nodeOrContainer = lView[tNode.index];\n if (isLContainer(nodeOrContainer)) {\n _queryNodeChildrenInContainer(nodeOrContainer, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (tNode.type & 4 /* Container */) {\n // Case 2: the TNode is a container\n // The native node has to be checked.\n const lContainer = lView[tNode.index];\n _addQueryMatch(lContainer[NATIVE], predicate, matches, elementsOnly, rootNativeNode);\n // Each view inside the container has to be processed.\n _queryNodeChildrenInContainer(lContainer, predicate, matches, elementsOnly, rootNativeNode);\n }\n else if (tNode.type & 16 /* Projection */) {\n // Case 3: the TNode is a projection insertion point (i.e. a <ng-content>).\n // The nodes projected at this location all need to be processed.\n const componentView = lView[DECLARATION_COMPONENT_VIEW];\n const componentHost = componentView[T_HOST];\n const head = componentHost.projection[tNode.projection];\n if (Array.isArray(head)) {\n for (let nativeNode of head) {\n _addQueryMatch(nativeNode, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (head) {\n const nextLView = componentView[PARENT];\n const nextTNode = nextLView[TVIEW].data[head.index];\n _queryNodeChildren(nextTNode, nextLView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n else if (tNode.child) {\n // Case 4: the TNode is a view.\n _queryNodeChildren(tNode.child, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n // We don't want to go to the next sibling of the root node.\n if (rootNativeNode !== nativeNode) {\n // To determine the next node to be processed, we need to use the next or the projectionNext\n // link, depending on whether the current node has been projected.\n const nextTNode = (tNode.flags & 4 /* isProjected */) ? tNode.projectionNext : tNode.next;\n if (nextTNode) {\n _queryNodeChildren(nextTNode, lView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function walk(el) {\n const textNodeType = 3;\n if (!el) {\n return;\n }\n\n if (el.hasChildNodes()) {\n [].forEach.call(el.childNodes, currentNode => {\n if (isFunction(filter) && !filter(currentNode)) {\n return;\n }\n if (isString(filter) && hasClass(currentNode, filter)) {\n return;\n }\n\n walk(currentNode);\n });\n }\n\n if (el.nodeType === textNodeType) {\n // For browsers support vue, the textContent property is all we need\n const nodeText = el.textContent || '';\n\n if (!nodeText.trim()) {\n return;\n }\n\n const highlightedText = highlightText(nodeText, keyword, flagClassName);\n let tmpDiv = document.createElement('div');\n\n tmpDiv.innerHTML = highlightedText;\n\n const { parentNode } = el;\n const { childNodes } = tmpDiv;\n\n while (childNodes.length) {\n /* eslint-disable-next-line no-magic-numbers */\n parentNode.insertBefore(childNodes[0], el);\n }\n parentNode.removeChild(el);\n tmpDiv = null;\n }\n }", "hasAnyText(opts = {}) {\n const { filterMask } = opts, otherOpts = __rest(opts, [\"filterMask\"]);\n return this._node.eachCheck(this._node.all, (element) => element.eventually.hasAnyText(otherOpts), filterMask, true);\n }", "function scanChildren(element){var found;if(element){for(var i=0,len=element.length;i<len;i++){var target=element[i];if(!found){for(var j=0,numChild=target.childNodes.length;j<numChild;j++){found=found||scanTree([target.childNodes[j]]);}}}}return found;}", "function Common_HTMLCanHaveChildren(theHTML)\n{\n\t//switch on tagname\n\treturn !theHTML.tagName.match(__NEMESIS_REGEX_HTML_NO_CHILDREN);\n}", "function filterTree(root) {\n var result = false;\n\n for (var i = 0; i < root.children.length; i++) {\n if (filterTree(root.children[i])) {\n result = true;\n }\n }\n root.showChildren = result;\n result = result || root.name.toLowerCase().indexOf($scope.zoneFilter.toLowerCase()) > -1;\n if (result) {\n root.hidden = false;\n }\n return result;\n }", "function filterTree(root) {\n var result = false;\n\n for (var i = 0; i < root.children.length; i++) {\n if (filterTree(root.children[i])) {\n result = true;\n }\n }\n root.showChildren = result;\n result = result || root.name.toLowerCase().indexOf($scope.zoneFilter.toLowerCase()) > -1;\n if (result) {\n root.hidden = false;\n }\n return result;\n }", "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n if (!selector || elementMatches$1(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n return allMatches;\n }", "function findChildren(parent, selector) {\n var parents = parent instanceof HTMLElement ? [parent] : parent;\n var allMatches = [];\n for (var i = 0; i < parents.length; i++) {\n var childNodes = parents[i].children; // only ever elements\n for (var j = 0; j < childNodes.length; j++) {\n var childNode = childNodes[j];\n if (!selector || elementMatches(childNode, selector)) {\n allMatches.push(childNode);\n }\n }\n }\n return allMatches;\n}", "function _buildFilterTree(expr) {\n var c;\n var child;\n var clean = false;\n var endParen;\n var esc = false;\n var i = 0;\n var obj;\n var tree = {};\n var split;\n var val = '';\n\n if (expr.length === 0)\n return tree;\n\n // Chop the parens (the call to matchParens below gets rid of the trailer)\n if (expr.charAt(0) == '(')\n expr = expr.substring(1, expr.length - 1);\n\n //store prefix operator\n if (expr.charAt(0) === '&') {\n tree.op = 'and';\n expr = expr.substring(1);\n } else if (expr.charAt(0) === '|') {\n tree.op = 'or';\n expr = expr.substring(1);\n } else if (expr.charAt(0) === '!') {\n tree.op = 'not';\n expr = expr.substring(1);\n } else {\n tree.op = 'expr';\n }\n\n if (tree.op != 'expr') {\n tree.children = [];\n\n // logical operators are k-ary, so we go until our expression string runs\n // out (at least for this recursion level)\n while (expr.length !== 0) {\n endParen = matchParens(expr);\n\n if (endParen == expr.length - 1) {\n tree.children[i] = _buildFilterTree(expr);\n expr = '';\n } else {\n child = expr.slice(0, endParen + 1);\n expr = expr.substring(endParen + 1);\n tree.children[i] = _buildFilterTree(child);\n }\n i++;\n }\n } else {\n //else its some sort of non-logical expression, parse and return as such\n var operatorStr = '';\n tree.name = '';\n tree.value = '';\n\n\n // This parses and enforces filter syntax, which is an AttributeDescription\n // plus a filter operator, followed by (for ldapjs), anything. Note\n // that ldapjs additionally allows the '_' character in the AD, as many\n // users rely on it, even though it's non-standard\n //\n // From 4.1.5 of RFC251\n //\n // AttributeDescription ::= LDAPString\n //\n // A value of AttributeDescription is based on the following BNF:\n //\n // <AttributeDescription> ::= <AttributeType> [ \";\" <options> ]\n //\n // <options> ::= <option> | <option> \";\" <options>\n //\n // <option> ::= <opt-char> <opt-char>*\n //\n // <opt-char> ::= ASCII-equivalent letters, numbers and hyphen\n //\n // Examples of valid AttributeDescription:\n //\n // cn\n // userCertificate;binary\n\n /* JSSTYLED */\n if (!/[a-zA-Z0-9;_\\-]+[~><:]?=.+/.test(expr))\n throw new Error(expr + ' is invalid');\n\n if (expr.indexOf('~=') !== -1) {\n operatorStr = '~=';\n tree.tag = 'approxMatch';\n } else if (expr.indexOf('>=') !== -1) {\n operatorStr = '>=';\n tree.tag = 'greaterOrEqual';\n } else if (expr.indexOf('<=') !== -1) {\n operatorStr = '<=';\n tree.tag = 'lessOrEqual';\n } else if (expr.indexOf(':=') !== -1) {\n operatorStr = ':=';\n tree.tag = 'extensibleMatch';\n } else if (expr.indexOf('=') !== -1) {\n operatorStr = '=';\n tree.tag = 'equalityMatch';\n } else {\n // tree.tag = 'present';\n throw new Error('invalid filter syntax');\n }\n\n if (operatorStr === '') {\n tree.name = expr;\n } else {\n // pull out lhs and rhs of equality operator\n var splitAry = expr.split(operatorStr);\n tree.name = splitAry.shift();\n tree.value = splitAry.join(operatorStr);\n\n // substrings fall into the equality bin in the\n // switch above so we need more processing here\n if (tree.tag === 'equalityMatch') {\n if (tree.value === '*') {\n tree.tag = 'present';\n } else {\n obj = parse_substr(tree);\n tree.initial = obj.initial;\n tree.any = obj.any;\n tree['final'] = obj['final'];\n tree.tag = obj.tag || tree.tag;\n tree.value = obj.value;\n esc = obj.esc;\n clean = obj.clean;\n }\n } else if (tree.tag == 'extensibleMatch') {\n split = tree.name.split(':');\n tree.extensible = {\n matchType: split[0],\n value: tree.value\n };\n\n switch (split.length) {\n case 1:\n break;\n case 2:\n if (split[1].toLowerCase() === 'dn') {\n tree.extensible.dnAttributes = true;\n } else {\n tree.extensible.rule = split[1];\n }\n break;\n case 3:\n tree.extensible.dnAttributes = true;\n tree.extensible.rule = split[2];\n break;\n default:\n throw new Error('Invalid extensible filter');\n }\n\n switch (tree.extensible.rule) {\n case '2.5.13.4':\n case 'caseIgnoreSubstringsMatch':\n tree.extensible.attribute = tree.extensible.matchType;\n obj = parse_substr(tree);\n tree.extensible.initial = obj.initial;\n tree.extensible.any = obj.any;\n tree.extensible['final'] = obj['final'];\n tree.value = obj.value;\n esc = obj.esc;\n clean = obj.clean;\n break;\n\n case '2.5.13.2':\n case 'caseIgnoreMatch':\n tree.extensible.attribute = tree.extensible.matchType;\n break;\n default:\n // noop\n break;\n }\n }\n }\n\n // Cleanup any escape sequences\n if (!clean) {\n\n for (i = 0; i < tree.value.length; i++) {\n c = tree.value[i];\n if (esc) {\n val += c;\n esc = false;\n } else if (c === '\\\\') {\n esc = true;\n } else {\n val += c;\n }\n }\n tree.value = val;\n }\n }\n\n return tree;\n}", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n var childView = lContainer[i];\n var firstChild = childView[TVIEW].firstChild;\n\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n}", "function filterByNodeType(arr, n) {\n return arr.filter((e) => e.nodeType === 1);\n}", "set hasChildren(value) {}", "function scanChildren(element) {\n var found;\n if ( element ) {\n for (var i = 0, len = element.length; i < len; i++) {\n var target = element[i];\n if ( !found ) {\n for (var j = 0, numChild = target.childNodes.length; j < numChild; j++) {\n found = found || scanTree([target.childNodes[j]]);\n }\n }\n }\n }\n return found;\n }", "function scanChildren(element) {\n var found;\n if ( element ) {\n for (var i = 0, len = element.length; i < len; i++) {\n var target = element[i];\n if ( !found ) {\n for (var j = 0, numChild = target.childNodes.length; j < numChild; j++) {\n found = found || scanTree([target.childNodes[j]]);\n }\n }\n }\n }\n return found;\n }", "function scanChildren(element) {\n var found;\n if ( element ) {\n for (var i = 0, len = element.length; i < len; i++) {\n var target = element[i];\n if ( !found ) {\n for (var j = 0, numChild = target.childNodes.length; j < numChild; j++) {\n found = found || scanTree([target.childNodes[j]]);\n }\n }\n }\n }\n return found;\n }", "function matchElement(element) {\n if (element.Level != 0) {\n return globalFilterFlag;\n }\n for (var index in this) {\n if (this[index]) {\n var value = element[index] ? element[index].removeHTMLTag() : \"\";\n // i is for ignoreCase\n if (!(new RegExp(this[index].escapeRegExp(), 'i').test(value))) {\n globalFilterFlag = false;\n return false;\n }\n }\n }\n globalFilterFlag = true;\n return true;\n }", "function getChildBoolean(xml, child) {\n\tvar childText = getChildText(xml, child);\n\tif (childText == \"true\") {\n\t\treturn true;\n\t}\n\telse if (childText == \"false\") {\n\t\treturn false;\n\t}\n\telse {\n\t\treturn null;\n\t}\n}", "function parentMatches(predicateFn) {\n return function (node) {\n let parent = node.parentNode;\n while (parent !== undefined) {\n if (predicateFn(parent)) {\n return true;\n }\n parent = parent.parentNode;\n }\n return false;\n };\n}", "function _queryNodeChildrenInContainerR3(lContainer, predicate, matches, elementsOnly, rootNativeNode) {\n for (var i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {\n var childView = lContainer[i];\n var firstChild = childView[TVIEW].firstChild;\n\n if (firstChild) {\n _queryNodeChildrenR3(firstChild, childView, predicate, matches, elementsOnly, rootNativeNode);\n }\n }\n }", "parentsWhileMatch(selector) {\n const retArr = [];\n let parent = this.parent().filter(item => item.matchesSelector(selector));\n while (parent.isPresent()) {\n retArr.push(parent);\n parent = parent.parent().filter(item => item.matchesSelector(selector));\n }\n return new DomQuery(...retArr);\n }", "parentsWhileMatch(selector) {\n const retArr = [];\n let parent = this.parent().filter(item => item.matchesSelector(selector));\n while (parent.isPresent()) {\n retArr.push(parent);\n parent = parent.parent().filter(item => item.matchesSelector(selector));\n }\n return new DomQuery(...retArr);\n }", "function filterBreeds(event) {\n //have access to event anyway, but if manipulating it should put as parameter\n const userSelection = event.target.value;\n // use filter to filter out breeds by letter\n // how to access breeds? get all elements on page that have breed\n // could add class name on creation to make easier, or use other selectors\n // if manipluating them elsewhere, would use class name to eliminate duplication\n // only works here because only lis\n const breedList = document.getElementsByTagName(\"li\");\n // debugger\n // to filter, could use filter, but the return value would be just list that match\n // would destroy all other ones and never be able to select other ones\n // instead loop through and hide ones that don't start with user selection so not removing!\n\n //forEach doesn't work, use for...of\n for (const breed of breedList) {\n //breed is html element, need to access innerText\n if (breed.innerText.startsWith(userSelection)) {\n // debugger\n breed.style.display = \"\";\n //shows any previosuly hidden breeds\n } else {\n breed.style.display = \"none\";\n }\n }\n}", "function ɵɵcontentQuery(directiveIndex, predicate, descend, read) {\n contentQueryInternal(getTView(), getLView(), predicate, descend, read, false, getCurrentTNode(), directiveIndex);\n}", "function contains(selector, text) {\r\n var elements = document.querySelectorAll(selector);\r\n return [].filter.call(elements, function (element) {\r\n return RegExp(text).test(element.textContent);\r\n });\r\n}", "function selectorTextFilter(node, index, originNode, textFilter) {\r\n function hasChildrenWithText(parentNode) {\r\n var cnCount = parentNode.childNodes.length;\r\n for (var i = 0; i < cnCount; i++) {\r\n if (selectorTextFilter(parentNode.childNodes[i], index, originNode, textFilter))\r\n return true;\r\n }\r\n return false;\r\n }\r\n function checkNodeText(text) {\r\n if (textFilter instanceof RegExp)\r\n return textFilter.test(text);\r\n return textFilter === text.trim();\r\n }\r\n // Element\r\n if (node.nodeType === 1) {\r\n // NOTE: In Firefox, <option> elements don't have `innerText`.\r\n // So, we fallback to `textContent` in that case (see GH-861).\r\n // SVG elements do not have `innerText` property as well\r\n return checkNodeText(node.innerText || node.textContent);\r\n }\r\n // Document\r\n if (node.nodeType === 9) {\r\n // NOTE: latest version of Edge doesn't have `innerText` for `document`,\r\n // `html` and `body`. So we check their children instead.\r\n var head = node.querySelector('head');\r\n var body = node.querySelector('body');\r\n return hasChildrenWithText(head) || hasChildrenWithText(body);\r\n }\r\n // DocumentFragment\r\n if (node.nodeType === 11)\r\n return hasChildrenWithText(node);\r\n return checkNodeText(node.textContent);\r\n }", "function get_real_children(node) {\n return [].filter.call(node.childNodes, is_node_not_empty);\n }" ]
[ "0.57309383", "0.5620076", "0.5612424", "0.5503472", "0.52730006", "0.51587266", "0.50474477", "0.50065356", "0.49436894", "0.49398923", "0.49030387", "0.49030325", "0.48921373", "0.4891908", "0.4878014", "0.4878014", "0.4878014", "0.4878014", "0.4878014", "0.48445186", "0.48164922", "0.4784076", "0.4772066", "0.47412974", "0.4710088", "0.47084123", "0.47008926", "0.46782252", "0.4673108", "0.46659166", "0.46625662", "0.46475223", "0.46299943", "0.4592592", "0.45790827", "0.4568286", "0.45591846", "0.4555603", "0.45509028", "0.45487595", "0.45421293", "0.45286798", "0.45198646", "0.45138013", "0.4500926", "0.4499056", "0.44741616", "0.4468388", "0.4468388", "0.4468388", "0.4468388", "0.4468388", "0.4466861", "0.4465869", "0.44651458", "0.44651458", "0.44651458", "0.44603023", "0.44603023", "0.44603023", "0.44511783", "0.44436008", "0.44396248", "0.442937", "0.442937", "0.44265437", "0.44247657", "0.44221774", "0.44221774", "0.44180176", "0.44176677", "0.44092375", "0.43956247", "0.4389914", "0.43802086", "0.43766236", "0.43762177", "0.4374688", "0.43718854", "0.43665856", "0.43665856", "0.43660653", "0.43626538", "0.4359649", "0.43519038", "0.43516496", "0.43496493", "0.43451285", "0.43451285", "0.43451285", "0.43275294", "0.43263537", "0.43242037", "0.43209684", "0.4320488", "0.4320488", "0.4320469", "0.43199563", "0.43135563", "0.43116736", "0.43080807" ]
0.0
-1
videoListUp controls theatre mode effect and animations
function videoListUp(){ $('.listUpWrap').hide(); $('.listDropWrap').slideDown(); $('.videoRowWrapper').velocity({ 'height': '60%' }, 600); $('#listContentWrap').velocity({ 'height': '40%' }, 600); $('.videoListRowWrapper').fadeIn(500, ()=>{ $('#text-carousel').slideDown(800); $('.thRow').fadeIn(700); $('.listDropWrap').slideDown(700); }); $('#mainVideo').velocity({ 'width': '98vh', 'height': '55vh' }, 600); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function overVideoControl() {\n videoCtrlTl.reverse();\n }", "function WeBack(theMode) {\n Mode = theMode;\n ModeCheck(Mode);\n\n areAnimated = [false, false, false, false];\n document.getElementById(\"nextVid\").style.display = \"none\";\n Learn_video.currentTime = 0;\n Learn_video.src = arrVideoList[0].name;\n Learn_video.play();\n console.log(arrVideoList[0].emotions);\n}", "function Learn_show() {\n console.log('Learn_show()');\n\n setInterval(Learn_onVideoUpdate, 50);\n\n Learn_setGreenLights();\n Learn_setVideoControls();\n\n Learn_setInteractionCallbacksLearn();\n CheckClick(clickCount);\n NextButtonClick();\n\n console.log(arrVideoList[0].emotions);\n\n videoCounter = arrVideoList.length;\n\n window.onresize = Learn_onResize;\n\n //Learn_setFullscreen();\n\n Learn_video.play();\n}", "function Learn_show(theMode) {\n //console.log('Learn_show()');\n\n Mode = theMode;\n console.log(\"STARTED IN MODE: \" + Mode);\n\n setInterval(Learn_onVideoUpdate, 50);\n\n Learn_setGreenLights();\n Learn_setVideoControls();\n Learn_setInteractionCallbacksLearn();\n\n if(Mode == \"play\") {\n CheckNew();\n //NextButtonClick();\n document.getElementById(\"button-gallery\").style.display = \"none\";\n }\n else {\n document.getElementById(\"button-gallery\").style.display = \"block\";\n }\n NextButtonClick();\n console.log(arrVideoList[0].emotions);\n\n window.onresize = Learn_onResize;\n //Learn_setFullscreen();\n\n Learn_video.src = arrVideoList[0].name;\n Learn_video.play();\n}", "function hoverVideo(e) { \n\t $('video', this).get(0).play(); \n $('video', this).removeClass('gris');\n // $('video', this).get(0).currentTime = 3;\n \n\n\t}", "function addUp() \n {\n for (i=0; i<= pauses.length-1; i++) \n {\n vidSum[i] = pauses[i] - plays[i];\n }\n\n durVid = vidSum.reduce(add, 0) / 1000;\n\n // Somewhat arbitrary amount in seconds to mark the video as \"watched\". \n if (durVid >= 3) \n {\n var vidId = vidlog.event.split(\"%\")[5];\n\n if (!finishedContentIds.includes(vidId))\n {\n var elements = document.getElementsByClassName(\"hd hd-2\"); \n var videoTitle = \"\"; \n\n if (elements.length > 0)\n {\n videoTitle = elements[0].innerText; \n }\n\n logVideoEvent(videoTitle);\n finishedContentIds.push(vidId)\n }\n }\n }", "function getVideo(event) { \n if (event.target.id == 'arrow-right') {\n activeIndex += 1;\n if (activeIndex == srcList.length) {\n activeIndex = 0;\n }\n }\n\n else if (event.target.id == 'arrow-left') {\n activeIndex -= 1;\n if (activeIndex < 0 ) {\n activeIndex = srcList.length - 1;\n }\n } \n \n else if (event.target.id == 'button-1') {\n activeIndex = 0;\n }\n\n else if (event.target.id == 'button-2') {\n activeIndex = 1;\n }\n\n else if (event.target.id == 'button-3') {\n activeIndex = 2;\n }\n \n setVideo(srcList[activeIndex]); // calling a function with the active video source in order to play the video\n activeButton(activeIndex);\n}", "function outVideoControl() {\n videoCtrlTl.play();\n }", "function buildVideoList(id, activeId, media) {\n var list = document.getElementById(id);\n \n // clear old content\n list.innerHTML = '';\n\n var n = media.length;\n \n console.log('Building menu ('+id+') with ' + n + ' elements');\n \n for (var i = 0; i < n; i++) {\n var video = media[i];\n \n \n var title = video.title;\n if (video.grandparentTitle) {\n title = video.grandparentTitle;\n }\n var meta = ' <img src=\"images/bullet1.png\" alt=\"\" /> ' + video.year;\n var offset = (video.viewOffset) ? video.viewOffset : 0;\n \n var item = document.createElement('li');\n item.setAttribute('data-key', video.key);\n\n if(video.type == \"photo\")\n item.setAttribute('data-type', (video.type));\n else\n item.setAttribute('data-type', (video.container) ? 'container' : 'video');\n item.setAttribute('data-title', title);\n item.setAttribute('data-meta', meta);\n item.setAttribute('data-offset', offset);\n //item.setAttribute('onclick', 'jump(,\"'+(i*140)+'px\");');\n\n var thumb = video.thumb;\n if (video.grandparentThumb) {\n thumb = video.grandparentThumb;\n }\n\n if (Settings.useBlobs()) {\n if(Blobs.retrieveBlob(thumb, \"small\"))\n var scaledThumb = Blobs.retrieveBlob(thumb, \"small\");\n else\n var scaledThumb = plexAPI.getScaledImageURL(plexAPI.getURL(thumb), 121, 170);\n }\n else\n var scaledThumb = plexAPI.getScaledImageURL(plexAPI.getURL(thumb), 121, 170);\n \n var imageContainer = document.createElement(\"div\");\n imageContainer.className = \"imagecnt\";\n \n var img = new Image();\n img.onerror = posterErrorHandler;\n \n /* this needs fixing \n if (i < PRELOADED_IMAGES) {\n img.src = scaledThumb;\n img.setAttribute('data-src', scaledThumb);\n }\n else {\n img.src = PLACEHOLDER_IMAGE;\n img.setAttribute('data-src', scaledThumb);\n }\n */\n img.src = scaledThumb;\n img.setAttribute('data-src', scaledThumb); \n \n var episdeSeason;\n if(video.season){\n episdeSeason = document.createElement(\"span\");\n episdeSeason.className = \"episodeseason\";\n episdeSeason.innerHTML = \"S\" + video.season + \" <span class='icon-small'></span> E\" + video.episode;\n }\n \n var photoTitle;\n if(video.type == \"photo\") {\n photoTitle = document.createElement(\"span\");\n photoTitle.className = \"photo-subtitle\";\n photoTitle.innerHTML = video.title; \n } \n \n \n var progressImage;\n \n if (offset > 0)\n progressImage = \"images/OverlayInProgress.png\";\n else if (!video.viewCount) \n progressImage = \"images/OverlayUnwatched.png\";\n \n if(progressImage){ \n var progress = new Image();\n progress.src = progressImage;\n progress.className = \"progress\";\n }\n \n item.appendChild(imageContainer);\n imageContainer.appendChild(img);\n if(photoTitle)\n imageContainer.appendChild(photoTitle);\n if(episdeSeason)\n item.appendChild(episdeSeason);\n if(progressImage)\n item.appendChild(progress); \n list.appendChild(item);\n\n if (i === 0) {\n item.setAttribute('id',activeId);\n }\n\n }\n }", "function playVideoJanFeb()\r\n{\r\n\r\n\t\t$('#image3').transition({ rotateX: '-105deg' }, 700, 'in-out', function(){ $(\"#image3\").css(\"display\",\"none\"); $(\"#image3back\").css(\"display\",\"none\"); });\r\n\t\t$('#image2').transition({ rotateX: '-105deg' , delay: 600}, 700, 'in-out', function(){ $(\"#image2\").css(\"display\",\"none\"); $(\"#image2back\").css(\"display\",\"none\"); });\r\n\t\t$('#image1').transition({ rotateX: '-105deg' , delay: 1200}, 700, 'in-out', function(){ \r\n\t\t\t\t\r\n\t\t\t\t$(\"#image1\").css(\"display\",\"none\"); \r\n\t\t\t\t$(\"#image1back\").css(\"display\",\"none\");\r\n\t\t\t\t$('#episodeVideoWindow').css(\"display\",\"block\"); \r\n\t\t\t\t$('#episodeVideoWindowBack').css(\"display\",\"block\"); \r\n\t\t\t\t$('#episodeVideoWindow').transition({ rotateX: '0deg' }, 700, 'in-out',function(){ \r\n\t\t\t\t\t//console.log(\"ROTATE ANIM END\");\r\n\t\t\t\t\t//$(\"#episodeVideoFrame\").remove(); \r\n\t\t\t\t\t$(\"#episodeVideo\").css(\"display\",\"inline-block\"); \r\n\t\t\t\t\r\n\t\t\t\t}); \r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\t$(\"#playVideoJanFavBTN\").css(\"display\", \"block\");\r\n\t\t\r\n\t\t$(\"#playVideoBtn\").off(\"click\",monthsToShow[currentSelectedMonth].playVideo);\r\n\t\t//console.log(\"Video Off\",$(\"#playVideoBtn\"));\r\n\t\t\r\n\t\tTweenMax.to($(\"#playVideoBtn\"),0.5,{css:{opacity: 0}, ease: Expo.easeInOut, onComplete: function(){\r\n\t\t\t$(\"#playVideoBtn\").css(\"display\",\"none\");\r\n\t\t}});\r\n\t\t$(\"#closeVideoBtn\").css(\"opacity\",\"0\").css(\"display\",\"block\");\r\n\t\t\r\n\t\t\r\n\t\t$(\"#closeVideoBtn\").on(\"click\",monthsToShow[currentSelectedMonth].reverseVideo);\r\n\t\t\r\n\t\tTweenMax.to($(\"#closeVideoBtn\"),0.5,{css:{opacity: 1}, delay: 0.5, ease: Expo.easeInOut});\r\n\t\t\r\n\t\tmonthsToShow[currentSelectedMonth].videoStatus = true;\r\n\t\t\r\n}", "function init()\n{\n isTouchable = hasTouchScreen();\n VideoSource = document.getElementById(\"video\");\n loader = document.getElementById(\"collapse-loader\");\n animation = document.getElementById(\"animation\");\n banner = document.getElementById(\"banner\");\n loader.addEventListener(\"click\", clickthrough);\n var images = [];\n images.push(Enabler.getUrl('img/bg_perso.jpg'));\n images.push(Enabler.getUrl('img/coke_1.png'));\n images.push(Enabler.getUrl('img/fade.png'));\n images.push(Enabler.getUrl('img/t_episodes.png'));\n images.push(Enabler.getUrl('img/arrow_expand.png'));\n images.push(Enabler.getUrl('img/t_demarrez_votre_mois_gratuit.png'));\n \n if (!isMobile.any())\n {\n \n images.push(Enabler.getUrl('img/arrow_expand_red.png'));\n images.push(Enabler.getUrl('img/t_demarrez_votre_mois_gratuit_rollover.png'));\n }\n \n\n \n\n// IF YOU HAVE A CTA INSIDE YOUR VIDEO OR INTO YOUR ENDSHOT\n// USE THIS FUNCTION TO DISPLAYED DIFFERENT IMAGE/VIDEO\n\n\n preloadImages(images, startAd);\n}", "function videoClickEvent(item,container,opt,simpleframe) {\n\n\n\t\t\t item.css({transform:\"none\",'-moz-transform':'none','-webkit-transform':'none'});\n\t\t\t item.closest('.esg-overflowtrick').css({transform:\"none\",'-moz-transform':'none','-webkit-transform':'none'});\n\t\t\t item.closest('ul').css({transform:\"none\",'-moz-transform':'none','-webkit-transform':'none'});\n\n\n\t\t\t // PREPARE THE CONTAINERS FOR MEDIAS\n\t\t\t if (!simpleframe)\n\t\t\t\t item.find('.esg-media-video').each(function() {\n\t\t\t\t var prep = jQuery(this);\n\t\t\t\t if (prep.data('youtube')!=undefined && item.find('.esg-youtube-frame').length==0) {\n\t\t\t\t\t var media= item.find('.esg-entry-media');\n\t\t\t\t \t var ytframe = \"https://www.youtube.com/embed/\"+prep.data('youtube')+\"?version=3&enablejsapi=1&html5=1&controls=1&autohide=1&rel=0&showinfo=0\";\n\t\t\t\t\t media.append('<iframe class=\"esg-youtube-frame\" wmode=\"Opaque\" style=\"position:absolute;top:0px;left:0px;display:none\" width=\"'+prep.attr(\"width\")+'\" height=\"'+prep.attr(\"height\")+'\" data-src=\"'+ytframe+'\" src=\"about:blank\"></iframe>');\n\t\t\t\t }\n\n\t\t\t\t if (prep.data('vimeo')!=undefined && item.find('.esg-vimeo-frame').length==0) {\n\t\t\t\t\t var media= item.find('.esg-entry-media');\n\t\t\t\t \t var vimframe = \"http://player.vimeo.com/video/\"+prep.data('youtube')+\"?title=0&byline=0&html5=1&portrait=0&api=1;\";\n\t\t\t\t\t media.append('<iframe class=\"esg-vimeo-frame\" allowfullscreen=\"false\" style=\"position:absolute;top:0px;left:0px;display:none\" webkitallowfullscreen=\"\" mozallowfullscreen=\"\" allowfullscreen=\"\" width=\"'+prep.attr(\"width\")+'\" height=\"'+prep.attr(\"height\")+'\" data-src=\"'+vimframe+'\" src=\"about:blank\"></iframe>');\n\t\t\t\t }\n\t\t\t\t\tif (prep.data('wistia')!=undefined && item.find('.esg-wistia-frame').length==0) {\n\t\t\t\t\t var media= item.find('.esg-entry-media');\n\t\t\t\t \t var wsframe = \"https://fast.wistia.net/embed/iframe/\"+prep.data('wistia')+\"?version=3&enablejsapi=1&html5=1&controls=1&autohide=1&rel=0&showinfo=0\";\n\t\t\t\t\t media.append('<iframe class=\"esg-wistia-frame\" wmode=\"Opaque\" style=\"position:absolute;top:0px;left:0px;display:none\" width=\"'+prep.attr(\"width\")+'\" height=\"'+prep.attr(\"height\")+'\" data-src=\"'+wsframe+'\" src=\"about:blank\"></iframe>');\n\t\t\t\t }\n\t\t\t\t if (prep.data('soundcloud')!=undefined && item.find('.esg-soundcloud-frame').length==0) {\n\t\t\t\t\t var media = item.find('.esg-entry-media');\n\t\t\t\t\t var scframe = 'https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/'+prep.data('soundcloud')+'&amp;auto_play=false&amp;hide_related=false&amp;visual=true&amp;show_artwork=true';\n\t\t\t\t\t media.append('<iframe class=\"esg-soundcloud-frame\" allowfullscreen=\"false\" style=\"position:absolute;top:0px;left:0px;display:none\" webkitallowfullscreen=\"\" mozallowfullscreen=\"\" allowfullscreen=\"\" width=\"'+prep.attr(\"width\")+'\" height=\"'+prep.attr(\"height\")+'\" scrolling=\"no\" frameborder=\"no\" data-src=\"'+scframe+'\" src=\"about:blank\"></iframe>');\n\t\t\t\t }\n\n\t\t\t\t if ((prep.data('mp4')!=undefined || prep.data('webm')!=undefined || prep.data('ogv')!=undefined) && item.find('.esg-video-frame').length==0 ) {\n\t\t\t\t \t var media= item.find('.esg-entry-media');\n\t\t\t media.append('<video class=\"esg-video-frame\" style=\"position:absolute;top:0px;left:0px;display:none\" width=\"'+prep.attr(\"width\")+'\" height=\"'+prep.attr(\"height\")+'\" data-origw=\"'+prep.attr(\"width\")+'\" data-origh=\"'+prep.attr(\"height\")+'\" ></video');\n\t\t\t\t if (prep.data('mp4')!=undefined) media.find('video').append('<source src=\"'+prep.data(\"mp4\")+'\" type=\"video/mp4\" />');\n\t\t\t\t if (prep.data('webm')!=undefined) media.find('video').append('<source src=\"'+prep.data(\"webm\")+'\" type=\"video/webm\" />');\n\t\t\t\t if (prep.data('ogv')!=undefined) media.find('video').append('<source src=\"'+prep.data(\"ogv\")+'\" type=\"video/ogg\" />');\n\t\t\t\t }\n\n\t\t\t\t })\n\n\t\t\t adjustMediaSize(item,true,null,opt);\n\n\t\t\t var ifr = item.find('.esg-youtube-frame');\n\t\t\t if (ifr.length==0) ifr=item.find('.esg-vimeo-frame');\n\t\t\t if (ifr.length==0) ifr=item.find('.esg-wistia-frame');\n\t\t\t if (ifr.length==0) ifr=item.find('.esg-soundcloud-frame');\n\t\t\t if (ifr.length==0) ifr=item.find('.esg-video-frame');\n\n\t\t\t var cover = item.find('.esg-entry-cover');\n\t\t\t var poster = item.find('.esg-media-poster');\n\n\n\n\t\t\t // IN CASE NO FRAME IS PREDEFINED YET WE NEED TO LOAD API, AND VIDEO, AND CHANGE SRC\n\n\t\t\t if (ifr.attr('src')==\"about:blank\") {\n\t\t\t\t ifr.attr('src',ifr.data('src'));\n\n\t\t\t\t loadVideoApis(container,opt);\n\t\t\t\t if (!simpleframe) punchgs.TweenLite.set(ifr,{opacity:0,display:\"block\"});\n\t\t\t\t var intr = setInterval(function() {\n\n\t\t\t\t \t// CHECK IF YOUTUBE MEDIA IS IN THE CONTAINER\n\t\t\t\t \tif (ifr.attr('src').toLowerCase().indexOf('youtube')>0) {\n\t\t\t\t \t if (prepareYT(ifr)==true) {\n\n\t\t\t\t \t\t\tclearInterval(intr);\n\t\t\t\t \t\t\tif (!simpleframe) {\n\t\t\t\t \t\t\t\tif (is_mobile()) {\n\t\t\t\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t\t\t\t} else {\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tplayYT(ifr,simpleframe);\n\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t \t}\n\t\t\t\t \t }\n\t\t\t\t \t}\n\n\t\t\t\t \telse\n\n\t\t\t\t\t// CHECK IF VIMEO MEDIA IS IN THE CONTAINER\n\t\t\t\t \tif (ifr.attr('src').toLowerCase().indexOf('vimeo')>0) {\n\t\t\t\t \t if (prepareVimeo(ifr)==true) {\n\t\t\t\t \t \t\tclearInterval(intr);\n\t\t\t\t \t \t\tif (!simpleframe) {\n\t\t\t\t\t \t \t\tif (is_mobile()) {\n\t\t\t\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t\t\t\t} else {\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\n\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t \tplayVimeo(ifr,simpleframe);\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t \telse\n\t\t\t\t\t\n\t\t\t\t\t// CHECK IF wistia MEDIA IS IN THE CONTAINER\n\t\t\t\t\tif (ifr.attr('src').toLowerCase().indexOf('wistia')>0) {\n\t\t\t\t\t\tif (prepareWs(ifr)==true) {\n\n\t\t\t\t \t\t\tclearInterval(intr);\n\t\t\t\t \t\t\tif (!simpleframe) {\n\t\t\t\t \t\t\t\tif (is_mobile()) {\n\t\t\t\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t\t\t\t} else {\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tplayYT(ifr,simpleframe);\n\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t \t}\n\n\t\t\t\t\telse\n\n\t\t\t\t\t// CHECK IF VIMEO MEDIA IS IN THE CONTAINER\n\t\t\t\t \tif (ifr.attr('src').toLowerCase().indexOf('soundcloud')>0) {\n\t\t\t\t \t if (prepareSoundCloud(ifr)==true) {\n\t\t\t\t \t \t\tclearInterval(intr);\n\t\t\t\t \t \t\tif (!simpleframe) {\n\t\t\t\t\t\t \t\tif (is_mobile()) {\n\t\t\t\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t\t\t\t} else {\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\n\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t \t\tplaySC(ifr,simpleframe);\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t},100);\n\t\t\t} else\n\n\t\t\tif (ifr.hasClass(\"esg-video-frame\")) {\n\n\t\t\t\t loadVideoApis(container,opt);\n\t\t\t\t punchgs.TweenLite.set(ifr,{opacity:0,display:\"block\"});\n\t\t\t\t // CHECK IF VIDEO MEDIA IS IN THE CONTAINER\n\t\t\t\t var intr = setInterval(function() {\n\t\t\t\t \t if (prepareVideo(ifr)==true) {\n\t\t\t\t \t \t\tclearInterval(intr);\n\t\t\t\t \t \t\tif (!simpleframe) {\n\t\t\t\t\t \t \t\tif (is_mobile()) {\n\t\t\t\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t\t\t\t} else {\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\n\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t \tplayVideo(ifr,simpleframe);\n\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t}\n\t\t\t\t },100)\n\n\t\t\t } else {\n\t\t\t\tif (!simpleframe) {\n\t\t\t\t\tif (is_mobile()) {\n\t\t \t\t\t\tpunchgs.TweenLite.set(ifr,{autoAlpha:1});\n\t\t\t\t \t\tpunchgs.TweenLite.set(poster,{autoAlpha:0});\n\t\t\t\t \t\tpunchgs.TweenLite.set(cover,{autoAlpha:0});\n\t\t\t\t \t} else {\n\n\t\t\t\t\t\tpunchgs.TweenLite.set(ifr,{opacity:0,display:\"block\"});\n\t\t\t\t \t\tpunchgs.TweenLite.to(ifr,0.5,{autoAlpha:1});\n\t\t\t\t \t\tpunchgs.TweenLite.to(poster,0.5,{autoAlpha:0});\n\t\t\t\t \t\tpunchgs.TweenLite.to(cover,0.5,{autoAlpha:0});\n\t\t\t\t \t}\n\t\t\t \t}\n\t\t \t\tif (ifr.attr('src') !=undefined) {\n\t\t\t \t\tif (ifr.attr('src').toLowerCase().indexOf('youtube')>0)\n\t\t\t\t\t \tplayYT(ifr,simpleframe);\n\t\t\t\t\tif (ifr.attr('src').toLowerCase().indexOf('vimeo')>0)\n\t\t\t\t\t \tplayVimeo(ifr,simpleframe);\n\t\t\t\t\tif (ifr.attr('src').toLowerCase().indexOf('wistia')>0)\n\t\t\t\t\t \tplayWs(ifr,simpleframe);\n\t\t\t\t\tif (ifr.attr('src').toLowerCase().indexOf('soundcloud')>0)\n\t\t\t\t\t \tplaySC(ifr,simpleframe);\n\n\t\t\t\t}\n\t\t\t }\n}", "function setUpPlaylist(input){\n var player=input.player, playlistId=input.playlistId, div=input.div, \n actionClick=input.actionClick, actionEnter=input.actionEnter, actionLeave=input.actionLeave;\n styleNowPlaying=input.styleNowPlaying, styleNotPlaying=input.styleNotPlaying;\n //div.style.display=\"block\";\n var sampleNode=div.getElementsByClassName('sampleNode')[0].cloneNode(true);\n while (div.firstChild) {\n div.removeChild(div.firstChild);\n }\n div.appendChild(sampleNode);\n var templateNode = sampleNode.cloneNode(true);\n sampleNode.style.display = \"none\";\n //get playlist video Ids as array\n var playlist=[],item=[],len;\n var styled=false;\n followPlaylist(player, div, styleNowPlaying, styleNotPlaying);\n if(typeof playlistId===\"string\"){//use playlistId, Max 50 items\n playlistInfo(playlistId,getlist);\n }\n else {//use Array, no maximun\n playlist=playlistId;\n len=playlist.length;\n for(var i=0;i<len;i++){\n display(i);\n }\n } \n function getlist(data1){\n len=data1.items.length;//test2.innerHTML+=\" playlistData:\"+len;\n for(var i=0;i<len;i++){\n playlist[i]=data1.items[i].contentDetails.videoId;\n display(i); \n }\n }\n function display(i){\n videoInfo(playlist[i],construction);\n function construction(data){\n\n //item[i]=div.getElementsByClassName('sampleNode')[0].cloneNode(true);//true:clone with all descendants\n item[i] = templateNode.cloneNode(true); //true:clone with all descendants\n // item[i].style.display=\"block\";\n if(item[i].getElementsByClassName(\"title\")[0]!=null) \n item[i].getElementsByClassName(\"title\")[0].innerHTML=data.items[0].snippet.title;\n if(item[i].getElementsByClassName(\"channelTitle\")[0]!=null)\n item[i].getElementsByClassName(\"channelTitle\")[0].innerHTML=data.items[0].snippet.channelTitle;\n if(item[i].getElementsByClassName(\"thumbnail\")[0]!=null){ \n var image=document.createElement('img');\n //image.setAttribute('src',data.items[0].snippet.thumbnails.default.url);\n image.setAttribute('src', 'http://img.youtube.com/vi/' + playlist[i] + '/default.jpg');\n item[i].getElementsByClassName(\"thumbnail\")[0].appendChild(image);\n }\n\n item[i].className += \" playlistItem \"+i+\" \"+playlist[i];\n //item[i].id=\"position:\"+i;\n //test2.innerHTML+=item[i].id;\n if(input.actionClick!=null) item[i].addEventListener(\"click\",click);\n if(input.actionEnter!=null)item[i].addEventListener(\"mouseenter\",cursorEnter);//better to use css :hover\n if(input.actionLeave!=null)item[i].addEventListener(\"mouseleave\",cursorLeave);\n //insert item in the right order\n if (i === len - 1) {\n div.appendChild(item[i]);\n //div.getElementsByClassName('sampleNode')[0].style.display = \"none\";\n }\n for(var j=i+1;j<len;j=j+1){\n if(item[j]!=undefined){\n div.insertBefore(item[i], item[j]);\n break;\n }\n if(j===len-1) div.appendChild(item[i]);\n }\n\n //check if now playing\n if(styled===false){\n var videoId=getQueryVariable(player.getVideoUrl(),'v');\n if(playlist[i]===videoId) {\n var event={data:player.getPlayerState()};\n if (styleNowPlaying) styleNowPlaying(event, item[i]);\n styled=true;\n } \n }\n function click(event){\n //loadVideo(player,playlist[i]);\n actionClick(event,i,item[i]);\n }\n function cursorEnter(event){\n actionEnter(event,i,item[i]);\n }\n function cursorLeave(event){\n actionLeave(event,i,item[i]);\n }\n }\n } \n function followPlaylist(player, playlistDiv,styleNowPlaying,styleNotPlaying) {\n //but eventlistenr seems always happen before div setting\n // test2.innerHTML+=\" eventListener\";\n player.addEventListener(\"onStateChange\",nowPlaying);\n function nowPlaying(event){\n //if(event.data===-1){\n var videoId=getQueryVariable(player.getVideoUrl(),'v');\n var itemDiv=playlistDiv.getElementsByClassName(videoId)[0];\n var listItems=playlistDiv.getElementsByClassName(\"playlistItem\");\n if(styleNotPlaying!=null) {for(var i=0;i<listItems.length;i++) styleNotPlaying(event,listItems[i]);}\n if(styleNowPlaying!=null) styleNowPlaying(event,itemDiv);\n //}\n }\n } \n}", "function videoEndHandler1(e) {\n //creative.dom.video1.vid.currentTime = 0;\n creative.dom.video1.vid.pause();\n //creative.dom.video1.vidPauseBtn.style.visibility = 'hidden';\n //creative.dom.video1.vidPlayBtn.style.visibility = 'visible';\n creative.isClick1 = true;\n\n /**\n * Hide video container ONlY and not the controls \n */\n\n //creative.dom.video1.vidContainer\n creative.dom.video1.vid.style.display = 'block'; \n creative.dom.expandedBgr.style.display = 'block';\n creative.dom.expandedHeading.style.visibility = 'visible';\n creative.dom.expandedHeading.style.display = 'block';\n\n //start end frame tween animation\n endFrameAnimation();\n}", "function playVideo(index) {\n var num\n thumbnails[index].addEventListener(\"click\", function chooseVideo(){\n position = index * (-62)\n imageHolder.style.left = String(position) + \"vw\"\n imageHolder.style.transition =\"all 1s ease\"\n num = position / (-62)\n videoTitle.textContent = ids[num][\"title\"]\n description.textContent = ids[num][\"info\"]\n })\n thumbnails[index].addEventListener(\"mouseover\", function changeSize() {\n thumbnails[index].style.marginLeft = \"0vw\"\n thumbnails[index].style.marginRight = \"0vw\"\n thumbnails[index].style.marginTop = \"-0.5vw\"\n thumbnails[index].style.width = \"8vw\"\n thumbnails[index].style.height = \"4.5vw\"\n //thumbnails[index].style.opacity = \"0.5\"\n })\n thumbnails[index].addEventListener(\"mouseout\", function changeSize() {\n thumbnails[index].style.marginLeft = \"0.5vw\"\n thumbnails[index].style.marginRight = \"0.5vw\"\n thumbnails[index].style.marginTop = \"0vw\"\n thumbnails[index].style.width = \"7vw\"\n thumbnails[index].style.height = \"4vw\"\n //thumbnails[index].style.opacity = \"1\"\n })\n}", "function playerControler() {\n var video = document.getElementById(\"Videotv\");\n var image = document.getElementById(\"Imagetv\");\n var count =0; // conta os elementos\n var toplay; //guarda o url do item a reproduzir :)\n var value = 4;\n var playlistsize = $(\"#playlistsize\").val();\n playlist = String($(\"#playlist\").val()).split(\";\");\n for(var i=0;i<playlistsize;i++){\n if($(\"#nextmultimedia\").val()==playlistsize || $(\"#nextmultimedia\").val()==0){\n $(\"#nextmultimedia\").val(1);\n toplay = playlist[1];\n break;\n }else{\n if(count==$(\"#nextmultimedia\").val() && $(\"#nextmultimedia\").val()<playlistsize){\n toplay = playlist[value-3];\n $(\"#nextmultimedia\").val(count+1);\n break;\n }\n }\n value=value+4;\n count++;\n }\n if(playlist[value-2]=='video'){\n $('#Imagetv').hide();\n $(\"#Videotv\").show();\n video.src = toplay;\n video.play();\n videoManager();\n }else if(playlist[value-2]=='image'){\n $(\"#Videotv\").hide();\n $('#Imagetv').show();\n $('#targetTime').val(playlist[value-1]);\n image.src = toplay;\n startImageTime();\n }\n}", "function videoEndHandler1(e) {\r\n //creative.dom.video1.vid.currentTime = 0;\r\n console.log('expanded intro video ended')\r\n creative.dom.video1.vid.pause();\r\n creative.dom.video1.vidPauseBtn.style.visibility = 'hidden';\r\n creative.dom.video1.vidPlayBtn.style.visibility = 'visible';\r\n creative.isClick1 = true;\r\n ShowExpandedEndFrame ();\r\n}", "function playPrevVideo() {\n var index\n if (position < 0) {\n position = position + 62\n imageHolder.style.left = String(position) + \"vw\"\n imageHolder.style.transition =\"all 1s ease\"\n index = position / (-62)\n videoTitle.textContent = ids[index][\"title\"]\n description.textContent = ids[index][\"info\"]\n } else if (position === 0) {\n position = (ids.length-1) * (-62)\n imageHolder.style.left = String(position) + \"vw\"\n imageHolder.style.transition = \"left 0.5s ease\"\n index = position / (-62)\n videoTitle.textContent = ids[index][\"title\"]\n description.textContent = ids[index][\"info\"]\n }\n}", "restoreDown(){\n let restore=document.querySelectorAll(\".restore_down\");\n let video=document.querySelectorAll(\".video_1\");\n let title=document.querySelector(\"#movie_title_iframe\");\n let player=document.querySelector(\"#video_player \");\n let isRestoreDown=true;\n\n\n restore.forEach(function (el) {\n\n el.addEventListener(\"click\", function (event) {\n event.preventDefault();\n if (isRestoreDown) {\n isRestoreDown = false;\n\n video[0].style.cssText = \"height: 140%;\";\n el.style.cssText = \"margin-left: 2%;\";\n if (title.textContent.length >= 42) {\n\n title.style.cssText = \" padding-right:1%;\"\n } else {\n title.style.cssText = \"padding-right:16%;\"\n }\n player.style.cssText = \" border-radius: 2px; width: 40%; height: 25%;display:block;margin-top:272px;padding-top:1%;padding-bottom:8%;margin-left:800px\"\n } else {\n isRestoreDown = true;\n\n if (title.textContent.length > 30) {\n\n title.style.cssText = \" padding-right:38%;\"\n } else {\n title.style.cssText = \"padding-right:54%;\"\n }\n video[0].style.cssText = \"height: 60%;\";\n player.style.cssText = \" border-radius: none; width: 100%; height: 100%;display:block;margin-top:0;margin-left:0px;padding-top:5%;padding-bottom:7%;\"\n\n }\n\n\n })\n\n })\n }", "function switchVideo(n) {\r\n document.getElementsByTagName(\"video\")[0].pause();\r\n\r\n document.getElementById(\"mp4\").src = movieInfo[n].src;\r\n document.getElementById(\"ogg\").src =\r\n movieInfo[n].src.substring(0, movieInfo[n].src.length - 3) + \"ogg\";\r\n document.getElementsByTagName(\"video\")[0].load();\r\n\r\n // Change the position in the list\r\n position = n + 1;\r\n}", "function mouseUp (e) {\n if (onplayhead === true) {\n moveplayhead(e)\n window.removeEventListener('mousemove', moveplayhead, true)\n // change current time\n player.currentTime = player.duration * clickPercent(e, timeline, timelineWidth)\n player.addEventListener('timeupdate', timeUpdate, false)\n }\n if (onVolhead === true) {\n console.log('Vol Up')\n moveVolHead(e)\n window.removeEventListener('mousemove', moveVolHead, true)\n // change current time\n player.volume = volPercent(e)\n }\n onVolhead = false\n onplayhead = false\n $('*').removeClass('nonselectable')\n }", "function forwardButtonTrigger() {\n if (window.currentVideoSelectedForPlayback) {\n setCurrentlyPlaying(false)\n const currentNode = window.currentVideoSelectedForPlayback\n const currentTime = currentNode.data.videoCore.currentTime\n const currentVideoEnd = currentNode.data.metadata.endTime\n\n if (currentTime + 1 < currentVideoEnd) {\n currentNode.data.videoCore.currentTime += 1\n } else if (currentNode.next) {\n const remainingTime = 1 - currentTime\n window.currentVideoSelectedForPlayback = currentNode.next\n const nextStartTime = window.currentVideoSelectedForPlayback.data.metadata.startTime\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = nextStartTime + remainingTime\n } else {\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = currentVideoEnd\n }\n renderUIAfterFrameChange(window.currentVideoSelectedForPlayback)\n }\n}", "showVideoOnTop(){\n this.scrollToTop(200)\n this.box.video = !this.box.video\n }", "function landingPlayVideo(e) {\n\n\t\t\t// play all videos\n\t\t\tvideoOne.play();\n\t\t\tvideoTwo.play();\n\t\t\tvideoThree.play();\n\n\t\t\taudioThree.play();\n\t\t\taudioOne.play();\n\n\t\t\taudioThree.volume = 0.15;\n\n\t\t\tvideoWindow.classList.add(\"move-content\");\n\n\t\t\t// change videoPlay button text to pause\n\t\t\tvideoPlay.innerHTML = \"Pause\";\n\t\t\t// add \"playing\" class to video play button\n\t\t\tvideoPlay.classList.add(\"playing\");\n\n\t\t}", "function playNextVideo() {\n var index\n if (position === (ids.length-1) * (-62)) {\n position = 0\n imageHolder.style.left = String(position) + \"vw\"\n imageHolder.style.transition = \"left 0.5s ease\"\n index = position / (-62)\n videoTitle.textContent = ids[index][\"title\"]\n description.textContent = ids[index][\"info\"]\n } else if (position <= 0) {\n position = position - 62\n imageHolder.style.left = String(position) + \"vw\"\n imageHolder.style.transition =\"all 1s ease\"\n index = position / (-62)\n videoTitle.textContent = ids[index][\"title\"]\n description.textContent = ids[index][\"info\"]\n }\n}", "function playvideo(event){\n var addanimation=document.querySelector(\".\"+event);\n addanimation.classList.add(\"pressed\");\n setTimeout(function(){\n addanimation.classList.remove(\"pressed\")\n },100);\n\n}", "function thumbNowPlaying() {\n var offset = $(curTarget).offset();\n if (thumbTimeout) {\n clearInterval(thumbTimeout);\n }\n $(video_thumb).css(offset);\n //console.log(\"Moving video to \" + offset);\n $(video_thumb).show();\n thumbTimeout = setInterval(thumbShotTrigger, (extractTime(segment_list[cur_segment].end) - extractTime(segment_list[cur_segment].begin)) * 1000);\n video_thumb.removeEventListener(\"playing\", thumbNowPlaying);\n }", "function renderMovieList (list, $container, category) {\n $container.children[0].remove();\n list.forEach((movie) => {\n const HTMLString = videoItemTemmplate(movie, category);\n const movieElement = createTemplate(HTMLString);\n $container.append(movieElement);\n const image = movieElement.querySelector('img');\n image.addEventListener('load', (event) => {\n event.srcElement.classList.add('fadeIn');\n // debugger\n });\n addEventClick(movieElement);\n });\n }", "enableTheaterModeForNewLayout() {\n this.centerVideoPlayer();\n }", "function videoGalleryBox() {\n if ($('.video-box').length) {\n var wrapper = $('.video-box');\n var imgLi = wrapper.find('ul.img-list').children('li');\n var imgCount = imgLi.length;\n var mainImg = wrapper.find('.main-box .img-box').children('img');\n var videoPreview = wrapper.find('.main-box').find('a.play-video');\n\n var videoImg = imgLi.map(function() {\n return $(this).data('video-img');\n });\n var videoUrl = imgLi.map(function() {\n return $(this).data('video-url');\n });\n var current = 1;\n\n // setting up values on init\n videoPreview.attr('href', wrapper.find('ul.img-list').children('li.active').data('video-url'));\n\n $('.vid-nav').find('a').on('click', function() {\n var dir = $(this).data('dir');\n if (dir === 'next') {\n current = current + 1;\n } else {\n current = current - 1;\n };\n if (current === 0) {\n current = imgCount;\n dir = 'next';\n } else if (current - 1 === imgCount) {\n current = 1;\n };\n console.log(current);\n\n makeSwitch();\n\n return false;\n });\n\n\n function makeSwitch() {\n var i = current - 1;\n var mainImgSrc = videoImg[i];\n var mainVideoSrc = videoUrl[i];\n\n imgLi.removeClass('active');\n imgLi.eq(i).addClass('active');\n mainImg.fadeOut(500, function() {\n mainImg.attr(\"src\", mainImgSrc);\n mainImg.fadeIn(500);\n });\n // mainImg.attr('src', mainImgSrc);\n videoPreview.attr('href', mainVideoSrc);\n }\n\n\n };\n}", "function PlayExpandedIntroVideo () {\r\ncreative.dom.video1.vid.play();\r\ncreative.dom.video1.vid.currentTime = 0;\r\n}", "function setUpLists(vidnumber) {\n // Let's copy the links to the appropriate location so we can position them there.\n var vidlinks = $('#hx-vidlinks-static-' + (vidnumber + 1))\n .clone()\n .prop('id', 'hx-vidlinks-live-' + (vidnumber + 1));\n vidlinks.appendTo('.video-wrapper.for-video-' + (vidnumber + 1));\n\n linkTimer[vidnumber] = [];\n\n // Each link needs a little bit added to it, to keep the author view simple.\n // This preps the links that we're going to display on the video.\n $('#hx-vidlinks-live-' + (vidnumber + 1))\n .children()\n .each(function(index) {\n var thisLinkBox = $(this);\n var thisLink = $(this).find('a');\n\n // Give the link a class and a unique ID\n thisLinkBox.addClass('hx-vidlink_' + hxLinkOptions.location);\n thisLinkBox.attr('id', 'link-card-live-' + index);\n\n // Give the images a class for styling purporses.\n thisLink.find('img').addClass('hx-vidlinkicon');\n\n // Make all the links open in new pages.\n thisLink.attr('target', '_blank');\n // Style all the links\n thisLink.addClass('hx-link-text-live');\n\n // Screen readers should skip these links. Rarely (but not never) an issue.\n thisLinkBox.attr('aria-hidden', 'true');\n\n // Build the link timer from the divs.\n var tempTimer = {\n time: hmsToTime(thisLinkBox.attr('data-time')),\n shown: false\n };\n linkTimer[vidnumber].push(tempTimer);\n });\n\n // This preps the ones that are visible all the time.\n $('#hx-vidlinks-static-' + (vidnumber + 1))\n .children()\n .each(function(index) {\n var thisLinkBox = $(this);\n var thisLink = $(this).find('a');\n\n // Give the link a class and a unique ID\n thisLinkBox.addClass('hx-vidlink-static');\n thisLinkBox.attr('id', 'link-card-static-' + index);\n\n // Remove the images.\n thisLink.find('img').remove();\n\n // Add time links before.\n let timelink = $('<a>');\n timelink.attr('href', thisLinkBox.attr('data-time'));\n timelink.addClass('jumptime');\n timelink.text(timeToHMS(hmsToTime(thisLinkBox.attr('data-time'))));\n thisLinkBox.prepend(' - ');\n thisLinkBox.prepend(timelink);\n console.log('timelink added');\n });\n\n // Finish making the unordered list.\n $('#hx-vidlinks-static-' + (vidnumber + 1) + ' .hx-vidlink-static').wrapAll(\n '<ul></ul>'\n );\n\n linkTimer[vidnumber].sort(timeCompare); // Uses a custom function to sort by time.\n }", "function initiateVideoChange(index) {\n var wrapper = $$wrappers[currentIndex]\n var nextWrapper = $$wrappers[index]\n\n // pause the current video\n $$videos[currentIndex].pause()\n\n // deactivate the current video\n wrapper.classList.remove('active')\n wrapper.classList.add('deactivate')\n\n // after the current video animates out...\n setTimeout(function() {\n // remove transition effect so progress-bar doesn't slowly decline\n var loadingBar = $$videoControls[currentIndex].querySelector(\n '.progress-bar span'\n )\n loadingBar.style.transitionDuration = '0s'\n\n // reset the current video\n if (!isNaN($$videos[currentIndex].duration)) {\n $$videos[currentIndex].currentTime = 0\n }\n $$videoControls[currentIndex].classList.remove('playing')\n\n // stop deactivation\n wrapper.classList.remove('deactivate')\n\n // check if the video is loaded\n // if not, listen for it to load\n if ($$videos[index].classList.contains('loaded')) {\n playVideo(index, nextWrapper)\n } else {\n $$videos[index].addEventListener(\n 'canplaythrough',\n playVideo(index, nextWrapper)\n )\n }\n }, 1000)\n}", "function videoButtonPress(event)\n{\n changeVideo();\n}", "function addListeners() {\r\n Enabler.addEventListener(studio.events.StudioEvent.EXPAND_START, expandStartHandler);\r\n Enabler.addEventListener(studio.events.StudioEvent.EXPAND_FINISH, expandFinishHandler);\r\n Enabler.addEventListener(studio.events.StudioEvent.COLLAPSE_START, collapseStartHandler);\r\n Enabler.addEventListener(studio.events.StudioEvent.COLLAPSE_FINISH, collapseFinishHandler);\r\n creative.dom.expandButton.addEventListener('click', onExpandHandler, false);\r\n creative.dom.collapseButton.addEventListener('click', onCollapseClickHandler, false);\r\n creative.dom.expandedExit.addEventListener('click', exitClickHandler);\r\n creative.dom.collapsedExit.addEventListener('click', collapsedExitClickHandler);\r\n\r\n //////// UNEXPANDED VIDEO\r\n creative.dom.video0.vidPlayBtn.addEventListener('click', pausePlayHandler0, false);\r\n creative.dom.video0.vidPauseBtn.addEventListener('click', pausePlayHandler0, false);\r\n creative.dom.video0.vidMuteBtn.addEventListener('click', muteUnmuteHandler0, false);\r\n creative.dom.video0.vidUnmuteBtn.addEventListener('click', muteUnmuteHandler0, false);\r\n creative.dom.video0.vidReplayBtn.addEventListener('click', replayHandler0, false);\r\n creative.dom.video0.vidStopBtn.addEventListener('click', stopHandler0, false);\r\n creative.dom.video0.vid.addEventListener('ended', videoEndHandler0, false);\r\n creative.dom.video0.vid.addEventListener('timeupdate', videoTimeUpdateHandler0, false); \r\n\r\n //////// EXPANDED INTRO VIDEO\r\n creative.dom.video1.vidPlayBtn.addEventListener('click', pausePlayHandler1, false);\r\n creative.dom.video1.vidPauseBtn.addEventListener('click', pausePlayHandler1, false);\r\n creative.dom.video1.vidMuteBtn.addEventListener('click', muteUnmuteHandler1, false);\r\n creative.dom.video1.vidUnmuteBtn.addEventListener('click', muteUnmuteHandler1, false);\r\n creative.dom.video1.vidReplayBtn.addEventListener('click', replayHandler1, false);\r\n creative.dom.video1.vidStopBtn.addEventListener('click', stopHandler1, false);\r\n creative.dom.video1.vid.addEventListener('ended', videoEndHandler1, false);\r\n creative.dom.video1.vid.addEventListener('timeupdate', videoTimeUpdateHandler1, false);\r\n\r\n\r\n}", "function videoClick(){\n\n var div = $(\"#videoPanel\");\n target_offset = div.offset();\n target_top = target_offset.top;\n\n $('html, body').animate({scrollTop:target_top}, 500);\n var ul = $(\"#ulNav\");\n ul.children().removeClass('highlightNav');\n $('#videoNav').addClass('highlightNav');\n}", "function updateVideosPosition() {\r\n\tupdatePosition('updateVideosPosition', '#videos > .video-container');\r\n}", "function updateCurrentVideo(current) {\n if (current.hasClass('playing'))\n return;\n\n $('.video-thumb').removeClass('playing');\n current.addClass('playing');\n }", "function videoEndHandler0(e) {\r\n console.log('unexpanded video end')\r\n creative.dom.video0.vid.currentTime = 0;\r\n creative.dom.video0.vid.pause();\r\n creative.dom.video0.vidPauseBtn.style.visibility = 'hidden';\r\n creative.dom.video0.vidPlayBtn.style.visibility = 'visible';\r\n creative.isClick0 = true;\r\n\r\n //// banner JS\r\n ShowUnexpandedEndFrame ();\r\n creative.dom.video0controlsholder.style.display = 'none';\r\n\r\n}", "function fn_subtitle_videolist(data, pos) {\n setTimeout(function() {\n var mainUl = document.getElementById('videolistul');\n var maindiv = document.getElementById('videolistdiv');\n var array = data;\n var navigation_pos = window.localStorage.getItem(\"titlepos\");\n var subtitle_pos = window.localStorage.getItem(\"subtitlepos\");\n var level3pos = window.localStorage.getItem(\"level3pos\");\n var from_search_page = window.localStorage.getItem(\"from_search_list\");\n\n var title_array = [];\n\n\n for (var i = 0; i < array['navigation'][navigation_pos]['subtitle'][subtitle_pos]['level3'][level3pos]['videourl'][pos]['videolist'].length; i++) {\n\n var video = array['navigation'][navigation_pos]['subtitle'][subtitle_pos]['level3'][level3pos]['videourl'][pos]['videolist'];\n\n $(\".title_name\").html(video[0]['displayName']);\n console.log(\"for loop \" + video[i]['file']);\n\n var innerli = document.createElement('li');\n\n\n var innerA = document.createElement('a');\n\n var list_v = document.createElement('div');\n\n list_v.setAttribute('class', 'list-v');\n list_v.setAttribute('id', i);\n list_v.setAttribute('video_title', i);\n var list_v_img = document.createElement('img');\n\n var logo = $(\".logo\").height();\n var imgLoad = $(\".imgLoad\").height();\n var contenttop = $(\".content-top\").height();\n var clr = $(\".clr\").height();\n var accormvideolist = $(\".accor-m video-list-new-layout\").height();\n var divForm = $(\"#divForm\").height();\n var accormdownloadpage = $(\"#accor-m download-page\").height();\n var totalheight = logo + imgLoad + contenttop + clr + accormvideolist + divForm + accormdownloadpage;\n var videoHeight = window.innerHeight - totalheight;\n if (window.innerHeight > window.innerWidth) {\n var deviceType = (navigator.userAgent.match(/iPad/i)) == \"iPad\" ? \"iPad\" : (navigator.userAgent.match(/iPhone/i)) == \"iPhone\" ? \"iPhone\" : (navigator.userAgent.match(/Android/i)) == \"Android\" ? \"Android\" : (navigator.userAgent.match(/BlackBerry/i)) == \"BlackBerry\" ? \"BlackBerry\" : \"null\";\n\n if (deviceType == \"iPad\") {\n var size = (window.innerHeight * 300) / 1024;\n videoHeight = videoHeight - size;\n }\n }\n if (i == 0) {\n file_exist_download(video[0]['title'], video[0]['file'], video[0]['image'], videoHeight, window.innerWidth);\n }\n\n\n\n\n console.log(\"-----------------------------\" + video[i]['image']);\n var videotitle = video[i]['title'].replace(/\\s+/g, '');\n\n list_v_img.setAttribute('src', root_path1 + \"/GymWijzer/Thumbnail/\" + videotitle + \"/video_thumbnail.jpg\");\n list_v_img.setAttribute('onError', \"this.onerror=null;this.src='\" + video[i]['image'] + \"';\");\n\n\n if (i == 0) {\n poster_file_exist(video[i]['title'], video[i]['image']);\n }\n\n list_v_img.setAttribute('height', 100);\n list_v_img.setAttribute('width', 100);\n list_v.appendChild(list_v_img);\n\n\n\n var paly_b = document.createElement('div');\n paly_b.setAttribute('class', 'paly-b');\n\n var fa_fa_play = document.createElement('i');\n fa_fa_play.setAttribute('class', 'fa fa-play');\n paly_b.appendChild(fa_fa_play);\n list_v.appendChild(paly_b);\n list_v.setAttribute('vid_name', video[i]['title']);\n list_v.setAttribute('vid_displayName', video[i]['displayName']);\n list_v.setAttribute('vid_url', video[i]['file']);\n\n var fileexist = \"GymWijzer/Video/\" + video[i]['title'] + \".mp4\";\n\n window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {\n var entry = fileSystem.root;\n\n entry.getFile(fileexist, {\n create: false,\n exclusive: false\n }, function(dir) {\n var root_path = fileSystem.root.toURL();\n image = root_path + \"/GymWijzer/Thumbnail/\" + filename + \"/video_thumbnail.jpg\";\n image = image.replace(/\\s+/g, '');\n list_v.setAttribute('vid_image', image);\n }, function(error) {\n list_v.setAttribute('vid_image', video[i]['image']);\n });\n }, null);\n\n\n\n\n innerA.appendChild(list_v);\n\n\n var span = document.createElement('span');\n span.innerHTML = video[i]['displayName'];\n title_array[i] = video[i]['title'];\n innerA.appendChild(span);\n innerli.appendChild(innerA);\n mainUl.appendChild(innerli);\n\n\n\n\n var span1 = document.createElement('span');\n span1.innerHTML = video[i]['description'];\n span1.setAttribute('class', 'des_2');\n\n innerA.appendChild(span1);\n\n\n var trash_i = document.createElement('i');\n var center_i = document.createElement('center');\n trash_i.setAttribute('class', 'fa fa-trash');\n trash_i.setAttribute('trash_videname', video[i]['title']);\n innerA.appendChild(trash_i);\n\n innerli.appendChild(innerA);\n mainUl.appendChild(innerli);\n\n console.log(from_search_page);\n if (from_search_page == \"true\") {\n\n var video_pos = window.localStorage.getItem(\"videopos\");\n\n\n if (i == video_pos) {\n window.localStorage.setItem(\"videoname\", video[video_pos]['title']);\n window.localStorage.setItem(\"videourl\", video[video_pos]['file']);\n window.localStorage.setItem(\"videoimage\", video[video_pos]['image']);\n\n\n window.localStorage.setItem(\"from_search_list\", false);\n console.log(\"from_search_page \" + window.localStorage.getItem(\"from_search_list\"));\n\n\n }\n } else {\n\n console.log(\"else call\");\n if (i == 0) {\n window.localStorage.setItem(\"videoname\", video[i]['title']);\n window.localStorage.setItem(\"videourl\", video[i]['file']);\n window.localStorage.setItem(\"videoimage\", video[i]['image']);\n\n }\n\n }\n\n }\n\n maindiv.appendChild(mainUl);\n jQuery(\".list-v\").click(function() {\n\n var videoname = $(this).attr('vid_name');\n var videourl = $(this).attr('vid_url');\n var videoimage = $(this).attr('vid_image');\n var id = $(this).attr('id');\n console.log(\"mage url is :>\" + videoimage);\n poster_file_exist(videoname, videoimage);\n\n window.localStorage.setItem(\"videoid\", id);\n window.localStorage.setItem(\"videoname\", videoname);\n //alert(videourl);\n window.localStorage.setItem(\"videourl\", videourl);\n window.localStorage.setItem(\"videoimage\", videoimage);\n\n\n $(\".title_name\").html($(this).attr('vid_displayName'));\n var logo = $(\".logo\").height();\n var imgLoad = $(\".imgLoad\").height();\n var contenttop = $(\".content-top\").height();\n var clr = $(\".clr\").height();\n var accormvideolist = $(\".accor-m video-list-new-layout\").height();\n var divForm = $(\"#divForm\").height();\n var accormdownloadpage = $(\"#accor-m download-page\").height();\n var totalheight = logo + imgLoad + contenttop + clr + accormvideolist + divForm + accormdownloadpage;\n\n file_exist_download(videoname, videourl, videoimage, videoHeight, window.innerWidth);\n\n });\n jQuery(\".fa.fa-trash\").click(function() {\n\n trahsname = $(this).attr('trash_videname');\n jQuery.fancybox.open(\"#conform_donwload\");\n\n\n });\n\n\n\n\n setTimeout(function() {\n for (var l = 0; l < title_array.length; l++) {\n console.log(\"titkw name :> \" + title_array[l]);\n file_exist(title_array[l], l);\n }\n\n }, 2500); //Timeout changed\n\n\n\n\n }, 2500); //Timeout changed\n\n}", "function jwPlayer_video(dir_path, image, height, width) {\n jwplayer(\"myElement\").setup({\n file: dir_path,\n image: image,\n height: height + \"px\",\n width: width + \"px\",\n repeat: \"always\",\n aspectratio: \"16:9\"\n });\n\n\n var videoTag;\n var currentRate = 1;\n\n jwplayer().onReady(function() {\n \n if (jwplayer().getRenderingMode() == \"html5\") {\n\n videoTag = document.querySelector('video');\n\n if (videoTag.playbackRate) {\n \n jwplayer().addButton(\"../images/slow.png\", \"Slow Motion\",\n toggleSlomo, \"slomo\");\n jwplayer().addButton(\"../images/play.png\", \"Normal Motion\",\n toggleNormal, \"normal\");\n jwplayer().addButton(\"../images/fast.png\", \"Fast Motion\",\n toggleFast, \"fast\");\n }\n }\n });\n\n function toggleSlomo() {\n\n if (currentRate >= 1) {\n currentRate = 0.5\n }\n videoTag.playbackRate = currentRate;\n videoTag.defaultPlaybackRate = currentRate;\n \n if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {\n // alert(\"firefox\");\n jwplayer().seek(jwplayer().getPosition());\n }\n\n };\n\n function toggleNormal() {\n if (currentRate != 1) {\n currentRate = 1\n }\n videoTag.playbackRate = currentRate;\n videoTag.defaultPlaybackRate = currentRate;\n if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {\n jwplayer().seek(jwplayer().getPosition());\n }\n\n };\n\n function toggleFast() {\n if (currentRate <= 1) {\n currentRate = 2\n }\n videoTag.playbackRate = currentRate;\n videoTag.defaultPlaybackRate = currentRate;\n if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {\n jwplayer().seek(jwplayer().getPosition());\n }\n\n };\n}", "function showNavOverVideo() {\n state.change(\"browse\");\n overlay.show();\n main.show();\n controls.main.addClass(\"mini\");\n controls.main.show();\n controls.background.hide();\n controls.back.hide();\n updateVideoControls();\n displayControls(false);\n focusActiveSlide();\n }", "function OnComplete()\n{\nvideoContainer.style.visibility = \"hidden\";\naddClass(animation, 'start');\nvideoComplete = true;\n}", "function _updateStreamList() {\n var streams = playback.createFilteredVideoStreamList(),\n streamsLength = streams.length;\n CadmiumMediaStreams$addMethodsToArray(streams);\n for (var i = 0; i < streamsLength; i++) {\n streams[i].lower = streams[i - 1];\n streams[i].higher = streams[i + 1];\n }\n _videoStreamList = streams;\n }", "function list(){\n if($(\"#list\").is(\":hidden\")){\n $(\"#video\").hide(500);\n $(\"#list\").show();\n //奇数行\n // $(\"ul li:odd\").css({ \"background-color\":\"#c3bbb9\"});\t\n //偶数行\n // $(\"ul li:even\").css({\"background-color\":\"#f7f6f6\"});\n }\n else { \n $(\"#list\").hide();\n $(\"#video\").show();}\n}", "function vimeoready(player_id) {\n\n var froogaloop = $f(player_id);\n\n froogaloop.addEvent('play', function(data) {\n var bt = $('body').find('.tp-bannertimer');\n var opt = bt.data('opt');\n bt.stop();\n opt.videoplaying = true;\n });\n\n froogaloop.addEvent('finish', function(data) {\n var bt = $('body').find('.tp-bannertimer');\n var opt = bt.data('opt');\n if (opt.conthover == 0)\n bt.animate({ 'width': \"100%\" }, { duration: ((opt.delay - opt.cd) - 100), queue: false, easing: \"linear\" });\n opt.videoplaying = false;\n });\n\n froogaloop.addEvent('pause', function(data) {\n var bt = $('body').find('.tp-bannertimer');\n var opt = bt.data('opt');\n if (opt.conthover == 0)\n bt.animate({ 'width': \"100%\" }, { duration: ((opt.delay - opt.cd) - 100), queue: false, easing: \"linear\" });\n opt.videoplaying = false;\n });\n\n\n }", "function videoStarter() {\r\n\r\n\t$('#stream-boy').vide({\r\n\t\tmp4:'video/streamboy-clip.mp4',\r\n\t\togv:'video/streamboy-clip.ogv',\r\n\t\twebm:'video/streamboy-clip.webm',\r\n\t\tposter:'img/space-poster.jpg',\r\n\t\t}, {\r\n\t\tloop: true,\r\n\t\tmuted: true,\r\n\t\tautoplay: true,\r\n\t\tposterType: \"jpg\",\r\n\t\tclassName: \"stream-boy\"\r\n\t});\r\n\r\n\t$('#space-video').vide({\r\n\t\tmp4:'video/space-planet-with-reverse50.mp4',\r\n\t\togv:'video/space-planet-with-reverse50.ogv',\r\n\t\twebm:'video/space-planet-with-reverse50.webm',\r\n\t\tposter:'img/space-poster.jpg',\r\n\t\t}, {\r\n\t\tloop: true,\r\n\t\tmuted: true,\r\n\t\tautoplay: true,\r\n\t\tposterType: \"jpg\",\r\n\t\tclassName: \"space-video\"\r\n\t});\r\n\r\n\t// Get instance of the plugin\r\n\tvar spaceVideo = $('#space-video').data('vide');\r\n\tvar spaceVideoObject = spaceVideo.getVideoObject();\r\n\r\n\thud.mousemove(function( event ) {\r\n\r\n\t\tvar pageCoords = \"( \" + event.pageX + \", \" + event.pageY + \" )\";\r\n\t\tvar hudPosition = hud.position();\r\n\r\n\t\t// Find the position of the cursor inside the \"HUD\" relative to the width of the window\r\n\t\t// Divide by 4 and round up to get a clean percentage\r\n\t\tvar innerHudPosition = Math.round( ( event.pageX - hudPosition.left + 200 ) / 4 );\r\n\r\n\t\t//console.log(\"Camera Position: \" + innerHudPosition + \"%\");\r\n\t\t//console.log(\"Video Time: \" + spaceVideoObject.currentTime );\r\n\r\n\t\t// Set the video frame position relative to innerHudPosition\r\n\t\tspaceVideoObject.currentTime = innerHudPosition / 2;\r\n\t\tspaceVideoObject.pause();\r\n\r\n\t});\r\n\r\n\thud.mouseover(function() {\r\n\t\tspace.addClass(\"seeking-state\");\r\n\t});\r\n\r\n\thud.mouseout(function() {\r\n\t\t// setTimeout(function() { spaceVideoObject.play(); }, 1000);\r\n\t\tspaceVideoObject.play();\r\n\t\tspace.removeClass(\"seeking-state\");\r\n\t});\r\n}", "function addTab(event) {\n \tvar data = event.data.data;\n \tif (!data.id) {\n \t\tlog.warn(\"Cannot add video to list! Missing video ID.\");\n \t\treturn;\n \t}\n\n \tvar playing = false;\n \tif (data.state == 1)\n \t\tplaying = true;\n\n \tif (video[data.id]) {\n \t\tvideo[data.id].playing = playing;\n \t\tvideo[data.id].source = event.source;\n \t\tvideo[data.id].title = data.title;\n\n \t\tif (ping[data.id].timeout) {\n \t\t\twindow.clearTimeout(ping[data.id].timeout);\n \t\t\tping[data.id].timeout = null;\n\n \t\t\tlog.info(\"Page found. It wont be removed from list.\");\n \t\t}\n\n \t\tlog.info(\"Video is already in list. Video data is updated. ID: \" + data.id + '.');\n \t}\n \telse {\n \t\tvideo[data.id] = {\n \t\t\tfirstplay: true,\n \t\t\tfocused: false,\n \t\t\tplaying: playing,\n \t\t\tsource: event.source,\n \t\t\torigin: event.origin,\n \t\t\ttitle: data.title\n \t\t};\n \t\tvideocount++;\n\n \t\tlog.info(\"New video added to list. Video ID: \" + data.id + '.');\n\n \t\t// Start pinging injected scripts to see if they’re still alive.\n \t\tping[data.id] = {\n \t\t\treplay: true,\n \t\t\tinterval: window.setInterval(function () {\n \t\t\t\techo(data.id);\n \t\t\t}, 1551)\n \t\t};\n \t}\n\n \t// Add toolbar button if needed.\n \tif (pref.getPref(\"addtoolbarbutton\")) {\n \t\tif (toolbar.button === null) {\n \t\t\ttoolbar.videoid = data.id;\n \t\t\taddToolbarButton();\n \t\t}\n \t\telse if (toolbar.button.popup === null) {\n \t\t\tremoveToolbarButton(true);\n \t\t\taddToolbarButton();\n \t\t}\n \t\telse\n \t\t\tupdateToolbarButton();\n \t}\n }", "function tuto() {\r\n switch (index) {\r\n\r\n //for each slide the iframe and transition video is be changed and will be replayed\r\n case 1:\r\n $(\"iframe\").attr(\"src\", \"https://app.lapentor.com/sphere/start-1\");\r\n\r\n break;\r\n\r\n case 2:\r\n $(\"#overgang\").attr(\"src\", \"beelden/final_medialab.mp4\");\r\n $(\"#overgang\").fadeIn();\r\n $(\"#overgang\").trigger('play');\r\n $(\"iframe\").attr(\"src\", \"https://app.lapentor.com/sphere/medialab\");\r\n\r\n $(\"#overgang\").on(\"ended\", function () {\r\n $(\"#overgang\").fadeOut();\r\n });\r\n\r\n\r\n break;\r\n\r\n case 3:\r\n $(\"iframe\").attr(\"src\", \"https://app.lapentor.com/sphere/computerlokaal\");\r\n $(\"#overgang\").attr(\"src\", \"beelden/final_computerlokaal.mp4\");\r\n $(\"#overgang\").fadeIn();\r\n $(\"#overgang\").trigger('play');\r\n $(\"#overgang\").on(\"ended\", function () {\r\n $(\"#overgang\").fadeOut();\r\n });\r\n\r\n\r\n\r\n break;\r\n\r\n\r\n case 4:\r\n $(\"#overgang\").attr(\"src\", \"beelden/final_aula.mp4\");\r\n $(\"#overgang\").fadeIn();\r\n $(\"#overgang\").trigger('play');\r\n $(\"iframe\").attr(\"src\", \"https://app.lapentor.com/sphere/aula\");\r\n $(\"#overgang\").on(\"ended\", function () {\r\n $(\"#overgang\").fadeOut();\r\n });\r\n break;\r\n\r\n case 5:\r\n $(\".overlay\").fadeOut();\r\n $(\"iframe\").attr(\"src\", \"https://app.lapentor.com/sphere/design\");\r\n $(\"#overgang\").attr(\"src\", \"beelden/final_design.mp4\");\r\n $(\"#overgang\").fadeIn();\r\n $(\"#overgang\").trigger('play');\r\n $(\"#overgang\").on(\"ended\", function () {\r\n $(\"#overgang\").fadeOut();\r\n\r\n });\r\n\r\n break;\r\n\r\n case 6:\r\n //end of the tour which opens the \"wish to leave the tour popUp\"\r\n $(\".overlay2,#promt\").fadeIn();\r\n\r\n }\r\n }", "function showCover() {\n $(\".vjs-poster\").addClass(\"endCover\");\n}", "function showControls() {\n videoControls.classList.remove('hide');\n}", "function changeNowPlaying(index) {\n\t$('#now-playing').remove();\n\t$('#video-' + index).append('<span id=\"now-playing\">now playing!</span></a></li>');\n}", "function apr_video_callback(data,type){\n var list = jQuery(\"#video-list\");\n list.html(data);\n apr_jscroller(type,list);\n}", "function doShowAdvLinkFast() \n {\n if($('#oc-link-advanced-player').is(':animated')) {\n $('#oc-link-advanced-player').stop();\n }\n $('#oc-link-advanced-player').css('marginLeft', '0px');\n }", "function play(e){\n var id = e.id;\n var arr = byId(\"i\"+id ).value.split(\";\");\n \n // var jsonObj = JSON.parse(jsonStr);\n $(\"#h1\").html(id);\n $(\"#list\").hide();\n $(\"#video\").show();\n \n //config the video tag property\n $(\"#video\").attr({\n \"src\":arr[0],\n \"controls\":true,\n \"loop\":true,\n \"autoplay\":true,\n \"type\":arr[1]\n });\n}", "update () {\n if (this.activePause) {\n // pause active, wait\n return\n }\n\n if (this.currentTimeout) {\n window.clearTimeout(this.currentTimeout)\n this.currentTimeout = null\n }\n\n if (!this.current || this.current.index === null) {\n return\n }\n\n const entry = this.list[this.current.index]\n\n const currentPosition = this.current.video.currentTime\n\n // filter\n const nextActions = entry.actions ? entry.actions.filter((action, index) => action.time >= currentPosition && index >= this.current.actionIndex) : []\n const nextPauses = entry.pauses ? entry.pauses.filter((pause, index) => pause.time >= currentPosition && index >= this.current.pauseIndex) : []\n\n const time = Math.min(\n nextActions.length ? nextActions[0].time : global.Infinity, \n nextPauses.length ? nextPauses[0].time : global.Infinity\n )\n\n if (time === currentPosition) {\n this.executeActionsOrPauses(entry, time)\n }\n else if (time !== global.Infinity) {\n this.currentTimeout = window.setTimeout(() => this.executeActionsOrPauses(entry, time), (time - currentPosition) * 1000)\n this.current.video.play()\n }\n else {\n this.current.video.play()\n }\n }", "function PlayVideo() {\r\n\t\r\n\t\tif( $('.video-wrapper').length > 0 ){\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$(\".video-wrapper\").mouseenter(function(e) {\r\n\t\t\t\tif ($(this).hasClass(\"play\")) {\r\n\t\t\t\t\t$( \"#ball\" ).addClass(\"pause-movie\")\t\t\r\n\t\t\t\t}\r\n\t\t\t\tTweenMax.to('#ball', 0.1,{transformOrigin: '15px 15px', borderWidth: '1px', scale: 2});\r\n\t\t\t\t$( \"#ball\" ).addClass(\"over-movie\").append( '<i class=\"fa fa-play\"></i><i class=\"fa fa-pause\"></i>' );\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t$(\".video-wrapper\").mouseleave(function(e) {\r\n\t\t\t\tTweenMax.to('#ball', 0.1,{borderWidth: '2px', scale:1, x: -15, y: -15});\r\n\t\t\t\t$(\"#ball\").removeClass(\"over-movie\").removeClass(\"pause-movie\");\r\n\t\t\t\t$('#ball i').remove();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t$(\".video-wrapper .control\").mouseenter(function(e) {\t\r\n\t\t\t\tTweenMax.to('#ball', 0.2,{borderWidth: '20px', scale: 0});\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t$(\".video-wrapper .control\").mouseleave(function(e) {\r\n\t\t\t\tTweenMax.to('#ball', 0.1,{transformOrigin: '15px 15px', borderWidth: '1px', scale: 2});\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tvar videocenter = ($(window).height() - $('.video-cover').height()) / 2\r\n\t\t\t\t\t\r\n\t\t\t////////////////////////////////////////////////////// REFACTOR //////////////////////////////////////////////////////\r\n\t\t\t// plays or pause the video function of its current state\r\n\t\t\tvar playpause = function( videoObj ) {\r\n\t\t\t\t\r\n\t\t\t\tif( videoObj[0] != null ){\r\n\t\t\t\t\tif(videoObj[0].paused || videoObj[0].ended) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvideoObj.parent().addClass('play');\r\n\t\t\t\t\t\tvideoObj[0].play();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvideoObj.parent().removeClass('play');\r\n\t\t\t\t\t\tvideoObj[0].pause();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\t//Time format converter - 00:00\r\n\t\t\tvar timeFormat = function(seconds){\r\n\t\t\t\tvar m = Math.floor(seconds/60)<10 ? \"0\"+Math.floor(seconds/60) : Math.floor(seconds/60);\r\n\t\t\t\tvar s = Math.floor(seconds-(m*60))<10 ? \"0\"+Math.floor(seconds-(m*60)) : Math.floor(seconds-(m*60));\r\n\t\t\t\treturn m+\":\"+s;\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\t// Events\r\n\t\t\t// click to video cover - will start the video\r\n\t\t\t$('.video-wrapper').on('click', function() {\r\n\t\t\t\t\r\n\t\t\t\t$('html,body').animate({scrollTop: $(this).offset().top - videocenter},390);\t\t\r\n\t\t\t\t// hide the video cover in order to start playing\r\n\t\t\t\t$(this).find('.video-cover').addClass('hidden');\r\n\t\t\t\t\r\n\t\t\t\t$( \"#ball\" ).toggleClass(\"pause-movie\");\r\n\t\t\t\t\r\n\t\t\t\t// pause first the other videos\r\n\t\t\t\tvar current_wrapper = $(this);\r\n\t\t\t\t$('#main-page-content').find('.video-wrapper').each(function() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif( !current_wrapper.is( $(this) ) ){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$(this).removeClass('play');\r\n\t\t\t\t\t\t$(this).find('video').each(function() {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif( !$(this).get(0).paused && !$(this).get(0).ended ) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(this).get(0).pause();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t// trigger the click for the inner video\r\n\t\t\t\t$(this).find('video').each(function() {\r\n\r\n\t\t\t\t\tplaypause( $(this) );\r\n\t\t\t\t});\r\n\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//fullscreen button clicked\r\n\t\t\t$('.btnFS').on('click', function( e ) {\r\n\t\t\t\t\t\r\n\t\t\t\tvar parent_wrapper\t= $(this).closest('.video-wrapper');\r\n\t\t\t\tvar video_object \t\t= parent_wrapper.find('video');\r\n\t\t\t\t\t\r\n\t\t\t\tif($.isFunction(video_object[0].webkitEnterFullscreen)) {\r\n\t\t\t\t\tvideo_object[0].webkitEnterFullscreen();\r\n\t\t\t\t}\t\r\n\t\t\t\telse if ($.isFunction(video_object[0].mozRequestFullScreen)) {\r\n\t\t\t\t\tvideo_object[0].mozRequestFullScreen();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\talert('Your browsers doesn\\'t support fullscreen');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// prevent video wrapper div responding the event\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\t\r\n\t\t\t//sound button clicked\r\n\t\t\t$('.sound').on('click', function( e ) {\r\n\t\t\t\t\t\r\n\t\t\t\tvar parent_wrapper\t= $(this).closest('.video-wrapper');\r\n\t\t\t\tvar video_object \t\t= parent_wrapper.find('video');\r\n\t\t\t\t\t\r\n\t\t\t\tvideo_object[0].muted = !video_object[0].muted;\r\n\t\t\t\t$(this).toggleClass('muted');\r\n\t\t\t\tif(video_object[0].muted) {\r\n\t\t\t\t\tparent_wrapper.find('.volumeBar').css('width',0);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tparent_wrapper.find('.volumeBar').css('width', video_object[0].volume*100+'%');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// prevent video wrapper div responding the event\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t//progress bar (video timebar) clicked\r\n\t\t\t$('.progress').on('click', function( e ) {\r\n\t\t\t\t\r\n\t\t\t\tvar parent_wrapper\t= $(this).closest('.video-wrapper');\r\n\t\t\t\tvar video_object \t\t= parent_wrapper.find('video');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t// calculate click position\r\n\t\t\t\t// and update video current time\r\n\t\t\t\t// as well as progress bar\r\n\t\t\t\tvar maxduration \t= video_object[0].duration;\r\n\t\t\t\tvar position \t\t\t= e.pageX - $(this).offset().left;\r\n\t\t\t\tvar percentage \t= 100 * position / $(this).width();\r\n\t\t\t\tif(percentage > 100) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tpercentage = 100;\r\n\t\t\t\t}\r\n\t\t\t\tif(percentage < 0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tpercentage = 0;\r\n\t\t\t\t}\r\n\t\t\t\t$('.timeBar').css('width', percentage+'%');\t\r\n\t\t\t\tvideo_object[0].currentTime = maxduration * percentage / 100;\r\n\t\t\t\t\r\n\t\t\t\t// prevent video wrapper div responding the event\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\t$('#main-page-content').find('video').each(function() {\r\n\t\t\t\r\n\t\t\t\tvar video = $(this);\r\n\t\t\t\tvar video_wrapper = $(this).parent();\r\n\t\t\t\t\r\n\t\t\t\t//remove default control when JS loaded\r\n\t\t\t\tvideo[0].removeAttribute(\"controls\");\r\n\t\t\t\tvideo_wrapper.find('.control').fadeIn(500);\r\n\t\t\t\tvideo_wrapper.find('.caption').fadeIn(500);\r\n\t\t\t \r\n\t\t\t\t//before everything get started and we have the info about the video such as duration\r\n\t\t\t\tvideo.on('loadedmetadata', function() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar video_object = $(this);\r\n\t\t\t\t\tvar parent_wrapper = $(this).parent();\r\n\t\t\t\t\t//set video properties\r\n\t\t\t\t\tparent_wrapper.find('.current').text(timeFormat(0));\r\n\t\t\t\t\tparent_wrapper.find('.duration').text(timeFormat(video[0].duration));\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t//display current video buffered progress\r\n\t\t\t\tvideo.on('progress', function() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar video_object \t\t= $(this);\r\n\t\t\t\t\tvar parent_wrapper \t= $(this).parent();\r\n\t\t\t\t\tvar maxduration \t\t= video_object [0].duration;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (maxduration > 0) {\r\n\t\t\t\t\t for (var i = 0; i < video_object [0].buffered.length; i++) {\r\n\t\t\t\t\t\t\tif (video_object [0].buffered.start(video_object [0].buffered.length - 1 - i) <video_object [0].currentTime) {\r\n\t\t\t\t\t\t\t\tvar perc = (video_object [0].buffered.end(video_object [0].buffered.length - 1 - i) / maxduration) * 100 + \"%\";\r\n\t\t\t\t\t\t\t\tparent_wrapper.find('.bufferBar').css('width',perc+'%');\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t//display current video play time\r\n\t\t\t\tvideo.on('timeupdate', function() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar parent_wrapper \t= $(this).parent();\r\n\t\t\t\t\tvar currentPos \t\t\t= $(this).get(0).currentTime;\r\n\t\t\t\t\tvar maxduration \t\t= $(this).get(0).duration;\r\n\t\t\t\t\tvar perc \t\t\t\t\t= 100 * currentPos / maxduration;\r\n\t\t\t\t\tparent_wrapper.find('.timeBar').css('width',perc+'%');\t\r\n\t\t\t\t\tparent_wrapper.find('.current').text(timeFormat(currentPos));\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t//video screen and play button clicked\r\n\t\t\t\tvideo.on('click', function() { \r\n\t\t\t\t\t\r\n\t\t\t\t\tplaypause( $(this) ); \r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t//video canplay event\r\n\t\t\t\tvideo.on('canplay', function() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar parent_wrapper = $(this).parent();\r\n\t\t\t\t\tparent_wrapper.find('.loading').fadeOut(100); //?\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t//video canplaythrough event\r\n\t\t\t\t//solve Chrome cache issue\r\n\t\t\t\tvar completeloaded = false;\r\n\t\t\t\tvideo.on('canplaythrough', function() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tcompleteloaded = true;\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t//video ended event\r\n\t\t\t\tvideo.on('ended', function() {\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).get(0).pause();\r\n\t\t\t\t\t$(this).parent().removeClass(\"play\");\r\n\t\t\t\t\t$( \"#ball\" ).toggleClass(\"pause-movie\");\r\n\t\t\t\t});\r\n\t\t\t\r\n\t\t\t\t//video seeking event\r\n\t\t\t\tvideo.on('seeking', function() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//if video fully loaded, ignore loading screen\r\n\t\t\t\t\tif(!completeloaded) { \r\n\t\t\t\t\t\tvar parent_wrapper = $(this).parent();\r\n\t\t\t\t\t\tparent_wrapper.find('.loading').fadeIn(200); //?\r\n\t\t\t\t\t}\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t//video seeked event\r\n\t\t\t\tvideo.on('seeked', function() { });\r\n\t\t\t\t\r\n\t\t\t\t//video waiting for more data event\r\n\t\t\t\tvideo.on('waiting', function() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar parent_wrapper = $(this).parent();\r\n\t\t\t\t\tparent_wrapper.find('.loading').fadeIn(200); //?\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "function video_playlist_side_to_main(){\n\t$('.group-header .field-name-field-film-time').after($('.region-leftbar1 div#block-views-playlist-block-1'));\n\t$('.region-leftbar1 div#block-views-playlist-block-1').remove();\n\t$('div#block-views-playlist-block-1').addClass('opened');\n}", "function fastForwardVideo() {\n var fastForward = player.getCurrentTime();\n var add15Seconds = fastForward + 15;\n player.seekTo(add15Seconds);\n }", "function toggleFrameList() {\n if (sozi.framelist.isVisible()) {\n sozi.framelist.hide();\n player.restart();\n } else {\n player.stop();\n sozi.framelist.show();\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 changeVideo(enableVideo)\n{\n var jqObj = $(app.VID_BUTTON),\n jqObj1 = $('#videoPreview'),\n jqOo = $(app.LOCAL_PLUGIN),\n enable,\n w, h;\n if (!jqObj[0] || !jqObj1[0])\n {\n app.log(4, \"changeVideo couldn't find video button\");\n }\n if (!jqOo[0])\n {\n app.log(4, \"changeVideo couldn't find local video spot\");\n }\n if (!Callcast.IsVideoDeviceAvailable())\n {\n app.log(4, \"changeVideo called when video is not available\");\n }\n // if called without arg toggle video (old behavior)\n if (undefined === enableVideo)\n {\n enable = !Callcast.IsVideoEnabled();\n }\n else // use arg\n {\n enable = enableVideo;\n }\n if (enable)\n {\n $('#effectsPanel > div').css({'display': 'block'});\n jqObj.addClass('on') // change button\n .attr('title', 'Turn Video Off ' + app.videoKeyAccel);\n jqObj1.addClass('on') // change button\n .attr('title', 'Turn Video Off ' + app.videoKeyAccel);\n // Check object dimensions.\n w = jqOo.width() - 4;\n h = Callcast.HEIGHT * (w / Callcast.WIDTH);\n Callcast.SendLocalVideoToPeers({width: w, height: h});\n // remove background image to prevent it from showing around the plugin\n // if there is no fb image leave the default bg image since it does not show through\n if (app.user.fbProfilePicUrl)\n {\n jqOo.css('background-image', '');\n }\n }\n else\n {\n $('#effectsPanel > div').css({'display': 'none'});\n jqObj.removeClass('on') // change button\n .attr('title', 'Turn Video On ' + app.videoKeyAccel);\n jqObj1.removeClass('on') // change button\n .attr('title', 'Turn Video On ' + app.videoKeyAccel);\n Callcast.SendLocalVideoToPeers(enable);\n // show background image if fb image url exists\n // if not the default is used and does not show around the plugin\n if (app.user.fbProfilePicUrl)\n {\n jqOo.css('background-image', 'url(' + app.user.fbProfilePicUrl + ')');\n }\n }\n return false;\n} // changeVideo()", "function anim() {\n\n\t// Call Animation Sequence\n\ttl.totalDuration(30);\n\ttl.play();\n\ttl.call(anim1);\n\n\t// Define Animation Sequence\n\tfunction anim1(){\n\t\tEnabler.loadModule(studio.module.ModuleId.VIDEO, function() {\n\t\t\tstudio.video.Reporter.attach('frame1Video', frame1Video);\n\t\t\tframe1Video.muted = true;\n\t\t\tframe1Video.play();\n\t\t});\n\t\ttl.to(frame1, 0.5, {autoAlpha:1, zIndex:1});\n\n\t\tfunction videoEnd() {\n\t\t\tstudio.video.Reporter.detach('frame1Video');\n\t\t\ttl.play();\n\t\t\tframe1Video.pause();\n\t\t\ttl.call(anim2);\n\t\t}\n\t\tel('frame1Video').addEventListener('ended', videoEnd);\n\t\tel('frame1Video').addEventListener('click', videoEnd);\n\t}\n\n\tfunction anim2() {\n\t\t_tl.set(['.frame3Quote#quote1', '.frame3Quote#quote2', '.frame3Quote#quote3', '.frame3Reference#reference1', '.frame3Reference#reference2', '.frame3Reference#reference3', '#frame4Logo', '#frame4Title', '#frame4Release', '#frame4Cta'], {autoAlpha:0});\n\n\t\ttl.to('#frame1', 0.5, {autoAlpha:0, zIndex:0})\n\n\t\t // Frame 2\n\t\t .from('#frame2', 0, {autoAlpha:0})\n\t\t .to('#frame2', 1, {autoAlpha:1, zIndex:1})\n\t\t .to('#frame2', 1, {autoAlpha:0, zIndex:0, delay:2})\n\n\t\t // Frame 3 Fade\n\t\t .from('#frame3', 0, {autoAlpha:0, zIndex:0})\n\t\t .to('#frame3', 1, {autoAlpha:1, zIndex:1})\n\n\t\t // Frame 3 (Review 1)\n\t\t .to('.frame3Quote#quote1', 1.5, {autoAlpha:1, ease: Power2.easeOut}, \"-=0.5\")\n\t\t .to('.frame3Reference#reference1', 1.5, {autoAlpha:1, ease: Power2.easeOut}, \"-=1.25\")\n\n\t\t // Frame 3 (Review 2)\n\t\t .to('.frame3Quote#quote2', 1.5, {autoAlpha:1, ease: Power2.easeOut}, \"-=1.25\")\n\t\t .to('.frame3Reference#reference2', 1.5, {autoAlpha:1, ease: Power2.easeOut}, \"-=1.25\")\n\n\t\t // Frame 3 (Review 3)\n\t\t .to('.frame3Quote#quote3', 1.5, {autoAlpha:1, ease: Power2.easeOut}, \"-=1.25\")\n\t\t .to('.frame3Reference#reference3', 1.5, {autoAlpha:1, ease: Power2.easeOut}, \"-=1.25\")\n\n\t\t // Frame 3 Fade\n\t\t .to('#frame3', 1, {autoAlpha:0, zIndex:0, delay:2})\n\n\t\t // Frame 4 Fade\n\t\t .from('#frame4', 0, {autoAlpha:0, zIndex:0})\n\t\t .to('#frame4', 1, {autoAlpha:1, zIndex:1})\n\n\t\t // Frame 4 Animations\n\t\t .to('#frame4Logo', 1.5, {autoAlpha:1})\n\t\t .to('#frame4Title', 1.5, {autoAlpha:1}, \"-=1.25\")\n\t\t .to('#frame4Release', 1.5, {autoAlpha:1}, \"-=1.25\")\n\t\t .to('#frame4Cta', 1.5, {autoAlpha:1}, \"-=1.25\");\n\t}\n}", "function onUp(event) {\n moveFilter(msgMoveMotion.Up);\n}", "function scrollList(){\n var list = $(\".list\").get(0);\n var top = parseInt($(\".onplay\").get(0).offsetTop - list.offsetHeight / 2 + 30 );\n Tools.addDomBufferAnimate(list, {\"scrollTop\": top}, 20);\n }", "function playVideo() { \n\t\t$(\"#index-vid-a\").removeClass(\"hidden\"); \n\t \t$(\"#vid-pic\").css('display', 'none');\n\t \t$(\"#index-vid-b\").css('display', 'none');\n\t \tvar vid = $(\"#index-vid-a\");\n\t vid.controls = false;\n\t vid.load();\n\t vid.on('ended',function(){\n\t \t$(vid).css('display', 'none');\n\t\t\t$(\"#index-vid-b\").css('display', 'inline-block');\n\t\t\tvar vidb = $(\"#index-vid-b\");\n\t\t\tvidb.controls = false;\n\t \tvidb.load();\n\t \tvidb.on('ended',function(){ \n\t \t\t\t$(vidb).css('display', 'none');\n\t\t\t\t$(\"#vid-pic\").css('display', 'inline-block');\n\t\t\t});\n\t}); \n\n\t}", "onListItemClick(inputVid) {\n this.setState({\n video: inputVid,\n });\n }", "function setupGui(videoList,cameras) {\r\n\r\n //gui state\r\n const gui = new dat.GUI({width:300});\r\n gui.domElement.style = 'position:absolute;top:50px;right:0px';\r\n\r\n let videos = gui.addFolder('Video Source Controller')\r\n const videoController = videos.add(guiState.video,'name',videoList)\r\n\r\n videoController.onChange(function (name) {\r\n guiState.changeVideoName = name\r\n })\r\n\r\n let confidence = gui.addFolder('Confidence Controller');\r\n confidence.add(guiState.confidence,'minPoseConfidence',0.0,1.0);\r\n confidence.add(guiState.confidence,'compareThreshold',0.0,1.0);\r\n\r\n //deactivate joints\r\n let joints = gui.addFolder('Joint Controller');\r\n for (let k in guiState.joints){\r\n let c = joints.add(guiState.joints,k.toString());\r\n c.onChange(function () {\r\n let index = Joints.indexOf(k.toString());\r\n if (guiState.joints[k]){\r\n guiState.deactivateArray.remove(index);\r\n }\r\n else {\r\n guiState.deactivateArray.push(index);\r\n }\r\n if(DEBUG) {\r\n console.log(guiState.deactivateArray);\r\n }\r\n })\r\n }\r\n\r\n //show control\r\n let output = gui.addFolder('Output');\r\n output.add(guiState.output, 'showVideo');\r\n output.add(guiState.output, 'showSkeleton');\r\n output.add(guiState.output, 'showPoints');\r\n output.add(guiState.output,'flipHorizontal')\r\n\r\n //camera control\r\n let cameraNames = [];\r\n let cameraIds = [];\r\n cameras.forEach(({name,id})=>{\r\n cameraNames.push(name);\r\n cameraIds.push(id);\r\n })\r\n let camera = gui.addFolder('Camera');\r\n const cameraController = camera.add(guiState.camera,'deviceName',cameraNames);\r\n\r\n //camera listener\r\n cameraController.onChange(function(name) {\r\n guiState.changeCameraDevice = cameraIds[cameraNames.indexOf(name)];\r\n });\r\n}", "function displayVideo() {\n if(currentQ.video){\n $(\"#video\").html(\"<div id=\\\"vidDiv\\\"></div>\");\n $(\"#vidDiv\").html(currentQ.video);\n var vidDivText = $(\"<p>\").text(\"Watch Video\");\n $(vidDivText).attr(\"id\", \"watchText\");\n $(vidDivText).prependTo(\"#video\");\n $(vidDivText)\n .css(\"background-color\", \"rgba(255, 255, 255, 0.9\")\n .css(\"box-shadow\", \"2px 2px 50px rgba(0,0,0,0.2)\");\n /* click #watchText to run videoVisibility function */\n $(\"#watchText\")\n .on(\"click\", videoVisibility);\n /* sets hover properties for #watchText */\n $(\"#watchText\").hover(\n function(){\n $(\"#watchText\")\n // .css(\"background-color\", \"rgba(235, 235, 235, 0.2\")\n .css(\"box-shadow\", \"0px 0px 0px rgba(0,0,0,0.3)\");\n }, \n function() {\n $(\"#watchText\")\n // .css(\"background-color\", \"rgba(255, 255, 255, 0.8\")\n .css(\"box-shadow\", \"5px 5px 25px rgba(0,0,0,0.3)\");\n }\n );\n }\n}", "function prevSong(){\n $(\".playpause\").addClass(\"active\");\n $(\".image\").addClass(\"active\");\n if($('.listItemPlay').hasClass('playing')){\n $('.listItemPlay').removeClass('playing')\n }\n playlist_index--;\n if(playlist_index < 0){\n playlist_index = playlist.length - 1;\n }\n $('.music-list ul li').eq(playlist_index).addClass('playing');\n fetchMusicDetail();\n}", "function playVideo() {\n playVideoSegments(transcripts)\n}", "playVideo(url, title, backgroundImage, transition) {\n if (!this.controls) {\n this.controls = new VPcontrolPanel({\n player: this.player,\n title: title,\n cover: backgroundImage,\n distance: 2,\n width: 3\n }, transition);\n this.container();\n this.player.loadVideo(url);\n } else {\n this.controls.loadVideo(title, url, backgroundImage, this.sphere);\n }\n }", "function audioVideoVis() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t//unwrap post and protfolio videos\r\n\t\t\t\t\t$('.video-wrap iframe').unwrap();\r\n\t\t\t\t\t$('#sidebar iframe[src]').unwrap();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('audio')\r\n\t\t\t\t\t\t.attr('width', '100%')\r\n\t\t\t\t\t\t.attr('height', '100%')\r\n\t\t\t\t\t\t.css('visibility', 'visible');\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($body.hasClass('mobile')) {\r\n\t\t\t\t\t\t$('video').css('visibility', 'hidden');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$('video').css('visibility', 'visible');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.wp-video').each(function () {\r\n\t\t\t\t\t\tvar video = $(this).find('video').get(0);\r\n\t\t\t\t\t\tvideo.addEventListener('loadeddata', function () {\r\n\t\t\t\t\t\t\t$window.trigger('resize');\r\n\t\t\t\t\t\t}, false);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\t//webkit video back button fix \r\n\t\t\t\t\t$('.main-content iframe[src]').each(function () {\r\n\t\t\t\t\t\t$(this).css({\r\n\t\t\t\t\t\t\t'opacity': '1',\r\n\t\t\t\t\t\t\t'visibility': 'visible'\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function handleEnter( event ) {\n var currState = state.get();\n var target = $(event.target);\n var isVideoTarget;\n\n // toggle the controls on/off in video state,\n // assuming the target isn't anything specific\n // like a button.\n if( currState === \"video\" && target.is(document.body) ){\n toggleControls(true);\n return;\n }\n\n // determine whether this event should launch a new video\n isVideoTarget = (target.is(\".item\") || target.closest(\".item\").length);\n\n // figure out which state we're in, and play\n // the selected video.\n if({ \"browse\":1, \"main\":1, \"info\":1 }[ currState ] && isVideoTarget ) {\n video.isPlaying() && video.stop();\n video.isInfoVideo = currState === \"info\";\n playSelectedVideo( event );\n currState === \"info\" && toggleInfo(false);\n currState !== \"info\" && list.markStartIndex();\n // currState !== \"info\" && console.log( 'marking list start index', list.selectedIndex );\n }\n }", "function mouseUp(event) {\n if (onplayhead == true) {\n moveplayhead(event);\n window.removeEventListener('mousemove', moveplayhead, true);\n // change current time\n clip.currentTime = duration * clickPercent(event);\n clip.addEventListener('timeupdate', timeUpdate, false);\n }\n onplayhead = false;\n}", "function onPlayerReady(event) {\n player.loadPlaylist(viewmodel.Hindivideolist());\n player.setShuffle(true);\n player.setLoop(true);\n //event.target.playVideo();\n}", "function onPlaybackUpdate(time, duration) {\n}", "function itemHoverAnim(item,art,opt,direction) {\n\n\t \t if (item.data('simplevideo') != 1) checkMediaListeners(item);\n\t \t var videoon = false;\n\t \t var emp = item.find('.esg-media-poster');\n\t \t if (emp.length>0) {\n\t\t \t if (emp.css(\"opacity\")==0) videoon = true;\n\t \t }\n\n\n\n\t \t if (item.find('.isplaying, .isinpause').length>0 || videoon) return false;\n \t\t clearTimeout(item.data('hovertimer'));\n \t\t var curdelays = opt.mainhoverdelay;\n \t\t if (art==\"set\") curdelays=0;\n\n \t\t item.data('hovertimer',setTimeout(function() {\n\t \t\t \t item.data('animstarted',1);\n\n\n\t \t\t \t punchgs.TweenLite.set(item,{z:0.01,x:0,y:0,rotationX:0,rotationY:0,rotationZ:0});\n\t\t\t \t // ADD A CLASS FOR ANY FURTHER DEVELOPEMENTS\n\t\t\t\t item.addClass(\"esg-hovered\");\n\t\t\t\t var ecc = item.find('.esg-entry-cover');\n\t\t\t\t punchgs.TweenLite.set(ecc,{transformStyle:\"flat\"});\n\t\t\t\t if (art!=\"set\") fixCenteredCoverElement(item,ecc);\n\n\t\t\t\t //if (!ecc.hasClass(\"esg-visible-cover\")) punchgs.TweenLite.fromTo(ecc,0.2,{autoAlpha:0},{force3D:\"auto\",autoAlpha:1,overwrite:\"auto\"});\n\n\t\t\t\t if (item.find('.esg-entry-content').length>0 && art!=\"set\" && opt.layout==\"even\") {\n\t\t\t\t \tvar pt = item.data('pt'), pb = item.data('pb'), pl = item.data('pl'), pr = item.data('pr'),\n\t\t\t\t \t\tbt = item.data('bt'), bb = item.data('bb'), bl = item.data('bl'), br = item.data('br');\n\n\t\t\t\t \titem.data('hhh',item.outerHeight());\n\t\t\t\t \titem.data('www',item.outerWidth());\n\n\t\t\t\t\tpunchgs.TweenLite.set(item.find('.esg-entry-content'),{display:\"block\"});\n\n\t\t\t\t\tpunchgs.TweenLite.set(item.find('.esg-entry-media'),{height:item.data('hhh')});\n\t\t\t\t\tpunchgs.TweenLite.set(item,{z:0.1,zIndex:50,x:0-(pl+pr+br+bl)/2, y:0-(pt+pb+bt+bb)/2,height:\"auto\",width:item.data('www')+pl+pr+bl+br});\n\n\n\t\t\t\t\tif (opt.evenGridMasonrySkinPusher==\"on\") {\n\t\t\t\t\t\tvar hdifference = item.height() - item.data('hhh');\n\t\t\t\t\t\toffsetParrents(hdifference,item);\n\t\t\t\t\t}\n\n\t\t\t\t \t // SPECIAL FUN FOR OVERLAPPING CONTAINER, SHOWING MASONRY IN EVEN GRID !!!\n\t\t\t\t \t item.css({\tpaddingTop:pt+\"px\",\n\t\t\t\t \t \t\t\tpaddingLeft:pl+\"px\",\n\t\t\t\t \t \t\t\tpaddingRight:pr+\"px\",\n\t\t\t\t \t \t\t\tpaddingBottom:pr+\"px\"\n\t\t\t\t \t \t\t});\n\n\t\t\t\t \t item.css({borderTopWidth:bt+\"px\",borderBottomWidth:bb+\"px\",borderLeftWidth:bl+\"px\",borderRightWidth:br+\"px\"});\n\n\t\t\t\t\t if (opt.inanimation != true ) punchgs.TweenLite.set(item.closest('.esg-overflowtrick'),{overflow:\"visible\",overwrite:\"all\"});\n\t\t\t\t }\n\n\t\t\t\t jQuery.each(esgAnimmatrix,function(index,key) {\n\t\t\t\t\t item.find(key[0]).each(function() {\n\t\t\t\t\t\t \t var elem = jQuery(this),\n\t\t\t\t\t\t\t \t dd = elem.data('delay')!=undefined ? elem.data('delay') : 0;\n\t\t\t\t\t\t\t \t animfrom = key[2];\n\t\t\t\t\t\t\t \t animto = key[3];\n\n\t \t\t\t\t\t\t // SET ANIMATE POSITIONS\n\t \t\t\t\t\t\t animto.delay=dd;\n\t \t\t\t\t\t\t animto.overwrite=\"all\";\n\t \t\t\t\t\t\t animfrom.overwrite=\"all\";\n\t \t\t\t\t\t\t animto.transformStyle=\"flat\";\n\t \t\t\t\t\t\t animto.force3D=true;\n\t \t\t\t\t\t\t var elemdelay = 0;\n\n\t \t\t\t\t\t\t // IF IT IS NOT MEDIA, WE CAN REMOVE ALL TRANSFORMS\n\t \t\t\t\t\t\t var isOut = key[0].indexOf('out') > -1;\n\t \t\t\t\t\t\t if (!elem.hasClass(\"esg-entry-media\") && !isOut)\n\t \t\t\t\t\t\t \tanimto.clearProps=\"transform\";\n\n\t \t\t\t\t\t\t if (isOut) animfrom.clearProps = \"transform\";\n\t \t\t\t\t\t\t \n\t\t \t\t\t\t\t animto.z=0.001;\n\n\t\t \t\t\t\t\t // SET PERSPECTIVE IF IT IS STILL UNDEFINED\n\t\t \t\t\t\t\t if (animfrom.transformPerspective ==undefined)\n\t\t\t \t\t\t\t\t\t animfrom.transformPerspective = 1000;\n\n\t\t\t \t\t\t\t // IF IT IS AN OVERLAY, WE NEED TO SET Z POSITION EXTREM\n\t\t\t \t\t\t\t if (elem.hasClass(\"esg-overlay\")) {\n\t\t\t\t \t\t\t\t if (animfrom.z == undefined) animfrom.z = -0.002;\n\t\t\t\t \t\t\t\t animto.z = -.0001;\n\t\t\t \t\t\t\t }\n\n\t \t\t\t\t\t\t var animobject = elem;\n\t \t\t\t\t\t\t var splitted = false;\n\n\t \t\t\t\t\t\t // ID MEDIA EXIST AND VIDEO EXIST, NO HOVER NEEDED\n\t \t\t\t\t\t\t if (elem.hasClass(\"esg-entry-media\") && elem.find('.esg-media-video').length>0)\n\t \t\t\t\t\t\t return true;\n\n\t \t\t\t\t\t\t // ANIMATE BREAK DOWN\n\t \t\t\t\t\t\t var tw = punchgs.TweenLite.killTweensOf(animobject,false);\n\n\n\t \t\t\t\t\t\t \n\n\t \t\t\t\t\t\t // IF IT IS ONLY START, WE NEED TO SET INSTEAD OF ANIMATE\n\t \t\t\t\t\t\t if (art==\"set\" ) {\n\t\t \t\t\t\t\t\t\tvar tw = punchgs.TweenLite.set(animobject,animfrom);\n\t\t \t\t\t\t\t\t\tif (isOut) {\t\t\t \t\t\t\t\t\t \t\n\t\t \t\t\t\t\t\t \t\ttw.eventCallback(\"onComplete\",resetTransforms,[animobject]);\t\t\t \t\t\t\t\t\t\n\t\t\t \t\t\t\t\t\t}\n\t \t\t\t\t\t\t } else\n \t\t\t\t\t\t \t\tswitch (key[0]) {\n\t \t\t\t\t\t\t \t\tcase \".esg-shifttotop\":\n\t \t\t\t\t\t\t \t\t\t\tanimto.y = 0 - item.find('.esg-bc.eec').last().height();\n\t \t\t\t\t\t\t \t\t\t\tvar tw = punchgs.TweenLite.fromTo(elem,0.5,{y:0},{y:animto.y});\n\t \t\t\t\t\t\t \t\tbreak;\n\t \t\t\t\t\t\t \t\tcase \".esg-slide\":\n\t \t\t\t\t\t\t \t\t\t\tvar xy = directionPrepare(direction,\"in\",item.width(),item.height());\n\t\t\t\t\t\t\t\t\t\t\tvar af = new Object();\n\t\t\t\t\t\t\t\t\t\t\tvar at = new Object();\n\t\t\t\t\t\t\t\t\t\t\tjQuery.extend(af,animfrom);\n\t\t\t\t\t\t\t\t\t\t\tjQuery.extend(at,animto);\n\t \t\t\t\t\t\t \t\t\t\taf.css.x = xy.x;\n\t \t\t\t\t\t\t \t\t\t\taf.css.y = xy.y;\n\t\t\t\t\t\t\t\t\t\t\tvar tw = punchgs.TweenLite.fromTo(animobject,key[1],af,at,elemdelay);\n\t \t\t\t\t\t\t \t\tbreak;\n\t \t\t\t\t\t\t \t\tcase \".esg-slideout\":\n\t \t\t\t\t\t\t \t\t\t\tvar xy = directionPrepare(direction,\"out\",item.width(),item.height());\n\t\t\t\t\t\t\t\t\t\t\tvar af = new Object();\n\t\t\t\t\t\t\t\t\t\t\tvar at = new Object();\n\t\t\t\t\t\t\t\t\t\t\tjQuery.extend(af,animfrom);\n\t\t\t\t\t\t\t\t\t\t\tjQuery.extend(at,animto);\n\t \t\t\t\t\t\t \t\t\t\tat.x = xy.x;\n\t \t\t\t\t\t\t \t\t\t\tat.y = xy.y;\n\t \t\t\t\t\t\t \t\t\t\tat.clearProps=\"\";\n\t\t\t\t\t\t\t\t\t\t\tvar tw = punchgs.TweenLite.fromTo(animobject,key[1],af,at,elemdelay);\n\t \t\t\t\t\t\t \t\tbreak;\n\n\t \t\t\t\t\t\t \t\tdefault:\n\t \t\t\t\t\t\t \t\t\t\tvar tw = punchgs.TweenLite.fromTo(animobject,key[1],animfrom,animto,elemdelay);\t \t\t\t\t\t\t \t\t\t\t\n\t \t\t\t\t\t\t \t\tbreak;\n \t\t\t\t\t\t \t\t}\n\t\t\t\t\t })\n\t\t\t\t })\n\t\t},curdelays));\n\n}", "function video_play(i){\n\ttrack_index = i ;\n\tlive_video = i ;\n\tif (!videoPause) {\n\t\tvideo_stop();\n\t \tgetFlashObject().SetVariable(\"method:setUrl\", flvArray[i]);\n \t}\n\tgetFlashObject().SetVariable(\"method:play\", \"\");\n\tvideoPause = false ; \n\tjQuery(\".playliste li:eq(\"+i+\")\").addClass(\"play_on\");\n}", "function videosSection() {\n // alert(\"videos clicked\");\n $(\"#videos\").addClass(\"actively_selected\");\n $(\"#solo_images, #effects, #all_panel\").removeClass(\"actively_selected\").slideUp();\n $(\".actively_selected\").slideDown();\n}", "function setVideo(e, value) {\n myMediaStream.getVideoTracks()[0].enabled = !myMediaStream.getVideoTracks()[0].enabled;\n myVideoStatus = myMediaStream.getVideoTracks()[0].enabled;\n e.target.className = \"fas fa-video\" + (myVideoStatus ? \"\" : \"-slash\");\n if (value) {\n videoBtn.className = \"fas fa-video\" + (myVideoStatus ? \"\" : \"-slash\");\n tippy(startVideoBtn, { content: myVideoStatus ? \"Off\" : \"On\", placement: \"top\", });\n }\n setMyVideoStatus(myVideoStatus);\n}", "function initalizeVideoElements() {\n var fade_in_videos = document.querySelectorAll(\".fade-in-video\");\n if (fade_in_videos.length) {\n for (i = 0; i < fade_in_videos.length; i++) {\n fade_in_videos[i].addEventListener(\"playing\", function() {\n this.classList.add(\"is-playing\");\n });\n }\n }\n}", "function clickthrough(event) \n{\n switch(event.target)\n {\n case video :\n \n if (!isMobile.any())\n {\n addClass(animation, 'start'); \n Enabler.exit(\"Click_On_Video\");\n freeze();\n videoContainer.style.visibility = \"hidden\";\n video.pause(); \n \n }\n break;\n case click:\n case zoneExpandCtaBtn :\n Enabler.exit(\"Click_On_Endshot\");\n addClass(animation, 'start'); \n freeze();\n break;\n case loader:\n clickOnLoader = true;\n loader.style.display = \"none\";\n addClass(animation, 'start'); \n freeze();\n Enabler.exit(\"Click_On_Loader\");\n break;\n }\n}", "function newGameVideo() {\n //light up the island for the first time\n}", "animateTV () {\r\n if (this.tvpower === \"off\") {\r\n this.tvleft.anims.play('leftscreenon', true);\r\n this.tvright.anims.play('rightscreenon', true);\r\n this.tvpower = \"on\";\r\n }\r\n else {\r\n this.tvleft.anims.play('leftscreenoff');\r\n this.tvright.anims.play('rightscreenoff');\r\n this.tvpower = \"off\";\r\n }\r\n }", "function updateTimelinePosition() {\r\n\tupdatePosition('updateTimelinePosition', '#timeline > .video-container');\r\n}", "function set_option(idx) {\n // set video timeline options\n var video_elems = document.getElementsByClassName('timeline_element');\n for (var elem of video_elems) {\n var timeline = elem.querySelector('.video_timeline');\n var _cut_points = timeline.getAttribute('points');\n var _point_classes = timeline.getAttribute('point_class');\n\n var cut_point_split = _cut_points.split(',');\n var point_classes_split = _point_classes.split(',');\n\n timeline.innerHTML = \"\"; \n \n for (var i = 0; i < cut_point_split.length; i++) {\n var cls_idx = point_classes_split[i];\n if (cls_idx.length == 0) {\n continue;\n }\n if (cls_idx == idx-1) {\n var time = cut_point_split[i];\n var time_minute = parseInt(time.substring(0,2));\n var time_second = parseInt(time.substring(3,5));\n create_cut_point_ui(elem, idx-1, time_minute*60+time_second);\n }\n }\n }\n}", "function animateTheCaptions(nextli, opt) {\n\n\n\n\n nextli.find('.caption').each(function(i) {\n\n offsetx = opt.width / 2 - opt.startwidth / 2;\n\n if (opt.bh > 1) {\n opt.bw = 1;\n opt.bh = 1;\n }\n\n if (opt.bw > 1) {\n opt.bw = 1;\n opt.bh = 1;\n }\n\n var xbw = opt.bw;\n\n\n\n\n var nextcaption = nextli.find('.caption:eq(' + i + ')');\n nextcaption.stop(true, true);\n\n\n if (nextcaption.hasClass(\"coloredbg\")) offsetx = 0;\n if (offsetx < 0) offsetx = 0;\n\n clearTimeout(nextcaption.data('timer'));\n\n\n\n // YOUTUBE AND VIMEO LISTENRES INITIALISATION\n\n var frameID = \"iframe\" + Math.round(Math.random() * 1000 + 1);\n\n if (nextcaption.find('iframe').length > 0) {\n var ifr = nextcaption.find('iframe');\n\n if (ifr.attr('src').toLowerCase().indexOf('youtube') >= 0) {\n\n ifr.attr('id', frameID);\n ifr.addClass(\"HasListener\");\n var player;\n player = new YT.Player(frameID, {\n events: {\n \"onStateChange\": onPlayerStateChange\n }\n });\n\n } else {\n if (ifr.attr('src').toLowerCase().indexOf('vimeo') >= 0) {\n\n if (!ifr.hasClass(\"HasListener\")) {\n ifr.addClass(\"HasListener\");\n ifr.attr('id', frameID);\n var isrc = ifr.attr('src');\n var queryParameters = {},\n queryString = isrc,\n re = /([^&=]+)=([^&]*)/g,\n m;\n // Creates a map with the query string parameters\n while (m = re.exec(queryString)) {\n queryParameters[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);\n }\n\n\n if (queryParameters['player_id'] != undefined) {\n\n isrc = isrc.replace(queryParameters['player_id'], frameID);\n } else {\n isrc = isrc + \"&player_id=\" + frameID;\n }\n\n try {\n isrc = isrc.replace('api=0', 'api=1');\n } catch (e) {}\n\n isrc = isrc + \"&api=1\";\n\n\n\n ifr.attr('src', isrc);\n var player = nextcaption.find('iframe')[0];\n $f(player).addEvent('ready', vimeoready);\n\n }\n\n }\n }\n }\n\n\n\n\n\n\n var imw = 0;\n var imh = 0;\n\n if (nextcaption.find('img').length > 0) {\n var im = nextcaption.find('img');\n if (im.data('ww') == undefined) im.data('ww', im.width());\n if (im.data('hh') == undefined) im.data('hh', im.height());\n\n var ww = im.data('ww');\n var hh = im.data('hh');\n\n\n im.width(ww * opt.bw);\n im.height(hh * opt.bh);\n imw = im.width();\n imh = im.height();\n } else {\n\n if (nextcaption.find('iframe').length > 0) {\n var im = nextcaption.find('iframe');\n if (nextcaption.data('ww') == undefined) {\n nextcaption.data('ww', im.width());\n }\n if (nextcaption.data('hh') == undefined) nextcaption.data('hh', im.height());\n\n var ww = nextcaption.data('ww');\n var hh = nextcaption.data('hh');\n\n var nc = nextcaption;\n if (nc.data('fsize') == undefined) nc.data('fsize', parseInt(nc.css('font-size'), 0) || 0);\n if (nc.data('pt') == undefined) nc.data('pt', parseInt(nc.css('paddingTop'), 0) || 0);\n if (nc.data('pb') == undefined) nc.data('pb', parseInt(nc.css('paddingBottom'), 0) || 0);\n if (nc.data('pl') == undefined) nc.data('pl', parseInt(nc.css('paddingLeft'), 0) || 0);\n if (nc.data('pr') == undefined) nc.data('pr', parseInt(nc.css('paddingRight'), 0) || 0);\n\n if (nc.data('mt') == undefined) nc.data('mt', parseInt(nc.css('marginTop'), 0) || 0);\n if (nc.data('mb') == undefined) nc.data('mb', parseInt(nc.css('marginBottom'), 0) || 0);\n if (nc.data('ml') == undefined) nc.data('ml', parseInt(nc.css('marginLeft'), 0) || 0);\n if (nc.data('mr') == undefined) nc.data('mr', parseInt(nc.css('marginRight'), 0) || 0);\n\n if (nc.data('bt') == undefined) nc.data('bt', parseInt(nc.css('borderTop'), 0) || 0);\n if (nc.data('bb') == undefined) nc.data('bb', parseInt(nc.css('borderBottom'), 0) || 0);\n if (nc.data('bl') == undefined) nc.data('bl', parseInt(nc.css('borderLeft'), 0) || 0);\n if (nc.data('br') == undefined) nc.data('br', parseInt(nc.css('borderRight'), 0) || 0);\n\n if (nc.data('lh') == undefined) nc.data('lh', parseInt(nc.css('lineHeight'), 0) || 0);\n\n\n nextcaption.css({\n 'font-size': (nc.data('fsize') * opt.bw) + \"px\",\n\n 'padding-top': (nc.data('pt') * opt.bh) + \"px\",\n 'padding-bottom': (nc.data('pb') * opt.bh) + \"px\",\n 'padding-left': (nc.data('pl') * opt.bw) + \"px\",\n 'padding-right': (nc.data('pr') * opt.bw) + \"px\",\n\n 'margin-top': (nc.data('mt') * opt.bh) + \"px\",\n 'margin-bottom': (nc.data('mb') * opt.bh) + \"px\",\n 'margin-left': (nc.data('ml') * opt.bw) + \"px\",\n 'margin-right': (nc.data('mr') * opt.bw) + \"px\",\n\n 'border-top': (nc.data('bt') * opt.bh) + \"px\",\n 'border-bottom': (nc.data('bb') * opt.bh) + \"px\",\n 'border-left': (nc.data('bl') * opt.bw) + \"px\",\n 'border-right': (nc.data('br') * opt.bw) + \"px\",\n\n 'line-height': (nc.data('lh') * opt.bh) + \"px\",\n 'height': (hh * opt.bh) + 'px',\n 'white-space': \"nowrap\"\n\n\n });\n\n im.width(ww * opt.bw);\n im.height(hh * opt.bh);\n imw = im.width();\n imh = im.height();\n } else {\n\n var nc = nextcaption;\n if (nc.data('fsize') == undefined) nc.data('fsize', parseInt(nc.css('font-size'), 0) || 0);\n if (nc.data('pt') == undefined) nc.data('pt', parseInt(nc.css('paddingTop'), 0) || 0);\n if (nc.data('pb') == undefined) nc.data('pb', parseInt(nc.css('paddingBottom'), 0) || 0);\n if (nc.data('pl') == undefined) nc.data('pl', parseInt(nc.css('paddingLeft'), 0) || 0);\n if (nc.data('pr') == undefined) nc.data('pr', parseInt(nc.css('paddingRight'), 0) || 0);\n\n if (nc.data('mt') == undefined) nc.data('mt', parseInt(nc.css('marginTop'), 0) || 0);\n if (nc.data('mb') == undefined) nc.data('mb', parseInt(nc.css('marginBottom'), 0) || 0);\n if (nc.data('ml') == undefined) nc.data('ml', parseInt(nc.css('marginLeft'), 0) || 0);\n if (nc.data('mr') == undefined) nc.data('mr', parseInt(nc.css('marginRight'), 0) || 0);\n\n if (nc.data('bt') == undefined) nc.data('bt', parseInt(nc.css('borderTop'), 0) || 0);\n if (nc.data('bb') == undefined) nc.data('bb', parseInt(nc.css('borderBottom'), 0) || 0);\n if (nc.data('bl') == undefined) nc.data('bl', parseInt(nc.css('borderLeft'), 0) || 0);\n if (nc.data('br') == undefined) nc.data('br', parseInt(nc.css('borderRight'), 0) || 0);\n\n if (nc.data('lh') == undefined) nc.data('lh', parseInt(nc.css('lineHeight'), 0) || 0);\n\n\n nextcaption.css({\n 'font-size': (nc.data('fsize') * opt.bw) + \"px\",\n\n 'padding-top': (nc.data('pt') * opt.bh) + \"px\",\n 'padding-bottom': (nc.data('pb') * opt.bh) + \"px\",\n 'padding-left': (nc.data('pl') * opt.bw) + \"px\",\n 'padding-right': (nc.data('pr') * opt.bw) + \"px\",\n\n 'margin-top': (nc.data('mt') * opt.bh) + \"px\",\n 'margin-bottom': (nc.data('mb') * opt.bh) + \"px\",\n 'margin-left': (nc.data('ml') * opt.bw) + \"px\",\n 'margin-right': (nc.data('mr') * opt.bw) + \"px\",\n\n 'border-top': (nc.data('bt') * opt.bh) + \"px\",\n 'border-bottom': (nc.data('bb') * opt.bh) + \"px\",\n 'border-left': (nc.data('bl') * opt.bw) + \"px\",\n 'border-right': (nc.data('br') * opt.bw) + \"px\",\n\n 'line-height': (nc.data('lh') * opt.bh) + \"px\",\n 'white-space': \"nowrap\"\n\n\n });\n imh = nextcaption.outerHeight(true);\n imw = nextcaption.outerWidth(true);\n }\n }\n\n\n\n if (nextcaption.hasClass('fade')) {\n\n nextcaption.css({ 'opacity': 0, 'left': (xbw * nextcaption.data('x') + offsetx) + 'px', 'top': (opt.bh * nextcaption.data('y')) + \"px\" });\n }\n\n\n\n if (nextcaption.hasClass('lfr')) {\n\n nextcaption.css({ 'opacity': 1, 'left': (5 + opt.width) + 'px', 'top': (opt.bh * nextcaption.data('y')) + \"px\" });\n\n }\n\n if (nextcaption.hasClass('lfl')) {\n\n nextcaption.css({ 'opacity': 1, 'left': (-5 - imw) + 'px', 'top': (opt.bh * nextcaption.data('y')) + \"px\" });\n\n }\n\n if (nextcaption.hasClass('sfl')) {\n\n nextcaption.css({ 'opacity': 0, 'left': ((xbw * nextcaption.data('x')) - 50 + offsetx) + 'px', 'top': (opt.bh * nextcaption.data('y')) + \"px\" });\n }\n\n if (nextcaption.hasClass('sfr')) {\n nextcaption.css({ 'opacity': 0, 'left': ((xbw * nextcaption.data('x')) + 50 + offsetx) + 'px', 'top': (opt.bh * nextcaption.data('y')) + \"px\" });\n }\n\n\n\n\n if (nextcaption.hasClass('lft')) {\n\n nextcaption.css({ 'opacity': 1, 'left': (xbw * nextcaption.data('x') + offsetx) + 'px', 'top': (-5 - imh) + \"px\" });\n\n }\n\n if (nextcaption.hasClass('lfb')) {\n nextcaption.css({ 'opacity': 1, 'left': (xbw * nextcaption.data('x') + offsetx) + 'px', 'top': (5 + opt.height) + \"px\" });\n\n }\n\n if (nextcaption.hasClass('sft')) {\n nextcaption.css({ 'opacity': 0, 'left': (xbw * nextcaption.data('x') + offsetx) + 'px', 'top': ((opt.bh * nextcaption.data('y')) - 50) + \"px\" });\n }\n\n if (nextcaption.hasClass('sfb')) {\n nextcaption.css({ 'opacity': 0, 'left': (xbw * nextcaption.data('x') + offsetx) + 'px', 'top': ((opt.bh * nextcaption.data('y')) + 50) + \"px\" });\n }\n\n\n\n\n nextcaption.data('timer', setTimeout(function() {\n if (nextcaption.hasClass('fade')) {\n nextcaption.data('repo', nextcaption.css('opacity'));\n nextcaption.animate({ 'opacity': 1 });\n }\n if (nextcaption.hasClass('lfr') ||\n nextcaption.hasClass('lfl') ||\n nextcaption.hasClass('sfr') ||\n nextcaption.hasClass('sfl') ||\n nextcaption.hasClass('lft') ||\n nextcaption.hasClass('lfb') ||\n nextcaption.hasClass('sft') ||\n nextcaption.hasClass('sfb')\n ) {\n var easetype = nextcaption.data('easing');\n if (easetype == undefined) easetype = \"linear\";\n nextcaption.data('repx', nextcaption.position().left);\n nextcaption.data('repy', nextcaption.position().top);\n\n nextcaption.data('repo', nextcaption.css('opacity'));\n nextcaption.animate({ 'opacity': 1, 'left': (xbw * nextcaption.data('x') + offsetx) + 'px', 'top': opt.bh * (nextcaption.data('y')) + \"px\" }, { duration: nextcaption.data('speed'), easing: easetype });\n }\n }, nextcaption.data('start')));\n\n })\n }", "function onPlayerReady(event) { \n //event.target.playVideo();\n detenerVideo();\n}", "function transitionThreeUp(){\n\n}", "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "function updateVisibility() {\n if (player.tech_ && player.tech_.featuresVolumeControl === false) {\n this.addClass('vjs-hidden');\n } else {\n this.removeClass('vjs-hidden');\n }\n }", "function look_ruby_video_playlist_animation_start(playlist) {\r\n\r\n var playlist_iframe = playlist.find('.video-playlist-iframe');\r\n var iframe_outer = playlist.find('.video-playlist-iframe-el');\r\n var iframe_height = playlist_iframe.height();\r\n\r\n playlist_iframe.css('height', iframe_height);\r\n playlist_iframe.prepend('<div class=\"video-loader\"></div>');\r\n iframe_outer.empty();\r\n }", "function onPlayerStateChange(event) {\n\n\t\t\t\t\t var embedCode = event.target.getVideoEmbedCode();\n\t\t\t\t\t var container = jQuery('#'+embedCode.split('id=\"')[1].split('\"')[0]).closest('.tp-simpleresponsive');\n\n\t\t\t\t\tif (event.data == YT.PlayerState.PLAYING) {\n\n\t\t\t\t\t\tvar bt = container.find('.tp-bannertimer');\n\t\t\t\t\t\tvar opt = bt.data('opt');\n\t\t\t\t\t\tbt.stop();\n\n\t\t\t\t\t\topt.videoplaying=true;\n\t\t\t\t\t\t//konsole.log(\"VideoPlay set to True due onPlayerStateChange PLAYING\");\n\t\t\t\t\t\topt.videostartednow=1;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tvar bt = container.find('.tp-bannertimer');\n\t\t\t\t\t\tvar opt = bt.data('opt');\n\n\t\t\t\t\t\tif (event.data!=-1) {\n\t\t\t\t\t\t\tif (opt.conthover==0)\n\t\t\t\t\t\t\t\tbt.animate({'width':\"100%\"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:\"linear\"});\n\t\t\t\t\t\t\topt.videoplaying=false;\n\t\t\t\t\t\t\topt.videostoppednow=1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (event.data==0 && opt.nextslideatend==true)\n\t\t\t\t\t\topt.container.revnext();\n\n\n\t\t\t\t }", "function vimeoready(player_id) {\n\n var froogaloop = $f(player_id);\n\n //jQuery('#debug').html(jQuery('#debug').html()+\" <br>Frooga Func\"+Math.round(Math.random()*100));\n\n froogaloop.addEvent('ready', function(data) {\n //jQuery('#debug').html(jQuery('#debug').html()+\" <br>Ready\"+Math.round(Math.random()*100));\n froogaloop.addEvent('play', function(data) {\n //jQuery('#debug').html(jQuery('#debug').html()+\" <br>Play\"+Math.round(Math.random()*100));\n\n var bt = jQuery('body').find('.tp-bannertimer');\n var opt = bt.data('opt');\n bt.stop();\n opt.videoplaying = true;\n //console.log(\"VideoPlay set to True due vimeoready PLAYING\");\n });\n\n froogaloop.addEvent('finish', function(data) {\n var bt = jQuery('body').find('.tp-bannertimer');\n var opt = bt.data('opt');\n if (opt.conthover == 0)\n bt.animate({'width': \"100%\"}, {duration: ((opt.delay - opt.cd) - 100), queue: false, easing: \"linear\"});\n opt.videoplaying = false;\n //console.log(\"VideoPlay set to False due vimeoready FINNSIH\");\n opt.videostartednow = 1;\n if (opt.nextslideatend == true)\n opt.container.revnext();\n\n });\n\n froogaloop.addEvent('pause', function(data) {\n var bt = jQuery('body').find('.tp-bannertimer');\n var opt = bt.data('opt');\n if (opt.conthover == 0)\n bt.animate({'width': \"100%\"}, {duration: ((opt.delay - opt.cd) - 100), queue: false, easing: \"linear\"});\n opt.videoplaying = false;\n //console.log(\"VideoPlay set to False due vimeoready PAUSE\");\n opt.videostoppednow = 1;\n });\n });\n\n\n\n\n }", "function update_frame(v_index){\r\n\r\n\tif(v_index == 1){\r\n\t\tvideoT.currentTime = document.getElementById(\"slidebar_T\").value/100* videoT.duration;\r\n\t}\r\n\telse if(v_index ==2){\r\n\t\tvideoGP.currentTime = document.getElementById(\"slidebar_GP\").value/100 *videoGP.duration;\r\n\t}\r\n\telse{\r\n\t\talert(\"Error update_frame() : video index invalid\");\r\n\t}\r\n\r\n\r\n}", "function fastForward() {\n target = this.classList[1] - 1;\n\n shownMedia[target].currentTime += 5;\n\n // If fast forward exceeds video length, goes back to beginning of video and pauses\n if(shownMedia[target].currentTime >= shownMedia[target].duration) {\n shownMedia[target].pause();\n shownMedia[target].currentTime = 0;\n playPauseBtn[target].textContent = 'Play';\n }\n }", "function showIntro (){\n $('#video_intro')[0].play();\n $(\"#button_playIntro\")\n .delay(500)\n .velocity(\"transition.bounceIn\"); \n $(\"#button_scroll\")\n .delay(800)\n .velocity(\"transition.slideUpBigIn\");\n }", "onVideoListEntryTitleClick(newCurrentVideo) {\n this.setState({\n currentVideo: newCurrentVideo\n });\n }", "function playVidWaterVideo (event) {\n vidWaterVideo.play();\n $(window).scrollTop($('#videoWaterVidCenterer').offset().top + 15);\n $(\"#vidWaterVideo\").css(\"opacity\",1);\n //jumpScroll($('#vidWaterVideo').scrollTop(\n }" ]
[ "0.63554186", "0.6338707", "0.6247146", "0.6129791", "0.60924506", "0.60314065", "0.5993365", "0.59597695", "0.593787", "0.59194374", "0.5875801", "0.5864315", "0.58640885", "0.5816547", "0.578954", "0.57855105", "0.57586527", "0.5750631", "0.57198644", "0.57128775", "0.56889534", "0.56693983", "0.56266487", "0.56150055", "0.5603418", "0.5599872", "0.558806", "0.558623", "0.55815506", "0.557895", "0.55721647", "0.5555423", "0.5550433", "0.553623", "0.55295604", "0.5529065", "0.55254334", "0.5521571", "0.55214113", "0.552047", "0.5514185", "0.5509289", "0.5501122", "0.5486632", "0.54818106", "0.54752594", "0.54748905", "0.5474324", "0.5472039", "0.5468625", "0.546351", "0.5458391", "0.545476", "0.5454334", "0.54542285", "0.5450183", "0.54471517", "0.5443295", "0.5438363", "0.5432314", "0.54293543", "0.5417312", "0.5409955", "0.5406757", "0.5402826", "0.54025054", "0.53989947", "0.5396381", "0.53955954", "0.5394947", "0.5393517", "0.5387516", "0.53871185", "0.5384095", "0.53824806", "0.5381499", "0.537133", "0.5370706", "0.5370669", "0.53665155", "0.5365784", "0.53622633", "0.5353139", "0.5352736", "0.5348811", "0.53464675", "0.5337755", "0.5335503", "0.53340894", "0.5332118", "0.5330856", "0.5330856", "0.53242743", "0.53239346", "0.5322174", "0.53215295", "0.5310378", "0.530841", "0.5306749", "0.530572" ]
0.7239287
0
Click handler to console log search results
function clickHandler() { $('.listUpButton').on('click tap', ()=>{ videoListUp(); }); $('.listDropButton').on('click tap', ()=>{ videoListDown(); }); $('#myLinkButton').on('click tap',()=>{ clipBoard('linkGhost'); }); $('#userLinkModal').on('hidden.bs.modal',()=>{ if($('.linkCopyArea').css('display')==='block'){ history.pushState({},'','/'); } }); $('.channelDropDown').on('click tap', '.dropdownChannelLiLoad', () => { browsingMode = false; dropOpened = false; returnToPageOne(); compileSelectedChannelsFromDropdown(); clearVideoList(); if (window.innerWidth < 767) { closeChannelDrop(); } else { $('mainNav-option').removeClass('in') .attr('aria-expanded', 'false'); $('.channelDropDown').removeClass('open'); } var numUpdated = 0; for(var i = 0; i<clientSelectedChannelObjects.length; i++){ $.ajax({ url:'./script/api_calls_to_db/access_database/access.php', method:'post', dataType:'JSON', data:{ action:'update_video_list', youtube_channel_id:clientSelectedChannelObjects[i].youtube_channel_id, last_channel_pull:clientSelectedChannelObjects[i].last_channel_pull }, success: function (data) { numUpdated++; if(numUpdated === clientSelectedChannelObjects.length){ returnToPageOne(); loadSelectedChannels(); } }, errors: function (data) { } }) } }); $(".dropdownChannelLiAll").on("click tap", function () { browsingMode = false; clientSelectedChannelIds = deepCopy(clientSubscribedChannelIds); clientSelectedChannelObjects = deepCopy(clientSubscribedChannelObjects); // returnToPageOne(); renderChannelSelectionDropdown(); clearVideoList(); if (window.innerWidth < 767) { closeChannelDrop(); } else { $('mainNav-option').removeClass('in') .attr('aria-expanded', 'false'); $('.channelDropDown').removeClass('open'); dropOpened = false; } var numUpdated = 0; for(var i = 0; i<clientSubscribedChannelObjects.length; i++){ $.ajax({ url:'./script/api_calls_to_db/access_database/access.php', method:'post', dataType:'JSON', data:{ action:'update_video_list', youtube_channel_id:clientSubscribedChannelObjects[i].youtube_channel_id, last_channel_pull:clientSubscribedChannelObjects[i].last_channel_pull }, success: function (data) { numUpdated++; if(numUpdated === clientSubscribedChannelObjects.length){ returnToPageOne(); loadSelectedChannels(); } }, errors: function (data) { } }) } }); $('#channelCategoryUl').on('click tap', '.channelLiChannel, .dropdownChannelLi input', (e) => { if ($(e.target).is('input')) { return; } else { let input = $(e.target).children('input'); if (input[0].checked == true) { input[0].checked = false; } else if (input[0].checked == false) { input[0].checked = true; } } }); $('a.dropdown-toggle').on('click tap', () => { $('.channelDropDown').toggleClass('open'); if (dropOpened) { dropOpened = false; } else { setTimeout(() => { dropOpened = true; }, 300); } }); //category submit button $('.channelCategoryButton').on('click tap', (e)=>{ e.preventDefault(); $('.channelCategoryForm').submit(); }); $('.channelCategoryForm').submit((e)=>{ e.preventDefault(); let categoryStr = ''; categoryStr = $(e.target).find('input').val(); if($(e.target).closest('.modal').attr('id') === "userLinkModal"){ changeCategory(categoryStr); } else{ var isUncategorized = true; for(var cat in clientCategories){ if(clientCategories[cat].indexOf(channelIdOfCategorySet) !== -1){ isUncategorized = false; } } if(isUncategorized){ changeCategory(categoryStr); } else{ changeCategory(categoryStr, true); } } $(e.target).find('input').val(''); $(e.target).closest('.modal').modal('hide').on('hidden.bs.modal',()=>{ // toastMsg('Channel Added', 2000); }); }); $('.existingCategoryButton').on('click tap', (e)=>{ let categoryStr = ''; categoryStr = $(e.target).closest('.existingCategorySelect').find('select option:selected').val(); if($(e.target).closest('.modal').attr('id') === "userLinkModal"){ changeCategory(categoryStr); } else{ var isUncategorized = true; for(var cat in clientCategories){ if(clientCategories[cat].indexOf(channelIdOfCategorySet) !== -1){ isUncategorized = false; } } if(isUncategorized){ changeCategory(categoryStr); } else{ changeCategory(categoryStr, true); } } $(e.target).closest('.existingCategorySelect').find('select option:selected').prop('selected', false); $(e.target).closest('.existingCategorySelect').find('select option:disabled').prop('selected', true); $(e.target).closest('.modal').modal('hide').on('hidden.bs.modal',()=>{ // toastMsg('Channel Added', 2000); }); }); //Search Button $('.channelSearchForm').on('click tap', '.channelSearchButton', (e) => { e.preventDefault(); $('.channelSearchForm').submit(); }); function channelSearchWorked() { for (var i = 0; i < 10; i++) { renderChannelSearchStats(i) } } function channelSearchFailed(message) { console.log('console.log("CHANNEL SEARCH FAILED")', message); } $(".channelSearchForm").submit(function (event) { event.preventDefault(); let inputStr = ''; if ($(event.target).find('input').val() === "") { return; //prevent empty input } else { inputStr = $(event.target).find('input').val(); } $(".navbar-collapse").collapse('hide'); searchChannelsByName(inputStr).then(channelSearchWorked, channelSearchFailed); if($('.contentPlaceholderWrapper').css('display')!=='none'){ $('.contentPlaceholderWrapper').fadeOut(1000, function () { $('#text-carousel, .videoHeader, .listDropWrap').slideDown(1100); }); } }); //Browse Button $('.browseChannelButton').on("click tap", handleBrowseButton); //Add Buttons $('.addChannelButton').on("click tap", handleAddButton); $(".tdPlaylistButton").on("click tap", handleAddToPlaylist); $('.ui-autocomplete').on('click tap','.ui-menu-item-wrapper', function (event){ event.stopPropagation(); let autocompleteValue = $(event.target).text(); $('.channelSearchInput').val(autocompleteValue); $('.channelSearchButton').click(); // searchChannelsByName(autocompleteValue).then(channelSearchWorked, channelSearchFailed); }); /*************************************************************************************************** * click handlers for table rows that are untouched * @params none */ $(".tdTitle, .tdChannel, .tdUpDate").on("click tap", function () { if (!$(this).parent().hasClass('selectedTd')) { $(".tdTitle, .tdChannel").unbind("mouseup"); $('.tdTitle i.fa').remove(); //Table List Row Title that is selected $(".tdTitle").mouseup(function () { if ($(this).parent().hasClass('selectedTd')) { // $("#videoStats").focus().click() $("#videoStats").trigger('focus') } }); //Table List Row Channel that is selected $(".tdChannel").mouseup(function () { if ($(this).parent().hasClass('selectedTd')) { // $("#channelInfo").focus().click() $("#channelInfo").trigger('focus') } }); currentlySelectedVideoID = $(this).parent().attr('videoID'); var channelID = $(this).parent().attr('channelID'); updateMidNavText(); // $('.fa-play-circle-o').remove(); $('.fa-circle-o-notch').remove(); var playSymbol = $('<i>') // .addClass("fa fa-play-circle-o") .addClass('fa fa-circle-o-notch fa-spin fa-fw circleSpinner') .css({ "margin-right": '5px', 'color': 'green' }); $(this).parent().find(".tdTitle>span").prepend(playSymbol); $('.tdList').removeClass('selectedTd'); $(this).parent().addClass("selectedTd"); if (getAutoPlayValue()) { player.loadVideoById(currentlySelectedVideoID); } else { player.cueVideoById(currentlySelectedVideoID); } //update video stats popover updateVideoInfoPopover(currentlySelectedVideoID); //update channel stats popover updateChannelInfoPopover(channelID); } }); /*************************************************************************************************** * click handlers for bottom carousel slides * @params none */ $('#rightArrowIcon').on('click tap',carouselRightArrow); $('#leftArrowIcon').on('click tap',carouselLeftArrow); /*************************************************************************************************** * click handler for 'watch order' function and arrow icon * @params none */ $("#playOrderArrow").on('click', function(){ reversePlayDirection = !reversePlayDirection; if(reversePlayDirection === false){ $("i").removeClass('up') }else{ $("i").addClass('up') } }); /*************************************************************************************************** * click handlers for theatre controls * @params none */ $('.fastForwardButton').on('click tap', fastForwardVideo); $('.rewindButton').on('click tap', rewindVideo); $('.playButton').on('click tap', playYtVideo); $('.lastVideoButton').on('click tap',playPrevYTVideo); $('.nextVideoButton').on('click tap', playNextYTVideo); /*************************************************************************************************** * fastForwardVideo - moves video forward in time 15s * @params none */ function fastForwardVideo() { var fastForward = player.getCurrentTime(); var add15Seconds = fastForward + 15; player.seekTo(add15Seconds); } /*************************************************************************************************** * playTYVideo - pause and play functionality with tooltip and icon changes * @params none */ function playYtVideo() { player.playVideo(); if (this.classList.value === playFaClass) { $('.playButton').tooltip('hide') $('.playButton').removeClass(playFaClass).toggleClass(pauseFaClass); $(this).attr('data-original-title','Pause') } else { $('.pauseButton').tooltip('hide'); $('.pauseButton').removeClass(pauseFaClass).toggleClass(playFaClass); $(this).attr('data-original-title','Play') player.pauseVideo() } } /*************************************************************************************************** * rewindVideo - moves video back in time 15s * @params none */ function rewindVideo() { var fastForward = player.getCurrentTime(); var minus15Seconds = fastForward - 15; player.seekTo(minus15Seconds); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function watchResultClick() {\n $(document).on('click', '.result-name', function(event) {\n event.preventDefault();\n\n const queryTarget = $(event.currentTarget);\n const queryTerm = (queryTarget.html());\n\n $('.search-results-section').prop('hidden', true);\n\n retrieveJSON(queryTerm, displayMarvelData, displayYouTubeData);\n });\n}", "function clickedSearch(e) {\n var newSearch = e.target.textContent;\n getSearchResults(newSearch);\n}", "afterSearch(result, params) {\n console.log(\"Hereeeeeeeeeee 12\");\n }", "function clicked() {\n search()\n; }", "function searchButtonClicked() {\n if (!processConfiguration()) {\n window.alert(\"Error on configuration. Be sure to add valid access tokens to configuration first to perform a search.\");\n return\n }\n //nothing entered...\n searchString = processSearchString(document.getElementById(\"input\").value);\n if (searchString == \"\") {\n return;\n }\n sources = [];\n projects = [];\n connectorAPIs = [];\n connectorManager = new ConnectorManager(token_config['GitHub'], token_config['GitLab']);\n //resetting the necessary values\n getSources();\n getConnectors();\n currentPage = 1;\n maxPage = 1;\n receivedProjects = 0;\n rowCounter = 0;\n //the date is used to ignore newly created projects\n //-> would lead to displacements when changing pages\n date = new Date(Date.now()).toISOString().replace(/[\\..+Z]+/g, \"+00:00\");\n document.getElementById(\"lastSearchedOutput\").innerHTML = searchString;\n initiateSearch();\n}", "function runSearch(e) {\n if (e.target.value === \"\") {\n // On empty string, remove all search results\n // Otherwise this may show all results as everything is a \"match\"\n applySearchResults([]);\n } else {\n const tokens = e.target.value.split(\" \");\n const moddedTokens = tokens.map(function (token) {\n // \"*\" + token + \"*\"\n return token;\n })\n const searchTerm = moddedTokens.join(\" \");\n const searchResults = idx.search(searchTerm);\n const mapResults = searchResults.map(function (result) {\n const resultUrl = docMap.get(result.ref);\n return { name: result.ref, url: resultUrl };\n })\n\n applySearchResults(mapResults);\n }\n\n}", "function handleEvent(event){\r\n \r\n var results = event.results;\r\n\r\n cli.print(format(results));\r\n }", "function track_search_ga_event() {\n\t\tvar formName = '#form_topsearch';\n\t\tvar selected_option_id = $.trim( $( formName + \" #topsearch_type\" ).val() );\n\t\tvar div_id = 'tab' + selected_option_id;\n\t\tvar option_text = $.trim( $( '#' + div_id ).find('a').text() );\n\n\t\tGAEventTracker( 'SEARCHUSAGE', 'NO_OF_USERS', 'RESULTCLICK' ); \n\t\tGAEventTracker( 'SEARCHUSAGE', 'RESULTCLICK', option_text.toUpperCase() );\n\t}", "function fetchResults(e) { //declares function that will fetch results from the URL SIMON ^\n // console.log(e);\n e.preventDefault(); // doesn't reload entire page created, only a section\n url = ${baseURL}?api-key=${key}&page=${pageNumber}&q=$ {searchTerm.value}", "function processSearch(response) {\r\n\tlet responseData = JSON.parse(response);\r\n\t searchResults = responseData.results;\r\n\t results_html=\"\";\r\n\tfor (i in responseData.results)\r\n\t\tresults_html+=\"<p onclick=\\\"nameClicked(event)\\\" id=\"+responseData.results[i].id+\" class=results>\"+responseData.results[i].name+\"</p>\";\r\n\r\n\tdocument.getElementById(\"output\").innerHTML=results_html;\r\n}", "function fetchResults(txt) {\n\tconsole.log(searchStr);\n}", "function watchForSubmit(){\n $(\".js-submit-search\").on('click', function(){\n event.preventDefault();\n\n $('.js-results').contents().remove();\n\n const query = $(this).prev().val();\n console.log($(this).prev().val());\n getDataFromAPI(query, displaySearchData);\n });\n}", "function searchClick() {\n console.log(\"sono qui\");\n var query = $('#titolo_digit').val();\n console.log(query);\n movieResult(query);\n tvResult(query);\n\n}", "searchAndLog(phrase) {\n /* eslint-disable no-console */\n this.search(phrase).then(results => {\n console.group(`Search For '${phrase}'`);\n for (let result of results) {\n let doc = result.document;\n if (doc.type === 'class') {\n console.groupCollapsed(`Class: %c${doc.title}`, 'font-family: monospace');\n for (let [term, match] of Object.entries(result.resultInfo.matchData.metadata)) {\n for (let [key, data] of Object.entries(match)) {\n if (key === 'keywords') {\n let test = term.toLowerCase();\n for (let keyword of doc.keywords) {\n if (keyword.toLowerCase().indexOf(test) !== -1) {\n console.log(`%c${keyword} %c(field)`, 'font-family: monospace; font-weight: bold', 'font-family: inherit; font-weight: normal');\n }\n }\n } else {\n for (let position of data.position) {\n logSnippet(doc, key, position);\n }\n }\n }\n }\n console.groupEnd();\n } else if (doc.type === 'template') {\n console.groupCollapsed(`Route: %c${doc.route}`, 'font-family: monospace');\n for (let match of Object.values(result.resultInfo.matchData.metadata)) {\n for (let [key, data] of Object.entries(match)) {\n for (let position of data.position) {\n logSnippet(doc, key, position);\n }\n }\n }\n console.groupEnd();\n }\n }\n console.groupEnd();\n });\n /* eslint-enable */\n }", "function onSearchTerm(evt) {\n var text = evt.target.value;\n doSearch(text, $('#types .btn-primary').text());\n }", "function handleSearch() {\n triggerSearch({}); // need empty braces here\n }", "function clickSearchBox(object){\n let searchText = document.querySelector(\".form-inline input[type='text']\").value;\n document.location = page.RESULT + '?searchWords='+searchText.toLowerCase();\n}", "function showResults(search) {\n\t//show loading icon in btn\n\tvar btn = $('#search');\n\t\tbtn.addClass('searching');\n\t$.ajax(\n\t{\n\t\turl: 'php_scripts/actions.php',\n\t\ttype: 'POST',\n\t\tdata: 'action=search&search='+search,\n\t\tdataType: 'JSON',\n\t\tsuccess: function(data) {\n\t\t\t// console.log(data.length);\n\t\t\t// console.log(typeof data[0] !== 'object');\n\t\t\t// var result = JSON.parse(data);\n\t\t\tappendResultToDom(data);\n\t\t\t//remove loading from search btn\n\t\t\tbtn.removeClass('searching');\n\t\t},\n\t\terror: function(response) {\n\t\t\t//log js errors\n\t\t\tshortTimeMesg('Alert! Search failed!', 'short-time-msg-failure');\n\t\t\t//remove loading from search btn\n\t\t\tbtn.removeClass('searching');\n\t\t}\n\t}\n\t);\n}", "function searchEventListener() {\n\t$(\"#searchbtn\").click(function() {\n\t\tif ($(\"#searchbox\").val() != '') {\n\t\t\tsearchNewspapers($(\"#searchbox\").val());\n\t\t}\n\t});\n}", "function searchCall() {\n $('#searchButton').click(function () {\n var qString = $('#searchInput').val();\n bindSearchUrl(qString);\n });\n\n $('#searchInput').keypress(keypressHandler);\n }", "function logResults(data) {\n console.log(data);\n}", "function handleWebSearch() {\n\n moviesList.on(\"click\", \".movie__title\", function(e) {\n var movieTitle = $(e.currentTarget).text();\n window.open( \"https://www.google.com/search?q=\" + encodeURIComponent(movieTitle) + \" \" + encodeURIComponent(config.searchSufix) );\n });\n }", "function performSearch() {\n // reset the scroll in case they scrolled down to read prior results\n window.scrollTo(0, 0)\n\n fetchSearch(\n // Ensures event properties include \"type\": \"gene\" in search logging.\n 'gene', {\n page: searchParams.page,\n genes: searchParams.genes,\n preset: searchParams.preset\n }).then(results => {\n setSearchState({\n params: searchParams,\n isError: false,\n isLoading: false,\n isLoaded: true,\n results,\n updateSearch\n })\n }).catch(error => {\n setSearchState({\n params: searchParams,\n isError: true,\n isLoading: false,\n isLoaded: true,\n results: error,\n updateSearch\n })\n })\n }", "function displayNewSearchResults(event) {\n let searchTerm = event.target.value;\n let currentSearch = giphy[\"query\"][\"q\"];\n if (searchTerm !== currentSearch && searchTerm !== \"\") {\n giphy[\"query\"][\"q\"] = searchTerm;\n updateOffset(true);\n update();\n }\n}", "function showResults() {\n\t\t\t\tconsole.clear();\n\t\t\t\tconsole.log(data);\n\t\t\t}", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "function searchHandler(e) {\n \"use strict\";\n // Prevent default form action\n e.preventDefault();\n showFilteredBreeds();\n}", "function SearchResults() {\n\n}", "function showResults(results){\n\t\n}", "function quickSearchButton_click() {\n //Begin Search Animation\n var $quickSearchResultsListWrapper = $(\"#QuickSearchResultsListWrapper_helm\");\n var $quickSearchProgressLoaderWrapper = $(\"#QuickSearchProgressLoaderWrapper_helm\");\n quickSearchResults_show(true);\n showProgressSpinner(true, \"#QuickSearchResultsContentTab_helm\");\n var quickSearch = quickSearchOptions_GetUserDefinedValues(); //Gather the search options specified by user and package them in QuickSearchOptions_helm javascript object\n quickSearch.recentSearches.save.call(quickSearch); //save the quick search in recent quick searches\n //\n helm.xhr.getQuickSearchResults(quickSearch.toJSON()).promise().done(function() {\n showProgressSpinner(false,\"#QuickSearchResultsContentTab_helm\");\n });\n if (Compass.Global.isLoanSelected && helm.DisplayMode !== \"QuickSearchRecentlyViewedOnly\") { //a setting/check for is in iquote mode would be better here.\n helm.showBasicLoanDetailsInPageHeader(true);\n }\n }", "function setSearchClick(searchUrl) {\n $(\"#search-btn\").on(\"click\", function() {\n var searchInput = $(\"#search-input\").val();\n if (!searchInput == \"\") {\n $(\"#result-panels-wrapper\").html(\"\");\n getSearchData(searchUrl, searchInput);\n }\n });\n}", "function handleSearchClick(){\r\n var temp = document.getElementById('searchText').value;\r\n fetchRecipesBySearch(temp);\r\n }", "function handleSearchWaypointResultClick(e) {\n\t\t\tvar rootElement = $(e.currentTarget).parent().parent().parent().parent();\n\t\t\tvar index = rootElement.attr('id');\n\t\t\trootElement.removeClass('unset');\n\t\t\trootElement = rootElement.get(0);\n\n\t\t\trootElement.querySelector('.searchAgainButton').show();\n\t\t\trootElement.querySelector('.guiComponent').hide();\n\n\t\t\tvar waypointResultElement = rootElement.querySelector('.waypointResult');\n\t\t\t//remove older entries:\n\t\t\twhile (waypointResultElement.firstChild) {\n\t\t\t\twaypointResultElement.removeChild(waypointResultElement.firstChild);\n\t\t\t}\n\t\t\twaypointResultElement.insert(e.currentTarget);\n\t\t\twaypointResultElement.show();\n\n\t\t\t//remove search markers and add a new waypoint marker\n\t\t\ttheInterface.emit('ui:waypointResultClick', {\n\t\t\t\twpIndex : index,\n\t\t\t\tfeatureId : e.currentTarget.id,\n\t\t\t\tsearchIds : rootElement.getAttribute('data-search')\n\t\t\t});\n\t\t}", "function searchHistory() {\n $(\".cityRecord\").on(\"click\", function(event) {\n event.preventDefault();\n var inputEl = $(this).text();\n infoDisplay(inputEl);\n })\n}", "logViewSearchResults(object) {\n if (!isObject(object)) {\n throw new Error(\n 'firebase.analytics().logViewSearchResults(*): The supplied arg must be an object of key/values.',\n );\n }\n\n return this.logEvent(\n 'view_search_results',\n validateStruct(\n object,\n structs.ViewSearchResults,\n 'firebase.analytics().logViewSearchResults(*):',\n ),\n );\n }", "function listenResultsClick() {\n\tconst resultsLink = document.getElementById('display-results');\n\tresultsLink.addEventListener('click', () => {\n\t\t// send page view to Analytics\n\t\tgtag('config', 'UA-170700693-2', {\n\t\t\tpage_title: 'resultat-detall',\n\t\t\tpage_path: '/resultat-detall',\n\t\t});\n\t\t// send Analytics event\n\t\tgtag('event', 'display-results', {\n\t\t\tevent_category: state.age,\n\t\t\tevent_label: `score: ${state.score}`,\n\t\t});\n\t\t// clean HTML\n\t\tcontent.innerHTML = '';\n\t\t// create Results title\n\t\tconst resultsTitle = document.createElement('h1');\n\t\tresultsTitle.textContent = 'Resultats';\n\t\tcontent.appendChild(resultsTitle);\n\t\t// create list of answers\n\t\tconst answers = document.createElement('ul');\n\t\tstate.collectedAnswers.map((item) => {\n\t\t\tconst uniqueAnswer = document.createElement('li');\n\t\t\tuniqueAnswer.id = 'answer-item';\n\t\t\tuniqueAnswer.innerHTML = `${\n\t\t\t\titem.correct\n\t\t\t\t\t? '<i class=\"fas fa-check-circle answer-summary\" id=\"correct-answer\"></i>'\n\t\t\t\t\t: '<i class=\"fas fa-times-circle answer-summary\" id=\"wrong-answer\"></i>'\n\t\t\t}<p>Pregunta: ${item.question} | Resposta: ${item.answer}</p>`;\n\t\t\t// uniqueAnswer.textContent = `Pregunta: ${item.question} | Resposta: ${\n\t\t\t// \titem.answer\n\t\t\t// } | ${item.correct ? 'Correcte' : 'Equivocada'}`;\n\t\t\tanswers.appendChild(uniqueAnswer);\n\t\t});\n\t\tcontent.appendChild(answers);\n\n\t\t// CTA button\n\t\tconst ctaButton = document.createElement('button');\n\t\tctaButton.id = 'tryAgain';\n\t\tctaButton.textContent = `Torna-ho a provar`;\n\t\tcontent.appendChild(ctaButton);\n\t\t// social media buttons\n\t\tdisplaySocialMediaButtons(content);\n\t});\n}", "function handleResults() {\n // console.log(event.target + 'was clicked');\n updateChartArrays();\n displayList();\n drawChart(); //new line\n}", "function printLogs(file, per_page, search) {\n curr_log = file;\n $('#actions-menu').empty();\n $('#actions-menu').append('<li><a href=\"#\" onclick=\"search_log(); return false\"><i class=\"glyphicon glyphicon-refresh\"></i> Refresh</a></li>');\n\n $.when(getLogs(file, per_page, search)).done(function (data) {\n\n }).fail(function (message) {\n addModalError(message);\n });\n}", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "function handleViewResultsButtonClicked() {\n $('.page').on('click', '.view-results', function (event) {\n event.preventDefault();\n STORE.view = 'results';\n STORE.button = { class: 'start-over', label: 'Start Over' };\n STORE.currentQuestion = null;\n STORE.userChoice = null;\n renderPage();\n });\n}", "function searchEngine(e){\n\n let input = document.getElementById('search-input');\n let html = '';\n let matchingResults = [];\n let heading = document.querySelector('.search-heading');\n\n// Find Matching Results\n if(input.value === ''){\n\n searchResults.forEach(function(obj){\n heading.textContent = 'Most Visited';\n\n if(obj.frequent === true){\n matchingResults.push(obj);\n }\n })\n } else {\n\n heading.textContent = 'Search Results';\n searchResults.forEach(function(obj){\n if(obj.title.toUpperCase().includes(input.value.toUpperCase())){\n matchingResults.push(obj);\n }\n })\n }\n\n\n\n if(matchingResults.length > 0){\n\n matchingResults.forEach(function(el){\n html += `<li><a class=\"grey-text\" href=\"${el.link}\">${boldString(el.title, input.value)}</a></li>`\n })\n document.querySelector('.popup-list').innerHTML = html;\n } else{\n html = `<li>There are no suggestions for your query.</li>`\n document.querySelector('.popup-list').innerHTML = html;\n }\n\n}", "function searchClick(){\r\n\t//get searchbox value\r\n\tterm = $('#searchBox').val();\r\n\t//Display message while waiting for server response\r\n\t$('#mainContainer').html('<h4>Searching....</h4>');\r\n\t//send AJAX request containing search term\r\n\t$.get( \"index.php\", { s: \"ajxSearchResult\", p: term }, function(data){\r\n\t\t$('#mainContainer').html(data);\r\n\t});\t\r\n}", "function executeSearch(event) {\n event.preventDefault();\n\n // Get the user's input from the textbox.\n var searchTerms = document.getElementById(\"search-terms\").value;\n\n // Print out the user's search terms to the developer console.\n console.log(\"The user has submitted the following search terms: \" + searchTerms);\n\n // Make an asynchronous request to Spotify's library. We'll have to provide the\n // function that should be called once the results are received.\n var parameters = {\n\turl: 'https://api.spotify.com/v1/search',\n\tdata: {\n\t q: searchTerms,\n\t type: 'track'\n\t},\n\tsuccess: onSuccessfulSearch\n };\n \n $.ajax(parameters);\n \n \n}", "function executeSearch(){\n\t/*Save the form data to a JSON file, so that it can be autopopulated the next time the form page is opened.*/\n\tsaveJsonToBrowserStorage(convertCriteriaToJSON());\n\t/*Redirect to the search page*/\n\tcreateNewTabWithURL(generateSearchURL());\n\t/*Close the Current Tab, as it has no need to be open, and avoid Tab Spam.*/\n\tcloseCurrentTab();\n}", "function getInput() {\n\t\t\tsearchBtn.addEventListener('click', () => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsearchTerm = searchValue.value.toLowerCase();\n\t\t\t\tconsole.log(searchTerm);\n\t\t\t\tresults.innerHTML = ''; // clear page for new results\n\t\t\t\tgetData(searchTerm); // run w/ searchTerm\n\t\t\t\tformContainer.reset();\n\t\t\t});\n\t\t}", "function displayResults() {\n\n $('.btn').focus();\n $('#top-result').fadeIn();\n $('.container__outside--output').fadeIn();\n $('#map').html('<img src=' + mapUrl + '>');\n $('#result').text(venue.name);\n $('#location').text(venue.address);\n $('#url').html('<a href=\"' + venue.url + '\" target=\"_blank\">Vist website</a>');\n $('#category').html('<img src=\"' + venue.icon + '64.png\">');\n \n }", "searchClicked(_) {\n flikrSearch(this.state.term).fork(this.showError,this.updateResults)\n }", "function init() {\n document.getElementById(\"search-btn\").addEventListener(\"click\", executeSearch);\n\n // automatically place focus on the textbox after the page is finished loading\n document.getElementById(\"search-terms\").focus();\n\n\n var t = document.getElementById(\"search-results\");\n console.log(t);\n\n \n\n}", "function searchSubmit() {\n $('.js-search-form').click(e => {\n event.preventDefault();\n const searchTarget = $(event.currentTarget).find('.js-query');\n const query = searchTarget.val();\n getComicInfo(query,callBack)\n });\n}", "function onSearchResponse(response) {\n\t\tconsole.log(\"FUNCTION: onSearchResponse()\");\n\t\tshowResponse(response);\n\t}", "function searchResultsHandler() {\r\n $('.input-form').submit(e => {\r\n e.preventDefault();\r\n const userQuery = $('#user-query').val();\r\n const userResultsNumber = $('#user-number-results').val() || '10';\r\n clearInputs();\r\n getSearchResults(userQuery, userResultsNumber);\r\n });\r\n}", "function handleSubmit() {\n //Take the search term string entered by the user in the input field, add it to the baseUrl, make a fetch request to that new url, and append the results of what we searched for to the DOM in the correct element, wrapped in li tags\n}", "function collectSearchQuery() {\n document.querySelector('#submitButton').addEventListener('click', function () {\n const searchJSON = { search: { subject: '', code: '', title: '', semester: '', weight: '', department: '' } }\n\n searchJSON.search.subject = document.getElementById('subject').value\n searchJSON.search.code = document.getElementById('code').value\n searchJSON.search.title = document.getElementById('title').value\n searchJSON.search.semester = document.getElementById('semester').value\n searchJSON.search.weight = document.getElementById('weight').value\n searchJSON.search.department = document.getElementById('department').value\n\n console.log('Search request: ' + JSON.stringify(searchJSON))\n\n window.api.send('toMain', searchJSON)\n\n window.api.receive('fromMain', (data) => {\n console.log(`Received ${data} from main process`)\n })\n\n window.location.replace('results.html')\n })\n}", "clickSearchBox(event) {\n if (!this.isSearching()) {\n this.startSearching();\n }\n }", "function onKeyPressed () {\n\n // Gets the current text in the space bar\n const currInput = searchBar.firstElementChild.value;\n\n // Gets all matching links\n const nameMatches = findNameMatches(currInput);\n\n // Hides extra buttons\n hideLinks(nameMatches.length);\n\n // Sets the linksToDisplay to the matches for output\n linksToDisplay = nameMatches;\n\n // Shows first page of output\n placePaginatedLinks(1, linksToDisplay);\n\n}", "executeSearch(term) {\n var results;\n try {\n results = this.search.fuse.search(term); // the actual query being run using fuse.js\n } catch (err) {\n if (err instanceof TypeError) {\n console.log(\"hugo-fuse-search: search failed because Fuse.js was not instantiated properly.\")\n } else {\n console.log(\"hugo-fuse-search: search failed: \" + err)\n }\n return;\n }\n let searchitems = '';\n\n if (results.length === 0) { // no results based on what was typed into the input box\n this.resultsAvailable = false;\n searchitems = '';\n } else { // we got results, show 5\n for (let item in results.slice(0,5)) {\n let result = results[item];\n if ('item' in result) {\n let item = result.item;\n searchitems += this.itemHtml(item);\n }\n }\n this.resultsAvailable = true;\n }\n\n this.element_results.innerHTML = searchitems;\n if (results.length > 0) {\n this.top_result = this.element_results.firstChild;\n this.bottom_result = this.element_results.lastChild;\n }\n }", "function display_results() {\n}", "function onClickSearch(entry) {\n // for snippet info\n var request = gapi.client.youtube.search.list({\n part: 'snippet',\n q: entry,\n\t\tmaxResults: 10,\n\t\ttype: 'video',\n\t\tvideoCategoryId: 10 // search for music only\n });\n\t\n\t// for id info\n var requestId = gapi.client.youtube.search.list({\n part: 'id',\n q: entry,\n\t\tmaxResults: 10,\n\t\ttype: 'video',\n\t\tvideoCategoryId: 10 // search for music only\n });\n \n // Send the request to the API server,\n // and invoke onSearchResponse() with the response.\n\trequestId.execute(getVideoId);\n request.execute(onSearchResponse);\n}", "afterSearch(searchText, result) {\n }", "function handleQuery(pageControl, args) {\n var originalResults;\n app.sessionState.lastSearch = args.queryText;\n //this.initializeLayout(element.querySelector(\".resultslist\").winControl, Windows.UI.ViewManagement.ApplicationView.value);\n searchData(pageControl, args.queryText);\n }", "function handleBtnClick(event) {\n var searchHistory = [];\n\n searchHistory = state.searchTerms;\n event.preventDefault();\n // call hacker news api to retrieve articles based upon searchTerm\n API.getHackerNews(searchTerm)\n .then(news => {\n // store returned list into state variable of news\n setNews(news.data.hits);\n console.log(news.data.hits[3].url);\n })\n .catch(err => console.log(err));\n searchHistory.push(searchTerm);\n // store new search term into \"store\" for state management\n dispatch({\n type: \"searchTerms\",\n searchTerms: searchHistory\n });\n }", "function TreeViewPerformSearchCallback(res){\n\tif(res && !res.error){\n\t\teval('treeview = ' + res.treeviewname + ';');\n\t\tvar container = treeview.getElement(treeview.prefix + '_searchresultcontainer');\n\t\tcontainer.innerHTML = treeview.searchclosecode;\n\t\tif(res.results.length){\n\t\t\tvar i;\n\t\t\tfor(i=0;i<res.results.length;i++){\n\t\t\t\tvar result = res.results[i];\n\t\t\t\tvar descriptions = Base64.decode(result.descriptions);\n\t\t\t\tvar parts = descriptions.split(res.separator);\n\t\t\t\tvar j;\n\t\t\t\tvar html = '<div class=\"trv_searchresultitem\" onclick=\"' + res.treeviewname + '.BeginOpenPath(\\'' + result.ids + '\\',\\''+res.separator+'\\');\">';\n\t\t\t\tfor(j=0;j<parts.length;j++){\n\t\t\t\t\thtml += '<ul>' + parts[j];\n\t\t\t\t}\n\t\t\t\tfor(j=0;j<parts.length;j++){\n\t\t\t\t\thtml += '</ul>';\n\t\t\t\t}\n\t\t\t\thtml += '</div>';\n\t\t\t\tcontainer.innerHTML += html;\n\t\t\t}\n\t\t}else{\n\t\t\tcontainer.innerHTML += '<div class=\"\">Sorry, no results found for your search term.</div>';\n\t\t}\n\t}else{\n\t\talert(res.error);\n\t\tif(res.treeviewname){\n\t\t\teval('treeview = ' + res.treeviewname + ';');\n\t\t\ttreeview.getElement(treeview.prefix + '_searchresultcontainer').style.display = 'none';\n\t\t}\n\t}\t\n}", "function add_click() {\n $('#search').click(function(){\n var query = find_query_params();\n //show a simple error message if the user hasn't entered enough in the query\n query?query_data(query):error();\n });\n }", "function emitSearch(event){ if (event.which == 13) {addSearch();}}", "function addeventListener() {\n var button = document.getElementById('search-button');\n button.addEventListener('click', linearSearch);\n }", "function notifySavedResults() {\n console.log('\\n==============================================\\n');\n console.log(\"I've went ahead and query results into log.txt as well!\");\n console.log('\\n==============================================\\n');\n}", "function displaySearchResults(results) {\n var addressClickHandler = function() {\n var location = $(this).data('location');\n $('#directions').empty();\n findPollingLocationFor(location);\n };\n if (results.length === 1) {\n findPollingLocationFor(results[0].geometry.location);\n } else {\n var $ul = $('<ul>').addClass('location-choices').appendTo('#directions');\n for (var i = 0; i < results.length; i++) {\n var result = results[i];\n var link = $('<a>').text(result.formatted_address).data('location', result.geometry.location).on('click', addressClickHandler);\n $('<li>').append(link).appendTo($ul);\n }\n $('.modal').modal('hide');\n }\n }", "onSearch() {\n try {\n const searchText = this.getSearchHash();\n if (searchText === this.priorSearchText)\n return;\n this.engine.search(searchText);\n this.priorSearchText = searchText;\n }\n catch (ex) {\n this.publish(\"error\", ex.message);\n }\n }", "function onSearchResponse(response) {\n showResponse(response);\n}", "function onSearchResponse(response) {\n showResponse(response);\n}", "function onSearchResponse(response) {\n showResponse(response);\n}", "function onSearchResponse(response) {\n showResponse(response);\n}", "function search() {\n\t\n}", "function handleSearchEvent() {\n const newData = filterStudents(searchValue);\n showPage(newData, 1);\n addPagination(newData);\n}", "function searchTerms(d){\n\t\n\tpayload = implode_form(d);\n\n\td.getElementById('demo_results').style.display = \"block\";\n\trdiv = d.getElementById('results_status'); // locate the output div \n\trdiv.innerHTML = ''; // clear out the block, prepare for data!\n\n\tlaunchEngines(rdiv,apibase+'/terms.',payload);\n\t//console.log('APIBASE: ' + apibase);\n\n}", "searchClicked(e) { flickrSearch(this.state.term).fork(this.props.showError, this.updateResults ) }", "function startUp() {\n let search = document.getElementById(\"search\");\n search.onclick = searchAll;\n }", "function handleSearchResult(data) {\n\t\tvar searchResult = \"\";\n\t\tsearchResult += \"<div class='resultButton'>\"\n\t\tsearchResult += \"<img class='resultImage' alt='test' src='\" + data[0].profilePicture +\"'\\>\";\n\t\tsearchResult += \"<h2 class='resultName' action='/profile'>\" + data[0].username + \"</h2>\";\n\t\tsearchResult += \"</div>\";\n\t\tdocument.getElementById(\"searchResults\").innerHTML = searchResult;\t\n\t}", "function init() {\n\n loadLatestSearch();\n\n displayLatestSearches();\n\n searchHandler();\n\n $('#submitBtn').on(\"click\", () => {\n saveSearchTerm($('#search').val().toUpperCase()); \n searchHandler($('#search').val());\n })\n}", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function onSearchResponse(response) {\n showResponse(response);\n\n}", "function clickSearchButton(e){\n _self.getDefaultPlace(_self.scope.inputSearch.value); \n }", "function sendSearchResult(search) {\n selectAndExecute(\"sr/\" + forHash(search), function() {\n var response = {type: \"searchresult\", link: \"search\", search: search, lists: [], controlLink: location.hash};\n response.header = $.trim($(\"#breadcrumbs\").find(\".tab-text\").text());\n var searchView = $(\"#main .search-view\");\n response.moreText = $.trim(searchView.find(\"div .header .more:visible\").first().text());\n response.lists.push(parseSublist(searchView, \"srar\", 6));\n response.lists.push(parseSublist(searchView, \"sral\", 5));\n response.lists.push(parseSublist(searchView, \"srs\", 10));\n response.empty = response.lists[0] === null && response.lists[1] === null && response.lists[2] === null;\n post(\"player-navigationList\", response);\n });\n }", "function searchOpsToPrint(searchInput, targetListElement, listTextElement, searchBtn, highlight) {\n $(searchInput).keyup(function () {\n filterListOnSearch(this, targetListElement, listTextElement, highlight);\n });\n if ($(searchBtn).length) {\n $(searchBtn).click(function () {\n filterListOnSearch(searchInput, targetListElement, listTextElement, highlight);\n });\n }\n }", "function search(){\r\n if (!searchField.value)\r\n return;\r\n\r\n let results = searchEngine.search(searchField.value,{\r\n fields: {\r\n tags: { boost: 3 },\r\n title: { boost: 2 },\r\n body: { boost: 1 }\r\n }\r\n }); \r\n\r\n searchResults.classList.add('header-searchResults--show')\r\n\r\n let resultsHtml = '';\r\n if (results.length){\r\n \r\n resultsHtml = `Found ${results.length} post(s).`;\r\n for(let result of results){\r\n let doc = searchEngine.documentStore.getDoc(result.ref);\r\n resultsHtml += `\r\n <div class=\"header-searchResult\">\r\n <a href=\"${doc.id}\">${doc.title}</a>\r\n </div>`;\r\n\r\n }\r\n } else{\r\n resultsHtml = `<div class=\"header-searchResult\">\r\n No results found for ${searchField.value}\r\n </div>`;\r\n }\r\n\r\n searchResults.innerHTML = resultsHtml;\r\n}", "function displaySearchResults(query){\n\t// create the complete url\n\tvar wiki_url = base_url + query;\n\tconsole.log(wiki_url);\n\t$.getJSON(wiki_url, function(json){\n\t\tvar result = json[\"query\"][\"search\"];\n\t\tfor(var i=0; i<result.length; i++){\n\t\t\tconsole.log(result[i]);\n\t\t\turl_link = base_redirect + result[i].title.replace(\" \", \"%20\");\n\t\t\t$(\"#content\").append(\"<a href='\" + url_link + \"' class='list-group-item' target='_blank'><h3>\"\n\t\t\t+ result[i].title + \"</h3><br>\" + result[i].snippet + \"<br></a>\");\n\t\t}\n\t});\n\t\n}", "function searched() {\n\n $(\".searched\").click(function (event) {\n console.log($(this).text())\n // event.stopPropagation()\n // event.preventDefault()\n var city = $(this).text()\n getWeather(city)\n getForecast(city)\n console.log(city)\n $('#dashBoard').empty()\n $('#foreCast').empty()\n $('#city').val(\"\")\n $('#five').empty()\n })\n\n }", "searchClicked(_) { console.log(this.state.term) }", "function setQuery(e) {\n if (e.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "function onExecuteSearch(searchInput, resultsContainer)\n{\n var query = searchInput.value;\n\n if(query)\n {\n getResults(query, function(results) {\n\n var resultsList = getResultsList(results);\n\n // Clear existing results container (if applicable)\n var currResultsList = document.getElementById('results');\n if(currResultsList)\n {\n resultsContainer.removeChild(currResultsList);\n }\n\n // Display current results\n resultsContainer.appendChild(resultsList);\n\n });\n }\n}", "function opensearch(){\n\tsummer.openWin({\n\t\tid : \"search\",\n\t\turl : \"comps/summer-component-contacts/www/html/search.html\"\n\t});\n}", "function onSearchResponse(response) {\r\n showResponse(response);\r\n}", "function spotifySearch() {\n // console.log(\"This is the spotify search\");\n if(process.argv.length === 3){\n searchTerm = \"The Sign\";\n }\n spotify.search({\n type: \"track\",\n query: searchTerm,\n limit: 10,\n }, function(err,data) {\n if(err) {\n return console.log(\"Error occurred: \" + err);\n }\n for (var i = 0; i < data.tracks.items.length; i++) {\n \n console.log(`Artist: ${data.tracks.items[i].artists[0].name}\\nSong Name: ${data.tracks.items[i].name}\\nSpotify Preview Link: ${data.tracks.items[i].preview_url}\\nAlbum: ${data.tracks.items[i].album.name}\\n\\n`);\n }\n })\n trackInfo(action, searchTerm);\n }", "clickSearch() {\n this.set('loading', true);\n this.elasticSearch.setFilterString(\"\");\n this.elasticSearch.clearUserSearch();\n this.elasticSearch.queryUsers();\n }", "function searchAftrClick() {\n var searchTerm = $(\"#searchTerm\").val();\n\n if (searchTerm.length > 0) {\n sample();\n } else {\n // search string is of 0 length ... remove list of previous results\n $(\"#output\").html(\"<hr>\");\n }\n}", "search() {\n this.trigger('search', {\n element: this.searchBar,\n query: this.searchBar.value\n });\n }", "function handleSearchAttempt (e) {\n var _query;\n\n // If there's no index, exit immediately and re-initialise:\n if (typeof _links !== 'object' || !Array.isArray(_links) || !_links) { return init(); }\n\n // Prevent default submit behaviour\n typeof e !== 'undefined' && e.preventDefault();\n\n // Retrieve the search query from the input element\n _query = e.target.querySelector('input').value;\n\n // Suffice it to say that we should quit if there's no query\n if (typeof _query !== 'string' || !_query) { return; }\n\n displaySearchResults(_query, getSearchResults(_query, _links));\n return false;\n }", "function search(_event) {\r\n let inputName = document.getElementById(\"searchname\");\r\n let inputMatrikel = document.getElementById(\"searchmatrikel\");\r\n let query = \"command=search\";\r\n query += \"&nameSearch=\" + inputName.value;\r\n query += \"&matrikelSearch=\" + inputMatrikel.value;\r\n console.log(query);\r\n sendRequest(query, handleSearchResponse);\r\n }", "function submitSearch() {\n hitSelected = document.getElementsByClassName('aa-cursor')[0];\n\n if (hitSelected && searchQuery) {\n const articleUrl = hitSelected.querySelector('a').href;\n window.location.assign(articleUrl);\n } else if (!hitSelected && searchQuery && hits) {\n window.location.assign(`{{ site.url }}/search?query=${searchQuery}`);\n }\n }" ]
[ "0.7064954", "0.6880764", "0.66768646", "0.66062427", "0.6478713", "0.6472322", "0.64366", "0.6415114", "0.639487", "0.6392921", "0.6390435", "0.63857293", "0.63739496", "0.63557416", "0.6340277", "0.63195914", "0.62942517", "0.62883085", "0.6281115", "0.62702334", "0.62624305", "0.6255375", "0.62544984", "0.62429893", "0.6239467", "0.62392294", "0.619284", "0.61665046", "0.61600584", "0.6158129", "0.6156404", "0.6151842", "0.61476094", "0.6145246", "0.613872", "0.61216354", "0.61208576", "0.61180866", "0.61006224", "0.6098024", "0.6093922", "0.6082522", "0.60752267", "0.60673285", "0.60615414", "0.6060772", "0.6055384", "0.6052662", "0.60444844", "0.6038498", "0.6038299", "0.6038151", "0.6035747", "0.6028337", "0.60242444", "0.60099655", "0.6008803", "0.5989289", "0.59865063", "0.5980356", "0.5968544", "0.596184", "0.5957157", "0.59382993", "0.5936795", "0.59330404", "0.59324735", "0.5930042", "0.59278405", "0.59278405", "0.59278405", "0.59278405", "0.59217554", "0.59190595", "0.591219", "0.59112084", "0.5901878", "0.5898807", "0.5895897", "0.58931595", "0.58931595", "0.58931595", "0.58931595", "0.58929133", "0.5891414", "0.5891087", "0.5890081", "0.5889925", "0.5887666", "0.588734", "0.58832836", "0.5882606", "0.5879418", "0.5876633", "0.5870564", "0.5869889", "0.58684766", "0.58633786", "0.58535916", "0.58513904", "0.58486" ]
0.0
-1
fastForwardVideo moves video forward in time 15s
function fastForwardVideo() { var fastForward = player.getCurrentTime(); var add15Seconds = fastForward + 15; player.seekTo(add15Seconds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fastForward() {\n target = this.classList[1] - 1;\n\n shownMedia[target].currentTime += 5;\n\n // If fast forward exceeds video length, goes back to beginning of video and pauses\n if(shownMedia[target].currentTime >= shownMedia[target].duration) {\n shownMedia[target].pause();\n shownMedia[target].currentTime = 0;\n playPauseBtn[target].textContent = 'Play';\n }\n }", "function forwardVideo(increment) {\n player.currentTime += increment;\n}", "function forwardButtonTrigger() {\n if (window.currentVideoSelectedForPlayback) {\n setCurrentlyPlaying(false)\n const currentNode = window.currentVideoSelectedForPlayback\n const currentTime = currentNode.data.videoCore.currentTime\n const currentVideoEnd = currentNode.data.metadata.endTime\n\n if (currentTime + 1 < currentVideoEnd) {\n currentNode.data.videoCore.currentTime += 1\n } else if (currentNode.next) {\n const remainingTime = 1 - currentTime\n window.currentVideoSelectedForPlayback = currentNode.next\n const nextStartTime = window.currentVideoSelectedForPlayback.data.metadata.startTime\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = nextStartTime + remainingTime\n } else {\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = currentVideoEnd\n }\n renderUIAfterFrameChange(window.currentVideoSelectedForPlayback)\n }\n}", "function skipForward10Sec()\r\n\t{\r\n\t\tmyVideo.currentTime = myVideo.currentTime + 10; //the playback time increases by ten second\r\n\t}", "onFastForward(){\n var { player } = this.state;\n var intervalFunc = setInterval(function(){\n var currentTime = player.getCurrentTime();\n player.seekTo(currentTime + 5, true);\n }, 250);\n this.setState({\n goForward: intervalFunc\n })\n }", "function forward(seconds) {\n var operation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n action: 'forward-' + seconds,\n source: ''\n };\n\n this.video.forward(seconds);\n\n return {\n type: OPERATE,\n operation: operation\n };\n}", "function moveForward() {\n if (autoMove) {\n if (new Date() - time > 10) {\n // Update view matrix via the camera\n mat4.invert(camera, viewMat);\n mat4.translate(camera, camera, vec3.fromValues(0, 0, -.01));\n mat4.invert(viewMat, camera);\n\n time = Date.now();\n }\n // Refresh screen then keep running in a loop\n gl.uniformMatrix4fv(viewUnif, false, viewMat);\n drawScene();\n //window.requestAnimFrame(moveForward);\n }\n}", "function forward(seconds) {\n\t var operation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n\t action: 'forward-' + seconds,\n\t source: ''\n\t };\n\n\t this.video.forward(seconds);\n\n\t return {\n\t type: OPERATE,\n\t operation: operation\n\t };\n\t}", "function rewindVideo() {\n var fastForward = player.getCurrentTime();\n var minus15Seconds = fastForward - 15;\n player.seekTo(minus15Seconds);\n }", "function startPlayback() { \n setTimeout(moveForward, slideInterval);\n}", "function forwardStep(e) {\n setMedia();\n media.currentTime = media.currentTime + trjs.param.forwardskip;\n }", "function run_forward() {\n const motor_dur = 50;\n const motor_spd = -1000;\n \n ev3_runForTime(motorA, motor_dur, motor_spd);\n ev3_runForTime(motorB, motor_dur, motor_spd);\n ev3_pause(10);\n}", "function run_forward() {\n const motor_dur = 50;\n const motor_spd = -1000;\n \n ev3_runForTime(motorA, motor_dur, motor_spd);\n ev3_runForTime(motorB, motor_dur, motor_spd);\n ev3_pause(10);\n}", "function scrollPlay(){ \n var frameNumber = window.pageYOffset/playbackConst;\n vid.currentTime = frameNumber;\n window.requestAnimationFrame(scrollPlay);\n }", "fastForward() {\n this.frame = window.requestAnimationFrame(()=>this.immediate());\n }", "function playOneSegment(videoSrc, inPoint, outPoint) {\n video.src = videoSrc\n video.load\n video.currentTime = inPoint\n video.play()\n video.ontimeupdate = function () {\n stopAtOutPoint()\n }\n counter += 1\n }", "function forward(){\n if(curFrame <= frames.length-1)\n drawCurFrame();\n}", "function adelantar() {\n\n \n video.currentTime += 10;\n console.log(video.currentTime)\n}", "function rewindVideo(increment) {\n player.currentTime -= increment;\n}", "function skipBackward30Sec()\r\n\t{\r\n\t\tmyVideo.currentTime = myVideo.currentTime - 30; //the playback time decreases by 30 seconds\r\n\t}", "function nextFrame(){\n // Protecting upper bounds\n if (frame === 7781){\n console.log('End of Frames')\n return\n }\n setFrame(frame + 1)\n console.log('Next Frame')\n playerRef.current.seekTo(frame / 60)\n console.log(frame)\n console.log(frame / 60)\n }", "onVideoSeeked() {\n this.videoFrameReady = true;\n this.drawCurrentFrame();\n }", "function handleForward(){\n audio.currentTime += 3;\n if(audio.currentTime >= audio.duration || audio.paused){\n audio.pause();\n audio.currentTime = 0;\n player.innerHTML = hdlPlay\n }\n }", "function forward() {\n const currProgress = parseInt(progressInp.value, 10);\n const maxProgress = parseInt(progressInp.max, 10);\n\n if ((currProgress + 2000) < maxProgress) {\n progressInp.value = currProgress + 2000;\n } else {\n progressInp.value = maxProgress;\n }\n\n updateDuration();\n updateReplay();\n}", "function seek_video()\n {\n if (!(current in timecodes)) return;\n if (!video_elt.contentWindow) video_elt.currentTime = timecodes[current];\n else video_elt.contentWindow.postMessage([\"seek\", timecodes[current]], \"*\");\n }", "function runForward($el, $bgWidth, duration, frameRate, dir){\n\n var frameWidth = $el.width();\n var frameHeight = $el.height();\n var frameNum = $bgWidth/frameWidth;\n var rate = duration/frameRate;\n var countFrame = 0\n\n var backgroundPos = $el.css('backgroundPosition').split(\" \");\n var xPos = backgroundPos[0],\n yPos = backgroundPos[1];\n\n\n function runStrip() {\n\n setInterval(function() {\n\n if (dir == 'h'){\n if(countFrame<frameNum) {\n $el.css({backgroundPosition: -frameWidth*countFrame + \"px \"+yPos});\n }\n else if(countFrame==frameNum) {\n //run on complete\n }\n }\n\n\n else if (dir == 'v'){\n if(countFrame<frameNum) {\n $el.css({backgroundPosition: xPos+\" \"+ (-frameWidth*countFrame) + \"px\"});\n }\n else if(countFrame==frameNum) {\n //run on complete\n }\n }\n\n\n countFrame++;\n\n }, rate);\n\n }\n\n runStrip();\n}", "function retroceder() {\n\n video.currentTime -= 10;\n console.log(video.currentTime)\n}", "function fastForward() {\r\n if(window.HTMLAudioElement){\r\n try {\r\n var mySong = document.getElementById('music')\r\n mySong.currentTime += 30.0; \r\n }\r\n catch(e) {\r\n // Fail silently but show in F12 developer tools console\r\n if(window.console&&console.error(\"Error:\"+e));\r\n }\r\n }\r\n}", "goToFrame(frame) {\n this._video.onPlay();\n return this._video.gotoFrame(frame, true);\n }", "function nextFrame() {\n _timeController.proposeNextFrame();\n }", "advance() {\n if (this._forceNextFrame) {\n this.playheadPosition = this._forceNextFrame;\n this._forceNextFrame = null;\n } else if (this._playing) {\n this.playheadPosition++;\n\n if (this.playheadPosition > this.length) {\n this.playheadPosition = 1;\n }\n }\n }", "nextFrame() {\r\n\t\t\tif (this.frame < this.length - 1) this.frame = this.frame + 1;\r\n\t\t\telse if (this.looping) this.frame = 0;\r\n\r\n\t\t\tthis.targetFrame = -1;\r\n\t\t\tthis.playing = false;\r\n\t\t}", "run() {\n requestAnimationFrame(() => {\n this.runFrame();\n });\n\n this.output.video.run();\n\n this.running = true;\n this.paused = false;\n }", "function playNextVideo() {\n var index\n if (position === (ids.length-1) * (-62)) {\n position = 0\n imageHolder.style.left = String(position) + \"vw\"\n imageHolder.style.transition = \"left 0.5s ease\"\n index = position / (-62)\n videoTitle.textContent = ids[index][\"title\"]\n description.textContent = ids[index][\"info\"]\n } else if (position <= 0) {\n position = position - 62\n imageHolder.style.left = String(position) + \"vw\"\n imageHolder.style.transition =\"all 1s ease\"\n index = position / (-62)\n videoTitle.textContent = ids[index][\"title\"]\n description.textContent = ids[index][\"info\"]\n }\n}", "function drawFrame(frame) {\n\t\tvideo.currentTime = (frame.second > video.duration ? video.duration : frame.second);\n\t}", "function increaseSpeed() {\n\tvideo.playbackRate *= 1.25;\n\tconsole.log(\"Speed is \"+ video.playbackRate);\n}", "function trackVideoStart() {\n\n flushParams();\n correlateMediaPlaybackEvents();\n\n s.Media.open(videoFileName, videoStreamLength, omniturePlayerName());\n s.Media.play(videoFileName, 0, 0);\n }", "startPlayback() {\n setInterval(this.moveForward, this.slideInterval);\n }", "nextFrame() {\n\t\t\t\tif (this.frame < this.images.length - 1) this.frame = this.frame + 1;\n\t\t\t\telse if (this.looping) this.frame = 0;\n\n\t\t\t\tthis.targetFrame = -1;\n\t\t\t\tthis.playing = false;\n\t\t\t}", "function MediaGoForward()\r\n{\r\n MediaStop();\r\n\r\n if (WrapAtEnd)\r\n (iCurrentImage == (xMediaContent.length - 2)) ? iCurrentImage = 0 : iCurrentImage+=2;\r\n else\r\n (iCurrentImage == (xMediaContent.length - 2)) ? iCurrentImage = iCurrentImage : iCurrentImage+=2;\r\n\r\n document.MEDIAIMAGE.src = xMediaContent[iCurrentImage];\r\n}", "function nextFile(time) {\n // If already displaying the last one, do nothing.\n if (currentFileIndex === files.length - 1)\n return;\n\n // Don't pan a playing video!\n if (currentFrame.displayingVideo && !currentFrame.video.player.paused)\n currentFrame.video.pause();\n\n // Set a flag to ignore pan and zoom gestures during the transition.\n transitioning = true;\n setTimeout(function() { transitioning = false; }, time);\n\n // Set transitions for the visible frames\n var transition = 'transform ' + time + 'ms ease';\n currentFrame.container.style.transition = transition;\n nextFrame.container.style.transition = transition;\n\n // Cycle the three frames so next becomes current,\n // current becomes previous, and previous becomes next.\n var tmp = previousFrame;\n previousFrame = currentFrame;\n currentFrame = nextFrame;\n nextFrame = tmp;\n currentFileIndex++;\n\n // Move (transition) the frames to their new position\n resetFramesPosition();\n\n // Update the frame for the new next item\n setupFrameContent(currentFileIndex + 1, nextFrame);\n\n // When the transition is done, cleanup\n currentFrame.container.addEventListener('transitionend', function done(e) {\n this.removeEventListener('transitionend', done);\n\n // Reposition the item that just transitioned off the screen\n // to reset any zooming and panning\n previousFrame.reset();\n });\n\n // Disable the edit button if we're now viewing a video, and enable otherwise\n if (currentFrame.displayingVideo)\n $('fullscreen-edit-button').classList.add('disabled');\n else\n $('fullscreen-edit-button').classList.remove('disabled');\n}", "function setProgressForward() {\n isPlaying = \"paused\"\n // Firstly we will set idNextSong to true.\n playNextSong = true\n // If we hold the forward button for 1 sec, then this function will execute and it will increase the current time of mediany 30 sec else it will play the next song.\n setTimeout(function () {\n try {\n currentTimeAccurate += 30.0;\n media.currentTime += 30.0;\n document.getElementById(\"progress-bar\").style.width = `${(currentTimeAccurate / duration) * 100}%`;\n }\n catch (err) { }\n // Now as we don't have to play next song, then set playNextSong variable to false.\n playNextSong = false\n }, 1000)\n}", "function playx() {\n\t\t// compatibility.requestAnimationFrame(play);\n\t\tvar x = compatibility.requestAnimationFrame(playx); // play video streaming \n\t\tif (video.paused) { // play streaming video\n\t\t\tvideo.play();\n\t\t}\n\n\t\tif (video.readyState === video.HAVE_ENOUGH_DATA && video.videoWidth > 0) { // jika webcam berhasil mengcapture gambar real time user dan dimuat ke dala video \n\t\t// mirroring (flip horizontal)\n\t\t\t// video.style.cssText = \"-moz-transform: scale(-1, 1); \\\n\t\t\t// -webkit-transform: scale(-1, 1); -o-transform: scale(-1, 1); \\\n\t\t\t// transform: scale(-1, 1); filter: FlipH;\";\n\t\t// mirroring (flip vertical)\n\t\t\t// video.style.cssText = \"-moz-transform: scale(1, -1); \\\n\t\t\t// -webkit-transform: scale(1, -1); -o-transform: scale(1, -1); \\\n\t\t\t// transform: scale(1, -1); filter: FlipV;\";\n\n \t// Prepare the detector once the video dimensions are known:\n \tif (!detector) {\n\t\t\t\tvar width = ~~(60 * video.videoWidth / video.videoHeight);\n\t\t\t\tvar height = 60;\n\t \t\tdetector = new objectdetect.detector(width, height, 1.1, detectLib);\n\t \t\t// detector = new objectdetect.detector(1024, 720, 1.1, objectdetect.upperbody);\n\t \t}\n \t\t\n \t\t// Perform the actual detection:\n\t\t\tvar coords = detector.detect(video, 1); // objectdetect.js line 684\n\t\t\t// console.log(typeof (coords[0])); \t\t// object\n\t\t\t// console.log(coords[0]);\t\t \t\t\t// [45.09428000000002, 20.93663000000001, 32.210200000000015, 32.210200000000015, 1]\n \t\t\t\n \t\t\tif (coords[0]) {\n\t\t\t\tvar coord = coords[0];\n\t\t\t\tcoord = smoother.smooth(coord);\n\t\t\t\t// Rescale coordinates from detector to video coordinate space:\n\t\t\t\t\tcoord[0] *= video.videoWidth / detector.canvas.width;\t\t// x\n\t\t\t\t\tcoord[1] *= video.videoHeight / detector.canvas.height;\t\t// y\n\t\t\t\t\tcoord[2] *= video.videoWidth / detector.canvas.width;\t\t// width\n\t\t\t\t\tcoord[3] *= video.videoHeight / detector.canvas.height;\t// height\n\n\t\t\t\t\t\t// console.log('c[0]='+coord[0]);\n\t\t\t\t\t\t// console.log('l vid='+video.videoWidth);\n\t\t\t\t\t\t// console.log('l can='+detector.canvas.width);\n\n\t\t\t\t\t// Display shirt overlay: \n\t\t\t\t\t\t// shirt.style.left = ~~(coord[0] + coord[2] * 1.0/8 + video.offsetLeft) + 'px';\n\t\t\t\t\t\t// shirt.style.top = ~~(coord[1] + coord[3] * 0.8/8 + video.offsetTop) + 'px';\n\t\t\t\t\t\t// shirt.style.width = ~~(coord[2] * 6/8) + 'px';\n\t\t\t\t\t\t// shirt.style.height = ~~(coord[3] * 6/8) + 'px';\n\t\t\t\t\t\n\t\t\t\t\t//( original ) Display shirt overlay: \n\t\t\t\t\t// shirt.style.left = ~~(coord[0] + coord[2] * 1.0/8 + video.offsetLeft) + 'px';\n\t\t\t\t\t// shirt.style.top = ~~(coord[1] + coord[3] * 0.8/8 + video.offsetTop) + 'px';\n\t\t\t\t\t// shirt.style.width = ~~(coord[2] * 6/8) + 'px';\n\t\t\t\t\t// shirt.style.height = ~~(coord[3] * 6/8) + 'px';\n\t\t\t\t\t\n\t\t\t\t\t// edit 1\n\t\t\t\t\t\t// shirt.style.left = ~~(coord[0] + coord[2] * 1.0/8 + video.offsetLeft) + 'px';\n\t\t\t\t\t\t// shirt.style.top = ~~(coord[1] + coord[3] * 0.8/1.3 + video.offsetTop) + 'px';\n\t\t\t\t\t\t// shirt.style.width = ~~(coord[2] * 6.3/8) + 'px';\n\t\t\t\t\t\t// shirt.style.height = ~~(coord[3] * 8/8) + 'px';\n\n\t\t\t\t\t// edit 2\n\t\t\t\t\t\tshirt.style.left = ~~(coord[0] + coord[2] * 1.0/8 + video.offsetLeft) + 'px';\n\t\t\t\t\t\tshirt.style.top = ~~(coord[1] + coord[3] * 0.8/1.4 + video.offsetTop) + 'px';\n\t\t\t\t\t\tshirt.style.width = ~~(coord[2] * 6.3/8) + 'px';\n\t\t\t\t\t\tshirt.style.height = ~~(coord[3] * 8/8) + 'px';\n\t\t\t\t\t\t// shirt.style.height = ~~(coord[3] * 6.5/8) + 'px';\n\n\t\t\t\t\t\t// console.log('s left='+shirt.style.left);\n\t\t\t\t\t\t// console.log('s top='+shirt.style.top);\n\t\t\t\t\t\t// console.log('s width='+shirt.style.width);\n\t\t\t\t\t\t// console.log('s height='+shirt.style.height);\n\n\t\t\t\t\tshirt.style.opacity = 1;\n\t\t\t\t\tshirt.style.zIndex =2147483647;\n\n\t\t\t\t\tvar l1 = coord[0]; \n\t\t\t\t\tvar l2 = coord[2]; \n\t\t\t\t\tvar lebar =Math.abs(l2-l1); \n\t\t\t\t\t// alert('l1='+l1+' l2='+l2+' lebar='+lebar);\n\t\t\t\t\t\n\t\t\t\t\tvar t1 = coord[1]; \n\t\t\t\t\tvar t2 = coord[3]; \n\t\t\t\t\tvar tinggi =Math.abs(t2-t1); \n\t\t\t\t\t// alert('t1='+t1+' t2='+t2+' tinggi='+tinggi);\n\t\t\t\t\t\n\t\t\t\t$('#coord0Info').html(coord[0].toFixed(2));\n\t\t\t\t$('#coord1Info').html(coord[1].toFixed(2));\n\t\t\t\t\n\t\t\t\tvar w = coord[2].toFixed(2);\n\t\t\t\t// labelSize(w);\n\t\t\t\t// captureCollect(w);\n\t\t\t\tiCapture++;\n\t\t\t\tcalculation(w);\n\t\t\t} else { \n\t\t\t\t// var opacity = shirt.style.opacity - 0.2;\n\t\t\t\t// shirt.style.opacity = opacity > 0 ? opacity : 0;\n\t\t\t}\n\t\t}\n\t\tiPlayLoop++;\n\t\tsetInterval(loopLog,1000);\n\t}", "function startVideo() {\n\n // start video\n vid.play();\n // start tracking\n ctrack.start(vid);\n trackingStarted = true;\n // start loop to draw face\n// drawLoop();\t\n\tvar t2 = setTimeout(\"drawLoop()\",10000);\t\n setCommandValue(\"System is loading ...\");\n var t2 = setTimeout(\"setCommandValue('Round 1, ready? 😎')\",4000);\n var t2 = setTimeout(\"setCommandValue('Now, follow my order 😜')\",7000);\n var t2 = setTimeout(\"setCommandValue('Show your happy to endless work 😅')\",10000);\n var t9 = setTimeout(\" round1 = true\",10000);\n\n}", "function videoStarter() {\r\n\r\n\t$('#stream-boy').vide({\r\n\t\tmp4:'video/streamboy-clip.mp4',\r\n\t\togv:'video/streamboy-clip.ogv',\r\n\t\twebm:'video/streamboy-clip.webm',\r\n\t\tposter:'img/space-poster.jpg',\r\n\t\t}, {\r\n\t\tloop: true,\r\n\t\tmuted: true,\r\n\t\tautoplay: true,\r\n\t\tposterType: \"jpg\",\r\n\t\tclassName: \"stream-boy\"\r\n\t});\r\n\r\n\t$('#space-video').vide({\r\n\t\tmp4:'video/space-planet-with-reverse50.mp4',\r\n\t\togv:'video/space-planet-with-reverse50.ogv',\r\n\t\twebm:'video/space-planet-with-reverse50.webm',\r\n\t\tposter:'img/space-poster.jpg',\r\n\t\t}, {\r\n\t\tloop: true,\r\n\t\tmuted: true,\r\n\t\tautoplay: true,\r\n\t\tposterType: \"jpg\",\r\n\t\tclassName: \"space-video\"\r\n\t});\r\n\r\n\t// Get instance of the plugin\r\n\tvar spaceVideo = $('#space-video').data('vide');\r\n\tvar spaceVideoObject = spaceVideo.getVideoObject();\r\n\r\n\thud.mousemove(function( event ) {\r\n\r\n\t\tvar pageCoords = \"( \" + event.pageX + \", \" + event.pageY + \" )\";\r\n\t\tvar hudPosition = hud.position();\r\n\r\n\t\t// Find the position of the cursor inside the \"HUD\" relative to the width of the window\r\n\t\t// Divide by 4 and round up to get a clean percentage\r\n\t\tvar innerHudPosition = Math.round( ( event.pageX - hudPosition.left + 200 ) / 4 );\r\n\r\n\t\t//console.log(\"Camera Position: \" + innerHudPosition + \"%\");\r\n\t\t//console.log(\"Video Time: \" + spaceVideoObject.currentTime );\r\n\r\n\t\t// Set the video frame position relative to innerHudPosition\r\n\t\tspaceVideoObject.currentTime = innerHudPosition / 2;\r\n\t\tspaceVideoObject.pause();\r\n\r\n\t});\r\n\r\n\thud.mouseover(function() {\r\n\t\tspace.addClass(\"seeking-state\");\r\n\t});\r\n\r\n\thud.mouseout(function() {\r\n\t\t// setTimeout(function() { spaceVideoObject.play(); }, 1000);\r\n\t\tspaceVideoObject.play();\r\n\t\tspace.removeClass(\"seeking-state\");\r\n\t});\r\n}", "function startVideo() {\n console.log(\"Inside Start Video\");\n stream.getVideoTracks()[0].enabled = true;\n }", "moveForward() {\n this._currentLinearSpeed = this._linearSpeed;\n this._currentAngularSpeed = 0;\n }", "moveForward () {\n this.update(this.deltaIndex(1))\n }", "function moveForward() {\n\tif (currentMoveNum < totalMoves) {\n\t\tvar move = moveListLog[currentMoveNum];\n\t\tdoLogMove(move);\n\t\tcurrentMoveNum += 1;\n\t} else {\n\t\tpause = true;\n\t}\n}", "function setVideoProgress(){\n // return true;\n video.currentTime = (+progress.value * video.duration) / 100;\n}", "function doShowAdvLinkFast() \n {\n if($('#oc-link-advanced-player').is(':animated')) {\n $('#oc-link-advanced-player').stop();\n }\n $('#oc-link-advanced-player').css('marginLeft', '0px');\n }", "function playPrevVideo() {\n var index\n if (position < 0) {\n position = position + 62\n imageHolder.style.left = String(position) + \"vw\"\n imageHolder.style.transition =\"all 1s ease\"\n index = position / (-62)\n videoTitle.textContent = ids[index][\"title\"]\n description.textContent = ids[index][\"info\"]\n } else if (position === 0) {\n position = (ids.length-1) * (-62)\n imageHolder.style.left = String(position) + \"vw\"\n imageHolder.style.transition = \"left 0.5s ease\"\n index = position / (-62)\n videoTitle.textContent = ids[index][\"title\"]\n description.textContent = ids[index][\"info\"]\n }\n}", "function changeSpeed() {\n\tif($video[0].playbackRate === 1) {\n\t\t$video[0].playbackRate = 2;\n\t\t$fastFwd.text(\"2x Speed\");\n\t} else if ($video[0].playbackRate === 2) {\n\t\t$video[0].playbackRate = 1;\n\t\t$fastFwd.text(\"1x Speed\");\t\t\t\t\n\t}\n}", "function jwPlayer_video(dir_path, image, height, width) {\n jwplayer(\"myElement\").setup({\n file: dir_path,\n image: image,\n height: height + \"px\",\n width: width + \"px\",\n repeat: \"always\",\n aspectratio: \"16:9\"\n });\n\n\n var videoTag;\n var currentRate = 1;\n\n jwplayer().onReady(function() {\n \n if (jwplayer().getRenderingMode() == \"html5\") {\n\n videoTag = document.querySelector('video');\n\n if (videoTag.playbackRate) {\n \n jwplayer().addButton(\"../images/slow.png\", \"Slow Motion\",\n toggleSlomo, \"slomo\");\n jwplayer().addButton(\"../images/play.png\", \"Normal Motion\",\n toggleNormal, \"normal\");\n jwplayer().addButton(\"../images/fast.png\", \"Fast Motion\",\n toggleFast, \"fast\");\n }\n }\n });\n\n function toggleSlomo() {\n\n if (currentRate >= 1) {\n currentRate = 0.5\n }\n videoTag.playbackRate = currentRate;\n videoTag.defaultPlaybackRate = currentRate;\n \n if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {\n // alert(\"firefox\");\n jwplayer().seek(jwplayer().getPosition());\n }\n\n };\n\n function toggleNormal() {\n if (currentRate != 1) {\n currentRate = 1\n }\n videoTag.playbackRate = currentRate;\n videoTag.defaultPlaybackRate = currentRate;\n if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {\n jwplayer().seek(jwplayer().getPosition());\n }\n\n };\n\n function toggleFast() {\n if (currentRate <= 1) {\n currentRate = 2\n }\n videoTag.playbackRate = currentRate;\n videoTag.defaultPlaybackRate = currentRate;\n if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {\n jwplayer().seek(jwplayer().getPosition());\n }\n\n };\n}", "function reproductor(video0,video, video2,video3,video4,video6,video7,video8,video9,video10){\n\n\tvideo6.style.opacity = \"0\";\n\tvideo7.style.opacity = \"0\";\n\tvideo8.style.opacity = \"0\";\n\tvideo9.style.opacity = \"0\";\n\tvideo10.style.opacity = \"0\";\n\n\tvideo0.load();\n\tvideo.load();\n\tvideo2.load();\n\tvideo3.load();\n\tvideo4.load();\n\t\n\n\tvideo.addEventListener('loadeddata', function() {\n\t\tvideo0.currentTime = 0;\n\t\tvideo0.play();\n\n\t\tvideo.currentTime = 0;\n\t\tvideo.style.opacity = \"1\";\n\t\tvideo.play();\n\n\t\tvideo2.currentTime = 0;\n\t\tvideo2.style.opacity = \"1\";\n\t\tvideo2.play(); \n\n\t\t\n\t\tvideo3.currentTime = 0;\n\t\tvideo3.style.opacity = \"1\";\n\t\tvideo3.play();\n\n\t\n\t\tvideo4.currentTime = 0;\n\t\tvideo4.style.opacity = \"1\";\n\t\tvideo4.play();\t })\t\t\t\t\n\n\tvar i = 0;\n\tvar x = 0;\n\tvar y = 0;\n\tvar z = 0;\n\tvar v = 0;\n\tvar w = 0;\n\tvar times=0;\n\tvar cadena=0;\n\n\tvideo.onended = function() {\t\t\n\t\tif (i < times){\n\t\t\ti++;\n\t\t\tvideo.play(); \n\t\t}else{ \n\t\t\tvideo.style.opacity = \"0\";\n\t\t\tvideo2.style.opacity = \"0\";\n\t\t\tvideo3.style.opacity = \"0\";\n\t\t\tvideo4.style.opacity = \"0\";\n\n\t\t\t\n\t\t\tvideo6.load();\n\t\t\tvideo7.load();\n\t\n\t\t\tvideo6.currentTime = 0;\n\t\t\tvideo6.style.opacity = \"1\";\n\t\t\tvideo6.play()\n\n\t\t\tvideo7.currentTime = 0;\n\t\t\tvideo7.style.opacity = \"1\";\n\t\t\tvideo7.play()\n\t\n\t\t}\n\t};\n\tvideo7.onended = function() {\n\t\tvideo7.currentTime = 0;\n\t\tvideo6.currentTime = 0;\n\t\tvideo6.style.opacity = \"0\";\n\t\tvideo7.style.opacity = \"0\";\n\n\t\tvideo8.load();\t\n\t\tvideo8.currentTime = 0;\n\t\tvideo8.style.opacity = \"1\";\n\t\tvideo8.play()\n\n\t\t\t\n\t};\n\tvideo8.onended = function() {\n\t\tvideo8.currentTime = 0;\n\t\tvideo8.style.opacity = \"0\";\n\n\t\tvideo10.load();\t\n\t\tvideo10.currentTime = 0;\n\t\tvideo10.style.opacity = \"1\";\n\t\tvideo10.play()\t\n\t};\n\tvideo9.onended = function() {\n\t\tvideo9.currentTime = 0;\n\t\tvideo9.style.opacity = \"0\";\n\n\t\tvideo10.load();\t\n\t\tvideo10.currentTime = 0;\n\t\tvideo10.style.opacity = \"1\";\n\t\tvideo10.play()\t\t\n\t};\n\tvideo10.onended = function() {\n\t\tvideo10.currentTime = 0;\n\t\tvideo10.style.opacity = \"0\";\n\t};\n\n\tvideo.onerror = function() {\n\t\talert(\"Chrome blocks Shia on this page:( Try on another one!\");\n\t};\n}", "function drawVedio() {\n setTimeout(() => {\n canvas.getContext(\"2d\").drawImage(video, 0, 0, 100, 100);\n drawVedio();\n }, 0);\n }", "function setupPlayerwithKeyFrame(index) {\r\n\ttotalStartTime = performance.now();\r\n\tdownloadSegment(index, keyFrameUrl[index], function(data) {\r\n\t\tsetupPlayer(index);\r\n\t});\r\n}", "function startParade() {\n player.playVideo();\n // Lets the video start for a brief moment before the GIF cycling is called\n setTimeout(function(){\n imgCycle(0);\n $('#chyron h1').text(paradeTitle);\n $('#wrapper').removeClass('loading');\n },400);\n \n }", "function WeBack(theMode) {\n Mode = theMode;\n ModeCheck(Mode);\n\n areAnimated = [false, false, false, false];\n document.getElementById(\"nextVid\").style.display = \"none\";\n Learn_video.currentTime = 0;\n Learn_video.src = arrVideoList[0].name;\n Learn_video.play();\n console.log(arrVideoList[0].emotions);\n}", "nextFrame() {\n this.updateParticles();\n this.displayMeasurementTexts(this.stepNo);\n this.stepNo++;\n\n if (this.stepNo < this.history.length - 1) {\n // Set timeout only if playing\n if (this.playing) {\n this.currentTimeout = window.setTimeout(\n this.nextFrame.bind(this),\n this.animationStepDuration\n );\n }\n } else {\n this.finish();\n }\n }", "onRewind(){\n var { player } = this.state;\n var norm = this.returnToNorm;\n var intervalFunc = setInterval(function(){\n var currentTime = player.getCurrentTime();\n if(currentTime > 5) {\n player.seekTo(currentTime - 5, true);\n } else {\n player.seekTo(0, true);\n norm();\n }\n }, 250);\n this.setState({\n goForward: intervalFunc\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 updateVideoProgress() {\n // Set the current time of video based on position of slider\n video.currentTime = (progress.value * video.duration) / 100;\n}", "nextFrame( globalMsec ){\n //console.log('nextFrame: ', globalMsec);\n if( this.transportState != 'play' )\n return;\n\n //Check for tempo change\n //Using a flag is a workaround attempt to see if it fixes the issue\n // of stutter/pause when changing tempo on the fly. It doesn't.\n if( this.musicParams.beatDurChangeFlag ){\n //console.log('caugt beatDurChangeFlag');\n this.musicParams.beatDurChangeFlag = false;\n this.ChangeTempoOnTheFly( this.musicParams.beatDurChange );\n }\n\n //Get current music time\n this.currentMusicTimes = this.getMusicTimes( globalMsec );\n\n //Simple note player or Beat click - can we do this in a separate thread somehow?\n var playClick = this.doNotePlayer( globalMsec ) == false;\n this.doBeatClick( playClick );\n\n //Only update visuals with a minimum time diff. This should help smooth things out\n // I think since we won't have as much load on the system.\n //This should help with things like particles that may be emitted every frame, cuz\n // will keep them more evenly spaced in time.\n //Music input and playback stuff gets done at every update above, cuz we want\n // less latency with that, and it takes less horsepower anyway.\n //** NOTE** make sure this doesn't cause trouble with MX updates that happen\n // in translator.updateForFrame()\n this.updateCumDelta += globalMsec - this.updatePrevMsec;\n if( this.updateCumDelta >= this.updateMinDelta ){\n //Run through MX's & VX's and update - visualize!\n this.translator.updateForFrame( this.currentMusicTimes );\n this.updatePrevMsec = globalMsec;\n //Take away the min delta so if we keep getting in here on deltas just\n // under the threshold, the diff will accumlate and get us to trigger again\n // sooner.\n this.updateCumDelta -= this.updateMinDelta;\n }/*else \n console.log('skip translator update with delta, and cumDelta ', globalMsec - this.updatePrevMsec, this.updateCumDelta)*/\n }", "tick () {\n if (!this.enabled || !this.el.object3D || !this.video.srcObject) {\n return\n }\n\n this.el.sceneEl.camera.getWorldDirection(this.directionVector)\n\n if (this.lastCameraAngle >= this.angleRadians && this.directionVector.y < this.angleRadians) {\n this.debounceShowVideo()\n } else if (this.lastCameraAngle <= this.angleRadians && this.directionVector.y > this.angleRadians) {\n this.hideVideo()\n }\n\n this.lastCameraAngle = this.directionVector.y\n }", "seek(e){\n this.setState({sentinel : true});\n console.log(e.target.value, parseFloat(this.state.duration));\n this.state.video.currentTime = parseFloat(e.target.value)*parseFloat(this.state.duration);\n this.state.video2.currentTime = parseFloat(e.target.value)*parseFloat(this.state.duration);\n }", "async function forward() {\n delete this.currentFrame;\n const page = this.getPageHandle();\n await page.goForward();\n return null;\n}", "stepForward() {\n this.player_.volume(this.player_.volume() + 0.1);\n }", "onPreviousVideo() {\n const { controller } = this.props;\n if (typeof controller.rewindOrRequestPreviousVideo === 'function') {\n controller.rewindOrRequestPreviousVideo();\n }\n }", "function overVideoControl() {\n videoCtrlTl.reverse();\n }", "goForward() {\n const actualPosition = this.mower.position.clone();\n const nextPosition = this.getNextPositionForward(actualPosition);\n if(this.isNextPositionAllowed(nextPosition)) {\n this.updatePosition(nextPosition);\n }\n }", "requestFrame(next, resumed) {\n let now = Date.now();\n this.frame = {\n count: requestAnimationFrame(next),\n time: now,\n rate: resumed ? 0 : now - this.frame.time,\n scale: this.screen.scale * this.frame.rate * 0.01\n };\n }", "requestFrame(next, resumed) {\n let now = Date.now();\n this.frame = {\n count: requestAnimationFrame(next),\n time: now,\n rate: resumed ? 0 : now - this.frame.time,\n scale: this.screen.scale * this.frame.rate * 0.01\n };\n }", "updateCurrentTime(e) {\n e.preventDefault();\n // playHead / (100 / this.videoEle.duration) = this.videoEle.currentTime\n let targetTime = Number(e.target.value) / (100 / this.videoEle.duration);\n this.videoEle.currentTime = targetTime;\n this.updateProgress();\n }", "function forward() {\n topPos = img.offsetTop;\n img.style.top = topPos - 12 + 'px';\n}", "function nla_frame_to_video_frame(nla_frame, vtex) {\n var frame_delta = Math.round(nla_frame) - vtex.frame_start;\n if (vtex.use_cyclic) {\n frame_delta = frame_delta % vtex.frame_duration;\n if (frame_delta < 0)\n frame_delta += vtex.frame_duration;\n }\n return vtex.frame_offset + frame_delta;\n}", "function seekVideo(browser, currentTime){\n\tbrowser.execute(function(currentTime) {\n\t\t// get the video at a given point\n\t\tvar videoElement = arSession.arSource.domElement\n\t\tvideoElement.pause()\n\t\tvideoElement.currentTime = 4.0\n\t}, currentTime)\t\n}", "animate(){\n if (this.timeFromLast > this.animationTime){\n this.currentFrameNum++;\n this.currentFrameX += this.frameWidth;\n this.timeFromLast = 0;\n this.timeUntilLast = millis();\n }\n \n if (this.currentFrameNum > this.maxFrame){\n this.currentFrameNum = 3;\n this.currentFrameX = 22;\n }\n \n }", "function moveVideoFromGPS(video_index) {\n var major_time_milestone = 0;\n var previous_acted_milestone = -1;\n $(\"#\"+VIDEO[video_index].ElementID).on(\"timeupdate\", function(event){\n major_time_milestone = Math.floor(this.currentTime);\n if (major_time_milestone != previous_acted_milestone) {\n previous_acted_milestone = major_time_milestone;\n try {\n scene.traverse((node) => { \n if (node.uuid == VIDEO[video_index].UUID) {\n var new_position = new THREE.Vector3(\n VIDEO[video_index].PositionArray[major_time_milestone+1][0], \n VIDEO[video_index].PositionArray[major_time_milestone+1][3], \n VIDEO[video_index].PositionArray[major_time_milestone+1][1]);\n\n //node.position.x = new_position.x;\n //node.position.y = new_position.y;\n //node.position.z = new_position.z;\n\n //http://dotnetfollower.com/wordpress/2011/08/javascript-how-to-convert-latitude-and-longitude-to-mercator-coordinates/\n function LatLonToMercator(lat, lon) {\n var rMajor = 6378137;\n var shift = Math.PI * rMajor;\n var z = lon * shift / 180;\n var x = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);\n x = x * shift / 180;\n \n return {'Z': z, 'X': x};\n }\n\n var converted_coords = LatLonToMercator(new_position.x, new_position.z);\n\n var NEW_POSITION = new THREE.Vector3(converted_coords.X, new_position.y, converted_coords.Z);\n var tween = new TWEEN.Tween(node.position).to(NEW_POSITION, 1000).start();\n }\n });\n } catch { }\n }\n });\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}", "function playnext(){\n document.getElementById(\"vtc\").innerHTML = \"Overclock your CPU with BIOS\";\n video.autoplay=\"autoplay\"; //autopaly second video after video1 fingished \n video.src=\"video/p2.mp4\"; //play second video\n }", "_handleNewFrame(frame){\n\t\tif(this._vrDisplay){\n\t\t\tif (this._arCoreCameraRenderer) {\n\t\t\t\tthis._arCoreCameraRenderer.render()\n\t\t\t}\n\t\t\tthis._vrDisplay.getFrameData(this._vrFrameData)\n\t\t}\n\n\t\t// WebRTC video\n\t\tif (this._videoEl && this._sendVideoFrame && !this._videoFramesPaused) {\n\t\t\tthis._sendVideoFrame = false;\n\t\t\t\n\t\t\tvar canvasWidth = this._videoRenderWidth;\n\t\t\tvar canvasHeight = this._videoRenderHeight;\n\t\t\tthis._videoCtx.drawImage(this._videoEl, 0, 0, canvasWidth, canvasHeight);\n\t\t\tvar imageData = this._videoCtx.getImageData(0, 0, canvasWidth, canvasHeight);\n\n\t\t\tvar data = imageData.data\n\t\t\tvar len = imageData.data.length\n\t\t\t// imageData = new ArrayBuffer(len)\n\t\t\t// var buffData = new Uint8Array(imageData);\n\t\t\t// for (var i = 0; i < len; i++) buffData[i] = data[i] \n\t\t\t\n\t\t\tvar buffers = [\n\t\t\t\t{\n\t\t\t\t\tsize: {\n\t\t\t\t\t width: canvasWidth,\n\t\t\t\t\t height: canvasHeight,\n\t\t\t\t\t bytesPerRow: canvasWidth * 4,\n\t\t\t\t\t bytesPerPixel: 4\n\t\t\t\t\t},\n\t\t\t\t\tbuffer: imageData\n\t\t\t\t}];\n\n\t\t\tvar pixelFormat = XRVideoFrame.IMAGEFORMAT_RGBA32;\n\n\t\t\tvar timestamp = frame.timestamp; \n\t\t\t\n\t\t\t// set from frame\n\t\t\tvar view = frame.views[0];\n\n\t\t\t//this._videoViewMatrix.set(view.viewMatrix);\n\t\t\tMatrixMath.mat4_invert(this._videoViewMatrix, view.viewMatrix)\n\t\t\t\n\t\t\tthis._videoProjectionMatrix.set(view.projectionMatrix)\n\t\t\t\n\t\t\tvar camera = {\n\t\t\t\tarCamera: false,\n\t\t\t\tcameraOrientation: 0,\n\t\t\t\tcameraIntrinsics: this._cameraIntrinsics.slice(0),\n\t\t\t\t// cameraIntrinsics: [(this._videoEl.videoWidth/2) / Math.tan(view._fov.leftDegrees * Math.PI/180), 0, (this._videoEl.videoWidth/2), \n\t\t\t\t// \t\t\t\t\t0, (this._videoEl.videoHeight/2) / Math.tan(view._fov.upDegrees * Math.PI/180), (this._videoEl.videoHeight/2), \n\t\t\t\t// \t\t\t\t\t0, 0, 1],\n\t\t\t\tcameraImageResolution: {\n\t\t\t\t\t\twidth: this._videoEl.videoWidth,\n\t\t\t\t\t\theight: this._videoEl.videoHeight\n\t\t\t\t\t},\t\t\t\t \n\t\t\t\tviewMatrix: this._videoViewMatrix,\n\t\t\t\tprojectionMatrix: this._videoProjectionMatrix\n\t\t\t}\n\t\t\t//debugger;\n\n\t\t\tvar xrVideoFrame = new XRVideoFrame(buffers, pixelFormat, timestamp, camera )\n\n\t\t\ttry {\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent(\n\t\t\t\t\t\tReality.COMPUTER_VISION_DATA,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsource: this,\n\t\t\t\t\t\t\tdetail: xrVideoFrame\n\t\t\t\t\t\t}\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t} catch(e) {\n\t\t\t\tconsole.error('COMPUTER_VISION_DATA event error', e)\n\t\t\t}\n\t\t}\n\t\t// TODO update the anchor positions using ARCore or ARKit\n\t}", "function hoverVideo(e) { \n\t $('video', this).get(0).play(); \n $('video', this).removeClass('gris');\n // $('video', this).get(0).currentTime = 3;\n \n\n\t}", "function stepForward(){\n if(index === (playList.length - 1) ){\n index = 0\n }else{\n index++\n }\n box.innerHTML = `Track ${index + 1} - ${playList[index]}${ext}`;\n audio.src = dir + playList[index] + ext;\n audio.play()\n }", "play() {\n this.frame = window.requestAnimationFrame(()=>this.firstFrame());\n }", "function thumbNowPlaying() {\n var offset = $(curTarget).offset();\n if (thumbTimeout) {\n clearInterval(thumbTimeout);\n }\n $(video_thumb).css(offset);\n //console.log(\"Moving video to \" + offset);\n $(video_thumb).show();\n thumbTimeout = setInterval(thumbShotTrigger, (extractTime(segment_list[cur_segment].end) - extractTime(segment_list[cur_segment].begin)) * 1000);\n video_thumb.removeEventListener(\"playing\", thumbNowPlaying);\n }", "function update_frame(v_index){\r\n\r\n\tif(v_index == 1){\r\n\t\tvideoT.currentTime = document.getElementById(\"slidebar_T\").value/100* videoT.duration;\r\n\t}\r\n\telse if(v_index ==2){\r\n\t\tvideoGP.currentTime = document.getElementById(\"slidebar_GP\").value/100 *videoGP.duration;\r\n\t}\r\n\telse{\r\n\t\talert(\"Error update_frame() : video index invalid\");\r\n\t}\r\n\r\n\r\n}", "function playVideo(index, wrapper) {\n // toggle\n $$videos[index].classList.add('loaded')\n\n // activate the next video and start playing it\n wrapper.classList.add('active')\n $$videoControls[index].classList.add('playing')\n $$videos[index].play()\n\n $$videoControls[index].querySelector(\n '.progress-bar span'\n ).style.transitionDuration =\n Math.ceil($$videos[index].duration / playbackRate).toString() + 's'\n\n // set the currentIndex to be that of the current video's index\n currentIndex = index\n}", "function moveForwardAndBackward() {\n return new Promise (async (resolve) => {\n await moveForward(drone, 20, 3000);\n await pause(drone);\n await moveBackward(drone, 20, 3000);\n await pause(drone);\n resolve();\n });\n}", "handlePlayerFrame(){\n if(this.speedY < 0){\n this.frameY = 3\n }else{\n this.frameY = 0\n }\n if (this.frameX < 3){\n this.frameX++\n } else {\n this.frameX = 0\n }\n }", "function startVideoProgress(){\n var progressTime = document.getElementById('videoProgressTime');\n var currentVideoTime = player.getCurrentTime();\n var videoDuration = player.getDuration();\n progressTime.innerHTML = formatTime(currentVideoTime) + \" / \" + formatTime(videoDuration);\n updateProgressBar(currentVideoTime, videoDuration);\n videoProgress = setTimeout(function() {\n startVideoProgress();\n }, 1000);\n }", "function setVideoTime() {\r\n togglePlayPause();\r\n video.currentTime = (progress.value / 100) * video.duration;\r\n togglePlayPause();\r\n}", "function frame(){\t\n\tvar t_step = secondsPerAnimatingMillisecond * animationStep;\n\tif(elapsedVirtualTime == 0){ // half step approx\n\t\tt_step = t_step / 2;\n\t\taccel();\n\t\tvel(t_step);\n\t} else {\n\t\tpos(t_step);\n\t\taccel();\n\t\tvel(t_step);\n\t\tredrawCanvas();\n\t}\n\t\n\telapsedVirtualTime += t_step;\n}", "play () {\n if (!this.current) {\n this.start()\n }\n\n if (this.list[this.current.index].videoDuration === 0) {\n return this.next()\n }\n\n this.update()\n }", "onNextFrame(dt) {\n if (this.movingLeft) {\n this.x = this.x - (this.speed * dt)\n if (this.x < 0) {\n this.movingLeft = false\n }\n } else {\n this.x = this.x + (this.speed * dt)\n if (this.x >= (globals.CANVAS_WIDTH - this.width)) {\n this.movingLeft = true\n }\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 repeater(start, stop) {\r\n\tlet vid = document.getElementsByTagName('video');\r\n\tvar vid_curr = vid[0].currentTime;\r\n\tconsole.log()\r\n\tif(vid[0].currentTime >= stop)\r\n\t\tvid[0].currentTime = start;\r\n\telse if(vid[0].currentTime < start)\r\n\t\tvid[0].currentTime = start;\r\n}", "function startVideo($elm) {\n setTimeout(() => {\n var elm = $elm.find('video')[0];\n elm.play();\n }, 500);\n}", "function prevFrame(){\n // Protecting lower bounds\n if (frame === 1){\n console.log('No Previous Frame')\n return\n }\n setFrame(frame - 1)\n console.log('Previous Frame')\n playerRef.current.seekTo(frame / 60)\n console.log(frame)\n console.log(frame / 60)\n }", "function playVideo() {\n playVideoSegments(transcripts)\n}" ]
[ "0.77340055", "0.7658001", "0.6955349", "0.69523954", "0.68846303", "0.6644918", "0.66411155", "0.661723", "0.65360624", "0.6456723", "0.6333538", "0.6300024", "0.6300024", "0.62600034", "0.622176", "0.6207095", "0.6189372", "0.618286", "0.6170801", "0.60887", "0.6076027", "0.6035013", "0.6001117", "0.5988999", "0.59826845", "0.5982169", "0.5974545", "0.5946753", "0.5934535", "0.59284836", "0.59059733", "0.5898302", "0.5870398", "0.58662045", "0.58652174", "0.58489627", "0.58427507", "0.58218485", "0.5809463", "0.5809111", "0.5804991", "0.5783073", "0.57771623", "0.577396", "0.5763985", "0.5763766", "0.5759009", "0.57529986", "0.5740187", "0.57308894", "0.5719247", "0.5701978", "0.56995994", "0.56951797", "0.5693024", "0.5688803", "0.56878626", "0.5682616", "0.5682285", "0.56676775", "0.56637496", "0.5652717", "0.56289434", "0.5628145", "0.56191605", "0.5605117", "0.56042695", "0.559794", "0.55846167", "0.55815995", "0.5567305", "0.55660444", "0.55660444", "0.5563664", "0.55604523", "0.55584073", "0.55583525", "0.55582714", "0.554874", "0.5543703", "0.5539398", "0.5531632", "0.5530061", "0.5514657", "0.55132055", "0.5512222", "0.5486888", "0.54848546", "0.54791474", "0.5468916", "0.5468777", "0.5467252", "0.5463893", "0.5463079", "0.54614747", "0.54568976", "0.5452739", "0.54526466", "0.5449707", "0.5447666" ]
0.858113
0
playTYVideo pause and play functionality with tooltip and icon changes
function playYtVideo() { player.playVideo(); if (this.classList.value === playFaClass) { $('.playButton').tooltip('hide') $('.playButton').removeClass(playFaClass).toggleClass(pauseFaClass); $(this).attr('data-original-title','Pause') } else { $('.pauseButton').tooltip('hide'); $('.pauseButton').removeClass(pauseFaClass).toggleClass(playFaClass); $(this).attr('data-original-title','Play') player.pauseVideo() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function action_toggle_play() {\n if (video.paused) {\n video.play();\n change_icon('play'); \n } else {\n video.pause();\n change_icon('pause'); \n }\n delay = delay_value;\n}", "function playVideo() {\r\n video.play();\r\n play.innerHTML = '<i class=\"fas fa-pause fa-2x\"></i>';\r\n}", "function updateIcons() {\n // Check if video is paused or playing \n if (video.paused) {\n // if video is paused, show the play button \n play.innerHTML = '<i class=\"fa fa-play fa-2x\">'\n } else {\n // if video is playing, show the pause button\n play.innerHTML = '<i class=\"fa fa-pause fa-2x\">'\n }\n\n}", "function pauseVideo() {\r\n video.pause();\r\n play.innerHTML = '<i class=\"fas fa-play fa-2x\"></i>';\r\n}", "function play() {\n player.playVideo();\n launch_progress_timer();\n play_pause_button.setAttribute('title', 'Pause');\n play_pause_snap_button.toState(1);\n\n var is_hover_bottom_bar = el.querySelector('.mp-bottom-bar:hover');\n if (!is_hover_bottom_bar) {\n setTimeout(hideControls, 2000);\n }\n }", "function togglePlayVideo() {\n let icon = playbtn.querySelector('.video-ctrl-bt');\n if(video.paused) {\n videoduration = convertSecondsToMinutes(video.duration);\n overvideo.style.backgroundColor = 'transparent';\n video.play();\n playToPauseBtn(icon);\n videobtn.style.display = 'none';\n addVideoListeners();\n outVideoControl();\n videoPlaying = true;\n }\n else {\n video.pause();\n pauseToPlayBtn(icon);\n videobtn.style.display = 'block';\n removeVideoListeners();\n videoCtrlTl.reverse();\n videoPlaying = false;\n }\n }", "function togglePlay() {\n if (elements.video.paused) {\n elements.video.play();\n elements.playBtn.classList.replace('fa-play', 'fa-pause');\n elements.playBtn.setAttribute('title', 'Pause');\n } else {\n elements.video.pause();\n showPlayIcon();\n }\n}", "function play() {\n video.play();\n play_pause_button.setAttribute('title', 'Pause');\n play_pause_snap_button.toState(1);\n\n var is_hover_bottom_bar = el.querySelector('.mp-bottom-bar:hover');\n if (!is_hover_bottom_bar) {\n setTimeout(hideControls, 2000);\n }\n }", "function togglePlay() {\n if(isPlaying) {\n domVideo.pause();\n isPlaying = false;\n playButton.innerHTML = '<img src=\"video-plugin/video-img/play.png\" />';\n } else {\n domVideo.play();\n isPlaying = true;\n playButton.innerHTML = '<img src=\"video-plugin/video-img/pause.png\" />';\n }\n}", "function togglePlayPause() {\n if (video.paused || video.ended) {\n playpause.title = 'pause';\n playpause.innerHTML = '<img src=\"icons/pause-icon.png\">';\n playpause.className = 'pause';\n video.play();\n}\n else {\n playpause.title = 'play';\n playpause.innerHTML = '<img src=\"icons/play-icon.png\">';\n playpause.className = 'play';\n video.pause();\n }\n}", "function hoverVideo(e) { \n\t $('video', this).get(0).play(); \n $('video', this).removeClass('gris');\n // $('video', this).get(0).currentTime = 3;\n \n\n\t}", "function togglePlay() {\n var theSVG = this.firstElementChild;\n poster.classList.add('hide');\n videoControls.classList.remove('invisible');\n vidPlayer.classList.remove('hide');\n\n if (vidPlayer.paused) {\n theSVG.dataset.icon = \"pause-circle\";\n vidPlayer.play();\n } else {\n theSVG.dataset.icon = \"play-circle\";\n vidPlayer.pause();\n }\n }", "$mediaplayerPlay() {\n // console.log('mediaplayerPlay');\n this.tag('Stop').patch({\n visible: false\n }, false);\n this.tag('Play').patch({\n visible: false \n }, false);\n \n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"<i class='fas fa-pause'></i>\";\n } else {\n video.pause();\n btn.innerHTML = \"<i class='fas fa-play'></i>\";\n }\n}", "function playPauseFun() {\t\t//Play and Pause button functionality...\n\tif (myVideoVar.paused) {\n\t\tmyVideoVar.play();\n\t\tupdatemyStreamBarVar = setInterval(streamingFun, 10);\t\t//Calls streamingFun function every 10ms...\n\t\tmyPlayButtonVar.className = \"fa fa-pause fa-3x\";\t//Changes play icon to pause icon...\n\t\tmyStatusVar.innerHTML = \"Playing ...\";\n\t} else {\n\t\tmyVideoVar.pause();\n\t\twindow.clearInterval(updatemyStreamBarVar);\t\t//Stops running 'streamingFun' when paused... this line of code can be omitted...\n\t\tmyPlayButtonVar.className = \"fa fa-play fa-3x\";\t\t//Changes pause icon to play icon...\n\t\tmyStatusVar.innerHTML = \"Paused ...\";\n\t}\n}", "function playVideo() { \n\tif($video[0].paused) {\n\t\t$video[0].play();\n\t\t$playButton.find(\"img\").attr(\"src\", \"icons/pause-icon.png\"); \n\t\t$buttonControls.hide();\n\t\t$videoControls.css(\"margin-top\", \"5%\");\t \t\n\t} else {\n\t\t$video[0].pause();\n\t\t$playButton.find(\"img\").attr(\"src\", \"icons/play-icon.png\");\t\t\t\n\t}\t\t\n}", "playPause() {\n let video = document.getElementById('video');\n\n if (video) { \n if (video.ended) {\n this.setState({play_icon: \"replay\"})\n } else if (video.paused) {\n this.setState({ play_icon: \"play_arrow\" })\n } else {\n this.setState({ play_icon: \"pause\" })\n }\n }\n }", "playCallback(e) {\n if (this.isCurrentTrack()) {\n this.setBigPlay()\n } else {\n this.bigPlayLoaded = false\n Rails.fire(this.loadTrackTarget, 'click')\n }\n this.registeredListen = false\n this.playTarget.classList.replace('play_button', 'pause_button')\n this.playTarget.firstElementChild.setAttribute('data-icon', 'pause')\n }", "swapPlayPause() {\n let video = document.getElementById('video');\n if (video.paused || video.ended) {\n video.play()\n this.setState({ play_icon: \"pause\" })\n // this.playPause()\n } else {\n video.pause()\n this.setState({ play_icon: \"play_arrow\" })\n // this.playPause()\n }\n }", "function pauseTrack() {\n curr_track.pause();\n isPlaying = false;\n\n // Replace icon with the play icon \n playpause_btn.innerHTML = '<i class=\"fa fa-play-circle fa-5x\"></i>';\n}", "function updateIcon() {\n\tconst ctrl = document.querySelector('.player__button[title=\"Toggle Play\"]');\n\tif(video_application.paused) {\n\t\tctrl.textContent = '>';\n\t}\n\telse {\n\t\tctrl.textContent = '||';\n\t}\n}", "function togglePlay() {\n // if (selectors.video.paused) {\n // selectors.video.play();\n // } else {\n // selectors.video.pause();\n // }\n\n const method = selectors.video.paused ? \"play\" : \"pause\";\n selectors.video[method]();\n}", "function playTrack() {\n curr_track.play();\n isPlaying = true;\n \n // To replace icon with pause icon\n playpause_btn.innerHTML = '<i class=\"fa fa-pause-circle fa-5x\"></i>';\n}", "function clickPlayPauseList() {\n // Update status of other btn's (If pause icons replace by play icons)\n var btnPauseStatus = document.querySelectorAll(\".mdi-pause-circle-outline\");\n btnPauseStatus.forEach(element => {\n element.classList.remove(\"mdi-pause-circle-outline\");\n element.classList.add(\"mdi-play-circle-outline\");\n })\n\n last_url = this.getAttribute(\"url\");\n // Si player en pause alors lire\n if (player.paused) {\n if (last_url !== url) {\n url = last_url;\n change(last_url);\n }\n player.play();\n lastbtn = this;\n btnPlayPause.setAttribute(\"value\", \"Pause\");\n playPause_Icons(this, false);\n }\n else // Si player en lecture alors pause\n {\n // Compare l'url du bouton et celui en cours dans le lecteur (Si pas les mêmes changer l'url du lecteur par la nouvelle reçu puis relancer automatiquement la lecture)\n if (last_url !== url) {\n url = last_url;\n change(last_url);\n player.play();\n lastbtn = this;\n btnPlayPause.setAttribute(\"value\", \"Pause\");\n playPause_Icons(this, false);\n }\n else {\n player.pause();\n btnPlayPause.setAttribute(\"value\", \"Play\");\n playPause_Icons(this, true);\n }\n }\n}", "function video_play(i){\n\ttrack_index = i ;\n\tlive_video = i ;\n\tif (!videoPause) {\n\t\tvideo_stop();\n\t \tgetFlashObject().SetVariable(\"method:setUrl\", flvArray[i]);\n \t}\n\tgetFlashObject().SetVariable(\"method:play\", \"\");\n\tvideoPause = false ; \n\tjQuery(\".playliste li:eq(\"+i+\")\").addClass(\"play_on\");\n}", "function togglePlay() {\n const method = video.paused ? 'play' : 'pause' ;\n video[method]();\n}", "function togglePlay() {\n video[video.paused ? 'play' : 'pause']();\n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Stop video\";\n } else {\n video.pause();\n btn.innerHTML = \"Watch video\";\n }\n}", "function toggle_play_pause(ev)\n {\n ev.preventDefault();\n if (video_elt.paused || video_elt.ended) play_video(); else pause_video();\n }", "function togglePlayVideo()\r\n\t{\r\n\t\t //if statement; outcome differs depending on conditions\r\n\t\tif ( myVideo.paused === true ) //video is paused\r\n\t\t{\r\n\t\t\tmyVideo.play(); //the DOM play method plays the video, when clicked\r\n\t\t\tplayButton.innerHTML = \"&#9616;&#9616;\"; //updates inside HTML button selector: turns into a pause icon made from two same Unicode characters\r\n\t\t\tisPaused = false; //boolean variable is assigned to false\r\n\t\t}\r\n\t\telse //if the video is playing\r\n\t\t{\r\n\t\t\tmyVideo.pause(); //the DOM pause method pauses the video, when clicked\r\n\t\t\tplayButton.innerHTML = \"&#9658;\" ; //updates inside HTML button selector when clicked: turns into a right-pointing pointer made from single Unicode character\r\n\t\t\tisPaused = true; //boolean variable is assigned to true\r\n\t\t} //ends if statement\r\n\t} //ends function \"togglePlayVideo\"", "function togglePlay() {\n\t// Selecting the right method\n\tconst method = video.paused ? 'play' : 'pause';\n\t// Calling the finction\n\tvideo[method]();\n}", "function myFunction() {\r\nif (video.paused) {\r\n video.play();\r\n btn.innerHTML = \"Pause\";\r\n} else {\r\n video.pause();\r\n btn.innerHTML = \"Play\";\r\n}\r\n}", "function videoPlayer() {\n if ($(\".playerVideo\").length>0) { //If there are video backgrounds\n $(\".playerVideo\").mb_YTPlayer();\n jQuery('.playerVideo').on(\"YTPPause\",function(){\n jQuery('.play-video').removeClass('playing');\n });\n jQuery('.playerVideo').on(\"YTPPlay\",function(){\n jQuery('.play-video').addClass('playing');\n });\n jQuery('.play-video').on('click', function(e) {\n if (jQuery('.play-video').hasClass('playing')) {\n jQuery(\".playerVideo\").pauseYTP();\n } else {\n jQuery('audio').each(function (i,e) {\n this.pause();\n });\n jQuery(\".playerVideo\").playYTP();\n }\n e.preventDefault();\n });\n };\n}", "function togglePlay() {\r\n\tif (miguel.paused){\r\n\t\ttoggleIcon();\r\n\t\treturn miguel.play();\r\n\t} else {\r\n\t\ttoggleIcon();\r\n\t\treturn miguel.pause();\r\n\t}\r\n}", "function togglePlay() {\n const method = video.paused ? 'play' : 'pause';\n video[method]();\n}", "function play(that) {\n\t\tvar video = that.find('video').get(0),\n\t\t\tcontroller;\n\t\tif (that.settings.controlPosition) {\n\t\t\tcontroller = $(that.settings.controlPosition).find('.ui-video-background-play a');\n\t\t} else {\n\t\t\tcontroller = that.find('.ui-video-background-play a');\n\t\t}\n\t\tif (video.paused) {\n\t\t\tvideo.play();\n\t\t\tcontroller.toggleClass('ui-icon-pause ui-icon-play').text(that.settings.controlText[1]);\n\t\t} else {\n\t\t\tif (video.ended) {\n\t\t\t\tvideo.play();\n\t\t\t\tcontroller.toggleClass('ui-icon-pause ui-icon-play').text(that.settings.controlText[1]);\n\t\t\t} else {\n\t\t\t\tvideo.pause();\n\t\t\t\tcontroller.toggleClass('ui-icon-pause ui-icon-play').text(that.settings.controlText[0]);\n\t\t\t}\n\t\t}\n\t}", "function playVideo() { \n\t\t$(\"#index-vid-a\").removeClass(\"hidden\"); \n\t \t$(\"#vid-pic\").css('display', 'none');\n\t \t$(\"#index-vid-b\").css('display', 'none');\n\t \tvar vid = $(\"#index-vid-a\");\n\t vid.controls = false;\n\t vid.load();\n\t vid.on('ended',function(){\n\t \t$(vid).css('display', 'none');\n\t\t\t$(\"#index-vid-b\").css('display', 'inline-block');\n\t\t\tvar vidb = $(\"#index-vid-b\");\n\t\t\tvidb.controls = false;\n\t \tvidb.load();\n\t \tvidb.on('ended',function(){ \n\t \t\t\t$(vidb).css('display', 'none');\n\t\t\t\t$(\"#vid-pic\").css('display', 'inline-block');\n\t\t\t});\n\t}); \n\n\t}", "function piloteVideo() {\r\n\t\tif (roi.paused) {\r\n\t\t\troi.play();\r\n \r\n\t\t} else {\r\n\t\t\troi.pause();}\r\n }", "toggle () {\n if (this.video.paused) {\n this.play();\n }\n else {\n this.pause();\n }\n }", "play() {\n this.player.play();\n this.shadowRoot.querySelector(\"#play\").className = \"playerClicked\";\n this.shadowRoot.querySelector(\"#pause\").className = \"\";\n }", "function outVideoControl() {\n videoCtrlTl.play();\n }", "function myFunction() {\r\n if (video.paused) {\r\n video.play();\r\n btn.innerHTML = \"Pause\";\r\n } else {\r\n video.pause();\r\n btn.innerHTML = \"Play\";\r\n }\r\n}", "function togglePlay(){\n console.log(\"working? togglePlay fn\")\n const method = video.paused ? 'play' : 'pause';\n video[method]();\n}", "function togglePlay() {\n video.paused ? video.play() : video.pause();\n}", "function video_play(to_id){\n\tvar cur = document.getElementsByClassName('visible')[0];\n\tvar cur_id= cur.getAttribute('id');\n\tvar nxt = document.getElementById(to_id);\n\t\n\tconsole.log(cur_id +' this is cur within video_swap');\n\tconsole.log(to_id+' play this');\n\tconsole.log(cur_id+' now stopped ');\n\t\n\tif (cur_id != to_id){\n\t\tnxt.classList.remove('hidden'); \n\t\tnxt.classList.add('visible');\n\t\tif (!nxt.hasAttribute('playnext')){\n\t\t\tnxt.setAttribute(\"loop\",\"true\");\n\t\t}\n\n\t\tcur.classList.add('hidden');\n\t\tcur.classList.remove('visible'); // for use with selectors\n\t\tcur.load(); // reset to timecount 0\n\t\tif (cur.hasAttribute(\"loop\"))\n\t\t\t{cur.removeAttribute(\"loop\");}\t\t\n\n\t\tif(nxt.nodeName=='VIDEO'){\n\t\t\tnxt.play();\n\t\t\tliveTrace();\n\t\t}\n\t\tif(cur.nodeName=='VIDEO'){\n\t\t\tcur.pause();\n\t\t}\n\t}\t\n}", "function updateButton() {\n // My solution\n // if (!video.paused) {\n // toggle.textContent = \"││\";\n // } else {\n // toggle.textContent = \"►\";\n // }\n\n // Wes's solution\n const icon = this.paused ? \"►\" : \"││\"; // `this` used instead of `video`\n toggle.textContent = icon;\n}", "function playmovie(){\r\n\tparent.cpCmndResume = true;\r\n\texportRoot.runTime_mc.pbcPause_mc.visible = true;\r\n\texportRoot.runTime_mc.pbcPlay_mc.visible = false;\r\n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function initVideo() {\n var $video = $(\"#myVideo\");\n\n var $btn = $(\"#myBtn\");\n // debugger;\n if ($video[0].paused) {\n $video[0].play();\n $btn.html(\"Pause\");\n } else {\n $video[0].pause();\n $btn.html(\"Play\");\n }\n }", "function videoPlay($wrapper) {\n var $iframe = $wrapper.find('.js-videoIframe');\n var src = $iframe.data('src');\n // hide poster\n $wrapper.addClass('videoWrapperActive');\n // add iframe src in, starting the video\n $iframe.attr('src',src);\n }", "function media_controller(ytplayer_name,tag) {\r\n // === Canvas Button ===\r\n function drawStopButton(ctx,color) {\r\n ctx.clearRect(0,0,28,26); ctx.fillStyle=color;\r\n ctx.fillRect( 8, 7,12,13);\r\n }\r\n function drawStepBackButton(ctx,color) {\r\n ctx.clearRect(0,0,28,26); ctx.fillStyle=color;\r\n ctx.fillRect(20, 7.9, 3,11.3);\r\n ctx.beginPath(); ctx.moveTo(18, 8); ctx.lineTo(17, 8); ctx.lineTo( 6,14); ctx.lineTo(17,19); ctx.lineTo(18,19); ctx.lineTo(18, 8);\r\n ctx.fill(); \r\n }\r\n function drawFrameButton(ctx,color) {\r\n ctx.clearRect(0,0,28,26); ctx.fillStyle=color;\r\n ctx.fillRect( 5, 7.9, 3,11.3);\r\n ctx.beginPath(); ctx.moveTo(10, 8); ctx.lineTo(11, 8); ctx.lineTo(22,14); ctx.lineTo(11,19); ctx.lineTo(10,19); ctx.moveTo(10, 8);\r\n ctx.fill(); \r\n }\r\n function drawPlayButton(ctx,color) {\r\n ctx.clearRect(0,0,28,26); ctx.fillStyle=color;\r\n ctx.beginPath(); ctx.moveTo( 6, 7); ctx.lineTo(21,14); ctx.lineTo( 6,20); ctx.lineTo( 6, 7);\r\n ctx.fill(); \r\n }\r\n function drawPauseButton(ctx,color) {\r\n ctx.clearRect(0,0,28,26); ctx.fillStyle=color;\r\n ctx.fillRect( 8, 6, 4,15);\r\n ctx.fillRect(16, 6, 4,15);\r\n }\r\n function drawMemoButton(ctx,color) {\r\n ctx.clearRect(0,0,28,26); ctx.fillStyle=color;\r\n ctx.fillRect ( 6, 5, 7, 3);\r\n ctx.fillRect ( 6, 5, 3,14);\r\n ctx.clearRect( 7, 6, 5, 1);\r\n ctx.clearRect( 7, 6, 1,12);\r\n }\r\n function drawLoopButton(ctx,color) {\r\n ctx.clearRect(0,0,35,26); ctx.fillStyle=color;\r\n ctx.beginPath();\r\n ctx.arc(25,15 ,5.9,Math.PI/2,-Math.PI/2,true);\r\n ctx.arc(25,14.6,4 ,-Math.PI/2,Math.PI/2,false);\r\n ctx.fill();\r\n ctx.fillRect(13,19,12,2.2);\r\n ctx.beginPath();\r\n ctx.arc(13,14.2,4.5,-Math.PI/2,Math.PI/2,true);\r\n ctx.arc(13,14.4,6.5,Math.PI/2,-Math.PI/2,false);\r\n ctx.fill();\r\n ctx.fillRect(9,9,2,3);\r\n ctx.fillRect(11,9,3,2);\r\n ctx.fillRect(12,7.4,6,3);\r\n ctx.beginPath(); ctx.moveTo(11, 4); ctx.lineTo(14, 4); ctx.lineTo(21, 9); ctx.lineTo(14,14); ctx.lineTo(11,14); ctx.lineTo(18, 9); ctx.lineTo(11, 4);\r\n ctx.fill();\r\n }\r\n function drawRewindButton(ctx,color) {\r\n ctx.clearRect(0,0,28,26); ctx.fillStyle=color;\r\n ctx.fillRect(8, 7, 1.2,13.5);\r\n ctx.beginPath(); ctx.moveTo(21, 7); ctx.lineTo( 8,14); ctx.lineTo(21,20); ctx.lineTo(21, 7);\r\n ctx.fill(); \r\n }\r\n function drawLimitButton(ctx,color) {\r\n ctx.clearRect(0,0,28,26); ctx.fillStyle=color;\r\n ctx.fillRect (15,18, 7, 3);\r\n ctx.fillRect (19, 6, 3,14);\r\n ctx.clearRect(16,19, 5, 1);\r\n ctx.clearRect(20, 7, 1,12);\r\n }\r\n function drawFreezeButton(ctx,color) {\r\n ctx.clearRect(0,0,28,26); ctx.fillStyle=color;\r\n switch (getValue('CUSTOM_FREEZE_BUTTON')) {\r\n case 0: default: // Original\r\n ctx.fillRect(11, 6, 2, 3); ctx.fillRect(15, 6, 2, 3); // Eyes\r\n ctx.fillRect(13,10, 2, 1); // Nose\r\n ctx.fillRect(13, 2, 2, 1); ctx.fillRect(10, 3, 3, 1); ctx.fillRect(15, 3, 3, 1); ctx.fillRect( 9, 4, 1, 2); ctx.fillRect(18, 4, 1, 2); ctx.fillRect( 8, 6, 1, 2); ctx.fillRect(19, 6, 1, 2); ctx.fillRect( 9, 8, 1, 3); ctx.fillRect(18, 8, 1, 3); ctx.fillRect(10,10, 1, 2); ctx.fillRect(17,10, 1, 2); ctx.fillRect(11,12, 2, 1); ctx.fillRect(15,12, 2, 1); ctx.fillRect(11,13, 6, 1); ctx.fillRect(11,14, 1, 1); ctx.fillRect(16,14, 1, 1); // Head\r\n ctx.fillRect( 5,13, 2, 1); ctx.fillRect(21,13, 2, 1); ctx.fillRect( 5,14, 1, 1); ctx.fillRect( 7,14, 2, 1); ctx.fillRect(19,14, 2, 1); ctx.fillRect(22,14, 1, 1); ctx.fillRect( 4,15, 1, 1); ctx.fillRect( 9,15,10, 1); ctx.fillRect(23,15, 1, 1); ctx.fillRect( 5,16, 5, 1); ctx.fillRect(13,16, 3, 1); ctx.fillRect(19,16, 5, 1); ctx.fillRect(10,17, 2, 1); ctx.fillRect(15,17, 4, 1); ctx.fillRect( 9,18, 2, 1); ctx.fillRect(12,18, 3, 1); ctx.fillRect(18,18, 1, 1); ctx.fillRect( 4,19, 5, 1); ctx.fillRect(11,19, 2, 1); ctx.fillRect(15,19, 2, 1); ctx.fillRect(19,19, 5, 1); ctx.fillRect( 4,20, 1, 2); ctx.fillRect( 8,20, 3, 1); ctx.fillRect(17,20, 3, 1); ctx.fillRect(23,20, 1, 1); ctx.fillRect( 6,21, 2, 1); ctx.fillRect(20,21, 3, 1); ctx.fillRect( 5,22, 1, 1); // Bones\r\n break;\r\n case 1: // Eject Button\r\n ctx.fillRect( 7, 17,14,5);\r\n ctx.beginPath(); ctx.moveTo(14, 5); ctx.lineTo( 7,15); ctx.lineTo(21.5,15); ctx.lineTo(14.5, 5);\r\n ctx.fill(); \r\n break;\r\n }\r\n }\r\n function drawEULinkButton(ctx,color,line) {\r\n ctx.clearRect(0,0,34,26); ctx.fillStyle=color;\r\n ctx.fillRect (12, 8, 9, 9);\r\n ctx.fillRect (13, 9, 9, 9);\r\n ctx.clearRect(13, 9, 7, 7);\r\n if(line) { ctx.fillRect(10,22,14,1.2); }\r\n }\r\n function drawFSLinkButton(ctx,color,line) {\r\n ctx.clearRect(0,0,56,26); ctx.fillStyle=color;\r\n ctx.beginPath();\r\n ctx.arc(14,12,3,Math.PI*70/180,-Math.PI*70/180,true);\r\n ctx.arc(14,12,2,-Math.PI*60/180,Math.PI*60/180,false);\r\n ctx.fill();\r\n ctx.beginPath(); ctx.moveTo(20, 7); ctx.lineTo(10,12); ctx.lineTo(20,17); ctx.lineTo(18,17); ctx.lineTo(8,12); ctx.lineTo(18, 7); ctx.lineTo(20, 7);\r\n ctx.fill();\r\n ctx.fillRect (35, 8, 9, 9);\r\n ctx.fillRect (36, 9, 9, 9);\r\n ctx.clearRect(36, 9, 7, 7);\r\n if(line) { ctx.fillRect(7,22,41,1.2); }\r\n }\r\n function drawThumb(ctx) {\r\n ctx.fillRect(27, 3, 6, 3);\r\n ctx.fillRect(27, 7, 6, 3);\r\n ctx.fillRect(27,11, 6, 3);\r\n ctx.fillRect(27,15, 6, 3);\r\n ctx.fillRect(27,19, 6, 3);\r\n }\r\n function draw4DIV3Button(ctx,color) {\r\n ctx.clearRect(0,0,38,26); ctx.fillStyle=color;\r\n ctx.globalAlpha=0.6;\r\n drawThumb(ctx);\r\n ctx.fillRect( 5,19,21, 3);\r\n ctx.globalAlpha=1;\r\n ctx.fillRect( 5, 3,21,15);\r\n ctx.beginPath(); ctx.moveTo(13, 7); ctx.lineTo(17.5,10); ctx.lineTo(13,13); ctx.moveTo(13, 7);\r\n ctx.globalCompositeOperation = 'destination-out'; ctx.fill(); ctx.globalCompositeOperation = 'source-over';\r\n }\r\n function drawWIDEButton(ctx,color) {\r\n ctx.clearRect(0,0,38,26); ctx.fillStyle=color;\r\n ctx.globalAlpha=0.6;\r\n drawThumb(ctx);\r\n ctx.fillRect( 5,15,21, 7);\r\n ctx.globalAlpha=1;\r\n ctx.fillRect( 5, 3,21,11);\r\n ctx.beginPath(); ctx.moveTo(13, 5); ctx.lineTo(17.5, 8); ctx.lineTo(13,11); ctx.moveTo(13, 5);\r\n ctx.globalCompositeOperation = 'destination-out'; ctx.fill(); ctx.globalCompositeOperation = 'source-over';\r\n }\r\n function drawBARButton(ctx,color) {\r\n ctx.clearRect(0,0,38,26); ctx.fillStyle=color;\r\n ctx.globalAlpha=0.6;\r\n drawThumb(ctx);\r\n ctx.fillRect( 5,15,21, 7);\r\n ctx.globalAlpha=1;\r\n ctx.fillRect( 5, 3,21, 3);\r\n }\r\n\r\n var ytplayer = $(ytplayer_name);\r\n if(!ytplayer) { show_alert('Media Controller Disabled: \"'+ytplayer_name+'\" not found'); return; }\r\n if(ytplayer.getAttribute('mc_embedtype')) { show_debug('Trying to rebind Media Controller to \"'+ytplayer_name+'\" (dropped)'); return; }\r\n else { show_debug('Binding Media Controller to \"'+ytplayer_name+'\" (Success)'); }\r\n ytplayer.setAttribute('mc_embedtype',tag);\r\n show_debug('Bind MC '+ytplayer_name+' ('+tag+')');\r\n\r\n // Media Controller display mode\r\n var ytplayer_offsetLeft=0; var ytplayer_width=getWidth(ytplayer);\r\n if(ytplayer_width<=0) { ytplayer_width=getWidth(ytplayer.parentNode); }\r\n if(ytplayer_width>960) { ytplayer_offsetLeft=(ytplayer_width-960)/2; ytplayer_width=960; }\r\n\r\n var MC_height=26; var MC_leftB2=167; var MC_topB2=-1; var MC_leftB3=480-166;\r\n if(ytplayer_width<480-126) { MC_leftB2=(ytplayer_width-244)/2+117; MC_leftB3=ytplayer_width-30; }\r\n if(ytplayer_width<300) { MC_leftB2=19; MC_leftB3=145; MC_topB2=26; }\r\n\r\n var yt_p=ytplayer.parentNode; var yt_ns; var yt_c=ytplayer;\r\n if(yt_p.tagName==\"OBJECT\") { yt_c=yt_p; yt_p.setAttribute('mc_embedtype',3); yt_ns=yt_p.nextSibling; yt_p=yt_p.parentNode; }\r\n else { yt_ns=ytplayer.nextSibling; }\r\n\r\n if(arguments.callee.count) {\r\n arguments.callee.count++;\r\n } else {\r\n arguments.callee.count=1;\r\n if(getValue('USE_IMAGE_FOR_BUTTON')>0) { OPTIONS_BOX['LIGHT_COLOR_MC_BACKGROUND'][3]='E8E8E8'; OPTIONS_BOX['LIGHT_COLOR_MC_TOGGLE_LOOP'][3]='D0D0FF'; }\r\n var glo='0.9'; if(USE_DARK_COLORS) { glo='0.2'; }\r\n GM_addGlobalStyle('.yte-MC-button { border: 1px solid '+color('MC_BORDER')+'; border-top:0; cursor:pointer; '+MakeBRadiusCSS('0 0 3px 3px')+MakeGradientCSS('rgba(255,255,255,'+glo+')','rgba(255,255,255,0)')+'background-color:'+color('MC_BACKGROUND')+' }'\r\n +'.yte-MC-button:hover { '+MakeBoxShadowCSS('5px',colorShadow('MC_BACKGROUND'))+'; z-index:5; }'\r\n +'.yte-MC-button[Lvalue]:not([Lvalue=\"0\"]) { background-color:'+color('MC_TOGGLE_LOOP')+' }'\r\n +'.yte-MC-button[Bvalue], .yte-MC-button[Evalue] { background-color:'+color('MC_TOGGLE_BEG_END')+' }'\r\n +'.yte-MC-button-red { border: 1px solid '+color('MC_BORDER')+'; border-top:0; cursor:pointer; '+MakeBRadiusCSS('0 0 3px 3px')+MakeGradientCSS('rgba(255,255,255,'+glo+')','rgba(255,255,255,0)')+'background-color:'+color('MC_BG_RED')+'; }'\r\n +'.yte-MC-button-red:hover { '+MakeBoxShadowCSS('5px',colorShadow('MC_BG_RED'))+'; z-index:5; }'\r\n +'.yte-MC-button-blue { border: 1px solid '+color('MC_BORDER')+'; border-top:0; '+MakeBRadiusCSS('0 0 3px 3px')+MakeGradientCSS('rgba(255,255,255,'+glo+')','rgba(255,255,255,0)')+' background-color:'+color('MC_BG_BLUE_OUT')+' }'\r\n +'.yte-MC-button-blue:hover { '+MakeBoxShadowCSS('5px',colorShadow('MC_BORDER'))+'; background-color:'+color('MC_BG_BLUE_IN')+'; z-index:5; }'\r\n +'body[YTE-LightOff] .yte-MC-button { border-color:'+color_change(1,'MC_BORDER')+'; '+MakeGradientCSS('rgba(255,255,255,0.1)','rgba(255,255,255,0)')+'; background-color:'+color_change(1,'MC_BACKGROUND')+'; }'\r\n +'body[YTE-LightOff] .yte-MC-button[Lvalue]:not([Lvalue=\"0\"]) { background-color:'+color_change(1,'MC_TOGGLE_LOOP')+' }'\r\n +'body[YTE-LightOff] .yte-MC-button[Bvalue], body[YTE-LightOff] .yte-MC-button[Evalue] { background-color:'+color_change(1,'MC_TOGGLE_BEG_END')+' }'\r\n +'body[YTE-LightOff] .yte-MC-button:hover { '+MakeBoxShadowCSS('5px',colorGlow('MC_BACKGROUND',1))+' }'\r\n +'body[YTE-LightOff] .yte-MC-button-red { border-color:'+color_change(1,'MC_BORDER')+'; '+MakeGradientCSS('rgba(255,255,255,0.1)','rgba(255,255,255,0)')+'; background-color:'+color_change(1,'MC_BG_RED')+'; }'\r\n +'body[YTE-LightOff] .yte-MC-button-red:hover { '+MakeBoxShadowCSS('5px',colorGlow('MC_BG_RED',1))+' }'\r\n +'body[YTE-LightOff] .yte-MC-button-blue { border: 1px solid '+color_change(1,'MC_BORDER')+';'+MakeBRadiusCSS('0 0 3px 3px')+MakeGradientCSS('rgba(255,255,255,0.1)','rgba(255,255,255,0)')+' background-color:'+color_change(1,'MC_BG_BLUE_OUT')+' }'\r\n +'body[YTE-LightOff] .yte-MC-button-blue:hover { '+MakeBoxShadowCSS('5px',colorGlow('MC_BORDER',1))+'; background-color:'+color_change(1,'MC_BG_BLUE_IN')+'; z-index:5; }'\r\n );\r\n }\r\n\r\n mediabar=document.createElement('div');\r\n //mediabar.setAttribute('id','Media_Controller-'+ytplayer_name);\r\n mediabar.setAttribute('style','position:relative; width:'+ytplayer_width+'px; margin-bottom:5px; padding-bottom:3px; z-index:550;'\r\n +'height:'+(MC_height+MC_topB2-1)+'px; border:0px; color:'+color('MC_TEXT_OUT')+' !important; line-height:1em !important');\r\n\r\n // === Media Controller Bar ===\r\n // 1st group\r\n var buttonStop=document.createElement('div');\r\n buttonStop.setAttribute('title',getText(\"stop\"));\r\n buttonStop.setAttribute('class','yte-MC-button');\r\n buttonStop.setAttribute('style','left: 0px; position:absolute; width:28px; height:'+MC_height+'px; overflow:hidden');\r\n var buttonStopCtx=addTransparentCanvas(buttonStop,28,26).getContext('2d');\r\n drawStopButton(buttonStopCtx,color('MC_TEXT_OUT'));\r\n buttonStop.addEventListener('mouseover', function() { drawStopButton(buttonStopCtx,color('MC_TEXT_ACTION_IN')); }, true);\r\n buttonStop.addEventListener('mouseout', function() { drawStopButton(buttonStopCtx,color('MC_TEXT_OUT')); }, true);\r\n buttonStop.addEventListener('click', function() { player_stop(ytplayer_name); }, true);\r\n user_select(buttonStop,'none');\r\n mediabar.appendChild(buttonStop);\r\n\r\n var buttonStepBack=document.createElement('div');\r\n buttonStepBack.setAttribute('title',getText(\"stepb\"));\r\n buttonStepBack.setAttribute('class','yte-MC-button');\r\n buttonStepBack.setAttribute('style','left:29px; position:absolute; width:28px; height:'+MC_height+'px; overflow:hidden');\r\n var buttonStepBackCtx=addTransparentCanvas(buttonStepBack,28,26).getContext('2d');\r\n drawStepBackButton(buttonStepBackCtx,color('MC_TEXT_OUT'));\r\n buttonStepBack.addEventListener('mouseover', function() { drawStepBackButton(buttonStepBackCtx,color('MC_TEXT_ACTION_IN')); }, true);\r\n buttonStepBack.addEventListener('mouseout', function() { drawStepBackButton(buttonStepBackCtx,color('MC_TEXT_OUT')); }, true);\r\n buttonStepBack.addEventListener('click', function() { player_stepback(ytplayer_name); }, true);\r\n user_select(buttonStepBack,'none');\r\n mediabar.appendChild(buttonStepBack);\r\n\r\n var buttonFrame=document.createElement('div');\r\n buttonFrame.setAttribute('title',getText(\"stepf\"));\r\n buttonFrame.setAttribute('class','yte-MC-button');\r\n buttonFrame.setAttribute('style','left:58px; position:absolute; width:28px; height:'+MC_height+'px; overflow:hidden');\r\n var buttonFrameCtx=addTransparentCanvas(buttonFrame,28,26).getContext('2d');\r\n drawFrameButton(buttonFrameCtx,color('MC_TEXT_OUT'));\r\n buttonFrame.addEventListener('mouseover', function() { drawFrameButton(buttonFrameCtx,color('MC_TEXT_ACTION_IN')); }, true);\r\n buttonFrame.addEventListener('mouseout', function() { drawFrameButton(buttonFrameCtx,color('MC_TEXT_OUT')); }, true);\r\n buttonFrame.addEventListener('click', function() { player_frame(ytplayer_name); }, true);\r\n user_select(buttonFrame,'none');\r\n mediabar.appendChild(buttonFrame);\r\n\r\n var buttonPlay=document.createElement('div');\r\n buttonPlay.setAttribute('title',getText(\"play\"));\r\n buttonPlay.setAttribute('class','yte-MC-button');\r\n buttonPlay.setAttribute('style','left:87px; position:absolute; width:28px; height:'+MC_height+'px; overflow:hidden');\r\n var buttonPlayCtx=addTransparentCanvas(buttonPlay,28,26).getContext('2d');\r\n drawPlayButton(buttonPlayCtx,color('MC_TEXT_OUT'));\r\n buttonPlay.addEventListener('mouseover', function() { drawPlayButton(buttonPlayCtx,color('MC_TEXT_ACTION_IN')); }, true);\r\n buttonPlay.addEventListener('mouseout', function() { drawPlayButton(buttonPlayCtx,color('MC_TEXT_OUT')); }, true);\r\n buttonPlay.addEventListener('click', function() { player_play(ytplayer_name); }, true);\r\n user_select(buttonPlay,'none');\r\n mediabar.appendChild(buttonPlay);\r\n\r\n var buttonPause=document.createElement('div');\r\n buttonPause.setAttribute('title',getText(\"pause\"));\r\n buttonPause.setAttribute('class','yte-MC-button');\r\n buttonPause.setAttribute('style','left:116px; position:absolute; width:28px; height:'+MC_height+'px; overflow:hidden');\r\n var buttonPauseCtx=addTransparentCanvas(buttonPause,28,26).getContext('2d');\r\n drawPauseButton(buttonPauseCtx,color('MC_TEXT_OUT'));\r\n buttonPause.addEventListener('mouseover', function() { drawPauseButton(buttonPauseCtx,color('MC_TEXT_ACTION_IN')); }, true);\r\n buttonPause.addEventListener('mouseout', function() { drawPauseButton(buttonPauseCtx,color('MC_TEXT_OUT')); }, true);\r\n buttonPause.addEventListener('click', function() { player_pause(ytplayer_name); }, true);\r\n user_select(buttonPause,'none');\r\n mediabar.appendChild(buttonPause);\r\n\r\n\r\n // 2nd group\r\n var buttonMemo=document.createElement('div');\r\n buttonMemo.setAttribute('id',ytplayer_name+'-Memo_state');\r\n buttonMemo.setAttribute('title',getText(\"begin\"));\r\n buttonMemo.setAttribute('class','yte-MC-button');\r\n buttonMemo.setAttribute('style','left:'+MC_leftB2+'px; top:'+(MC_topB2+1)+'px; position:absolute; width:28px; height:'+MC_height+'px; overflow:hidden');\r\n //buttonMemo.removeAttribute('Bvalue');\r\n var buttonMemoCtx=addTransparentCanvas(buttonMemo,28,26).getContext('2d');\r\n drawMemoButton(buttonMemoCtx,color('MC_TEXT_OUT'));\r\n buttonMemo.addEventListener('mouseover', function() { drawMemoButton(buttonMemoCtx,color('MC_TEXT_TOGGLE_IN')); }, true);\r\n buttonMemo.addEventListener('mouseout', function() { drawMemoButton(buttonMemoCtx,color('MC_TEXT_OUT')); }, true);\r\n buttonMemo.addEventListener('click', function() { player_memo(ytplayer_name); }, true);\r\n user_select(buttonMemo,'none');\r\n mediabar.appendChild(buttonMemo);\r\n\r\n var buttonLoop=document.createElement('div');\r\n buttonLoop.setAttribute('id',ytplayer_name+'-Loop_state');\r\n buttonLoop.setAttribute('title',getText(\"loop\"));\r\n buttonLoop.setAttribute('class','yte-MC-button');\r\n buttonLoop.setAttribute('style','left:'+(MC_leftB2+29)+'px; top:'+(MC_topB2+1)+'px; position:absolute; width:37px; height:'+MC_height+'px; overflow:hidden');\r\n buttonLoop.setAttribute('Lvalue',getValue('MC_LOOP_AT_START'));\r\n var buttonLoopCtx=addTransparentCanvas(buttonLoop,35,26).getContext('2d');\r\n drawLoopButton(buttonLoopCtx,color('MC_TEXT_OUT'));\r\n buttonLoop.addEventListener('mouseover', function() { drawLoopButton(buttonLoopCtx,color('MC_TEXT_TOGGLE_IN')); }, true);\r\n buttonLoop.addEventListener('mouseout', function() { drawLoopButton(buttonLoopCtx,color('MC_TEXT_OUT')); }, true);\r\n buttonLoop.addEventListener('click', function() { player_loop(ytplayer_name); }, true);\r\n user_select(buttonLoop,'none');\r\n mediabar.appendChild(buttonLoop);\r\n\r\n var buttonRewind=document.createElement('div');\r\n buttonRewind.setAttribute('title',getText(\"rewnd\"));\r\n buttonRewind.setAttribute('class','yte-MC-button');\r\n buttonRewind.setAttribute('style','left:'+(MC_leftB2+67)+'px; top:'+(MC_topB2+1)+'px; position:absolute; width:28px; height:'+MC_height+'px; overflow:hidden');\r\n var buttonRewindCtx=addTransparentCanvas(buttonRewind,28,26).getContext('2d');\r\n drawRewindButton(buttonRewindCtx,color('MC_TEXT_OUT'));\r\n buttonRewind.addEventListener('mouseover', function() { drawRewindButton(buttonRewindCtx,color('MC_TEXT_ACTION_IN')); }, true);\r\n buttonRewind.addEventListener('mouseout', function() { drawRewindButton(buttonRewindCtx,color('MC_TEXT_OUT')); }, true);\r\n buttonRewind.addEventListener('click', function() { player_rewind(ytplayer_name); }, true);\r\n user_select(buttonRewind,'none');\r\n mediabar.appendChild(buttonRewind);\r\n\r\n var buttonLimit=document.createElement('div');\r\n buttonLimit.setAttribute('id',ytplayer_name+'-Limit_state');\r\n buttonLimit.setAttribute('title',getText(\"end\"));\r\n buttonLimit.setAttribute('class','yte-MC-button');\r\n buttonLimit.setAttribute('style','left:'+(MC_leftB2+96)+'px; top:'+(MC_topB2+1)+'px; position:absolute; width:28px; height:'+MC_height+'px; overflow:hidden');\r\n //buttonLimit.removeAttribute('Evalue');\r\n var buttonLimitCtx=addTransparentCanvas(buttonLimit,28,26).getContext('2d');\r\n drawLimitButton(buttonLimitCtx,color('MC_TEXT_OUT'));\r\n buttonLimit.addEventListener('mouseover', function() { drawLimitButton(buttonLimitCtx,color('MC_TEXT_TOGGLE_IN')); }, true);\r\n buttonLimit.addEventListener('mouseout', function() { drawLimitButton(buttonLimitCtx,color('MC_TEXT_OUT')); }, true);\r\n buttonLimit.addEventListener('click', function() { player_limit(ytplayer_name); }, true);\r\n user_select(buttonLimit,'none');\r\n mediabar.appendChild(buttonLimit);\r\n\r\n\r\n // 3rd group\r\n var buttonFreeze=document.createElement('div');\r\n buttonFreeze.setAttribute('title',getText(\"kill\"));\r\n buttonFreeze.setAttribute('class','yte-MC-button-red');\r\n buttonFreeze.setAttribute('style','left:'+MC_leftB3+'px; position:absolute; width:28px; height:'+MC_height+'px; overflow:hidden');\r\n var buttonFreezeCtx=addTransparentCanvas(buttonFreeze,28,26).getContext('2d');\r\n //buttonFreeze.firstChild.style.setProperty('margin-top','1px','');\r\n drawFreezeButton(buttonFreezeCtx,color('MC_TEXT_OUT'));\r\n buttonFreeze.addEventListener('mouseover', function() { drawFreezeButton(buttonFreezeCtx,color('MC_TEXT_ACTION_IN')); }, true);\r\n buttonFreeze.addEventListener('mouseout', function() { drawFreezeButton(buttonFreezeCtx,color('MC_TEXT_OUT')); }, true);\r\n buttonFreeze.addEventListener('click', function() { player_freeze(ytplayer_name); }, true);\r\n user_select(buttonFreeze,'none');\r\n mediabar.appendChild(buttonFreeze);\r\n\r\n // 4th group\r\n if(gvar.isWatchPage) {\r\n if(!gvar.isVerifAgePage) {\r\n var eurl=get_embedURL();\r\n if(eurl) {\r\n var buttonEULink=document.createElement('a');\r\n buttonEULink.setAttribute('title',getText(\"embed\"));\r\n buttonEULink.setAttribute('class','yte-MC-button-blue');\r\n buttonEULink.setAttribute('style','position:absolute; top:0px; right:'+0+'px; width:34px; height:'+MC_height+'px; display: block; overflow:hidden');\r\n buttonEULink.setAttribute('href',eurl);\r\n buttonEULink.setAttribute('target','_blank');\r\n var buttonEULinkCtx=addTransparentCanvas(buttonEULink,34,26).getContext('2d');\r\n drawEULinkButton(buttonEULinkCtx,color('MC_TEXT_BLUE_OUT'),false);\r\n user_select(buttonEULink,'none');\r\n mediabar.appendChild(buttonEULink);\r\n buttonEULink.addEventListener('mouseover' , function() { drawEULinkButton(buttonEULinkCtx,color('MC_TEXT_BLUE_IN'),true); }, true);\r\n buttonEULink.addEventListener('mouseout' , function() { drawEULinkButton(buttonEULinkCtx,color('MC_TEXT_BLUE_OUT'),false); }, true);\r\n buttonEULink.addEventListener('click' , function() { player_freeze.freeze=1; player_freeze(ytplayer_name); }, true);\r\n if(ytplayer_width<480) { buttonEULink.style.visibility='hidden'; }\r\n } else { show_alert('Media Controller : Global variable for \"Embed URL\" not found',0); }\r\n\r\n var fsurl=get_newfullscreenURL();\r\n if(fsurl) {\r\n var buttonFSLink=document.createElement('a');\r\n buttonFSLink.setAttribute('title',getText(\"fscr\"));\r\n buttonFSLink.setAttribute('class','yte-MC-button-blue');\r\n buttonFSLink.setAttribute('style','position:absolute; top:0px; right:'+35+'px; width:56px; height:'+MC_height+'px; display: block; overflow:hidden');\r\n buttonFSLink.setAttribute('href',fsurl);\r\n buttonFSLink.setAttribute('target','_blank');\r\n var buttonFSLinkCtx=addTransparentCanvas(buttonFSLink,56,26).getContext('2d');\r\n drawFSLinkButton(buttonFSLinkCtx,color('MC_TEXT_BLUE_OUT'),false);\r\n user_select(buttonFSLink,'none');\r\n mediabar.appendChild(buttonFSLink);\r\n buttonFSLink.addEventListener('mouseover' , function() { drawFSLinkButton(buttonFSLinkCtx,color('MC_TEXT_BLUE_IN'),true); }, true);\r\n buttonFSLink.addEventListener('mouseout' , function() { drawFSLinkButton(buttonFSLinkCtx,color('MC_TEXT_BLUE_OUT'),false); }, true);\r\n buttonFSLink.addEventListener('click' , function() { player_freeze.freeze=1; player_freeze(ytplayer_name); }, true);\r\n if(ytplayer_width<480) { buttonFSLink.style.visibility='hidden'; }\r\n } else { show_alert('Media Controller : Global variable for \"Fullscreen URL\" not found',0); }\r\n }\r\n\r\n mediabar.style.setProperty('margin-left','auto','');\r\n mediabar.style.setProperty('margin-right','auto','');\r\n\r\n gvar.buttonStop=buttonStop; gvar.buttonStepBack=buttonStepBack; gvar.buttonFrame=buttonFrame; gvar.buttonPlay=buttonPlay; gvar.buttonPause=buttonPause;\r\n gvar.buttonMemo=buttonMemo; gvar.buttonLoop=buttonLoop; gvar.buttonRewind=buttonRewind; gvar.buttonLimit=buttonLimit; gvar.buttonFreeze=buttonFreeze;\r\n }\r\n\r\n // Light Off\r\n if(gvar.isWatchPage || gvar.isBetaChannel) {\r\n mediaController_resize(ytplayer_name,mediabar);\r\n change_mediaController_color(USE_DARK_COLORS,mediabar);\r\n yt_p.style.setProperty('z-index','550','');\r\n var YTPoverlay=mLightOff.display(0,ytplayer_name,yt_p);\r\n YTPoverlay.addEventListener('click', function() { mLightOff.display(0,ytplayer_name); }, true);\r\n YTPoverlay.addEventListener('mouseover', function() { mLightOff.display(1,ytplayer_name); }, true);\r\n // Turn off the light at start\r\n if(getValue('LIGHT_OFF_AT_START')>0) { mLightOff.create(); }\r\n window.setTimeout( function() { change_media_controller_display(mediabar); },30);\r\n }\r\n\r\n // 5th group\r\n if(gvar.isBetaChannel) {\r\n var buttonSize4=document.createElement('div');\r\n buttonSize4.setAttribute('title','640x480');\r\n buttonSize4.setAttribute('class','yte-MC-button');\r\n buttonSize4.setAttribute('style','right:'+96+'px; position:absolute; width:38px; height:'+MC_height+'px; overflow:hidden;');\r\n var buttonSize4Ctx=addTransparentCanvas(buttonSize4,38,26).getContext('2d');\r\n draw4DIV3Button(buttonSize4Ctx,color('MR_DRAW_TEXT_OUT'));\r\n buttonSize4.addEventListener('mouseover', function() { draw4DIV3Button(buttonSize4Ctx,color('MR_DRAW_TEXT_IN')); }, true);\r\n buttonSize4.addEventListener('mouseout', function() { draw4DIV3Button(buttonSize4Ctx,color('MR_DRAW_TEXT_OUT')); }, true);\r\n buttonSize4.addEventListener('click', function() { setSizePlayer(1,ytplayer_name); }, true);\r\n user_select(buttonSize4,'none'); mediabar.appendChild(buttonSize4);\r\n\r\n var buttonSizeW=document.createElement('div');\r\n buttonSizeW.setAttribute('title','640x360');\r\n buttonSizeW.setAttribute('class','yte-MC-button');\r\n buttonSizeW.setAttribute('style','right:'+135+'px; position:absolute; width:38px; height:'+MC_height+'px; overflow:hidden;');\r\n var buttonSizeWCtx=addTransparentCanvas(buttonSizeW,38,26).getContext('2d');\r\n drawWIDEButton(buttonSizeWCtx,color('MR_DRAW_TEXT_OUT'));\r\n buttonSizeW.addEventListener('mouseover', function() { drawWIDEButton(buttonSizeWCtx,color('MR_DRAW_TEXT_IN')); }, true);\r\n buttonSizeW.addEventListener('mouseout', function() { drawWIDEButton(buttonSizeWCtx,color('MR_DRAW_TEXT_OUT')); }, true);\r\n buttonSizeW.addEventListener('click', function() { setSizePlayer(2,ytplayer_name); }, true);\r\n user_select(buttonSizeW,'none'); mediabar.appendChild(buttonSizeW);\r\n\r\n var buttonSizeU=document.createElement('div');\r\n buttonSizeU.setAttribute('title','640x0');\r\n buttonSizeU.setAttribute('class','yte-MC-button');\r\n buttonSizeU.setAttribute('style','right:'+174+'px; position:absolute; width:38px; height:'+MC_height+'px; overflow:hidden;');\r\n var buttonSizeUCtx=addTransparentCanvas(buttonSizeU,38,26).getContext('2d');\r\n drawBARButton(buttonSizeUCtx,color('MR_DRAW_TEXT_OUT'));\r\n buttonSizeU.addEventListener('mouseover', function() { drawBARButton(buttonSizeUCtx,color('MR_DRAW_TEXT_IN')); }, true);\r\n buttonSizeU.addEventListener('mouseout', function() { drawBARButton(buttonSizeUCtx,color('MR_DRAW_TEXT_OUT')); }, true);\r\n buttonSizeU.addEventListener('click', function() { setSizePlayer(3,ytplayer_name); }, true);\r\n user_select(buttonSizeU,'none'); mediabar.appendChild(buttonSizeU);\r\n\r\n gvar.buttonStop=buttonStop; gvar.buttonStepBack=buttonStepBack; gvar.buttonFrame=buttonFrame; gvar.buttonPlay=buttonPlay; gvar.buttonPause=buttonPause;\r\n gvar.buttonMemo=buttonMemo; gvar.buttonLoop=buttonLoop; gvar.buttonRewind=buttonRewind; gvar.buttonLimit=buttonLimit; gvar.buttonFreeze=buttonFreeze;\r\n gvar.buttonSize4=buttonSize4; gvar.buttonSizeW=buttonSizeW; gvar.buttonSizeU=buttonSizeU;\r\n\r\n var ButtonLightOff=mLightOff.addButton(ytplayer.id,LIGHT_OFF_BUTTON_ID,0)\r\n ButtonLightOff.setAttribute('style','right:'+0+'px; position:absolute; width:29px; height:'+MC_height+'px; overflow:hidden;');\r\n ButtonLightOff.setAttribute('class','yte-MC-button');\r\n mediabar.appendChild(ButtonLightOff);\r\n }\r\n\r\n if(gvar.isGoogleWatch) {\r\n //yt_p.parentNode.insertBefore(mediabar,yt_p.nextSibling);\r\n yt_p.insertBefore(mediabar, yt_ns);\r\n var wp=$('watch-panel'); if(wp) { wp.style.setProperty('padding-top','5px','important'); }\r\n } else {\r\n yt_p.insertBefore(mediabar, yt_ns);\r\n // Horizontal offset fix\r\n var leftdiff=getAbsoluteLeft(mediabar)-getAbsoluteLeft(ytplayer)-ytplayer_offsetLeft;\r\n if(leftdiff!=0) { mediabar.style.left=(-leftdiff)+'px'; }\r\n }\r\n\r\n // Vertical offset fix\r\n var ytplayer_height=getHeight(ytplayer);\r\n var topdiff=getAbsoluteTop(mediabar)-ytplayer_height-getAbsoluteTop(ytplayer);\r\n if(topdiff!=0) { mediabar.style.top=(-topdiff)+'px'; }\r\n\r\n player_check_limit(ytplayer_name);\r\n}", "function VideoPlayPause() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "playVideo(url, title, backgroundImage, transition) {\n if (!this.controls) {\n this.controls = new VPcontrolPanel({\n player: this.player,\n title: title,\n cover: backgroundImage,\n distance: 2,\n width: 3\n }, transition);\n this.container();\n this.player.loadVideo(url);\n } else {\n this.controls.loadVideo(title, url, backgroundImage, this.sphere);\n }\n }", "function togglePlay() {\n\tif (player.paused){\n\t\ttoggleIcon();\n\t\treturn player.play();\n\t} else {\n\t\ttoggleIcon();\n\t\treturn player.pause();\n\t}\n}", "_pauseVideo() {\n this.e.target.pauseVideo();\n console.log('Pausing the video');\n }", "function videoPlay($wrapper) {\n var $iframe = $wrapper.find('.js-videoIframe');\n var src = $iframe.data('src');\n // hide poster\n $wrapper.addClass('videoWrapperActive');\n // add iframe src in, starting the video\n $iframe.attr('src',src);\n }", "function play_btn_pause() {\n playTrackBtn.setAttribute('src', 'images/pause.png');\n}", "onPlayPauseClick() {\n const { controller } = this.props;\n controller.togglePlayPause();\n }", "function toggleplay() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n}", "function updateButton() {\n // we can use this because it's bound to the video itself\n const icon = this.paused ? '►' : '❚ ❚';\n toggle.textContent = icon;\n}", "function setVideo(e, value) {\n myMediaStream.getVideoTracks()[0].enabled = !myMediaStream.getVideoTracks()[0].enabled;\n myVideoStatus = myMediaStream.getVideoTracks()[0].enabled;\n e.target.className = \"fas fa-video\" + (myVideoStatus ? \"\" : \"-slash\");\n if (value) {\n videoBtn.className = \"fas fa-video\" + (myVideoStatus ? \"\" : \"-slash\");\n tippy(startVideoBtn, { content: myVideoStatus ? \"Off\" : \"On\", placement: \"top\", });\n }\n setMyVideoStatus(myVideoStatus);\n}", "function videoPlayVideo(e) {\n\t\t// change video play button text to play\n\t\tvideoPlay.innerHTML = \"Play\";\n\n\t\t// if videoplay button contains playing class, pause all videos if button is pressed\n\t\tif(videoPlay.classList.contains(\"playing\")) {\n\t\t\tvideoOne.pause();\n\t\t\tvideoTwo.pause();\n\t\t\tvideoThree.pause();\n\n\t\t\taudioThree.pause();\n\n\t\t\t// add paused class to video play button\n\t\t\tvideoPlay.classList.add(\"paused\");\n\t\t\t// remove the playing class to play button\n\t\t\tvideoPlay.classList.remove(\"playing\");\n\n\t\t\t// if videoPlay button contains paused class, play all video if button is pressed\n\t\t} else if (videoPlay.classList.contains(\"paused\")) {\n\t\t\tvideoOne.play();\n\t\t\tvideoTwo.play();\n\t\t\tvideoThree.play();\n\n\t\t\taudioThree.play()\n\n\t\t\t// add playing class to video play button\n\t\t\tvideoPlay.classList.add(\"playing\");\n\n\t\t\t// remove paused class to video play button\n\t\t\tvideoPlay.classList.remove(\"paused\");\n\n\t\t\t// change video play button to \"pause\";\n\t\t\tvideoPlay.innerHTML = \"Pause\";\n\n\t\t}\n\t}", "function togglePlayPause() {\r\n if (video.paused) {\r\n playVideo();\r\n } else {\r\n pauseVideo();\r\n }\r\n}", "function onPlayerReady(event) {\n //event.target.playVideo();\n event.target.pauseVideo();\n }", "videoCondition() {\n let { player } = this.refs\n if (this.state.pauseCondition) {\n if (player.currentTime === player.duration) {\n player.currentTime = 0\n player.play();\n }\n player.play();\n this.setState(\n {\n videoConditionText: 'Pause',\n pauseCondition: false\n }\n )\n } else {\n player.pause();\n this.setState(\n {\n videoConditionText: 'Play',\n pauseCondition: true\n }\n )\n }\n }", "function altplayer(video, altvideo) {\n\n if (this instanceof altplayer && video instanceof Element) {\n const self = this, plyropts = {\n captions: { active: true, language: 'auto', update: true },\n settings: [\n 'captions',\n 'quality'\n ]\n\n }, buttons = {\n play: `<span class=\"play-button\">\n <svg class=\"play-icn\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path fill=\"currentColor\" d=\"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6zM48 453.5v-395c0-4.6 5.1-7.5 9.1-5.2l334.2 197.5c3.9 2.3 3.9 8 0 10.3L57.1 458.7c-4 2.3-9.1-.6-9.1-5.2z\"></path></svg>\n </span>`,\n bigplay: html2element(`<span class=\"bigplay-button no-focus\" tabindex=\"-1\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\" class=\"bigplay-icn\"><path fill=\"currentColor\" d=\"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z\"></path></svg>\n </span>`)\n };\n Object.assign(self, {\n video: altvideo instanceof Element ? altvideo : html2element(`<video controls src=\"\" preload=\"none\" tabindex=\"-1\" class=\"altplayer-video\" />`),\n originalvideo: video,\n grabber: null,\n plyr: null,\n ready: false,\n elements: {\n root: html2element(`<div class=\"altplayer-container\" />`)\n }\n });\n //fit video to screen/iframe size\n const resize = () => {\n //fit to vertical view also (mobile), works also fullscreen\n self.plyr.elements.wrapper.classList.remove('.plyr__video-wrapper--fixed-ratio');\n self.video.style.width = `${doc.documentElement.clientWidth}px`;\n self.video.style.height = `${doc.documentElement.clientHeight}px`;\n };\n\n const start = () => {\n if ((!altvideo instanceof Element)) self.video.src = video.src;\n self.elements.root.insertBefore(self.video, self.elements.root.firstChild);\n doc.body.innerHTML = \"\";\n doc.body.insertBefore(self.elements.root, doc.body.firstChild);\n let currentTrack = -1;\n //convert subtitles to vtt\n if (self.video.textTracks.length > 0) {\n self.video.querySelectorAll('track').forEach(track => {\n if (typeof track.kind === s && /^(subtitles|captions)$/.test(track.kind) && typeof track.src === s) {\n let src = track.src, url = (src => {\n try {\n let a = doc.createElement('a'), url;\n a.href = src;\n url = new URL(a.href);\n if (url.href === doc.location.href) {\n return null;\n }\n return url;\n } catch (error) {\n return null;\n }\n })(src);\n if (url !== null) {\n // @link https://medium.com/netscape/hacking-it-out-when-cors-wont-let-you-be-great-35f6206cc646\n if (url.origin !== doc.location.origin) {\n url = \"https://cors-anywhere.herokuapp.com/\" + url.href;\n } else if ((/\\.srt/.test(url.pathname))) {\n url = url.href;\n } else url = url.href; //null;\n if (url !== null) {\n fetch(url, {\n // mode: \"no-cors\", method: \"GET\", \n cache: \"default\", redirect: 'follow'\n }).then(r => {\n if (r.status === 200) {\n r.text().then(text => {\n let parsed, vtt, blob, virtualurl;\n if (Array.isArray(parsed = Subtitle.parse(text)) && parsed.length > 0) {\n vtt = Subtitle.stringifyVtt(parsed);\n if (typeof vtt === s && vtt.length > 0) {\n blob = new Blob([vtt], { type: \"text/vtt\" });\n track.dataset.src = url;\n virtualurl = URL.createObjectURL(blob);\n track.src = virtualurl;\n //setTimeout(x => URL.revokeObjectURL(virtualurl), 2000);\n }\n }\n });\n }\n }).catch(ex => {\n console.error(ex);\n //track.remove();\n });\n }\n }\n }\n });\n }\n\n self.plyr = new Plyr(self.video, plyropts);\n self.plyr.on('ready', e => {\n\n self.plyr.elements.container.id = \"altplayer\" + Math.floor(+new Date() / 1000);\n self.plyr.elements.container.insertBefore(buttons.bigplay, self.plyr.elements.container.firstChild);\n buttons.bigplay.addEventListener('click', () => {\n self.video.play();\n });\n self.video.addEventListener('play', () => {\n buttons.bigplay.hidden = true;\n }, { once: true });\n self.video.addEventListener('click', function (e) {\n if (this.paused) this.play();\n else this.pause();\n });\n\n self.grabber = new StreamGrabber(self.video, module);\n\n //quality change (save to localStorage)\n self.plyr.on('qualitychange', function (e) {\n localStorage.lastquality = e.detail.quality;\n self.grabber.notify('Setting quality to ' + e.detail.quality + \"p\");\n });\n\n self.plyr.on('error', function (e) {\n let url = new URL(self.video.src);\n if (/\\.m3u8/.test(url.pathname)) {\n let hls = self.hls = new Hls();\n hls.on(Hls.Events.MANIFEST_PARSED, function (event, data) {\n self.video.dataset.src = url.href;\n self.grabber.onReady(() => {\n self.grabber.videolink = function () {\n return self.video.dataset.src;\n };\n });\n self.video.play();\n });\n hls.on(Hls.Events.MEDIA_ATTACHED, function () {\n hls.loadSource(url.href);\n });\n self.video.addEventListener('play', function () {\n if (self.video.textTracks.length > 0) {\n self.video.querySelectorAll('track[src]').forEach(track => {\n track.src = track.src;\n });\n }\n setTimeout(() => {\n self.plyr.currentTrack = currentTrack;\n }, 300);\n\n }, { once: true });\n hls.attachMedia(self.video);\n }\n });\n\n //activate first subtitle track if CC are disabled\n currentTrack = self.plyr.currentTrack;\n if (self.video.textTracks.length > 0 && self.plyr.currentTrack === -1) {\n setTimeout(() => {\n self.plyr.currentTrack = currentTrack = 0;\n }, 200);\n\n }\n //video auto size (won't go out of bounds)\n window.addEventListener('resize', resize);\n resize();\n\n //set ready\n self.ready = true;\n trigger(self.elements.root, \"altplayer.ready\");\n });\n };\n\n if (altplayer.ready === true) {\n start();\n } else doc.body.addEventListener('altplayer.resources.ready', start);\n\n altplayer.loadResources();\n }\n }", "function ShowHelp() {\n $('img').tooltip('show');\n coursePlayer.pause();\n}", "playPauseVideo() {\n if (this.state.showPlay) {\n this.refs.video.play();\n this.setState({\n showPlay: false\n })\n }\n else {\n this.refs.video.pause();\n this.setState({\n showPlay: true\n })\n }\n }", "function videoPlay($wrapper) {\n var $iframe = $wrapper.find('.js-videoIframe');\n var src = $iframe.data('src');\n $wrapper.addClass('videoWrapperActive');\n $iframe.attr('src',src);\n}", "function playOrPause(value){\n \tif(value == true){\n \t\t// show play button\n \t\tcp.show(playID);\n \t\t// hide pause button\n \t\tcp.hide(pauseID);\t\t\t\n \t}\n \telse{\n \t\t// hide play\n \t\tcp.hide(playID);\n \t\t// show pause\n \t\tcp.show(pauseID);\t\n \t}\n }", "function pause(isso){\n if(isso.id == `play`){\n audio.play()\n isso.src = '/img/pause.png'\n isso.id = 'pause'\n\n } else if(isso.id == `pause`) {\n audio.pause()\n isso.src = '/img/play-button-arrowhead.png'\n isso.id = 'play'\n \n }\n}", "function pauseVid() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function InteractiveVideo(props) {\n const { src, alt } = props;\n\n return (\n <Player playsInline poster=\"/assets/poster.png\" src=\"/static/video/HT-Campaign.mp4\">\n <ControlBar autoHide={false} className=\"my-class\" />\n </Player>\n );\n}", "function toggleVideoStatus() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n}", "function onPlayerStateChange(event) {\n\n\t\t\t\t\t var embedCode = event.target.getVideoEmbedCode();\n\t\t\t\t\t var ytcont = jQuery('#'+embedCode.split('id=\"')[1].split('\"')[0])\n\t\t\t\t\t var container = ytcont.closest('.tp-simpleresponsive');\n\t\t\t\t\t var player = ytcont.parent().data('player');\n\n\t\t\t\t\tif (event.data == YT.PlayerState.PLAYING) {\n\n\t\t\t\t\t\tvar bt = container.find('.tp-bannertimer');\n\t\t\t\t\t\tvar opt = bt.data('opt');\n\t\t\t\t\t\tbt.stop();\n\n\t\t\t\t\t\tif (ytcont.closest('.tp-caption').data('volume')==\"mute\")\n\t\t\t\t\t\t\t player.mute();\n\n\t\t\t\t\t\topt.videoplaying=true;\n\t\t\t\t\t\t//konsole.log(\"VideoPlay set to True due onPlayerStateChange PLAYING\");\n\t\t\t\t\t\topt.videostartednow=1;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tvar bt = container.find('.tp-bannertimer');\n\t\t\t\t\t\tvar opt = bt.data('opt');\n\n\t\t\t\t\t\tif (event.data!=-1) {\n\t\t\t\t\t\t\tif (opt.conthover==0)\n\t\t\t\t\t\t\t\tbt.animate({'width':\"100%\"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:\"linear\"});\n\t\t\t\t\t\t\topt.videoplaying=false;\n\t\t\t\t\t\t\topt.videostoppednow=1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (event.data==0 && opt.nextslideatend==true)\n\t\t\t\t\t\topt.container.revnext();\n\n\n\t\t\t\t }", "function toggleVideoPlayback(e){\n\tif (e.source.playing) {\n\t\te.source.pause();\n\t} else {\n\t\te.source.play();\n\t}\n}", "function setPlayAndPause() {\n if (_options) {\n // Add play and pause button handler.\n // Flag to keep drag if pause or play should be used.\n var playCtrl = jQuery(\"#\" + _options.playAndPauseDivId);\n if (playCtrl.length) {\n playCtrl.click(function() {\n if (_requestAnimationTime !== undefined) {\n firePause();\n\n } else {\n firePlay();\n }\n });\n }\n // Initialize image.\n // Notice, pause and play actions update images in those functions.\n setPlayAndPauseImage();\n }\n }", "function setPlayAndPause() {\n if (_options) {\n // Add play and pause button handler.\n // Flag to keep drag if pause or play should be used.\n var playCtrl = jQuery(\"#\" + _options.playAndPauseDivId);\n if (playCtrl.length) {\n playCtrl.click(function() {\n if (_requestAnimationTime !== undefined) {\n firePause();\n\n } else {\n firePlay();\n }\n });\n }\n // Initialize image.\n // Notice, pause and play actions update images in those functions.\n setPlayAndPauseImage();\n }\n }", "function playVideo(){\n const html = `\n <i class=\"stopVideo fas fa-video-slash\"></i>\n <span> Play Video </span>\n `\n document.querySelector('.video').innerHTML = html;\n\n}", "function pauseOn()\n\t\t\t{\n\t\t\t\tpause = true;\n\t\t\t\tq.find(\".x-controls .pause\").hide();\n\t\t\t\tq.find(\".x-controls .play\").show();\n\t\t\t}", "function displayVideo() {\n if(currentQ.video){\n $(\"#video\").html(\"<div id=\\\"vidDiv\\\"></div>\");\n $(\"#vidDiv\").html(currentQ.video);\n var vidDivText = $(\"<p>\").text(\"Watch Video\");\n $(vidDivText).attr(\"id\", \"watchText\");\n $(vidDivText).prependTo(\"#video\");\n $(vidDivText)\n .css(\"background-color\", \"rgba(255, 255, 255, 0.9\")\n .css(\"box-shadow\", \"2px 2px 50px rgba(0,0,0,0.2)\");\n /* click #watchText to run videoVisibility function */\n $(\"#watchText\")\n .on(\"click\", videoVisibility);\n /* sets hover properties for #watchText */\n $(\"#watchText\").hover(\n function(){\n $(\"#watchText\")\n // .css(\"background-color\", \"rgba(235, 235, 235, 0.2\")\n .css(\"box-shadow\", \"0px 0px 0px rgba(0,0,0,0.3)\");\n }, \n function() {\n $(\"#watchText\")\n // .css(\"background-color\", \"rgba(255, 255, 255, 0.8\")\n .css(\"box-shadow\", \"5px 5px 25px rgba(0,0,0,0.3)\");\n }\n );\n }\n}", "renderPlaybackControl() {\n const { intl, isPaused } = this.props;\n const text = intl.formatMessage(isPaused ? messages.play : messages.pause);\n return (\n <button\n aria-label={text}\n className={classNames(styles.playbackControl)}\n onClick={this.togglePause}\n tabIndex=\"0\"\n type=\"button\"\n value={text}\n >\n <img alt=\"\" role=\"presentation\" src={isPaused ? playImage : pauseImage} />\n </button>\n );\n }", "function onPlayerStateChange(event) {\n\t//正要播放\n\tif (event.data == 1) {\n\t\t//縮圖and按鈕隱藏\n\t\t$(\".videoPlayer .play-button\").hide();\n\t\t$(\".videoPlayer .play-button\").closest(\".youtube-player\").find(\".youtube-thumb\").hide();\n\t\t//播放and聲音按鈕亮起來\n\t\t$(\".videoControl .playBtn\").css({\n\t\t\t\"background-image\":\"url(img/video/play_btn_hover.png)\"});\n\t\tplayer.unMute();\n\t\t$(\".videoControl .unMuteBtn\").css({\n\t\t\t\"background-image\":\"url(img/video/unmute_btn_hover.png)\"});\n\t\t$(\".videoControl .muteBtn\").css({\n\t\t\t\"background-image\":\"url(img/video/mute_btn.png)\"});\n\t\t$( \".videoControl .volume\" ).slider(\"value\",player.getVolume());\n\t\tYTgetTimer = setInterval(getYTplay,1000);//設置youtube播放時間計時器\n\t\tYTplay = true;\n\t\t}\n\t//正要暫停或結束播放\n\telse if (event.data == 2 || event.data == 0) {\n\t\tclearInterval(YTgetTimer);\n\t\t$(\".videoControl .playBtn\").css({\n\t\t\t\"background-image\":\"url(img/video/play_btn.png)\"});\n\t\t$(\".videoControl .unMuteBtn\").css({\n\t\t\t\"background-image\":\"url(img/video/unmute_btn.png)\"});\n\t\t$(\".videoControl .muteBtn\").css({\n\t\t\t\"background-image\":\"url(img/video/mute_btn.png)\"});\n\t\tif(event.data == 0){\n\t\t\t$(\".videoPlayer .play-button\").show();\n\t\t\t$(\".videoPlayer .play-button\").closest(\".youtube-player\").find(\".youtube-thumb\").show();\n\t\t\t}\n\t\tYTplay = false;\n\t\t}\n\t}", "function toggleVid() {\n if (playing) {\n earring.pause();\n button.html('play');\n } else {\n earring.loop();\n button.html('pause');\n }\n playing = !playing;\n}", "function pausePlayGifs() {\n var status = $(this).attr(\"data-status\");\n var pause = $(this).attr(\"data-pause\");\n var play = $(this).attr(\"data-play\");\n if (status === \"stop\") {\n $(this).attr(\"src\", play);\n $(this).attr(\"data-status\", \"animate\")\n } else if (status === \"animate\") {\n $(this).attr(\"src\", pause);\n $(this).attr(\"data-status\", \"stop\")\n }\n }", "function playVideo() {\n if (getPlayerPaused()) {\n editor.player[0].play();\n }\n}", "function playVideo(video) {\n\t\tconsole.log(\"playVideo button clicked\"); \n\t\t// set the video player window to the player window instead of blank\n\t\t$scope.playerWindowURL = './templates/video_player_window.html';\n\t\t$scope.collabServerPlayVideoURL = colabConfig.colabServerBaseURL + \"/uploaded_videos/\" + video.file_name;\n\t}", "function onPlayerStateChange(e) {\n e[\"data\"] == YT.PlayerState.PLAYING && setTimeout(onPlayerPercent, 1000, e[\"target\"]);\n var video_data = e.target[\"getVideoData\"](),\n label = video_data.title;\n // Get title of the current page\n var pageTitle = document.title;\n if (e[\"data\"] == YT.PlayerState.PLAYING && YT.gtmLastAction == \"p\") {\n label = \"Video Played - \" + video_data.title;\n dataLayer.push(\n {\n 'event': 'youtube',\n 'eventCategory': 'Youtube Videos',\n 'eventAction': pageTitle,\n 'eventLabel': label\n });\n YT.gtmLastAction = \"\";\n }\n if (e[\"data\"] == YT.PlayerState.PAUSED) {\n label = \"Video Paused - \" + video_data.title;\n dataLayer.push(\n {\n 'event': 'youtube',\n 'eventCategory': 'Youtube Videos',\n 'eventAction': pageTitle,\n 'eventLabel': label\n });\n YT.gtmLastAction = \"p\";\n }\n\n}", "showLocalVideo() {}", "function onPlayerReady(event) {\r\n //event.target.playVideo();\r\n}", "function videoPlay($wrapper) {\n var $iframe = $wrapper.find('.js-videoIframe');\n var src = $iframe.data('src');\n // hide poster\n $wrapper.addClass('videoWrapperActive');\n // add iframe src in, starting the video\n $iframe.attr('src',src);\n}", "function videoPlay($wrapper) {\n var $iframe = $wrapper.find('.js-videoIframe');\n var src = $iframe.data('src');\n // hide poster\n $wrapper.addClass('videoWrapperActive');\n // add iframe src in, starting the video\n $iframe.attr('src',src);\n}", "function toggleVideoStatus(){\n if(video.paused){\n video.play();\n }else {\n video.pause();\n }\n}", "function pp(){\n if(config.site ==='twitch'){\n $(\".qa-pause-play-button\").click();\n } else if(config.site ==='netflix'){\n return;\n }\n else {\n if(myPlayer.paused){\n myPlayer.play();\n } else {\n myPlayer.pause();\n }\n }\n log(\"play/pause triggered\");\n}", "function onPlayerStateChange(event) {\n\n\t\t\t\t\t var embedCode = event.target.getVideoEmbedCode();\n\t\t\t\t\t var container = jQuery('#'+embedCode.split('id=\"')[1].split('\"')[0]).closest('.tp-simpleresponsive');\n\n\t\t\t\t\tif (event.data == YT.PlayerState.PLAYING) {\n\n\t\t\t\t\t\tvar bt = container.find('.tp-bannertimer');\n\t\t\t\t\t\tvar opt = bt.data('opt');\n\t\t\t\t\t\tbt.stop();\n\n\t\t\t\t\t\topt.videoplaying=true;\n\t\t\t\t\t\t//konsole.log(\"VideoPlay set to True due onPlayerStateChange PLAYING\");\n\t\t\t\t\t\topt.videostartednow=1;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tvar bt = container.find('.tp-bannertimer');\n\t\t\t\t\t\tvar opt = bt.data('opt');\n\n\t\t\t\t\t\tif (event.data!=-1) {\n\t\t\t\t\t\t\tif (opt.conthover==0)\n\t\t\t\t\t\t\t\tbt.animate({'width':\"100%\"},{duration:((opt.delay-opt.cd)-100),queue:false, easing:\"linear\"});\n\t\t\t\t\t\t\topt.videoplaying=false;\n\t\t\t\t\t\t\topt.videostoppednow=1;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif (event.data==0 && opt.nextslideatend==true)\n\t\t\t\t\t\topt.container.revnext();\n\n\n\t\t\t\t }", "toggleVideo() {\n var self = this;\n\n if (self.get('isPlaying')) {\n self.get('Player').pauseVideo();\n self.set('isPlaying', false);\n\n self.get('$progressBar').stop();\n Ember.run.cancel(self.vidClock);\n } else {\n self.get('Player').playVideo();\n self.set('isPlaying', true);\n }\n }" ]
[ "0.75403845", "0.72437173", "0.7180169", "0.7180067", "0.710993", "0.7079209", "0.70605505", "0.69493806", "0.69403315", "0.68844175", "0.68768364", "0.6874432", "0.6864135", "0.6862987", "0.6852703", "0.6849988", "0.679399", "0.6791494", "0.6780978", "0.6716388", "0.6700786", "0.6695665", "0.6693363", "0.66523737", "0.66442126", "0.6637657", "0.6637408", "0.66213566", "0.66206557", "0.6612732", "0.660214", "0.6592715", "0.65874314", "0.65707666", "0.6557691", "0.65534884", "0.65432894", "0.65414727", "0.65336406", "0.65334207", "0.65330684", "0.6532619", "0.65184486", "0.6514935", "0.6507749", "0.6500282", "0.6499504", "0.64795184", "0.64795184", "0.64795184", "0.64795184", "0.64795184", "0.6476263", "0.64176685", "0.6413632", "0.6413406", "0.6409693", "0.6408813", "0.63814795", "0.63795173", "0.6378233", "0.6377676", "0.6377664", "0.63752943", "0.6367965", "0.6366645", "0.63644636", "0.6359212", "0.634797", "0.63458383", "0.6339366", "0.6323428", "0.6320638", "0.63201094", "0.6317832", "0.6315455", "0.63105035", "0.63094616", "0.63092136", "0.6305682", "0.6302888", "0.6302888", "0.62983376", "0.6294617", "0.62905365", "0.62881625", "0.6281103", "0.6274813", "0.6274418", "0.62740713", "0.6267223", "0.62671334", "0.6266844", "0.626679", "0.62608945", "0.62608945", "0.62600994", "0.6259834", "0.6250374", "0.62488145" ]
0.81265557
0
rewindVideo moves video back in time 15s
function rewindVideo() { var fastForward = player.getCurrentTime(); var minus15Seconds = fastForward - 15; player.seekTo(minus15Seconds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rewindVideo(increment) {\n player.currentTime -= increment;\n}", "function fastForwardVideo() {\n var fastForward = player.getCurrentTime();\n var add15Seconds = fastForward + 15;\n player.seekTo(add15Seconds);\n }", "function restoreTime () {\n const restoreTime = thiz.$videoPlayerRestoreTime(\n videoUrl,\n videoProgress\n )\n if (restoreTime > 0) {\n player.mute()\n player.playVideo()\n setTimeout(function () {\n player.pauseVideo()\n player.seekTo(restoreTime, true)\n player.unMute()\n }, 2000)\n }\n }", "rewind() {\r\n\t\t\tthis.looping = false;\r\n\t\t\tthis.goToFrame(0);\r\n\t\t}", "function rewind() {\n target = this.classList[1] - 1;\n\n shownMedia[target].currentTime -= 5;\n }", "rewind() {\n\t\t\t\tthis.frame = 0;\n\t\t\t}", "function retroceder() {\n\n video.currentTime -= 10;\n console.log(video.currentTime)\n}", "resetVideo() {\n this.videoElt.pause();\n this.videoElt.currentTime = 0;\n this.videoElt.style.display = 'none';\n }", "function skipBackward30Sec()\r\n\t{\r\n\t\tmyVideo.currentTime = myVideo.currentTime - 30; //the playback time decreases by 30 seconds\r\n\t}", "function skipForward10Sec()\r\n\t{\r\n\t\tmyVideo.currentTime = myVideo.currentTime + 10; //the playback time increases by ten second\r\n\t}", "rewindGameTime()\n {\n this.specialEffects.prepareCanvasLayersForEffects();\n\n if (this.timeIsRewinding)\n {\n console.log(\"Rewinding\");\n this.specialEffects.performRewindTimeSpecialEffects();\n }\n }", "function reiniciar() {\n\n video.load();\n playPause();\n}", "function stopVideo() {\n // Reset the time to zero\n video.currentTime = 0;\n video.pause();\n\n}", "function resetVid(data){\n\n myPlayer.currentTime(0);\n myPlayer.loop(true);\n myPlayer.play();\n console.log(\"video reset \");\n\n\n}", "function reloadVideo() {\n let icon = playbtn.querySelector('.video-ctrl-bt');\n video.load();\n pauseToPlayBtn(icon);\n videobtn.style.display = 'block';\n videotime.innerHTML = '0:00 / '+videoduration;\n removeVideoListeners();\n videoCtrlTl.reverse();\n videoPlaying = false;\n progressbar.style.width = null;\n }", "function resetVideo(){\n video.removeAttribute('controls')\n video.autoplay=true\n video.src = URL.createObjectURL(stream);\n}", "function forwardVideo(increment) {\n player.currentTime += increment;\n}", "function rWindVid() {\n vidPlayer.currentTime = 0;\n clipBar.value = 0;\n }", "function seek_video()\n {\n if (!(current in timecodes)) return;\n if (!video_elt.contentWindow) video_elt.currentTime = timecodes[current];\n else video_elt.contentWindow.postMessage([\"seek\", timecodes[current]], \"*\");\n }", "function scrubVideo()\r\n\t{\r\n\t\tconst scrubTime = myVideo.duration * ( scrubSlider.value/100 ); //to get the time on the slider; a percentage is formed from the duration of the video multiplied by the slider value divided by 100\r\n\t\tmyVideo.currentTime = scrubTime; //whenever the user uses the slider, it will show the current time of the video (e.g. 100% will be when the video ends)\r\n\t}", "onPreviousVideo() {\n const { controller } = this.props;\n if (typeof controller.rewindOrRequestPreviousVideo === 'function') {\n controller.rewindOrRequestPreviousVideo();\n }\n }", "function skipBackwardToStart()\r\n\t{\r\n\t\tmyVideo.currentTime = 0; //the playback time returns back to 0 seconds\r\n\t\t//if statement; outcome differs depending on conditions\r\n\t\tif ( myVideo.currentTime === 0 )\r\n\t\t{\r\n\t\t\tmyVideo.pause(); //the DOM pause method pauses the video, when clicked\r\n\t\t\tplayButton.innerHTML = \"&#9658;\" ; //updates inside HTML button selector when clicked: turns into a right-pointing pointer made from single Unicode\r\n\t\t\tmyVideo.load(); //DOM load() method re-loads the video\r\n\t\t\tscrubSlider.value = 0; //reset the slider for video playback to zero\r\n\t\t} //end if statement\r\n\t}", "function setVideoTime() {\r\n togglePlayPause();\r\n video.currentTime = (progress.value / 100) * video.duration;\r\n togglePlayPause();\r\n}", "function stepBack(mediaId, rewindBy){\r\n if (!getCurrentPlayer(mediaId))\r\n {\r\n setCurrentPlayer(mediaId);\r\n }\r\n var newTime;\r\n var currentTime;\r\n if(currentPlayer.currentTime)\r\n currentTime = currentPlayer.currentTime\r\n else\r\n currentTime = convertDisplayTimeToSeconds($(\"#ucatJumpToTimeTB_\"+mediaId).val());\r\n \r\n newTime = currentTime - rewindBy;\r\n if(newTime <= rewindBy || newTime <= 0){\r\n newTime = 0;\r\n }\r\n ucatMediaJumpToTime(mediaId, newTime, currentPlayer.isPlaying);\r\n}", "function shiftRight() {\n\tright_video = current_video - 1;\n\tif(right_video < 1) {\n\t\tright_video = vid_array.length-1;\n\t}\n\tswitchToVideo(right_video);\n}", "function seekVideo(browser, currentTime){\n\tbrowser.execute(function(currentTime) {\n\t\t// get the video at a given point\n\t\tvar videoElement = arSession.arSource.domElement\n\t\tvideoElement.pause()\n\t\tvideoElement.currentTime = 4.0\n\t}, currentTime)\t\n}", "function fastForward() {\n target = this.classList[1] - 1;\n\n shownMedia[target].currentTime += 5;\n\n // If fast forward exceeds video length, goes back to beginning of video and pauses\n if(shownMedia[target].currentTime >= shownMedia[target].duration) {\n shownMedia[target].pause();\n shownMedia[target].currentTime = 0;\n playPauseBtn[target].textContent = 'Play';\n }\n }", "async reset() {\n this.setState({\n paused: true,\n rate: 1,\n showHeader: false,\n }, () => this.videoPlayer && this.videoPlayer.seek(0)\n )\n this.progressBar && this.progressBar.updateProgress(0)\n \n }", "onRewind(){\n var { player } = this.state;\n var norm = this.returnToNorm;\n var intervalFunc = setInterval(function(){\n var currentTime = player.getCurrentTime();\n if(currentTime > 5) {\n player.seekTo(currentTime - 5, true);\n } else {\n player.seekTo(0, true);\n norm();\n }\n }, 250);\n this.setState({\n goForward: intervalFunc\n })\n }", "function replayVideo() {\n var icon = document.getElementById(\"replay-icon\");\n var replayText = document.getElementById(\"play-again-txt\");\n var video = document.getElementById(\"save-sharing-video\");\n if (video.paused) {\n video.currentTime = 0;\n video.play();\n icon.style.display = \"none\";\n replayText.style.display = \"none\";\n }\n}", "onVideoSeeked() {\n this.videoFrameReady = true;\n this.drawCurrentFrame();\n }", "function rewind() {\r\n if ( presentSlideNumber == 1 ){\r\n hideSharePopUp();\r\n }\r\n\r\n window.scene.rewind();\r\n presentSlideNumber = 1;\r\n updateState();\r\n }", "function swap() {\n video.remove();\n if (mode === 1){ // using front, swap to rear - 0\n\t video = createCapture({\n audio: false,\n video: {\n facingMode: {ideal:\"environment\"}\n }\n\t });\n mode = 0;\n } else { // using rear, swap to front - 1\n\t video = createCapture({\n audio: false,\n video: {\n facingMode: {ideal:\"user\"}\n }\n\t });\n mode = 1;\n }\n video.elt.setAttribute('playsinline', '');\n video.size(240, 320);\n video.hide();\n mode_div.html(mode)\n}", "seekToTime(time) {\n this.videoPlayer.currentTime(time);\n }", "function resetVideo() {\n // hide image and show video\n image.classList.add(\"hide\");\n video.classList.remove(\"hide\");\n // update instructions overlay\n instructions.innerHTML = \"tap screen to take a snapshot\";\n }", "function _rewindThumbnailSlide() {\n\t\tif (thumbindex > 0) {\n\t\t\tthumbindex--;\n\t\t\t_thumbnailSlide();\n\t\t}\n\t}", "function adelantar() {\n\n \n video.currentTime += 10;\n console.log(video.currentTime)\n}", "function overVideoControl() {\n videoCtrlTl.reverse();\n }", "function btnComenzar() {\n vid.currentTime = 0;\n vid.play();\n}", "changeTime() {\n let video = document.getElementById('video');\n let seekBar = document.getElementById('seek-bar');\n \n var time = video.duration * (seekBar.value / 100);\n\n video.currentTime = time;\n this.calculateTime();\n }", "function autoVideo() {\r\n // Reloop the list of videos from the first movie\r\n if (position == movieInfo.length) {\r\n position = 0;\r\n document.getElementsByTagName(\"video\")[0].onended = function () {\r\n setTimeout(autoVideo, 2000);\r\n };\r\n }\r\n\r\n document.getElementById(\"mp4\").src = movieInfo[position].src;\r\n document.getElementById(\"ogg\").src =\r\n movieInfo[position].src.substring(0, movieInfo[position].src.length - 3) +\r\n \"ogg\";\r\n document.getElementsByTagName(\"video\")[0].load();\r\n\r\n position++;\r\n}", "function restartPlaybackAtCurrentPosition() {\n\t\t\t\t//unregister event listeners so that actions here aren't captured by analytics\n\t\t\t\tunregisterWindowResizeEvent();\n\t\t\t\tunregisterPlayerEvents();\n\n\t\t\t\tvar playerTime = player.input.time;\n\n\t\t\t\t//stop and restart playback\n\t\t\t\tplayer.playlist.stop();\n\t\t\t\tplayer.playlist.play();\n\n\t\t\t\t//restore the playback position (except for live streams)\n\t\t\t\tif (!scope.stream.isLive) {\n\t\t\t\t\tplayer.input.time = playerTime;\n\t\t\t\t}\n\n\t\t\t\t//restore event listeners\n\t\t\t\tregisterPlayerEvents();\n\t\t\t\tregisterWindowResizeEvent();\n\t\t\t}", "function restart()\n{\n\tsetTimeout(function ()\n\t{\n\t\tmuziek.currentTime = 1; muziek.play(); restart();\n\t}, (muziek.duration - 1) * 1000);\n}", "restart() {\n this.reset();\n this.movie = false;\n this.displayMovie = false;\n this.movieArray = [];\n this.lastMovie = 0;\n }", "function forwardButtonTrigger() {\n if (window.currentVideoSelectedForPlayback) {\n setCurrentlyPlaying(false)\n const currentNode = window.currentVideoSelectedForPlayback\n const currentTime = currentNode.data.videoCore.currentTime\n const currentVideoEnd = currentNode.data.metadata.endTime\n\n if (currentTime + 1 < currentVideoEnd) {\n currentNode.data.videoCore.currentTime += 1\n } else if (currentNode.next) {\n const remainingTime = 1 - currentTime\n window.currentVideoSelectedForPlayback = currentNode.next\n const nextStartTime = window.currentVideoSelectedForPlayback.data.metadata.startTime\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = nextStartTime + remainingTime\n } else {\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = currentVideoEnd\n }\n renderUIAfterFrameChange(window.currentVideoSelectedForPlayback)\n }\n}", "function pauseCurrentVideo() {\n \tisPlaying = false;\n \tvideo.pauseVideo();\n }", "function rewindSlide() {\n if (currentSlide > 0) {\n currentSlide -= 1;\n updateSlide();\n }\n}", "function rewindAudio(){\n var oAudio = document.getElementById('myaudio');\n oAudio.currentTime -= 3.0;\n}", "function endOfVideo() {\n\n\tif(videoOne.currentTime > 144 && videoOne.currentTime < 145) {\n\n\t\tendingWindow.classList.add(\"move-content-ending\");\n\n\t\tvideoOne.pause();\n\t\tvideoTwo.pause();\n\t\tvideoThree.pause();\n\n\t\taudioThree.pause();\n\t\taudioOne.pause();\n\n\n\n\t} else {\n\n\t}\n\n}", "function videoPause() {\n video.pause();\n }", "function videoPause() {\n video.pause();\n }", "function moveForward() {\n if (autoMove) {\n if (new Date() - time > 10) {\n // Update view matrix via the camera\n mat4.invert(camera, viewMat);\n mat4.translate(camera, camera, vec3.fromValues(0, 0, -.01));\n mat4.invert(viewMat, camera);\n\n time = Date.now();\n }\n // Refresh screen then keep running in a loop\n gl.uniformMatrix4fv(viewUnif, false, viewMat);\n drawScene();\n //window.requestAnimFrame(moveForward);\n }\n}", "function previousFile(time) {\n // if already displaying the first one, do nothing.\n if (currentFileIndex === 0)\n return;\n\n // Don't pan a playing video!\n if (currentFrame.displayingVideo && !currentFrame.video.player.paused)\n currentFrame.video.pause();\n\n // Set a flag to ignore pan and zoom gestures during the transition.\n transitioning = true;\n setTimeout(function() { transitioning = false; }, time);\n\n // Set transitions for the visible frames\n var transition = 'transform ' + time + 'ms ease';\n previousFrame.container.style.transition = transition;\n currentFrame.container.style.transition = transition;\n\n // Transition to the previous item: previous becomes current, current\n // becomes next, etc.\n var tmp = nextFrame;\n nextFrame = currentFrame;\n currentFrame = previousFrame;\n previousFrame = tmp;\n currentFileIndex--;\n\n // Move (transition) the frames to their new position\n resetFramesPosition();\n\n // Preload the new previous item\n setupFrameContent(currentFileIndex - 1, previousFrame);\n\n // When the transition is done do some cleanup\n currentFrame.container.addEventListener('transitionend', function done(e) {\n this.removeEventListener('transitionend', done);\n // Reset the size and position of the item that just panned off\n nextFrame.reset();\n });\n\n // Disable the edit button if we're now viewing a video, and enable otherwise\n if (currentFrame.displayingVideo)\n $('fullscreen-edit-button').classList.add('disabled');\n else\n $('fullscreen-edit-button').classList.remove('disabled');\n}", "function movePlaySlider()\r\n\t{\r\n\t\tscrubSlider.value = ( myVideo.currentTime/myVideo.duration )* 100; //creates a percentage to match the slider position to the current playback time\r\n\t}", "function replayMedia() {\n resetPlayer();\n player.play();\n}", "function CloseVideoScreen() {\n watchingVideo = false\n\n var videoElm = document.getElementById(\"vs-video\")\n\n videoElm.pause()\n videoElm.currentTime = 0\n document.getElementById(\"video-wrap\").classList.add(\"closed\")\n}", "function scrollPlay(){ \n var frameNumber = window.pageYOffset/playbackConst;\n vid.currentTime = frameNumber;\n window.requestAnimationFrame(scrollPlay);\n }", "function sleepCam(){\n baseServo.move(90);\n camServo.move(0);\n }", "function prevFrame(){\n // Protecting lower bounds\n if (frame === 1){\n console.log('No Previous Frame')\n return\n }\n setFrame(frame - 1)\n console.log('Previous Frame')\n playerRef.current.seekTo(frame / 60)\n console.log(frame)\n console.log(frame / 60)\n }", "function backButtonTrigger() {\n if (window.currentVideoSelectedForPlayback) {\n setCurrentlyPlaying(false)\n const currentNode = window.currentVideoSelectedForPlayback\n const currentTime = currentNode.data.videoCore.currentTime\n const currentVideoStart = currentNode.data.metadata.startTime\n\n if (currentTime - currentVideoStart > 1) {\n currentNode.data.videoCore.currentTime -= 1\n } else if (currentNode.prev) {\n const remainingTime = 1 - currentTime\n window.currentVideoSelectedForPlayback = currentNode.prev\n const prevEndTime = window.currentVideoSelectedForPlayback.data.metadata.endTime\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = prevEndTime - remainingTime\n } else {\n window.currentVideoSelectedForPlayback.data.videoCore.currentTime = currentVideoStart\n }\n renderUIAfterFrameChange(window.currentVideoSelectedForPlayback)\n }\n}", "function goToTime(t) {\n //console.log('goto', t);\n if (t == -2) {\n window.close();\n return;\n } else if (t == -1) {\n t = game.start;\n }\n player.seekTo(t, true);\n player.playVideo();\n nextTimePoint = getNext(t);\n}", "function thumbNowPlaying() {\n var offset = $(curTarget).offset();\n if (thumbTimeout) {\n clearInterval(thumbTimeout);\n }\n $(video_thumb).css(offset);\n //console.log(\"Moving video to \" + offset);\n $(video_thumb).show();\n thumbTimeout = setInterval(thumbShotTrigger, (extractTime(segment_list[cur_segment].end) - extractTime(segment_list[cur_segment].begin)) * 1000);\n video_thumb.removeEventListener(\"playing\", thumbNowPlaying);\n }", "function reproductor(video0,video, video2,video3,video4,video6,video7,video8,video9,video10){\n\n\tvideo6.style.opacity = \"0\";\n\tvideo7.style.opacity = \"0\";\n\tvideo8.style.opacity = \"0\";\n\tvideo9.style.opacity = \"0\";\n\tvideo10.style.opacity = \"0\";\n\n\tvideo0.load();\n\tvideo.load();\n\tvideo2.load();\n\tvideo3.load();\n\tvideo4.load();\n\t\n\n\tvideo.addEventListener('loadeddata', function() {\n\t\tvideo0.currentTime = 0;\n\t\tvideo0.play();\n\n\t\tvideo.currentTime = 0;\n\t\tvideo.style.opacity = \"1\";\n\t\tvideo.play();\n\n\t\tvideo2.currentTime = 0;\n\t\tvideo2.style.opacity = \"1\";\n\t\tvideo2.play(); \n\n\t\t\n\t\tvideo3.currentTime = 0;\n\t\tvideo3.style.opacity = \"1\";\n\t\tvideo3.play();\n\n\t\n\t\tvideo4.currentTime = 0;\n\t\tvideo4.style.opacity = \"1\";\n\t\tvideo4.play();\t })\t\t\t\t\n\n\tvar i = 0;\n\tvar x = 0;\n\tvar y = 0;\n\tvar z = 0;\n\tvar v = 0;\n\tvar w = 0;\n\tvar times=0;\n\tvar cadena=0;\n\n\tvideo.onended = function() {\t\t\n\t\tif (i < times){\n\t\t\ti++;\n\t\t\tvideo.play(); \n\t\t}else{ \n\t\t\tvideo.style.opacity = \"0\";\n\t\t\tvideo2.style.opacity = \"0\";\n\t\t\tvideo3.style.opacity = \"0\";\n\t\t\tvideo4.style.opacity = \"0\";\n\n\t\t\t\n\t\t\tvideo6.load();\n\t\t\tvideo7.load();\n\t\n\t\t\tvideo6.currentTime = 0;\n\t\t\tvideo6.style.opacity = \"1\";\n\t\t\tvideo6.play()\n\n\t\t\tvideo7.currentTime = 0;\n\t\t\tvideo7.style.opacity = \"1\";\n\t\t\tvideo7.play()\n\t\n\t\t}\n\t};\n\tvideo7.onended = function() {\n\t\tvideo7.currentTime = 0;\n\t\tvideo6.currentTime = 0;\n\t\tvideo6.style.opacity = \"0\";\n\t\tvideo7.style.opacity = \"0\";\n\n\t\tvideo8.load();\t\n\t\tvideo8.currentTime = 0;\n\t\tvideo8.style.opacity = \"1\";\n\t\tvideo8.play()\n\n\t\t\t\n\t};\n\tvideo8.onended = function() {\n\t\tvideo8.currentTime = 0;\n\t\tvideo8.style.opacity = \"0\";\n\n\t\tvideo10.load();\t\n\t\tvideo10.currentTime = 0;\n\t\tvideo10.style.opacity = \"1\";\n\t\tvideo10.play()\t\n\t};\n\tvideo9.onended = function() {\n\t\tvideo9.currentTime = 0;\n\t\tvideo9.style.opacity = \"0\";\n\n\t\tvideo10.load();\t\n\t\tvideo10.currentTime = 0;\n\t\tvideo10.style.opacity = \"1\";\n\t\tvideo10.play()\t\t\n\t};\n\tvideo10.onended = function() {\n\t\tvideo10.currentTime = 0;\n\t\tvideo10.style.opacity = \"0\";\n\t};\n\n\tvideo.onerror = function() {\n\t\talert(\"Chrome blocks Shia on this page:( Try on another one!\");\n\t};\n}", "function changeToNextFrame() {\n if (_currentTime === undefined) {\n _currentTime = getBeginDate().getTime();\n\n } else {\n var deltaTime = getResolution();\n _currentTime = _currentTime + deltaTime > getEndDate().getTime() ? getBeginDate().getTime() : _currentTime + deltaTime;\n }\n MyController.events.triggerEvent(\"timechanged\", {\n time : _currentTime\n });\n }", "function retake() {\n video.play();\n snapButton.onclick = snap;\n snapButton.value = \"Capture\";\n document.getElementById(\"editor\").innerHTML = \"\";\n document.getElementById(\"calculate\").style.display = \"none\";\n canvas.style.display = \"none\";\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n}", "function start() {\n media.currentTime = 0;\n }", "function startPlayback() { \n setTimeout(moveForward, slideInterval);\n}", "function drawVedio() {\n setTimeout(() => {\n canvas.getContext(\"2d\").drawImage(video, 0, 0, 100, 100);\n drawVedio();\n }, 0);\n }", "function sync() {\n if (videos.b.media.readyState === 4) {\n videos.b.currentTime(\n videos.a.currentTime() + offsetSecond\n );\n }\n // 方法通知瀏覽器我們想要產生動畫,並且要求瀏覽器在刷新畫面前呼叫特定函數刷新動畫\n requestAnimationFrame(sync);\n }", "function playnext(){\n document.getElementById(\"vtc\").innerHTML = \"Overclock your CPU with BIOS\";\n video.autoplay=\"autoplay\"; //autopaly second video after video1 fingished \n video.src=\"video/p2.mp4\"; //play second video\n }", "function togglePlayVideo() {\n let icon = playbtn.querySelector('.video-ctrl-bt');\n if(video.paused) {\n videoduration = convertSecondsToMinutes(video.duration);\n overvideo.style.backgroundColor = 'transparent';\n video.play();\n playToPauseBtn(icon);\n videobtn.style.display = 'none';\n addVideoListeners();\n outVideoControl();\n videoPlaying = true;\n }\n else {\n video.pause();\n pauseToPlayBtn(icon);\n videobtn.style.display = 'block';\n removeVideoListeners();\n videoCtrlTl.reverse();\n videoPlaying = false;\n }\n }", "function PlayExpandedIntroVideo () {\r\ncreative.dom.video1.vid.play();\r\ncreative.dom.video1.vid.currentTime = 0;\r\n}", "function onPlayerReady() {\r\n player.playVideo();\r\n /*let time = player.getCurrentTime();\r\n if(player.stopVideo()){\r\n let time2 = player.getCurrentTime();\r\n \r\n player.playVideo(time2);\r\n }*/\r\n \r\n }", "function _rewindThumbnailScroll() {\n\t\tif (thumbindex < 0) {\n\t\t\tstopSlideshow();\n\n\t\t\tvar target = {};\n\t\t\ttarget[rtlpos] = 0;\n\t\t\tthumbs.animate(target, -4 * _getRTLPosition(thumbs), 'linear', _updateThumbnailNavigation); // \"left\" (or \"right\" for RTL) is always a negative number\n\t\t}\n\t}", "function updateTime(time) {\n domVideo.currentTime = time;\n}", "function resetAllVideo() {\n localStorage.view1 = undefined;\n localStorage.view2 = undefined;\n localStorage.view3 = undefined;\n gVideoCounter = 1;\n\n // Stop all streams to unlock the cameras.\n for (var id in gStreams) {\n gStreams[id].getVideoTracks()[0].stop();\n }\n // Reset the video tags to avoid the frozen image.\n for (var i=1; i<=2; i++) {\n var videoTag = $('vid' + i);\n if (videoTag.currentTime > 0) {\n videoTag.currentTime = 0;\n videoTag.load();\n }\n }\n}", "function switchVideo(n) {\r\n document.getElementsByTagName(\"video\")[0].pause();\r\n\r\n document.getElementById(\"mp4\").src = movieInfo[n].src;\r\n document.getElementById(\"ogg\").src =\r\n movieInfo[n].src.substring(0, movieInfo[n].src.length - 3) + \"ogg\";\r\n document.getElementsByTagName(\"video\")[0].load();\r\n\r\n // Change the position in the list\r\n position = n + 1;\r\n}", "function stopVideo() {\n if (vid.currentTime >= stopTime && state == 1) {\n \tvid.pause();\n state = 0;\n }\n}", "function trackVideoEnd() {\n\n flushParams();\n correlateMediaPlaybackEvents();\n s.Media.stop(videoFileName, videoStreamLength);\n s.Media.close(videoFileName);\n }", "function stopVideo() {\r\n player.pauseVideo();\r\n }", "function hoverVideo(e) { \n\t $('video', this).get(0).play(); \n $('video', this).removeClass('gris');\n // $('video', this).get(0).currentTime = 3;\n \n\n\t}", "function timeupdate() {\n var lastBuffered = video.buffered.end(video.buffered.length-1);\n seekbar.min = video.startTime;\n seekbar.max = lastBuffered;\n seekbar.value = video.currentTime;\n $('#timer').html(formatTime(video.currentTime));\n if(review == true)\n {\n\t sk.min = video.startTime;\n\t sk.max = lastBuffered;\n\t sk.value = video.currentTime;\n\t reviewText();\n }\n}", "function piloteVideo() {\r\n\t\tif (roi.paused) {\r\n\t\t\troi.play();\r\n \r\n\t\t} else {\r\n\t\t\troi.pause();}\r\n }", "function playPrevVideo() {\n var index\n if (position < 0) {\n position = position + 62\n imageHolder.style.left = String(position) + \"vw\"\n imageHolder.style.transition =\"all 1s ease\"\n index = position / (-62)\n videoTitle.textContent = ids[index][\"title\"]\n description.textContent = ids[index][\"info\"]\n } else if (position === 0) {\n position = (ids.length-1) * (-62)\n imageHolder.style.left = String(position) + \"vw\"\n imageHolder.style.transition = \"left 0.5s ease\"\n index = position / (-62)\n videoTitle.textContent = ids[index][\"title\"]\n description.textContent = ids[index][\"info\"]\n }\n}", "function advance() {\r\n clearTimeout(timeout);\r\n\r\n timeout = setTimeout(function () {\r\n if (currentIndex < ($slides.length - 1)) {\r\n move(currentIndex + 1);\r\n }\r\n else {\r\n move(0);\r\n }\r\n }, 400000);\r\n }", "function startVideo() {\n\n // start video\n vid.play();\n // start tracking\n ctrack.start(vid);\n trackingStarted = true;\n // start loop to draw face\n// drawLoop();\t\n\tvar t2 = setTimeout(\"drawLoop()\",10000);\t\n setCommandValue(\"System is loading ...\");\n var t2 = setTimeout(\"setCommandValue('Round 1, ready? 😎')\",4000);\n var t2 = setTimeout(\"setCommandValue('Now, follow my order 😜')\",7000);\n var t2 = setTimeout(\"setCommandValue('Show your happy to endless work 😅')\",10000);\n var t9 = setTimeout(\" round1 = true\",10000);\n\n}", "function restartSong() {\n\taid.currentTime = 0;\n}", "resetState({ commit }) {\n videoPlayer.resetState();\n commit(types.UPDATE_CURRENT_VIDEO, false);\n }", "function goToTimeDuration(id_video, time) {\n $(\".img_play_video\").hide();\n var vid = document.getElementById(id_video);\n vid.currentTime = time;\n vid.play();\n}", "nextFrame() {\r\n\t\t\tif (this.frame < this.length - 1) this.frame = this.frame + 1;\r\n\t\t\telse if (this.looping) this.frame = 0;\r\n\r\n\t\t\tthis.targetFrame = -1;\r\n\t\t\tthis.playing = false;\r\n\t\t}", "function updateVideoCurrentTime() {\n let curtime = convertSecondsToMinutes(video.currentTime);\n videotime.innerHTML = curtime+' / '+videoduration;\n }", "function WeBack(theMode) {\n Mode = theMode;\n ModeCheck(Mode);\n\n areAnimated = [false, false, false, false];\n document.getElementById(\"nextVid\").style.display = \"none\";\n Learn_video.currentTime = 0;\n Learn_video.src = arrVideoList[0].name;\n Learn_video.play();\n console.log(arrVideoList[0].emotions);\n}", "function seek(time)\n{\n\tif (bDebug) {\n\t\tconsole.log('Media: Seeking to time: ' + time);\n\t}\n\n\tif (sBrowser === 'mobile' || sBrowser === 'ipad' || bIsHtml5) {\n\t\t// if the video is not playing, start it and function calls itself again\n\t\tmodVid.getIsPlaying(function(isPlaying) {\n\t\t\tif (isPlaying === true) {\n\t\t\t\tmodVid.seek(time);\n\t\t\t}\n\t\t\telse\n\t\t\t{\t// function recalls itself till result is true\n\t\t\t\tmodVid.play();\n\t\t\t\tseek(time);\n\t\t\t}\n\t\t});\n\t}\n\telse\n\t{\n\t\tif (modVid.isPlaying())\n\t\t{\n\t\t\tmodVid.seek(time);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tqueuedTime = time;\n\t\t\tmodVid.play();\n\t\t}\n\t}\n}", "function replayHandler1(e) {\n\n theTimeline.seek(0);\n theTimeline.stop();\n\n creative.dom.expandedHeading.style.opacity = 0;\n creative.dom.expandedBgr.style.opacity = 0;\n creative.dom.expandedCopy.style.opacity = 0;\n\n creative.dom.video1.vidContainer.style.opacity = 1;\n\n Enabler.counter(\"Replay video 1\", true);\n creative.dom.video1.vid.currentTime = 0;\n creative.dom.video1.vid.play();\n creative.dom.video1.vid.volume = 1.0;\n creative.dom.video1.vidUnmuteBtn.style.visibility = 'hidden';\n\n creative.dom.video1.vidMuteBtn.style.visibility = 'visible';\n\n //start end frame tween animation\n //endFrameAnimation();\n //creative.dom.expandedHeading.style.display = 'block';\n\n}", "function playCurrentVideo() {\n \tisPlaying = true;\n \tvideo.playVideo();\n }", "function setVideoProgress(){\n // return true;\n video.currentTime = (+progress.value * video.duration) / 100;\n}", "function nextFile(time) {\n // If already displaying the last one, do nothing.\n if (currentFileIndex === files.length - 1)\n return;\n\n // Don't pan a playing video!\n if (currentFrame.displayingVideo && !currentFrame.video.player.paused)\n currentFrame.video.pause();\n\n // Set a flag to ignore pan and zoom gestures during the transition.\n transitioning = true;\n setTimeout(function() { transitioning = false; }, time);\n\n // Set transitions for the visible frames\n var transition = 'transform ' + time + 'ms ease';\n currentFrame.container.style.transition = transition;\n nextFrame.container.style.transition = transition;\n\n // Cycle the three frames so next becomes current,\n // current becomes previous, and previous becomes next.\n var tmp = previousFrame;\n previousFrame = currentFrame;\n currentFrame = nextFrame;\n nextFrame = tmp;\n currentFileIndex++;\n\n // Move (transition) the frames to their new position\n resetFramesPosition();\n\n // Update the frame for the new next item\n setupFrameContent(currentFileIndex + 1, nextFrame);\n\n // When the transition is done, cleanup\n currentFrame.container.addEventListener('transitionend', function done(e) {\n this.removeEventListener('transitionend', done);\n\n // Reposition the item that just transitioned off the screen\n // to reset any zooming and panning\n previousFrame.reset();\n });\n\n // Disable the edit button if we're now viewing a video, and enable otherwise\n if (currentFrame.displayingVideo)\n $('fullscreen-edit-button').classList.add('disabled');\n else\n $('fullscreen-edit-button').classList.remove('disabled');\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 setProgressBackward() {\n isPlaying = \"paused\"\n // Firstly we will set idNextSong to true.\n playNextSong = true\n // If we hold the backward button for 1 sec, then this function will execute and it will decrease the current time of mediany 30 sec else it will play the next song.\n setTimeout(function () {\n try {\n currentTimeAccurate -= 30.0;\n media.currentTime -= 30.0;\n document.getElementById(\"progress-bar\").style.width = `${(currentTimeAccurate / duration) * 100}%`;\n }\n catch (err) { }\n // Now as we don't have to play next song, then set playNextSong variable to false.\n playNextSong = false\n }, 1000)\n}", "function stopVideo() {\n player.stopVideo();\n clearInterval(videoProgress);\n }" ]
[ "0.7942025", "0.7152836", "0.7088374", "0.69246083", "0.67662406", "0.6706276", "0.66731083", "0.6651095", "0.6614244", "0.65366465", "0.6421747", "0.64172256", "0.6397", "0.6352967", "0.63216233", "0.62962365", "0.62938714", "0.62787235", "0.6264922", "0.6215699", "0.6154194", "0.61524236", "0.61304194", "0.6110867", "0.60500175", "0.6043044", "0.60158974", "0.600735", "0.59870523", "0.59743136", "0.58979046", "0.58902246", "0.58870953", "0.5878584", "0.5866547", "0.5859266", "0.5847963", "0.5838718", "0.58308846", "0.5795583", "0.57718736", "0.5766784", "0.57407796", "0.5715399", "0.5682511", "0.5680835", "0.56779826", "0.56521964", "0.5651257", "0.561619", "0.561619", "0.5603553", "0.5602835", "0.55936974", "0.5589749", "0.5583646", "0.5567658", "0.5558447", "0.55491203", "0.5548409", "0.55301195", "0.5529468", "0.5529212", "0.54974896", "0.54856944", "0.5480497", "0.547611", "0.54730296", "0.54688394", "0.54606956", "0.54565096", "0.54521215", "0.5450557", "0.5448315", "0.5443477", "0.5438988", "0.5436491", "0.5434743", "0.54342926", "0.54265696", "0.54260725", "0.54238015", "0.5418288", "0.5416584", "0.5402242", "0.5401512", "0.53936213", "0.539087", "0.5390478", "0.5387752", "0.53794336", "0.53719246", "0.536849", "0.5367924", "0.5359538", "0.5356623", "0.5354283", "0.5350816", "0.53484535", "0.5340194" ]
0.858974
0
carouselLeftArrow carousel controls on bottom
function carouselLeftArrow(){ $(".carousel").carousel('prev'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function slideLeft() {\n var parent = $(this).closest('.carousel');\n var items = $.makeArray(parent.find('.item:not(.hidden)'));\n if (items.length == 1) {\n //already at the end\n return;\n }\n var item = $(items.shift());\n item.animate({'margin-left': item.width()*-1, opacity: '0%'}, 'slow', 'linear', function() {\n item.addClass('hidden').removeClass('active')\n $(items.shift()).addClass('active');\n setIndicator(parent);\n });\n}", "function addCarouselMoving($carousel)\n {\n $carousel.find('.owl-item').on('click', function(){\n if($(this).prev().hasClass('center')) {\n $carousel.trigger('next.owl.carousel');\n } else if ($(this).next().hasClass('center')) {\n $carousel.trigger('prev.owl.carousel');\n }\n });\n }", "function leftArrowHandle(){\n let new_val = slides[slides.length - 1].props.slideNum + slides_count -1\n if (new_val > slides_arr.length-1) new_val = new_val - slides_arr.length\n if (slides_count ===1){\n new_val = slides[0].props.slideNum -1\n if (new_val < 0) new_val = slides_arr.length - 1\n }\n const updated = slides.slice(0,slides_count-1)\n setSlides([slides_arr[new_val],...updated])\n }", "function carouselRightArrow(){\n if($('#tdList-20').attr('videoID') === '') {\n return;\n } else if ($('#tdList-40').attr('videoID') === '' && currentSlideNumber % 2 === 0) {\n return;\n }\n $(\".carousel\").carousel('next');\n}", "function shiftCarousel(carousel, direction) {\n const numberOfSlides = carousel.querySelectorAll('.iw-carousel__inner img').length;\n const currentSlideIndex = Number(carousel.querySelector('.iw-carousel__indicators .active').dataset.slideTo);\n let newSlideIndex = currentSlideIndex + direction;\n if (newSlideIndex >= numberOfSlides)\n newSlideIndex = 0;\n if (newSlideIndex < 0)\n newSlideIndex = numberOfSlides - 1;\n showCarouselSlide(carousel, newSlideIndex);\n}", "function checkCarouselSlide() {\n var arrow_left = $(\".message_bot_area .footer_message_input .carousel_slide [data-slide='prev']\"),\n arrow_right = $(\".message_bot_area .footer_message_input .carousel_slide [data-slide='next']\");\n\n if ($('.message_bot_area .generic_group.active .generic_container .generic_box').length > 1) {\n if($('.message_bot_area .generic_group.active .generic_container .generic_box:last-child').hasClass('active')) {\n arrow_right.hide();\n arrow_left.show();\n } else if($('.message_bot_area .generic_group.active .generic_container .generic_box:first-child').hasClass('active')) {\n arrow_right.show();\n arrow_left.hide();\n } else {\n arrow_right.show();\n arrow_left.show();\n }\n } else {\n arrow_right.hide();\n arrow_left.hide();\n }\n //re-active Carousel indicator (Because move indicator to outsite Carousel div)\n var indexActive = $('.message_bot_area .generic_container .generic_box.active').index();\n $('.message_bot_area .footer_message_input .generic_indicators li').removeClass('active');\n $('.message_bot_area .footer_message_input .generic_indicators li').eq(indexActive).addClass('active');\n}", "function moveCarousel(btn) {\n const inner = $($(btn).parent()).find(\".CustomCarousel-inner\");\n let items = inner.find(\".item\");\n let visibleItems = inner.find(\".item.Visib\").length;\n let amount = visibleItems;\n if (items.length - visibleItems < visibleItems)\n amount = items.length - visibleItems;\n\n const condition = $(btn).hasClass(\"btn-prev\");\n items.hide();\n for (let i = 0; i < amount; i++) {\n items = inner.find(\".item\");\n if (condition) {\n items[0].before(items[items.length - 1]);\n } else {\n items[items.length - 1].after(items[0]);\n }\n }\n resizeCarousel(inner.parent());\n}", "function setSlickArrow(){\n\n if ( $(\".slider-destination .slick-slide\").length){\n var s = Math.round($('.slider-destination img').height() + 6);\n $( '.slider-destination .slick-prev, .slider-destination .slick-next').css('top', s);\n\n } \n }", "prev() {\n const self = this;\n $('.mdi-chevron-right').removeClass('product-carousel__icon--disable'); \n\n const slider = $('.product-carousel__slider');\n const offsetLeft = parseInt(slider.css('left').replace('px', '')); \n const divider = (Math.abs(offsetLeft) / this.state.productSize);\n\n if (Math.abs(offsetLeft) < this.state.productSize) {\n this.updateDimensions(self);\n } \n else {\n let left = 0; \n \n if (offsetLeft < 0) { \n if (divider % 1 == 0) {\n left = offsetLeft + this.state.productSize;\n }\n else {\n const extraSpace = offsetLeft - -Math.abs(this.state.productSize * Math.floor(divider));\n left = offsetLeft - extraSpace; \n }\n }\n \n slider.css(\"left\",`${left}px`);\n } \n }", "renderArrowBtns () {\n const { theme } = this.props\n return (\n <div className={`carouselNav`}>\n <a className={cls(style.prevIcon, theme.prevIcon)} onClick={(e) => this.moveSlide('prev')} />\n <a className={cls(style.nextIcon, theme.nextIcon)} onClick={(e) => this.moveSlide('next')} />\n </div>\n )\n }", "function slideRight() {\n var parent = $(this).closest('.carousel');\n var items = $.makeArray(parent.find('.item.hidden'));\n if (items.length == 0) {\n //already at the beginning\n return;\n }\n parent.find('.item.active').removeClass('active');\n var item = $(items.pop());\n item.removeClass('hidden').animate({'margin-left': '0', opacity: '100%'}, 'slow', 'linear', function(){ setIndicator(parent);}).addClass('active');\n}", "function myMoveLeft() { //ad ogni click sulla freccia di sinistra\n scrollPosition = scrollPosition - scrollChange; //sottraggo alla posizione iniziale il valore di cambiamento settato \n carousel.scrollTo(scrollPosition, 0); //vado ad assegnare la posizione finale al contenitore sull'asse x\n}", "function setPositionSliderArrows() {\r\n let slideWidth = document.querySelector(\".together-cheaper-box\").offsetWidth;\r\n let currentSliderWidth = document.querySelector(\".together-cheaper-slider\").offsetWidth;\r\n let sliderArrowPrev = document.getElementsByClassName(\"together-cheaper-slider-arr-prev\")[0];\r\n let sliderArrowNext = document.getElementsByClassName(\"together-cheaper-slider-arr-next\")[0];\r\n let sliderArrowWidth = sliderArrowPrev.offsetWidth;\r\n let sliderArrowPosition = currentSliderWidth/2-slideWidth/2-sliderArrowWidth/2;\r\n sliderArrowPrev.style.left = sliderArrowPosition+\"px\";\r\n sliderArrowNext.style.right = sliderArrowPosition+\"px\";\r\n}", "function slideArrowHandler() {\n var section = $(this).closest(SECTION_SEL);\n\n if ($(this).hasClass(SLIDES_PREV)) {\n if (isScrollAllowed.m.left) {\n moveSlideLeft(section);\n }\n } else {\n if (isScrollAllowed.m.right) {\n moveSlideRight(section);\n }\n }\n }", "function prev(){\n // If on first item go to end, otherwise go to previous item\n if ( currentItem - 1 < 0 ){\n currentItem = carouselItems.length - 1;\n } else {\n currentItem--;\n }\n updateCarousel();\n }", "function slideArrowHandler(){\n var section = $(this).closest(SECTION_SEL);\n\n if ($(this).hasClass(SLIDES_PREV)) {\n if(isScrollAllowed.m.left){\n moveSlideLeft(section);\n }\n } else {\n if(isScrollAllowed.m.right){\n moveSlideRight(section);\n }\n }\n }", "function slideArrowHandler(){\n var section = $(this).closest(SECTION_SEL);\n\n if ($(this).hasClass(SLIDES_PREV)) {\n if(isScrollAllowed.m.left){\n moveSlideLeft(section);\n }\n } else {\n if(isScrollAllowed.m.right){\n moveSlideRight(section);\n }\n }\n }", "function slide(dir) {\n let active_index = $('.active-img').index();\n let new_index;\n if (dir == 'right') {\n new_index = active_index + 1;\n if (new_index == $('.carousel').children('li').length - 1) {\n new_index = 0;\n };\n } else if (dir == 'left') {\n new_index = active_index - 1;\n if (new_index == 0) {\n new_index = $('.carousel').children('li').length - 1;\n };\n };\n slideTo(new_index);\n}", "function slideArrowHandler(){\n var section = $(this).closest(SECTION_SEL);\n\n if ($(this).hasClass(SLIDES_PREV)) {\n if(isScrollAllowed.m.left){\n FP.moveSlideLeft(section);\n }\n } else {\n if(isScrollAllowed.m.right){\n FP.moveSlideRight(section);\n }\n }\n }", "function slideArrowHandler(){\n var section = $(this).closest(SECTION_SEL);\n\n if ($(this).hasClass(SLIDES_PREV)) {\n if(isScrollAllowed.m.left){\n FP.moveSlideLeft(section);\n }\n } else {\n if(isScrollAllowed.m.right){\n FP.moveSlideRight(section);\n }\n }\n }", "function nextArrow(){\r\n // Utilizziamo una variabile per indicare la condizione iniziale dell'active, il quale si dovrà spostare nelle immagini successive al click.\r\n var immagini = $('.images img.active');\r\n // Dobbiamo prima togliere la classe 'active' dall'immagine iniziale e, dopo, aggiungere 'active' all'immagine successiva.\r\n immagini.removeClass('active');\r\n immagini.next().addClass('active');\r\n // La condizione if permette di far ritornare la classe 'active' dall'ultima immagine (last) alla prima immagine (first).\r\n if (immagini.hasClass('last')) {\r\n $('.images img.first').addClass('active');\r\n }\r\n // Adesso dobbiamo cambiare il colore dei pallini della navbar che devono diventare blu quando si clicca. Utilizziamo una variabile per indicare la condizione iniziale dell'active.\r\n var pallinoBlu = $('.nav i.active');\r\n // La classe 'active' passa dal primo pallino (first) al pallino successivo.\r\n pallinoBlu.removeClass('active');\r\n pallinoBlu.next().addClass('active');\r\n // if permette di far ritornare la classe 'active' dall'ultimo pallino (last) al prima pallino (first).\r\n if (pallinoBlu.hasClass('last')) {\r\n $('.nav i.first').addClass('active');\r\n }\r\n}", "function rightArrowHandle(){\n let new_val = slides[0].props.slideNum + slides_count\n if (new_val > slides_arr.length-1) new_val = new_val - slides_arr.length\n const updated = slides.slice(1,slides_count)\n setSlides([...updated,slides_arr[new_val]])\n }", "function slideArrowHandler(){\r\n var section = $(this).closest(SECTION_SEL);\r\n\r\n if ($(this).hasClass(SLIDES_PREV)) {\r\n if(isScrollAllowed.m.left){\r\n moveSlideLeft(section);\r\n }\r\n } else {\r\n if(isScrollAllowed.m.right){\r\n moveSlideRight(section);\r\n }\r\n }\r\n }", "function slideArrowHandler(){\r\n var section = $(this).closest(SECTION_SEL);\r\n\r\n if ($(this).hasClass(SLIDES_PREV)) {\r\n if(isScrollAllowed.m.left){\r\n moveSlideLeft(section);\r\n }\r\n } else {\r\n if(isScrollAllowed.m.right){\r\n moveSlideRight(section);\r\n }\r\n }\r\n }", "function slideArrowHandler(){\r\n var section = $(this).closest(SECTION_SEL);\r\n\r\n if ($(this).hasClass(SLIDES_PREV)) {\r\n if(isScrollAllowed.m.left){\r\n moveSlideLeft(section);\r\n }\r\n } else {\r\n if(isScrollAllowed.m.right){\r\n moveSlideRight(section);\r\n }\r\n }\r\n }", "function moveCarousel() {\n let transformValue = carouselItemsActiveIndex * carouselWrapWidth;\n carouselList.style.transform =\n \"translate3d(-\" + transformValue + \"px, 0px, 0px)\";\n addActiveToItem();\n addTransition();\n setActivePagination();\n setButtonAttr();\n}", "function leftArrow() {\n clearInterval(autoAdvance);\n for (var i = 0; i < 5; i++) {\n if ((photoOrder[i] - 1) === 0) {\n photoOrder[i] = 5;\n } else {\n photoOrder[i] -= 1;\n }\n populateFigures();\n }\n}", "function moveCarousel(direction) {\n\tif (direction == 'next') { // if next button was clicked\n\t\tif (currentImgIndex + 1 == leftArray.length) { // if moving forward will go past the length of carousel children\n\t\t\tcurrentImgIndex = -1; // set currentImgIndex to beginning of array and carousel children (-1 because 1 must be added in the next line)\n\t\t}\n\t\tcurrentImgIndex++; // increase currentImgIndex to go to the next image\n\t\tcarousel.css('left', leftArray[currentImgIndex]); // set 'left' to value to center proper image\n\t} else if (direction == 'prev') { // if prev button was clicked\n\t\tif (currentImgIndex - 1 < 0) { // if moving backward will index -1 (not an index)\n\t\t\tcurrentImgIndex = leftArray.length; // set currentImgIndex to end of array and carousel children\n\t\t}\n\t\tcurrentImgIndex--; // decrease currentImgIndex to got to previous image\n\t\tcarousel.css('left', leftArray[currentImgIndex]); // set 'left' to value to center proper image\n\t} else { // else, you fucked up\n\t\tconsole.error('Slider: moveCarousel() accepts \"next\" or \"prev\" parameters');\n\t}\n\n\tvar i = 0; // index to keep track of current carousel child loop is on\n\tcarousel.children().each(function() {\n\t\ti++; // increase index\n\t\tif (i == currentImgIndex + 1) { // if this child is the center image RN, make it opaque\n\t\t\t$(this).css('opacity', '1');\n\t\t} else { // all others are set to half opacitiy\n\t\t\t$(this).css('opacity', '.5');\n\t\t}\n\t});\n}", "initializeLeftArrow() {\n const leftArrowWrapper = document.createElement(\"div\");\n const leftArrow = document.createElement(\"div\");\n\n leftArrowWrapper.className += ` ${style.slider_arrow_wrapper}`;\n leftArrow.className += ` ${style.slider_arrow} ${style.slider_left_arrow}`;\n leftArrowWrapper.style.order = -2;\n leftArrowWrapper.appendChild(leftArrow);\n leftArrowWrapper.addEventListener(\"click\", () =>\n this.animateAllSlides(this.childrens, this.slideLeft.bind(this))\n );\n\n return leftArrowWrapper;\n }", "render(){\n return (\n <div>\n <Carousel moveArray={this.handleMoveArray} pictures={this.state.items} amount={this.state.amount}/>\n <button className=\"navigation previous\" onClick={() => this.handleMoveArray('left')}><ion-icon name=\"arrow-back\"></ion-icon></button>\n <button className=\"navigation next\" onClick={() => this.handleMoveArray('right')}><ion-icon name=\"arrow-forward\"></ion-icon></button>\n </div>\n );\n }", "function NextArrow(props) {\n const {currentSlide, slideCount, onClick, displayedSlides} = props;\n const showArrow = slideCount - currentSlide > displayedSlides;\n const opts = {\n className: classNames('js-carousel-nav', 'carousel-arrow', 'next', 'btn btn-secondary', {'active': showArrow}),\n onClick\n };\n\n if (!showArrow) {\n opts.disabled = 'disabled';\n }\n\n return (\n <button {...opts}>\n <span>Next </span>\n <span className=\"icon fa fa-chevron-right\" aria-hidden=\"true\"></span>\n <span className=\"sr\">{ 'Scroll carousel forwards' }</span>\n </button>\n );\n}", "function manageControls(position){\n // Hide left arrow if position is first slide\n if(position==0){ $('#left_arrow').hide() }\n else{ $('#left_arrow').show() }\n // Hide right arrow if position is last slide\n if(position==numberOfSlides-7){ $('#right_arrow').hide() }\n else{ $('#right_arrow').show() }\n }", "function carouselStartPos() {\n SELECTORS.$slideWrapper.css('left', STATE.OFFSET + 'px');\n }", "function updateArrows() {\n console.log(\"zz\");\n //Update the state of the lines right\n dq(\".slide-number-line.active\").classList.remove(\"active\");\n slidesNumberLines[activeSlide].classList.add(\"active\");\n\n //Update the state of the arrows\n if (activeSlide == 0) {\n leftArrow.classList.add(\"disabled\");\n } else if (activeSlide === nSlides - 1) {\n rightArrow.classList.add(\"disabled\");\n } else {\n leftArrow.classList.remove(\"disabled\");\n rightArrow.classList.remove(\"disabled\");\n }\n}", "function initCarousel3up() {\n var galleryPrev = '<a href=\"\" class=\"icon icon-arrow-left no-bg\"><span class=\"is-vishidden\">Previous</span><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 500 500\" enable-background=\"new 0 0 500 500\"><path d=\"M344.5 5.3l31.7 31.6L163.1 250l213.1 213.1-31.7 31.6L99.8 250z\"/></svg></a>';\n var galleryNext = '<a href=\"\" class=\"icon icon-arrow-right no-bg\"><span class=\"is-vishidden\">Next</span><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 500 500\" enable-background=\"new 0 0 500 500\"><path d=\"M153.5 5.3l-31.7 31.6L334.9 250 121.8 463.1l31.7 31.6L398.2 250z\"/></svg></a>';\n\n $carousel3up.show().owlCarousel({\n autoPlay: 4000,\n slideSpeed: 300,\n lazyLoad: true,\n paginationSpeed: 400,\n pagination: false,\n navigation: true,\n stopOnHover: true,\n navigationText: [galleryPrev, galleryNext],\n itemsCustom: [[0,2], [730,3], [800,2], [930,3]]\n });\n }", "function loadCarousel() {\n var carousel = document.getElementById(\"carousel\");\n var prev = document.getElementById(\"prev\");\n var next = document.getElementById(\"next\");\n var items = carousel.querySelectorAll('.content li');\n var counter = 0;\n var amount = items.length;\n var current = items[0];\n for (var i = 0; i < amount; ++i) {\n if (items[i].classList.contains('current')) {\n current = items[i];\n counter = i;\n break;\n }\n }\n function navigate(direction) {\n current && current.classList.remove('current');\n counter += direction;\n if (counter <= 0) {\n counter = 0;\n prev.disabled = true;\n } else {\n prev.disabled = false;\n }\n if (counter >= amount - 1) {\n counter = amount - 1;\n next.disabled = true;\n } else {\n next.disabled = false;\n }\n current = items[counter];\n if (current) {\n current.classList.add('current');\n selectedHistory = current.textContent;\n }\n }\n next.addEventListener('click', function(ev) {\n navigate(1);\n });\n prev.addEventListener('click', function(ev) {\n navigate(-1);\n });\n if (current) {\n current.classList.add('current');\n selectedHistory = current.textContent;\n }\n navigate(0);\n}", "function initCarouselType() {\n var group = $('.scenario_block_origin .generic_group').clone();\n group.insertBefore($('.message_bot_area .fixedsidebar-content .text_button_next'));\n // $('.message_bot_area .fixedsidebar-content').append(group);\n generic_element_select();\n createCarouselBox(group);\n addItemCarouselBox();\n initslide();\n slideCarousel();\n}", "function initCarousel() {\n \"use strict\";\n try {\n var slides,\n leftButton = '<button class=\"carouselLeft\" type=\"button\" aria-label=\"Previous slide\">&#x276c;</button>',\n rightButton = '<button class=\"carouselRight\" type=\"button\" aria-label=\"Next slide\">&#x276d;</button>',\n navDotContainer,\n navDots,\n i,\n j;\n\n for (i = 0; i < carousels.length; i += 1) {\n carousels[i].classList.add(\"active\");\n carousels[i].setAttribute(\"aria-live\", \"polite\");\n // Insert buttons and attach event handlers\n carousels[i].insertAdjacentHTML(\"afterbegin\", leftButton);\n carousels[i].insertAdjacentHTML(\"beforeend\", rightButton);\n carousels[i].querySelector(\".carouselLeft\").onclick = function() {\n jumpToSlide(this.parentElement, \"previous\");\n };\n carousels[i].querySelector(\".carouselRight\").onclick = function() {\n jumpToSlide(this.parentElement, \"next\");\n };\n // Set up slides with classes to control position\n slides = carousels[i].querySelectorAll(\".slide\");\n navDotContainer = '<p class=\"navDots\">';\n for (j = 0; j < slides.length; j += 1) {\n if (j === 0) {\n slides[j].className = \"slide selected\";\n slides[j].setAttribute(\"aria-hidden\", false);\n } else {\n slides[j].className = \"slide right\";\n slides[j].setAttribute(\"aria-hidden\", true);\n }\n slides[j].dataset.index = j;\n navDotContainer += '<button type=\"button\" value=\"' + j +'\" aria-label=\"Slide ' + (j+1) +'\"></button>';\n }\n navDotContainer += '</p>';\n carousels[i].insertAdjacentHTML(\"beforeend\", navDotContainer);\n carousels[i].querySelector(\".navDots button:first-child\").className = \"current\";\n navDots = carousels[i].querySelectorAll(\".navDots button\");\n for (j = 0; j < navDots.length; j += 1) {\n navDots[j].onclick = function() {\n jumpToSlide(this.parentElement.parentElement, this.value);\n };\n }\n }\n setCarouselHeight();\n window.addEventListener(\"resize\", setCarouselHeight);\n } catch (ex) {\n console.log(ex.name + \": \" + ex.message);\n }\n }", "function fNextPreviousButtons (rightArrowId, leftArrowId, aImages, aTitles, sectionImgsContainerId) {\n var ii = 0;\n /**-------------===========( Next Click Functions )===========-------------**/\n rightArrowId.click (function () {\n //console.log (\"rightArrowId:--------------\");\n leftArrowId.show ();\n ii++;\n nextPos = colRightWidth * ii;\n titolo.textContent = aTitles[ii];\n if (nextPos <= 0) {\n nextPos = 0;\n }\n if (ii >= (aImages.length - 1)) {\n ii = aImages.length - 1; //imgsCount - 1; //\n rightArrowId.hide ();\n //console.log (\"ij2b: \", ii);\n }\n fSlider (sectionImgsContainerId, -nextPos);\n\n /** Test position **/\n /*elemPosition = sectionImgsContainerId.position ();\n //console.log (\"elemPosition: \", elemPosition.left);*/\n });\n\n /**-------------===========( Previous Click Functions )===========-------------**/\n leftArrowId.bind (\"click\", function () {\n //console.log (\"leftArrowId:--------------\");\n rightArrowId.show ();\n ii--;\n //console.log (\"ij1: \", ii);\n prevPos = colRightWidth * ii;\n //console.log (\"prevPos: \", prevPos);\n //console.log (\"colRightWidth: \", colRightWidth);\n //console.log (\"aImages.length: \", aImages.length);\n titolo.textContent = aTitles[ii];\n if (prevPos <= 0) {\n prevPos = 0;\n }\n if (ii <= 0) {\n //console.log (\"ij1b: \", ii);\n j = 0;\n leftArrowId.hide ();\n }\n fSlider (sectionImgsContainerId, -prevPos);\n })\n }", "function moveSlide (carousel,currentSlide,targetSlide) {\n // first we need to find the position of the slide \n const position = targetSlide.style.left;\n //then we use translate X to shift the slide \n //need to move the slide to the left using translate X along the x-axis\n carousel.style.transform = `translateX(-${position})`;\n toggleActive (currentSlide,targetSlide);\n}", "function thumbArrows(){\n let thumbCont = document.querySelector('#thumbCont');\n let carousel = thumbCont.querySelector('#thumbCarousel');\n let leftarrow = thumbCont.querySelector('.thumb-left');\n let rightarrow = thumbCont.querySelector('.thumb-right');\n let thumbs = thumbCont.querySelector('.thumbProducts').children.length;\n let th = document.querySelector('.thumb');\n let thumbWidth = 0;\n th.addEventListener('load', function () {\n thumbWidth = th.offsetWidth;\n });\n let leftposition = 0;\n\n carousel.style.left = leftposition + 'px';\n leftarrow.addEventListener('click', previousThumb, false);\n rightarrow.addEventListener('click', nextThumb, false);\n\n var moveSlide = function (value) {\n leftposition += value * thumbWidth;\n carousel.style.left = leftposition + 'px';\n };\n\n function nextThumb(){\n if (leftposition > (thumbs-3) * -thumbWidth) {\n moveSlide(-1);\n } else {\n leftposition = 0;\n carousel.style.left = leftposition + 'px';\n }\n }\n\n function previousThumb(){\n if(leftposition !== 0) {\n moveSlide(1);\n } else if (leftposition === 0) {\n carousel.style.left = leftposition + 'px';\n } else {\n leftposition = (thumbs-1)* -thumbWidth;\n carousel.style.left = leftposition + 'px';\n }\n }\n }", "function createSlideArrows(section) {\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\n\n if (options.controlArrowColor !== '#fff') {\n css($(SLIDES_ARROW_NEXT_SEL, section), {\n 'border-color': 'transparent transparent transparent ' + options.controlArrowColor\n });\n css($(SLIDES_ARROW_PREV_SEL, section), {\n 'border-color': 'transparent ' + options.controlArrowColor + ' transparent transparent'\n });\n }\n\n if (!options.loopHorizontal) {\n hide($(SLIDES_ARROW_PREV_SEL, section));\n }\n }", "function resizeCarousel(carousel) {\n const parentWidth = $(carousel).width();\n const Btns = $(carousel).find(\".btn-prev , .btn-next\");\n Btns.hide();\n let inner = $(carousel).find(\".CustomCarousel-inner\");\n const items = $(inner).find(\".item\");\n let pad = $(carousel).attr(\"data-padding\");\n if (pad == NaN) pad = 0;\n\n $(items).hide();\n let widthCount = 0;\n let visibleItems = 0;\n if ($(carousel).hasClass(\"spaced\")) {\n spaced(carousel, parentWidth, items, pad);\n }\n let last;\n let i = 0;\n let maxHeight = 200;\n $(items).each(function () {\n if ($(this).height() > maxHeight) maxHeight = $(this).height();\n if (i++ > 0) $(this).css(\"padding-left\", pad + \"px\");\n else $(this).css(\"padding-left\", 0);\n $(this).removeClass(\"Last\");\n widthCount += $(this).outerWidth();\n if (widthCount < parentWidth) {\n visibleItems++;\n $(this).show();\n $(this).addClass(\"Visib\");\n last = $(this);\n } else $(this).removeClass(\"Visib\");\n });\n $(carousel).height(maxHeight + \"px\");\n if (last) last.addClass(\"Last\");\n if (items.length > visibleItems) {\n Btns.height($(carousel).height());\n Btns.show();\n }\n}", "function slideArrowHandler(){\n /*jshint validthis:true */\n var section = closest(this, SECTION_SEL);\n\n /*jshint validthis:true */\n if (hasClass(this, SLIDES_PREV)) {\n if(isScrollAllowed.m.left){\n moveSlideLeft(section);\n }\n } else {\n if(isScrollAllowed.m.right){\n moveSlideRight(section);\n }\n }\n }", "function slideArrowHandler(){\n /*jshint validthis:true */\n var section = closest(this, SECTION_SEL);\n\n /*jshint validthis:true */\n if (hasClass(this, SLIDES_PREV)) {\n if(isScrollAllowed.m.left){\n moveSlideLeft(section);\n }\n } else {\n if(isScrollAllowed.m.right){\n moveSlideRight(section);\n }\n }\n }", "function slideArrowHandler(){\n /*jshint validthis:true */\n var section = closest(this, SECTION_SEL);\n\n /*jshint validthis:true */\n if (hasClass(this, SLIDES_PREV)) {\n if(isScrollAllowed.m.left){\n moveSlideLeft(section);\n }\n } else {\n if(isScrollAllowed.m.right){\n moveSlideRight(section);\n }\n }\n }", "function createSlideArrows(section){\r\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\r\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\r\n\r\n if(options.controlArrowColor !== '#fff'){\r\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\r\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\r\n }\r\n\r\n if(!options.loopHorizontal){\r\n hide($(SLIDES_ARROW_PREV_SEL, section));\r\n }\r\n }", "function createSlideArrows(section){\r\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\r\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\r\n\r\n if(options.controlArrowColor !== '#fff'){\r\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\r\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\r\n }\r\n\r\n if(!options.loopHorizontal){\r\n hide($(SLIDES_ARROW_PREV_SEL, section));\r\n }\r\n }", "handleButtons( left )\r\n {\r\n if ( left >= 0 ){\r\n this.leftArrow.style.display = 'none';\r\n }else {\r\n this.leftArrow.style.display = 'block';\r\n }\r\n\r\n let width = this.contentScroll.getBoundingClientRect().right;\r\n let parentWidth = this.content.getBoundingClientRect().right;\r\n \r\n if ( width <= parentWidth ){\r\n this.rightArrow.style.display = 'none';\r\n }else {\r\n this.rightArrow.style.display = 'block';\r\n }\r\n }", "function next(){\n // If on last item go back to start, otherwise go to next item\n if ( currentItem + 1 >= carouselItems.length ){\n currentItem = 0;\n } else {\n currentItem++;\n }\n updateCarousel();\n }", "function createSlideArrows(section){\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\n\n if(options.controlArrowColor !== '#fff'){\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\n }\n\n if(!options.loopHorizontal){\n hide($(SLIDES_ARROW_PREV_SEL, section));\n }\n }", "function createSlideArrows(section){\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\n\n if(options.controlArrowColor !== '#fff'){\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\n }\n\n if(!options.loopHorizontal){\n hide($(SLIDES_ARROW_PREV_SEL, section));\n }\n }", "function createSlideArrows(section){\n var arrows = [createElementFromHTML('<div class=\"' + SLIDES_ARROW_PREV + '\"></div>'), createElementFromHTML('<div class=\"' + SLIDES_ARROW_NEXT + '\"></div>')];\n after($(SLIDES_WRAPPER_SEL, section)[0], arrows);\n\n if(options.controlArrowColor !== '#fff'){\n css($(SLIDES_ARROW_NEXT_SEL, section), {'border-color': 'transparent transparent transparent '+options.controlArrowColor});\n css($(SLIDES_ARROW_PREV_SEL, section), {'border-color': 'transparent '+ options.controlArrowColor + ' transparent transparent'});\n }\n\n if(!options.loopHorizontal){\n hide($(SLIDES_ARROW_PREV_SEL, section));\n }\n }", "moveForward(){\n const position = ReactDOM.findDOMNode(this.refs['PersonnelCarousel']).getBoundingClientRect();\n if((position.left - 800) * -1 > position.width - window.innerWidth) {\n this.setState({position: (position.width - window.innerWidth) * -1});\n } else {\n this.setState({position: this.state.position - 800});\n }\n }", "function slideLeft() {\n reset();\n sliderImages[current - 1].style.display = 'block'; // Show image when click left.\n current--; // Reduce dot.\n temporal[current].innerHTML = current + 1 + \"/\" + sliderImages.length; // Print number image is in current location.\n dots[current].classList.add(\"active\"); // Add class active (CSS) in current dot.\n}", "function directionalArrow(conditional){\r\n if(conditional) {\r\n numberOfSlide++;\r\n } else {\r\n numberOfSlide--;\r\n }\r\n hideSlide();\r\n}", "function slideArrowHandler(){\r\n /*jshint validthis:true */\r\n var section = closest(this, SECTION_SEL);\r\n\r\n /*jshint validthis:true */\r\n if (hasClass(this, SLIDES_PREV)) {\r\n if(isScrollAllowed.m.left){\r\n moveSlideLeft(section);\r\n }\r\n } else {\r\n if(isScrollAllowed.m.right){\r\n moveSlideRight(section);\r\n }\r\n }\r\n }", "function slideArrowHandler(){\r\n /*jshint validthis:true */\r\n var section = closest(this, SECTION_SEL);\r\n\r\n /*jshint validthis:true */\r\n if (hasClass(this, SLIDES_PREV)) {\r\n if(isScrollAllowed.m.left){\r\n moveSlideLeft(section);\r\n }\r\n } else {\r\n if(isScrollAllowed.m.right){\r\n moveSlideRight(section);\r\n }\r\n }\r\n }", "function prevArrow() {\r\n var immagini = $('.images img.active');\r\n immagini.removeClass('active');\r\n immagini.prev().addClass('active');\r\n if (immagini.hasClass('first')) {\r\n $('.images img.last').addClass('active');\r\n }\r\n var pallinoBlu = $('.nav i.active');\r\n pallinoBlu.removeClass('active');\r\n pallinoBlu.prev().addClass('active');\r\n if (pallinoBlu.hasClass('first')) {\r\n $('.nav i.last').addClass('active');\r\n }\r\n}", "function seven_prev_carousel()\n\t\t{\n\t\t\t if(100*length<option.width)\treturn false;\n\t\t\t var tb=parseInt(option.width/160);\n\t\t\t var temp=Math.abs(Math.ceil(parseInt(handle.find(\"#seven_hviewport\").css(\"left\"))/160));\n\t\t\t if(temp>=tb)\n\t\t\t {\n\t\t\t\t handle.find(\"#seven_hviewport\").animate({\n\t\t\t\t\t \"left\":-100*(temp-tb),\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t\t duration:200,\n\t\t\t\t\t easing:\"swing\"\n\t\t\t\t });\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t handle.find(\"#seven_hviewport\").animate({\n\t\t\t\t\t \"left\":\"0px\",\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t\t duration:200,\n\t\t\t\t\t easing:\"swing\"\n\t\t\t\t });\n\t\t\t}\t \n\t\t}", "function Slider(props) {\n const { classes } = props\n const [currentItem, setCurrentItem] = useState(0)\n const [items] = useState(props.items)\n\n const handleClick = nextItem => {\n\n const firstItem = 0\n const lastItem = items.length - 1\n const isLastItem = currentItem === lastItem\n const isFirstItem = currentItem === firstItem\n\n if (nextItem === 'foward') {\n setCurrentItem(isLastItem ? firstItem : currentItem + 1)\n\n return\n }\n\n setCurrentItem(isFirstItem ? lastItem : currentItem - 1)\n }\n\n const getActiveClass = index => {\n return index === currentItem ? classes.itemActive : ''\n }\n\n const getItemDescription = () => items[currentItem].title\n\n const renderItems = () => {\n\n return items.map((item, index) => (\n <div\n key={index}\n className={`${classes.itemWrapper} ${getActiveClass(index)}`}\n >\n <img src={item.src} alt='' className={classes.sliderImage} />\n <div className={classes.itemNameWrapper}>\n <Typography>{getItemDescription()}</Typography>\n </div>\n </div>\n ))\n }\n\n return (\n <div className={classes.carouselWrapper}>\n <span\n className={classes.carouselBackArrow}\n onClick={() => handleClick('back')}\n >\n <ArrowBackIosIcon />\n </span>\n {renderItems()}\n <span\n className={classes.carouselFowardArrow}\n onClick={() => handleClick('foward')}\n >\n <ArrowForwardIos />\n </span>\n </div>\n )\n}", "function previous() {\n clearInterval(interval);\n // don't move to the left if the current slide is already 0\n if (currentSlide !== 0) {\n const imageSlides = document.querySelector('.very-wide');\n // remove filled class from current slide\n navDots.item(currentSlide).firstChild.classList.remove('filled');\n currentSlide -= 1;\n imageSlides.style.transform = `translate(-${(currentSlide) * 100}vw)`;\n // add filled class to new current slide\n navDots.item(currentSlide).firstChild.classList.add('filled');\n }\n hideArrows();\n }", "onLeftArrowKeypress() {\n this.currentDirection === \"rtl\" ? this.next() : this.prev();\n }", "function slideLeft(){\r\n\t\treset();\r\n\t\tsliderImages[current - 1].style.display = 'block';\r\n\t\tcurrent--;\r\n\t}", "function mb_arrowClick(e) {\n var target = e.target;\n if (target == mb_leftArrow) {\n clearInterval(mb_imageSlideshowInterval);\n mb_hideImages();\n mb_removeDots();\n if (mb_counter == 1) {\n mb_counter = (mb_imageSlides.length - 1);\n mb_imageLoop();\n mb_imageSlideshowInterval = setInterval(mb_slideshow, 5000);\n } else {\n mb_counter--;\n mb_counter--;\n mb_imageLoop();\n mb_imageSlideshowInterval = setInterval(mb_slideshow, 5000);\n }\n } \n else if (target == mb_rightArrow) {\n clearInterval(mb_imageSlideshowInterval);\n mb_hideImages();\n mb_removeDots();\n if (mb_counter == mb_imageSlides.length) {\n mb_counter = 0;\n mb_imageLoop();\n mb_imageSlideshowInterval = setInterval(mb_slideshow, 5000);\n } else {\n mb_imageLoop();\n mb_imageSlideshowInterval = setInterval(mb_slideshow, 5000);\n }\n }\n}", "function manageControls(position){\r\n // Hide left arrow if position is first slide\r\n if(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() }\r\n // Hide right arrow if position is last slide\r\n if(position==numberOfSlides-1){ $('#rightControl').hide() } else{ $('#rightControl').show() }\r\n }", "function lastToTheBegin() {\n let lastSlider; // variable stores last slider\n if (curIndex === (quoteSlides.length - 1)) lastSlider = quoteSlides[0];\n else lastSlider = quoteSlides[curIndex + 1];\n\n // moving last slide to begin and removing the \"left: 0\" class of the container\n if (curIndex === 0) mySlider.insertBefore(lastSlider, quoteSlides[quoteSlides.length - 1]);\n else mySlider.insertBefore(lastSlider, quoteSlides[curIndex - 1]);\n mySlider.classList.remove('go-back');\n\n curButton--;\n if(curButton < 0){\n curButton = (myButtons.length - 1);\n myButtons[0].classList.remove('active-btn');\n myButtons[curButton].classList.add('active-btn');\n } else{\n myButtons[curButton + 1].classList.remove('active-btn');\n myButtons[curButton].classList.add('active-btn');\n }\n\n // decrement the current index \n curIndex--;\n if (curIndex < 0) {\n curIndex = 2;\n }\n}", "function moveToPrevSlide() {\n hideAllSlides(); // First, hide all slides. \n\n if (slidePosition === 0) { // if the user is in the first slide \n slidePosition = totalSlides - 1; // go to the last slide\n } else {\n slidePosition--; // otherwise, decrease the slide position (move to the previous one)\n }\n\n slides[slidePosition].classList.add(\"carousel-item-visible\"); // show the current slide position.\n}", "function addCarouselIndicator(parent_class, first_active) {\n $('.' + parent_class).append('<li data-slide-to=\"0\" data-target=\"#c-slide\"></li>');\n\n //re-set index for generic indicators\n $('.message_bot_area .generic_indicators li').each(function (index, value) {\n $(this).attr('data-slide-to', index);\n });\n //set active for first indicators and first generic_box\n var indicator = $('.message_bot_area .generic_indicators'),\n container = $('.message_bot_area .generic_container');\n indicator.find('li').removeClass('active');\n container.find('.generic_box').removeClass('active');\n if(first_active) {\n indicator.find('li:first-child').addClass('active');\n container.find('.generic_box:first-child').addClass('active');\n } else {\n indicator.find('li:last-child').addClass('active');\n container.find('.generic_box:last-child').addClass('active');\n }\n}", "function seven_next_carousel()\n\t\t{\n\t\t\t if(100*length<option.width)\t return false;\n\t\t\t var tb=parseInt(option.width/160);\n\t\t\t var temp=Math.abs(Math.ceil(parseInt(handle.find(\"#seven_hviewport\").css(\"left\"))/160));\n\t\t\t if(temp<(length-(tb*2)))\n\t\t\t {\n\t\t\t\t handle.find(\"#seven_hviewport\").animate({\n\t\t\t\t\t \"left\":-100*(temp+tb),\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t\t duration:400,\n\t\t\t\t\t easing:\"swing\"\n\t\t\t\t });\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t handle.find(\"#seven_hviewport\").animate({\n\t\t\t\t\t \"left\":-(handle.find(\"#seven_hviewport\").width()-option.width)+\"px\",\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t \n\t\t\t\t },\n\t\t\t\t {\n\t\t\t\t\t duration:400,\n\t\t\t\t\t easing:\"swing\"\n\t\t\t\t });\n\t\t\t }\n\t\t}", "initializeRightArrow() {\n const rightArrowWrapper = document.createElement(\"div\");\n const rightArrow = document.createElement(\"div\");\n\n rightArrowWrapper.className += ` ${style.slider_arrow_wrapper}`;\n rightArrow.className += ` ${style.slider_arrow} ${style.slider_right_arrow}`;\n rightArrowWrapper.style.order = 2;\n rightArrowWrapper.appendChild(rightArrow);\n rightArrowWrapper.addEventListener(\"click\", () =>\n this.animateAllSlides(this.childrens, this.slideRight.bind(this))\n );\n\n return rightArrowWrapper;\n }", "function init_appslide()\n {\n $('.join-us .carousel').carousel(\n {\n navigation: true,\n navigationText: [\n '<i class=\"fa fa-arrow-left\"></i>',\n '<i class=\"fa fa-arrow-right\"></i>'\n ],\n singleItem: true,\n autoPlay: true,\n pagination: false\n });\n }", "function manageControls(position){\n // Hide left arrow if position is first slide\n\tif(position==0){ j('#leftControl').hide() } else{ j('#leftControl').show() }\n\t// Hide right arrow if position is last slide\n if(position==numberOfSlides-1){ j('#rightControl').hide() } else{ j('#rightControl').show() }\n }", "function firstToTheEnd() {\n let firstSlider; // variable stores first slider\n if (curIndex === 0) firstSlider = quoteSlides[quoteSlides.length - 1];\n else firstSlider = quoteSlides[curIndex - 1];\n\n // moving first slide to the end and removing the \"left: -200%\" class of the container\n mySlider.appendChild(firstSlider);\n mySlider.classList.remove('go-forward');\n\n // increment the current index \n curIndex++;\n if (curIndex > (quoteSlides.length - 1)) curIndex = 0;\n\n // setting current button number due to current Index\n if(curIndex > 0){\n curButton = curIndex - 1;\n // if current button = 0 we have to go to the last element \n if(curButton > 0){ \n myButtons[curButton - 1].classList.remove('active-btn');\n myButtons[curButton].classList.add('active-btn');\n } else{\n myButtons[myButtons.length - 1].classList.remove('active-btn');\n myButtons[0].classList.add('active-btn');\n } \n } else{\n curButton = myButtons.length - 1;\n myButtons[curButton - 1].classList.remove('active-btn');\n myButtons[curButton].classList.add('active-btn');\n }\n}", "function createSlideArrows(section) {\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if (options.controlArrowColor != '#fff') {\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent ' + options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent ' + options.controlArrowColor + ' transparent transparent');\n }\n\n if (!options.loopHorizontal) {\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "slidePrev(object, slideView) {\n slideView.slidePrev(500);\n }", "carouselHandleNext(index, e) {\n\t\tthis.setState({carouselIndex : index});\n\t\t\n\t}", "_handleArrowClick(event) {\n const that = this,\n previousIndex = that._currentIndex;\n\n if (that.disabled) {\n return;\n }\n\n that.$.arrowLeft.contains(event.target) ? that.prev() : that.next();\n that._changeEvent(previousIndex, that._currentIndex);\n }", "function manageControls(position){\n // Hide left arrow if position is first slide\n\tif(position==0){ $('#leftControl').hide() } else{ $('#leftControl').show() }\n\t// Hide right arrow if position is last slide\n if(position==numberOfSlides-1){ $('#rightControl').hide() } else{ $('#rightControl').show() }\n }", "_handleLeft(){\n if(this._buttonIndex > 0){\n this._setIndex(this._buttonIndex - 1);\n }else{\n this._setIndex(this.buttons.length -1);\n }\n }", "function autoIncrementCarouselSlide() {\n if (!isCarouselPaused()) {\n const current = quoteContainer.querySelector('.is-active');\n const index = quotes.indexOf(current);\n transitionQuote(index + 1);\n }\n }", "function showCarouselSlide(carousel, slideIndex) {\n const slides = carousel.querySelectorAll('.iw-carousel__item');\n const indicators = carousel.querySelectorAll('.iw-carousel__indicators li');\n addClassAndRemoveInSiblings(slides[slideIndex], 'active');\n addClassAndRemoveInSiblings(indicators[slideIndex], 'active');\n}", "function slidePrev(){\n $(sliderList).animate({ left: \"+=\" + objectWidth }, animationTime, function(){\n if(activeObj == 0){\n activeObj = objectCount - 1;\n $(sliderList).css(\"left\", \"-\" + ((objectWidth * 2) + (objectWidth * activeObj)) + \"px\");\n }else{\n activeObj--;\n }\n });\n}", "function hideArrows() {\n // hide back arrow if on the first slide\n const leftArrow = document.querySelector('.arrow.left');\n if (currentSlide === 0) {\n leftArrow.classList.add('hidden');\n } else {\n leftArrow.classList.remove('hidden');\n }\n // hide next arrow if at the end of slideshow\n const rightArrow = document.querySelector('.arrow.right');\n if (currentSlide === numOfImages - 1) {\n rightArrow.classList.add('hidden');\n } else {\n rightArrow.classList.remove('hidden');\n }\n }", "function prevSlide() {\n position = $slider.find(\".show\").index() - 1;\n if (position < 0) position = size - 1;\n changeCarousel(position);\n }", "function createSlideArrows(section){\r\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\r\n\r\n if(options.controlArrowColor!='#fff'){\r\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\r\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\r\n }\r\n\r\n if(!options.loopHorizontal){\r\n section.find(SLIDES_ARROW_PREV_SEL).hide();\r\n }\r\n }", "function createSlideArrows(section){\r\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\r\n\r\n if(options.controlArrowColor!='#fff'){\r\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\r\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\r\n }\r\n\r\n if(!options.loopHorizontal){\r\n section.find(SLIDES_ARROW_PREV_SEL).hide();\r\n }\r\n }", "function createSlideArrows(section){\r\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\r\n\r\n if(options.controlArrowColor!='#fff'){\r\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\r\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\r\n }\r\n\r\n if(!options.loopHorizontal){\r\n section.find(SLIDES_ARROW_PREV_SEL).hide();\r\n }\r\n }", "function show_carousel(){\n\n var carousel_content = \"<div id='carousel' class='carousel slide'>\";\n carousel_content += \"<ol class='carousel-indicators'>\";\n for(var i = 0; i < eatery_marker_list.length; i++){\n carousel_content += \"<li data-target='#carousel' data-slide-to='\" + i + \"'\" + ((i==0)?\" class='active'\":\"\") + \"></li>\";\n }\n carousel_content += \"</ol><div class='carousel-inner'>\";\n for(var i = 0; i < eatery_marker_list.length; i++){\n var m = eatery_marker_list[i];\n carousel_content += \"<div class='item\" + ((i==0)?\" active\":\"\") + \"'>\";\n carousel_content += \"<div class='row'><center><h2>\" + m.name + \"</h2>\";\n carousel_content += m.street + \"<br>\" + ((m.street_2==\"\")?\"\":m.street_2);\n carousel_content += m.city + \", \" + m.state + \" \" + m.zipcode + \"<br>\";\n carousel_content += \"<font size='3'>\" + m.food_info + \"</font>\" + \"<br>\";\n carousel_content += ((m.website==\"\")?\"\":\"<a href='\" + m.website + \"' target='_blank'>\" + m.website + \"</a>\")\n carousel_content += \"</center></div></div>\";\n }\n carousel_content += \"</div>\";\n\n carousel_content += \"<div id='carousel_arrows' class='row'>\" +\n \"<div class='col-md-4'></div><div class='col-md-2'><a class='left' href='#carousel' data-slide='prev'>\" +\n \"<span class='glyphicon glyphicon-chevron-left'></span></a></div>\";\n carousel_content += \"<div class='col-md-2'><a class='right' href='#carousel' data-slide='next'>\" + \n \"<span class='glyphicon glyphicon-chevron-right'></span></a></div><div class='col-md-4'></div>\";\n\n carousel_content += \"</div></div><br><div id='carousel_text_link'><a href='javascript:show_list();' class='text-center'>View List</a>\";\n document.getElementById(\"list_overlay\").innerHTML = carousel_content;\n document.getElementById(\"list_overlay\").style.display = \"inherit\";\n $('.carousel').carousel({\n interval: false\n })\n}", "function slideShowNext() {\n slideShow((curIndex !== slides.length - 1) ? curIndex + 1 : 0, 'left');\n }", "function leftArrow()\n {\n canvasObjs[1] = new CanvasObject(MID_CANVAS - 125, 200, 50, 50);\n canvasObjs[1].clickCallback = function()\n {\n if (Game.bet - Game.betIncrement >= 0)\n {\n Game.bet -= Game.betIncrement;\n }\n\n if (Game.RGBTitleScreen.mobile) canvasObjs[1].isHovered = false;\n }\n canvasObjs[1].hoverCallback = function()\n {\n drawLeftArrow('#FFF', MID_CANVAS - 125, 200);\n }\n }", "function displayLeftArrow() {\n if(page == 0) {\n document.getElementById('leftArrow').setAttribute('style', 'opacity: 0; cursor: default; pointer-events: none;');\n } else {\n document.getElementById('leftArrow').setAttribute('style', 'opacity: 1; cursor: pointer; pointer-events: auto;');\n }\n }", "function createSlideArrows(section){\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if(options.controlArrowColor!='#fff'){\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\n }\n\n if(!options.loopHorizontal){\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "function createSlideArrows(section){\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if(options.controlArrowColor!='#fff'){\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\n }\n\n if(!options.loopHorizontal){\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "function createSlideArrows(section){\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if(options.controlArrowColor!='#fff'){\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\n }\n\n if(!options.loopHorizontal){\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "function createSlideArrows(section){\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if(options.controlArrowColor!='#fff'){\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\n }\n\n if(!options.loopHorizontal){\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "function createSlideArrows(section){\n section.find(SLIDES_WRAPPER_SEL).after('<div class=\"' + SLIDES_ARROW_PREV + '\"></div><div class=\"' + SLIDES_ARROW_NEXT + '\"></div>');\n\n if(options.controlArrowColor!='#fff'){\n section.find(SLIDES_ARROW_NEXT_SEL).css('border-color', 'transparent transparent transparent '+options.controlArrowColor);\n section.find(SLIDES_ARROW_PREV_SEL).css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');\n }\n\n if(!options.loopHorizontal){\n section.find(SLIDES_ARROW_PREV_SEL).hide();\n }\n }", "previous(arrayMedias) {\n $('.left-arrow-carousel').on('click', () => {\n this.currentIndex -= 1;\n if (this.currentIndex < 0) {\n this.currentIndex = arrayMedias.length - 1;\n }\n let previousMedia = getMedia(arrayMedias[this.currentIndex])\n $('#carousel-media').html(previousMedia);\n })\n }", "activeNextSlider(){\n if(this.index.next !== undefined){\n this.changeSlide(this.index.next)\n }\n }", "function onLoad() {\n carousel = new Carousel();\n carousel.centerSelected();\n}" ]
[ "0.6882294", "0.6827787", "0.67363364", "0.6665643", "0.6549694", "0.6548015", "0.65184164", "0.65014553", "0.64959544", "0.6490066", "0.6479246", "0.6466931", "0.64633083", "0.64388466", "0.64321345", "0.63685733", "0.63685733", "0.6358446", "0.6349347", "0.6349347", "0.6319655", "0.62971663", "0.6296328", "0.6296328", "0.6296328", "0.628821", "0.624765", "0.6223017", "0.6212633", "0.6194725", "0.6133075", "0.6123239", "0.6122789", "0.6117438", "0.6115879", "0.61112076", "0.60792685", "0.60775906", "0.6074009", "0.60725284", "0.6062495", "0.6060071", "0.6041456", "0.60402805", "0.60402805", "0.60402805", "0.603986", "0.603986", "0.60339344", "0.6032711", "0.601375", "0.601375", "0.601375", "0.5991795", "0.597295", "0.59662896", "0.5965502", "0.5965502", "0.5963348", "0.5957323", "0.59486175", "0.5945098", "0.59218997", "0.5908065", "0.58888286", "0.5883664", "0.5883053", "0.5872495", "0.58659464", "0.5857985", "0.58496743", "0.5849383", "0.58425254", "0.58318824", "0.5819781", "0.5817095", "0.58109677", "0.58085555", "0.58054024", "0.5801656", "0.5795674", "0.57868856", "0.57812464", "0.578123", "0.57809377", "0.57798874", "0.57798874", "0.57798874", "0.5773095", "0.57730514", "0.57722735", "0.57609475", "0.5758293", "0.5758293", "0.5758293", "0.5758293", "0.5758293", "0.57569647", "0.57445043", "0.5743208" ]
0.7947538
0